1var Uh=Object.defineProperty;var po=e=>{throw TypeError(e)};var Yh=(e,t,i)=>t in e?Uh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var x=(e,t,i)=>Yh(e,typeof t!="symbol"?t+"":t,i),wn=(e,t,i)=>t.has(e)||po("Cannot "+i);var M=(e,t,i)=>(wn(e,t,"read from private field"),i?i.call(e):t.get(e)),L=(e,t,i)=>t.has(e)?po("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),B=(e,t,i,s)=>(wn(e,t,"write to private field"),s?s.call(e,i):t.set(e,i),i),T=(e,t,i)=>(wn(e,t,"access private method"),i);import{A as Kh,d as Xh}from"./stimulus-DBqx-Wos.js";/*! 2Turbo 8.0.13 3Copyright © 2025 37signals LLC 4 */(function(e){if(typeof e.requestSubmit=="function")return;e.requestSubmit=function(s){s?(t(s,this),s.click()):(s=document.createElement("input"),s.type="submit",s.hidden=!0,this.appendChild(s),s.click(),this.removeChild(s))};function t(s,n){s instanceof HTMLElement||i(TypeError,"parameter 1 is not of type 'HTMLElement'"),s.type=="submit"||i(TypeError,"The specified element is not a submit button"),s.form==n||i(DOMException,"The specified element is not owned by this form element","NotFoundError")}function i(s,n,r){throw new s("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+n+".",r)}})(HTMLFormElement.prototype);const Xa=new WeakMap;function Gh(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null,i=t?t.closest("input, button"):null;return(i==null?void 0:i.type)=="submit"?i:null}function Zh(e){const t=Gh(e.target);t&&t.form&&Xa.set(t.form,t)}(function(){if("submitter"in Event.prototype)return;let e=window.Event.prototype;if("SubmitEvent"in window){const t=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in t))e=t;else return}addEventListener("click",Zh,!0),Object.defineProperty(e,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return Xa.get(this.target)}})})();const ue={eager:"eager",lazy:"lazy"},tn=class tn extends HTMLElement{constructor(){super();x(this,"loaded",Promise.resolve());this.delegate=new tn.delegateConstructor(this)}static get observedAttributes(){return["disabled","loading","src"]}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(i){i=="loading"?this.delegate.loadingStyleChanged():i=="src"?this.delegate.sourceURLChanged():i=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(i){i?this.setAttribute("src",i):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(i){i?this.setAttribute("refresh",i):this.removeAttribute("refresh")}get shouldReloadWithMorph(){return this.src&&this.refresh==="morph"}get loading(){return Jh(this.getAttribute("loading")||"")}
4set loading(i){i?this.setAttribute("loading",i):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(i){i?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(i){i?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){var i,s;return(s=(i=this.ownerDocument)==null?void 0:i.documentElement)==null?void 0:s.hasAttribute("data-turbo-preview")}};x(tn,"delegateConstructor");let mt=tn;function Jh(e){switch(e.toLowerCase()){case"lazy":return ue.lazy;default:return ue.eager}}const Qh={enabled:!0,progressBarDelay:500,unvisitableExtensions:new Set([".7z",".aac",".apk",".avi",".bmp",".bz2",".css",".csv",".deb",".dmg",".doc",".docx",".exe",".gif",".gz",".heic",".heif",".ico",".iso",".jpeg",".jpg",".js",".json",".m4a",".mkv",".mov",".mp3",".mp4",".mpeg",".mpg",".msi",".ogg",".ogv",".pdf",".pkg",".png",".ppt",".pptx",".rar",".rtf",".svg",".tar",".tif",".tiff",".txt",".wav",".webm",".webp",".wma",".wmv",".xls",".xlsx",".xml",".zip"])};function Li(e){if(e.getAttribute("data-turbo-eval")=="false")return e;{const t=document.createElement("script"),i=el();return i&&(t.nonce=i),t.textContent=e.textContent,t.async=!1,tu(t,e),t}}function tu(e,t){for(const{name:i,value:s}of t.attributes)e.setAttribute(i,s)}function eu(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function W(e,{target:t,cancelable:i,detail:s}={}){const n=new CustomEvent(e,{cancelable:i,bubbles:!0,composed:!0,detail:s});return t&&t.isConnected?t.dispatchEvent(n):document.documentElement.dispatchEvent(n),n}function go(e){e.preventDefault(),e.stopImmediatePropagation()}function wi(){return document.visibilityState==="hidden"?Za():Ga()}function Ga(){return new Promise(e=>requestAnimationFrame(()=>e()))}function Za(){return new Promise(e=>setTimeout(()=>e(),0))}function iu(){return Promise.resolve()}function Ja(e=""){return new DOMParser().parseFromString(e,"text/html")}function Qa(e,...t){const i=su(e,t).replace(/^\n/,"").split(` 5`),s=i[0].match(/^\s+/),n=s?s[0].length:0;return i.map(r=>r.slice(n)).join(` 6`)}function su(e,t){return e.reduce((i,s,n)=>{const r=t[n]==null?"":t[n];return i+s+r},"")}function Jt(){return Array.from({length:36}).map((e,t)=>t==8||t==13||t==18||t==23?"-":t==14?"4":t==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function Bs(e,...t){for(const i of t.map(s=>s==null?void 0:s.getAttribute(e)))if(typeof i=="string")return i;return null}function nu(e,...t){return t.some(i=>i&&i.hasAttribute(e))}function Hs(...e){for(const t of e)t.localName=="turbo-frame"&&t.setAttribute("busy",""),t.setAttribute("aria-busy","true")}function Ns(...e){for(const t of e)t.localName=="turbo-frame"&&t.removeAttribute("busy"),t.removeAttribute("aria-busy")}function ru(e,t=2e3){return new Promise(i=>{const s=()=>{e.removeEventListener("error",s),e.removeEventListener("load",s),i()};e.addEventListener("load",s,{once:!0}),e.addEventListener("error",s,{once:!0}),setTimeout(i,t)})}function tl(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function ou(e){return e=="advance"||e=="replace"||e=="restore"}function me(...e){const t=Bs("data-turbo-action",...e);return ou(t)?t:null}function _r(e){return document.querySelector(`meta[name="${e}"]`)}function zs(e){const t=_r(e);return t&&t.content}function el(){const e=_r("csp-nonce");if(e){const{nonce:t,content:i}=e;return t==""?i:t}}function au(e,t){let i=_r(e);return i||(i=document.createElement("meta"),i.setAttribute("name",e),document.head.appendChild(i)),i.setAttribute("content",t),i}function Fe(e,t){var i;if(e instanceof Element)return e.closest(t)||Fe(e.assignedSlot||((i=e.getRootNode())==null?void 0:i.host),t)}function wr(e){return!!e&&e.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof e.focus=="function"}function il(e){return Array.from(e.querySelectorAll("[autofocus]")).find(wr)}async function lu(e,t){const i=t();e(),await Ga();const s=t();return[i,s]}function sl(e){if(e==="_blank")return!1;if(e){for(const t of document.getElementsByName(e))if(t instanceof HTMLIFrameElement)return!1;return!0}else return!0}function nl(e){return Fe(e,"a[href]:not([target^=_]):not([download])")}function rl(e){return tt(e.getAttribute("href")||"")}function cu(e,t){let i=null;return(...s)=>{const n=()=>e.apply(this,s);clearTimeout(i),i=setTimeout(n,t)}}const hu={"aria-disabled":{beforeSubmit:e=>{e.setAttribute("aria-disabled","true"),e.addEventListener("click",go)},afterSubmit:e=>{e.removeAttribute("aria-disabled"),e.removeEventListener("click",go)}},disabled:{beforeSubmit:e=>e.disabled=!0,afterSubmit:e=>e.disabled=!1}};var Bi,Ka;let uu=(Ka=class{constructor(t){L(this,Bi,null);Object.assign(this,t)}get submitter(){return M(this,Bi)}set submitter(t){B(this,Bi,hu[t]||t)}},Bi=new WeakMap,Ka);const du=new uu({mode:"on",submitter:"disabled"}),J={drive:Qh,forms:du};function tt(e){return new URL(e.toString(),document.baseURI)}function be(e){let t;if(e.hash)return e.hash.slice(1);if(t=e.href.match(/#(.*)$/))return t[1]}function xr(e,t){const i=(t==null?void 0:t.getAttribute("formaction"))||e.getAttribute("action")||e.action;return tt(i)}function fu(e){return(bu(e).match(/\.[^.]*$/)||[])[0]||""}function pu(e,t){const i=yu(t);return e.href===tt(i).href||e.href.startsWith(i)}function qt(e,t){return pu(e,t)&&!J.drive.unvisitableExtensions.has(fu(e))}function qn(e){const t=be(e);return t!=null?e.href.slice(0,-(t.length+1)):e.href}function es(e){return qn(e)}function gu(e,t){return tt(e).href==tt(t).href}function mu(e){return e.pathname.split("/").slice(1)}function bu(e){return mu(e).slice(-1)[0]}function yu(e){return vu(e.origin+e.pathname)}function vu(e){return e.endsWith("/")?e:e+"/"}class nn{constructor(t){this.response=t}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return tt(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(t){return this.response.headers.get(t)}}class _u extends Set{constructor(t){super(),this.maxSize=t}add(t){if(this.size>=this.maxSize){const s=this.values().next().value;this.delete(s)}super.add(t)}}const ol=new _u(20),wu=window.fetch;function Sr(e,t={}){const i=new Headers(t.headers||{}),s=Jt();return ol.add(s),i.append("X-Turbo-Request-Id",s),wu(e,{...t,headers:i})}function rn(e){switch(e.toLowerCase()){case"get":return ut.get;case"post":return ut.post;case"put":return ut.put;case"patch":return ut.patch;case"delete":return ut.delete}}const ut={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function al(e){switch(e.toLowerCase()){case $t.multipart:return $t.multipart;case $t.plain:return $t.plain;default:return $t.urlEncoded}}const $t={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"};var Hi,Ue,ll,cl;class Xe{constructor(t,i,s,n=new URLSearchParams,r=null,o=$t.urlEncoded){L(this,Ue);x(this,"abortController",new AbortController);L(this,Hi,t=>{});var c;const[a,l]=mo(tt(s),i,n,o);this.delegate=t,this.url=a,this.target=r,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:i.toUpperCase(),headers:{...this.defaultHeaders}
6,body:l,signal:this.abortSignal,referrer:(c=this.delegate.referrer)==null?void 0:c.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(t){const i=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,s=rn(t)||ut.get;this.url.search="";const[n,r]=mo(this.url,s,i,this.enctype);this.url=n,this.fetchOptions.body=r,this.fetchOptions.method=s.toUpperCase()}get headers(){return this.fetchOptions.headers}set headers(t){this.fetchOptions.headers=t}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(t){this.fetchOptions.body=t}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){const{fetchOptions:t}=this;this.delegate.prepareRequest(this);const i=await T(this,Ue,ll).call(this,t);try{this.delegate.requestStarted(this),i.detail.fetchRequest?this.response=i.detail.fetchRequest.response:this.response=Sr(this.url.href,t);const s=await this.response;return await this.receive(s)}catch(s){if(s.name!=="AbortError")throw T(this,Ue,cl).call(this,s)&&this.delegate.requestErrored(this,s),s}finally{this.delegate.requestFinished(this)}}async receive(t){const i=new nn(t);return W("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:i},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,i):i.succeeded?this.delegate.requestSucceededWithResponse(this,i):this.delegate.requestFailedWithResponse(this,i),i}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return on(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(t){this.headers.Accept=[t,this.headers.Accept].join(", ")}}Hi=new WeakMap,Ue=new WeakSet,ll=async function(t){const i=new Promise(n=>B(this,Hi,n)),s=W("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:t,url:this.url,resume:M(this,Hi)},target:this.target});return this.url=s.detail.url,s.defaultPrevented&&await i,s},cl=function(t){return!W("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:t}}).defaultPrevented};function on(e){return rn(e)==ut.get}function mo(e,t,i,s){const n=Array.from(i).length>0?new URLSearchParams(hl(i)):e.searchParams;return on(t)?[xu(e,n),null]:s==$t.urlEncoded?[e,n]:[e,i]}function hl(e){const t=[];for(const[i,s]of e)s instanceof File||t.push([i,s]);return t}function xu(e,t){const i=new URLSearchParams(hl(t));return e.search=i.toString(),e}class Su{constructor(t,i){x(this,"started",!1);x(this,"intersect",t=>{const i=t.slice(-1)[0];i!=null&&i.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)});this.delegate=t,this.element=i,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}}class Ae{static wrap(t){return typeof t=="string"?new this(eu(t)):t}constructor(t){this.fragment=Eu(t)}}x(Ae,"contentType","text/vnd.turbo-stream.html");function Eu(e){for(const t of e.querySelectorAll("turbo-stream")){const i=document.importNode(t,!0);for(const s of i.templateElement.content.querySelectorAll("script"))s.replaceWith(Li(s));t.replaceWith(i)}return e}const Au=100;var pe,Dt;class ku{constructor(){L(this,pe,null);L(this,Dt,null)}get(t){if(M(this,Dt)&&M(this,Dt).url===t&&M(this,Dt).expire>Date.now())return M(this,Dt).request}setLater(t,i,s){this.clear(),B(this,pe,setTimeout(()=>{i.perform(),this.set(t,i,s),B(this,pe,null)},Au))}set(t,i,s){B(this,Dt,{url:t,request:i,expire:new Date(new Date().getTime()+s)})}clear(){M(this,pe)&&clearTimeout(M(this,pe)),B(this,Dt,null)}}pe=new WeakMap,Dt=new WeakMap;const Mu=10*1e3,Oe=new ku,Te={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"};class an{constructor(t,i,s,n=!1){x(this,"state",Te.initialized);const r=Iu(i,s),o=Lu(Cu(i,s),r),a=Pu(i,s),l=Ou(i,s);this.delegate=t,this.formElement=i,this.submitter=s,this.fetchRequest=new Xe(this,r,o,a,i,l),this.mustRedirect=n}static confirmMethod(t){return Promise.resolve(confirm(t))}get method(){return this.fetchRequest.method}set method(t){this.fetchRequest.method=t}get action(){return this.fetchRequest.url.toString()}set action(t){this.fetchRequest.url=tt(t)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){const{initialized:t,requesting:i}=Te,s=Bs("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof s=="string"&&!await(typeof J.forms.confirm=="function"?J.forms.confirm:an.confirmMethod)(s,this.formElement,this.submitter))&&this.state==t)return this.state=i,this.fetchRequest.perform()}stop(){const{stopping:t,stopped:i}=Te;if(this.state!=t&&this.state!=i)return this.state=t,this.fetchRequest.cancel(),!0}prepareRequest(t){if(!t.isSafe){const i=Tu(zs("csrf-param"))||zs("csrf-token");i&&(t.headers["X-CSRF-Token"]=i)}this.requestAcceptsTurboStreamResponse(t)&&t.acceptResponseType(Ae.contentType)}requestStarted(t){this.state=Te.waiting,this.submitter&&J.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),Hs(this.formElement),W("turbo:submit-start",{target:this.formElement,detail
6:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(t,i){Oe.clear(),this.result={success:i.succeeded,fetchResponse:i}}requestSucceededWithResponse(t,i){if(i.clientError||i.serverError){this.delegate.formSubmissionFailedWithResponse(this,i);return}if(Oe.clear(),this.requestMustRedirect(t)&&Ru(i)){const s=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,s)}else this.state=Te.receiving,this.result={success:!0,fetchResponse:i},this.delegate.formSubmissionSucceededWithResponse(this,i)}requestFailedWithResponse(t,i){this.result={success:!1,fetchResponse:i},this.delegate.formSubmissionFailedWithResponse(this,i)}requestErrored(t,i){this.result={success:!1,error:i},this.delegate.formSubmissionErrored(this,i)}requestFinished(t){this.state=Te.stopped,this.submitter&&J.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),Ns(this.formElement),W("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){const t=this.submitter;this.originalSubmitText=t.value,t.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){const t=this.submitter;t.value=this.originalSubmitText}}}requestMustRedirect(t){return!t.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(t){return!t.isSafe||nu("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){var t;return(t=this.submitter)==null?void 0:t.getAttribute("data-turbo-submits-with")}}function Pu(e,t){const i=new FormData(e),s=t==null?void 0:t.getAttribute("name"),n=t==null?void 0:t.getAttribute("value");return s&&i.append(s,n||""),i}function Tu(e){if(e!=null){const i=(document.cookie?document.cookie.split("; "):[]).find(s=>s.startsWith(e));if(i){const s=i.split("=").slice(1).join("=");return s?decodeURIComponent(s):void 0}}}function Ru(e){return e.statusCode==200&&!e.redirected}function Cu(e,t){const i=typeof e.action=="string"?e.action:null;return t!=null&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||i||""}function Lu(e,t){const i=tt(e);return on(t)&&(i.search=""),i}function Iu(e,t){const i=(t==null?void 0:t.getAttribute("formmethod"))||e.getAttribute("method")||"";return rn(i.toLowerCase())||ut.get}function Ou(e,t){return al((t==null?void 0:t.getAttribute("formenctype"))||e.enctype)}class ln{constructor(t){this.element=t}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(t){return this.getElementForAnchor(t)!=null}getElementForAnchor(t){return t?this.element.querySelector(`[id='${t}'], a[name='${t}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return il(this.element)}get permanentElements(){return dl(this.element)}getPermanentElementById(t){return ul(this.element,t)}getPermanentElementMapForSnapshot(t){const i={};for(const s of this.permanentElements){const{id:n}=s,r=t.getPermanentElementById(n);r&&(i[n]=[s,r])}return i}}function ul(e,t){return e.querySelector(`#${t}[data-turbo-permanent]`)}function dl(e){return e.querySelectorAll("[id][data-turbo-permanent]")}class Er{constructor(t,i){x(this,"started",!1);x(this,"submitCaptured",()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)});x(this,"submitBubbled",t=>{if(!t.defaultPrevented){const i=t.target instanceof HTMLFormElement?t.target:void 0,s=t.submitter||void 0;i&&Fu(i,s)&&Du(i,s)&&this.delegate.willSubmitForm(i,s)&&(t.preventDefault(),t.stopImmediatePropagation(),this.delegate.formSubmitted(i,s))}});this.delegate=t,this.eventTarget=i}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}}function Fu(e,t){return((t==null?void 0:t.getAttribute("formmethod"))||e.getAttribute("method"))!="dialog"}function Du(e,t){const i=(t==null?void 0:t.getAttribute("formtarget"))||e.getAttribute("target");return sl(i)}var Ni,zi;class fl{constructor(t,i){L(this,Ni,t=>{});L(this,zi,t=>{});this.delegate=t,this.element=i}scrollToAnchor(t){const i=this.snapshot.getElementForAnchor(t);i?(this.scrollToElement(i),this.focusElement(i)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(t){this.scrollToAnchor(be(t))}scrollToElement(t){t.scrollIntoView()}focusElement(t){t instanceof HTMLElement&&(t.hasAttribute("tabindex")?t.focus():(t.setAttribute("tabindex","-1"),t.focu
6s(),t.removeAttribute("tabindex")))}scrollToPosition({x:t,y:i}){this.scrollRoot.scrollTo(t,i)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(t){const{isPreview:i,shouldRender:s,willRender:n,newSnapshot:r}=t,o=n;if(s)try{this.renderPromise=new Promise(h=>B(this,Ni,h)),this.renderer=t,await this.prepareToRenderSnapshot(t);const a=new Promise(h=>B(this,zi,h)),l={resume:M(this,zi),render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(r,l)||await a,await this.renderSnapshot(t),this.delegate.viewRenderedSnapshot(r,i,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(t)}finally{delete this.renderer,M(this,Ni).call(this,void 0),delete this.renderPromise}else o&&this.invalidate(t.reloadReason)}invalidate(t){this.delegate.viewInvalidated(t)}async prepareToRenderSnapshot(t){this.markAsPreview(t.isPreview),await t.prepareToRender()}markAsPreview(t){t?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(t){this.element.setAttribute("data-turbo-visit-direction",t)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(t){await t.render()}finishRenderingSnapshot(t){t.finishRendering()}}Ni=new WeakMap,zi=new WeakMap;class Bu extends fl{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new ln(this.element)}}class pl{constructor(t,i){x(this,"clickBubbled",t=>{this.clickEventIsSignificant(t)?this.clickEvent=t:delete this.clickEvent});x(this,"linkClicked",t=>{this.clickEvent&&this.clickEventIsSignificant(t)&&this.delegate.shouldInterceptLinkClick(t.target,t.detail.url,t.detail.originalEvent)&&(this.clickEvent.preventDefault(),t.preventDefault(),this.delegate.linkClickIntercepted(t.target,t.detail.url,t.detail.originalEvent)),delete this.clickEvent});x(this,"willVisit",t=>{delete this.clickEvent});this.delegate=t,this.element=i}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickEventIsSignificant(t){var n;const i=t.composed?(n=t.target)==null?void 0:n.parentElement:t.target,s=nl(i)||i;return s instanceof Element&&s.closest("turbo-frame, html")==this.element}}class gl{constructor(t,i){x(this,"started",!1);x(this,"clickCaptured",()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)});x(this,"clickBubbled",t=>{if(t instanceof MouseEvent&&this.clickEventIsSignificant(t)){const i=t.composedPath&&t.composedPath()[0]||t.target,s=nl(i);if(s&&sl(s.target)){const n=rl(s);this.delegate.willFollowLinkToLocation(s,n,t)&&(t.preventDefault(),this.delegate.followedLinkToLocation(s,n))}}});this.delegate=t,this.eventTarget=i}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickEventIsSignificant(t){return!(t.target&&t.target.isContentEditable||t.defaultPrevented||t.which>1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)}}class ml{constructor(t,i){this.delegate=t,this.linkInterceptor=new gl(this,i)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(t,i){return!1}prefetchAndCacheRequestToLocation(t,i){}willFollowLinkToLocation(t,i,s){return this.delegate.willSubmitFormLinkToLocation(t,i,s)&&(t.hasAttribute("data-turbo-method")||t.hasAttribute("data-turbo-stream"))}followedLinkToLocation(t,i){const s=document.createElement("form"),n="hidden";for(const[u,d]of i.searchParams)s.append(Object.assign(document.createElement("input"),{type:n,name:u,value:d}));const r=Object.assign(i,{search:""});s.setAttribute("data-turbo","true"),s.setAttribute("action",r.href),s.setAttribute("hidden","");const o=t.getAttribute("data-turbo-method");o&&s.setAttribute("method",o);const a=t.getAttribute("data-turbo-frame");a&&s.setAttribute("data-turbo-frame",a);const l=me(t);l&&s.setAttribute("data-turbo-action",l);const c=t.getAttribute("data-turbo-confirm");c&&s.setAttribute("data-turbo-confirm",c),t.hasAttribute("data-turbo-stream")&&s.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(t,i,s),document.body.appendChild(s),s.addEventListener("turbo:submit-end",()=>s.remove(),{once:!0}),requestAnimationFrame(()=>s.requestSubmit())}}class bl{static async preservingPermanentElements(t,i,s){const n=new this(t,i);n.enter(),await s(),n.leave()}constructor(t,i){this.delegate=t,this.permanentElementMap=i}enter(){for(const t in this.permanentElementMap){const[i,s]=this.permanentElementMap[t];this.delegate.enteringBardo(i,s),this.replaceNewPermanentElementWithPlaceholder(s)}}leave(){for(const t in this.permanentElementMap){const[i]=this.permanentElementMap[t];this.replaceCurrentPermanentElementWithClone(i),this.replacePlaceholderWithPermanentElement(i),this.delegate.leavingBardo(i)}}replaceNewPermanentElementWithPlaceholder(t){const i=Hu(t);t.replaceWith(i)}replaceCurrentPermanentElementWithClone(t){const i=t.cloneNode(!0);t.replaceWith(i)}replacePlaceholderWithPermanentElement(t){const i=this.getPlaceholderById(t.id);i==null||i.replaceWith(t)}getPlaceholderById(t){return this.placeholders.find(i=>i.content==t)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}function Hu(e){const t=document.createElement("meta");return t.setAttribute("name","turbo-permanent-placeholder"),t.setAttribute("content",e.id),t}var Bt;class Ar{constructor(t,i,s,n=!0){L(this,Bt,null);
6this.currentSnapshot=t,this.newSnapshot=i,this.isPreview=s,this.willRender=n,this.renderElement=this.constructor.renderElement,this.promise=new Promise((r,o)=>this.resolvingFunctions={resolve:r,reject:o})}static renderElement(t,i){}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(t){await bl.preservingPermanentElements(this,this.permanentElementMap,t)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){const t=this.connectedSnapshot.firstAutofocusableElement;t&&t.focus()}}enteringBardo(t){M(this,Bt)||t.contains(this.currentSnapshot.activeElement)&&B(this,Bt,this.currentSnapshot.activeElement)}leavingBardo(t){t.contains(M(this,Bt))&&M(this,Bt)instanceof HTMLElement&&(M(this,Bt).focus(),B(this,Bt,null))}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}}Bt=new WeakMap;class cn extends Ar{static renderElement(t,i){var o;const s=document.createRange();s.selectNodeContents(t),s.deleteContents();const n=i,r=(o=n.ownerDocument)==null?void 0:o.createRange();r&&(r.selectNodeContents(n),t.appendChild(r.extractContents()))}constructor(t,i,s,n,r,o=!0){super(i,s,n,r,o),this.delegate=t}get shouldRender(){return!0}async render(){await wi(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await wi(),this.focusFirstAutofocusableElement(),await wi(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const t=this.currentElement.firstElementChild,i=Nu(this.currentElement.getAttribute("data-autoscroll-block"),"end"),s=zu(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(t)return t.scrollIntoView({block:i,behavior:s}),!0}return!1}activateScriptElements(){for(const t of this.newScriptElements){const i=Li(t);t.replaceWith(i)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}function Nu(e,t){return e=="end"||e=="start"||e=="center"||e=="nearest"?e:t}function zu(e,t){return e=="auto"||e=="smooth"?e:t}var Vu=function(){const e=()=>{},t={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:e,afterNodeAdded:e,beforeNodeMorphed:e,afterNodeMorphed:e,beforeNodeRemoved:e,afterNodeRemoved:e,beforeAttributeUpdated:e},head:{style:"merge",shouldPreserve:d=>d.getAttribute("im-preserve")==="true",shouldReAppend:d=>d.getAttribute("im-re-append")==="true",shouldRemove:e,afterHeadMorphed:e},restoreFocus:!0};function i(d,f,y={}){d=h(d);const b=u(f),p=c(d,b,y),g=n(p,()=>a(p,d,b,m=>m.morphStyle==="innerHTML"?(r(m,d,b),Array.from(d.childNodes)):s(m,d,b)));return p.pantry.remove(),g}function s(d,f,y){const b=u(f);let p=Array.from(b.childNodes);const g=p.indexOf(f),m=p.length-(g+1);return r(d,b,y,f,f.nextSibling),p=Array.from(b.childNodes),p.slice(g,p.length-m)}function n(d,f){var w;if(!d.config.restoreFocus)return f();let y=document.activeElement;if(!(y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement))return f();const{id:b,selectionStart:p,selectionEnd:g}=y,m=f();return b&&b!==((w=document.activeElement)==null?void 0:w.id)&&(y=d.target.querySelector(`#${b}`),y==null||y.focus()),y&&!y.selectionEnd&&g&&y.setSelectionRange(p,g),m}const r=function(){function d(v,_,E,S=null,A=null){_ instanceof HTMLTemplateElement&&E instanceof HTMLTemplateElement&&(_=_.content,E=E.content),S||(S=_.firstChild);for(const k of E.childNodes){if(S&&S!=A){const R=y(v,k,S,A);if(R){R!==S&&p(v,S,R),o(R,k,v),S=R.nextSibling;continue}}if(k instanceof Element&&v.persistentIds.has(k.id)){const R=g(_,k.id,S,v);o(R,k,v),S=R.nextSibling;continue}const P=f(_,k,S,v);P&&(S=P.nextSibling)}for(;S&&S!=A;){const k=S;S=S.nextSibling,b(v,k)}}
6function f(v,_,E,S){if(S.callbacks.beforeNodeAdded(_)===!1)return null;if(S.idMap.has(_)){const A=document.createElement(_.tagName);return v.insertBefore(A,E),o(A,_,S),S.callbacks.afterNodeAdded(A),A}else{const A=document.importNode(_,!0);return v.insertBefore(A,E),S.callbacks.afterNodeAdded(A),A}}const y=function(){function v(S,A,k,P){let R=null,F=A.nextSibling,it=0,$=k;for(;$&&$!=P;){if(E($,A)){if(_(S,$,A))return $;R===null&&(S.idMap.has($)||(R=$))}if(R===null&&F&&E($,F)&&(it++,F=F.nextSibling,it>=2&&(R=void 0)),$.contains(document.activeElement))break;$=$.nextSibling}return R||null}function _(S,A,k){let P=S.idMap.get(A),R=S.idMap.get(k);if(!R||!P)return!1;for(const F of P)if(R.has(F))return!0;return!1}function E(S,A){const k=S,P=A;return k.nodeType===P.nodeType&&k.tagName===P.tagName&&(!k.id||k.id===P.id)}return v}();function b(v,_){var E;if(v.idMap.has(_))w(v.pantry,_,null);else{if(v.callbacks.beforeNodeRemoved(_)===!1)return;(E=_.parentNode)==null||E.removeChild(_),v.callbacks.afterNodeRemoved(_)}}function p(v,_,E){let S=_;for(;S&&S!==E;){let A=S;S=S.nextSibling,b(v,A)}return S}function g(v,_,E,S){const A=S.target.querySelector(`#${_}`)||S.pantry.querySelector(`#${_}`);return m(A,S),w(v,A,E),A}function m(v,_){const E=v.id;for(;v=v.parentNode;){let S=_.idMap.get(v);S&&(S.delete(E),S.size||_.idMap.delete(v))}}function w(v,_,E){if(v.moveBefore)try{v.moveBefore(_,E)}catch{v.insertBefore(_,E)}else v.insertBefore(_,E)}return d}(),o=function(){function d(m,w,v){return v.ignoreActive&&m===document.activeElement?null:(v.callbacks.beforeNodeMorphed(m,w)===!1||(m instanceof HTMLHeadElement&&v.head.ignore||(m instanceof HTMLHeadElement&&v.head.style!=="morph"?l(m,w,v):(f(m,w,v),g(m,v)||r(v,m,w))),v.callbacks.afterNodeMorphed(m,w)),m)}function f(m,w,v){let _=w.nodeType;if(_===1){const E=m,S=w,A=E.attributes,k=S.attributes;for(const P of k)p(P.name,E,"update",v)||E.getAttribute(P.name)!==P.value&&E.setAttribute(P.name,P.value);for(let P=A.length-1;0<=P;P--){const R=A[P];if(R&&!S.hasAttribute(R.name)){if(p(R.name,E,"remove",v))continue;E.removeAttribute(R.name)}}g(E,v)||y(E,S,v)}(_===8||_===3)&&m.nodeValue!==w.nodeValue&&(m.nodeValue=w.nodeValue)}function y(m,w,v){if(m instanceof HTMLInputElement&&w instanceof HTMLInputElement&&w.type!=="file"){let _=w.value,E=m.value;b(m,w,"checked",v),b(m,w,"disabled",v),w.hasAttribute("value")?E!==_&&(p("value",m,"update",v)||(m.setAttribute("value",_),m.value=_)):p("value",m,"remove",v)||(m.value="",m.removeAttribute("value"))}else if(m instanceof HTMLOptionElement&&w instanceof HTMLOptionElement)b(m,w,"selected",v);else if(m instanceof HTMLTextAreaElement&&w instanceof HTMLTextAreaElement){let _=w.value,E=m.value;if(p("value",m,"update",v))return;_!==E&&(m.value=_),m.firstChild&&m.firstChild.nodeValue!==_&&(m.firstChild.nodeValue=_)}}function b(m,w,v,_){const E=w[v],S=m[v];if(E!==S){const A=p(v,m,"update",_);A||(m[v]=w[v]),E?A||m.setAttribute(v,""):p(v,m,"remove",_)||m.removeAttribute(v)}}function p(m,w,v,_){return m==="value"&&_.ignoreActiveValue&&w===document.activeElement?!0:_.callbacks.beforeAttributeUpdated(m,w,v)===!1}function g(m,w){return!!w.ignoreActiveValue&&m===document.activeElement&&m!==document.body}return d}();function a(d,f,y,b){if(d.head.block){const p=f.querySelector("head"),g=y.querySelector("head");if(p&&g){const m=l(p,g,d);return Promise.all(m).then(()=>{const w=Object.assign(d,{head:{block:!1,ignore:!0}});return b(w)})}}return b(d)}function l(d,f,y){let b=[],p=[],g=[],m=[],w=new Map;for(const _ of f.children)w.set(_.outerHTML,_);for(const _ of d.children){let E=w.has(_.outerHTML),S=y.head.shouldReAppend(_),A=y.head.shouldPreserve(_);E||A?S?p.push(_):(w.delete(_.outerHTML),g.push(_)):y.head.style==="append"?S&&(p.push(_),m.push(_)):y.head.shouldRemove(_)!==!1&&p.push(_)}m.push(...w.values());let v=[];for(const _ of m){let E=document.createRange().createContextualFragment(_.outerHTML).firstChild;if(y.callbacks.beforeNodeAdded(E)!==!1){if("href"in E&&E.href||"src"in E&&E.src){let S,A=new Promise(function(k){S=k});E.addEventListener("load",function(){S()}),v.push(A)}d.appendChild(E),y.callbacks.afterNodeAdded(E),b.push(E)}}for(const _ of p)y.callbacks.beforeNodeRemoved(_)!==!1&&(d.removeChild(_),y.callbacks.afterNodeRemoved(_));return y.head.afterHeadMorphed(d,{added:b,kept:g,removed:p}),v}const c=function(){function d(w,v,_){const{persistentIds:E,idMap:S}=g(w,v),A=f(_),k=A.morphStyle||"outerHTML";if(!["innerHTML","outerHTML"].includes(k))throw`Do not understand how to morph style ${k}`;return{target:w,newContent:v,config:A,morphStyle:k,ignoreActive:A.ignoreActive,ignoreActiveValue:A.ignoreActiveValue,restoreFocus:A.restoreFocus,idMap:S,persistentIds:E,pantry:y(),callbacks:A.callbacks,head:A.head}}function f(w){let v=Object.assign({},t);return Object.assign(v,w),v.callbacks=Object.assign({},t.callbacks,w.callbacks),v.head=Object.assign({},t.head,w.head),v}function y(){const w=document.createElement("div");return w.hidden=!0,document.body.insertAdjacentElement("afterend",
6w),w}function b(w){let v=Array.from(w.querySelectorAll("[id]"));return w.id&&v.push(w),v}function p(w,v,_,E){for(const S of E)if(v.has(S.id)){let A=S;for(;A;){let k=w.get(A);if(k==null&&(k=new Set,w.set(A,k)),k.add(S.id),A===_)break;A=A.parentElement}}}function g(w,v){const _=b(w),E=b(v),S=m(_,E);let A=new Map;p(A,S,w,_);const k=v.__idiomorphRoot||v;return p(A,S,k,E),{persistentIds:S,idMap:A}}function m(w,v){let _=new Set,E=new Map;for(const{id:A,tagName:k}of w)E.has(A)?_.add(A):E.set(A,k);let S=new Set;for(const{id:A,tagName:k}of v)S.has(A)?_.add(A):E.get(A)===k&&S.add(A);for(const A of _)S.delete(A);return S}return d}(),{normalizeElement:h,normalizeParent:u}=function(){const d=new WeakSet;function f(g){return g instanceof Document?g.documentElement:g}function y(g){if(g==null)return document.createElement("div");if(typeof g=="string")return y(p(g));if(d.has(g))return g;if(g instanceof Node){if(g.parentNode)return b(g);{const m=document.createElement("div");return m.append(g),m}}else{const m=document.createElement("div");for(const w of[...g])m.append(w);return m}}function b(g){return{childNodes:[g],querySelectorAll:m=>{const w=g.querySelectorAll(m);return g.matches(m)?[g,...w]:w},insertBefore:(m,w)=>g.parentNode.insertBefore(m,w),moveBefore:(m,w)=>g.parentNode.moveBefore(m,w),get __idiomorphRoot(){return g}}}function p(g){let m=new DOMParser,w=g.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(w.match(/<\/html>/)||w.match(/<\/head>/)||w.match(/<\/body>/)){let v=m.parseFromString(g,"text/html");if(w.match(/<\/html>/))return d.add(v),v;{let _=v.firstChild;return _&&d.add(_),_}}else{let _=m.parseFromString("<body><template>"+g+"</template></body>","text/html").body.querySelector("template").content;return d.add(_),_}}return{normalizeElement:f,normalizeParent:y}}();return{morph:i,defaults:t}}();function kr(e,t,{callbacks:i,...s}={}){Vu.morph(e,t,{...s,callbacks:new qu(i)})}function yl(e,t){kr(e,t.childNodes,{morphStyle:"innerHTML"})}var Vi;class qu{constructor({beforeNodeMorphed:t}={}){L(this,Vi);x(this,"beforeNodeAdded",t=>!(t.id&&t.hasAttribute("data-turbo-permanent")&&document.getElementById(t.id)));x(this,"beforeNodeMorphed",(t,i)=>{if(t instanceof Element)return!t.hasAttribute("data-turbo-permanent")&&M(this,Vi).call(this,t,i)?!W("turbo:before-morph-element",{cancelable:!0,target:t,detail:{currentElement:t,newElement:i}}).defaultPrevented:!1});x(this,"beforeAttributeUpdated",(t,i,s)=>!W("turbo:before-morph-attribute",{cancelable:!0,target:i,detail:{attributeName:t,mutationType:s}}).defaultPrevented);x(this,"beforeNodeRemoved",t=>this.beforeNodeMorphed(t));x(this,"afterNodeMorphed",(t,i)=>{t instanceof Element&&W("turbo:morph-element",{target:t,detail:{currentElement:t,newElement:i}})});B(this,Vi,t||(()=>!0))}}Vi=new WeakMap;class $u extends cn{static renderElement(t,i){W("turbo:before-frame-morph",{target:t,detail:{currentElement:t,newElement:i}}),yl(t,i)}async preservingPermanentElements(t){return await t()}}const Ot=class Ot{constructor(){x(this,"hiding",!1);x(this,"value",0);x(this,"visible",!1);x(this,"trickle",()=>{this.setValue(this.value+Math.random()/100)});this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}static get defaultCSS(){return Qa` 7 .turbo-progress-bar { 8 position: fixed; 9 display: block; 10 top: 0; 11 left: 0; 12 height: 3px; 13 background: #0076ff; 14 z-index: 2147483647; 15 transition: 16 width ${Ot.animationDuration}ms ease-out, 17 opacity ${Ot.animationDuration/2}ms ${Ot.animationDuration/2}ms ease-in; 18 transform: translate3d(0, 0, 0); 19 } 20 `}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(t){this.value=t,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(t){this.progressElement.style.opacity="0",setTimeout(t,Ot.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,Ot.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){const t=document.createElement("style");t.type="text/css",t.textContent=Ot.defaultCSS;const i=el();return i&&(t.nonce=i),t}createProgressElement(){const t=document.createElement("div");return t.className="turbo-progress-bar",t}};x(Ot,"animationDuration",300);let $n=Ot;class ju extends ln{constructor(){super(...arguments);x(this,"detailsByOuterHTML",this.children.filter(i=>!Ku(i)).map(i=>Zu(i)).reduce((i,s)=>{const{outerHTML:n}=s,r=n in i?i[n]:{type:Wu(s),tracked:Uu(s),elements:[]};return{...i,[n]:{...r,elements:[...r.elements,s]}}},{}))}get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(i=>this.detailsByOuterHTML[i].tracked).join("")}getScriptElementsNotInSnapshot(i){return this.getElementsMatchingTypeNotInSnapshot("script",i)}getStylesheetElementsNotInSnapshot(i){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",i)}getElementsMatchingTypeNotInSnapshot(i,s){return Object.keys(this.detailsByOuterHTML).filter(n=>!(n in s.detailsByOuterHTML)).map(n=>this.detailsByOuterHTML[n]).filter(({type:n})=>n==i).map(({elements:[n]})=>n)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((i,s)=>{const{type:n,tracked:r,elements:o}=this.detailsByOuterHTML[s];return n==null&&!r?[...i,...o]:o.length>1?[...i,...o.slice(1)]:i},[])}getMetaValue(i){const s=this.findMetaElementByName(i);return s?s.getAttribute("content"):null}findMetaElementByName(i){return Object.keys(this.detailsByOuterHTML).reduce((s,n)=>{const{elements:[r]}=this.detailsByOuterHTML[n];return Gu(r,i)?r:s},void 0|void 0)}}function Wu(e){if(Yu(e))return"script";if(Xu(e))return"stylesheet"}function Uu(e){return e.getAttribute("data-turbo-track")=="reload"}function Yu(e){return e.localName=="script"}function Ku(e){return e.localName=="noscript"}function Xu(e){const t=e.localName;return t=="style"||t=="link"&&e.getAttribute("rel")=="stylesheet"}function Gu(e,t){return e.localName=="meta"&&e.getAttribute("name")==t}function Zu(e){return e.hasAttribute("nonce")&&e.setAttribute("nonce",""),e}class pt extends ln{static fromHTMLString(t=""){return this.fromDocument(Ja(t))}static fromElement(t){return this.fromDocument(t.ownerDocument)}static fromDocument({documentElement:t,body:i,head:s}){return new this(t,i,new ju(s))}constructor(t,i,s){super(i),this.documentElement=t,this.headSnapshot=s}clone(){const t=this.element.cloneNode(!0),i=this.element.querySelectorAll("select"),s=t.querySelectorAll("select");for(const[n,r]of i.entries()){const o=s[n];for(const a of o.selectedOptions)a.selected=!1;for(const a of r.selectedOptions)o.options[a.index].selected=!0}for(const n of t.querySelectorAll('input[type="password"]'))n.value="";return new pt(this.documentElement,t,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){const t=this.getSetting("root")??"/";return tt(t)}
20get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(t){return this.headSnapshot.getMetaValue(`turbo-${t}`)}}var qi,jt;class Ju{constructor(){L(this,qi,!1);L(this,jt,Promise.resolve())}renderChange(t,i){return t&&this.viewTransitionsAvailable&&!M(this,qi)?(B(this,qi,!0),B(this,jt,M(this,jt).then(async()=>{await document.startViewTransition(i).finished}))):B(this,jt,M(this,jt).then(i)),M(this,jt)}get viewTransitionsAvailable(){return document.startViewTransition}}qi=new WeakMap,jt=new WeakMap;const Qu={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},is={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Rt={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},De={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},td={advance:"forward",restore:"back",replace:"none"};class ed{constructor(t,i,s,n={}){x(this,"identifier",Jt());x(this,"timingMetrics",{});x(this,"followedRedirect",!1);x(this,"historyChanged",!1);x(this,"scrolled",!1);x(this,"shouldCacheSnapshot",!0);x(this,"acceptsStreamResponse",!1);x(this,"snapshotCached",!1);x(this,"state",Rt.initialized);x(this,"viewTransitioner",new Ju);this.delegate=t,this.location=i,this.restorationIdentifier=s||Jt();const{action:r,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:c,response:h,visitCachedSnapshot:u,willRender:d,updateHistory:f,shouldCacheSnapshot:y,acceptsStreamResponse:b,direction:p}={...Qu,...n};this.action=r,this.historyChanged=o,this.referrer=a,this.snapshot=l,this.snapshotHTML=c,this.response=h,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=u,this.willRender=d,this.updateHistory=f,this.scrolled=!d,this.shouldCacheSnapshot=y,this.acceptsStreamResponse=b,this.direction=p||td[r]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==Rt.initialized&&(this.recordTimingMetric(is.visitStart),this.state=Rt.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Rt.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Rt.canceled)}complete(){this.state==Rt.started&&(this.recordTimingMetric(is.visitEnd),this.adapter.visitCompleted(this),this.state=Rt.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Rt.started&&(this.state=Rt.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){var t;if(!this.historyChanged&&this.updateHistory){const i=this.location.href===((t=this.referrer)==null?void 0:t.href)?"replace":this.action,s=tl(i);this.history.update(s,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new Xe(this,ut.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(is.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(t=this.response){if(this.response=t,t){const{statusCode:i}=t;bo(i)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,i)}}finishRequest(){this.recordTimingMetric(is.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){const{statusCode:t,responseHTML:i}=this.response;this.render(async()=>
20{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,bo(t)&&i!=null){const s=pt.fromHTMLString(i);await this.renderPageSnapshot(s,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(pt.fromHTMLString(i),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){const t=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(t&&(!be(this.location)||t.hasAnchor(be(this.location)))&&(this.action=="restore"||t.isPreviewable))return t}getPreloadedSnapshot(){if(this.snapshotHTML)return pt.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){const t=this.getCachedSnapshot();if(t){const i=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(t,i),this.adapter.visitRendered(this),i||this.complete())})}}followRedirect(){var t;this.redirectedToLocation&&!this.followedRedirect&&((t=this.response)!=null&&t.redirected)&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(t){this.acceptsStreamResponse&&t.acceptResponseType(Ae.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(t,i){}async requestSucceededWithResponse(t,i){const s=await i.responseHTML,{redirected:n,statusCode:r}=i;s==null?this.recordResponse({statusCode:De.contentTypeMismatch,redirected:n}):(this.redirectedToLocation=i.redirected?i.location:void 0,this.recordResponse({statusCode:r,responseHTML:s,redirected:n}))}async requestFailedWithResponse(t,i){const s=await i.responseHTML,{redirected:n,statusCode:r}=i;s==null?this.recordResponse({statusCode:De.contentTypeMismatch,redirected:n}):this.recordResponse({statusCode:r,responseHTML:s,redirected:n})}requestErrored(t,i){this.recordResponse({statusCode:De.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){const{scrollPosition:t}=this.restorationData;if(t)return this.view.scrollToPosition(t),!0}scrollToAnchor(){const t=be(this.location);if(t!=null)return this.view.scrollToAnchor(t),!0}recordTimingMetric(t){this.timingMetrics[t]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(t=>t&&this.visitCachedSnapshot(t)),this.snapshotCached=!0)}async render(t){this.cancelRender(),await new Promise(i=>{this.frame=document.visibilityState==="hidden"?setTimeout(()=>i(),0):requestAnimationFrame(()=>i())}),await t(),delete this.frame}async renderPageSnapshot(t,i){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(t),async()=>{await this.view.renderPage(t,i,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}}function bo(e){return e>=200&&e<300}class id{constructor(t){x(this,"progressBar",new $n);x(this,"showProgressBar",()=>{this.progressBar.show()});this.session=t}visitProposedToLocation(t,i){qt(t,this.navigator.rootLocation)?this.navigator.startVisit(t,(i==null?void 0:i.restorationIdentifier)||Jt(),i):window.location.href=t.toString()}visitStarted(t){this.location=t.location,t.loadCachedSnapshot(),t.issueRequest(),t.goToSamePageAnchor()}visitRequestStarted(t){this.progressBar.setValue(0),t.hasCachedSnapshot()||t.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(t){t.loadResponse()}visitRequestFailedWithStatusCode(t,i){switch(i){case De.networkFailure:case De.timeoutFailure:case De.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:i}});default:return t.loadResponse()}}visitRequestFinished(t){}visitCompleted(t){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(t){this.reload(t)}visitFailed(t){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(t){}linkPrefetchingIsEnabledForLocation(t){return!0}
20formSubmissionStarted(t){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(t){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}reload(t){var i;W("turbo:reload",{detail:t}),window.location.href=((i=this.location)==null?void 0:i.toString())||window.location.href}get navigator(){return this.session.navigator}}class sd{constructor(){x(this,"selector","[data-turbo-temporary]");x(this,"deprecatedSelector","[data-turbo-cache=false]");x(this,"started",!1);x(this,"removeTemporaryElements",t=>{for(const i of this.temporaryElements)i.remove()})}start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){const t=document.querySelectorAll(this.deprecatedSelector);return t.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...t]}}var gt,vl,ks,Ms;class nd{constructor(t,i){L(this,gt);this.session=t,this.element=i,this.linkInterceptor=new pl(this,i),this.formSubmitObserver=new Er(this,i)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(t,i,s){return T(this,gt,ks).call(this,t)}linkClickIntercepted(t,i,s){const n=T(this,gt,Ms).call(this,t);n&&n.delegate.linkClickIntercepted(t,i,s)}willSubmitForm(t,i){return t.closest("turbo-frame")==null&&T(this,gt,vl).call(this,t,i)&&T(this,gt,ks).call(this,t,i)}formSubmitted(t,i){const s=T(this,gt,Ms).call(this,t,i);s&&s.delegate.formSubmitted(t,i)}}gt=new WeakSet,vl=function(t,i){const s=xr(t,i),n=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),r=tt((n==null?void 0:n.content)??"/");return T(this,gt,ks).call(this,t,i)&&qt(s,r)},ks=function(t,i){if(t instanceof HTMLFormElement?this.session.submissionIsNavigatable(t,i):this.session.elementIsNavigatable(t)){const n=T(this,gt,Ms).call(this,t,i);return n?n!=t.closest("turbo-frame"):!1}else return!1},Ms=function(t,i){const s=(i==null?void 0:i.getAttribute("data-turbo-frame"))||t.getAttribute("data-turbo-frame");if(s&&s!="_top"){const n=this.element.querySelector(`#${s}:not([disabled])`);if(n instanceof mt)return n}};class rd{constructor(t){x(this,"location");x(this,"restorationIdentifier",Jt());x(this,"restorationData",{});x(this,"started",!1);x(this,"pageLoaded",!1);x(this,"currentIndex",0);x(this,"onPopState",t=>{if(this.shouldHandlePopState()){const{turbo:i}=t.state||{};if(i){this.location=new URL(window.location.href);const{restorationIdentifier:s,restorationIndex:n}=i;this.restorationIdentifier=s;const r=n>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,s,r),this.currentIndex=n}}});x(this,"onPageLoad",async t=>{await iu(),this.pageLoaded=!0});this.delegate=t}start(){var t,i;this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=((i=(t=history.state)==null?void 0:t.turbo)==null?void 0:i.restorationIndex)||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(t,i){this.update(history.pushState,t,i)}replace(t,i){this.update(history.replaceState,t,i)}update(t,i,s=Jt()){t===history.pushState&&++this.currentIndex;const n={turbo:{restorationIdentifier:s,restorationIndex:this.currentIndex}};t.call(history,n,"",i.href),this.location=i,this.restorationIdentifier=s}getRestorationDataForIdentifier(t){return this.restorationData[t]||{}}updateRestorationData(t){const{restorationIdentifier:i}=this,s=this.restorationData[i];this.restorationData[i]={...s,...t}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}}var Be,$i,ji,Wi,en,Ui,Ye,_l,wl;class od{constructor(t,i){L(this,Ye);x(this,"started",!1);L(this,Be,null);L(this,$i,()=>{this.eventTarget.addEventListener("mouseenter",M(this,ji),{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",M(this,Wi),{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",M(this,Ui),!0),this.started=!0});L(this,ji,t=>{if(zs("turbo-prefetch")==="false")return;const i=t.target;if(i.matches&&i.matches("a[href]:not([target^=_]):not([download])")&&T(this,Ye,wl).call(this,i)){const n=i,r=rl(n);if(this.delegate.canPrefetchRequestToLocation(n,r)){B(this,Be,n);const o=new Xe(this,ut.get,r,new URLSearchParams,i);Oe.setLater(r.toString(),o,M(this,Ye,_l))}}});L(this,Wi,t=>{t.target===M(this,Be)&&M(this,en).call(this)});L(this,en,()=>{Oe.clear(),B(this,Be,null)});L(this,Ui,t=>{if(t.target.tagName!=="FORM"&&t.detail.fetchOptions.method==="GET"){const i=Oe.get(t.detail.url.toString());i&&(t.detail.fetchRequest=i),Oe.clear()}});this.delegate=t,this.eventTarget=i}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",M(this,$i),{once:!0}):M(this,$i).call(this))}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",M(this,ji),{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",M(this,Wi),{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",M(this,Ui),!0),this.started=!1)}prepareRequest(t){const i=t.target;t.headers["X-Sec-Purpose"]="prefetch";
20const s=i.closest("turbo-frame"),n=i.getAttribute("data-turbo-frame")||(s==null?void 0:s.getAttribute("target"))||(s==null?void 0:s.id);n&&n!=="_top"&&(t.headers["Turbo-Frame"]=n)}requestSucceededWithResponse(){}requestStarted(t){}requestErrored(t){}requestFinished(t){}requestPreventedHandlingResponse(t,i){}requestFailedWithResponse(t,i){}}Be=new WeakMap,$i=new WeakMap,ji=new WeakMap,Wi=new WeakMap,en=new WeakMap,Ui=new WeakMap,Ye=new WeakSet,_l=function(){return Number(zs("turbo-prefetch-cache-time"))||Mu},wl=function(t){return!(!t.getAttribute("href")||ad(t)||ld(t)||cd(t)||hd(t)||dd(t))};const ad=e=>e.origin!==document.location.origin||!["http:","https:"].includes(e.protocol)||e.hasAttribute("target"),ld=e=>e.pathname+e.search===document.location.pathname+document.location.search||e.href.startsWith("#"),cd=e=>{if(e.getAttribute("data-turbo-prefetch")==="false"||e.getAttribute("data-turbo")==="false")return!0;const t=Fe(e,"[data-turbo-prefetch]");return!!(t&&t.getAttribute("data-turbo-prefetch")==="false")},hd=e=>{const t=e.getAttribute("data-turbo-method");return!!(t&&t.toLowerCase()!=="get"||ud(e)||e.hasAttribute("data-turbo-confirm")||e.hasAttribute("data-turbo-stream"))},ud=e=>e.hasAttribute("data-remote")||e.hasAttribute("data-behavior")||e.hasAttribute("data-confirm")||e.hasAttribute("data-method"),dd=e=>W("turbo:before-prefetch",{target:e,cancelable:!0}).defaultPrevented;var Ke,xl,Sl;class fd{constructor(t){L(this,Ke);this.delegate=t}proposeVisit(t,i={}){this.delegate.allowsVisitingLocationWithAction(t,i.action)&&this.delegate.visitProposedToLocation(t,i)}startVisit(t,i,s={}){this.stop(),this.currentVisit=new ed(this,tt(t),i,{referrer:this.location,...s}),this.currentVisit.start()}submitForm(t,i){this.stop(),this.formSubmission=new an(this,t,i,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(t){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(t)}async formSubmissionSucceededWithResponse(t,i){if(t==this.formSubmission){const s=await i.responseHTML;if(s){const n=t.isSafe;n||this.view.clearSnapshotCache();const{statusCode:r,redirected:o}=i,l={action:T(this,Ke,xl).call(this,t,i),shouldCacheSnapshot:n,response:{statusCode:r,responseHTML:s,redirected:o}};this.proposeVisit(i.location,l)}}}async formSubmissionFailedWithResponse(t,i){const s=await i.responseHTML;if(s){const n=pt.fromHTMLString(s);i.serverError?await this.view.renderError(n,this.currentVisit):await this.view.renderPage(n,!1,!0,this.currentVisit),n.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(t,i){console.error(i)}formSubmissionFinished(t){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(t)}linkPrefetchingIsEnabledForLocation(t){return typeof this.adapter.linkPrefetchingIsEnabledForLocation=="function"?this.adapter.linkPrefetchingIsEnabledForLocation(t):!0}visitStarted(t){this.delegate.visitStarted(t)}visitCompleted(t){this.delegate.visitCompleted(t),delete this.currentVisit}locationWithActionIsSamePage(t,i){const s=be(t),n=be(this.view.lastRenderedLocation),r=i==="restore"&&typeof s>"u";return i!=="replace"&&qn(t)===qn(this.view.lastRenderedLocation)&&(r||s!=null&&s!==n)}visitScrolledToSamePageLocation(t,i){this.delegate.visitScrolledToSamePageLocation(t,i)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}}Ke=new WeakSet,xl=function(t,i){const{submitter:s,formElement:n}=t;return me(s,n)||T(this,Ke,Sl).call(this,i)},Sl=function(t){var s;return t.redirected&&t.location.href===((s=this.location)==null?void 0:s.href)?"replace":"advance"};const re={initial:0,loading:1,interactive:2,complete:3};class pd{constructor(t){x(this,"stage",re.initial);x(this,"started",!1);x(this,"interpretReadyState",()=>{const{readyState:t}=this;t=="interactive"?this.pageIsInteractive():t=="complete"&&this.pageIsComplete()});x(this,"pageWillUnload",()=>{this.delegate.pageWillUnload()});this.delegate=t}start(){this.started||(this.stage==re.initial&&(this.stage=re.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}pageIsInteractive(){this.stage==re.loading&&(this.stage=re.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==re.interactive&&(this.stage=re.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}}class gd{constructor(t){x(this,"started",!1);x(this,"onScroll",()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})});this.delegate=t}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}updatePosition(t){this.delegate.scrollPositionChanged(t)}}class md{render({fragment:t}){bl.preservingPermanentElements(this,bd(t),()=>{yd(t,()=>{vd(()=>{document.documentElement.appendChild(t)})})})}enteringBardo(t,i){i.replaceWith(t.cloneNode(!0))}leavingBardo(){}}function bd(e){const t=dl(document.documentElement),i={};for(const s of t){const{id:n}=s;for(const r of e.querySelectorAll("turbo-stream")){const o=ul(r.templateElement.content,n);o&&(i[n]=[s,o])}}return i}async function yd(e,t){const i=`turbo-stream-autofocus-${Jt()}`,s=e.querySelectorAll("turbo-stream"),n=_d(s);let r=null;if(n&&(n.id?r=n.id:r=i,n.id=r),t(),await wi(),(document.activeElement==null||document.activeElement==document.body)&&r){const a=document.getElementById(r);wr(a)&&a.focus(),a&&a.id==i&&a.removeAttribute("id")}}async function vd(e){const[t,i]=await lu(e,()=>document.activeElement),s=t&&t.id;if(s){const n=document.getElementById(s);wr(n)&&n!=i&&n.focus()}}function _d(e){for(const t of e){const i=il(t.templateElement.content);if(i)return i}return null}var Wt;class wd{constructor(t){x(this,"sources",new Set);L(this,Wt,!1);x(this,"inspectFetchResponse",t=>{const i=xd(t);i&&Sd(i)&&(t.preventDefault(),this.receiveMessageResponse(i))});x(this,"receiveMessageEvent",t=>
20{M(this,Wt)&&typeof t.data=="string"&&this.receiveMessageHTML(t.data)});this.delegate=t}start(){M(this,Wt)||(B(this,Wt,!0),addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){M(this,Wt)&&(B(this,Wt,!1),removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(t){this.streamSourceIsConnected(t)||(this.sources.add(t),t.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(t){this.streamSourceIsConnected(t)&&(this.sources.delete(t),t.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(t){return this.sources.has(t)}async receiveMessageResponse(t){const i=await t.responseHTML;i&&this.receiveMessageHTML(i)}receiveMessageHTML(t){this.delegate.receivedMessageFromStream(Ae.wrap(t))}}Wt=new WeakMap;function xd(e){var i;const t=(i=e.detail)==null?void 0:i.fetchResponse;if(t instanceof nn)return t}function Sd(e){return(e.contentType??"").startsWith(Ae.contentType)}class Ed extends Ar{static renderElement(t,i){const{documentElement:s,body:n}=document;s.replaceChild(i,n)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){const{documentElement:t,head:i}=document;t.replaceChild(this.newHead,i),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(const t of this.scriptElements){const i=t.parentNode;if(i){const s=Li(t);i.replaceChild(s,t)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}}var sn,El;class hn extends Ar{constructor(){super(...arguments);L(this,sn)}static renderElement(i,s){document.body&&s instanceof HTMLBodyElement?document.body.replaceWith(s):document.documentElement.appendChild(s)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){T(this,sn,El).call(this),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}async mergeHead(){const i=this.mergeProvisionalElements(),s=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await i,await s,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){const i=[];for(const s of this.newHeadStylesheetElements)i.push(ru(s)),document.head.appendChild(s);await Promise.all(i)}copyNewHeadScriptElements(){for(const i of this.newHeadScriptElements)document.head.appendChild(Li(i))}removeUnusedDynamicStylesheetElements(){for(const i of this.unusedDynamicStylesheetElements)document.head.removeChild(i)}async mergeProvisionalElements(){const i=[...this.newHeadProvisionalElements];for(const s of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(s,i)||document.head.removeChild(s);for(const s of i)document.head.appendChild(s)}isCurrentElementInElementList(i,s){for(const[n,r]of s.entries()){if(i.tagName=="TITLE"){if(r.tagName!="TITLE")continue;if(i.innerHTML==r.innerHTML)return s.splice(n,1),!0}if(r.isEqualNode(i))return s.splice(n,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(const i of this.currentHeadProvisionalElements)document.head.removeChild(i)}copyNewHeadProvisionalElements(){for(const i of this.newHeadProvisionalElements)document.head.appendChild(i)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(const i of this.newBodyScriptElements){const s=Li(i);i.replaceWith(s)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(i=>i.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}}sn=new WeakSet,El=function(){const{documentElement:i}=this.currentSnapshot,{lang:s}
20=this.newSnapshot;s?i.setAttribute("lang",s):i.removeAttribute("lang")};class Ad extends hn{static renderElement(t,i){kr(t,i,{callbacks:{beforeNodeMorphed:s=>!yo(s)}});for(const s of t.querySelectorAll("turbo-frame"))yo(s)&&s.reload();W("turbo:morph",{detail:{currentElement:t,newElement:i}})}async preservingPermanentElements(t){return await t()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}}function yo(e){return e instanceof mt&&e.src&&e.refresh==="morph"&&!e.closest("[data-turbo-permanent]")}class kd{constructor(t){x(this,"keys",[]);x(this,"snapshots",{});this.size=t}has(t){return es(t)in this.snapshots}get(t){if(this.has(t)){const i=this.read(t);return this.touch(t),i}}put(t,i){return this.write(t,i),this.touch(t),i}clear(){this.snapshots={}}read(t){return this.snapshots[es(t)]}write(t,i){this.snapshots[es(t)]=i}touch(t){const i=es(t),s=this.keys.indexOf(i);s>-1&&this.keys.splice(s,1),this.keys.unshift(i),this.trim()}trim(){for(const t of this.keys.splice(this.size))delete this.snapshots[t]}}class Md extends fl{constructor(){super(...arguments);x(this,"snapshotCache",new kd(10));x(this,"lastRenderedLocation",new URL(location.href));x(this,"forceReloaded",!1)}shouldTransitionTo(i){return this.snapshot.prefersViewTransitions&&i.prefersViewTransitions}renderPage(i,s=!1,n=!0,r){const a=this.isPageRefresh(r)&&this.snapshot.shouldMorphPage?Ad:hn,l=new a(this.snapshot,i,s,n);return l.shouldRender?r==null||r.changeHistory():this.forceReloaded=!0,this.render(l)}renderError(i,s){s==null||s.changeHistory();const n=new Ed(this.snapshot,i,!1);return this.render(n)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(i=this.snapshot){if(i.isCacheable){this.delegate.viewWillCacheSnapshot();const{lastRenderedLocation:s}=this;await Za();const n=i.clone();return this.snapshotCache.put(s,n),n}}getCachedSnapshotForLocation(i){return this.snapshotCache.get(i)}isPageRefresh(i){return!i||this.lastRenderedLocation.pathname===i.location.pathname&&i.action==="replace"}shouldPreserveScrollPosition(i){return this.isPageRefresh(i)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return pt.fromElement(this.element)}}var Yi;class Pd{constructor(t,i){x(this,"selector","a[data-turbo-preload]");L(this,Yi,()=>{this.preloadOnLoadLinksForView(document.body)});this.delegate=t,this.snapshotCache=i}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M(this,Yi)):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",M(this,Yi))}preloadOnLoadLinksForView(t){for(const i of t.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(i)&&this.preloadURL(i)}async preloadURL(t){const i=new URL(t.href);if(this.snapshotCache.has(i))return;await new Xe(this,ut.get,i,new URLSearchParams,t).perform()}prepareRequest(t){t.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(t,i){try{const s=await i.responseHTML,n=pt.fromHTMLString(s);this.snapshotCache.put(t.url,n)}catch{}}requestStarted(t){}requestErrored(t){}requestFinished(t){}requestPreventedHandlingResponse(t,i){}requestFailedWithResponse(t,i){}}Yi=new WeakMap;var He,Ps;class Td{constructor(t){L(this,He);this.session=t}clear(){this.session.clearCache()}resetCacheControl(){T(this,He,Ps).call(this,"")}exemptPageFromCache(){T(this,He,Ps).call(this,"no-cache")}exemptPageFromPreview(){T(this,He,Ps).call(this,"no-preview")}}He=new WeakSet,Ps=function(t){au("turbo-cache-control",t)};var Ki;class Rd{constructor(t){x(this,"navigator",new fd(this));x(this,"history",new rd(this));x(this,"view",new Md(this,document.documentElement));x(this,"adapter",new id(this));x(this,"pageObserver",new pd(this));x(this,"cacheObserver",new sd);x(this,"linkPrefetchObserver",new od(this,document));x(this,"linkClickObserver",new gl(this,window));x(this,"formSubmitObserver",new Er(this,document));x(this,"scrollObserver",new gd(this));x(this,"streamObserver",new wd(this));x(this,"formLinkClickObserver",new ml(this,document.documentElement));x(this,"frameRedirector",new nd(this,document.documentElement));x(this,"streamMessageRenderer",new md);
20x(this,"cache",new Td(this));x(this,"enabled",!0);x(this,"started",!1);L(this,Ki,150);this.recentRequests=t,this.preloader=new Pd(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(t){this.adapter=t}visit(t,i={}){const s=i.frame?document.getElementById(i.frame):null;if(s instanceof mt){const n=i.action||me(s);s.delegate.proposeVisitIfNavigatedWithAction(s,n),s.src=t.toString()}else this.navigator.proposeVisit(tt(t),i)}refresh(t,i){const s=i&&this.recentRequests.has(i),n=t===document.baseURI;!s&&!this.navigator.currentVisit&&n&&this.visit(t,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(t){this.streamObserver.connectStreamSource(t)}disconnectStreamSource(t){this.streamObserver.disconnectStreamSource(t)}renderStreamMessage(t){this.streamMessageRenderer.render(Ae.wrap(t))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(t){console.warn("Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`"),this.progressBarDelay=t}set progressBarDelay(t){J.drive.progressBarDelay=t}get progressBarDelay(){return J.drive.progressBarDelay}set drive(t){J.drive.enabled=t}get drive(){return J.drive.enabled}set formMode(t){J.forms.mode=t}get formMode(){return J.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return M(this,Ki)}set pageRefreshDebouncePeriod(t){this.refresh=cu(this.debouncedRefresh.bind(this),t),B(this,Ki,t)}shouldPreloadLink(t){const i=t.hasAttribute("data-turbo-method"),s=t.hasAttribute("data-turbo-stream"),n=t.getAttribute("data-turbo-frame"),r=n=="_top"?null:document.getElementById(n)||Fe(t,"turbo-frame:not([disabled])");if(i||s||r instanceof mt)return!1;{const o=new URL(t.href);return this.elementIsNavigatable(t)&&qt(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(t,i,s){this.enabled?this.navigator.startVisit(t,i,{action:"restore",historyChanged:!0,direction:s}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(t){this.history.updateRestorationData({scrollPosition:t})}willSubmitFormLinkToLocation(t,i){return this.elementIsNavigatable(t)&&qt(i,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(t,i){return this.elementIsNavigatable(t)&&qt(i,this.snapshot.rootLocation)&&this.navigator.linkPrefetchingIsEnabledForLocation(i)}willFollowLinkToLocation(t,i,s){return this.elementIsNavigatable(t)&&qt(i,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(t,i,s)}followedLinkToLocation(t,i){const s=this.getActionForLink(t),n=t.hasAttribute("data-turbo-stream");this.visit(i.href,{action:s,acceptsStreamResponse:n})}allowsVisitingLocationWithAction(t,i){return this.locationWithActionIsSamePage(t,i)||this.applicationAllowsVisitingLocation(t)}visitProposedToLocation(t,i){vo(t),this.adapter.visitProposedToLocation(t,i)}visitStarted(t){t.acceptsStreamResponse||(Hs(document.documentElement),this.view.markVisitDirection(t.direction)),vo(t.location),t.silent||this.notifyApplicationAfterVisitingLocation(t.location,t.action)}visitCompleted(t){this.view.unmarkVisitDirection(),Ns(document.documentElement),this.notifyApplicationAfterPageLoad(t.getTimingMetrics())}locationWithActionIsSamePage(t,i){return this.navigator.locationWithActionIsSamePage(t,i)}visitScrolledToSamePageLocation(t,i){this.notifyApplicationAfterVisitingSamePageLocation(t,i)}willSubmitForm(t,i){const s=xr(t,i);return this.submissionIsNavigatable(t,i)&&qt(tt(s),this.snapshot.rootLocation)}formSubmitted(t,i){this.navigator.submitForm(t,i)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}
20pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(t){this.renderStreamMessage(t)}viewWillCacheSnapshot(){var t;(t=this.navigator.currentVisit)!=null&&t.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:t},i){const s=this.notifyApplicationBeforeRender(t,i),{defaultPrevented:n,detail:{render:r}}=s;return this.view.renderer&&r&&(this.view.renderer.renderElement=r),!n}viewRenderedSnapshot(t,i,s){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(s)}preloadOnLoadLinksForView(t){this.preloader.preloadOnLoadLinksForView(t)}viewInvalidated(t){this.adapter.pageInvalidated(t)}frameLoaded(t){this.notifyApplicationAfterFrameLoad(t)}frameRendered(t,i){this.notifyApplicationAfterFrameRender(t,i)}applicationAllowsFollowingLinkToLocation(t,i,s){return!this.notifyApplicationAfterClickingLinkToLocation(t,i,s).defaultPrevented}applicationAllowsVisitingLocation(t){return!this.notifyApplicationBeforeVisitingLocation(t).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(t,i,s){return W("turbo:click",{target:t,detail:{url:i.href,originalEvent:s},cancelable:!0})}notifyApplicationBeforeVisitingLocation(t){return W("turbo:before-visit",{detail:{url:t.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(t,i){return W("turbo:visit",{detail:{url:t.href,action:i}})}notifyApplicationBeforeCachingSnapshot(){return W("turbo:before-cache")}notifyApplicationBeforeRender(t,i){return W("turbo:before-render",{detail:{newBody:t,...i},cancelable:!0})}notifyApplicationAfterRender(t){return W("turbo:render",{detail:{renderMethod:t}})}notifyApplicationAfterPageLoad(t={}){return W("turbo:load",{detail:{url:this.location.href,timing:t}})}notifyApplicationAfterVisitingSamePageLocation(t,i){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:t.toString(),newURL:i.toString()}))}notifyApplicationAfterFrameLoad(t){return W("turbo:frame-load",{target:t})}notifyApplicationAfterFrameRender(t,i){return W("turbo:frame-render",{detail:{fetchResponse:t},target:i,cancelable:!0})}submissionIsNavigatable(t,i){if(J.forms.mode=="off")return!1;{const s=i?this.elementIsNavigatable(i):!0;return J.forms.mode=="optin"?s&&t.closest('[data-turbo="true"]')!=null:s&&this.elementIsNavigatable(t)}}elementIsNavigatable(t){const i=Fe(t,"[data-turbo]"),s=Fe(t,"turbo-frame");return J.drive.enabled||s?i?i.getAttribute("data-turbo")!="false":!0:i?i.getAttribute("data-turbo")=="true":!1}getActionForLink(t){return me(t)||"advance"}get snapshot(){return this.view.snapshot}}Ki=new WeakMap;function vo(e){Object.defineProperties(e,Cd)}const Cd={absoluteURL:{get(){return this.toString()}}},K=new Rd(ol),{cache:Al,navigator:kl}=K;function Mr(){K.start()}function Ml(e){K.registerAdapter(e)}function Pl(e,t){K.visit(e,t)}function Pr(e){K.connectStreamSource(e)}function Tr(e){K.disconnectStreamSource(e)}function Tl(e){K.renderStreamMessage(e)}function Rl(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),K.clearCache()}function Cl(e){console.warn("Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),J.drive.progressBarDelay=e}function Ll(e){console.warn("Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),J.forms.confirm=e}function Il(e){console.warn("Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),J.forms.mode=e}var Ld=Object.freeze({__proto__:null,navigator:kl,session:K,cache:Al,PageRenderer:hn,PageSnapshot:pt,FrameRenderer:cn,fetch:Sr,config:J,start:Mr,registerAdapter:Ml,visit:Pl,connectStreamSource:Pr,disconnectStreamSource:Tr,renderStreamMessage:Tl,clearCache:Rl,setProgressBarDelay:Cl,setConfirmMethod:Ll,setFormMode:Il});
20class Id extends Error{}var Ne,Pt,Ut,Xi,ze,Ve,C,Le,Ol,Fl,Dl,Bl,Hl,Nl,zl,jn,Ie,Vl,Ts,ql,$l,jl;class Od{constructor(t){L(this,C);x(this,"fetchResponseLoaded",t=>Promise.resolve());L(this,Ne,null);L(this,Pt,()=>{});L(this,Ut,!1);L(this,Xi,!1);L(this,ze,new Set);L(this,Ve,!1);x(this,"action",null);x(this,"visitCachedSnapshot",({element:t})=>{const i=t.querySelector("#"+this.element.id);i&&this.previousFrameElement&&i.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement});this.element=t,this.view=new Bu(this,this.element),this.appearanceObserver=new Su(this,this.element),this.formLinkClickObserver=new ml(this,this.element),this.linkInterceptor=new pl(this,this.element),this.restorationIdentifier=Jt(),this.formSubmitObserver=new Er(this,this.element)}connect(){M(this,Ut)||(B(this,Ut,!0),this.loadingStyle==ue.lazy?this.appearanceObserver.start():T(this,C,Le).call(this),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){M(this,Ut)&&(B(this,Ut,!1),this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==ue.eager&&T(this,C,Le).call(this)}sourceURLChanged(){T(this,C,ql).call(this,"src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==ue.eager||M(this,Xi))&&T(this,C,Le).call(this))}sourceURLReloaded(){const{refresh:t,src:i}=this.element;return B(this,Ve,i&&t==="morph"),this.element.removeAttribute("complete"),this.element.src=null,this.element.src=i,this.element.loaded}loadingStyleChanged(){this.loadingStyle==ue.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),T(this,C,Le).call(this))}async loadResponse(t){(t.redirected||t.succeeded&&t.isHTML)&&(this.sourceURL=t.response.url);try{const i=await t.responseHTML;if(i){const s=Ja(i);pt.fromDocument(s).isVisitable?await T(this,C,Ol).call(this,t,s):await T(this,C,Bl).call(this,t)}}finally{B(this,Ve,!1),this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(t){this.proposeVisitIfNavigatedWithAction(t,me(t)),T(this,C,Le).call(this)}willSubmitFormLinkToLocation(t){return T(this,C,Ts).call(this,t)}submittedFormLinkToLocation(t,i,s){const n=T(this,C,Ie).call(this,t);n&&s.setAttribute("data-turbo-frame",n.id)}shouldInterceptLinkClick(t,i,s){return T(this,C,Ts).call(this,t)}linkClickIntercepted(t,i){T(this,C,Dl).call(this,t,i)}willSubmitForm(t,i){return t.closest("turbo-frame")==this.element&&T(this,C,Ts).call(this,t,i)}formSubmitted(t,i){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new an(this,t,i);const{fetchRequest:s}=this.formSubmission;this.prepareRequest(s),this.formSubmission.start()}prepareRequest(t){var i;t.headers["Turbo-Frame"]=this.id,(i=this.currentNavigationElement)!=null&&i.hasAttribute("data-turbo-stream")&&t.acceptResponseType(Ae.contentType)}requestStarted(t){Hs(this.element)}requestPreventedHandlingResponse(t,i){M(this,Pt).call(this)}async requestSucceededWithResponse(t,i){await this.loadResponse(i),M(this,Pt).call(this)}async requestFailedWithResponse(t,i){await this.loadResponse(i),M(this,Pt).call(this)}requestErrored(t,i){console.error(i),M(this,Pt).call(this)}requestFinished(t){Ns(this.element)}formSubmissionStarted({formElement:t}){Hs(t,T(this,C,Ie).call(this,t))}formSubmissionSucceededWithResponse(t,i){const s=T(this,C,Ie).call(this,t.formElement,t.submitter);s.delegate.proposeVisitIfNavigatedWithAction(s,me(t.submitter,t.formElement,s)),s.delegate.loadResponse(i),t.isSafe||K.clearCache()}formSubmissionFailedWithResponse(t,i){this.element.delegate.loadResponse(i),K.clearCache()}formSubmissionErrored(t,i){console.error(i)}formSubmissionFinished({formElement:t}){Ns(t,T(this,C,Ie).call(this,t))}allowsImmediateRender({element:t},i){const s=W("turbo:before-frame-render",{target:this.element,detail:{newFrame:t,...i},cancelable:!0}),{defaultPrevented:n,detail:{render:r}}=s;return this.view.renderer&&r&&(this.view.renderer.renderElement=r),!n}viewRenderedSnapshot(t,i,s){}preloadOnLoadLinksForView(t){K.preloadOnLoadLinksForView(t)}viewInvalidated(){}
20willRenderFrame(t,i){this.previousFrameElement=t.cloneNode(!0)}proposeVisitIfNavigatedWithAction(t,i=null){if(this.action=i,this.action){const s=pt.fromElement(t).clone(),{visitCachedSnapshot:n}=t.delegate;t.delegate.fetchResponseLoaded=async r=>{if(t.src){const{statusCode:o,redirected:a}=r,l=await r.responseHTML,h={response:{statusCode:o,redirected:a,responseHTML:l},visitCachedSnapshot:n,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:s};this.action&&(h.action=this.action),K.visit(t.src,h)}}}}changeHistory(){if(this.action){const t=tl(this.action);K.history.update(t,tt(this.element.src||""),this.restorationIdentifier)}}async extractForeignFrameElement(t){let i;const s=CSS.escape(this.id);try{if(i=wo(t.querySelector(`turbo-frame#${s}`),this.sourceURL),i)return i;if(i=wo(t.querySelector(`turbo-frame[src][recurse~=${s}]`),this.sourceURL),i)return await i.loaded,await this.extractForeignFrameElement(i)}catch(n){return console.error(n),new mt}return null}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(t){T(this,C,$l).call(this,"src",()=>{this.element.src=t??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||M(this,Pt).call(this)!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(t){t?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&M(this,Ut)}get rootLocation(){const t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),i=(t==null?void 0:t.content)??"/";return tt(i)}}Ne=new WeakMap,Pt=new WeakMap,Ut=new WeakMap,Xi=new WeakMap,ze=new WeakMap,Ve=new WeakMap,C=new WeakSet,Le=async function(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=T(this,C,Fl).call(this,tt(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,B(this,Xi,!0))},Ol=async function(t,i){const s=await this.extractForeignFrameElement(i.body),n=M(this,Ve)?$u:cn;if(s){const r=new ln(s),o=new n(this,this.view.snapshot,r,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(o),this.complete=!0,K.frameRendered(t,this.element),K.frameLoaded(this.element),await this.fetchResponseLoaded(t)}else T(this,C,Hl).call(this,t)&&T(this,C,Nl).call(this,t)},Fl=async function(t){var s;const i=new Xe(this,ut.get,t,new URLSearchParams,this.element);return(s=M(this,Ne))==null||s.cancel(),B(this,Ne,i),new Promise(n=>{B(this,Pt,()=>{B(this,Pt,()=>{}),B(this,Ne,null),n()}),i.perform()})},Dl=function(t,i,s){const n=T(this,C,Ie).call(this,t,s);n.delegate.proposeVisitIfNavigatedWithAction(n,me(s,t,n)),T(this,C,jl).call(this,t,()=>{n.src=i})},Bl=async function(t){console.warn(`The response (${t.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await T(this,C,jn).call(this,t.response)},Hl=function(t){this.element.setAttribute("complete","");const i=t.response,s=async(r,o)=>{r instanceof Response?T(this,C,jn).call(this,r):K.visit(r,o)};return!W("turbo:frame-missing",{target:this.element,detail:{response:i,visit:s},cancelable:!0}).defaultPrevented},Nl=function(t){this.view.missing(),T(this,C,zl).call(this,t)},zl=function(t){const i=`The response (${t.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new Id(i)},jn=async function(t){const i=new nn(t),s=await i.responseHTML,{location:n,redirected:r,statusCode:o}=i;return K.visit(n,{response:{redirected:r,statusCode:o,responseHTML:s}})},Ie=function(t,i){const s=Bs("data-turbo-frame",i,t)||this.element.getAttribute("target");return _o(s)??this.element},Vl=function(t,i){const s=xr(t,i);return qt(tt(s),this.rootLocation)},Ts=function(t,i){const s=Bs("data-turbo-frame",i,t)||this.element.getAttribute("target");if(t instanceof HTMLFormElement&&!T(this,C,Vl).call(this,t,i)||!this.enabled||s=="_top")return!1;if(s){const n=_o(s);if(n)return!n.disabled}return!(!K.elementIsNavigatable(t)||i&&!K.elementIsNavigatable(i))},ql=function(t){return M(this,ze).has(t)},$l=function(t,i){M(this,ze).add(t),i(),M(this,ze).delete(t)},jl=function(t,i){this.currentNavigationElement=t,i(),delete this.currentNavigationElement};function _o(e){if(e!=null){const t=document.getElementById(e);if(t instanceof mt)return t}}function wo(e,t){if(e){const i=e.getAttribute("src");if(i!=null&&t!=null&&gu(i,t))throw new Error(`Matching <turbo-frame id="${e.id}"> element has a source URL which references itself`);if(e.ownerDocument!==document&&(e=document.importNode(e,!0)),e instanceof mt)return e.connectedCallback(),e.disconnectedCallback(),e}}
20const Rr={after(){this.targetElements.forEach(e=>{var t;return(t=e.parentElement)==null?void 0:t.insertBefore(this.templateContent,e.nextSibling)})},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.append(this.templateContent))},before(){this.targetElements.forEach(e=>{var t;return(t=e.parentElement)==null?void 0:t.insertBefore(this.templateContent,e)})},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(e=>e.prepend(this.templateContent))},remove(){this.targetElements.forEach(e=>e.remove())},replace(){const e=this.getAttribute("method");this.targetElements.forEach(t=>{e==="morph"?kr(t,this.templateContent):t.replaceWith(this.templateContent)})},update(){const e=this.getAttribute("method");this.targetElements.forEach(t=>{e==="morph"?yl(t,this.templateContent):(t.innerHTML="",t.append(this.templateContent))})},refresh(){K.refresh(this.baseURI,this.requestId)}};var ge,gi;const fo=class fo extends HTMLElement{constructor(){super(...arguments);L(this,ge)}static async renderElement(i){await i.performAction()}async connectedCallback(){try{await this.render()}catch(i){console.error(i)}finally{this.disconnect()}}async render(){return this.renderPromise??(this.renderPromise=(async()=>{const i=this.beforeRenderEvent;this.dispatchEvent(i)&&(await wi(),await i.detail.render(this))})())}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(i=>i.remove())}get duplicateChildren(){var n;const i=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.getAttribute("id")),s=[...((n=this.templateContent)==null?void 0:n.children)||[]].filter(r=>!!r.getAttribute("id")).map(r=>r.getAttribute("id"));return i.filter(r=>s.includes(r.getAttribute("id")))}get performAction(){if(this.action){const i=Rr[this.action];if(i)return i;T(this,ge,gi).call(this,"unknown action")}T(this,ge,gi).call(this,"action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;T(this,ge,gi).call(this,"target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){const i=this.ownerDocument.createElement("template");return this.appendChild(i),i}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;T(this,ge,gi).call(this,"first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:fo.renderElement}})}get targetElementsById(){var s;const i=(s=this.ownerDocument)==null?void 0:s.getElementById(this.target);return i!==null?[i]:[]}get targetElementsByQuery(){var s;const i=(s=this.ownerDocument)==null?void 0:s.querySelectorAll(this.targets);return i.length!==0?Array.prototype.slice.call(i):[]}};ge=new WeakSet,gi=function(i){throw new Error(`${this.description}: ${i}`)};let Vs=fo;class Wl extends HTMLElement{constructor(){super(...arguments);x(this,"streamSource",null)}connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Pr(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),Tr(this.streamSource))}get src(){return this.getAttribute("src")||""}}mt.delegateConstructor=Od;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",mt);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",Vs);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",Wl);(()=>{let e=document.currentScript;if(e&&!e.hasAttribute("data-turbo-suppress-warning"))for(e=e.parentElement;e;){if(e==document.body)return console.warn(Qa` 21 You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do! 22 23 Load your applicationâs JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change. 24 25 For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements 26 27 ââ 28 Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s 29 `,e.outerHTML);e=e.parentElement}})();window.Turbo={...Ld,StreamActions:Rr};Mr();const Fd=Object.freeze(Object.defineProperty({__proto__:null,FetchEnctype:$t,FetchMethod:ut,FetchRequest:Xe,FetchResponse:nn,FrameElement:mt,FrameLoadingStyle:ue,FrameRenderer:cn,PageRenderer:hn,PageSnapshot:pt,StreamActions:Rr,StreamElement:Vs,StreamSourceElement:Wl,cache:Al,clearCache:Rl,config:J,connectStreamSource:Pr,disconnectStreamSource:Tr,fetch:Sr,fetchEnctypeFromString:al,fetch
vendor: 10,960 bytes, lines 29-39
29MethodFromString:rn,isSafe:on,navigator:kl,registerAdapter:Ml,renderStreamMessage:Tl,session:K,setConfirmMethod:Ll,setFormMode:Il,setProgressBarDelay:Cl,start:Mr,visit:Pl},Symbol.toStringTag,{value:"Module"}));window.Turbo=Fd;document.addEventListener("turbo:frame-load",()=>{const{scrollTop:e}=document.scrollingElement;e!==0&&(document.scrollingElement.scrollTop=e+1,document.scrollingElement.scrollTop=e)});const Dd={...Xh,controllerAttribute:"s-controller",actionAttribute:"s-action",targetAttribute:"s-target",targetAttributeForScope:e=>`s-${e}-target`,outletAttributeForScope:(e,t)=>`s-${e}-${t}-outlet`};window.Stimulus=Kh.start(document.documentElement,Dd);/*! 30 * @kurkle/color v0.3.4 31 * https://github.com/kurkle/color#readme 32 * (c) 2024 Jukka Kurkela 33 * Released under the MIT License 34 */function Gi(e){return e+.5|0}const Yt=(e,t,i)=>Math.max(Math.min(e,i),t);function mi(e){return Yt(Gi(e*2.55),0,255)}function Gt(e){return Yt(Gi(e*255),0,255)}function Ft(e){return Yt(Gi(e/2.55)/100,0,1)}function xo(e){return Yt(Gi(e*100),0,100)}const dt={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},Wn=[..."0123456789ABCDEF"],Bd=e=>Wn[e&15],Hd=e=>Wn[(e&240)>>4]+Wn[e&15],ss=e=>(e&240)>>4===(e&15),Nd=e=>ss(e.r)&&ss(e.g)&&ss(e.b)&&ss(e.a);function zd(e){var t=e.length,i;return e[0]==="#"&&(t===4||t===5?i={r:255&dt[e[1]]*17,g:255&dt[e[2]]*17,b:255&dt[e[3]]*17,a:t===5?dt[e[4]]*17:255}:(t===7||t===9)&&(i={r:dt[e[1]]<<4|dt[e[2]],g:dt[e[3]]<<4|dt[e[4]],b:dt[e[5]]<<4|dt[e[6]],a:t===9?dt[e[7]]<<4|dt[e[8]]:255})),i}const Vd=(e,t)=>e<255?t(e):"";function qd(e){var t=Nd(e)?Bd:Hd;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Vd(e.a,t):void 0}const $d=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ul(e,t,i){const s=t*Math.min(i,1-i),n=(r,o=(r+e/30)%12)=>i-s*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function jd(e,t,i){const s=(n,r=(n+e/60)%6)=>i-i*t*Math.max(Math.min(r,4-r,1),0);return[s(5),s(3),s(1)]}function Wd(e,t,i){const s=Ul(e,1,.5);let n;for(t+i>1&&(n=1/(t+i),t*=n,i*=n),n=0;n<3;n++)s[n]*=1-t-i,s[n]+=t;return s}function Ud(e,t,i,s,n){return e===n?(t-i)/s+(t<i?6:0):t===n?(i-e)/s+2:(e-t)/s+4}function Cr(e){const i=e.r/255,s=e.g/255,n=e.b/255,r=Math.max(i,s,n),o=Math.min(i,s,n),a=(r+o)/2;let l,c,h;return r!==o&&(h=r-o,c=a>.5?h/(2-r-o):h/(r+o),l=Ud(i,s,n,h,r),l=l*60+.5),[l|0,c||0,a]}function Lr(e,t,i,s){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,i,s)).map(Gt)}function Ir(e,t,i){return Lr(Ul,e,t,i)}function Yd(e,t,i){return Lr(Wd,e,t,i)}function Kd(e,t,i){return Lr(jd,e,t,i)}function Yl(e){return(e%360+360)%360}function Xd(e){const t=$d.exec(e);let i=255,s;if(!t)return;t[5]!==s&&(i=t[6]?mi(+t[5]):Gt(+t[5]));const n=Yl(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?s=Yd(n,r,o):t[1]==="hsv"?s=Kd(n,r,o):s=Ir(n,r,o),{r:s[0],g:s[1],b:s[2],a:i}}function Gd(e,t){var i=Cr(e);i[0]=Yl(i[0]+t),i=Ir(i),e.r=i[0],e.g=i[1],e.b=i[2]}function Zd(e){if(!e)return;const t=Cr(e),i=t[0],s=xo(t[1]),n=xo(t[2]);return e.a<255?`hsla(${i}, ${s}%, ${n}%, ${Ft(e.a)})`:`hsl(${i}, ${s}%, ${n}%)`}const So={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"},Eo={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 Jd(){const e={},t=Object.keys(Eo),i=Object.keys(So);let s,n,r,o,a;for(s=0;s<t.length;s++){for(o=a=t[s],n=0;n<i.length;n++)r=i[n],a=a.replace(r,So[r]);r=parseInt(Eo[o],16),e[a]=[r>>16&255,r>>8&255,r&255]}return e}let ns;function Qd(e){ns||(ns=Jd(),ns.transparent=[0,0,0,0]);const t=ns[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const tf=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ef(e){const t=tf.exec(e);let i=255,s,n,r;if(t){if(t[7]!==s){const o=+t[7];i=t[8]?mi(o):Yt(o*255,0,255)}return s=+t[1],n=+t[3],r=+t[5],s=255&(t[2]?mi(s):Yt(s,0,255)),n=255&(t[4]?mi(n):Yt(n,0,255)),r=255&(t[6]?mi(r):Yt(r,0,255)),{r:s,g:n,b:r,a:i}}}function sf(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ft(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const xn=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Re=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function nf(e,t,i){const s=Re(Ft(e.r)),n=Re(Ft(e.g)),r=Re(Ft(e.b));return{r:Gt(xn(s+i*(Re(Ft(t.r))-s))),g:Gt(xn(n+i*(Re(Ft(t.g))-n))),b:Gt(xn(r+i*(Re(Ft(t.b))-r))),a:e.a+i*(t.a-e.a)}}function rs(e,t,i){if(e){let s=Cr(e);s[t]=Math.max(0,Math.min(s[t]+s[t]*i,t===0?360:1)),s=Ir(s),e.r=s[0],e.g=s[1],e.b=s[2]}}function Kl(e,t){return e&&Object.assign(t||{},e)}function Ao(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Gt(e[3]))):(t=Kl(e,{r:0,g:0,b:0,a:1}),t.a=Gt(t.a)),t}function rf(e){return e.charAt(0)==="r"?ef(e):Xd(e)}class Ii{constructor(t){if(t instanceof Ii)return t;const i=typeof t;let s;i==="object"?s=Ao(t):i==="string"&&(s=zd(t)||Qd(t)||rf(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=Kl(this._rgb);return t&&(t.a=Ft(t.a)),t}set rgb(t){this._rgb=Ao(t)}rgbString(){return this._valid?sf(this._rgb):void 0}hexString(){return this._valid?qd(this._rgb):void 0}hslString(){return this._valid?Zd(this._rgb):void 0}mix(t,i){if(t){const s=this.rgb,n=t.rgb;let r;const o=i===r?.5:i,a=2*o-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,s.r=255&c*s.r+r*n.r+.5,s.g=255&c*s.g+r*n.g+.5,s.b=255&c*s.b+r*n.b+.5,s.a=o*s.a+(1-o)*n.a,this.rgb=s}return this}interpolate(t,i){return t&&(this._rgb=nf(this._rgb,t._rgb,i)),this}clone(){return new Ii(this.rgb)}alpha(t){return this._rgb.a=Gt(t),this}clearer(t){const i=this._rgb;return i.a*=1-t,this}greyscale(){const t=this._rgb,i=Gi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=i,this}opaquer(t){const i=this._rgb;return i.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return rs(this._rgb,2,t),this}darken(t){return rs(this._rgb,2,-t),this}saturate(t){return rs(this._rgb,1,t),this}desaturate(t){return rs(this._rgb,1,-t),this}rotate(t){return Gd(this._rgb,t),this}}/*! 35 * Chart.js v4.5.1 36 * https://www.chartjs.org 37 * (c) 2025 Chart.js Contributors 38 * Released under the MIT License 39 */function Ct(){}const of=(()=>{let e=0;return()=>e++})();function O(e){return e==null}function Q(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function I(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function bt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function St(e,t){return bt(e)?e:t}function N(e,t){return typeof e>"u"?t:e}const af=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function j(e,t,i){if(e&&typeof e.call=="function")return e.apply(i,t)}function D(e,t,i,s){let n,r,o;if(Q(e))for(r=e.length,n=0;n<r;n++)t.call(i,e[n],n);else if(I(e))for(o=Object.keys(e),r=o.length,n=0;n<r;n++)t.call(i,e[o[n]],o[n])}function qs(e,t){let i,s,n,r;if(!e||!t||e.length!==t.length)return!1;for(i=0,s=e.length;i<s;++i)if(n=e[i],r=t[i],n.datasetIndex!==r.datasetIndex||n.index!==r.index)return!1;return!0}function $s(e){if(Q(e))return e.map($s);if(I(e)){const t=Object.create(null),i=Object.keys(e),s=i.length;let n=0;for(;n<s;++n)t[i[n]]=$s(e[i[n]]);return t}return e}function Xl(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function lf(e,t,i,s){if(!Xl(e))return;const n=t[e],r=i[e];I(n)&&I(r)?Tt(n,r,s):t[e]=$s(r)}function Tt(e,t,i){const s=Q(t)?t:[t],n=s.length;if(!I(e))return e;i=i||{};const r=i.merger||lf;let o;for(let a=0;a<n;++a){if(o=s[a],!I(o))continue;const l=Object.keys(o);for(let c=0,h=l.length;c<h;++c)r(l[c],e,o,i)}return e}function xi(e,t){return Tt(e,t,{merger:cf})}function cf(e,t,i){if(!Xl(e))return;const s=t[e],n=i[e];I(s)&&I(n)?xi(s,n):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=$s(n))}const ko={"":e=>e,x:e=>e.x,y:e=>e.y};function hf(e){const t=e.split("."),i=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}function uf(e){const t=hf(e);return i=>{for(const s of t){if(s==="")break;i=i&&i[s]}return i}}function qe(e,t){return(ko[t]||(ko[t]=uf(t)))(e)}function Or(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Oi=e=>typeof e<"u",Qt=e=>typeof e=="function",Mo=(e,t)=>{if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0};function df(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const U=Math.PI,ht=2*U,js=Number.POSITIVE_INFINITY,ff=U/180,et=U/2,oe
vendor: 44,990 bytes, lines 39-44
39=U/4,Po=U*2/3,Gl=Math.log10,Zt=Math.sign;function Rs(e,t,i){return Math.abs(e-t)<i}function To(e){const t=Math.round(e);e=Rs(e,t,e/1e3)?t:e;const i=Math.pow(10,Math.floor(Gl(e))),s=e/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function pf(e){const t=[],i=Math.sqrt(e);let s;for(s=1;s<i;s++)e%s===0&&(t.push(s),t.push(e/s));return i===(i|0)&&t.push(i),t.sort((n,r)=>n-r).pop(),t}function gf(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ws(e){return!gf(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function mf(e,t){const i=Math.round(e);return i-t<=e&&i+t>=e}function bf(e,t,i){let s,n,r;for(s=0,n=e.length;s<n;s++)r=e[s][i],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function de(e){return e*(U/180)}function yf(e){return e*(180/U)}function Ro(e){if(!bt(e))return;let t=1,i=0;for(;Math.round(e*t)/t!==e;)t*=10,i++;return i}function Zl(e,t){const i=t.x-e.x,s=t.y-e.y,n=Math.sqrt(i*i+s*s);let r=Math.atan2(s,i);return r<-.5*U&&(r+=ht),{angle:r,distance:n}}function vf(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function kt(e){return(e%ht+ht)%ht}function Jl(e,t,i,s){const n=kt(e),r=kt(t),o=kt(i),a=kt(r-n),l=kt(o-n),c=kt(n-r),h=kt(n-o);return n===r||n===o||s||a>l&&c<h}function ct(e,t,i){return Math.max(t,Math.min(i,e))}function _f(e){return ct(e,-32768,32767)}function Un(e,t,i,s=1e-6){return e>=Math.min(t,i)-s&&e<=Math.max(t,i)+s}function Fr(e,t,i){i=i||(o=>e[o]<t);let s=e.length-1,n=0,r;for(;s-n>1;)r=n+s>>1,i(r)?n=r:s=r;return{lo:n,hi:s}}const Yn=(e,t,i,s)=>Fr(e,i,s?n=>{const r=e[n][t];return r<i||r===i&&e[n+1][t]===i}:n=>e[n][t]<i),wf=(e,t,i)=>Fr(e,i,s=>e[s][t]>=i);function xf(e,t,i){let s=0,n=e.length;for(;s<n&&e[s]<t;)s++;for(;n>s&&e[n-1]>i;)n--;return s>0||n<e.length?e.slice(s,n):e}const Ql=["push","pop","shift","splice","unshift"];function Sf(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ql.forEach(i=>{const s="_onData"+Or(i),n=e[i];Object.defineProperty(e,i,{configurable:!0,enumerable:!1,value(...r){const o=n.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...r)}),o}})})}function Co(e,t){const i=e._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Ql.forEach(r=>{delete e[r]}),delete e._chartjs)}function tc(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const ec=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function ic(e,t){let i=[],s=!1;return function(...n){i=n,s||(s=!0,ec.call(window,()=>{s=!1,e.apply(t,i)}))}}function Ef(e,t){let i;return function(...s){return t?(clearTimeout(i),i=setTimeout(e,t,s)):e.apply(this,s),t}}const Af=e=>e==="start"?"left":e==="end"?"right":"center",Lo=(e,t,i)=>e==="start"?t:e==="end"?i:(t+i)/2,os=e=>e===0||e===1,Io=(e,t,i)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ht/i)),Oo=(e,t,i)=>Math.pow(2,-10*e)*Math.sin((e-t)*ht/i)+1,Si={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*et)+1,easeOutSine:e=>Math.sin(e*et),easeInOutSine:e=>-.5*(Math.cos(U*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>os(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>os(e)?e:Io(e,.075,.3),easeOutElastic:e=>os(e)?e:Oo(e,.075,.3),easeInOutElastic(e){return os(e)?e:e<.5?.5*Io(e*2,.1125,.45):.5+.5*Oo(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Si.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Si.easeInBounce(e*2)*.5:Si.easeOutBounce(e*2-1)*.5+.5};function sc(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Fo(e){return sc(e)?e:new Ii(e)}function Sn(e){return sc(e)?e:new Ii(e).saturate(.5).darken(.1).hexString()}const kf=["x","y","borderWidth","radius","tension"],Mf=["color","borderColor","backgroundColor"];function Pf(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Mf},numbers:{type:"number",properties:kf}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Tf(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Do=new Map;function Rf(e,t){t=t||{};const i=e+JSON.stringify(t);let s=Do.get(i);return s||(s=new Intl.NumberFormat(e,t),Do.set(i,s)),s}function nc(e,t,i){return Rf(t,i).format(e)}const Cf={values(e){return Q(e)?e:""+e},numeric(e,t,i){if(e===0)return"0";const s=this.chart.options.locale;let n,r=e;if(i.length>1){const c=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),r=Lf(e,i)}const o=Gl(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),nc(e,s,l)}};function Lf(e,t){let i=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(i)>=1&&e!==Math.floor(e)&&(i=e-Math.floor(e)),i}var rc={formatters:Cf};function If(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,i)=>i.lineWidth,tickColor:(t,i)=>i.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:rc.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Se=Object.create(null),Kn=Object.create(null);function Ei(e,t){if(!t)return e;const i=t.split(".");for(let s=0,n=i.length;s<n;++s){const r=i[s];e=e[r]||(e[r]=Object.create(null))}return e}function En(e,t,i){return typeof t=="string"?Tt(Ei(e,t),i):Tt(Ei(e,""),t)}class Of{constructor(t,i){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=s=>s.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=(s,n)=>Sn(n.backgroundColor),this.hoverBorderColor=(s,n)=>Sn(n.borderColor),this.hoverColor=(s,n)=>Sn(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(i)}set(t,i){return En(this,t,i)}get(t){return Ei(this,t)}describe(t,i){return En(Kn,t,i)}override(t,i){return En(Se,t,i)}route(t,i,s,n){const r=Ei(this,t),o=Ei(this,s),a="_"+i;Object.defineProperties(r,{[a]:{value:r[i],writable:!0},[i]:{enumerable:!0,get(){const l=this[a],c=o[n];return I(l)?Object.assign({},c,l):N(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(i=>i(this))}}var G=new Of({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Pf,Tf,If]);function Ff(e){return!e||O(e.size)||O(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Bo(e,t,i,s,n){let r=t[n];return r||(r=t[n]=e.measureText(n).width,i.push(n)),r>s&&(s=r),s}function ae(e,t,i){const s=e.currentDevicePixelRatio,n=i!==0?Math.max(i/2,.5):0;return Math.round((t-n)*s)/s+n}function Ho(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Xn(e,t,i,s){Df(e,t,i,s)}function Df(e,t,i,s,n){let r,o,a,l,c,h,u,d;const f=t.pointStyle,y=t.rotation,b=t.radius;let p=(y||0)*ff;if(f&&typeof f=="object"&&(r=f.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){e.save(),e.translate(i,s),e.rotate(p),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(b)||b<=0)){switch(e.beginPath(),f){default:e.arc(i,s,b,0,ht),e.closePath();break;case"triangle":h=b,e.moveTo(i+Math.sin(p)*h,s-Math.cos(p)*b),p+=Po,e.lineTo(i+Math.sin(p)*h,s-Math.cos(p)*b),p+=Po,e.lineTo(i+Math.sin(p)*h,s-Math.cos(p)*b),e.closePath();break;case"rectRounded":c=b*.516,l=b-c,o=Math.cos(p+oe)*l,u=Math.cos(p+oe)*l,a=Math.sin(p+oe)*l,d=Math.sin(p+oe)*l,e.arc(i-u,s-a,c,p-U,p-et),e.arc(i+d,s-o,c,p-et,p),e.arc(i+u,s+a,c,p,p+et),e.arc(i-d,s+o,c,p+et,p+U),e.closePath();break;case"rect":if(!y){l=Math.SQRT1_2*b,h=l,e.rect(i-h,s-l,2*h,2*l);break}p+=oe;case"rectRot":u=Math.cos(p)*b,o=Math.cos(p)*b,a=Math.sin(p)*b,d=Math.sin(p)*b,e.moveTo(i-u,s-a),e.lineTo(i+d,s-o),e.lineTo(i+u,s+a),e.lineTo(i-d,s+o),e.closePath();break;case"crossRot":p+=oe;case"cross":u=Math.cos(p)*b,o=Math.cos(p)*b,a=Math.sin(p)*b,d=Math.sin(p)*b,e.moveTo(i-u,s-a),e.lineTo(i+u,s+a),e.moveTo(i+d,s-o),e.lineTo(i-d,s+o);break;case"star":u=Math.cos(p)*b,o=Math.cos(p)*b,a=Math.sin(p)*b,d=Math.sin(p)*b,e.moveTo(i-u,s-a),e.lineTo(i+u,s+a),e.moveTo(i+d,s-o),e.lineTo(i-d,s+o),p+=oe,u=Math.cos(p)*b,o=Math.cos(p)*b,a=Math.sin(p)*b,d=Math.sin(p)*b,e.moveTo(i-u,s-a),e.lineTo(i+u,s+a),e.moveTo(i+d,s-o),e.lineTo(i-d,s+o);break;case"line":o=Math.cos(p)*b,a=Math.sin(p)*b,e.moveTo(i-o,s-a),e.lineTo(i+o,s+a);break;case"dash":e.moveTo(i,s),e.lineTo(i+Math.cos(p)*b,s+Math.sin(p)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Dr(e,t,i){return i=i||.5,!t||e&&e.x>t.left-i&&e.x<t.right+i&&e.y>t.top-i&&e.y<t.bottom+i}function oc(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function ac(e){e.restore()}function Bf(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),O(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Hf(e,t,i,s,n){if(n.strikethrough||n.underline){const r=e.measureText(s),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=i-r.actualBoundingBoxAscent,c=i+r.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=n.decorationWidth||2,e.moveTo(o,h),e.lineTo(a,h),e.stroke()}}function Nf(e,t){const i=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=i}function No(e,t,i,s,n,r={}){const o=Q(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(e.save(),e.font=n.string,Bf(e,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&Nf(e,r.backdrop),a&&(r.strokeColor&&(e.strokeStyle=r.strokeColor),O(r.strokeWidth)||(e.lineWidth=r.strokeWidth),e.strokeText(c,i,s,r.maxWidth)),e.fillText(c,i,s,r.maxWidth),Hf(e,i,s,c,r),s+=Number(n.lineHeight);e.restore()}function Gn(e,t){const{x:i,y:s,w:n,h:r,radius:o}=t;e.arc(i+o.topLeft,s+o.topLeft,o.topLeft,1.5*U,U,!0),e.lineTo(i,s+r-o.bottomLeft),e.arc(i+o.bottomLeft,s+r-o.bottomLeft,o.bottomLeft,U,et,!0),e.lineTo(i+n-o.bottomRight,s+r),e.arc(i+n-o.bottomRight,s+r-o.bottomRight,o.bottomRight,et,0,!0),e.lineTo(i+n,s+o.topRight),e.arc(i+n-o.topRight,s+o.topRight,o.topRight,0,-et,!0),e.lineTo(i+o.topLeft,s)}const zf=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Vf=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function qf(e,t){const i=(""+e).match(zf);if(!i||i[1]==="normal")return t*1.2;switch(e=+i[2],i[3]){case"px":return e;case"%":e/=100;break}return t*e}const $f=e=>+e||0;function Br(e,t){const i={},s=I(t),n=s?Object.keys(t):t,r=I(e)?s?o=>N(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of n)i[o]=$f(r(o));return i}function lc(e){return Br(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ai(e){return Br(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Nt(e){const t=lc(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function _t(e,t){e=e||{},t=t||G.font;let i=N(e.size,t.size);typeof i=="string"&&(i=parseInt(i,10));let s=N(e.style,t.style);s&&!(""+s).match(Vf)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:N(e.family,t.family),lineHeight:qf(N(e.lineHeight,t.lineHeight),i),size:i,style:s,weight:N(e.weight,t.weight),string:""};return n.string=Ff(n),n}function q(e,t,i,s){let n,r,o;for(n=0,r=e.length;n<r;++n)if(o=e[n],o!==void 0&&(t!==void 0&&typeof o=="function"&&(o=o(t)),i!==void 0&&Q(o)&&(o=o[i%o.length]),o!==void 0))return o}function jf(e,t,i){const{min:s,max:n}=e,r=af(t,(n-s)/2),o=(a,l)=>i&&a===0?0:a+l;return{min:o(s,-Math.abs(r)),max:o(n,r)}}function Ge(e,t){return Object.assign(Object.create(e),t)}function Hr(e,t=[""],i,s,n=()=>e[0]){const r=i||e;typeof s>"u"&&(s=dc("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:r,_fallback:s,_getTarget:n,override:a=>Hr([a,...e],t,r,s)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return hc(a,l,()=>Jf(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Vo(a).includes(l)},ownKeys(a){return Vo(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function $e(e,t,i,s){const n={_cacheable:!1,_proxy:e,_context:t,_subProxy:i,_stack:new Set,_descriptors:cc(e,s),setContext:r=>$e(e,r,i,s),override:r=>$e(e.override(r),t,i,s)};return new Proxy(n,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return hc(r,o,()=>Uf(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function cc(e,t={scriptable:!0,indexable:!0}){const{_scriptable:i=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=e;return{allKeys:n,scriptable:i,indexable:s,isScriptable:Qt(i)?i:()=>i,isIndexable:Qt(s)?s:()=>s}}const Wf=(e,t)=>e?e+Or(t):t,Nr=(e,t)=>I(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function hc(e,t,i){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const s=i();return e[t]=s,s}function Uf(e,t,i){const{_proxy:s,_context:n,_subProxy:r,_descriptors:o}=e;let a=s[t];return Qt(a)&&o.isScriptable(t)&&(a=Yf(t,a,e,i)),Q(a)&&a.length&&(a=Kf(t,a,e,o.isIndexable)),Nr(t,a)&&(a=$e(a,n,r&&r[t],o)),a}function Yf(e,t,i,s){const{_proxy:n,_context:r,_subProxy:o,_stack:a}=i;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(r,o||s);return a.delete(e),Nr(e,l)&&(l=zr(n._scopes,n,e,l)),l}function Kf(e,t,i,s){const{_proxy:n,_context:r,_subProxy:o,_descriptors:a}=i;if(typeof r.index<"u"&&s(e))return t[r.index%t.length];if(I(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=zr(c,n,e,h);t.push($e(u,r,o&&o[e],a))}}return t}function uc(e,t,i){return Qt(e)?e(t,i):e}const Xf=(e,t)=>e===!0?t:typeof e=="string"?qe(t,e):void 0;function Gf(e,t,i,s,n){for(const r of t){const o=Xf(i,r);if(o){e.add(o);const a=uc(o._fallback,i,n);if(typeof a<"u"&&a!==i&&a!==s)return a}else if(o===!1&&typeof s<"u"&&i!==s)return null}return!1}function zr(e,t,i,s){const n=t._rootScopes,r=uc(t._fallback,i,s),o=[...e,...n],a=new Set;a.add(s);let l=zo(a,o,i,r||i,s);return l===null||typeof r<"u"&&r!==i&&(l=zo(a,o,r,l,s),l===null)?!1:Hr(Array.from(a),[""],n,r,()=>Zf(t,i,s))}function zo(e,t,i,s,n){for(;i;)i=Gf(e,t,i,s,n);return i}function Zf(e,t,i){const s=e._getTarget();t in s||(s[t]={});const n=s[t];return Q(n)&&I(i)?i:n||{}}function Jf(e,t,i,s){let n;for(const r of t)if(n=dc(Wf(r,e),i),typeof n<"u")return Nr(e,n)?zr(i,s,e,n):n}function dc(e,t){for(const i of t){if(!i)continue;const s=i[e];if(typeof s<"u")return s}}function Vo(e){let t=e._keys;return t||(t=e._keys=Qf(e._scopes)),t}function Qf(e){const t=new Set;for(const i of e)for(const s of Object.keys(i).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function Vr(){return typeof window<"u"&&typeof document<"u"}function qr(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Us(e,t,i){let s;return typeof e=="string"?(s=parseInt(e,10),e.indexOf("%")!==-1&&(s=s/100*t.parentNode[i])):s=e,s}const un=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function tp(e,t){return un(e).getPropertyValue(t)}const ep=["top","right","bottom","left"];function ye(e,t,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const r=ep[n];s[r]=parseFloat(e[t+"-"+r+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const ip=(e,t,i)=>(e>0||t>0)&&(!i||!i.shadowRoot);function sp(e,t){const i=e.touches,s=i&&i.length?i[0]:e,{offsetX:n,offsetY:r}=s;let o=!1,a,l;if(ip(n,r,e.target))a=n,l=r;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function ce(e,t){if("native"in e)return e;const{canvas:i,currentDevicePixelRatio:s}=t,n=un(i),r=n.boxSizing==="border-box",o=ye(n,"padding"),a=ye(n,"border","width"),{x:l,y:c,box:h}=sp(e,i),u=o.left+(h&&a.left),d=o.top+(h&&a.top);let{width:f,height:y}=t;return r&&(f-=o.width+a.width,y-=o.height+a.height),{x:Math.round((l-u)/f*i.width/s),y:Math.round((c-d)/y*i.height/s)}}function np(e,t,i){let s,n;if(t===void 0||i===void 0){const r=e&&qr(e);if(!r)t=e.clientWidth,i=e.clientHeight;else{const o=r.getBoundingClientRect(),a=un(r),l=ye(a,"border","width"),c=ye(a,"padding");t=o.width-c.width-l.width,i=o.height-c.height-l.height,s=Us(a.maxWidth,r,"clientWidth"),n=Us(a.maxHeight,r,"clientHeight")}}return{width:t,height:i,maxWidth:s||js,maxHeight:n||js}}const Kt=e=>Math.round(e*10)/10;function rp(e,t,i,s){const n=un(e),r=ye(n,"margin"),o=Us(n.maxWidth,e,"clientWidth")||js,a=Us(n.maxHeight,e,"clientHeight")||js,l=np(e,t,i);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const d=ye(n,"border","width"),f=ye(n,"padding");c-=f.width+d.width,h-=f.height+d.height}return c=Math.max(0,c-r.width),h=Math.max(0,s?c/s:h-r.height),c=Kt(Math.min(c,o,l.maxWidth)),h=Kt(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Kt(c/2)),(t!==void 0||i!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=Kt(Math.floor(h*s))),{width:c,height:h}}function qo(e,t,i){const s=t||1,n=Kt(e.height*s),r=Kt(e.width*s);e.height=Kt(e.height),e.width=Kt(e.width);const o=e.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==s||o.height!==n||o.width!==r?(e.currentDevicePixelRatio=s,o.height=n,o.width=r,e.ctx.setTransform(s,0,0,s,0,0),!0):!1}const op=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Vr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function $o(e,t){const i=tp(e,t),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const ap=function(e,t){return{x(i){return e+e+t-i},setWidth(i){t=i},textAlign(i){return i==="center"?i:i==="right"?"left":"right"},xPlus(i,s){return i-s},leftForLtr(i,s){return i-s}}},lp=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function An(e,t,i){return e?ap(t,i):lp()}function cp(e,t){let i,s;(t==="ltr"||t==="rtl")&&(i=e.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",t,"important"),e.prevTextDirection=s)}function hp(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function as(e,t,i){return e.options.clip?e[i]:t[i]}function up(e,t){const{xScale:i,yScale:s}=e;return i&&s?{left:as(i,t,"left"),right:as(i,t,"right"),top:as(s,t,"top"),bottom:as(s,t,"bottom")}:t}function dp(e,t){const i=t._clip;if(i.disabled)return!1;const s=up(t,e.chartArea);return{left:i.left===!1?0:s.left-(i.left===!0?0:i.left),right:i.right===!1?e.width:s.right+(i.right===!0?0:i.right),top:i.top===!1?0:s.top-(i.top===!0?0:i.top),bottom:i.bottom===!1?e.height:s.bottom+(i.bottom===!0?0:i.bottom)}}/*! 40 * Chart.js v4.5.1 41 * https://www.chartjs.org 42 * (c) 2025 Chart.js Contributors 43 * Released under the MIT License 44 */class fp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,s,n){const r=i.listeners[n],o=i.duration;r.forEach(a=>a({chart:t,initial:i.initial,numSteps:o,currentStep:Math.min(s-i.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=ec.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let i=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const r=s.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),r.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),i+=r.length}),this._lastDate=t,i===0&&(this._running=!1)}_getAnims(t){const i=this._charts;let s=i.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,s)),s}listen(t,i,s){this._getAnims(t).listeners[i].push(s)}add(t,i){!i||!i.length||this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){const i=this._charts.get(t);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const i=this._charts.get(t);return!(!i||!i.running||!i.items.length)}stop(t){const i=this._charts.get(t);if(!i||!i.items.length)return;const s=i.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Lt=new fp;const jo="transparent",pp={boolean(e,t,i){return i>.5?t:e},color(e,t,i){const s=Fo(e||jo),n=s.valid&&Fo(t||jo);return n&&n.valid?n.mix(s,i).hexString():t},number(e,t,i){return e+(t-e)*i}};class gp{constructor(t,i,s,n){const r=i[s];n=q([t.to,n,r,t.from]);const o=q([t.from,r,n]);this._active=!0,this._fn=t.fn||pp[t.type||typeof o],this._easing=Si[t.easing]||Si.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=s,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,i,s){if(this._active){this._notify(!1);const n=this._target[this._prop],r=s-this._start,o=this._duration-r;this._start=s,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=q([t.to,i,n,t.from]),this._from=q([t.from,n,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const i=t-this._start,s=this._duration,n=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||i<s),!this._active){this._target[n]=a,this._notify(!0);return}if(i<0){this._target[n]=r;return}l=i/s%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((i,s)=>{t.push({res:i,rej:s})})}_notify(t){const i=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][i]()}}class fc{constructor(t,i){this._chart=t,this._properties=new Map,this.configure(i)}configure(t){if(!I(t))return;const i=Object.keys(G.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const r=t[n];if(!I(r))return;const o={};for(const a of i)o[a]=r[a];(Q(r.properties)&&r.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,o)})})}_animateOptions(t,i){const s=i.options,n=bp(t,s);if(!n)return[];const r=this._createAnimations(n,s);return s.$shared&&mp(t.options.$animations,s).then(()=>{t.options=s},()=>{}),r}_createAnimations(t,i){const s=this._properties,n=[],r=t.$animations||(t.$animations={}),o=Object.keys(i),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,i));continue}const h=i[c];let u=r[c];const d=s.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}r[c]=u=new gp(d,t,c,h),n.push(u)}return n}update(t,i){if(this._properties.size===0){Object.assign(t,i);return}const s=this._createAnimations(t,i);if(s.length)return Lt.add(this._chart,s),!0}}function mp(e,t){const i=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const r=e[s[n]];r&&r.active()&&i.push(r.wait())}return Promise.all(i)}function bp(e,t){if(!t)return;let i=e.options;if(!i){e.options=t;return}return i.$shared&&(e.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}function Wo(e,t){const i=e&&e.options||{},s=i.reverse,n=i.min===void 0?t:0,r=i.max===void 0?t:0;return{start:s?r:n,end:s?n:r}}function yp(e,t,i){if(i===!1)return!1;const s=Wo(e,i),n=Wo(t,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function vp(e){let t,i,s,n;return I(e)?(t=e.top,i=e.right,s=e.bottom,n=e.left):t=i=s=n=e,{top:t,right:i,bottom:s,left:n,disabled:e===!1}}function pc(e,t){const i=[],s=e._getSortedDatasetMetas(t);let n,r;for(n=0,r=s.length;n<r;++n)i.push(s[n].index);return i}function Uo(e,t,i,s={}){const n=e.keys,r=s.mode==="single";let o,a,l,c;if(t===null)return;let h=!1;for(o=0,a=n.length;o<a;++o){if(l=+n[o],l===i){if(h=!0,s.all)continue;break}c=e.values[l],bt(c)&&(r||t===0||Zt(t)===Zt(c))&&(t+=c)}return!h&&!s.all?0:t}function _p(e,t){const{iScale:i,vScale:s}=t,n=i.axis==="x"?"x":"y",r=s.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,h;for(l=0,c=o.length;l<c;++l)h=o[l],a[l]={[n]:h,[r]:e[h]};return a}function kn(e,t){const i=e&&e.options.stacked;return i||i===void 0&&t.stack!==void 0}function wp(e,t,i){return`${e.id}.${t.id}.${i.stack||i.type}`}function xp(e){const{min:t,max:i,minDefined:s,maxDefined:n}=e.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}function Sp(e,t,i){const s=e[t]||(e[t]={});return s[i]||(s[i]={})}function Yo(e,t,i,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const r=e[n.index];if(i&&r>0||!i&&r<0)return n.index}return null}function Ko(e,t){const{chart:i,_cachedMeta:s}=e,n=i._stacks||(i._stacks={}),{iScale:r,vScale:o,index:a}=s,l=r.axis,c=o.axis,h=wp(r,o,s),u=t.length;let d;for(let f=0;f<u;++f){const y=t[f],{[l]:b,[c]:p}=y,g=y._stacks||(y._stacks={});d=g[c]=Sp(n,h,b),d[a]=p,d._top=Yo(d,o,!0,s.type),d._bottom=Yo(d,o,!1,s.type);const m=d._visualValues||(d._visualValues={});m[a]=p}}function Mn(e,t){const i=e.scales;return Object.keys(i).filter(s=>i[s].axis===t).shift()}function Ep(e,t){return Ge(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ap(e,t,i){return Ge(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:i,index:t,mode:"default",type:"data"})}function oi(e,t){const i=e.controller.index,s=e.vScale&&e.vScale.axis;if(s){t=t||e._parsed;for(const n of t){const r=n._stacks;if(!r||r[s]===void 0||r[s][i]===void 0)return;delete r[s][i],r[s]._visualValues!==void 0&&r[s]._visualValues[i]!==void 0&&delete r[s]._visualValues[i]}}}const Pn=e=>e==="reset"||e==="none",Xo=(e,t)=>t?e:Object.assign({},e),kp=(e,t,i)=>e&&!t.hidden&&t._stacked&&{keys:pc(i,!0),values:null};class ki{constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=kn(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,i=this._cachedMeta,s=this.getDataset(),n=(u,d,f,y)=>u==="x"?d:u==="r"?y:f,r=i.xAxisID=N(s.xAxisID,Mn(t,"x")),o=i.yAxisID=N(s.yAxisID,Mn(t,"y")),a=i.rAxisID=N(s.rAxisID,Mn(t,"r")),l=i.indexAxis,c=i.iAxisID=n(l,r,o,a),h=i.vAxisID=n(l,o,r,a);i.xScale=this.getScaleForId(r),i.yScale=this.getScaleForId(o),i.rScale=this.getScaleForId(a),i.iScale=this.getScaleForId(c),i.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Co(this._data,this),t._stacked&&oi(t)}_dataCheck(){const t=this.getDataset(),i=t.data||(t.data=[]),s=this._data;if(I(i)){const n=this._cachedMeta;this._data=_p(i,n)}else if(s!==i){if(s){Co(s,this);const n=this._cachedMeta;oi(n),n._parsed=[]}i&&Object.isExtensible(i)&&Sf(i,this),this._syncList=[],this._data=i}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const i=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const r=i._stacked;i._stacked=kn(i.vScale,i),i.stack!==s.stack&&(n=!0,oi(i),i.stack=s.stack),this._resyncElements(t),(n||r!==i._stacked)&&(Ko(this,i._parsed),i._stacked=kn(i.vScale,i))}configure(){const t=this.chart.config,i=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){const{_cachedMeta:s,_data:n}=this,{iScale:r,_stacked:o}=s,a=r.axis;let l=t===0&&i===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,u,d;if(this._parsing===!1)s._parsed=n,s._sorted=!0,d=n;else{Q(n[t])?d=this.parseArrayData(s,n,t,i):I(n[t])?d=this.parseObjectData(s,n,t,i):d=this.parsePrimitiveData(s,n,t,i);const f=()=>u[a]===null||c&&u[a]<c[a];for(h=0;h<i;++h)s._parsed[h+t]=u=d[h],l&&(f()&&(l=!1),c=u);s._sorted=l}o&&Ko(this,d)}parsePrimitiveData(t,i,s,n){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),h=r===o,u=new Array(n);let d,f,y;for(d=0,f=n;d<f;++d)y=d+s,u[d]={[a]:h||r.parse(c[y],y),[l]:o.parse(i[y],y)};return u}parseArrayData(t,i,s,n){const{xScale:r,yScale:o}=t,a=new Array(n);let l,c,h,u;for(l=0,c=n;l<c;++l)h=l+s,u=i[h],a[l]={x:r.parse(u[0],h),y:o.parse(u[1],h)};return a}parseObjectData(t,i,s,n){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,u,d,f;for(h=0,u=n;h<u;++h)d=h+s,f=i[d],c[h]={x:r.parse(qe(f,a),d),y:o.parse(qe(f,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,i,s){const n=this.chart,r=this._cachedMeta,o=i[t.axis],a={keys:pc(n,!0),values:i._stacks[t.axis]._visualValues};return Uo(a,o,r.index,{mode:s})}updateRangeFromParsed(t,i,s,n){const r=s[i.axis];let o=r===null?NaN:r;const a=n&&s._stacks[i.axis];n&&a&&(n.values=a,o=Uo(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,i){const s=this._cachedMeta,n=s._parsed,r=s._sorted&&t===s.iScale,o=n.length,a=this._getOtherScale(t),l=kp(i,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=xp(a);let d,f;function y(){f=n[d];const b=f[a.axis];return!bt(f[t.axis])||h>b||u<b}for(d=0;d<o&&!(!y()&&(this.updateRangeFromParsed(c,t,f,l),r));++d);if(r){for(d=o-1;d>=0;--d)if(!y()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const i=this._cachedMeta._parsed,s=[];let n,r,o;for(n=0,r=i.length;n<r;++n)o=i[n][t.axis],bt(o)&&s.push(o);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const i=this._cachedMeta,s=i.iScale,n=i.vScale,r=this.getParsed(t);return{label:s?""+s.getLabelForValue(r[s.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}_update(t){const i=this._cachedMeta;this.update(t||"default"),i._clip=vp(N(this.options.clip,yp(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,i=this.chart,s=this._cachedMeta,n=s.data||[],r=i.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,r,a,l),h=a;h<a+l;++h){const u=n[h];u.hidden||(u.active&&c?o.push(u):u.draw(t,r))}for(h=0;h<o.length;++h)o[h].draw(t,r)}getStyle(t,i){const s=i?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,i,s){const n=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=Ap(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=n.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Ep(this.chart.getContext(),this.index)),r.dataset=n,r.index=r.datasetIndex=this.index;return r.active=!!i,r.mode=s,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,i){return this._resolveElementOptions(this.dataElementType.id,i,t)}_resolveElementOptions(t,i="default",s){const n=i==="active",r=this._cachedDataOpts,o=t+"-"+i,a=r[o],l=this.enableOptionSharing&&Oi(s);if(a)return Xo(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=n?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),f=Object.keys(G.elements[t]),y=()=>this.getContext(s,n,i),b=c.resolveNamedOptions(d,f,y,u);return b.$shared&&(b.$shared=l,r[o]=Object.freeze(Xo(b,l))),b}_resolveAnimations(t,i,s){const n=this.chart,r=this._cachedDataOpts,o=`animation-${i}`,a=r[o];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,i),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,s,i))}const c=new fc(n,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,i){return!i||Pn(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){const s=this.resolveDataElementOptions(t,i),n=this._sharedOptions,r=this.getSharedOptions(s),o=this.includeOptions(i,r)||r!==n;return this.updateSharedOptions(r,i,s),{sharedOptions:r,includeOptions:o}}updateElement(t,i,s,n){Pn(n)?Object.assign(t,s):this._resolveAnimations(i,n).update(t,s)}updateSharedOptions(t,i,s){t&&!Pn(i)&&this._resolveAnimations(void 0,i).update(t,s)}_setStyle(t,i,s,n){t.active=n;const r=this.getStyle(i,n);this._resolveAnimations(i,s,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,i,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,i,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const i=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,r=i.length,o=Math.min(r,n);o&&this.parse(0,o),r>n?this._insertElements(n,r-n,t):r<n&&this._removeElements(r,n-r)}_insertElements(t,i,s=!0){const n=this._cachedMeta,r=n.data,o=t+i;let a;const l=c=>{for(c.length+=i,a=c.length-1;a>=o;a--)c[a]=c[a-i]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,i),s&&this.updateElements(r,t,i,"reset")}updateElements(t,i,s,n){}_removeElements(t,i){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,i);s._stacked&&oi(s,n)}s.data.splice(t,i)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[i,s,n]=t;this[i](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,i){i&&this._sync(["_removeElements",t,i]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}x(ki,"defaults",{}),x(ki,"datasetElementType",null),x(ki,"dataElementType",null);function Mp(e,t){if(!e._cache.$bar){const i=e.getMatchingVisibleMetas(t);let s=[];for(let n=0,r=i.length;n<r;n++)s=s.concat(i[n].controller.getAllParsedValues(e));e._cache.$bar=tc(s.sort((n,r)=>n-r))}return e._cache.$bar}function Pp(e){const t=e.iScale,i=Mp(t,e.type);let s=t._length,n,r,o,a;const l=()=>{o===32767||o===-32768||(Oi(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(n=0,r=i.length;n<r;++n)o=t.getPixelForValue(i[n]),l();for(a=void 0,n=0,r=t.ticks.length;n<r;++n)o=t.getPixelForTick(n),l();return s}function Tp(e,t,i,s){const n=i.barThickness;let r,o;return O(n)?(r=t.min*i.categoryPercentage,o=i.barPercentage):(r=n*s,o=1),{chunk:r/s,ratio:o,start:t.pixels[e]-r/2}}function Rp(e,t,i,s){const n=t.pixels,r=n[e];let o=e>0?n[e-1]:null,a=e<n.length-1?n[e+1]:null;const l=i.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/s,ratio:i.barPercentage,start:c}}function Cp(e,t,i,s){const n=i.parse(e[0],s),r=i.parse(e[1],s),o=Math.min(n,r),a=Math.max(n,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[i.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:r,min:o,max:a}}function gc(e,t,i,s){return Q(e)?Cp(e,t,i,s):t[i.axis]=i.parse(e,s),t}function Go(e,t,i,s){const n=e.iScale,r=e.vScale,o=n.getLabels(),a=n===r,l=[];let c,h,u,d;for(c=i,h=i+s;c<h;++c)d=t[c],u={},u[n.axis]=a||n.parse(o[c],c),l.push(gc(d,u,r,c));return l}function Tn(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Lp(e,t,i){return e!==0?Zt(e):(t.isHorizontal()?1:-1)*(t.min>=i?1:-1)}function Ip(e){let t,i,s,n,r;return e.horizontal?(t=e.base>e.x,i="left",s="right"):(t=e.base<e.y,i="bottom",s="top"),t?(n="end",r="start"):(n="start",r="end"),{start:i,end:s,reverse:t,top:n,bottom:r}}function Op(e,t,i,s){let n=t.borderSkipped;const r={};if(!n){e.borderSkipped=r;return}if(n===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:h}=Ip(e);n==="middle"&&i&&(e.enableBorderRadius=!0,(i._top||0)===s?n=c:(i._bottom||0)===s?n=h:(r[Zo(h,o,a,l)]=!0,n=c)),r[Zo(n,o,a,l)]=!0,e.borderSkipped=r}function Zo(e,t,i,s){return s?(e=Fp(e,t,i),e=Jo(e,i,t)):e=Jo(e,t,i),e}function Fp(e,t,i){return e===t?i:e===i?t:e}function Jo(e,t,i){return e==="start"?t:e==="end"?i:e}function Dp(e,{inflateAmount:t},i){e.inflateAmount=t==="auto"?i===1?.33:0:t}class Cs extends ki{parsePrimitiveData(t,i,s,n){return Go(t,i,s,n)}parseArrayData(t,i,s,n){return Go(t,i,s,n)}parseObjectData(t,i,s,n){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,h=o.axis==="x"?a:l,u=[];let d,f,y,b;for(d=s,f=s+n;d<f;++d)b=i[d],y={},y[r.axis]=r.parse(qe(b,c),d),u.push(gc(qe(b,h),y,o,d));return u}updateRangeFromParsed(t,i,s,n){super.updateRangeFromParsed(t,i,s,n);const r=s._custom;r&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const i=this._cachedMeta,{iScale:s,vScale:n}=i,r=this.getParsed(t),o=r._custom,a=Tn(o)?"["+o.start+", "+o.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+s.getLabelForValue(r[s.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,t)}updateElements(t,i,s,n){const r=n==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(i,n);for(let f=i;f<i+s;f++){const y=this.getParsed(f),b=r||O(y[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,h),g=(y._stacks||{})[a.axis],m={horizontal:c,base:b.base,enableBorderRadius:!g||Tn(y._custom)||o===g._top||o===g._bottom,x:c?b.head:p.center,y:c?p.center:b.head,height:c?p.size:Math.abs(b.size),width:c?Math.abs(b.size):p.size};d&&(m.options=u||this.resolveDataElementOptions(f,t[f].active?"active":n));const w=m.options||t[f].options;Op(m,w,g,o),Dp(m,w,h.ratio),this.updateElement(t[f],f,m,n)}}_getStacks(t,i){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),r=s.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(i),l=a&&a[s.axis],c=h=>{const u=h._parsed.find(f=>f[s.axis]===l),d=u&&u[h.vScale.axis];if(O(d)||isNaN(d))return!0};for(const h of n)if(!(i!==void 0&&c(h))&&((r===!1||o.indexOf(h.stack)===-1||r===void 0&&h.stack===void 0)&&o.push(h.stack),h.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,i=this.chart.options.indexAxis;return Object.keys(t).filter(s=>t[s].axis===i).shift()}_getAxis(){const t={},i=this.getFirstScaleIdForIndexAxis();for(const s of this.chart.data.datasets)t[N(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,i)]=!0;return Object.keys(t)}_getStackIndex(t,i,s){const n=this._getStacks(t,s),r=i!==void 0?n.indexOf(i):-1;return r===-1?n.length-1:r}_getRuler(){const t=this.options,i=this._cachedMeta,s=i.iScale,n=[];let r,o;for(r=0,o=i.data.length;r<o;++r)n.push(s.getPixelForValue(this.getParsed(r)[s.axis],r));const a=t.barThickness;return{min:a||Pp(i),pixels:n,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:i,_stacked:s,index:n},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,h=Tn(c);let u=l[i.axis],d=0,f=s?this.applyStack(i,l,s):u,y,b;f!==u&&(d=f-u,f=u),h&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&Zt(u)!==Zt(c.barEnd)&&(d=0),d+=u);const p=!O(r)&&!h?r:d;let g=i.getPixelForValue(p);if(this.chart.getDataVisibility(t)?y=i.getPixelForValue(d+f):y=g,b=y-g,Math.abs(b)<o){b=Lp(b,i,a)*o,u===a&&(g-=b/2);const m=i.getPixelForDecimal(0),w=i.getPixelForDecimal(1),v=Math.min(m,w),_=Math.max(m,w);g=Math.max(Math.min(g,_),v),y=g+b,s&&!h&&(l._stacks[i.axis]._visualValues[n]=i.getValueForPixel(y)-i.getValueForPixel(g))}if(g===i.getPixelForValue(a)){const m=Zt(b)*i.getLineWidthForValue(a)/2;g+=m,b-=m}
vendor: 4,797 bytes, line 44
44return{size:b,base:g,head:y,center:y+b/2}}_calculateBarIndexPixels(t,i){const s=i.scale,n=this.options,r=n.skipNull,o=N(n.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(i.grouped){const h=r?this._getStackCount(t):i.stackCount,u=n.barThickness==="flex"?Rp(t,i,n,h*c):Tp(t,i,n,h*c),d=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(N(d,this.getFirstScaleIdForIndexAxis())),y=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+f;a=u.start+u.chunk*y+u.chunk/2,l=Math.min(o,u.chunk*u.ratio)}else a=s.getPixelForValue(this.getParsed(t)[s.axis],t),l=Math.min(o,i.min*i.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,i=t.vScale,s=t.data,n=s.length;let r=0;for(;r<n;++r)this.getParsed(r)[i.axis]!==null&&!s[r].hidden&&s[r].draw(this._ctx)}}x(Cs,"id","bar"),x(Cs,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),x(Cs,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function le(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class $r{constructor(t){x(this,"options");this.options=t||{}}static override(t){Object.assign($r.prototype,t)}init(){}formats(){return le()}parse(){return le()}format(){return le()}add(){return le()}diff(){return le()}startOf(){return le()}endOf(){return le()}}var Bp={_date:$r};function Hp(e,t,i,s){const{controller:n,data:r,_sorted:o}=e,a=n._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const c=a._reversePixels?wf:Yn;if(s){if(n._sharedOptions){const h=r[0],u=typeof h.getRange=="function"&&h.getRange(t);if(u){const d=c(r,t,i-u),f=c(r,t,i+u);return{lo:d.lo,hi:f.hi}}}}else{const h=c(r,t,i);if(l){const{vScale:u}=n._cachedMeta,{_parsed:d}=e,f=d.slice(0,h.lo+1).reverse().findIndex(b=>!O(b[u.axis]));h.lo-=Math.max(0,f);const y=d.slice(h.hi).findIndex(b=>!O(b[u.axis]));h.hi+=Math.max(0,y)}return h}}return{lo:0,hi:r.length-1}}function dn(e,t,i,s,n){const r=e.getSortedVisibleDatasetMetas(),o=i[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:h}=r[a],{lo:u,hi:d}=Hp(r[a],t,o,n);for(let f=u;f<=d;++f){const y=h[f];y.skip||s(y,c,f)}}}function Np(e){const t=e.indexOf("x")!==-1,i=e.indexOf("y")!==-1;return function(s,n){const r=t?Math.abs(s.x-n.x):0,o=i?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function Rn(e,t,i,s,n){const r=[];return!n&&!e.isPointInArea(t)||dn(e,i,t,function(a,l,c){!n&&!Dr(a,e.chartArea,0)||a.inRange(t.x,t.y,s)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function zp(e,t,i,s){let n=[];function r(o,a,l){const{startAngle:c,endAngle:h}=o.getProps(["startAngle","endAngle"],s),{angle:u}=Zl(o,{x:t.x,y:t.y});Jl(u,c,h)&&n.push({element:o,datasetIndex:a,index:l})}return dn(e,i,t,r),n}function Vp(e,t,i,s,n,r){let o=[];const a=Np(i);let l=Number.POSITIVE_INFINITY;function c(h,u,d){const f=h.inRange(t.x,t.y,n);if(s&&!f)return;const y=h.getCenterPoint(n);if(!(!!r||e.isPointInArea(y))&&!f)return;const p=a(t,y);p<l?(o=[{element:h,datasetIndex:u,index:d}],l=p):p===l&&o.push({element:h,datasetIndex:u,index:d})}return dn(e,i,t,c),o}function Cn(e,t,i,s,n,r){return!r&&!e.isPointInArea(t)?[]:i==="r"&&!s?zp(e,t,i,n):Vp(e,t,i,s,n,r)}function Qo(e,t,i,s,n){const r=[],o=i==="x"?"inXRange":"inYRange";let a=!1;return dn(e,i,t,(l,c,h)=>{l[o]&&l[o](t[i],n)&&(r.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:r}var qp={modes:{index(e,t,i,s){const n=ce(t,e),r=i.axis||"x",o=i.includeInvisible||!1,a=i.intersect?Rn(e,n,r,s,o):Cn(e,n,r,!1,s,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(e,t,i,s){const n=ce(t,e),r=i.axis||"xy",o=i.includeInvisible||!1;let a=i.intersect?Rn(e,n,r,s,o):Cn(e,n,r,!1,s,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(e,t,i,s){const n=ce(t,e),r=i.axis||"xy",o=i.includeInvisible||!1;return Rn(e,n,r,s,o)},nearest(e,t,i,s){const n=ce(t,e),r=i.axis||"xy",o=i.includeInvisible||!1;return Cn(e,n,r,i.intersect,s,o)},x(e,t,i,s){const n=ce(t,e);return Qo(e,n,"x",i.intersect,s)},y(e,t,i,s){const n=ce(t,e);return Qo(e,n,"y",i.intersect,s)}}};const mc=["left","top","right","bottom"];function ai(e,t){return e.filter(i=>i.pos===t)}function ta(e,t){return e.filter(i=>mc.indexOf(i.pos)===-1&&i.box.axis===t)}function li(e,t){return e.sort((i,s)=>{const n=t?s:i,r=t?i:s;
vendor: 4,326 bytes, line 44
44return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function $p(e){const t=[];let i,s,n,r,o,a;for(i=0,s=(e||[]).length;i<s;++i)n=e[i],{position:r,options:{stack:o,stackWeight:a=1}}=n,t.push({index:i,box:n,pos:r,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&r+o,stackWeight:a});return t}function jp(e){const t={};for(const i of e){const{stack:s,pos:n,stackWeight:r}=i;if(!s||!mc.includes(n))continue;const o=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function Wp(e,t){const i=jp(e),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let r,o,a;for(r=0,o=e.length;r<o;++r){a=e[r];const{fullSize:l}=a.box,c=i[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&t.availableHeight)}return i}function Up(e){const t=$p(e),i=li(t.filter(c=>c.box.fullSize),!0),s=li(ai(t,"left"),!0),n=li(ai(t,"right")),r=li(ai(t,"top"),!0),o=li(ai(t,"bottom")),a=ta(t,"x"),l=ta(t,"y");return{fullSize:i,leftAndTop:s.concat(r),rightAndBottom:n.concat(l).concat(o).concat(a),chartArea:ai(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:r.concat(o).concat(a)}}function ea(e,t,i,s){return Math.max(e[i],t[i])+Math.max(e[s],t[s])}function bc(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Yp(e,t,i,s){const{pos:n,box:r}=i,o=e.maxPadding;if(!I(n)){i.size&&(e[n]-=i.size);const u=s[i.stack]||{size:0,count:1};u.size=Math.max(u.size,i.horizontal?r.height:r.width),i.size=u.size/u.count,e[n]+=i.size}r.getPadding&&bc(o,r.getPadding());const a=Math.max(0,t.outerWidth-ea(o,e,"left","right")),l=Math.max(0,t.outerHeight-ea(o,e,"top","bottom")),c=a!==e.w,h=l!==e.h;return e.w=a,e.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function Kp(e){const t=e.maxPadding;function i(s){const n=Math.max(t[s]-e[s],0);return e[s]+=n,n}e.y+=i("top"),e.x+=i("left"),i("right"),i("bottom")}function Xp(e,t){const i=t.maxPadding;function s(n){const r={left:0,top:0,right:0,bottom:0};return n.forEach(o=>{r[o]=Math.max(t[o],i[o])}),r}return s(e?["left","right"]:["top","bottom"])}function bi(e,t,i,s){const n=[];let r,o,a,l,c,h;for(r=0,o=e.length,c=0;r<o;++r){a=e[r],l=a.box,l.update(a.width||t.w,a.height||t.h,Xp(a.horizontal,t));const{same:u,other:d}=Yp(t,i,a,s);c|=u&&n.length,h=h||d,l.fullSize||n.push(a)}return c&&bi(n,t,i,s)||h}function ls(e,t,i,s,n){e.top=i,e.left=t,e.right=t+s,e.bottom=i+n,e.width=s,e.height=n}function ia(e,t,i,s){const n=i.padding;let{x:r,y:o}=t;for(const a of e){const l=a.box,c=s[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const u=t.w*h,d=c.size||l.height;Oi(c.start)&&(o=c.start),l.fullSize?ls(l,n.left,o,i.outerWidth-n.right-n.left,d):ls(l,t.left+c.placed,o,u,d),c.start=o,c.placed+=u,o=l.bottom}else{const u=t.h*h,d=c.size||l.width;Oi(c.start)&&(r=c.start),l.fullSize?ls(l,r,n.top,d,i.outerHeight-n.bottom-n.top):ls(l,r,t.top+c.placed,d,u),c.start=r,c.placed+=u,r=l.right}}t.x=r,t.y=o}var cs={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(i){t.draw(i)}}]},e.boxes.push(t)},removeBox(e,t){const i=e.boxes?e.boxes.indexOf(t):-1;i!==-1&&e.boxes.splice(i,1)},configure(e,t,i){t.fullSize=i.fullSize,t.position=i.position,t.weight=i.weight},update(e,t,i,s){if(!e)return;const n=Nt(e.options.layout.padding),r=Math.max(t-n.width,0),o=Math.max(i-n.height,0),a=Up(e.boxes),l=a.vertical,c=a.horizontal;D(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const h=l.reduce((b,p)=>p.box.options&&p.box.options.display===!1?b:b+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:i,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),d=Object.assign({},n);bc(d,Nt(s));const f=Object.assign({maxPadding:d,w:r,h:o,x:n.left,y:n.top},n),y=Wp(l.concat(c),u);bi(a.fullSize,f,u,y),bi(l,f,u,y),bi(c,f,u,y)&&bi(l,f,u,y),Kp(f),ia(a.leftAndTop,f,u,y),f.x+=f.w,f.y+=f.h,ia(a.rightAndBottom,f,u,y),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},D(a.chartArea,b=>{const p=b.box;Object.assign(p,e.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class yc{acquireContext(t,i){}releaseContext(t){return!1}
vendor: 4,485 bytes, line 44
44addEventListener(t,i,s){}removeEventListener(t,i,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,s,n){return i=Math.max(0,i||t.width),s=s||t.height,{width:i,height:Math.max(0,n?Math.floor(i/n):s)}}isAttached(t){return!0}updateConfig(t){}}class Gp extends yc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ls="$chartjs",Zp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},sa=e=>e===null||e==="";function Jp(e,t){const i=e.style,s=e.getAttribute("height"),n=e.getAttribute("width");if(e[Ls]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",sa(n)){const r=$o(e,"width");r!==void 0&&(e.width=r)}if(sa(s))if(e.style.height==="")e.height=e.width/(t||2);else{const r=$o(e,"height");r!==void 0&&(e.height=r)}return e}const vc=op?{passive:!0}:!1;function Qp(e,t,i){e&&e.addEventListener(t,i,vc)}function tg(e,t,i){e&&e.canvas&&e.canvas.removeEventListener(t,i,vc)}function eg(e,t){const i=Zp[e.type]||e.type,{x:s,y:n}=ce(e,t);return{type:i,chart:t,native:e,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Ys(e,t){for(const i of e)if(i===t||i.contains(t))return!0}function ig(e,t,i){const s=e.canvas,n=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Ys(a.addedNodes,s),o=o&&!Ys(a.removedNodes,s);o&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function sg(e,t,i){const s=e.canvas,n=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Ys(a.removedNodes,s),o=o&&!Ys(a.addedNodes,s);o&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const Fi=new Map;let na=0;function _c(){const e=window.devicePixelRatio;e!==na&&(na=e,Fi.forEach((t,i)=>{i.currentDevicePixelRatio!==e&&t()}))}function ng(e,t){Fi.size||window.addEventListener("resize",_c),Fi.set(e,t)}function rg(e){Fi.delete(e),Fi.size||window.removeEventListener("resize",_c)}function og(e,t,i){const s=e.canvas,n=s&&qr(s);if(!n)return;const r=ic((a,l)=>{const c=n.clientWidth;i(a,l),c<n.clientWidth&&i()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||r(c,h)});return o.observe(n),ng(e,r),o}function Ln(e,t,i){i&&i.disconnect(),t==="resize"&&rg(e)}function ag(e,t,i){const s=e.canvas,n=ic(r=>{e.ctx!==null&&i(eg(r,e))},e);return Qp(s,t,n),n}class lg extends yc{acquireContext(t,i){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Jp(t,i),s):null}releaseContext(t){const i=t.canvas;if(!i[Ls])return!1;const s=i[Ls].initial;["height","width"].forEach(r=>{const o=s[r];O(o)?i.removeAttribute(r):i.setAttribute(r,o)});const n=s.style||{};return Object.keys(n).forEach(r=>{i.style[r]=n[r]}),i.width=i.width,delete i[Ls],!0}addEventListener(t,i,s){this.removeEventListener(t,i);const n=t.$proxies||(t.$proxies={}),o={attach:ig,detach:sg,resize:og}[i]||ag;n[i]=o(t,i,s)}removeEventListener(t,i){const s=t.$proxies||(t.$proxies={}),n=s[i];if(!n)return;({attach:Ln,detach:Ln,resize:Ln}[i]||tg)(t,i,n),s[i]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,s,n){return rp(t,i,s,n)}isAttached(t){const i=t&&qr(t);return!!(i&&i.isConnected)}}function cg(e){return!Vr()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Gp:lg}var As;let Ze=(As=class{constructor(){x(this,"x");x(this,"y");x(this,"active",!1);x(this,"options");x(this,"$animations")}tooltipPosition(t){const{x:i,y:s}=this.getProps(["x","y"],t);return{x:i,y:s}}hasValue(){return Ws(this.x)&&Ws(this.y)}getProps(t,i){const s=this.$animations;if(!i||!s)return this;const n={};return t.forEach(r=>{n[r]=s[r]&&s[r].active()?s[r]._to:this[r]}),n}},x(As,"defaults",{}),x(As,"defaultRoutes"),As);function hg(e,t){const i=e.options.ticks,s=ug(e),n=Math.min(i.maxTicksLimit||s,s),r=i.major.enabled?fg(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>n)return pg(t,c,r,o/n),c;const h=dg(r,t,n);if(o>0){let u,d;const f=o>1?Math.round((l-a)/(o-1)):null;for(hs(t,c,h,O(f)?0:a-f,a),u=0,d=o-1;u<d;u++)hs(t,c,h,r[u],r[u+1]);return hs(t,c,h,l,O(f)?t.length:l+f),c}return hs(t,c,h),c}function ug(e){const t=e.options.offset,i=e._tickSize(),s=e._length/i+(t?0:1),n=e._maxLength/i;return Math.floor(Math.min(s,n))}function dg(e,t,i){const s=gg(e),n=t.length/i;if(!s)return Math.max(n,1);const r=pf(s);for(let o=0,a=r.length-1;o<a;
vendor: 42,085 bytes, line 44
44o++){const l=r[o];if(l>n)return l}return Math.max(n,1)}function fg(e){const t=[];let i,s;for(i=0,s=e.length;i<s;i++)e[i].major&&t.push(i);return t}function pg(e,t,i,s){let n=0,r=i[0],o;for(s=Math.ceil(s),o=0;o<e.length;o++)o===r&&(t.push(e[o]),n++,r=i[n*s])}function hs(e,t,i,s,n){const r=N(s,0),o=Math.min(N(n,e.length),e.length);let a=0,l,c,h;for(i=Math.ceil(i),n&&(l=n-s,i=l/Math.floor(l/i)),h=r;h<0;)a++,h=Math.round(r+a*i);for(c=Math.max(r,0);c<o;c++)c===h&&(t.push(e[c]),a++,h=Math.round(r+a*i))}function gg(e){const t=e.length;let i,s;if(t<2)return!1;for(s=e[0],i=1;i<t;++i)if(e[i]-e[i-1]!==s)return!1;return s}const mg=e=>e==="left"?"right":e==="right"?"left":e,ra=(e,t,i)=>t==="top"||t==="left"?e[t]+i:e[t]-i,oa=(e,t)=>Math.min(t||e,e);function aa(e,t){const i=[],s=e.length/t,n=e.length;let r=0;for(;r<n;r+=s)i.push(e[Math.floor(r)]);return i}function bg(e,t,i){const s=e.ticks.length,n=Math.min(t,s-1),r=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(n),c;if(!(i&&(s===1?c=Math.max(l-r,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<r-a||l>o+a)))return l}function yg(e,t){D(e,i=>{const s=i.gc,n=s.length/2;let r;if(n>t){for(r=0;r<n;++r)delete i.data[s[r]];s.splice(0,n)}})}function ci(e){return e.drawTicks?e.tickLength:0}function la(e,t){if(!e.display)return 0;const i=_t(e.font,t),s=Nt(e.padding);return(Q(e.text)?e.text.length:1)*i.lineHeight+s.height}function vg(e,t){return Ge(e,{scale:t,type:"scale"})}function _g(e,t,i){return Ge(e,{tick:i,index:t,type:"tick"})}function wg(e,t,i){let s=Af(e);return(i&&t!=="right"||!i&&t==="right")&&(s=mg(s)),s}function xg(e,t,i,s){const{top:n,left:r,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:h}=l;let u=0,d,f,y;const b=o-n,p=a-r;if(e.isHorizontal()){if(f=Lo(s,r,a),I(i)){const g=Object.keys(i)[0],m=i[g];y=h[g].getPixelForValue(m)+b-t}else i==="center"?y=(c.bottom+c.top)/2+b-t:y=ra(e,i,t);d=a-r}else{if(I(i)){const g=Object.keys(i)[0],m=i[g];f=h[g].getPixelForValue(m)-p+t}else i==="center"?f=(c.left+c.right)/2-p+t:f=ra(e,i,t);y=Lo(s,o,n),u=i==="left"?-et:et}return{titleX:f,titleY:y,maxWidth:d,rotation:u}}class Je extends Ze{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,i){return t}getUserBounds(){let{_userMin:t,_userMax:i,_suggestedMin:s,_suggestedMax:n}=this;return t=St(t,Number.POSITIVE_INFINITY),i=St(i,Number.NEGATIVE_INFINITY),s=St(s,Number.POSITIVE_INFINITY),n=St(n,Number.NEGATIVE_INFINITY),{min:St(t,s),max:St(i,n),minDefined:bt(t),maxDefined:bt(i)}}getMinMax(t){let{min:i,max:s,minDefined:n,maxDefined:r}=this.getUserBounds(),o;if(n&&r)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),n||(i=Math.min(i,o.min)),r||(s=Math.max(s,o.max));return i=r&&i>s?s:i,s=n&&i>s?i:s,{min:St(i,St(s,i)),max:St(s,St(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){j(this.options.beforeUpdate,[this])}update(t,i,s){const{beginAtZero:n,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=jf(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?aa(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=hg(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,i,s;this.isHorizontal()?(i=this.left,s=this.right):(i=this.top,s=this.bottom,t=!t),this._startPixel=i,this._endPixel=s,this._reversePixels=t,this._length=s-i,this._alignToPixels=this.options.alignToPixels}afterUpdate(){j(this.options.afterUpdate,[this])}beforeSetDimensions(){j(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(){j(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),j(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){j(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const i=this.options.ticks;let s,n,r;for(s=0,n=t.length;s<n;s++)r=t[s],r.label=j(i.callback,[r.value,s,t],this)}afterTickToLabelConversion(){j(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){j(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,i=t.ticks,s=oa(this.ticks.length,t.ticks.maxTicksLimit),n=i.minRotation||0,r=i.maxRotation;let o=n,a,l,c;if(!this._isVisible()||!i.display||n>=r||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=ct(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),u+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-ci(t.grid)-i.padding-la(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),o=yf(Math.min(Math.asin(ct((h.highest.height+6)/a,-1,1)),Math.asin(ct(l/c,-1,1))-Math.asin(ct(d/c,-1,1)))),o=Math.max(n,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){j(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){j(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:i,options:{ticks:s,title:n,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=la(n,i.options.font);if(a?(t.width=this.maxWidth,t.height=ci(r)+l):(t.height=this.maxHeight,t.width=ci(r)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=s.padding*2,y=de(this.labelRotation),b=Math.cos(y),p=Math.sin(y);if(a){const g=s.mirror?0:p*u.width+b*d.height;t.height=Math.min(this.maxHeight,t.height+g+f)}else{const g=s.mirror?0:b*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+g+f)}this._calculatePadding(c,h,p,b)}}this._handleMargins(),a?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,s,n){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,f=0;l?c?(d=n*t.width,f=s*i.height):(d=s*t.height,f=n*i.width):r==="start"?f=i.width:r==="end"?d=t.width:r!=="inner"&&(d=t.width/2,f=i.width/2),this.paddingLeft=Math.max((d-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+o)*this.width/(this.width-u),0)}else{let h=i.height/2,u=t.height/2;r==="start"?(h=0,u=t.height):r==="end"&&(h=i.height,u=0),this.paddingTop=h+o,this.paddingBottom=u+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){j(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:i}=this.options;return i==="top"||i==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let i,s;for(i=0,s=t.length;i<s;i++)O(t[i].label)&&(t.splice(i,1),s--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const i=this.options.ticks.sampleSize;let s=this.ticks;i<s.length&&(s=aa(s,i)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,i,s){const{ctx:n,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(i/oa(i,s));let c=0,h=0,u,d,f,y,b,p,g,m,w,v,_;for(u=0;u<i;u+=l){if(y=t[u].label,b=this._resolveTickFontOptions(u),n.font=p=b.string,g=r[p]=r[p]||{data:{},gc:[]},m=b.lineHeight,w=v=0,!O(y)&&!Q(y))w=Bo(n,g.data,g.gc,w,y),v=m;else if(Q(y))for(d=0,f=y.length;d<f;++d)_=y[d],!O(_)&&!Q(_)&&(w=Bo(n,g.data,g.gc,w,_),v+=m);o.push(w),a.push(v),c=Math.max(w,c),h=Math.max(v,h)}yg(r,i);const E=o.indexOf(c),S=a.indexOf(h),A=k=>({width:o[k]||0,height:a[k]||0});return{first:A(0),last:A(i-1),widest:A(E),highest:A(S),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const i=this._startPixel+t*this._length;return _f(this._alignToPixels?ae(this.chart,i,0):i)}getDecimalForPixel(t){const i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){const i=this.ticks||[];if(t>=0&&t<i.length){const s=i[t];return s.$context||(s.$context=_g(this.getContext(),t,s))}return this.$context||(this.$context=vg(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,i=de(this.labelRotation),s=Math.abs(Math.cos(i)),n=Math.abs(Math.sin(i)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const i=this.axis,s=this.chart,n=this.options,{grid:r,position:o,border:a}=n,l=r.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),d=ci(r),f=[],y=a.setContext(this.getContext()),b=y.display?y.width:0,p=b/2,g=function(V){return ae(s,V,b)};let m,w,v,_,E,S,A,k,P,R,F,it;if(o==="top")m=g(this.bottom),S=this.bottom-d,k=m-p,R=g(t.top)+p,it=t.bottom;else if(o==="bottom")m=g(this.top),R=t.top,it=g(t.bottom)-p,S=m+p,k=this.top+d;else if(o==="left")m=g(this.right),E=this.right-d,A=m-p,P=g(t.left)+p,F=t.right;else if(o==="right")m=g(this.left),P=t.left,F=g(t.right)-p,E=m+p,A=this.left+d;else if(i==="x"){if(o==="center")m=g((t.top+t.bottom)/2+.5);else if(I(o)){const V=Object.keys(o)[0],X=o[V];m=g(this.chart.scales[V].getPixelForValue(X))}R=t.top,it=t.bottom,S=m+p,k=S+d}else if(i==="y"){if(o==="center")m=g((t.left+t.right)/2);else if(I(o)){const V=Object.keys(o)[0],X=o[V];m=g(this.chart.scales[V].getPixelForValue(X))}E=m-p,A=E-d,P=t.left,F=t.right}const $=N(n.ticks.maxTicksLimit,u),H=Math.max(1,Math.ceil(u/$));for(w=0;w<u;w+=H){const V=this.getContext(w),X=r.setContext(V),yt=a.setContext(V),st=X.lineWidth,Me=X.color,ts=yt.dash||[],Pe=yt.dashOffset,ni=X.tickWidth,se=X.tickColor,ri=X.tickBorderDash||[],ne=X.tickBorderDashOffset;v=bg(this,w,l),v!==void 0&&(_=ae(s,v,st),c?E=A=P=F=_:S=k=R=it=_,f.push({tx1:E,ty1:S,tx2:A,ty2:k,x1:P,y1:R,x2:F,y2:it,width:st,color:Me,borderDash:ts,borderDashOffset:Pe,tickWidth:ni,tickColor:se,tickBorderDash:ri,tickBorderDashOffset:ne}))}return this._ticksLength=u,this._borderValue=m,f}_computeLabelItems(t){const i=this.axis,s=this.options,{position:n,ticks:r}=s,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=r,d=ci(s.grid),f=d+h,y=u?-h:f,b=-de(this.labelRotation),p=[];let g,m,w,v,_,E,S,A,k,P,R,F,it="middle";if(n==="top")E=this.bottom-y,S=this._getXAxisLabelAlignment();else if(n==="bottom")E=this.top+y,S=this._getXAxisLabelAlignment();else if(n==="left"){const H=this._getYAxisLabelAlignment(d);S=H.textAlign,_=H.x}else if(n==="right"){const H=this._getYAxisLabelAlignment(d);S=H.textAlign,_=H.x}else if(i==="x"){if(n==="center")E=(t.top+t.bottom)/2+f;else if(I(n)){const H=Object.keys(n)[0],V=n[H];E=this.chart.scales[H].getPixelForValue(V)+f}S=this._getXAxisLabelAlignment()}else if(i==="y"){if(n==="center")_=(t.left+t.right)/2-f;else if(I(n)){const H=Object.keys(n)[0],V=n[H];_=this.chart.scales[H].getPixelForValue(V)}S=this._getYAxisLabelAlignment(d).textAlign}i==="y"&&(l==="start"?it="top":l==="end"&&(it="bottom"));const $=this._getLabelSizes();for(g=0,m=a.length;g<m;++g){w=a[g],v=w.label;const H=r.setContext(this.getContext(g));A=this.getPixelForTick(g)+r.labelOffset,k=this._resolveTickFontOptions(g),P=k.lineHeight,R=Q(v)?v.length:1;const V=R/2,X=H.color,yt=H.textStrokeColor,st=H.textStrokeWidth;let Me=S;o?(_=A,S==="inner"&&(g===m-1?Me=this.options.reverse?"left":"right":g===0?Me=this.options.reverse?"right":"left":Me="center"),n==="top"?c==="near"||b!==0?F=-R*P+P/2:c==="center"?F=-$.highest.height/2-V*P+P:F=-$.highest.height+P/2:c==="near"||b!==0?F=P/2:c==="center"?F=$.highest.height/2-V*P:F=$.highest.height-R*P,u&&(F*=-1),b!==0&&!H.showLabelBackdrop&&(_+=P/2*Math.sin(b))):(E=A,F=(1-R)*P/2);let ts;if(H.showLabelBackdrop){const Pe=Nt(H.backdropPadding),ni=$.heights[g],se=$.widths[g];let ri=F-Pe.top,ne=0-Pe.left;switch(it){case"middle":ri-=ni/2;break;case"bottom":ri-=ni;break}switch(S){case"center":ne-=se/2;break;case"right":ne-=se;break;case"inner":g===m-1?ne-=se:g>0&&(ne-=se/2);break}ts={left:ne,top:ri,width:se+Pe.width,height:ni+Pe.height,color:H.backdropColor}}p.push({label:v,font:k,textOffset:F,options:{rotation:b,color:X,strokeColor:yt,strokeWidth:st,textAlign:Me,textBaseline:it,translation:[_,E],backdrop:ts}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:i}=this.options;if(-de(this.labelRotation))return t==="top"?"left":"right";let n="center";return i.align==="start"?n="left":i.align==="end"?n="right":i.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:i,ticks:{crossAlign:s,mirror:n,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,h;return i==="left"?n?(h=this.right+r,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):i==="right"?n?(h=this.left+r,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,i=this.options.position;if(i==="left"||i==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(i==="top"||i==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:i},left:s,top:n,width:r,height:o}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(s,n,r,o),t.restore())}getLineWidthForValue(t){const i=this.options.grid;if(!this._isVisible()||!i.display)return 0;const n=this.ticks.findIndex(r=>r.value===t);return n>=0?i.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const i=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(i.display)for(r=0,o=n.length;r<o;++r){const l=n[r];i.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),i.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:i,options:{border:s,grid:n}}=this,r=s.setContext(this.getContext()),o=s.display?r.width:0;if(!o)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,u,d;this.isHorizontal()?(c=ae(t,this.left,o)-o/2,h=ae(t,this.right,a)+a/2,u=d=l):(u=ae(t,this.top,o)-o/2,d=ae(t,this.bottom,a)+a/2,c=h=l),i.save(),i.lineWidth=r.width,i.strokeStyle=r.color,i.beginPath(),i.moveTo(c,u),i.lineTo(h,d),i.stroke(),i.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&oc(s,n);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,h=o.textOffset;No(s,c,0,h,l,a)}n&&ac(s)}drawTitle(){const{ctx:t,options:{position:i,title:s,reverse:n}}=this;if(!s.display)return;const r=_t(s.font),o=Nt(s.padding),a=s.align;let l=r.lineHeight/2;i==="bottom"||i==="center"||I(i)?(l+=o.bottom,Q(s.text)&&(l+=r.lineHeight*(s.text.length-1))):l+=o.top;const{titleX:c,titleY:h,maxWidth:u,rotation:d}=xg(this,l,i,a);No(t,s.text,0,0,r,{color:s.color,maxWidth:u,rotation:d,textAlign:wg(a,i,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,i=t.ticks&&t.ticks.z||0,s=N(t.grid&&t.grid.z,-1),n=N(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Je.prototype.draw?[{z:i,draw:r=>{this.draw(r)}}]:[{z:s,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:i,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const i=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let r,o;for(r=0,o=i.length;r<o;++r){const a=i[r];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const i=this.options.ticks.setContext(this.getContext(t));return _t(i.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class us{constructor(t,i,s){this.type=t,this.scope=i,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const i=Object.getPrototypeOf(t);let s;Ag(i)&&(s=this.register(i));const n=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in n||(n[r]=t,Sg(t,o,s),this.override&&G.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const i=this.items,s=t.id,n=this.scope;s in i&&delete i[s],n&&s in G[n]&&(delete G[n][s],this.override&&delete Se[s])}}function Sg(e,t,i){const s=Tt(Object.create(null),[i?G.get(i):{},G.get(t),e.defaults]);G.set(t,s),e.defaultRoutes&&Eg(t,e.defaultRoutes),e.descriptors&&G.describe(t,e.descriptors)}function Eg(e,t){Object.keys(t).forEach(i=>{const s=i.split("."),n=s.pop(),r=[e].concat(s).join("."),o=t[i].split("."),a=o.pop(),l=o.join(".");G.route(r,n,l,a)})}function Ag(e){return"id"in e&&"defaults"in e}class kg{constructor(){this.controllers=new us(ki,"datasets",!0),this.elements=new us(Ze,"elements"),this.plugins=new us(Object,"plugins"),this.scales=new us(Je,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,i,s){[...i].forEach(n=>{const r=s||this._getRegistryForType(n);s||r.isForType(n)||r===this.plugins&&n.id?this._exec(t,r,n):D(n,o=>{const a=s||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,i,s){const n=Or(t);j(s["before"+n],[],s),i[t](s),j(s["after"+n],[],s)}_getRegistryForType(t){for(let i=0;i<this._typedRegistries.length;i++){const s=this._typedRegistries[i];if(s.isForType(t))return s}return this.plugins}_get(t,i,s){const n=i.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var At=new kg;class Mg{constructor(){this._init=void 0}notify(t,i,s,n){if(i==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const r=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(r,t,i,s);return i==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,i,s,n){n=n||{};for(const r of t){const o=r.plugin,a=o[s],l=[i,n,r.options];if(j(a,l,o)===!1&&n.cancelable)return!1}return!0}invalidate(){O(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const i=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),i}_createDescriptors(t,i){const s=t&&t.config,n=N(s.options&&s.options.plugins,{}),r=Pg(s);return n===!1&&!i?[]:Rg(t,r,n,i)}_notifyStateChanges(t){const i=this._oldCache||[],s=this._cache,n=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(n(i,s),t,"stop"),this._notify(n(s,i),t,"start")}}function Pg(e){const t={},i=[],s=Object.keys(At.plugins.items);for(let r=0;r<s.length;r++)i.push(At.getPlugin(s[r]));const n=e.plugins||[];for(let r=0;r<n.length;r++){const o=n[r];i.indexOf(o)===-1&&(i.push(o),t[o.id]=!0)}return{plugins:i,localIds:t}}function Tg(e,t){return!t&&e===!1?null:e===!0?{}:e}function Rg(e,{plugins:t,localIds:i},s,n){const r=[],o=e.getContext();for(const a of t){const l=a.id,c=Tg(s[l],n);c!==null&&r.push({plugin:a,options:Cg(e.config,{plugin:a,local:i[l]},c,o)})}return r}function Cg(e,{plugin:t,local:i},s,n){const r=e.pluginScopeKeys(t),o=e.getOptionScopes(s,r);return i&&t.defaults&&o.push(t.defaults),e.createResolver(o,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Zn(e,t){const i=G.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||i.indexAxis||"x"}function Lg(e,t){let i=e;return e==="_index_"?i=t:e==="_value_"&&(i=t==="x"?"y":"x"),i}function Ig(e,t){return e===t?"_index_":"_value_"}function ca(e){if(e==="x"||e==="y"||e==="r")return e}function Og(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Jn(e,...t){if(ca(e))return e;for(const i of t){const s=i.axis||Og(i.position)||e.length>1&&ca(e[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ha(e,t,i){if(i[t+"AxisID"]===e)return{axis:t}}function Fg(e,t){if(t.data&&t.data.datasets){const i=t.data.datasets.filter(s=>s.xAxisID===e||s.yAxisID===e);if(i.length)return ha(e,"x",i[0])||ha(e,"y",i[0])}return{}}function Dg(e,t){const i=Se[e.type]||{scales:{}},s=t.scales||{},n=Zn(e.type,t),r=Object.create(null);return Object.keys(s).forEach(o=>{const a=s[o];if(!I(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Jn(o,a,Fg(o,e),G.scales[a.type]),c=Ig(l,n),h=i.scales||{};r[o]=xi(Object.create(null),[{axis:l},a,h[l],h[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||Zn(a,t),h=(Se[a]||{}).scales||{};Object.keys(h).forEach(u=>{const d=Lg(u,l),f=o[d+"AxisID"]||d;r[f]=r[f]||Object.create(null),xi(r[f],[{axis:d},s[f],h[u]])})}),Object.keys(r).forEach(o=>{const a=r[o];xi(a,[G.scales[a.type],G.scale])}),r}function wc(e){const t=e.options||(e.options={});t.plugins=N(t.plugins,{}),t.scales=Dg(e,t)}function xc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Bg(e){return e=e||{},e.data=xc(e.data),wc(e),e}const ua=new Map,Sc=new Set;function ds(e,t){let i=ua.get(e);return i||(i=t(),ua.set(e,i),Sc.add(i)),i}const hi=(e,t,i)=>{const s=qe(t,i);s!==void 0&&e.add(s)};class Hg{constructor(t){this._config=Bg(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=xc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),wc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ds(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,i){return ds(`${t}.transition.${i}`,()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,i){return ds(`${t}-${i}`,()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]])}pluginScopeKeys(t){const i=t.id,s=this.type;return ds(`${s}-plugin-${i}`,()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,i){const s=this._scopeCache;let n=s.get(t);return(!n||i)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,i,s){const{options:n,type:r}=this,o=this._cachedScopes(t,s),a=o.get(i);if(a)return a;const l=new Set;i.forEach(h=>{t&&(l.add(t),h.forEach(u=>hi(l,t,u))),h.forEach(u=>hi(l,n,u)),h.forEach(u=>hi(l,Se[r]||{},u)),h.forEach(u=>hi(l,G,u)),h.forEach(u=>hi(l,Kn,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Sc.has(i)&&o.set(i,c),c}chartOptionScopes(){const{options:t,type:i}=this;return[t,Se[i]||{},G.datasets[i]||{},{type:i},G,Kn]}resolveNamedOptions(t,i,s,n=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=da(this._resolverCache,t,n);let l=o;if(zg(o,i)){r.$shared=!1,s=Qt(s)?s():s;const c=this.createResolver(t,s,a);l=$e(o,s,c)}for(const c of i)r[c]=l[c];return r}createResolver(t,i,s=[""],n){const{resolver:r}=da(this._resolverCache,t,s);return I(i)?$e(r,i,void 0,n):r}}function da(e,t,i){let s=e.get(t);s||(s=new Map,e.set(t,s));const n=i.join();let r=s.get(n);return r||(r={resolver:Hr(t,i),subPrefixes:i.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,r)),r}const Ng=e=>I(e)&&Object.getOwnPropertyNames(e).some(t=>Qt(e[t]));function zg(e,t){const{isScriptable:i,isIndexable:s}=cc(e);for(const n of t){const r=i(n),o=s(n),a=(o||r)&&e[n];if(r&&(Qt(a)||Ng(a))||o&&Q(a))return!0}return!1}var Vg="4.5.1";const qg=["top","bottom","left","right","chartArea"];function fa(e,t){return e==="top"||e==="bottom"||qg.indexOf(e)===-1&&t==="x"}function pa(e,t){return function(i,s){return i[e]===s[e]?i[t]-s[t]:i[e]-s[e]}}function ga(e){const t=e.chart,i=t.options.animation;t.notifyPlugins("afterRender"),j(i&&i.onComplete,[e],t)}function $g(e){const t=e.chart,i=t.options.animation;j(i&&i.onProgress,[e],t)}function Ec(e){return Vr()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Is={},ma=e=>{const t=Ec(e);return Object.values(Is).filter(i=>i.canvas===t).pop()};function jg(e,t,i){const s=Object.keys(e);for(const n of s){const r=+n;if(r>=t){const o=e[n];delete e[n],(i>0||r>t)&&(e[r+i]=o)}}}function Wg(e,t,i,s){return!i||e.type==="mouseout"?null:s?t:e}class vt{static register(...t){At.add(...t),ba()}static unregister(...t){At.remove(...t),ba()}constructor(t,i){const s=this.config=new Hg(i),n=Ec(t),r=ma(n);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||cg(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=of(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Mg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ef(u=>this.update(u),o.resizeDelay||0),this._dataChanges=[],Is[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Lt.listen(this,"complete",ga),Lt.listen(this,"progress",$g),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:i},width:s,height:n,_aspectRatio:r}=this;return O(t)?i&&r?r:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return At}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():qo(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ho(this.canvas,this.ctx),this}stop(){return Lt.stop(this),this}resize(t,i){Lt.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){const s=this.options,n=this.canvas,r=s.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,i,r),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,qo(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),j(s.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const i=this.options.scales||{};D(i,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,i=t.scales,s=this.scales,n=Object.keys(s).reduce((o,a)=>(o[a]=!1,o),{});let r=[];i&&(r=r.concat(Object.keys(i).map(o=>{const a=i[o],l=Jn(o,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),D(r,o=>{const a=o.options,l=a.id,c=Jn(l,a),h=N(a.type,o.dtype);(a.position===void 0||fa(a.position,c)!==fa(o.dposition))&&(a.position=o.dposition),n[l]=!0;let u=null;if(l in s&&s[l].type===h)u=s[l];else{const d=At.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),s[u.id]=u}u.init(a,t)}),D(n,(o,a)=>{o||delete s[a]}),D(s,o=>{cs.configure(this,o,o.options),cs.addBox(this,o)})}_updateMetasets(){const t=this._metasets,i=this.data.datasets.length,s=t.length;if(t.sort((n,r)=>n.index-r.index),s>i){for(let n=i;n<s;++n)this._destroyDatasetMeta(n);t.splice(i,s-i)}this._sortedMetasets=t.slice(0).sort(pa("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach((s,n)=>{i.filter(r=>r===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],i=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=i.length;s<n;s++){const r=i[s];let o=this.getDatasetMeta(s);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(s),o=this.getDatasetMeta(s)),o.type=a,o.indexAxis=r.indexAxis||Zn(a,this.options),o.order=r.order||0,o.index=s,o.label=""+r.label,o.visible=this.isDatasetVisible(s),o.controller)o.controller.updateIndex(s),o.controller.linkScales();else{const l=At.getController(a),{datasetElementType:c,dataElementType:h}=G.datasets[a];Object.assign(l,{dataElementType:At.getElement(h),datasetElementType:c&&At.getElement(c)}),o.controller=new l(this,s),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){D(this.data.datasets,(t,i)=>{this.getDatasetMeta(i).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const i=this.config;i.update();const s=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:u}=this.getDatasetMeta(c),d=!n&&r.indexOf(u)===-1;u.buildOrUpdateElements(d),o=Math.max(+u.getMaxOverflow(),o)}o=this._minPadding=s.layout.autoPadding?o:0,this._updateLayout(o),n||D(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(pa("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){D(this.scales,t=>{cs.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,i=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Mo(i,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:r}of i){const o=s==="_removeElements"?-r:r;jg(t,n,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const i=this.data.datasets.length,s=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),n=s(0);for(let r=1;r<i;r++)if(!Mo(n,s(r)))return;return Array.from(n).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;cs.update(this,this.width,this.height,t);const i=this.chartArea,s=i.width<=0||i.height<=0;this._layers=[],D(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,r)=>{n._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let i=0,s=this.data.datasets.length;i<s;++i)this.getDatasetMeta(i).controller.configure();for(let i=0,s=this.data.datasets.length;i<s;++i)this._updateDataset(i,Qt(t)?t({datasetIndex:i}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,i){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:i,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(i),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Lt.has(this)?this.attached&&!Lt.running(this)&&Lt.start(this):(this.draw(),ga({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const i=this._layers;for(t=0;t<i.length&&i[t].z<=0;++t)i[t].draw(this.chartArea);for(this._drawDatasets();t<i.length;++t)i[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const i=this._sortedMetasets,s=[];let n,r;for(n=0,r=i.length;n<r;++n){const o=i[n];(!t||o.visible)&&s.push(o)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let i=t.length-1;i>=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const i=this.ctx,s={meta:t,index:t.index,cancelable:!0},n=dp(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&oc(i,n),t.controller.draw(),n&&ac(i),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Dr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,s,n){const r=qp.modes[i];return typeof r=="function"?r(this,t,s,n):[]}getDatasetMeta(t){const i=this.data.datasets[t],s=this._metasets;let n=s.filter(r=>r&&r._dataset===i).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Ge(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const i=this.data.datasets[t];if(!i)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!i.hidden}setDatasetVisibility(t,i){const s=this.getDatasetMeta(t);s.hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,s){const n=s?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,n);Oi(i)?(r.data[i].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),o.update(r,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){const i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),Lt.remove(this),t=0,i=this.data.datasets.length;t<i;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:i}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ho(t,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete Is[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,i=this.platform,s=(r,o)=>{i.addEventListener(this,r,o),t[r]=o},n=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};D(this.options.events,r=>s(r,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,i=this.platform,s=(l,c)=>{i.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(i.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",r),s("detach",o)};o=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),s("attach",a)},i.isAttached(this.canvas)?a():o()}unbindEvents(){D(this._listeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._listeners={},D(this._responsiveListeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,i,s){const n=s?"set":"remove";let r,o,a,l;for(i==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[n+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const i=this._active||[],s=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!qs(s,i)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,i))}notifyPlugins(t,i,s){return this._plugins.notify(this,t,i,s)}isPluginEnabled(t){return this._plugins._cache.filter(i=>i.plugin.id===t).length===1}_updateHoverStyles(t,i,s){const n=this.options.hover,r=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),o=r(i,t),a=s?t:r(t,i);o.length&&this.updateHoverStyle(o,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,i){const s={event:t,replay:i,cancelable:!0,inChartArea:this.isPointInArea(t)},n=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const r=this._handleEvent(t,i,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(r||s.changed)&&this.render(),this}_handleEvent(t,i,s){const{_active:n=[],options:r}=this,o=i,a=this._getActiveElements(t,n,s,o),l=df(t),c=Wg(t,this._lastEvent,s,l);s&&(this._lastEvent=null,j(r.onHover,[t,a,this],this),l&&j(r.onClick,[t,a,this],this));const h=!qs(a,n);
vendor: 4,931 bytes, line 44
44return(h||i)&&(this._active=a,this._updateHoverStyles(a,n,i)),this._lastEvent=c,h}_getActiveElements(t,i,s,n){if(t.type==="mouseout")return[];if(!s)return i;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}}x(vt,"defaults",G),x(vt,"instances",Is),x(vt,"overrides",Se),x(vt,"registry",At),x(vt,"version",Vg),x(vt,"getChart",ma);function ba(){return D(vt.instances,e=>e._plugins.invalidate())}function Ug(e,t,i){const{startAngle:s,x:n,y:r,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,u=Math.min(c/o,kt(s-i));if(e.beginPath(),e.arc(n,r,o-c/2,s+u/2,i-u/2),a>0){const d=Math.min(c/a,kt(s-i));e.arc(n,r,a+c/2,i-d/2,s+d/2,!0)}else{const d=Math.min(c/2,o*kt(s-i));if(h==="round")e.arc(n,r,d,i-U/2,s+U/2,!0);else if(h==="bevel"){const f=2*d*d,y=-f*Math.cos(i+U/2)+n,b=-f*Math.sin(i+U/2)+r,p=f*Math.cos(s+U/2)+n,g=f*Math.sin(s+U/2)+r;e.lineTo(y,b),e.lineTo(p,g)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Yg(e,t,i){const{startAngle:s,pixelMargin:n,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=n/a;e.beginPath(),e.arc(r,o,a,s-c,i+c),l>n?(c=n/l,e.arc(r,o,l,i+c,s-c,!0)):e.arc(r,o,n,i+et,s-et),e.closePath(),e.clip()}function Kg(e){return Br(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Xg(e,t,i,s){const n=Kg(e.options.borderRadius),r=(i-t)/2,o=Math.min(r,s*t/2),a=l=>{const c=(i-Math.min(r,l))*s/2;return ct(l,0,Math.min(r,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:ct(n.innerStart,0,o),innerEnd:ct(n.innerEnd,0,o)}}function Ce(e,t,i,s){return{x:i+e*Math.cos(t),y:s+e*Math.sin(t)}}function Ks(e,t,i,s,n,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+s+i-c,0),d=h>0?h+s+i+c:0;let f=0;const y=n-l;if(s){const H=h>0?h-s:0,V=u>0?u-s:0,X=(H+V)/2,yt=X!==0?y*X/(X+s):y;f=(y-yt)/2}const b=Math.max(.001,y*u-i/U)/u,p=(y-b)/2,g=l+p+f,m=n-p-f,{outerStart:w,outerEnd:v,innerStart:_,innerEnd:E}=Xg(t,d,u,m-g),S=u-w,A=u-v,k=g+w/S,P=m-v/A,R=d+_,F=d+E,it=g+_/R,$=m-E/F;if(e.beginPath(),r){const H=(k+P)/2;if(e.arc(o,a,u,k,H),e.arc(o,a,u,H,P),v>0){const st=Ce(A,P,o,a);e.arc(st.x,st.y,v,P,m+et)}const V=Ce(F,m,o,a);if(e.lineTo(V.x,V.y),E>0){const st=Ce(F,$,o,a);e.arc(st.x,st.y,E,m+et,$+Math.PI)}const X=(m-E/d+(g+_/d))/2;if(e.arc(o,a,d,m-E/d,X,!0),e.arc(o,a,d,X,g+_/d,!0),_>0){const st=Ce(R,it,o,a);e.arc(st.x,st.y,_,it+Math.PI,g-et)}const yt=Ce(S,g,o,a);if(e.lineTo(yt.x,yt.y),w>0){const st=Ce(S,k,o,a);e.arc(st.x,st.y,w,g-et,k)}}else{e.moveTo(o,a);const H=Math.cos(k)*u+o,V=Math.sin(k)*u+a;e.lineTo(H,V);const X=Math.cos(P)*u+o,yt=Math.sin(P)*u+a;e.lineTo(X,yt)}e.closePath()}function Gg(e,t,i,s,n){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Ks(e,t,i,s,l,n);for(let c=0;c<r;++c)e.fill();isNaN(a)||(l=o+(a%ht||ht))}return Ks(e,t,i,s,l,n),e.fill(),l}function Zg(e,t,i,s,n){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:u,borderDashOffset:d,borderRadius:f}=l,y=l.borderAlign==="inner";if(!c)return;e.setLineDash(u||[]),e.lineDashOffset=d,y?(e.lineWidth=c*2,e.lineJoin=h||"round"):(e.lineWidth=c,e.lineJoin=h||"bevel");let b=t.endAngle;if(r){Ks(e,t,i,s,b,n);for(let p=0;p<r;++p)e.stroke();isNaN(a)||(b=o+(a%ht||ht))}y&&Yg(e,t,b),l.selfJoin&&b-o>=U&&f===0&&h!=="miter"&&Ug(e,t,b),r||(Ks(e,t,i,s,b,n),e.stroke())}class yi extends Ze{constructor(i){super();x(this,"circumference");x(this,"endAngle");x(this,"fullCircles");x(this,"innerRadius");x(this,"outerRadius");x(this,"pixelMargin");x(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,i&&Object.assign(this,i)}inRange(i,s,n){const r=this.getProps(["x","y"],n),{angle:o,distance:a}=Zl(r,{x:i,y:s}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=(this.options.spacing+this.options.borderWidth)/2,y=N(d,c-l),b=Jl(o,l,c)&&l!==c,p=y>=ht||b,g=Un(a,h+f,u+f);return p&&g}getCenterPoint(i){const{x:s,y:n,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:c,spacing:h}=this.options,u=(r+o)/2,d=(a+l+h+c)/2;return{x:s+Math.cos(u)*d,y:n+Math.sin(u)*d}}tooltipPosition(i){return this.getCenterPoint(i)}draw(i){const{options:s,circumference:n}=this,r=(s.offset||0)/4,o=(s.spacing||0)/2,a=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=n>ht?Math.floor(n/ht):0,n===0||this.innerRadius<0||this.outerRadius<0)return;i.save();const l=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(U,n||0)),h=r*c;i.fillStyle=s.backgroundColor,i.strokeStyle=s.borderColor,Gg(i,this,h,o,a),Zg(i,this,h,o,a),i.restore(
vendor: 13,013 bytes, lines 44-46
44)}}x(yi,"id","arc"),x(yi,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),x(yi,"defaultRoutes",{backgroundColor:"backgroundColor"}),x(yi,"descriptors",{_scriptable:!0,_indexable:i=>i!=="borderDash"});function ya(e,t,i,s){const n=e.options,{[i]:r}=e.getProps([i],s);return Math.abs(t-r)<n.radius+n.hitRadius}class Os extends Ze{constructor(i){super();x(this,"parsed");x(this,"skip");x(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,i&&Object.assign(this,i)}inRange(i,s,n){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],n);return Math.pow(i-o,2)+Math.pow(s-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(i,s){return ya(this,i,"x",s)}inYRange(i,s){return ya(this,i,"y",s)}getCenterPoint(i){const{x:s,y:n}=this.getProps(["x","y"],i);return{x:s,y:n}}size(i){i=i||this.options||{};let s=i.radius||0;s=Math.max(s,s&&i.hoverRadius||0);const n=s&&i.borderWidth||0;return(s+n)*2}draw(i,s){const n=this.options;this.skip||n.radius<.1||!Dr(this,s,this.size(n)/2)||(i.strokeStyle=n.borderColor,i.lineWidth=n.borderWidth,i.fillStyle=n.backgroundColor,Xn(i,n,this.x,this.y))}getRange(){const i=this.options||{};return i.radius+i.hitRadius}}x(Os,"id","point"),x(Os,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),x(Os,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ac(e,t){const{x:i,y:s,base:n,width:r,height:o}=e.getProps(["x","y","base","width","height"],t);let a,l,c,h,u;return e.horizontal?(u=o/2,a=Math.min(i,n),l=Math.max(i,n),c=s-u,h=s+u):(u=r/2,a=i-u,l=i+u,c=Math.min(s,n),h=Math.max(s,n)),{left:a,top:c,right:l,bottom:h}}function Xt(e,t,i,s){return e?0:ct(t,i,s)}function Jg(e,t,i){const s=e.options.borderWidth,n=e.borderSkipped,r=lc(s);return{t:Xt(n.top,r.top,0,i),r:Xt(n.right,r.right,0,t),b:Xt(n.bottom,r.bottom,0,i),l:Xt(n.left,r.left,0,t)}}function Qg(e,t,i){const{enableBorderRadius:s}=e.getProps(["enableBorderRadius"]),n=e.options.borderRadius,r=Ai(n),o=Math.min(t,i),a=e.borderSkipped,l=s||I(n);return{topLeft:Xt(!l||a.top||a.left,r.topLeft,0,o),topRight:Xt(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Xt(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Xt(!l||a.bottom||a.right,r.bottomRight,0,o)}}function tm(e){const t=Ac(e),i=t.right-t.left,s=t.bottom-t.top,n=Jg(e,i/2,s/2),r=Qg(e,i/2,s/2);return{outer:{x:t.left,y:t.top,w:i,h:s,radius:r},inner:{x:t.left+n.l,y:t.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,r.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(n.b,n.r))}}}}function In(e,t,i,s){const n=t===null,r=i===null,a=e&&!(n&&r)&&Ac(e,s);return a&&(n||Un(t,a.left,a.right))&&(r||Un(i,a.top,a.bottom))}function em(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function im(e,t){e.rect(t.x,t.y,t.w,t.h)}function On(e,t,i={}){const s=e.x!==i.x?-t:0,n=e.y!==i.y?-t:0,r=(e.x+e.w!==i.x+i.w?t:0)-s,o=(e.y+e.h!==i.y+i.h?t:0)-n;return{x:e.x+s,y:e.y+n,w:e.w+r,h:e.h+o,radius:e.radius}}class Mi extends Ze{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:i,options:{borderColor:s,backgroundColor:n}}=this,{inner:r,outer:o}=tm(this),a=em(o.radius)?Gn:im;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,On(o,i,r)),t.clip(),a(t,On(r,-i,o)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),a(t,On(r,i)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,i,s){return In(this,t,i,s)}inXRange(t,i){return In(this,t,null,i)}inYRange(t,i){return In(this,null,t,i)}getCenterPoint(t){const{x:i,y:s,base:n,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(i+n)/2:i,y:r?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}x(Mi,"id","bar"),x(Mi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),x(Mi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const vi={average(e){if(!e.length)return!1;let t,i,s=new Set,n=0,r=0;for(t=0,i=e.length;t<i;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),n+=l.y,++r}}return r===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:n/r}},nearest(e,t){if(!e.length)return!1;let i=t.x,s=t.y,n=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=e.length;r<o;++r){const l=e[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=vf(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();i=l.x,s=l.y}return{x:i,y:s}}};function Et(e,t){return t&&(Q(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function It(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(` 45`)>-1?e.split(` 46`):e}function sm(e,t){const{element:i,datasetIndex:s,index:n}=t,r=e.getDatasetMeta(s).controller,{label:o,value:a}=r.getLabelAndValue(n);return{chart:e,label:o,parsed:r.getParsed(n),raw:e.data.datasets[s].data[n],formattedValue:a,dataset:r.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function va(e,t){const i=e.chart.ctx,{body:s,footer:n,title:r}=e,{boxWidth:o,boxHeight:a}=t,l=_t(t.bodyFont),c=_t(t.titleFont),h=_t(t.footerFont),u=r.length,d=n.length,f=s.length,y=Nt(t.padding);let b=y.height,p=0,g=s.reduce((v,_)=>v+_.before.length+_.lines.length+_.after.length,0);if(g+=e.beforeBody.length+e.afterBody.length,u&&(b+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),g){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=f*v+(g-f)*l.lineHeight+(g-1)*t.bodySpacing}d&&(b+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let m=0;const w=function(v){p=Math.max(p,i.measureText(v).width+m)};return i.save(),i.font=c.string,D(e.title,w),i.font=l.string,D(e.beforeBody.concat(e.afterBody),w),m=t.displayColors?o+2+t.boxPadding:0,D(s,v=>{D(v.before,w),D(v.lines,w),D(v.after,w)}),m=0,i.font=h.string,D(e.footer,w),i.restore(),p+=y.width,{width:p,height:b}}function nm(e,t){const{y:i,height:s}=t;return i<s/2?"top":i>e.height-s/2?"bottom":"center"}function rm(e,t,i,s){const{x:n,width:r}=s,o=i.caretSize+i.caretPadding;if(e==="left"&&n+r+o>t.width||e==="right"&&n-r-o<0)return!0}function om(e,t,i,s){const{x:n,width:r}=i,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),rm(c,e,t,i)&&(c="center"),c}function _a(e,t,i){const s=i.yAlign||t.yAlign||nm(e,i);return{xAlign:i.xAlign||t.xAlign||om(e,t,i,s),yAlign:s}}function am(e,t){let{x:i,width:s}=e;return t==="right"?i-=s:t==="center"&&(i-=s/2),i}function lm(e,t,i){let{y:s,height:n}=e;return t==="top"?s+=i:t==="bottom"?s-=n+i:s-=n/2,s}function wa(e,t,i,s){const{caretSize:n,caretPadding:r,cornerRadius:o}=e,{xAlign:a,yAlign:l}=i,c=n+r,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=Ai(o);let y=am(t,a);const b=lm(t,l,c);return l==="center"?a==="left"?y+=c:a==="right"&&(y-=c):a==="left"?y-=Math.max(h,d)+n:a==="right"&&(y+=Math.max(u,f)+n),{x:ct(y,0,s.width-t.width),y:ct(b,0,s.height-t.height)}}function fs(e,t,i){const s=Nt(i.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-s.right:e.x+s.left}function xa(e){return Et([],It(e))}function cm(e,t,i){return Ge(e,{tooltip:t,tooltipItems:i,type:"tooltip"})}function Sa(e,t){const i=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return i?e.override(i):e}const kc={beforeTitle:Ct,title(e){if(e.length>0){const t=e[0],i=t.chart.data.labels,s=i?i.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return i[t.dataIndex]}return""},afterTitle:Ct,beforeBody:Ct,beforeLabel:Ct,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const i=e.formattedValue;return O(i)||(t+=i),t},labelColor(e){const i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:Ct,afterBody:Ct,beforeFooter:Ct,footer:Ct,afterFooter:Ct};function rt(e,t,i,s){const n=e[t].call(i,s);return typeof n>"u"?kc[t].call(i,s):n}class Qn extends Ze{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const i=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&i.options.animation&&s.animations,r=new fc(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=cm(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,i){const{callbacks:s}=i,n=rt(s,"beforeTitle",this,t),r=rt(s,"title",this,t),o=rt(s,"afterTitle",this,t);let a=[];return a=Et(a,It(n)),a=Et(a,It(r)),a=Et(a,It(o)),a}getBeforeBody(t,i){return xa(rt(i.callbacks,"beforeBody",this,t))}getBody(t,i){const{callbacks:s}=i,n=[];return D(t,r=>{const o={before:[],lines:[],after:[]},a=Sa(s,r);Et(o.before,It(rt(a,"beforeLabel",this,r))),Et(o.lines,rt(a,"label",this,r)),Et(o.after,It(rt(a,"afterLabel",this,r))),n.push(o)}),n}getAfterBody(t,i){return xa(rt(i.callbacks,"afterBody",this,t))}getFooter(t,i){const{callbacks:s}=i,n=rt(s,"beforeFooter",this,t),r=rt(s,"footer",this,t),o=rt(s,"afterFooter",this,t);let a=[];return a=Et(a,It(n)),a=Et(a,It(r)),a=Et(a,It(o)),a}_createItems(t){const i=this._active,s=this.chart.data,n=[],r=[],o=[];let a=[],l,c;for(l=0,c=i.length;l<c;++l)a.push(sm(this.chart,i[l]));return t.filter&&(a=a.filter((h,u,d)=>t.filter(h,u,d,s))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,s))),D(a,h=>{const u=Sa(t.callbacks,h);n.push(rt(u,"labelColor",this,h)),r.push(rt(u,"labelPointStyle",this,h)),o.push(rt(u,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,i){const s=this.options.setContext(this.getContext()),n=this._active;let r,o=[];if(!n.length)this.opacity!==0&&(r={opacity:0});else{const a=vi[s.position].call(this,n,this._eventPosition);o=this._createItems(s),this.title=this.getTitle(o,s),this.beforeBody=this.getBeforeBody(o,s),this.body=this.getBody(o,s),this.afterBody=this.getAfterBody(o,s),this.footer=this.getFooter(o,s);const l=this._size=va(this,s),c=Object.assign({},a,l),h=_a(this.chart,s,c),u=wa(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,s,n){const r=this.getCaretPosition(t,s,n);i.lineTo(r.x1,r.y1),i.lineTo(r.x2,r.y2),i.lineTo(r.x3,r.y3)}getCaretPosition(t,i,s){const{xAlign:n,yAlign:r}=this,{caretSize:o,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=Ai(a),{x:d,y:f}=t,{width:y,height:b}=i;let p,g,m,w,v,_;return r==="center"?(v=f+b/2,n==="left"?(p=d,g=p-o,w=v+o,_=v-o):(p=d+y,g=p+o,w=v-o,_=v+o),m=p):(n==="left"?g=d+Math.max(l,h)+o:n==="right"?g=d+y-Math.max(c,u)-o:g=this.caretX,r==="top"?(w=f,v=w-o,p=g-o,m=g+o):(w=f+b,v=w+o,p=g+o,m=g-o),_=w),{x1:p,x2:g,x3:m,y1:w,y2:v,y3:_}}drawTitle(t,i,s){const n=this.title,r=n.length;let o,a,l;if(r){const c=An(s.rtl,this.x,this.width);for(t.x=fs(this,s.titleAlign,s),i.textAlign=c.textAlign(s.titleAlign),i.textBaseline="middle",o=_t(s.titleFont),a=s.titleSpacing,i.fillStyle=s.titleColor,i.font=o.string,l=0;l<r;++l)i.fillText(n[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,i,s,n,r){const o=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=r,h=_t(r.bodyFont),u=fs(this,"left",r),d=n.x(u),f=l<h.lineHeight?(h.lineHeight-l)/2:0,y=i.y+f;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=n.leftForLtr(d,c)+c/2,g=y+l/2;
vendor: 5,121 bytes, line 46
46t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Xn(t,b,p,g),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Xn(t,b,p,g)}else{t.lineWidth=I(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const b=n.leftForLtr(d,c),p=n.leftForLtr(n.xPlus(d,1),c-2),g=Ai(o.borderRadius);Object.values(g).some(m=>m!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Gn(t,{x:b,y,w:c,h:l,radius:g}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Gn(t,{x:p,y:y+1,w:c-2,h:l-2,radius:g}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,y,c,l),t.strokeRect(b,y,c,l),t.fillStyle=o.backgroundColor,t.fillRect(p,y+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,i,s){const{body:n}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,u=_t(s.bodyFont);let d=u.lineHeight,f=0;const y=An(s.rtl,this.x,this.width),b=function(A){i.fillText(A,y.x(t.x+f),t.y+d/2),t.y+=d+r},p=y.textAlign(o);let g,m,w,v,_,E,S;for(i.textAlign=o,i.textBaseline="middle",i.font=u.string,t.x=fs(this,p,s),i.fillStyle=s.bodyColor,D(this.beforeBody,b),f=a&&p!=="right"?o==="center"?c/2+h:c+2+h:0,v=0,E=n.length;v<E;++v){for(g=n[v],m=this.labelTextColors[v],i.fillStyle=m,D(g.before,b),w=g.lines,a&&w.length&&(this._drawColorBox(i,t,v,y,s),d=Math.max(u.lineHeight,l)),_=0,S=w.length;_<S;++_)b(w[_]),d=u.lineHeight;D(g.after,b)}f=0,d=u.lineHeight,D(this.afterBody,b),t.y-=r}drawFooter(t,i,s){const n=this.footer,r=n.length;let o,a;if(r){const l=An(s.rtl,this.x,this.width);for(t.x=fs(this,s.footerAlign,s),t.y+=s.footerMarginTop,i.textAlign=l.textAlign(s.footerAlign),i.textBaseline="middle",o=_t(s.footerFont),i.fillStyle=s.footerColor,i.font=o.string,a=0;a<r;++a)i.fillText(n[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+s.footerSpacing}}drawBackground(t,i,s,n){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:y}=Ai(n.cornerRadius);i.fillStyle=n.backgroundColor,i.strokeStyle=n.borderColor,i.lineWidth=n.borderWidth,i.beginPath(),i.moveTo(a+u,l),o==="top"&&this.drawCaret(t,i,s,n),i.lineTo(a+c-d,l),i.quadraticCurveTo(a+c,l,a+c,l+d),o==="center"&&r==="right"&&this.drawCaret(t,i,s,n),i.lineTo(a+c,l+h-y),i.quadraticCurveTo(a+c,l+h,a+c-y,l+h),o==="bottom"&&this.drawCaret(t,i,s,n),i.lineTo(a+f,l+h),i.quadraticCurveTo(a,l+h,a,l+h-f),o==="center"&&r==="left"&&this.drawCaret(t,i,s,n),i.lineTo(a,l+u),i.quadraticCurveTo(a,l,a+u,l),i.closePath(),i.fill(),n.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){const i=this.chart,s=this.$animations,n=s&&s.x,r=s&&s.y;if(n||r){const o=vi[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=va(this,t),l=Object.assign({},o,this._size),c=_a(i,t,l),h=wa(t,l,c,i);(n._to!==h.x||r._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const i=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(i);const n={width:this.width,height:this.height},r={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const o=Nt(i.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(r,t,n,i),cp(t,i.textDirection),r.y+=o.top,this.drawTitle(r,t,i),this.drawBody(r,t,i),this.drawFooter(r,t,i),hp(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!qs(s,n),o=this._positionChanged(n,i);(r||o)&&(this._active=n,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,s=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,r=this._active||[],o=this._getActiveElements(t,r,i,s),a=this._positionChanged(o,t),l=i||!qs(o,r)||a;return l&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),l}_getActiveElements(t,i,s,n){const r=this.options;if(t.type==="mouseout")return[];if(!n)return i.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,s);return r.reverse&&o.reverse(),o}_positionChanged(t,i){const{caretX:s,caretY:n,options:r}=this,o=vi[r.position].call(this,t,i);return o!==!1&&(s!==o.x||n!==o.y)}}x(Qn,"positioners",vi);var hm={id:"tooltip",_element:Qn,positioners:vi,afterInit(e,t,i){i&&(e.tooltip=new Qn({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const i={tooltip:t};
vendor: 23,419 bytes, lines 46-52
46if(e.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",i)}},afterEvent(e,t){if(e.tooltip){const i=t.replay;e.tooltip.handleEvent(t.event,i,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:kc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const um=(e,t,i,s)=>(typeof t=="string"?(i=e.push(t)-1,s.unshift({index:i,label:t})):isNaN(t)&&(i=null),i);function dm(e,t,i,s){const n=e.indexOf(t);if(n===-1)return um(e,t,i,s);const r=e.lastIndexOf(t);return n!==r?i:n}const fm=(e,t)=>e===null?null:ct(Math.round(e),0,t);function Ea(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class tr extends Je{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const i=this._addedLabels;if(i.length){const s=this.getLabels();for(const{index:n,label:r}of i)s[n]===r&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(O(t))return null;const s=this.getLabels();return i=isFinite(i)&&s[i]===t?i:dm(s,t,N(i,t),this._addedLabels),fm(i,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),i||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,i=this.max,s=this.options.offset,n=[];let r=this.getLabels();r=t===0&&i===r.length-1?r:r.slice(t,i+1),this._valueRange=Math.max(r.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let o=t;o<=i;o++)n.push({value:o});return n}getLabelForValue(t){return Ea.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}x(tr,"id","category"),x(tr,"defaults",{ticks:{callback:Ea}});function pm(e,t){const i=[],{bounds:n,step:r,min:o,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=e,f=r||1,y=h-1,{min:b,max:p}=t,g=!O(o),m=!O(a),w=!O(c),v=(p-b)/(u+1);let _=To((p-b)/y/f)*f,E,S,A,k;if(_<1e-14&&!g&&!m)return[{value:b},{value:p}];k=Math.ceil(p/_)-Math.floor(b/_),k>y&&(_=To(k*_/y/f)*f),O(l)||(E=Math.pow(10,l),_=Math.ceil(_*E)/E),n==="ticks"?(S=Math.floor(b/_)*_,A=Math.ceil(p/_)*_):(S=b,A=p),g&&m&&r&&mf((a-o)/r,_/1e3)?(k=Math.round(Math.min((a-o)/_,h)),_=(a-o)/k,S=o,A=a):w?(S=g?o:S,A=m?a:A,k=c-1,_=(A-S)/k):(k=(A-S)/_,Rs(k,Math.round(k),_/1e3)?k=Math.round(k):k=Math.ceil(k));const P=Math.max(Ro(_),Ro(S));E=Math.pow(10,O(l)?P:l),S=Math.round(S*E)/E,A=Math.round(A*E)/E;let R=0;for(g&&(d&&S!==o?(i.push({value:o}),S<o&&R++,Rs(Math.round((S+R*_)*E)/E,o,Aa(o,v,e))&&R++):S<o&&R++);R<k;++R){const F=Math.round((S+R*_)*E)/E;if(m&&F>a)break;i.push({value:F})}return m&&d&&A!==a?i.length&&Rs(i[i.length-1].value,a,Aa(a,v,e))?i[i.length-1].value=a:i.push({value:a}):(!m||A===a)&&i.push({value:A}),i}function Aa(e,t,{horizontal:i,minRotation:s}){const n=de(s),r=(i?Math.sin(n):Math.cos(n))||.001,o=.75*t*(""+e).length;return Math.min(t/r,o)}class gm extends Je{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,i){return O(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:i,maxDefined:s}=this.getUserBounds();let{min:n,max:r}=this;const o=l=>n=i?n:l,a=l=>r=s?r:l;if(t){const l=Zt(n),c=Zt(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(n===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(n-l)}this.min=n,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:i,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),i=i||11),i&&(n=Math.min(i,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,i=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:i.includeBounds!==!1},r=this._range||this,o=pm(n,r);return t.bounds==="ticks"&&bf(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let i=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-i)/Math.max(t.length-1,1)/2;i-=n,s+=n}this._startValue=i,this._endValue=s,this._valueRange=s-i}getLabelForValue(t){return nc(t,this.chart.options.locale,this.options.ticks.format)}}class er extends gm{determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=bt(t)?t:0,this.max=bt(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),i=t?this.width:this.height,s=de(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}x(er,"id","linear"),x(er,"defaults",{ticks:{callback:rc.formatters.numeric}});const fn={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}},lt=Object.keys(fn);function ka(e,t){return e-t}function Ma(e,t){if(O(t))return null;const i=e._adapter,{parser:s,round:n,isoWeekday:r}=e._parseOpts;let o=t;return typeof s=="function"&&(o=s(o)),bt(o)||(o=typeof s=="string"?i.parse(o,s):i.parse(o)),o===null?null:(n&&(o=n==="week"&&(Ws(r)||r===!0)?i.startOf(o,"isoWeek",r):i.startOf(o,n)),+o)}function Pa(e,t,i,s){const n=lt.length;for(let r=lt.indexOf(e);r<n-1;++r){const o=fn[lt[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((i-t)/(a*o.size))<=s)return lt[r]}return lt[n-1]}function mm(e,t,i,s,n){for(let r=lt.length-1;r>=lt.indexOf(i);r--){const o=lt[r];if(fn[o].common&&e._adapter.diff(n,s,o)>=t-1)return o}return lt[i?lt.indexOf(i):0]}function bm(e){for(let t=lt.indexOf(e)+1,i=lt.length;t<i;++t)if(fn[lt[t]].common)return lt[t]}function Ta(e,t,i){if(!i)e[t]=!0;else if(i.length){const{lo:s,hi:n}=Fr(i,t),r=i[s]>=t?i[s]:i[n];e[r]=!0}}function ym(e,t,i,s){const n=e._adapter,r=+n.startOf(t[0].value,s),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+n.add(a,1,s))l=i[a],l>=0&&(t[l].major=!0);return t}function Ra(e,t,i){const s=[],n={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],n[a]=o,s.push({value:a,major:!1});return r===0||!i?s:ym(e,s,n,i)}class Xs extends Je{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,i={}){const s=t.time||(t.time={}),n=this._adapter=new Bp._date(t.adapters.date);n.init(i),xi(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=i.normalized}parse(t,i){return t===void 0?null:Ma(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,i=this._adapter,s=t.time.unit||"day";let{min:n,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=bt(n)&&!isNaN(n)?n:+i.startOf(Date.now(),s),r=bt(r)&&!isNaN(r)?r:+i.endOf(Date.now(),s)+1,this.min=Math.min(n,r-1),this.max=Math.max(n+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(i=t[0],s=t[t.length-1]),{min:i,max:s}}buildTicks(){const t=this.options,i=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const r=this.min,o=this.max,a=xf(n,r,o);return this._unit=i.unit||(s.autoSkip?Pa(i.minUnit,this.min,this.max,this._getLabelCapacity(r)):mm(this,a.length,i.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:bm(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),Ra(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let i=0,s=0,n,r;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?i=1-n:i=(this.getDecimalForValue(t[1])-n)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?s=r:s=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;i=ct(i,0,o),s=ct(s,0,o),this._offsets={start:i,end:s,factor:1/(i+1+s)}}_generate(){const t=this._adapter,i=this.min,s=this.max,n=this.options,r=n.time,o=r.unit||Pa(r.minUnit,i,s,this._getLabelCapacity(i)),a=N(n.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Ws(l)||l===!0,h={};let u=i,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":o),t.diff(s,i,o)>1e5*a)throw new Error(i+" and "+s+" are too far apart with stepSize of "+a+" "+o);const y=n.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<s;d=+t.add(d,a,o),f++)Ta(h,d,y);return(d===s||n.bounds==="ticks"||f===1)&&Ta(h,d,y),Object.keys(h).sort(ka).map(b=>+b)}getLabelForValue(t){const i=this._adapter,s=this.options.time;return s.tooltipFormat?i.format(t,s.tooltipFormat):i.format(t,s.displayFormats.datetime)}format(t,i){const n=this.options.time.displayFormats,r=this._unit,o=i||n[r];return this._adapter.format(t,o)}_tickFormatFunction(t,i,s,n){const r=this.options,o=r.ticks.callback;if(o)return j(o,[t,i,s],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],u=c&&a[c],d=s[i],f=c&&u&&d&&d.major;return this._adapter.format(t,n||(f?u:h))}generateTickLabels(t){let i,s,n;for(i=0,s=t.length;i<s;++i)n=t[i],n.label=this._tickFormatFunction(n.value,i,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const i=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((i.start+s)*i.factor)}getValueForPixel(t){const i=this._offsets,s=this.getDecimalForPixel(t)/i.factor-i.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const i=this.options.ticks,s=this.ctx.measureText(t).width,n=de(this.isHorizontal()?i.maxRotation:i.minRotation),r=Math.cos(n),o=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*r+a*o,h:s*o+a*r}}_getLabelCapacity(t){const i=this.options.time,s=i.displayFormats,n=s[i.unit]||s.millisecond,r=this._tickFormatFunction(t,0,Ra(this,[t],this._majorUnit),n),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],i,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(i=0,s=n.length;i<s;++i)t=t.concat(n[i].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let i,s;if(t.length)return t;const n=this.getLabels();for(i=0,s=n.length;i<s;++i)t.push(Ma(this,n[i]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return tc(t.sort(ka))}}x(Xs,"id","time"),x(Xs,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ps(e,t,i){let s=0,n=e.length-1,r,o,a,l;i?(t>=e[s].pos&&t<=e[n].pos&&({lo:s,hi:n}=Yn(e,"pos",t)),{pos:r,time:a}=e[s],{pos:o,time:l}=e[n]):(t>=e[s].time&&t<=e[n].time&&({lo:s,hi:n}=Yn(e,"time",t)),{time:r,pos:a}=e[s],{time:o,pos:l}=e[n]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class Ca extends Xs{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(t);this._minPos=ps(i,this.min),this._tableRange=ps(i,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:i,max:s}=this,n=[],r=[];let o,a,l,c,h;for(o=0,a=t.length;o<a;++o)c=t[o],c>=i&&c<=s&&n.push(c);if(n.length<2)return[{time:i,pos:0},{time:s,pos:1}];for(o=0,a=n.length;o<a;++o)h=n[o+1],l=n[o-1],c=n[o],Math.round((h+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,i=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(i)||s.length===1)&&s.push(i),s.sort((n,r)=>n-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const i=this.getDataTimestamps(),s=this.getLabelTimestamps();return i.length&&s.length?t=this.normalize(i.concat(s)):t=i.length?i:s,t=this._cache.all=t,t}getDecimalForValue(t){return(ps(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const i=this._offsets,s=this.getDecimalForPixel(t)/i.factor-i.end;return ps(this._table,s*this._tableRange+this._minPos,!0)}}x(Ca,"id","timeseries"),x(Ca,"defaults",Xs.defaults);/*! 47 * chartjs-plugin-datalabels v2.2.0 48 * https://chartjs-plugin-datalabels.netlify.app 49 * (c) 2017-2022 chartjs-plugin-datalabels contributors 50 * Released under the MIT license 51 */var La=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),Pi={toTextLines:function(e){var t=[],i;for(e=[].concat(e);e.length;)i=e.pop(),typeof i=="string"?t.unshift.apply(t,i.split(` 52`)):Array.isArray(i)?e.push.apply(e,i):O(e)||t.unshift(""+i);return t},textSize:function(e,t,i){var s=[].concat(t),n=s.length,r=e.font,o=0,a;for(e.font=i.string,a=0;a<n;++a)o=Math.max(e.measureText(s[a]).width,o);return e.font=r,{height:n*i.lineHeight,width:o}},bound:function(e,t,i){return Math.max(e,Math.min(t,i))},arrayDiff:function(e,t){var i=e.slice(),s=[],n,r,o,a;for(n=0,o=t.length;n<o;++n)a=t[n],r=i.indexOf(a),r===-1?s.push([a,1]):i.splice(r,1);for(n=0,o=i.length;n<o;++n)s.push([i[n],-1]);return s},rasterize:function(e){return Math.round(e*La)/La}};function Fn(e,t){var i=t.x,s=t.y;if(i===null)return{x:0,y:-1};if(s===null)return{x:1,y:0};var n=e.x-i,r=e.y-s,o=Math.sqrt(n*n+r*r);return{x:o?n/o:0,y:o?r/o:-1}}function vm(e,t,i,s,n){switch(n){case"center":i=s=0;break;case"bottom":i=0,s=1;break;case"right":i=1,s=0;break;case"left":i=-1,s=0;break;case"top":i=0,s=-1;break;case"start":i=-i,s=-s;break;case"end":break;default:n*=Math.PI/180,i=Math.cos(n),s=Math.sin(n);break}return{x:e,y:t,vx:i,vy:s}}var _m=0,Mc=1,Pc=2,Tc=4,Rc=8;function gs(e,t,i){var s=_m;return e<i.left?s|=Mc:e>i.right&&(s|=Pc),t<i.top?s|=Rc:t>i.bottom&&(s|=Tc),s}function wm(e,t){for(var i=e.x0,s=e.y0,n=e.x1,r=e.y1,o=gs(i,s,t),a=gs(n,r,t),l,c,h;!(!(o|a)||o&a);)l=o||a,l&Rc?(c=i+(n-i)*(t.top-s)/(r-s),h=t.top):l&Tc?(c=i+(n-i)*(t.bottom-s)/(r-s),h=t.bottom):l&Pc?(h=s+(r-s)*(t.right-i)/(n-i),c=t.right):l&Mc&&(h=s+(r-s)*(t.left-i)/(n-i),c=t.left),l===o?(i=c,s=h,o=gs(i,s,t)):(n=c,r=h,a=gs(n,r,t));return{x0:i,x1:n,y0:s,y1:r}}function ms(e,t){var i=t.anchor,s=e,n,r;return t.clamp&&(s=wm(s,t.area)),i==="start"?(n=s.x0,r=s.y0):i==="end"?(n=s.x1,r=s.y1):(n=(s.x0+s.x1)/2,r=(s.y0+s.y1)/2),vm(n,r,e.vx,e.vy,t.align)}var bs={arc:function(e,t){var i=(e.startAngle+e.endAngle)/2,s=Math.cos(i),n=Math.sin(i),r=e.innerRadius,o=e.outerRadius;return ms({x0:e.x+s*r,y0:e.y+n*r,x1:e.x+s*o,y1:e.y+n*o,vx:s,vy:n},t)},point:function(e,t){var i=Fn(e,t.origin),s=i.x*e.options.radius,n=i.y*e.options.radius;return ms({x0:e.x-s,y0:e.y-n,x1:e.x+s,y1:e.y+n,vx:i.x,vy:i.y},t)},bar:function(e,t){var i=Fn(e,t.origin),s=e.x,n=e.y,r=0,o=0;return e.horizontal?(s=Math.min(e.x,e.base),r=Math.abs(e.base-e.x)):(n=Math.min(e.y,e.base),o=Math.abs(e.base-e.y)),ms({x0:s,y0:n+o,x1:s+r,y1:n,vx:i.x,vy:i.y},t)},fallback:function(e,t){var i=Fn(e,t.origin);return ms({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:i.x,vy:i.y},t)}},Ht=Pi.rasterize;function xm(e){var t=e.borderWidth||0,i=e.padding,s=e.size.height,n=e.size.width,r=-n/2,o=-s/2;return{frame:{x:r-i.left-t,y:o-i.top-t,w:n+i.width+t*2,h:s+i.height+t*2},text:{x:r,y:o,w:n,h:s}}}function Sm(e,t){var i=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!i)return null;if(i.xCenter!==void 0&&i.yCenter!==void 0)return{x:i.xCenter,y:i.yCenter};var s=i.getBasePixel();return e.horizontal?{x:s,y:null}:{x:null,y:s}}function Em(e){return e instanceof yi?bs.arc:e instanceof Os?bs.point:e instanceof Mi?bs.bar:bs.fallback}function Am(e,t,i,s,n,r){var o=Math.PI/2;if(r){var a=Math.min(r,n/2,s/2),l=t+a,c=i+a,h=t+s-a,u=i+n-a;e.moveTo(t,c),l<h&&c<u?(e.arc(l,c,a,-Math.PI,-o),e.arc(h,c,a,-o,0),e.arc(h,u,a,0,o),e.arc(l,u,a,o,Math.PI)):l<h?(e.moveTo(l,i),e.arc(h,c,a,-o,o),e.arc(l,c,a,o,Math.PI+o)):c<u?(e.arc(l,c,a,-Math.PI,0),e.arc(l,u,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,i)}else e.rect(t,i,s,n)}function km(e,t,i){var s=i.backgroundColor,n=i.borderColor,r=i.borderWidth;!s&&(!n||!r)||(e.beginPath(),Am(e,Ht(t.x)+r/2,Ht(t.y)+r/2,Ht(t.w)-r,Ht(t.h)-r,i.borderRadius),e.closePath(),s&&(e.fillStyle=s,e.fill()),n&&r&&(e.strokeStyle=n,e.lineWidth=r,e.lineJoin="miter",e.stroke()))}function Mm(e,t,i){var s=i.lineHeight,n=e.w,r=e.x,o=e.y+s/2;return t==="center"?r+=n/2:(t==="end"||t==="right")&&(r+=n),{h:s,w:n,x:r,y:o}}function Pm(e,t,i){var s=e.shadowBlur,n=i.stroked,r=Ht(i.x),o=Ht(i.y),a=Ht(i.w);n&&e.strokeText(t,r,o,a),i.filled&&(s&&n&&(e.shadowBlur=0),e.fillText(t,r,o,a),s&&n&&(e.shadowBlur=s))}function Tm(e,t,i,s){var n=s.textAlign,r=s.color,o=!!r,a=s.font,l=t.length,c=s.textStrokeColor,h=s.textStrokeWidth,u=c&&h,d;if(!(!l||!o&&!u))for(i=Mm(i,n,a),e.font=a.string,e.textAlign=n,e.textBaseline="middle",e.shadowBlur=s.textShadowBlur,e.shadowColor=s.textShadowColor,o&&(e.fillStyle=r),u&&(e.lineJoin="round",e.lineWidth=h,e.strokeStyle=c),d=0,l=t.length;d<l;++d)Pm(e,t[d],{stroked:u,filled:o,w:i.w,x:i.x,y:i.y+i.h*d})}var Cc=function(e,t,i,s){var n=this;n._config=e,n._index=s,n._model=null,n._rects=null,n._ctx=t,n._el=i};Tt(Cc.prototype,{_modelize:function(e,t,i,s){var n=this,r=n._index,o=_t(q([i.font,{}],s,r)),a=q([i.color,G.color],s,r);return{align:q([i.align,"center"],s,r),anchor:q([i.anchor,"center"],s,r),area:s.chart.chartArea,backgroundColor:q([i.backgroundColor,null],s,r),borderColor:q([i.borderColor,null],s,r),borderRadius:q([i.borderRadius,0],s,r),borderWidth:q([i.borderWidth,0],s,r),clamp:q([i.clamp,!1],s,r),clip:q([i.clip,!1],s,r),color:a,display:e,font:o,lines:t,offset:q([i.offset,4],s,r),opacity:q([i.opacity,1],s,r),origin:Sm(n._el,s),padding:Nt(q([i.padding,4],s,r)),positioner:Em(n._el),rotation:q([i.rotation,0],s,r)*(Math.PI/180),size:Pi.textSize(n._ctx,t,o),textAlign:q([i.textAlign,"start"],s,r),textShadowBlur:q([i.textShadowBlur,0],s,r),textShadowColor:q([i.textShadowColor,a],s,r),textStrokeColor:q([i.textStrokeColor,a],s,r),textStrokeWidth:q([i.textStrokeWidth,0],s,r)}},update:function(e){var t=this,i=null,s=null,n=t._index,r=t._config,o,a,l,c=q([r.display,!0],e,n);c&&(o=e.dataset.data[n],a=N(j(r.formatter,[o,e]),o),l=O(a)?[]:Pi.toTextLines(a),l.length&&(i=t._modelize(c,l,r,e),s=xm(i))),t._model=i,t._rects=s},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var i=this,s=e.ctx,n=i._model,r=i._rects,o;this.visible()&&(s.save(),n.clip&&(o=n.area,s.beginPath(),s.rect(o.left,o.top,o.right-o.left,o.bottom-o.top),s.clip()),s.globalAlpha=Pi.bound(0,n.opacity,1),s.translate(Ht(t.x),Ht(t.y)),s.rotate(n.rotation),km(s,r.frame,n),Tm(s,n.lines,r.text,n),s.restore())}});var Rm=Number.MIN_SAFE_INTEGER||-9007199254740991,Cm=Number.MAX_SAFE_INTEGER||9007199254740991;function ui(e,t,i){var s=Math.cos(i),n=Math.sin(i),r=t.x,o=t.y;return{x:r+s*(e.x-r)-n*(e.y-o),y:o+n*(e.x-r)+s*(e.y-o)}}function Ia(e,t){var i=Cm,s=Rm,n=t.origin,r,o,a,l,c;for(r=0;r<e.length;++r)o=e[r],a=o.x-n.x,l=o.y-n.y,c=t.vx*a+t.vy*l,i=Math.min(i,c),s=Math.max(s,c);return{min:i,max:s}}function ys(e,t){var i=t.x-e.x,s=t.y-e.y,n=Math.sqrt(i*i+s*s);return{vx:(t.x-e.x)/n,vy:(t.y-e.y)/n,origin:e,ln:n}}var Lc=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Tt(Lc.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,i){this._rotation=i,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,i=1,s=t._rect;return e=ui(e,t.center(),-t._rotation),!(e.x<s.x-i||e.y<s.y-i||e.x>s.x+s.w+i*2||e.y>s.y+s.h+i*2)},intersects:function(e){var t=this._points(),i=e._points(),s=[ys(t[0],t[1]),ys(t[0],t[3])],n,r,o;for(this._rotation!==e._rotation&&s.push(ys(i[0],i[1]),ys(i[0],i[3])),n=0;n<s.length;++n)if(r=Ia(t,s[n]),o=Ia(i,s[n]),r.max<o.min||o.max<r.min)return!1;return!0},_points:function(){var e=this,t=e._rect,i=e._rotation,s=e.center();return[ui({x:t.x,y:t.y},s,i),ui({x:t.x+t.w,y:t.y},s,i),ui({x:t.x+t.w,y:t.y+t.h},s,i),ui({x:t.x,y:t.y+t.h},s,i)]}});function Ic(e,t,i){var s=t.positioner(e,t),n=s.vx,r=s.vy;if(!n&&!r)return{x:s.x,y:s.y};var o=i.w,a=i.h,l=t.rotation,c=Math.abs(o/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),h=Math.abs(o/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),u=1/Math.max(Math.abs(n),Math.abs(r));return c*=n*u,h*=r*u,c+=t.offset*n,h+=t.offset*r,{x:s.x+c,y:s.y+h}}function Lm(e,t){var i,s,n,r;for(i=e.length-1;i>=0;--i)for(n=e[i].$layout,s=i-1;s>=0&&n._visible;--s)r=e[s].$layout,r._visible&&n._box.intersects(r._box)&&t(n,r);return e}function Im(e){var t,i,s,n,r,o,a;for(t=0,i=e.length;t<i;++t)s=e[t],n=s.$layout,n._visible&&(a=new Proxy(s._el,{get:(l,c)=>l.getProps([c],!0)[c]}),r=s.geometry(),o=Ic(a,s.model(),r),n._box.update(o,r,s.rotation()));return Lm(e,function(l,c){var h=l._hidable,u=c._hidable;
vendor: 4,473 bytes, line 52
52h&&u||u?c._visible=!1:h&&(l._visible=!1)})}var Ti={prepare:function(e){var t=[],i,s,n,r,o;for(i=0,n=e.length;i<n;++i)for(s=0,r=e[i].length;s<r;++s)o=e[i][s],t.push(o),o.$layout={_box:new Lc,_hidable:!1,_visible:!0,_set:i,_idx:o._index};return t.sort(function(a,l){var c=a.$layout,h=l.$layout;return c._idx===h._idx?h._set-c._set:h._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,i,s,n,r,o;for(i=0,s=e.length;i<s;++i)n=e[i],r=n.model(),o=n.$layout,o._hidable=r&&r.display==="auto",o._visible=n.visible(),t|=o._hidable;t&&Im(e)},lookup:function(e,t){var i,s;for(i=e.length-1;i>=0;--i)if(s=e[i].$layout,s&&s._visible&&s._box.contains(t))return e[i];return null},draw:function(e,t){var i,s,n,r,o,a;for(i=0,s=t.length;i<s;++i)n=t[i],r=n.$layout,r._visible&&(o=n.geometry(),a=Ic(n._el,n.model(),o),r._box.update(a,o,n.rotation()),n.draw(e,a))}},Om=function(e){if(O(e))return null;var t=e,i,s,n;if(I(e))if(!O(e.label))t=e.label;else if(!O(e.r))t=e.r;else for(t="",i=Object.keys(e),n=0,s=i.length;n<s;++n)t+=(n!==0?", ":"")+i[n]+": "+e[i[n]];return""+t},Fm={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:Om,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},ot="$datalabels",Oc="$default";function Dm(e,t){var i=e.datalabels,s={},n=[],r,o;return i===!1?null:(i===!0&&(i={}),t=Tt({},[t,i]),r=t.labels||{},o=Object.keys(r),delete t.labels,o.length?o.forEach(function(a){r[a]&&n.push(Tt({},[t,r[a],{_key:a}]))}):n.push(t),s=n.reduce(function(a,l){return D(l.listeners||{},function(c,h){a[h]=a[h]||{},a[h][l._key||Oc]=c}),delete l.listeners,a},{}),{labels:n,listeners:s})}function ir(e,t,i,s){if(t){var n=i.$context,r=i.$groups,o;t[r._set]&&(o=t[r._set][r._key],o&&j(o,[n,s])===!0&&(e[ot]._dirty=!0,i.update(n)))}}function Bm(e,t,i,s,n){var r,o;!i&&!s||(i?s?i!==s&&(o=r=!0):o=!0:r=!0,o&&ir(e,t.leave,i,n),r&&ir(e,t.enter,s,n))}function Hm(e,t){var i=e[ot],s=i._listeners,n,r;if(!(!s.enter&&!s.leave)){if(t.type==="mousemove")r=Ti.lookup(i._labels,t);else if(t.type!=="mouseout")return;n=i._hovered,i._hovered=r,Bm(e,s,n,r,t)}}function Nm(e,t){var i=e[ot],s=i._listeners.click,n=s&&Ti.lookup(i._labels,t);n&&ir(e,s,n,t)}var zm={id:"datalabels",defaults:Fm,beforeInit:function(e){e[ot]={_actives:[]}},beforeUpdate:function(e){var t=e[ot];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,i){var s=t.index,n=e[ot],r=n._datasets[s]=[],o=e.isDatasetVisible(s),a=e.data.datasets[s],l=Dm(a,i),c=t.meta.data||[],h=e.ctx,u,d,f,y,b,p,g,m;for(h.save(),u=0,f=c.length;u<f;++u)if(g=c[u],g[ot]=[],o&&g&&e.getDataVisibility(u)&&!g.skip)for(d=0,y=l.labels.length;d<y;++d)b=l.labels[d],p=b._key,m=new Cc(b,h,g,u),m.$groups={_set:s,_key:p||Oc},m.$context={active:!1,chart:e,dataIndex:u,dataset:a,datasetIndex:s},m.update(m.$context),g[ot].push(m),r.push(m);h.restore(),Tt(n._listeners,l.listeners,{merger:function(w,v,_){v[w]=v[w]||{},v[w][t.index]=_[w],n._listened=!0}})},afterUpdate:function(e){e[ot]._labels=Ti.prepare(e[ot]._datasets)},afterDatasetsDraw:function(e){Ti.draw(e,e[ot]._labels)},beforeEvent:function(e,t){if(e[ot]._listened){var i=t.event;switch(i.type){case"mousemove":case"mouseout":Hm(e,i);break;case"click":Nm(e,i);break}}},afterEvent:function(e){var t=e[ot],i=t._actives,s=t._actives=e.getActiveElements(),n=Pi.arrayDiff(i,s),r,o,a,l,c,h,u;for(r=0,o=n.length;r<o;++r)if(c=n[r],c[1])for(u=c[0].element[ot]||[],a=0,l=u.length;a<l;++a)h=u[a],h.$context.active=c[1]===1,h.update(h.$context);(t._dirty||n.length)&&(Ti.update(t._labels),e.render()),delete t._dirty}};vt.register(Cs,Mi,tr,er,hm,zm);vt.defaults.font.family="urban-grotesk";vt.defaults.font.weight="300";async function Vm(){try{const e=await fetch("/api/bess-revenue"),{status:t,data:i,message:s}=await e.json();if(t==="success")return i;console.error(s)}catch(e){console.error(e)}return null}async function qm(){const e=document.getElementById("bess-chart");if(!e)return;const t=await Vm();if(!t)return;const i=t.slice(-12),s=i.map(o=>{const[a,l]=o.month.split("-");return`${l}-${a}`}),n=i.map(o=>Math.round(o.revenue_eur_per_mw)),r=e.getContext("2d");new vt(r,{type:"bar",data:{labels:s,datasets:[{data:n,backgroundColor:"#7DA7AD",hoverBackgroun
52dColor:"#467680",borderRadius:0,barPercentage:.6,categoryPercentage:.7}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:o=>`${o.parsed.y.toLocaleString("cs-CZ")} EUR/MW`}},datalabels:{anchor:"end",align:"start",color:"#fff",display:()=>window.innerWidth>900,formatter:o=>`${Math.round(o/1e3)}k`}},scales:{x:{grid:{display:!1},ticks:{color:"#0F3757"},border:{color:"#E7EFF0"}},y:{beginAtZero:!0,grid:{color:"#E7EFF0",drawBorder:!1},ticks:{color:"#0F3757",callback:o=>`${o/1e3}k`},border:{color:"#E7EFF0"},title:{display:!0,text:"EUR / MW",color:"#0F3757"}}}}})}document.addEventListener("turbo:load",qm);const $m=()=>{document.querySelectorAll('a[href^="#"]').forEach(e=>{const t=e.getAttribute("href"),i=t!=="#"?document.querySelector(t):null;i&&e.addEventListener("click",s=>{s.preventDefault();const n=i.offsetTop;window.scrollTo({top:n-0,behavior:"smooth"})})})};document.addEventListener("turbo:load",$m);const jm=e=>{if(!e||!e.startsWith("#youtube"))return null;const t=e.indexOf("?");if(t===-1)return null;const i=new URLSearchParams(e.slice(t+1)),s=i.get("id"),n=i.get("seek")||i.get("t");return!s||!n?null:{id:s,seek:n}},Wm=e=>{e.preventDefault();const t=e.currentTarget.getAttribute("href");if(!t)return;const i=jm(t);if(!i)return;const s=document.getElementById(i.id);if(!s)return;const n=s.getBoundingClientRect();n.bottom>0&&n.top<window.innerHeight||s.scrollIntoView({behavior:"smooth",block:"center"}),document.dispatchEvent(new CustomEvent("youtube:seek",{detail:{id:i.id,time:i.seek}}))};document.addEventListener("turbo:load",()=>{document.querySelectorAll('a[href^="#youtube"]').forEach(e=>{e.addEventListener("click",Wm)})});let vs=0,Dn=!1;const Um=()=>({isExpanded:!1,isScrolled:!1,isHidden:!1,open(){this.isExpanded=!0},close(){this.isExpanded=!1},toggle(){this.isExpanded?this.close():this.open()},onScroll(){Dn||(window.requestAnimationFrame(()=>{this.handleScroll(),Dn=!1}),Dn=!0)},handleScroll(){if(this.isScrolled=window.pageYOffset>0,this.isExpanded)return;const e=window.pageYOffset||document.documentElement.scrollTop;e>vs?this.isHidden=!0:e<vs&&vs-e>=10?this.isHidden=!1:e<=0&&(this.isHidden=!1),vs=e<=0?0:e}});class at extends HTMLElement{constructor(){super(),this.isIframeLoaded=!1,this.isPlaylistThumbnailLoaded=!1,this.setupDom()}static get observedAttributes(){return["videoid","playlistid","videoplay","videotitle"]}connectedCallback(){this.addEventListener("pointerover",()=>at.warmConnections(this),{once:!0}),this.addEventListener("click",()=>this.addIframe())}get videoId(){return encodeURIComponent(this.getAttribute("videoid")||"")}set videoId(t){this.setAttribute("videoid",t)}get playlistId(){return encodeURIComponent(this.getAttribute("playlistid")||"")}set playlistId(t){this.setAttribute("playlistid",t)}get videoTitle(){return this.getAttribute("videotitle")||"Video"}set videoTitle(t){this.setAttribute("videotitle",t)}get videoPlay(){return this.getAttribute("videoplay")||"Play"}set videoPlay(t){this.setAttribute("videoplay",t)}get videoStartAt(){return this.getAttribute("videoStartAt")||"0"}get autoLoad(){return this.hasAttribute("autoload")}get autoPause(){return this.hasAttribute("autopause")}get noCookie(){return this.hasAttribute("nocookie")}get posterQuality(){return this.getAttribute("posterquality")||"hqdefault"}get posterLoading(){return this.getAttribute("posterloading")||"lazy"}get params(){return`start=${this.videoStartAt}&${this.getAttribute("params")}`}set params(t){this.setAttribute("params",t)}set posterQuality(t){this.setAttribute("posterquality",t)}get disableNoscript(){return this.hasAttribute("disablenoscript")}setupDom(){const t=this.attachShadow({mode:"open"});let i="";window.liteYouTubeNonce&&(i=`nonce="${window.liteYouTubeNonce}"`),t.innerHTML=` 53 <style ${i}> 54 :host { 55 --aspect-ratio: var(--lite-youtube-aspect-ratio, 16 / 9); 56 --aspect-ratio-short: var(--lite-youtube-aspect-ratio-short, 9 / 16); 57 --frame-shadow-visible: var(--lite-youtube-frame-shadow-visible, yes); 58 contain: content; 59 display: block; 60 position: relative; 61 width: 100%; 62 aspect-ratio: var(--aspect-ratio); 63 } 64 65 @media (max-width: 40em) { 66 :host([short]) { 67 aspect-ratio: var(--aspect-ratio-short); 68 } 69 } 70 71 #frame, #fallbackPlaceholder, iframe { 72 position: absolute; 73 width: 100%; 74 height: 100%; 75 left: 0; 76 top: 0; 77 } 78 79 #frame { 80 cursor: pointer; 81 } 82 83 #fallbackPlaceholder, slot[name=image]::slotted(*) { 84 object-fit: cover; 85 width: 100%; 86 height: 100%; 87 } 88 89 @container style(--frame-shadow-visible: yes) { 90 #frame::before { 91 content: ''; 92 display: block; 93 position: absolute; 94 top: 0; 95 background-image: linear-gradient(180deg, #111 -20%, transparent 90%); 96 height: 60px; 97 width: 100%; 98 z-index: 1; 99 } 100 } 101 102 #playButton { 103 width: 68px; 104 height: 48px; 105 background-color: transparent; 106 background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>'); 107 z-index: 1; 108 border: 0; 109 border-radius: inherit; 110 } 111 112 #playButton:before { 113 content: ''; 114 border-style: solid; 115 border-width: 11px 0 11px 19px; 116 border-color: transparent transparent transparent #fff; 117 } 118 119 #playButton, 120 #playButton:before { 121 position: absolute; 122 top: 50%; 123 left: 50%; 124 transform: translate3d(-50%, -50%, 0); 125 cursor: inherit; 126 } 127 128 /* Post-click styles */ 129 .activated { 130 cursor: unset; 131 } 132 133 #frame.activated::before, 134 #frame.activated > #playButton { 135 display: none; 136 } 137 </style> 138 <div id="frame"> 139 <picture> 140 <slot name="image"> 141 <source id="webpPlaceholder" type="image/webp"> 142 <source id="jpegPlaceholder" type="image/jpeg"> 143 <img id="fallbackPlaceholder" referrerpolicy="origin" loading="lazy"> 144 </slot> 145 </picture> 146 <button id="playButton" part="playButton"></button> 147 </div> 148 `,this.domRefFrame=t.querySelector("#frame"),this.domRefImg={fallback:t.querySelector("#fallbackPlaceholder"),webp:t.querySelector("#webpPlaceholder"),jpeg:t.querySelector("#jpegPlaceholder")},this.domRefPlayButton=t.querySelector("#playButton")}setupComponent(){this.shadowRoot.querySelector("slot[name=image]").assignedNodes().length===0&&this.initImagePlaceholder(),this.domRefPlayButton.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),this.setAttribute("title",`${this.videoPlay}: ${this.videoTitle}`),(this.autoLoad||this.isYouTubeShort()||this.autoPause)&&this.initIntersectionObserver(),this.disableNoscript||this.injectSearchNoScript()}attributeChangedCallback(t,i,s){i!==s&&(t==="playlistid"&&i!==null&&i!==s&&(this.isPlaylistThumbnailLoaded=!1),this.setupComponent(),this.domRefFrame.classList.contains("activated")&&(this.domRefFrame.classList.remove("activated"),this.shadowRoot.querySelector("iframe").remove(),this.isIframeLoaded=!1))}injectSearchNoScript(){const t=document.createElement("noscript");this.prepend(t),t.innerHTML=this.generateIframe()}generateIframe(t=!1){let i=t?0:1,s=this.autoPause?"&enablejsapi=1":"";const n=this.noCookie?"-nocookie":"";let r;return this.playlistId?r=`?listType=playlist&list=${this.playlistId}&`:r=`${this.videoId}?`,this.isYouTubeShort()&&(this.params=`loop=1&mute=1&modestbranding=1&playsinline=1&rel=0&enablejsapi=1&playlist=${this.videoId}`,i=1),` 149<iframe credentialless frameborder="0" title="${this.videoTitle}"
150 referrerpolicy="strict-origin-when-cross-origin" 151 allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen 152 src="https://www.youtube${n}.com/embed/${r}autoplay=${i}${s}&${this.params}" 153></iframe>`}addIframe(t=!1){if(!this.isIframeLoaded){const i=this.generateIframe(t);this.domRefFrame.insertAdjacentHTML("beforeend",i),this.domRefFrame.classList.add("activated"),this.isIframeLoaded=!0,this.attemptShortAutoPlay(),this.dispatchEvent(new CustomEvent("liteYoutubeIframeLoaded",{detail:{videoId:this.videoId},bubbles:!0,cancelable:!0}))}}initImagePlaceholder(){var t,i;this.playlistId&&!this.videoId?this.loadPlaylistThumbnail():this.testPosterImage(),this.domRefImg.fallback.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),(i=(t=this.domRefImg)==null?void 0:t.fallback)==null||i.setAttribute("alt",`${this.videoPlay}: ${this.videoTitle}`)}async loadPlaylistThumbnail(){if(!this.isPlaylistThumbnailLoaded){this.isPlaylistThumbnailLoaded=!0;try{const t=`https://www.youtube.com/oembed?url=https://www.youtube.com/playlist?list=${this.playlistId}&format=json`,i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch playlist thumbnail: ${i.status}`);const s=await i.json();if(s.thumbnail_url){const n=s.thumbnail_url,r=n.match(/\/vi\/([^\/]+)\//);if(r){const o=r[1];this.loadThumbnailImages(o)}else this.domRefImg.fallback.src=n,this.domRefImg.fallback.loading=this.posterLoading}}catch(t){console.warn("Failed to load playlist thumbnail:",t)}}}loadThumbnailImages(t){const i=`https://i.ytimg.com/vi_webp/${t}/${this.posterQuality}.webp`;this.domRefImg.webp.srcset=i;const s=`https://i.ytimg.com/vi/${t}/${this.posterQuality}.jpg`;this.domRefImg.jpeg.srcset=s,this.domRefImg.fallback.src=s,this.domRefImg.fallback.loading=this.posterLoading}async testPosterImage(){setTimeout(()=>{const t=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`,i=new Image;i.fetchPriority="low",i.referrerPolicy="origin",i.src=t,i.onload=async s=>{const n=s.target;(n==null?void 0:n.naturalHeight)==90&&(n==null?void 0:n.naturalWidth)==120&&(this.posterQuality="hqdefault"),this.loadThumbnailImages(this.videoId)}},100)}initIntersectionObserver(){const t={root:null,rootMargin:"0px",threshold:0};new IntersectionObserver((s,n)=>{s.forEach(r=>{r.isIntersecting&&!this.isIframeLoaded&&(at.warmConnections(this),this.addIframe(!0),n.unobserve(this))})},t).observe(this),this.autoPause&&new IntersectionObserver((n,r)=>{n.forEach(o=>{var a,l;o.intersectionRatio!==1&&((l=(a=this.shadowRoot.querySelector("iframe"))==null?void 0:a.contentWindow)==null||l.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"))})},{threshold:1}).observe(this)}attemptShortAutoPlay(){this.isYouTubeShort()&&setTimeout(()=>{var t,i;(i=(t=this.shadowRoot.querySelector("iframe"))==null?void 0:t.contentWindow)==null||i.postMessage('{"event":"command","func":"playVideo","args":""}',"*")},2e3)}isYouTubeShort(){return this.getAttribute("short")===""&&window.matchMedia("(max-width: 40em)").matches}static addPrefetch(t,i){const s=document.createElement("link");s.rel=t,s.href=i,s.crossOrigin="true",document.head.append(s)}static warmConnections(t){at.isPreconnected||window.liteYouTubeIsPreconnected||(at.addPrefetch("preconnect","https://i.ytimg.com/"),at.addPrefetch("preconnect","https://s.ytimg.com"),t.noCookie?at.addPrefetch("preconnect","https://www.youtube-nocookie.com"):(at.addPrefetch("preconnect","https://www.youtube.com"),at.addPrefetch("preconnect","https://www.google.com"),at.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),at.addPrefetch("preconnect","https://static.doubleclick.net")),at.isPreconnected=!0,window.liteYouTubeIsPreconnected=!0)}}at.isPreconnected=!1;customElements.define("lite-youtube",at);const Ym=()=>{const{Alpine:e}=window;if(!e||typeof e.store!="function")return null;const t=e.store("youtubeApi");return t||(e.store("youtubeApi",{promise:null,isReady:!1,load(){return window.YT&&window.YT.Player?(this.isReady=!0,Promise.resolve(window.YT)):this.promise?this.promise:(this.promise=new Promise((i,s)=>{const n=document.querySelector('script[src="https://www.youtube.com/iframe_api"]'),r=window.onYouTubeIframeAPIReady;if(window.onYouTubeIframeAPIReady=()=>{typeof r=="function"&&r(),this.isReady=!0,i(window.YT)},!n){const o=document.createElement("script");o.src="https://www.youtube.com/iframe_api",o.async=!0,o.onerror=()=>s(new Error("Failed to load YouTube Iframe API")),document.head.appendChild(o)}}),this.promise)}}),e.store("youtubeApi"))},Km=()=>({player:null,playerReady:!1,state:"idle",pendingAction:null,pendingSeek:null,iframe:null,iframeRequested:!1,handlers:null,liteYoutubeEl:null,init(){this.handlers={onIframeLoaded:this.onIframeLoaded.bind(this),onPlay:this.onPlay.bind(this),onPause:this.onPause.bind(this),onStop:this.onStop.bind(this),onSeek:this.onSeek.bind(this),onMute:this.onMute.bind(this),onUnmute:this.onUnmute.bind(this),onStateRequest:this.onStateRequest.bind(this)},this.liteYoutubeEl=this.findLiteYoutube(),this.$el.addEventListener("liteYoutubeIframeLoaded",this.handlers.onIframeLoaded),this.liteYoutubeEl&&this.liteYoutubeEl!==this.$el&&this.liteYoutubeEl.addEventListener("liteYoutubeIframeLoaded",this.handlers.onIframeLoaded),document.addEventListener("youtube:play",this.handlers.onPlay),document.addEventListener("youtube:pause",this.handlers.onPause),document.addEventListener("youtube:stop",this.handlers.onStop),document.addEventListener("youtube:seek",this.handlers.onSeek),document.addEventListener("youtube:mute",this.handlers.onMute),document.addEventListener("youtube:unmute",this.handlers.onUnmute),document.addEventListener("youtube:state",this.handlers.onStateRequest)},destroy(){this.handlers&&(this.$el.removeEventListener("liteYoutubeIframeLoaded",this.handlers.onIframeLoaded),this.liteYoutubeEl&&this.liteYoutubeEl!==this.$el&&this.liteYoutubeEl.removeEventListener("liteYoutubeIframeLoaded",this.handlers.onIframeLoaded),document.removeEventListener("youtube:play",this.handlers.onPlay),document.removeEventListener("youtube:pause",this.handlers.onPause),document.removeEventListener("youtube:stop",this.handlers.onStop),document.removeEventListener("youtube:seek",this.handlers.onSeek),document.removeEventListener("youtube:mute",this.handlers.onMute),document.removeEventListener("youtube:unmute",this.handlers.onUnmute),document.removeEventListener("youtube:state",this.handlers.onStateRequest),this.handlers=null,this.destroyPlayer())},onIframeLoaded(){const e=this.findIframe();if(!e||(this.player&&this.iframe!==e&&this.destroyPlayer(),this.player))return;this.iframe=e;const t=Ym();t&&t.load().then(()=>{this.player=new window.YT.Player(e,{events:{onReady:()=>
153{if(this.playerReady=!0,this.state=this.getPlayerState()??"idle",this.pendingAction==="play"&&(this.pendingAction=null,this.player.playVideo()),this.pendingSeek){const{time:i,allowSeekAhead:s}=this.pendingSeek;this.pendingSeek=null,this.seekTo(i,s)}},onStateChange:i=>{this.emitStateChange(this.mapPlayerState(i==null?void 0:i.data))}}})}).catch(()=>{this.player=null})},findLiteYoutube(){var e,t;return((t=(e=this.$el).querySelector)==null?void 0:t.call(e,"lite-youtube"))??null},findIframe(){var i,s;const e=(i=this.$el.shadowRoot)==null?void 0:i.querySelector("iframe");if(e)return e;const t=this.findLiteYoutube();return((s=t==null?void 0:t.shadowRoot)==null?void 0:s.querySelector("iframe"))??null},ensureIframe(){if(this.iframe||this.iframeRequested)return;this.iframeRequested=!0,(this.findLiteYoutube()??this.$el).click()},play(){if(this.playerReady){this.player.playVideo();return}this.pendingAction="play",this.ensureIframe()},pause(){this.playerReady&&this.player.pauseVideo()},stop(){this.playerReady&&this.player.stopVideo()},mute(){this.playerReady&&this.player.mute()},unmute(){this.playerReady&&this.player.unMute()},seekTo(e,t=!0){if(!this.playerReady){this.pendingSeek={time:e,allowSeekAhead:t},this.ensureIframe();return}const i=this.parseTimeToSeconds(e);i!==null&&this.player.seekTo(i,t)},getPlayer(){return this.player},onPlay(e){this.matchesEventTarget(e)&&this.play()},onPause(e){this.matchesEventTarget(e)&&this.pause()},onStop(e){this.matchesEventTarget(e)&&this.stop()},onSeek(e){var s,n;if(!this.matchesEventTarget(e))return;const t=((s=e==null?void 0:e.detail)==null?void 0:s.time)??(e==null?void 0:e.detail),i=(n=e==null?void 0:e.detail)==null?void 0:n.allowSeekAhead;this.seekTo(t,i!==void 0?i:!0)},onMute(e){this.matchesEventTarget(e)&&this.mute()},onUnmute(e){this.matchesEventTarget(e)&&this.unmute()},onStateRequest(e){var t;(t=e==null?void 0:e.detail)!=null&&t.response||this.matchesEventTarget(e)&&this.dispatchStateResponse()},dispatchStateResponse(){const e=this.getPlayerState();e!==null&&this.$dispatch("youtube:state",{response:!0,id:this.getTargetId(),videoid:this.getVideoId(),state:e})},emitStateChange(e){this.state=e,this.$dispatch("youtube:state-change",{id:this.getTargetId(),videoid:this.getVideoId(),state:e})},getPlayerState(){var t,i;if(!this.playerReady)return null;const e=(i=(t=this.player).getPlayerState)==null?void 0:i.call(t);return e==null?null:this.mapPlayerState(e)},mapPlayerState(e){var s;const t=(s=window.YT)==null?void 0:s.PlayerState;return{[t==null?void 0:t.UNSTARTED]:"unstarted",[t==null?void 0:t.ENDED]:"ended",[t==null?void 0:t.PLAYING]:"playing",[t==null?void 0:t.PAUSED]:"paused",[t==null?void 0:t.BUFFERING]:"buffering",[t==null?void 0:t.CUED]:"cued"}[e]??"idle"},getTargetId(){return this.$el.getAttribute("id")||this.getVideoId()},getVideoId(){return this.$el.getAttribute("videoid")},matchesEventTarget(e){var n,r,o;const t=((n=e==null?void 0:e.detail)==null?void 0:n.id)||((r=e==null?void 0:e.detail)==null?void 0:r.videoid)||((o=e==null?void 0:e.detail)==null?void 0:o.videoId);if(!t)return!0;const i=this.$el.getAttribute("id"),s=this.$el.getAttribute("videoid");return t===i||t===s},destroyPlayer(){this.player&&typeof this.player.destroy=="function"&&this.player.destroy(),this.player=null,this.playerReady=!1,this.iframe=null,this.iframeRequested=!1,this.pendingAction=null,this.pendingSeek=null,this.state="idle"},parseTimeToSeconds(e){if(typeof e=="number"&&Number.isFinite(e))return Math.max(0,Math.floor(e));if(typeof e!="string")return null;const t=e.trim();if(!t)return null;const i=t.split(":").map(a=>a.trim());if(i.length<2||i.length>3)return null;const s=i.map(a=>Number(a));if(s.some(a=>!Number.isFinite(a)||a<0))return null;if(i.length===2){const[a,l]=s;return Math.floor(a*60+l)}const[n,r,o]=s;return Math.floor(n*3600+r*60+o)}});var sr=!1,nr=!1,ve=[],rr=-1;function Xm(e){Gm(e)}function Gm(e){ve.includes(e)||ve.push(e),Jm()}function Zm(e){let t=ve.indexOf(e);t!==-1&&t>rr&&ve.splice(t,1)}function Jm(){!nr&&!sr&&(sr=!0,queueMicrotask(Qm))}function Qm(){sr=!1,nr=!0;for(let e=0;e<ve.length;e++)ve[e](),rr=e;ve.length=0,rr=-1,nr=!1}var Qe,ke,ti,Fc,or=!0;function tb(e){or=!1,e(),or=!0}function eb(e){Qe=e.reactive,ti=e.release,ke=t=>e.effect(t,{scheduler:i=>{or?Xm(i):i()}}),Fc=e.raw}function Oa(e){ke=e}function ib(e){let t=()=>{};return[s=>{let n=ke(s);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>
vendor: 20,343 bytes, lines 153-157
153{e._x_effects.forEach(r=>r())}),e._x_effects.add(n),t=()=>{n!==void 0&&(e._x_effects.delete(n),ti(n))},n},()=>{t()}]}function Dc(e,t){let i=!0,s,n=ke(()=>{let r=e();JSON.stringify(r),i?s=r:queueMicrotask(()=>{t(r,s),s=r}),i=!1});return()=>ti(n)}var Bc=[],Hc=[],Nc=[];function sb(e){Nc.push(e)}function jr(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,Hc.push(t))}function zc(e){Bc.push(e)}function Vc(e,t,i){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(i)}function qc(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([i,s])=>{(t===void 0||t.includes(i))&&(s.forEach(n=>n()),delete e._x_attributeCleanups[i])})}function nb(e){var t,i;for((t=e._x_effects)==null||t.forEach(Zm);(i=e._x_cleanups)!=null&&i.length;)e._x_cleanups.pop()()}var Wr=new MutationObserver(Xr),Ur=!1;function Yr(){Wr.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ur=!0}function $c(){rb(),Wr.disconnect(),Ur=!1}var di=[];function rb(){let e=Wr.takeRecords();di.push(()=>e.length>0&&Xr(e));let t=di.length;queueMicrotask(()=>{if(di.length===t)for(;di.length>0;)di.shift()()})}function Y(e){if(!Ur)return e();$c();let t=e();return Yr(),t}var Kr=!1,Gs=[];function ob(){Kr=!0}function ab(){Kr=!1,Xr(Gs),Gs=[]}function Xr(e){if(Kr){Gs=Gs.concat(e);return}let t=[],i=new Set,s=new Map,n=new Map;for(let r=0;r<e.length;r++)if(!e[r].target._x_ignoreMutationObserver&&(e[r].type==="childList"&&(e[r].removedNodes.forEach(o=>{o.nodeType===1&&o._x_marker&&i.add(o)}),e[r].addedNodes.forEach(o=>{if(o.nodeType===1){if(i.has(o)){i.delete(o);return}o._x_marker||t.push(o)}})),e[r].type==="attributes")){let o=e[r].target,a=e[r].attributeName,l=e[r].oldValue,c=()=>{s.has(o)||s.set(o,[]),s.get(o).push({name:a,value:o.getAttribute(a)})},h=()=>{n.has(o)||n.set(o,[]),n.get(o).push(a)};o.hasAttribute(a)&&l===null?c():o.hasAttribute(a)?(h(),c()):h()}n.forEach((r,o)=>{qc(o,r)}),s.forEach((r,o)=>{Bc.forEach(a=>a(o,r))});for(let r of i)t.some(o=>o.contains(r))||Hc.forEach(o=>o(r));for(let r of t)r.isConnected&&Nc.forEach(o=>o(r));t=null,i=null,s=null,n=null}function jc(e){return Ji(je(e))}function Zi(e,t,i){return e._x_dataStack=[t,...je(i||e)],()=>{e._x_dataStack=e._x_dataStack.filter(s=>s!==t)}}function je(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?je(e.host):e.parentNode?je(e.parentNode):[]}function Ji(e){return new Proxy({objects:e},lb)}var lb={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(i=>Object.prototype.hasOwnProperty.call(i,t)||Reflect.has(i,t))},get({objects:e},t,i){return t=="toJSON"?cb:Reflect.get(e.find(s=>Reflect.has(s,t))||{},t,i)},set({objects:e},t,i,s){const n=e.find(o=>Object.prototype.hasOwnProperty.call(o,t))||e[e.length-1],r=Object.getOwnPropertyDescriptor(n,t);return r!=null&&r.set&&(r!=null&&r.get)?r.set.call(s,i)||!0:Reflect.set(n,t,i)}};function cb(){return Reflect.ownKeys(this).reduce((t,i)=>(t[i]=Reflect.get(this,i),t),{})}function Wc(e){let t=s=>typeof s=="object"&&!Array.isArray(s)&&s!==null,i=(s,n="")=>{Object.entries(Object.getOwnPropertyDescriptors(s)).forEach(([r,{value:o,enumerable:a}])=>{if(a===!1||o===void 0||typeof o=="object"&&o!==null&&o.__v_skip)return;let l=n===""?r:`${n}.${r}`;typeof o=="object"&&o!==null&&o._x_interceptor?s[r]=o.initialize(e,l,r):t(o)&&o!==s&&!(o instanceof Element)&&i(o,l)})};return i(e)}function Uc(e,t=()=>{}){let i={initialValue:void 0,_x_interceptor:!0,initialize(s,n,r){return e(this.initialValue,()=>hb(s,n),o=>ar(s,n,o),n,r)}};return t(i),s=>{if(typeof s=="object"&&s!==null&&s._x_interceptor){let n=i.initialize.bind(i);i.initialize=(r,o,a)=>{let l=s.initialize(r,o,a);return i.initialValue=l,n(r,o,a)}}else i.initialValue=s;return i}}function hb(e,t){return t.split(".").reduce((i,s)=>i[s],e)}function ar(e,t,i){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=i;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),ar(e[t[0]],t.slice(1),i)}}var Yc={};function xt(e,t){Yc[e]=t}function lr(e,t){let i=ub(t);return Object.entries(Yc).forEach(([s,n])=>{Object.defineProperty(e,`$${s}`,{get(){return n(t,i)},enumerable:!1})}),e}function ub(e){let[t,i]=Qc(e),s={interceptor:Uc,...t};return jr(e,i),s}function db(e,t,i,...s){try{return i(...s)}catch(n){Di(n,e,t)}}function Di(e,t,i=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:i}),console.warn(`Alpine Expression Error: ${e.message} 154 155${i?'Expression: "'+i+`" 156 157`:""}`,t),setTimeout(()=>{throw e},0)}var Fs=!0;function Kc(e){let t=Fs;Fs=!1;let i=e();return Fs=t,i}function _e(e,t,i={}){let s;return nt(e,t)(n=>s=n,i),s}function nt(...e){return Xc(...e)}var Xc=Gc;function fb(e){Xc=e}function Gc(e,t){let i={};lr(i,e);let s=[i,...je(e)],n=typeof t=="function"?pb(s,t):mb(s,t,e);return db.bind(null,e,t,n)}function pb(e,t){return(i=()=>{},{scope:s={},params:n=[]}={})=>{let r=t.apply(Ji([s,...e]),n);Zs(i,r)}}var Bn={};function gb(e,t){if(Bn[e])return Bn[e];let i=Object.getPrototypeOf(async function(){}).constructor,s=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,r=(()=>{try{let o=new i(["__self","scope"],`with (scope) { __self.result = ${s} }; __self.finished = true; return __self.result;`);return Object.defineProperty(o,"name",{value:`[Alpine] ${e}`}),o}catch(o){return Di(o,t,e),Promise.resolve()}})();return Bn[e]=r,r}function mb(e,t,i){let s=gb(t,i);return(n=()=>{},{scope:r={},params:o=[]}={})=>{s.result=void 0,s.finished=!1;let a=Ji([r,...e]);if(typeof s=="function"){let l=s(s,a).catch(c=>Di(c,i,t));s.finished?(Zs(n,s.result,a,o,i),s.result=void 0):l.then(c=>{Zs(n,c,a,o,i)}).catch(c=>Di(c,i,t)).finally(()=>s.result=void 0)}}}function Zs(e,t,i,s,n){if(Fs&&typeof t=="function"){let r=t.apply(i,s);r instanceof Promise?r.then(o=>Zs(e,o,i,s)).catch(o=>Di(o,n,t)):e(r)}else typeof t=="object"&&t instanceof Promise?t.then(r=>e(r)):e(t)}var Gr="x-";function ei(e=""){return Gr+e}function bb(e){Gr=e}var Js={};function Z(e,t){return Js[e]=t,{before(i){if(!Js[i]){console.warn(String.raw`Cannot find directive \`${i}\`. \`${e}\` will use the default order of execution`);return}const s=fe.indexOf(i);fe.splice(s>=0?s:fe.indexOf("DEFAULT"),0,e)}}}function yb(e){return Object.keys(Js).includes(e)}function Zr(e,t,i){if(t=Array.from(t),e._x_virtualDirectives){let r=Object.entries(e._x_virtualDirectives).map(([a,l])=>({name:a,value:l})),o=Zc(r);r=r.map(a=>o.find(l=>l.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(r)}let s={};return t.map(ih((r,o)=>s[r]=o)).filter(nh).map(wb(s,i)).sort(xb).map(r=>_b(e,r))}function Zc(e){return Array.from(e).map(ih()).filter(t=>!nh(t))}var cr=!1,_i=new Map,Jc=Symbol();function vb(e){cr=!0;let t=Symbol();Jc=t,_i.set(t,[]);let i=()=>{for(;_i.get(t).length;)_i.get(t).shift()();_i.delete(t)},s=()=>{cr=!1,i()};e(i),s()}function Qc(e){let t=[],i=a=>t.push(a),[s,n]=ib(e);return t.push(n),[{Alpine:Qi,effect:s,cleanup:i,evaluateLater:nt.bind(nt,e),evaluate:_e.bind(_e,e)},()=>t.forEach(a=>a())]}function _b(e,t){let i=()=>{},s=Js[t.type]||i,[n,r]=Qc(e);Vc(e,t.original,r);let o=()=>{e._x_ignore||e._x_ignoreSelf||(s.inline&&s.inline(e,t,n),s=s.bind(s,e,t,n),cr?_i.get(Jc).push(s):s())};return o.runCleanups=r,o}var th=(e,t)=>({name:i,value:s})=>(i.startsWith(e)&&(i=i.replace(e,t)),{name:i,value:s}),eh=e=>e;function ih(e=()=>{}){return({name:t,value:i})=>{let{name:s,value:n}=sh.reduce((r,o)=>o(r),{name:t,value:i});return s!==t&&e(s,t),{name:s,value:n}}}var sh=[];function Jr(e){sh.push(e)}function nh({name:e}){return rh().test(e)}var rh=()=>new RegExp(`^${Gr}([^:^.]+)\\b`);function wb(e,t){return({name:i,value:s})=>{let n=i.match(rh()),r=i.match(/:([a-zA-Z0-9\-_:]+)/),o=i.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[i]||i;return{type:n?n[1]:null,value:r?r[1]:null,modifiers:o.map(l=>l.replace(".","")),expression:s,original:a}}}var hr="DEFAULT",fe=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",hr,"teleport"];function xb(e,t){let i=fe.indexOf(e.type)===-1?hr:e.type,s=fe.indexOf(t.type)===-1?hr:t.type;return fe.indexOf(i)-fe.indexOf(s)}function Ri(e,t,i={}){e.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0,cancelable:!0}))}function Ee(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(n=>Ee(n,t));return}let i=!1;if(t(e,()=>i=!0),i)return;let s=e.firstElementChild;for(;s;)Ee(s,t),s=s.nextElementSibling}function ft(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var Fa=!1;function Sb(){Fa&&ft("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Fa=!0,document.body||ft("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),Ri(document,"alpine:init"),Ri(document,"alpine:initializing"),Yr(),sb(t=>zt(t,Ee)),jr(t=>si(t)),zc((t,i)=>{Zr(t,i).forEach(s=>s())});let e=t=>!pn(t.parentElement,!0);Array.from(document.querySelectorAll(lh().join(","))).filter(e).forEach(t=>{zt(t)}),Ri(document,"alpine:initialized"),setTimeout(()=>{Mb()})}var Qr=[],oh=[];function ah(){return Qr.map(e=>e())}function lh(){return Qr.concat(oh).map(e=>e())}function ch(e){Qr.push(e)}function hh(e){oh.push(e)}function pn(e,t=!1){return ii(e,i=>{if((t?lh():ah()).some(n=>i.matches(n)))return!0})}function ii(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return ii(e.parentElement,t)}}function Eb(e){return ah().some(t=>e.matches(t))}var uh=[];function Ab(e){uh.push(e)}var kb=1;function zt(e,t=Ee,i=()=>{}){ii(e,s=>s._x_ignore)||vb(()=>{t(e,(s,n)=>{s._x_marker||(i(s,n),uh.forEach(r=>r(s,n)),Zr(s,s.attributes).forEach(r=>r()),s._x_ignore||(s._x_marker=kb++),s._x_ignore&&n())})})}function si(e,t=Ee){t(e,i=>{nb(i),qc(i),delete i._x_marker})}function Mb(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,i,s])=>{yb(i)||s.some(n=>{if(document.querySelector(n))return ft(`found "${n}", but missing ${t} plugin`),!0})})}var ur=[],to=!1;function eo(e=()=>{}){return queueMicrotask(()=>{to||setTimeout(()=>{dr()})}),new Promise(t=>{ur.push(()=>{e(),t()})})}function dr(){for(to=!1;ur.length;)ur.shift()()}function Pb(){to=!0}function io(e,t){return Array.isArray(t)?Da(e,t.join(" ")):typeof t=="object"&&t!==null?Tb(e,t):typeof t=="function"?io(e,t()):Da(e,t)}function Da(e,t){let i=n=>n.split(" ").filter(r=>!e.classList.contains(r)).filter(Boolean),s=n=>(e.classList.add(...n),()=>{e.classList.remove(...n)});return t=t===!0?t="":t||"",s(i(t))}function Tb(e,t){let i=a=>a.split(" ").filter(Boolean),s=Object.entries(t).flatMap(([a,l])=>l?i(a):!1).filter(Boolean),n=Object.entries(t).flatMap(([a,l])=>l?!1:i(a)).filter(Boolean),r=[],o=[];return n.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),o.push(a))}),s.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),r.push(a))}),()=>{o.forEach(a=>e.classList.add(a)),r.forEach(a=>e.classList.remove(a))}}function gn(e,t){return typeof t=="object"&&t!==null?Rb(e,t):Cb(e,t)}function Rb(e,t){let i={};return Object.entries(t).forEach(([s,n])=>{i[s]=e.style[s],s.startsWith("--")||(s=Lb(s)),e.style.setProperty(s,n)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{gn(e,i)}}function Cb(e,t){let i=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",i||"")}}function Lb(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function fr(e,t=()=>{}){let i=!1;return function(){i?t.apply(this,arguments):(i=!0,e.apply(this,arguments))}}Z("transition",(e,{value:t,modifiers:i,expression:s},{evaluate:n})=>{typeof s=="function"&&(s=n(s)),s!==!1&&(!s||typeof s=="boolean"?Ob(e,i,t):Ib(e,s,t))});function Ib(e,t,i){dh(e,io,""),{enter:n=>{e._x_transition.enter.during=n},"enter-start":n=>{e._x_transition.enter.start=n},"enter-end":n=>{e._x_transition.enter.end=n},leave:n=>{e._x_transition.leave.during=n},"leave-start":n=>{e._x_transition.leave.start=n},"leave-end":n=>{e._x_transition.leave.end=n}}[i](t)}function Ob(e,t,i){dh(e,gn);let s=!t.includes("in")&&!t.includes("out")&&!i,n=s||t.includes("in")||["enter"].includes(i),r=s||t.includes("out")||["leave"].includes(i);t.includes("in")&&!s&&(t=t.filter((g,m)=>m<t.indexOf("out"))),t.includes("out")&&!s&&(t=t.filter((g,m)=>m>t.indexOf("out")));let o=!t.includes("opacity")&&!t.includes("scale"),a=o||t.includes("opacity"),l=o||t.includes("scale"),c=a?0:1,h=l?fi(t,"scale",95)/100:1,u=fi(t,"delay",0)/1e3,d=fi(t,"origin","center"),f="opacity, transform",y=fi(t,"duration",150)/1e3,b=fi(t,"duration",75)/1e3,p="cubic-bezier(0.4, 0.0, 0.2, 1)";n&&(e._x_transition.enter.during={transformOrigin:d,transitionDelay:`${u}s`,transitionProperty:f,transitionDuration:`${y}s`,transitionTimingFunction:p},e._x_transition.enter.start={opacity:c,transform:`scale(${h})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),r&&(e._x_transition.leave.during={transformOrigin:d,transitionDelay:`${u}s`,transitionProperty:f,transitionDuration:`${b}s`,transitionTimingFunction:p},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:c,transform:`scale(${h})`})}function dh(e,t,i={}){e._x_transition||(e._x_transition={enter:{during:i,start:i,end:i},leave:{during:i,start:i,end:i},in(s=()=>{},n=()=>{}){pr(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},s,n)},out(s=()=>{},n=()=>{}){pr(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},s,n)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,i,s){const n=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let r=()=>n(i);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(i):r():e._x_transition?e._x_transition.in(i):r();return}e._x_hidePromise=e._x_transition?new Promise((o,a)=>{e._x_transition.out(()=>{},()=>o(s)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>a({isFromCancelledTransition:!0}))}):Promise.resolve(s),queueMicrotask(()=>{let o=fh(e);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(e)):n(()=>{let a=l=>{let c=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(a)]).then(([h])=>h==null?void 0:h());return delete l._x_hidePromise,delete l._x_hideChildren,c};a(e).catch(l=>{if(!l.isFromCancelledTransition)throw l})})})};function fh(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:fh(t)}function pr(e,t,{during:i,start:s,end:n}={},r=()=>{},o=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(i).length===0&&Object.keys(s).length===0&&Object.keys(n).length===0){r(),o();return}let a,l,c;Fb(e,{start(){a=t(e,s)},during(){l=t(e,i)},before:r,end(){a(),c=t(e,n)},after:o,cleanup(){l(),c()}})}function Fb(e,t){let i,s,n,r=fr(()=>{Y(()=>{i=!0,s||t.before(),n||(t.end(),dr()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(o){this.beforeCancels.push(o)},cancel:fr(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();r()}),finish:r},Y(()=>{t.start(),t.during()}),Pb(),requestAnimationFrame(()=>{if(i)return;let o=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;o===0&&(o=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),Y(()=>{t.before()}),s=!0,requestAnimationFrame(()=>{i||(Y(()=>{t.end()}),dr(),setTimeout(e._x_transitioning.finish,o+a),n=!0)})})}function fi(e,t,i){if(e.indexOf(t)===-1)return i;const s=e[e.indexOf(t)+1];if(!s||t==="scale"&&isNaN(s))return i;if(t==="duration"||t==="delay"){let n=s.match(/([0-9]+)ms/);if(n)return n[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[s,e[e.indexOf(t)+2]].join(" "):s}var te=!1;function ie(e,t=()=>{}){return(...i)=>te?t(...i):e(...i)}function Db(e){return(...t)=>te&&e(...t)}var ph=[];function mn(e){ph.push(e)}function Bb(e,t){ph.forEach(i=>i(e,t)),te=!0,gh(()=>{zt(t,(i,s)=>{s(i,()=>{})})}),te=!1}var gr=!1;function Hb(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),te=!0,gr=!0,gh(()=>{Nb(t)}),te=!1,gr=!1}function Nb(e){let t=!1;zt(e,(s,n)=>{Ee(s,(r,o)=>{if(t&&Eb(r))return o();t=!0,n(r,o)})})}function gh(e){let t=ke;Oa((i,s)=>{let n=t(i);return ti(n),()=>{}}),e(),Oa(t)}function mh(e,t,i,s=[]){switch(e._x_bindings||(e._x_bindings=Qe({})),e._x_bindings[t]=i,t=s.includes("camel")?Yb(t):t,t){case"value":zb(e,i);break;case"style":qb(e,i);break;case"class":Vb(e,i);break;case"selected":case"checked":$b(e,t,i);break;default:bh(e,t,i);break}}function zb(e,t){if(_h(e))e.attributes.value===void 0&&(e.value=t),window.fromModel&&(typeof t=="boolean"?e.checked=Ds(e.value)===t:e.checked=Ba(e.value,t));else if(so(e))Number.isInteger(t)?e.value=t:!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(i=>Ba(i,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Ub(e,t);else{if(e.value===t)return;e.value=t===void 0?"":t}}function Vb(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=io(e,t)}function qb(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=gn(e,t)}function $b(e,t,i){bh(e,t,i),Wb(e,t,i)}function bh(e,t,i){[null,void 0,!1].includes(i)&&Xb(t)?e.removeAttribute(t):(yh(t)&&(i=t),jb(e,t,i))}function jb(e,t,i){e.getAttribute(t)!=i&&e.setAttribute(t,i)}function Wb(e,t,i){e[t]!==i&&(e[t]=i)}function Ub(e,t){const i=[].concat(t).map(s=>s+"");Array.from(e.options).forEach(s=>{s.selected=i.includes(s.value)})}function Yb(e){return e.toLowerCase().replace(/-(\w)/g,(t,i)=>i.toUpperCase())}function Ba(e,t){return e==t}function Ds(e){return[1,"1","true","on","yes",!0].includes(e)?!0:[0,"0","false","off","no",!1].includes(e)?!1:e?!!e:null}var Kb=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function yh(e){return Kb.has(e)}function Xb(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function Gb(e,t,i){return e._x_bindings&&e._x_bindings[t]!==void 0?e._x_bindings[t]:vh(e,t,i)}function Zb(e,t,i,s=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let n=e._x_inlineBindings[t];return n.extract=s,Kc(()=>_e(e,n.expression))}return vh(e,t,i)}function vh(e,t,i){let s=e.getAttribute(t);return s===null?typeof i=="function"?i():i:s===""?!0:yh(t)?!![t,"true"].includes(s):s}function so(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function _h(e){return e.type==="radio"||e.localName==="ui-radio"}function wh(e,t){var i;return function(){var s=this,n=arguments,r=function(){i=null,e.apply(s,n)};clearTimeout(i),i=setTimeout(r,t)}}function xh(e,t){let i;return function(){let s=this,n=arguments;i||(e.apply(s,n),i=!0,setTimeout(()=>i=!1,t))}}function Sh({get:e,set:t},{get:i,set:s}){let n=!0,r,o=ke(()=>{let a=e(),l=i();if(n)s(Hn(a)),n=!1;else{let c=JSON.stringify(a),h=JSON.stringify(l);c!==r?s(Hn(a)):c!==h&&t(Hn(l))}r=JSON.stringify(e()),JSON.stringify(i())});return()=>{ti(o)}}function Hn(e){return typeof e=="object"?JSON.parse(JSON.stringify(e)):e}function Jb(e){(Array.isArray(e)?e:[e]).forEach(i=>i(Qi))}var he={},Ha=!1;function Qb(e,t){if(Ha||(he=Qe(he),Ha=!0),t===void 0)return he[e];he[e]=t,Wc(he[e]),typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&he[e].init()}function ty(){return he}var Eh={};function ey(e,t){let i=typeof t!="function"?()=>t:t;return e instanceof Element?Ah(e,i()):(Eh[e]=i,()=>{})}
157function iy(e){return Object.entries(Eh).forEach(([t,i])=>{Object.defineProperty(e,t,{get(){return(...s)=>i(...s)}})}),e}function Ah(e,t,i){let s=[];for(;s.length;)s.pop()();let n=Object.entries(t).map(([o,a])=>({name:o,value:a})),r=Zc(n);return n=n.map(o=>r.find(a=>a.name===o.name)?{name:`x-bind:${o.name}`,value:`"${o.value}"`}:o),Zr(e,n,i).map(o=>{s.push(o.runCleanups),o()}),()=>{for(;s.length;)s.pop()()}}var kh={};function sy(e,t){kh[e]=t}function ny(e,t){return Object.entries(kh).forEach(([i,s])=>{Object.defineProperty(e,i,{get(){return(...n)=>s.bind(t)(...n)},enumerable:!1})}),e}var ry={get reactive(){return Qe},get release(){return ti},get effect(){return ke},get raw(){return Fc},version:"3.14.9",flushAndStopDeferringMutations:ab,dontAutoEvaluateFunctions:Kc,disableEffectScheduling:tb,startObservingMutations:Yr,stopObservingMutations:$c,setReactivityEngine:eb,onAttributeRemoved:Vc,onAttributesAdded:zc,closestDataStack:je,skipDuringClone:ie,onlyDuringClone:Db,addRootSelector:ch,addInitSelector:hh,interceptClone:mn,addScopeToNode:Zi,deferMutations:ob,mapAttributes:Jr,evaluateLater:nt,interceptInit:Ab,setEvaluator:fb,mergeProxies:Ji,extractProp:Zb,findClosest:ii,onElRemoved:jr,closestRoot:pn,destroyTree:si,interceptor:Uc,transition:pr,setStyles:gn,mutateDom:Y,directive:Z,entangle:Sh,throttle:xh,debounce:wh,evaluate:_e,initTree:zt,nextTick:eo,prefixed:ei,prefix:bb,plugin:Jb,magic:xt,store:Qb,start:Sb,clone:Hb,cloneNode:Bb,bound:Gb,$data:jc,watch:Dc,walk:Ee,data:sy,bind:ey},Qi=ry;function oy(e,t){const i=Object.create(null),s=e.split(",");for(let n=0;n<s.length;n++)i[s[n]]=!0;return n=>!!i[n]}var ay=Object.freeze({}),ly=Object.prototype.hasOwnProperty,bn=(e,t)=>ly.call(e,t),we=Array.isArray,Ci=e=>Mh(e)==="[object Map]",cy=e=>typeof e=="string",no=e=>typeof e=="symbol",yn=e=>e!==null&&typeof e=="object",hy=Object.prototype.toString,Mh=e=>hy.call(e),Ph=e=>Mh(e).slice(8,-1),ro=e=>cy(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,uy=e=>{const t=Object.create(null);return i=>t[i]||(t[i]=e(i))},dy=uy(e=>e.charAt(0).toUpperCase()+e.slice(1)),Th=(e,t)=>e!==t&&(e===e||t===t),mr=new WeakMap,pi=[],Mt,xe=Symbol("iterate"),br=Symbol("Map key iterate");function fy(e){return e&&e._isEffect===!0}function py(e,t=ay){fy(e)&&(e=e.raw);const i=by(e,t);return t.lazy||i(),i}function gy(e){e.active&&(Rh(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var my=0;function by(e,t){const i=function(){if(!i.active)return e();if(!pi.includes(i)){Rh(i);try{return vy(),pi.push(i),Mt=i,e()}finally{pi.pop(),Ch(),Mt=pi[pi.length-1]}}};return i.id=my++,i.allowRecurse=!!t.allowRecurse,i._isEffect=!0,i.active=!0,i.raw=e,i.deps=[],i.options=t,i}function Rh(e){const{deps:t}=e;if(t.length){for(let i=0;i<t.length;i++)t[i].delete(e);t.length=0}}var We=!0,oo=[];function yy(){oo.push(We),We=!1}function vy(){oo.push(We),We=!0}function Ch(){const e=oo.pop();We=e===void 0?!0:e}function wt(e,t,i){if(!We||Mt===void 0)return;let s=mr.get(e);s||mr.set(e,s=new Map);let n=s.get(i);n||s.set(i,n=new Set),n.has(Mt)||(n.add(Mt),Mt.deps.push(n),Mt.options.onTrack&&Mt.options.onTrack({effect:Mt,target:e,type:t,key:i}))}function ee(e,t,i,s,n,r){const o=mr.get(e);if(!o)return;const a=new Set,l=h=>{h&&h.forEach(u=>{(u!==Mt||u.allowRecurse)&&a.add(u)})};if(t==="clear")o.forEach(l);else if(i==="length"&&we(e))o.forEach((h,u)=>{(u==="length"||u>=s)&&l(h)});else switch(i!==void 0&&l(o.get(i)),t){case"add":we(e)?ro(i)&&l(o.get("length")):(l(o.get(xe)),Ci(e)&&l(o.get(br)));break;case"delete":we(e)||(l(o.get(xe)),Ci(e)&&l(o.get(br)));break;case"set":Ci(e)&&l(o.get(xe));break}const c=h=>{h.options.onTrigger&&h.options.onTrigger({effect:h,target:e,key:i,type:t,newValue:s,oldValue:n,oldTarget:r}),h.options.scheduler?h.options.scheduler(h):h()};a.forEach(c)}var _y=oy("__proto__,__v_isRef,__isVue"),Lh=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(no)),wy=Ih(),xy=Ih(!0),Na=Sy();function Sy(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...i){const s=z(this);for(let r=0,o=this.length;r<o;r++)wt(s,"get",r+"");const n=s[t](...i);return n===-1||n===!1?s[t](...i.map(z)):n}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...i){yy();const s=z(this)[t].apply(this,i);return Ch(),s}}),e}function Ih(e=!1,t=!1){return function(s,n,r){if(n==="__v_isReactive")return!e;if(n==="__v_isReadonly")return e;if(n==="__v_raw"&&r===(e?t?By:Bh:t?Dy:Dh).get(s))return s;const o=we(s);if(!e&&o&&bn(Na,n))return Reflect.get(Na,n,r);const a=Reflect.get(s,n,r);return(no(n)?Lh.has(n):_y(n))||(e||wt(s,"get",n),t)?a:yr(a)?!o||!ro(n)?a.value:a:yn(a)?e?Hh(a):ho(a):a}}var Ey=Ay();function Ay(e=!1){return function(i,s,n,r){let o=i[s];if(!e&&(n=z(n),o=z(o),!we(i)&&yr(o)&&!yr(n)))return o.value=n,!0;const a=we(i)&&ro(s)?Number(s)<i.length:bn(i,s),l=Reflect.set(i,s,n,r);return i===z(r)&&(a?Th(n,o)&&ee(i,"set",s,n,o):ee(i,"add",s,n)),l}}function ky(e,t){const i=bn(e,t),s=e[t],n=Reflect.deleteProperty(e,t);return n&&i&&ee(e,"delete",t,void 0,s),n}function My(e,t){const i=Reflect.has(e,t);return(!no(t)||!Lh.has(t))&&wt(e,"has",t),i}function Py(e){return wt(e,"iterate",we(e)?"length":xe),Reflect.ownKeys(e)}var Ty={get:wy,set:Ey,deleteProperty:ky,has:My,ownKeys:Py},Ry={get:xy,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},ao=e=>yn(e)?ho(e):e,lo=e=>yn(e)?Hh(e):e,co=e=>e,vn=e=>Reflect.getPrototypeOf(e);function _s(e,t,i=!1,s=!1){e=e.__v_raw;const n=z(e),r=z(t);t!==r&&!i&&wt(n,"get",t),!i&&wt(n,"get",r);const{has:o}=vn(n),a=s?co:i?lo:ao;if(o.call(n,t))return a(e.get(t));if(o.call(n,r))return a(e.get(r));e!==n&&e.get(t)}function ws(e,t=!1){const i=this.__v_raw,s=z(i),n=z(e);return e!==n&&!t&&wt(s,"has",e),!t&&wt(s,"has",n),e===n?i.has(e):i.has(e)||i.has(n)}function xs(e,t=!1){return e=e.__v_raw,!t&&wt(z(e),"iterate",xe),Reflect.get(e,"size",e)}function za(e){e=z(e);const t=z(this);return vn(t).has.call(t,e)||(t.add(e),ee(t,"add",e,e)),this}
157function Va(e,t){t=z(t);const i=z(this),{has:s,get:n}=vn(i);let r=s.call(i,e);r?Fh(i,s,e):(e=z(e),r=s.call(i,e));const o=n.call(i,e);return i.set(e,t),r?Th(t,o)&&ee(i,"set",e,t,o):ee(i,"add",e,t),this}function qa(e){const t=z(this),{has:i,get:s}=vn(t);let n=i.call(t,e);n?Fh(t,i,e):(e=z(e),n=i.call(t,e));const r=s?s.call(t,e):void 0,o=t.delete(e);return n&&ee(t,"delete",e,void 0,r),o}function $a(){const e=z(this),t=e.size!==0,i=Ci(e)?new Map(e):new Set(e),s=e.clear();return t&&ee(e,"clear",void 0,void 0,i),s}function Ss(e,t){return function(s,n){const r=this,o=r.__v_raw,a=z(o),l=t?co:e?lo:ao;return!e&&wt(a,"iterate",xe),o.forEach((c,h)=>s.call(n,l(c),l(h),r))}}function Es(e,t,i){return function(...s){const n=this.__v_raw,r=z(n),o=Ci(r),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,c=n[e](...s),h=i?co:t?lo:ao;return!t&&wt(r,"iterate",l?br:xe),{next(){const{value:u,done:d}=c.next();return d?{value:u,done:d}:{value:a?[h(u[0]),h(u[1])]:h(u),done:d}},[Symbol.iterator](){return this}}}}function Vt(e){return function(...t){{const i=t[0]?`on key "${t[0]}" `:"";console.warn(`${dy(e)} operation ${i}failed: target is readonly.`,z(this))}return e==="delete"?!1:this}}function Cy(){const e={get(r){return _s(this,r)},get size(){return xs(this)},has:ws,add:za,set:Va,delete:qa,clear:$a,forEach:Ss(!1,!1)},t={get(r){return _s(this,r,!1,!0)},get size(){return xs(this)},has:ws,add:za,set:Va,delete:qa,clear:$a,forEach:Ss(!1,!0)},i={get(r){return _s(this,r,!0)},get size(){return xs(this,!0)},has(r){return ws.call(this,r,!0)},add:Vt("add"),set:Vt("set"),delete:Vt("delete"),clear:Vt("clear"),forEach:Ss(!0,!1)},s={get(r){return _s(this,r,!0,!0)},get size(){return xs(this,!0)},has(r){return ws.call(this,r,!0)},add:Vt("add"),set:Vt("set"),delete:Vt("delete"),clear:Vt("clear"),forEach:Ss(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{e[r]=Es(r,!1,!1),i[r]=Es(r,!0,!1),t[r]=Es(r,!1,!0),s[r]=Es(r,!0,!0)}),[e,i,t,s]}var[Ly,Iy,cv,hv]=Cy();function Oh(e,t){const i=e?Iy:Ly;return(s,n,r)=>n==="__v_isReactive"?!e:n==="__v_isReadonly"?e:n==="__v_raw"?s:Reflect.get(bn(i,n)&&n in s?i:s,n,r)}var Oy={get:Oh(!1)},Fy={get:Oh(!0)};function Fh(e,t,i){const s=z(i);if(s!==i&&t.call(e,s)){const n=Ph(e);console.warn(`Reactive ${n} contains both the raw and reactive versions of the same object${n==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var Dh=new WeakMap,Dy=new WeakMap,Bh=new WeakMap,By=new WeakMap;function Hy(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ny(e){return e.__v_skip||!Object.isExtensible(e)?0:Hy(Ph(e))}function ho(e){return e&&e.__v_isReadonly?e:Nh(e,!1,Ty,Oy,Dh)}function Hh(e){return Nh(e,!0,Ry,Fy,Bh)}function Nh(e,t,i,s,n){if(!yn(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=n.get(e);if(r)return r;const o=Ny(e);if(o===0)return e;const a=new Proxy(e,o===2?s:i);return n.set(e,a),a}function z(e){return e&&z(e.__v_raw)||e}function yr(e){return!!(e&&e.__v_isRef===!0)}xt("nextTick",()=>eo);xt("dispatch",e=>Ri.bind(Ri,e));xt("watch",(e,{evaluateLater:t,cleanup:i})=>(s,n)=>{let r=t(s),a=Dc(()=>{let l;return r(c=>l=c),l},n);i(a)});xt("store",ty);xt("data",e=>jc(e));xt("root",e=>pn(e));xt("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=Ji(zy(e))),e._x_refs_proxy));function zy(e){let t=[];return ii(e,i=>{i._x_refs&&t.push(i._x_refs)}),t}var Nn={};function zh(e){return Nn[e]||(Nn[e]=0),++Nn[e]}function Vy(e,t){return ii(e,i=>{if(i._x_ids&&i._x_ids[t])return!0})}function qy(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=zh(t))}xt("id",(e,{cleanup:t})=>(i,s=null)=>{let n=`${i}${s?`-${s}`:""}`;return $y(e,n,t,()=>{let r=Vy(e,i),o=r?r._x_ids[i]:zh(i);return s?`${i}-${o}-${s}`:`${i}-${o}`})});mn((e,t)=>{e._x_id&&(t._x_id=e._x_id)});function $y(e,t,i,s){if(e._x_id||(e._x_id={}),e._x_id[t])return e._x_id[t];let n=s();return e._x_id[t]=n,i(()=>{delete e._x_id[t]}),n}xt("el",e=>e);Vh("Focus","focus","focus");Vh("Persist","persist","persist");function Vh(e,t,i){xt(t,s=>ft(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${i}`,s))}Z("modelable",(e,{expression:t},{effect:i,evaluateLater:s,cleanup:n})=>{let r=s(t),o=()=>{let h;return r(u=>h=u),h},a=s(`${t} = __placeholder`),l=h=>a(()=>{},{scope:{__placeholder:h}}),c=o();l(c),queueMicrotask(()=>
vendor: 5,449 bytes, line 157
157{if(!e._x_model)return;e._x_removeModelListeners.default();let h=e._x_model.get,u=e._x_model.set,d=Sh({get(){return h()},set(f){u(f)}},{get(){return o()},set(f){l(f)}});n(d)})});Z("teleport",(e,{modifiers:t,expression:i},{cleanup:s})=>{e.tagName.toLowerCase()!=="template"&&ft("x-teleport can only be used on a <template> tag",e);let n=ja(i),r=e.content.cloneNode(!0).firstElementChild;e._x_teleport=r,r._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),r.setAttribute("data-teleport-target",!0),e._x_forwardEvents&&e._x_forwardEvents.forEach(a=>{r.addEventListener(a,l=>{l.stopPropagation(),e.dispatchEvent(new l.constructor(l.type,l))})}),Zi(r,{},e);let o=(a,l,c)=>{c.includes("prepend")?l.parentNode.insertBefore(a,l):c.includes("append")?l.parentNode.insertBefore(a,l.nextSibling):l.appendChild(a)};Y(()=>{o(r,n,t),ie(()=>{zt(r)})()}),e._x_teleportPutBack=()=>{let a=ja(i);Y(()=>{o(e._x_teleport,a,t)})},s(()=>Y(()=>{r.remove(),si(r)}))});var jy=document.createElement("div");function ja(e){let t=ie(()=>document.querySelector(e),()=>jy)();return t||ft(`Cannot find x-teleport element for selector: "${e}"`),t}var qh=()=>{};qh.inline=(e,{modifiers:t},{cleanup:i})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,i(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};Z("ignore",qh);Z("effect",ie((e,{expression:t},{effect:i})=>{i(nt(e,t))}));function vr(e,t,i,s){let n=e,r=l=>s(l),o={},a=(l,c)=>h=>c(l,h);if(i.includes("dot")&&(t=Wy(t)),i.includes("camel")&&(t=Uy(t)),i.includes("passive")&&(o.passive=!0),i.includes("capture")&&(o.capture=!0),i.includes("window")&&(n=window),i.includes("document")&&(n=document),i.includes("debounce")){let l=i[i.indexOf("debounce")+1]||"invalid-wait",c=Qs(l.split("ms")[0])?Number(l.split("ms")[0]):250;r=wh(r,c)}if(i.includes("throttle")){let l=i[i.indexOf("throttle")+1]||"invalid-wait",c=Qs(l.split("ms")[0])?Number(l.split("ms")[0]):250;r=xh(r,c)}return i.includes("prevent")&&(r=a(r,(l,c)=>{c.preventDefault(),l(c)})),i.includes("stop")&&(r=a(r,(l,c)=>{c.stopPropagation(),l(c)})),i.includes("once")&&(r=a(r,(l,c)=>{l(c),n.removeEventListener(t,r,o)})),(i.includes("away")||i.includes("outside"))&&(n=document,r=a(r,(l,c)=>{e.contains(c.target)||c.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&l(c))})),i.includes("self")&&(r=a(r,(l,c)=>{c.target===e&&l(c)})),(Ky(t)||$h(t))&&(r=a(r,(l,c)=>{Xy(c,i)||l(c)})),n.addEventListener(t,r,o),()=>{n.removeEventListener(t,r,o)}}function Wy(e){return e.replace(/-/g,".")}function Uy(e){return e.toLowerCase().replace(/-(\w)/g,(t,i)=>i.toUpperCase())}function Qs(e){return!Array.isArray(e)&&!isNaN(e)}function Yy(e){return[" ","_"].includes(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Ky(e){return["keydown","keyup"].includes(e)}function $h(e){return["contextmenu","click","mouse"].some(t=>e.includes(t))}function Xy(e,t){let i=t.filter(r=>!["window","document","prevent","stop","once","capture","self","away","outside","passive"].includes(r));if(i.includes("debounce")){let r=i.indexOf("debounce");i.splice(r,Qs((i[r+1]||"invalid-wait").split("ms")[0])?2:1)}if(i.includes("throttle")){let r=i.indexOf("throttle");i.splice(r,Qs((i[r+1]||"invalid-wait").split("ms")[0])?2:1)}if(i.length===0||i.length===1&&Wa(e.key).includes(i[0]))return!1;const n=["ctrl","shift","alt","meta","cmd","super"].filter(r=>i.includes(r));return i=i.filter(r=>!n.includes(r)),!(n.length>0&&n.filter(o=>((o==="cmd"||o==="super")&&(o="meta"),e[`${o}Key`])).length===n.length&&($h(e.type)||Wa(e.key).includes(i[0])))}function Wa(e){if(!e)return[];e=Yy(e);let t={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return t[e]=e,Object.keys(t).map(i=>{if(t[i]===e)return i}).filter(i=>i)}Z("model",(e,{modifiers:t,expression:i},{effect:s,cleanup:n})=>{let r=e;t.includes("parent")&&(r=e.parentNode);let o=nt(r,i),a;typeof i=="string"?a=nt(r,`${i} = __placeholder`):typeof i=="function"&&typeof i()=="string"?a=nt(r,`${i()} = __placeholder`):a=()=>{};let l=()=>{let d;return o(f=>d=f),Ua(d)?d.get():d},c=d=>{let f;o(y=>f=y),Ua(f)?f.set(d):a(()=>{},{scope:{__placeholder:d}})};typeof i=="string"&&e.type==="radio"&&Y(()=>{e.hasAttribute("name")||e.setAttribute("name",i)});var h=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let u=te?()=>{}:vr(e,h,t,d=>{c(zn(e,t,d,l()))});if(t.includes("fill")&&([void 0,null,""].includes(l())||so(e)&&Array.isArray(l())||e.tagName.toLowerCase()==="select"&&e.multiple)&&c(zn(e,t,{target:e},l())),e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=u,n(()=>e._x_removeModelListeners.default()),e.form){let d=vr(e.form,"reset",[],f=>{eo(()=>e._x_model&&e._x_model.set(zn(e,t,{target:e},l())))});n(()=>d())}e._x_model={get(){return l()},set(d){c(d)}},e._x_forceModelUpdate=d=>{d===void 0&&typeof i=="string"&&i.match(/\./)&&(d=""),window.fromModel=!0,Y(()=>mh(e,"value",d)),delete window.fromModel},s(()=>{let d=l();t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(d)})});function zn(e,t,i,s){return Y(()=>{if(i instanceof CustomEvent&&i.detail!==void 0)return i.detail!==null&&i.detail!==void 0?i.detail:i.target.value;if(so(e))if(Array.isArray(s)){let n=null;
157return t.includes("number")?n=Vn(i.target.value):t.includes("boolean")?n=Ds(i.target.value):n=i.target.value,i.target.checked?s.includes(n)?s:s.concat([n]):s.filter(r=>!Gy(r,n))}else return i.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(i.target.selectedOptions).map(n=>{let r=n.value||n.text;return Vn(r)}):t.includes("boolean")?Array.from(i.target.selectedOptions).map(n=>{let r=n.value||n.text;return Ds(r)}):Array.from(i.target.selectedOptions).map(n=>n.value||n.text);{let n;return _h(e)?i.target.checked?n=i.target.value:n=s:n=i.target.value,t.includes("number")?Vn(n):t.includes("boolean")?Ds(n):t.includes("trim")?n.trim():n}}})}function Vn(e){let t=e?parseFloat(e):null;return Zy(t)?t:e}function Gy(e,t){return e==t}function Zy(e){return!Array.isArray(e)&&!isNaN(e)}function Ua(e){return e!==null&&typeof e=="object"&&typeof e.get=="function"&&typeof e.set=="function"}Z("cloak",e=>queueMicrotask(()=>Y(()=>e.removeAttribute(ei("cloak")))));hh(()=>`[${ei("init")}]`);Z("init",ie((e,{expression:t},{evaluate:i})=>typeof t=="string"?!!t.trim()&&i(t,{},!1):i(t,{},!1)));Z("text",(e,{expression:t},{effect:i,evaluateLater:s})=>{let n=s(t);i(()=>{n(r=>{Y(()=>{e.textContent=r})})})});Z("html",(e,{expression:t},{effect:i,evaluateLater:s})=>{let n=s(t);i(()=>{n(r=>{Y(()=>{e.innerHTML=r,e._x_ignoreSelf=!0,zt(e),delete e._x_ignoreSelf})})})});Jr(th(":",eh(ei("bind:"))));var jh=(e,{value:t,modifiers:i,expression:s,original:n},{effect:r,cleanup:o})=>{if(!t){let l={};iy(l),nt(e,s)(h=>{Ah(e,h,n)},{scope:l});return}if(t==="key")return Jy(e,s);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let a=nt(e,s);r(()=>a(l=>{l===void 0&&typeof s=="string"&&s.match(/\./)&&(l=""),Y(()=>mh(e,t,l,i))})),o(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})};jh.inline=(e,{value:t,modifiers:i,expression:s})=>{t&&(e._x_inlineBindings||(e._x_inlineBindings={}),e._x_inlineBindings[t]={expression:s,extract:!1})};Z("bind",jh);function Jy(e,t){e._x_keyExpression=t}ch(()=>`[${ei("data")}]`);Z("data",(e,{expression:t},{cleanup:i})=>{if(Qy(e))return;t=t===""?"{}":t;let s={};lr(s,e);let n={};ny(n,s);let r=_e(e,t,{scope:n});(r===void 0||r===!0)&&(r={}),lr(r,e);let o=Qe(r);Wc(o);let a=Zi(e,o);o.init&&_e(e,o.init),i(()=>{o.destroy&&_e(e,o.destroy),a()})});mn((e,t)=>{e._x_dataStack&&(t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0))});function Qy(e){return te?gr?!0:e.hasAttribute("data-has-alpine-state"):!1}Z("show",(e,{modifiers:t,expression:i},{effect:s})=>{let n=nt(e,i);e._x_doHide||(e._x_doHide=()=>{Y(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{Y(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let r=()=>{e._x_doHide(),e._x_isShown=!1},o=()=>{e._x_doShow(),e._x_isShown=!0},a=()=>setTimeout(o),l=fr(u=>u?o():r(),u=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,u,o,r):u?a():r()}),c,h=!0;s(()=>n(u=>{!h&&u===c||(t.includes("immediate")&&(u?a():r()),l(u),c=u,h=!1)}))});Z("for",(e,{expression:t},{effect:i,cleanup:s})=>{let n=ev(t),r=nt(e,n.items),o=nt(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},i(()=>tv(e,n,r,o)),s(()=>{Object.values(e._x_lookup).forEach(a=>Y(()=>{si(a),a.remove()})),delete e._x_prevKeys,delete e._x_lookup})});function tv(e,t,i,s){let n=o=>typeof o=="object"&&!Array.isArray(o),r=e;i(o=>{iv(o)&&o>=0&&(o=Array.from(Array(o).keys(),p=>p+1)),o===void 0&&(o=[]);let a=e._x_lookup,l=e._x_prevKeys,c=[],h=[];if(n(o))o=Object.entries(o).map(([p,g])=>{let m=Ya(t,g,p,o);s(w=>{h.includes(w)&&ft("Duplicate key on x-for",e),h.push(w)},{scope:{index:p,...m}}),c.push(m)});else for(let p=0;p<o.length;p++){let g=Ya(t,o[p],p,o);s(m=>{h.includes(m)&&ft("Duplicate key on x-for",e),h.push(m)},{scope:{index:p,...g}}),c.push(g)}let u=[],d=[],f=[],y=[];for(let p=0;p<l.length;p++){let g=l[p];h.indexOf(g)===-1&&f.push(g)}l=l.filter(p=>!f.includes(p));let b="template";for(let p=0;p<h.length;p++){let g=h[p],m=l.indexOf(g);if(m===-1)l.splice(p,0,g),u.push([b,p]);else if(m!==p){let w=l.splice(p,1)[0],v=l.splice(m-1,1)[0];l.splice(p,0,v),l.splice(m,0,w),d.push([w,v])}else y.push(g);b=g}for(let p=0;p<f.length;p++){let g=f[p];g in a&&(Y(()=>{si(a[g]),a[g].remove()}),delete a[g])}for(let p=0;p<d.length;p++){let[g,m]=d[p],w=a[g],v=a[m],_=document.createElement("div");Y(()=>{v||ft('x-for ":key" is undefined or invalid',r,m,a),v.after(_),w.after(v),v._x_currentIfEl&&v.after(v._x_currentIfEl),_.before(w),w._x_currentIfEl&&w.after(w._x_currentIfEl),_.remove()}),v._x_refreshXForScope(c[h.indexOf(m)])}for(let p=0;p<u.length;p++){let[g,m]=u[p],w=g==="template"?r:a[g];w._x_currentIfEl&&(w=w._x_currentIfEl);let v=c[m],_=h[m],E=document.importNode(r.content,!0).firstElementChild,S=Qe(v);Zi(E,S,r),E._x_refreshXForScope=A=>{Object.entries(A).forEach(([k,P])=>{S[k]=P})},Y(()=>{w.after(E),ie(()=>zt(E))()}),typeof _=="object"&&ft("x-for key cannot be an object, it must be a string or an integer",r),a[_]=E}for(let p=0;p<y.length;p++)a[y[p]]._x_refreshXForScope(c[h.indexOf(y[p])]);r._x_prevKeys=h})}function ev(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,i=/^\s*\(|\)\s*$/g,s=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,n=e.match(s);if(!n)return;let r={};r.items=n[2].trim();let o=n[1].replace(i,"").trim(),a=o.match(t);return a?(r.item=o.replace(t,"").trim(),r.index=a[1].trim(),a[2]&&(r.collection=a[2].trim())):r.item=o,r}function Ya(e,t,i,s){let n={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(o=>
157o.trim()).forEach((o,a)=>{n[o]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(o=>o.trim()).forEach(o=>{n[o]=t[o]}):n[e.item]=t,e.index&&(n[e.index]=i),e.collection&&(n[e.collection]=s),n}function iv(e){return!Array.isArray(e)&&!isNaN(e)}function Wh(){}Wh.inline=(e,{expression:t},{cleanup:i})=>{let s=pn(e);s._x_refs||(s._x_refs={}),s._x_refs[t]=e,i(()=>delete s._x_refs[t])};Z("ref",Wh);Z("if",(e,{expression:t},{effect:i,cleanup:s})=>{e.tagName.toLowerCase()!=="template"&&ft("x-if can only be used on a <template> tag",e);let n=nt(e,t),r=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return Zi(a,{},e),Y(()=>{e.after(a),ie(()=>zt(a))()}),e._x_currentIfEl=a,e._x_undoIf=()=>{Y(()=>{si(a),a.remove()}),delete e._x_currentIfEl},a},o=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};i(()=>n(a=>{a?r():o()})),s(()=>e._x_undoIf&&e._x_undoIf())});Z("id",(e,{expression:t},{evaluate:i})=>{i(t).forEach(n=>qy(e,n))});mn((e,t)=>{e._x_ids&&(t._x_ids=e._x_ids)});Jr(th("@",eh(ei("on:"))));Z("on",ie((e,{value:t,modifiers:i,expression:s},{cleanup:n})=>{let r=s?nt(e,s):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let o=vr(e,t,i,a=>{r(()=>{},{scope:{$event:a},params:[a]})});n(()=>o())}));_n("Collapse","collapse","collapse");_n("Intersect","intersect","intersect");_n("Focus","trap","focus");_n("Mask","mask","mask");function _n(e,t,i){Z(t,s=>ft(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${i}`,s))}Qi.setEvaluator(Gc);Qi.setReactivityEngine({reactive:ho,effect:py,release:gy,raw:z});var sv=Qi,uo=sv;const nv=Object.assign({"../components/header.js":Um,"../components/youtubeVideo.js":Km});window.Alpine=uo;Object.entries(nv).forEach(([e,t])=>{const i=e.split("/").pop().split(".").shift();uo.data(i,t)});uo.start();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.