File: /var/www/web.enelar.com.co/dist/browser/scripts-6QLKDOAA.js
/*! For license information please see quill.js.LICENSE.txt */(function(De,Qe){typeof exports=="object"&&typeof module=="object"?module.exports=Qe():typeof define=="function"&&define.amd?define([],Qe):typeof exports=="object"?exports.Quill=Qe():De.Quill=Qe()})(self,function(){return function(){var De={9698:function(nt,W,u){"use strict";u.d(W,{Ay:function(){return F},Ji:function(){return K},mG:function(){return V},zo:function(){return v}});var y=u(6003),q=u(5232),$=u.n(q),T=u(3036),H=u(4850),_=u(5508);class F extends y.BlockBlot{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=V(this)),this.cache.delta}deleteAt(R,Y){super.deleteAt(R,Y),this.cache={}}formatAt(R,Y,G,rt){Y<=0||(this.scroll.query(G,y.Scope.BLOCK)?R+Y===this.length()&&this.format(G,rt):super.formatAt(R,Math.min(Y,this.length()-R-1),G,rt),this.cache={})}insertAt(R,Y,G){if(G!=null)return super.insertAt(R,Y,G),void(this.cache={});if(Y.length===0)return;const rt=Y.split(`
`),vt=rt.shift();vt.length>0&&(R<this.length()-1||this.children.tail==null?super.insertAt(Math.min(R,this.length()-1),vt):this.children.tail.insertAt(this.children.tail.length(),vt),this.cache={});let kt=this;rt.reduce((pt,O)=>(kt=kt.split(pt,!0),kt.insertAt(0,O),O.length),R+vt.length)}insertBefore(R,Y){const{head:G}=this.children;super.insertBefore(R,Y),G instanceof T.A&&G.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+1),this.cache.length}moveChildren(R,Y){super.moveChildren(R,Y),this.cache={}}optimize(R){super.optimize(R),this.cache={}}path(R){return super.path(R,!0)}removeChild(R){super.removeChild(R),this.cache={}}split(R){let Y=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(Y&&(R===0||R>=this.length()-1)){const rt=this.clone();return R===0?(this.parent.insertBefore(rt,this),this):(this.parent.insertBefore(rt,this.next),rt)}const G=super.split(R,Y);return this.cache={},G}}F.blotName="block",F.tagName="P",F.defaultChild=T.A,F.allowedChildren=[T.A,H.A,y.EmbedBlot,_.A];class v extends y.EmbedBlot{attach(){super.attach(),this.attributes=new y.AttributorStore(this.domNode)}delta(){return new($())().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(R,Y){const G=this.scroll.query(R,y.Scope.BLOCK_ATTRIBUTE);G!=null&&this.attributes.attribute(G,Y)}formatAt(R,Y,G,rt){this.format(G,rt)}insertAt(R,Y,G){if(G!=null)return void super.insertAt(R,Y,G);const rt=Y.split(`
`),vt=rt.pop(),kt=rt.map(O=>{const X=this.scroll.create(F.blotName);return X.insertAt(0,O),X}),pt=this.split(R);kt.forEach(O=>{this.parent.insertBefore(O,pt)}),vt&&this.parent.insertBefore(this.scroll.create("text",vt),pt)}}function V(k){let R=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return k.descendants(y.LeafBlot).reduce((Y,G)=>G.length()===0?Y:Y.insert(G.value(),K(G,{},R)),new($())).insert(`
`,K(k))}function K(k){let R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return k==null?R:("formats"in k&&typeof k.formats=="function"&&(R={...R,...k.formats()},Y&&delete R["code-token"]),k.parent==null||k.parent.statics.blotName==="scroll"||k.parent.statics.scope!==k.statics.scope?R:K(k.parent,R,Y))}v.scope=y.Scope.BLOCK_BLOT},3036:function(nt,W,u){"use strict";var y=u(6003);class q extends y.EmbedBlot{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}q.blotName="break",q.tagName="BR",W.A=q},580:function(nt,W,u){"use strict";var y=u(6003);class q extends y.ContainerBlot{}W.A=q},4541:function(nt,W,u){"use strict";var y=u(6003),q=u(5508);class $ extends y.EmbedBlot{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\uFEFF";static value(){}constructor(H,_,F){super(H,_),this.selection=F,this.textNode=document.createTextNode($.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(H,_){if(this.savedLength!==0)return void super.format(H,_);let F=this,v=0;for(;F!=null&&F.statics.scope!==y.Scope.BLOCK_BLOT;)v+=F.offset(F.parent),F=F.parent;F!=null&&(this.savedLength=$.CONTENTS.length,F.optimize(),F.formatAt(v,$.CONTENTS.length,H,_),this.savedLength=0)}index(H,_){return H===this.textNode?0:super.index(H,_)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const H=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const _=this.prev instanceof q.A?this.prev:null,F=_?_.length():0,v=this.next instanceof q.A?this.next:null,V=v?v.text:"",{textNode:K}=this,k=K.data.split($.CONTENTS).join("");let R;if(K.data=$.CONTENTS,_)R=_,(k||v)&&(_.insertAt(_.length(),k+V),v&&v.remove());else if(v)R=v,v.insertAt(0,k);else{const Y=document.createTextNode(k);R=this.scroll.create(Y),this.parent.insertBefore(R,this)}if(this.remove(),H){const Y=(vt,kt)=>_&&vt===_.domNode?kt:vt===K?F+kt-1:v&&vt===v.domNode?F+k.length+kt:null,G=Y(H.start.node,H.start.offset),rt=Y(H.end.node,H.end.offset);if(G!==null&&rt!==null)return{startNode:R.domNode,startOffset:G,endNode:R.domNode,endOffset:rt}}return null}update(H,_){if(H.some(F=>F.type==="characterData"&&F.target===this.textNode)){const F=this.restore();F&&(_.range=F)}}optimize(H){super.optimize(H);let{parent:_}=this;for(;_;){if(_.domNode.tagName==="A"){this.savedLength=$.CONTENTS.length,_.isolate(this.offset(_),this.length()).unwrap(),this.savedLength=0;break}_=_.parent}}value(){return""}}W.A=$},746:function(nt,W,u){"use strict";var y=u(6003),q=u(5508);const $="\uFEFF";class T extends y.EmbedBlot{constructor(_,F){super(_,F),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(v=>{this.contentNode.appendChild(v)}),this.leftGuard=document.createTextNode($),this.rightGuard=document.createTextNode($),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(_,F){return _===this.leftGuard?0:_===this.rightGuard?1:super.index(_,F)}restore(_){let F,v=null;const V=_.data.split($).join("");if(_===this.leftGuard)if(this.prev instanceof q.A){const K=this.prev.length();this.prev.insertAt(K,V),v={startNode:this.prev.domNode,startOffset:K+V.length}}else F=document.createTextNode(V),this.parent.insertBefore(this.scroll.create(F),this),v={startNode:F,startOffset:V.length};else _===this.rightGuard&&(this.next instanceof q.A?(this.next.insertAt(0,V),v={startNode:this.next.domNode,startOffset:V.length}):(F=document.createTextNode(V),this.parent.insertBefore(this.scroll.create(F),this.next),v={startNode:F,startOffset:V.length}));return _.data=$,v}update(_,F){_.forEach(v=>{if(v.type==="characterData"&&(v.target===this.leftGuard||v.target===this.rightGuard)){const V=this.restore(v.target);V&&(F.range=V)}})}}W.A=T},4850:function(nt,W,u){"use strict";var y=u(6003),q=u(3036),$=u(5508);class T extends y.InlineBlot{static allowedChildren=[T,q.A,y.EmbedBlot,$.A];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(_,F){const v=T.order.indexOf(_),V=T.order.indexOf(F);return v>=0||V>=0?v-V:_===F?0:_<F?-1:1}formatAt(_,F,v,V){if(T.compare(this.statics.blotName,v)<0&&this.scroll.query(v,y.Scope.BLOT)){const K=this.isolate(_,F);V&&K.wrap(v,V)}else super.formatAt(_,F,v,V)}optimize(_){if(super.optimize(_),this.parent instanceof T&&T.compare(this.statics.blotName,this.parent.statics.blotName)>0){const F=this.parent.isolate(this.offset(),this.length());this.moveChildren(F),F.wrap(this)}}}W.A=T},5508:function(nt,W,u){"use strict";u.d(W,{A:function(){return q},X:function(){return $}});var y=u(6003);class q extends y.TextBlot{}function $(T){return T.replace(/[&<>"']/g,H=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[H])}},3729:function(nt,W,u){"use strict";u.d(W,{default:function(){return d}});var y=u(6142),q=u(9698),$=u(3036),T=u(580),H=u(4541),_=u(746),F=u(4850),v=u(6003),V=u(5232),K=u.n(V),k=u(5374);function R(g){return g instanceof q.Ay||g instanceof q.zo}function Y(g){return typeof g.updateContent=="function"}class G extends v.ScrollBlot{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=q.Ay;static allowedChildren=[q.Ay,q.zo,T.A];constructor(f,U,A){let{emitter:N}=A;super(f,U),this.emitter=N,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",z=>this.handleDragStart(z))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const f=this.batch;this.batch=!1,this.update(f)}emitMount(f){this.emitter.emit(k.A.events.SCROLL_BLOT_MOUNT,f)}emitUnmount(f){this.emitter.emit(k.A.events.SCROLL_BLOT_UNMOUNT,f)}emitEmbedUpdate(f,U){this.emitter.emit(k.A.events.SCROLL_EMBED_UPDATE,f,U)}deleteAt(f,U){const[A,N]=this.line(f),[z]=this.line(f+U);if(super.deleteAt(f,U),z!=null&&A!==z&&N>0){if(A instanceof q.zo||z instanceof q.zo)return void this.optimize();const j=z.children.head instanceof $.A?null:z.children.head;A.moveChildren(z,j),A.remove()}this.optimize()}enable(){let f=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.domNode.setAttribute("contenteditable",f?"true":"false")}formatAt(f,U,A,N){super.formatAt(f,U,A,N),this.optimize()}insertAt(f,U,A){if(f>=this.length())if(A==null||this.scroll.query(U,v.Scope.BLOCK)==null){const N=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(N),A==null&&U.endsWith(`
`)?N.insertAt(0,U.slice(0,-1),A):N.insertAt(0,U,A)}else{const N=this.scroll.create(U,A);this.appendChild(N)}else super.insertAt(f,U,A);this.optimize()}insertBefore(f,U){if(f.statics.scope===v.Scope.INLINE_BLOT){const A=this.scroll.create(this.statics.defaultChild.blotName);A.appendChild(f),super.insertBefore(A,U)}else super.insertBefore(f,U)}insertContents(f,U){const A=this.deltaToRenderBlocks(U.concat(new(K())().insert(`
`))),N=A.pop();if(N==null)return;this.batchStart();const z=A.shift();if(z){const p=z.type==="block"&&(z.delta.length()===0||!this.descendant(q.zo,f)[0]&&f<this.length()),x=z.type==="block"?z.delta:new(K())().insert({[z.key]:z.value});rt(this,f,x);const w=z.type==="block"?1:0,I=f+x.length()+w;p&&this.insertAt(I-1,`
`);const B=(0,q.Ji)(this.line(f)[0]),J=V.AttributeMap.diff(B,z.attributes)||{};Object.keys(J).forEach(ot=>{this.formatAt(I-1,1,ot,J[ot])}),f=I}let[j,L]=this.children.find(f);A.length&&(j&&(j=j.split(L),L=0),A.forEach(p=>{if(p.type==="block")rt(this.createBlock(p.attributes,j||void 0),0,p.delta);else{const x=this.create(p.key,p.value);this.insertBefore(x,j||void 0),Object.keys(p.attributes).forEach(w=>{x.format(w,p.attributes[w])})}})),N.type==="block"&&N.delta.length()&&rt(this,j?j.offset(j.scroll)+L:this.length(),N.delta),this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(f){const U=this.path(f).pop();if(!U)return[null,-1];const[A,N]=U;return A instanceof v.LeafBlot?[A,N]:[null,-1]}line(f){return f===this.length()?this.line(f-1):this.descendant(R,f)}lines(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const A=(N,z,j)=>{let L=[],p=j;return N.children.forEachAt(z,j,(x,w,I)=>{R(x)?L.push(x):x instanceof v.ContainerBlot&&(L=L.concat(A(x,w,p))),p-=I}),L};return A(this,f,U)}optimize(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(f,U),f.length>0&&this.emitter.emit(k.A.events.SCROLL_OPTIMIZE,f,U))}path(f){return super.path(f).slice(1)}remove(){}update(f){if(this.batch)return void(Array.isArray(f)&&(this.batch=this.batch.concat(f)));let U=k.A.sources.USER;typeof f=="string"&&(U=f),Array.isArray(f)||(f=this.observer.takeRecords()),(f=f.filter(A=>{let{target:N}=A;const z=this.find(N,!0);return z&&!Y(z)})).length>0&&this.emitter.emit(k.A.events.SCROLL_BEFORE_UPDATE,U,f),super.update(f.concat([])),f.length>0&&this.emitter.emit(k.A.events.SCROLL_UPDATE,U,f)}updateEmbedAt(f,U,A){const[N]=this.descendant(z=>z instanceof q.zo,f);N&&N.statics.blotName===U&&Y(N)&&N.updateContent(A)}handleDragStart(f){f.preventDefault()}deltaToRenderBlocks(f){const U=[];let A=new(K());return f.forEach(N=>{const z=N?.insert;if(z)if(typeof z=="string"){const j=z.split(`
`);j.slice(0,-1).forEach(p=>{A.insert(p,N.attributes),U.push({type:"block",delta:A,attributes:N.attributes??{}}),A=new(K())});const L=j[j.length-1];L&&A.insert(L,N.attributes)}else{const j=Object.keys(z)[0];if(!j)return;this.query(j,v.Scope.INLINE)?A.push(N):(A.length()&&U.push({type:"block",delta:A,attributes:{}}),A=new(K()),U.push({type:"blockEmbed",key:j,value:z[j],attributes:N.attributes??{}}))}}),A.length()&&U.push({type:"block",delta:A,attributes:{}}),U}createBlock(f,U){let A;const N={};Object.entries(f).forEach(L=>{let[p,x]=L;this.query(p,v.Scope.BLOCK&v.Scope.BLOT)!=null?A=p:N[p]=x});const z=this.create(A||this.statics.defaultChild.blotName,A?f[A]:void 0);this.insertBefore(z,U||void 0);const j=z.length();return Object.entries(N).forEach(L=>{let[p,x]=L;z.formatAt(0,j,p,x)}),z}}function rt(g,f,U){U.reduce((A,N)=>{const z=V.Op.length(N);let j=N.attributes||{};if(N.insert!=null){if(typeof N.insert=="string"){const L=N.insert;g.insertAt(A,L);const[p]=g.descendant(v.LeafBlot,A),x=(0,q.Ji)(p);j=V.AttributeMap.diff(x,j)||{}}else if(typeof N.insert=="object"){const L=Object.keys(N.insert)[0];if(L==null)return A;if(g.insertAt(A,L,N.insert[L]),g.scroll.query(L,v.Scope.INLINE)!=null){const[p]=g.descendant(v.LeafBlot,A),x=(0,q.Ji)(p);j=V.AttributeMap.diff(x,j)||{}}}}return Object.keys(j).forEach(L=>{g.formatAt(A,z,L,j[L])}),A+z},f)}var vt=G,kt=u(5508),pt=u(584),O=u(4266);class X extends O.A{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(f,U){super(f,U),this.quill.on(y.Ay.events.EDITOR_CHANGE,(A,N,z,j)=>{A===y.Ay.events.SELECTION_CHANGE?N&&j!==y.Ay.sources.SILENT&&(this.currentRange=N):A===y.Ay.events.TEXT_CHANGE&&(this.ignoreChange||(this.options.userOnly&&j!==y.Ay.sources.USER?this.transform(N):this.record(N,z)),this.currentRange=Q(this.currentRange,N))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",A=>{A.inputType==="historyUndo"?(this.undo(),A.preventDefault()):A.inputType==="historyRedo"&&(this.redo(),A.preventDefault())})}change(f,U){if(this.stack[f].length===0)return;const A=this.stack[f].pop();if(!A)return;const N=this.quill.getContents(),z=A.delta.invert(N);this.stack[U].push({delta:z,range:Q(A.range,z)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(A.delta,y.Ay.sources.USER),this.ignoreChange=!1,this.restoreSelection(A)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(f,U){if(f.ops.length===0)return;this.stack.redo=[];let A=f.invert(U),N=this.currentRange;const z=Date.now();if(this.lastRecorded+this.options.delay>z&&this.stack.undo.length>0){const j=this.stack.undo.pop();j&&(A=A.compose(j.delta),N=j.range)}else this.lastRecorded=z;A.length()!==0&&(this.stack.undo.push({delta:A,range:N}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(f){dt(this.stack.undo,f),dt(this.stack.redo,f)}undo(){this.change("undo","redo")}restoreSelection(f){if(f.range)this.quill.setSelection(f.range,y.Ay.sources.USER);else{const U=function(A,N){const z=N.reduce((L,p)=>L+(p.delete||0),0);let j=N.length()-z;return function(L,p){const x=p.ops[p.ops.length-1];return x!=null&&(x.insert!=null?typeof x.insert=="string"&&x.insert.endsWith(`
`):x.attributes!=null&&Object.keys(x.attributes).some(w=>L.query(w,v.Scope.BLOCK)!=null))}(A,N)&&(j-=1),j}(this.quill.scroll,f.delta);this.quill.setSelection(U,y.Ay.sources.USER)}}}function dt(g,f){let U=f;for(let A=g.length-1;A>=0;A-=1){const N=g[A];g[A]={delta:U.transform(N.delta,!0),range:N.range&&Q(N.range,U)},U=N.delta.transform(U),g[A].delta.length()===0&&g.splice(A,1)}}function Q(g,f){if(!g)return g;const U=f.transformPosition(g.index);return{index:U,length:f.transformPosition(g.index+g.length)-U}}var at=u(8123);class yt extends O.A{constructor(f,U){super(f,U),f.root.addEventListener("drop",A=>{A.preventDefault();let N=null;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(A.clientX,A.clientY);else if(document.caretPositionFromPoint){const j=document.caretPositionFromPoint(A.clientX,A.clientY);N=document.createRange(),N.setStart(j.offsetNode,j.offset),N.setEnd(j.offsetNode,j.offset)}const z=N&&f.selection.normalizeNative(N);if(z){const j=f.selection.normalizedToRange(z);A.dataTransfer?.files&&this.upload(j,A.dataTransfer.files)}})}upload(f,U){const A=[];Array.from(U).forEach(N=>{N&&this.options.mimetypes?.includes(N.type)&&A.push(N)}),A.length>0&&this.options.handler.call(this,f,A)}}yt.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(g,f){if(!this.quill.scroll.query("image"))return;const U=f.map(A=>new Promise(N=>{const z=new FileReader;z.onload=()=>{N(z.result)},z.readAsDataURL(A)}));Promise.all(U).then(A=>{const N=A.reduce((z,j)=>z.insert({image:j}),new(K())().retain(g.index).delete(g.length));this.quill.updateContents(N,k.A.sources.USER),this.quill.setSelection(g.index+A.length,k.A.sources.SILENT)})}};var Et=yt;const Pt=["insertText","insertReplacementText"];class Ft extends O.A{constructor(f,U){super(f,U),f.root.addEventListener("beforeinput",A=>{this.handleBeforeInput(A)}),/Android/i.test(navigator.userAgent)||f.on(y.Ay.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(f){(0,at.Xo)({range:f,quill:this.quill})}replaceText(f){let U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(f.length===0)return!1;if(U){const A=this.quill.getFormat(f.index,1);this.deleteRange(f),this.quill.updateContents(new(K())().retain(f.index).insert(U,A),y.Ay.sources.USER)}else this.deleteRange(f);return this.quill.setSelection(f.index+U.length,0,y.Ay.sources.SILENT),!0}handleBeforeInput(f){if(this.quill.composition.isComposing||f.defaultPrevented||!Pt.includes(f.inputType))return;const U=f.getTargetRanges?f.getTargetRanges()[0]:null;if(!U||U.collapsed===!0)return;const A=function(j){return typeof j.data=="string"?j.data:j.dataTransfer?.types.includes("text/plain")?j.dataTransfer.getData("text/plain"):null}(f);if(A==null)return;const N=this.quill.selection.normalizeNative(U),z=N?this.quill.selection.normalizedToRange(N):null;z&&this.replaceText(z,A)&&f.preventDefault()}handleCompositionStart(){const f=this.quill.getSelection();f&&this.replaceText(f)}}var ct=Ft;const mt=/Mac/i.test(navigator.platform);class Nt extends O.A{isListening=!1;selectionChangeDeadline=0;constructor(f,U){super(f,U),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(f,U){let{line:A,event:N}=U;if(!(A instanceof v.ParentBlot&&A.uiNode))return!0;const z=getComputedStyle(A.domNode).direction==="rtl";return!!(z&&N.key!=="ArrowRight"||!z&&N.key!=="ArrowLeft")||(this.quill.setSelection(f.index-1,f.length+(N.shiftKey?1:0),y.Ay.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",f=>{!f.defaultPrevented&&(U=>U.key==="ArrowLeft"||U.key==="ArrowRight"||U.key==="ArrowUp"||U.key==="ArrowDown"||U.key==="Home"||!(!mt||U.key!=="a"||U.ctrlKey!==!0))(f)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+100,this.isListening||(this.isListening=!0,document.addEventListener("selectionchange",()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()},{once:!0}))}handleSelectionChange(){const f=document.getSelection();if(!f)return;const U=f.getRangeAt(0);if(U.collapsed!==!0||U.startOffset!==0)return;const A=this.quill.scroll.find(U.startContainer);if(!(A instanceof v.ParentBlot&&A.uiNode))return;const N=document.createRange();N.setStartAfter(A.uiNode),N.setEndAfter(A.uiNode),f.removeAllRanges(),f.addRange(N)}}var M=Nt;y.Ay.register({"blots/block":q.Ay,"blots/block/embed":q.zo,"blots/break":$.A,"blots/container":T.A,"blots/cursor":H.A,"blots/embed":_.A,"blots/inline":F.A,"blots/scroll":vt,"blots/text":kt.A,"modules/clipboard":pt.Ay,"modules/history":X,"modules/keyboard":at.Ay,"modules/uploader":Et,"modules/input":ct,"modules/uiNode":M});var d=y.Ay},5374:function(nt,W,u){"use strict";u.d(W,{A:function(){return T}});var y=u(8920),q=u(7356);const $=(0,u(6078).A)("quill:events");["selectionchange","mousedown","mouseup","click"].forEach(H=>{document.addEventListener(H,function(){for(var _=arguments.length,F=new Array(_),v=0;v<_;v++)F[v]=arguments[v];Array.from(document.querySelectorAll(".ql-container")).forEach(V=>{const K=q.A.get(V);K&&K.emitter&&K.emitter.handleDOM(...F)})})});var T=class extends y{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",$.error)}emit(){for(var H=arguments.length,_=new Array(H),F=0;F<H;F++)_[F]=arguments[F];return $.log.call($,..._),super.emit(..._)}handleDOM(H){for(var _=arguments.length,F=new Array(_>1?_-1:0),v=1;v<_;v++)F[v-1]=arguments[v];(this.domListeners[H.type]||[]).forEach(V=>{let{node:K,handler:k}=V;(H.target===K||K.contains(H.target))&&k(H,...F)})}listenDOM(H,_,F){this.domListeners[H]||(this.domListeners[H]=[]),this.domListeners[H].push({node:_,handler:F})}}},7356:function(nt,W){"use strict";W.A=new WeakMap},6078:function(nt,W){"use strict";const u=["error","warn","log","info"];let y="warn";function q(T){if(y&&u.indexOf(T)<=u.indexOf(y)){for(var H=arguments.length,_=new Array(H>1?H-1:0),F=1;F<H;F++)_[F-1]=arguments[F];console[T](..._)}}function $(T){return u.reduce((H,_)=>(H[_]=q.bind(console,_,T),H),{})}$.level=T=>{y=T},q.level=$.level,W.A=$},4266:function(nt,W){"use strict";W.A=class{static DEFAULTS={};constructor(u){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=u,this.options=y}}},6142:function(nt,W,u){"use strict";u.d(W,{Ay:function(){return g}});var y=u(8347),q=u(6003),$=u(5232),T=u.n($),H=u(3707),_=u(5123),F=u(9698),v=u(3036),V=u(4541),K=u(5508),k=u(8298);const R=/^[ -~]*$/;function Y(L,p,x){if(L.length===0){const[zt]=vt(x.pop());return p<=0?`</li></${zt}>`:`</li></${zt}>${Y([],p-1,x)}`}const[{child:w,offset:I,length:B,indent:J,type:ot},...ft]=L,[gt,_t]=vt(ot);if(J>p)return x.push(ot),J===p+1?`<${gt}><li${_t}>${G(w,I,B)}${Y(ft,J,x)}`:`<${gt}><li>${Y(L,p+1,x)}`;const At=x[x.length-1];if(J===p&&ot===At)return`</li><li${_t}>${G(w,I,B)}${Y(ft,J,x)}`;const[Ot]=vt(x.pop());return`</li></${Ot}>${Y(L,p-1,x)}`}function G(L,p,x){let w=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if("html"in L&&typeof L.html=="function")return L.html(p,x);if(L instanceof K.A)return(0,K.X)(L.value().slice(p,p+x));if(L instanceof q.ParentBlot){if(L.statics.blotName==="list-container"){const gt=[];return L.children.forEachAt(p,x,(_t,At,Ot)=>{const zt="formats"in _t&&typeof _t.formats=="function"?_t.formats():{};gt.push({child:_t,offset:At,length:Ot,indent:zt.indent||0,type:zt.list})}),Y(gt,-1,[])}const I=[];if(L.children.forEachAt(p,x,(gt,_t,At)=>{I.push(G(gt,_t,At))}),w||L.statics.blotName==="list")return I.join("");const{outerHTML:B,innerHTML:J}=L.domNode,[ot,ft]=B.split(`>${J}<`);return ot==="<table"?`<table style="border: 1px solid #000;">${I.join("")}<${ft}`:`${ot}>${I.join("")}<${ft}`}return L.domNode instanceof Element?L.domNode.outerHTML:""}function rt(L,p){return Object.keys(p).reduce((x,w)=>{if(L[w]==null)return x;const I=p[w];return I===L[w]?x[w]=I:Array.isArray(I)?I.indexOf(L[w])<0?x[w]=I.concat([L[w]]):x[w]=I:x[w]=[I,L[w]],x},{})}function vt(L){const p=L==="ordered"?"ol":"ul";switch(L){case"checked":return[p,' data-list="checked"'];case"unchecked":return[p,' data-list="unchecked"'];default:return[p,""]}}function kt(L){return L.reduce((p,x)=>{if(typeof x.insert=="string"){const w=x.insert.replace(/\r\n/g,`
`).replace(/\r/g,`
`);return p.insert(w,x.attributes)}return p.push(x)},new(T()))}function pt(L,p){let{index:x,length:w}=L;return new k.Q(x+p,w)}var O=class{constructor(L){this.scroll=L,this.delta=this.getDelta()}applyDelta(L){this.scroll.update();let p=this.scroll.length();this.scroll.batchStart();const x=kt(L),w=new(T());return function(I){const B=[];return I.forEach(J=>{typeof J.insert=="string"?J.insert.split(`
`).forEach((ot,ft)=>{ft&&B.push({insert:`
`,attributes:J.attributes}),ot&&B.push({insert:ot,attributes:J.attributes})}):B.push(J)}),B}(x.ops.slice()).reduce((I,B)=>{const J=$.Op.length(B);let ot=B.attributes||{},ft=!1,gt=!1;if(B.insert!=null){if(w.retain(J),typeof B.insert=="string"){const Ot=B.insert;gt=!Ot.endsWith(`
`)&&(p<=I||!!this.scroll.descendant(F.zo,I)[0]),this.scroll.insertAt(I,Ot);const[zt,Rt]=this.scroll.line(I);let jt=(0,y.A)({},(0,F.Ji)(zt));if(zt instanceof F.Ay){const[Gt]=zt.descendant(q.LeafBlot,Rt);Gt&&(jt=(0,y.A)(jt,(0,F.Ji)(Gt)))}ot=$.AttributeMap.diff(jt,ot)||{}}else if(typeof B.insert=="object"){const Ot=Object.keys(B.insert)[0];if(Ot==null)return I;const zt=this.scroll.query(Ot,q.Scope.INLINE)!=null;if(zt)(p<=I||this.scroll.descendant(F.zo,I)[0])&&(gt=!0);else if(I>0){const[Rt,jt]=this.scroll.descendant(q.LeafBlot,I-1);Rt instanceof K.A?Rt.value()[jt]!==`
`&&(ft=!0):Rt instanceof q.EmbedBlot&&Rt.statics.scope===q.Scope.INLINE_BLOT&&(ft=!0)}if(this.scroll.insertAt(I,Ot,B.insert[Ot]),zt){const[Rt]=this.scroll.descendant(q.LeafBlot,I);if(Rt){const jt=(0,y.A)({},(0,F.Ji)(Rt));ot=$.AttributeMap.diff(jt,ot)||{}}}}p+=J}else if(w.push(B),B.retain!==null&&typeof B.retain=="object"){const Ot=Object.keys(B.retain)[0];if(Ot==null)return I;this.scroll.updateEmbedAt(I,Ot,B.retain[Ot])}Object.keys(ot).forEach(Ot=>{this.scroll.formatAt(I,J,Ot,ot[Ot])});const _t=ft?1:0,At=gt?1:0;return p+=_t+At,w.retain(_t),w.delete(At),I+J+_t+At},0),w.reduce((I,B)=>typeof B.delete=="number"?(this.scroll.deleteAt(I,B.delete),I):I+$.Op.length(B),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(x)}deleteText(L,p){return this.scroll.deleteAt(L,p),this.update(new(T())().retain(L).delete(p))}formatLine(L,p){let x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(x).forEach(I=>{this.scroll.lines(L,Math.max(p,1)).forEach(B=>{B.format(I,x[I])})}),this.scroll.optimize();const w=new(T())().retain(L).retain(p,(0,H.A)(x));return this.update(w)}formatText(L,p){let x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(x).forEach(I=>{this.scroll.formatAt(L,p,I,x[I])});const w=new(T())().retain(L).retain(p,(0,H.A)(x));return this.update(w)}getContents(L,p){return this.delta.slice(L,L+p)}getDelta(){return this.scroll.lines().reduce((L,p)=>L.concat(p.delta()),new(T()))}getFormat(L){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,x=[],w=[];p===0?this.scroll.path(L).forEach(J=>{const[ot]=J;ot instanceof F.Ay?x.push(ot):ot instanceof q.LeafBlot&&w.push(ot)}):(x=this.scroll.lines(L,p),w=this.scroll.descendants(q.LeafBlot,L,p));const[I,B]=[x,w].map(J=>{const ot=J.shift();if(ot==null)return{};let ft=(0,F.Ji)(ot);for(;Object.keys(ft).length>0;){const gt=J.shift();if(gt==null)return ft;ft=rt((0,F.Ji)(gt),ft)}return ft});return{...I,...B}}getHTML(L,p){const[x,w]=this.scroll.line(L);if(x){const I=x.length();return x.length()>=w+p&&(w!==0||p!==I)?G(x,w,p,!0):G(this.scroll,L,p,!0)}return""}getText(L,p){return this.getContents(L,p).filter(x=>typeof x.insert=="string").map(x=>x.insert).join("")}insertContents(L,p){const x=kt(p),w=new(T())().retain(L).concat(x);return this.scroll.insertContents(L,x),this.update(w)}insertEmbed(L,p,x){return this.scroll.insertAt(L,p,x),this.update(new(T())().retain(L).insert({[p]:x}))}insertText(L,p){let x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return p=p.replace(/\r\n/g,`
`).replace(/\r/g,`
`),this.scroll.insertAt(L,p),Object.keys(x).forEach(w=>{this.scroll.formatAt(L,p.length,w,x[w])}),this.update(new(T())().retain(L).insert(p,(0,H.A)(x)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const L=this.scroll.children.head;if(L?.statics.blotName!==F.Ay.blotName)return!1;const p=L;return!(p.children.length>1)&&p.children.head instanceof v.A}removeFormat(L,p){const x=this.getText(L,p),[w,I]=this.scroll.line(L+p);let B=0,J=new(T());w!=null&&(B=w.length()-I,J=w.delta().slice(I,I+B-1).insert(`
`));const ot=this.getContents(L,p+B).diff(new(T())().insert(x).concat(J)),ft=new(T())().retain(L).concat(ot);return this.applyDelta(ft)}update(L){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const w=this.delta;if(p.length===1&&p[0].type==="characterData"&&p[0].target.data.match(R)&&this.scroll.find(p[0].target)){const I=this.scroll.find(p[0].target),B=(0,F.Ji)(I),J=I.offset(this.scroll),ot=p[0].oldValue.replace(V.A.CONTENTS,""),ft=new(T())().insert(ot),gt=new(T())().insert(I.value()),_t=x&&{oldRange:pt(x.oldRange,-J),newRange:pt(x.newRange,-J)};L=new(T())().retain(J).concat(ft.diff(gt,_t)).reduce((At,Ot)=>Ot.insert?At.insert(Ot.insert,B):At.push(Ot),new(T())),this.delta=w.compose(L)}else this.delta=this.getDelta(),L&&(0,_.A)(w.compose(L),this.delta)||(L=w.diff(this.delta,x));return L}},X=u(5374),dt=u(7356),Q=u(6078),at=u(4266),yt=u(746),Et=class{isComposing=!1;constructor(L,p){this.scroll=L,this.emitter=p,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",L=>{this.isComposing||this.handleCompositionStart(L)}),this.scroll.domNode.addEventListener("compositionend",L=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(L)})})}handleCompositionStart(L){const p=L.target instanceof Node?this.scroll.find(L.target,!0):null;!p||p instanceof yt.A||(this.emitter.emit(X.A.events.COMPOSITION_BEFORE_START,L),this.scroll.batchStart(),this.emitter.emit(X.A.events.COMPOSITION_START,L),this.isComposing=!0)}handleCompositionEnd(L){this.emitter.emit(X.A.events.COMPOSITION_BEFORE_END,L),this.scroll.batchEnd(),this.emitter.emit(X.A.events.COMPOSITION_END,L),this.isComposing=!1}},Pt=u(9609);const Ft=L=>{const p=L.getBoundingClientRect(),x="offsetWidth"in L&&Math.abs(p.width)/L.offsetWidth||1,w="offsetHeight"in L&&Math.abs(p.height)/L.offsetHeight||1;return{top:p.top,right:p.left+L.clientWidth*x,bottom:p.top+L.clientHeight*w,left:p.left}},ct=L=>{const p=parseInt(L,10);return Number.isNaN(p)?0:p},mt=(L,p,x,w,I,B)=>L<x&&p>w?0:L<x?-(x-L+I):p>w?p-L>w-x?L+I-x:p-w+B:0,Nt=["block","break","cursor","inline","scroll","text"],M=(0,Q.A)("quill"),d=new q.Registry;q.ParentBlot.uiClass="ql-ui";class g{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:d,theme:"default"};static events=X.A.events;static sources=X.A.sources;static version="2.0.2";static imports={delta:T(),parchment:q,"core/module":at.A,"core/theme":Pt.A};static debug(p){p===!0&&(p="log"),Q.A.level(p)}static find(p){let x=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return dt.A.get(p)||d.find(p,x)}static import(p){return this.imports[p]==null&&M.error(`Cannot import ${p}. Are you sure it was registered?`),this.imports[p]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const p=arguments.length<=0?void 0:arguments[0],x=!!(!(arguments.length<=1)&&arguments[1]),w="attrName"in p?p.attrName:p.blotName;typeof w=="string"?this.register(`formats/${w}`,p,x):Object.keys(p).forEach(I=>{this.register(I,p[I],x)})}else{const p=arguments.length<=0?void 0:arguments[0],x=arguments.length<=1?void 0:arguments[1],w=!!(!(arguments.length<=2)&&arguments[2]);this.imports[p]==null||w||M.warn(`Overwriting ${p} with`,x),this.imports[p]=x,(p.startsWith("blots/")||p.startsWith("formats/"))&&x&&typeof x!="boolean"&&x.blotName!=="abstract"&&d.register(x),typeof x.register=="function"&&x.register(d)}}constructor(p){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=function(J,ot){const ft=f(J);if(!ft)throw new Error("Invalid Quill container");const gt=!ot.theme||ot.theme===g.DEFAULTS.theme?Pt.A:g.import(`themes/${ot.theme}`);if(!gt)throw new Error(`Invalid theme ${ot.theme}. Did you register it?`);const{modules:_t,...At}=g.DEFAULTS,{modules:Ot,...zt}=gt.DEFAULTS;let Rt=U(ot.modules);Rt!=null&&Rt.toolbar&&Rt.toolbar.constructor!==Object&&(Rt={...Rt,toolbar:{container:Rt.toolbar}});const jt=(0,y.A)({},U(_t),U(Ot),Rt),Gt={...At,...A(zt),...A(ot)};let oe=ot.registry;return oe?ot.formats&&M.warn('Ignoring "formats" option because "registry" is specified'):oe=ot.formats?((ie,Tt,Ht)=>{const Xt=new q.Registry;return Nt.forEach(te=>{const Bt=Tt.query(te);Bt&&Xt.register(Bt)}),ie.forEach(te=>{let Bt=Tt.query(te);Bt||Ht.error(`Cannot register "${te}" specified in "formats" config. Are you sure it was registered?`);let ae=0;for(;Bt;)if(Xt.register(Bt),Bt="blotName"in Bt?Bt.requiredContainer??null:null,ae+=1,ae>100){Ht.error(`Cycle detected in registering blot requiredContainer: "${te}"`);break}}),Xt})(ot.formats,Gt.registry,M):Gt.registry,{...Gt,registry:oe,container:ft,theme:gt,modules:Object.entries(jt).reduce((ie,Tt)=>{let[Ht,Xt]=Tt;if(!Xt)return ie;const te=g.import(`modules/${Ht}`);return te==null?(M.error(`Cannot load ${Ht} module. Are you sure you registered it?`),ie):{...ie,[Ht]:(0,y.A)({},te.DEFAULTS||{},Xt)}},{}),bounds:f(Gt.bounds)}}(p,x),this.container=this.options.container,this.container==null)return void M.error("Invalid Quill container",p);this.options.debug&&g.debug(this.options.debug);const w=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",dt.A.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new X.A;const I=q.ScrollBlot.blotName,B=this.options.registry.query(I);if(!B||!("blotName"in B))throw new Error(`Cannot initialize Quill without "${I}" blot`);if(this.scroll=new B(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new O(this.scroll),this.selection=new k.A(this.scroll,this.emitter),this.composition=new Et(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(X.A.events.EDITOR_CHANGE,J=>{J===X.A.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(X.A.events.SCROLL_UPDATE,(J,ot)=>{const ft=this.selection.lastRange,[gt]=this.selection.getRange(),_t=ft&>?{oldRange:ft,newRange:gt}:void 0;N.call(this,()=>this.editor.update(null,ot,_t),J)}),this.emitter.on(X.A.events.SCROLL_EMBED_UPDATE,(J,ot)=>{const ft=this.selection.lastRange,[gt]=this.selection.getRange(),_t=ft&>?{oldRange:ft,newRange:gt}:void 0;N.call(this,()=>{const At=new(T())().retain(J.offset(this)).retain({[J.statics.blotName]:ot});return this.editor.update(At,[],_t)},g.sources.USER)}),w){const J=this.clipboard.convert({html:`${w}<p><br></p>`,text:`
`});this.setContents(J)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(p){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof p=="string"){const w=p;(p=document.createElement("div")).classList.add(w)}return this.container.insertBefore(p,x),p}blur(){this.selection.setRange(null)}deleteText(p,x,w){return[p,x,,w]=z(p,x,w),N.call(this,()=>this.editor.deleteText(p,x),w,p,-1*x)}disable(){this.enable(!1)}editReadOnly(p){this.allowReadOnlyEdits=!0;const x=p();return this.allowReadOnlyEdits=!1,x}enable(){let p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.scroll.enable(p),this.container.classList.toggle("ql-disabled",!p)}focus(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),p.preventScroll||this.scrollSelectionIntoView()}format(p,x){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:X.A.sources.API;return N.call(this,()=>{const I=this.getSelection(!0);let B=new(T());if(I==null)return B;if(this.scroll.query(p,q.Scope.BLOCK))B=this.editor.formatLine(I.index,I.length,{[p]:x});else{if(I.length===0)return this.selection.format(p,x),B;B=this.editor.formatText(I.index,I.length,{[p]:x})}return this.setSelection(I,X.A.sources.SILENT),B},w)}formatLine(p,x,w,I,B){let J;return[p,x,J,B]=z(p,x,w,I,B),N.call(this,()=>this.editor.formatLine(p,x,J),B,p,0)}formatText(p,x,w,I,B){let J;return[p,x,J,B]=z(p,x,w,I,B),N.call(this,()=>this.editor.formatText(p,x,J),B,p,0)}getBounds(p){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,w=null;if(w=typeof p=="number"?this.selection.getBounds(p,x):this.selection.getBounds(p.index,p.length),!w)return null;const I=this.container.getBoundingClientRect();return{bottom:w.bottom-I.top,height:w.height,left:w.left-I.left,right:w.right-I.left,top:w.top-I.top,width:w.width}}getContents(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-p;return[p,x]=z(p,x),this.editor.getContents(p,x)}getFormat(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof p=="number"?this.editor.getFormat(p,x):this.editor.getFormat(p.index,p.length)}getIndex(p){return p.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(p){return this.scroll.leaf(p)}getLine(p){return this.scroll.line(p)}getLines(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof p!="number"?this.scroll.lines(p.index,p.length):this.scroll.lines(p,x)}getModule(p){return this.theme.modules[p]}getSelection(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,x=arguments.length>1?arguments[1]:void 0;return typeof p=="number"&&(x=x??this.getLength()-p),[p,x]=z(p,x),this.editor.getHTML(p,x)}getText(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,x=arguments.length>1?arguments[1]:void 0;return typeof p=="number"&&(x=x??this.getLength()-p),[p,x]=z(p,x),this.editor.getText(p,x)}hasFocus(){return this.selection.hasFocus()}insertEmbed(p,x,w){let I=arguments.length>3&&arguments[3]!==void 0?arguments[3]:g.sources.API;return N.call(this,()=>this.editor.insertEmbed(p,x,w),I,p)}insertText(p,x,w,I,B){let J;return[p,,J,B]=z(p,0,w,I,B),N.call(this,()=>this.editor.insertText(p,x,J),B,p,x.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(p,x,w){return[p,x,,w]=z(p,x,w),N.call(this,()=>this.editor.removeFormat(p,x),w,p)}scrollRectIntoView(p){((x,w)=>{const I=x.ownerDocument;let B=w,J=x;for(;J;){const ft=J===I.body,gt=ft?{top:0,right:window.visualViewport?.width??I.documentElement.clientWidth,bottom:window.visualViewport?.height??I.documentElement.clientHeight,left:0}:Ft(J),_t=getComputedStyle(J),At=mt(B.left,B.right,gt.left,gt.right,ct(_t.scrollPaddingLeft),ct(_t.scrollPaddingRight)),Ot=mt(B.top,B.bottom,gt.top,gt.bottom,ct(_t.scrollPaddingTop),ct(_t.scrollPaddingBottom));if(At||Ot)if(ft)I.defaultView?.scrollBy(At,Ot);else{const{scrollLeft:zt,scrollTop:Rt}=J;Ot&&(J.scrollTop+=Ot),At&&(J.scrollLeft+=At);const jt=J.scrollLeft-zt,Gt=J.scrollTop-Rt;B={left:B.left-jt,top:B.top-Gt,right:B.right-jt,bottom:B.bottom-Gt}}J=ft||_t.position==="fixed"?null:(ot=J).parentElement||ot.getRootNode().host||null}var ot})(this.root,p)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const p=this.selection.lastRange,x=p&&this.selection.getBounds(p.index,p.length);x&&this.scrollRectIntoView(x)}setContents(p){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X.A.sources.API;return N.call(this,()=>{p=new(T())(p);const w=this.getLength(),I=this.editor.deleteText(0,w),B=this.editor.insertContents(0,p),J=this.editor.deleteText(this.getLength()-1,1);return I.compose(B).compose(J)},x)}setSelection(p,x,w){p==null?this.selection.setRange(null,x||g.sources.API):([p,x,,w]=z(p,x,w),this.selection.setRange(new k.Q(Math.max(0,p),x),w),w!==X.A.sources.SILENT&&this.scrollSelectionIntoView())}setText(p){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X.A.sources.API;const w=new(T())().insert(p);return this.setContents(w,x)}update(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:X.A.sources.USER;const x=this.scroll.update(p);return this.selection.update(p),x}updateContents(p){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X.A.sources.API;return N.call(this,()=>(p=new(T())(p),this.editor.applyDelta(p)),x,!0)}}function f(L){return typeof L=="string"?document.querySelector(L):L}function U(L){return Object.entries(L??{}).reduce((p,x)=>{let[w,I]=x;return{...p,[w]:I===!0?{}:I}},{})}function A(L){return Object.fromEntries(Object.entries(L).filter(p=>p[1]!==void 0))}function N(L,p,x,w){if(!this.isEnabled()&&p===X.A.sources.USER&&!this.allowReadOnlyEdits)return new(T());let I=x==null?null:this.getSelection();const B=this.editor.delta,J=L();if(I!=null&&(x===!0&&(x=I.index),w==null?I=j(I,J,p):w!==0&&(I=j(I,x,w,p)),this.setSelection(I,X.A.sources.SILENT)),J.length()>0){const ot=[X.A.events.TEXT_CHANGE,J,B,p];this.emitter.emit(X.A.events.EDITOR_CHANGE,...ot),p!==X.A.sources.SILENT&&this.emitter.emit(...ot)}return J}function z(L,p,x,w,I){let B={};return typeof L.index=="number"&&typeof L.length=="number"?typeof p!="number"?(I=w,w=x,x=p,p=L.length,L=L.index):(p=L.length,L=L.index):typeof p!="number"&&(I=w,w=x,x=p,p=0),typeof x=="object"?(B=x,I=w):typeof x=="string"&&(w!=null?B[x]=w:I=x),[L,p,B,I=I||X.A.sources.API]}function j(L,p,x,w){const I=typeof x=="number"?x:0;if(L==null)return null;let B,J;return p&&typeof p.transformPosition=="function"?[B,J]=[L.index,L.index+L.length].map(ot=>p.transformPosition(ot,w!==X.A.sources.USER)):[B,J]=[L.index,L.index+L.length].map(ot=>ot<p||ot===p&&w===X.A.sources.USER?ot:I>=0?ot+I:Math.max(p,ot+I)),new k.Q(B,J-B)}},8298:function(nt,W,u){"use strict";u.d(W,{Q:function(){return _}});var y=u(6003),q=u(5123),$=u(3707),T=u(5374);const H=(0,u(6078).A)("quill:selection");class _{constructor(V){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=V,this.length=K}}function F(v,V){try{V.parentNode}catch{return!1}return v.contains(V)}W.A=class{constructor(v,V){this.emitter=V,this.scroll=v,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new _(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{this.mouseDown||this.composing||setTimeout(this.update.bind(this,T.A.sources.USER),1)}),this.emitter.on(T.A.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const K=this.getNativeRange();K!=null&&K.start.node!==this.cursor.textNode&&this.emitter.once(T.A.events.SCROLL_UPDATE,(k,R)=>{try{this.root.contains(K.start.node)&&this.root.contains(K.end.node)&&this.setNativeRange(K.start.node,K.start.offset,K.end.node,K.end.offset);const Y=R.some(G=>G.type==="characterData"||G.type==="childList"||G.type==="attributes"&&G.target===this.root);this.update(Y?T.A.sources.SILENT:k)}catch{}})}),this.emitter.on(T.A.events.SCROLL_OPTIMIZE,(K,k)=>{if(k.range){const{startNode:R,startOffset:Y,endNode:G,endOffset:rt}=k.range;this.setNativeRange(R,Y,G,rt),this.update(T.A.sources.SILENT)}}),this.update(T.A.sources.SILENT)}handleComposition(){this.emitter.on(T.A.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(T.A.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const v=this.cursor.restore();if(!v)return;setTimeout(()=>{this.setNativeRange(v.startNode,v.startOffset,v.endNode,v.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(T.A.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(v,V){this.scroll.update();const K=this.getNativeRange();if(K!=null&&K.native.collapsed&&!this.scroll.query(v,y.Scope.BLOCK)){if(K.start.node!==this.cursor.textNode){const k=this.scroll.find(K.start.node,!1);if(k==null)return;if(k instanceof y.LeafBlot){const R=k.split(K.start.offset);k.parent.insertBefore(this.cursor,R)}else k.insertBefore(this.cursor,K.start.node);this.cursor.attach()}this.cursor.format(v,V),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(v){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const K=this.scroll.length();let k;v=Math.min(v,K-1),V=Math.min(v+V,K-1)-v;let[R,Y]=this.scroll.leaf(v);if(R==null)return null;if(V>0&&Y===R.length()){const[kt]=this.scroll.leaf(v+1);if(kt){const[pt]=this.scroll.line(v),[O]=this.scroll.line(v+1);pt===O&&(R=kt,Y=0)}}[k,Y]=R.position(Y,!0);const G=document.createRange();if(V>0)return G.setStart(k,Y),[R,Y]=this.scroll.leaf(v+V),R==null?null:([k,Y]=R.position(Y,!0),G.setEnd(k,Y),G.getBoundingClientRect());let rt,vt="left";if(k instanceof Text){if(!k.data.length)return null;Y<k.data.length?(G.setStart(k,Y),G.setEnd(k,Y+1)):(G.setStart(k,Y-1),G.setEnd(k,Y),vt="right"),rt=G.getBoundingClientRect()}else{if(!(R.domNode instanceof Element))return null;rt=R.domNode.getBoundingClientRect(),Y>0&&(vt="right")}return{bottom:rt.top+rt.height,height:rt.height,left:rt[vt],right:rt[vt],top:rt.top,width:0}}getNativeRange(){const v=document.getSelection();if(v==null||v.rangeCount<=0)return null;const V=v.getRangeAt(0);if(V==null)return null;const K=this.normalizeNative(V);return H.info("getNativeRange",K),K}getRange(){const v=this.scroll.domNode;if("isConnected"in v&&!v.isConnected)return[null,null];const V=this.getNativeRange();return V==null?[null,null]:[this.normalizedToRange(V),V]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&F(this.root,document.activeElement)}normalizedToRange(v){const V=[[v.start.node,v.start.offset]];v.native.collapsed||V.push([v.end.node,v.end.offset]);const K=V.map(Y=>{const[G,rt]=Y,vt=this.scroll.find(G,!0),kt=vt.offset(this.scroll);return rt===0?kt:vt instanceof y.LeafBlot?kt+vt.index(G,rt):kt+vt.length()}),k=Math.min(Math.max(...K),this.scroll.length()-1),R=Math.min(k,...K);return new _(R,k-R)}normalizeNative(v){if(!F(this.root,v.startContainer)||!v.collapsed&&!F(this.root,v.endContainer))return null;const V={start:{node:v.startContainer,offset:v.startOffset},end:{node:v.endContainer,offset:v.endOffset},native:v};return[V.start,V.end].forEach(K=>{let{node:k,offset:R}=K;for(;!(k instanceof Text)&&k.childNodes.length>0;)if(k.childNodes.length>R)k=k.childNodes[R],R=0;else{if(k.childNodes.length!==R)break;k=k.lastChild,R=k instanceof Text?k.data.length:k.childNodes.length>0?k.childNodes.length:k.childNodes.length+1}K.node=k,K.offset=R}),V}rangeToNative(v){const V=this.scroll.length(),K=(k,R)=>{k=Math.min(V-1,k);const[Y,G]=this.scroll.leaf(k);return Y?Y.position(G,R):[null,-1]};return[...K(v.index,!1),...K(v.index+v.length,!0)]}setNativeRange(v,V){let K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v,k=arguments.length>3&&arguments[3]!==void 0?arguments[3]:V,R=arguments.length>4&&arguments[4]!==void 0&&arguments[4];if(H.info("setNativeRange",v,V,K,k),v!=null&&(this.root.parentNode==null||v.parentNode==null||K.parentNode==null))return;const Y=document.getSelection();if(Y!=null)if(v!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:G}=this.getNativeRange()||{};if(G==null||R||v!==G.startContainer||V!==G.startOffset||K!==G.endContainer||k!==G.endOffset){v instanceof Element&&v.tagName==="BR"&&(V=Array.from(v.parentNode.childNodes).indexOf(v),v=v.parentNode),K instanceof Element&&K.tagName==="BR"&&(k=Array.from(K.parentNode.childNodes).indexOf(K),K=K.parentNode);const rt=document.createRange();rt.setStart(v,V),rt.setEnd(K,k),Y.removeAllRanges(),Y.addRange(rt)}}else Y.removeAllRanges(),this.root.blur()}setRange(v){let V=arguments.length>1&&arguments[1]!==void 0&&arguments[1],K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T.A.sources.API;if(typeof V=="string"&&(K=V,V=!1),H.info("setRange",v),v!=null){const k=this.rangeToNative(v);this.setNativeRange(...k,V)}else this.setNativeRange(null);this.update(K)}update(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T.A.sources.USER;const V=this.lastRange,[K,k]=this.getRange();if(this.lastRange=K,this.lastNative=k,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,q.A)(V,this.lastRange)){if(!this.composing&&k!=null&&k.native.collapsed&&k.start.node!==this.cursor.textNode){const Y=this.cursor.restore();Y&&this.setNativeRange(Y.startNode,Y.startOffset,Y.endNode,Y.endOffset)}const R=[T.A.events.SELECTION_CHANGE,(0,$.A)(this.lastRange),(0,$.A)(V),v];this.emitter.emit(T.A.events.EDITOR_CHANGE,...R),v!==T.A.sources.SILENT&&this.emitter.emit(...R)}}}},9609:function(nt,W){"use strict";class u{static DEFAULTS={modules:{}};static themes={default:u};modules={};constructor(q,$){this.quill=q,this.options=$}init(){Object.keys(this.options.modules).forEach(q=>{this.modules[q]==null&&this.addModule(q)})}addModule(q){const $=this.quill.constructor.import(`modules/${q}`);return this.modules[q]=new $(this.quill,this.options.modules[q]||{}),this.modules[q]}}W.A=u},8276:function(nt,W,u){"use strict";u.d(W,{Hu:function(){return H},gS:function(){return $},qh:function(){return T}});var y=u(6003);const q={scope:y.Scope.BLOCK,whitelist:["right","center","justify"]},$=new y.Attributor("align","align",q),T=new y.ClassAttributor("align","ql-align",q),H=new y.StyleAttributor("align","text-align",q)},9541:function(nt,W,u){"use strict";u.d(W,{l:function(){return $},s:function(){return T}});var y=u(6003),q=u(8638);const $=new y.ClassAttributor("background","ql-bg",{scope:y.Scope.INLINE}),T=new q.a2("background","background-color",{scope:y.Scope.INLINE})},9404:function(nt,W,u){"use strict";u.d(W,{Ay:function(){return V},Cy:function(){return K},EJ:function(){return v}});var y=u(9698),q=u(3036),$=u(4541),T=u(4850),H=u(5508),_=u(580),F=u(6142);class v extends _.A{static create(R){const Y=super.create(R);return Y.setAttribute("spellcheck","false"),Y}code(R,Y){return this.children.map(G=>G.length()<=1?"":G.domNode.innerText).join(`
`).slice(R,R+Y)}html(R,Y){return`<pre>
${(0,H.X)(this.code(R,Y))}
</pre>`}}class V extends y.Ay{static TAB=" ";static register(){F.Ay.register(v)}}class K extends T.A{}K.blotName="code",K.tagName="CODE",V.blotName="code-block",V.className="ql-code-block",V.tagName="DIV",v.blotName="code-block-container",v.className="ql-code-block-container",v.tagName="DIV",v.allowedChildren=[V],V.allowedChildren=[H.A,q.A,$.A],V.requiredContainer=v},8638:function(nt,W,u){"use strict";u.d(W,{JM:function(){return T},a2:function(){return q},g3:function(){return $}});var y=u(6003);class q extends y.StyleAttributor{value(_){let F=super.value(_);return F.startsWith("rgb(")?(F=F.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${F.split(",").map(v=>`00${parseInt(v,10).toString(16)}`.slice(-2)).join("")}`):F}}const $=new y.ClassAttributor("color","ql-color",{scope:y.Scope.INLINE}),T=new q("color","color",{scope:y.Scope.INLINE})},7912:function(nt,W,u){"use strict";u.d(W,{Mc:function(){return $},VL:function(){return H},sY:function(){return T}});var y=u(6003);const q={scope:y.Scope.BLOCK,whitelist:["rtl"]},$=new y.Attributor("direction","dir",q),T=new y.ClassAttributor("direction","ql-direction",q),H=new y.StyleAttributor("direction","direction",q)},6772:function(nt,W,u){"use strict";u.d(W,{q:function(){return $},z:function(){return H}});var y=u(6003);const q={scope:y.Scope.INLINE,whitelist:["serif","monospace"]},$=new y.ClassAttributor("font","ql-font",q);class T extends y.StyleAttributor{value(F){return super.value(F).replace(/["']/g,"")}}const H=new T("font","font-family",q)},664:function(nt,W,u){"use strict";u.d(W,{U:function(){return q},r:function(){return $}});var y=u(6003);const q=new y.ClassAttributor("size","ql-size",{scope:y.Scope.INLINE,whitelist:["small","large","huge"]}),$=new y.StyleAttributor("size","font-size",{scope:y.Scope.INLINE,whitelist:["10px","18px","32px"]})},584:function(nt,W,u){"use strict";u.d(W,{Ay:function(){return Ft},hV:function(){return g}});var y=u(6003),q=u(5232),$=u.n(q),T=u(9698),H=u(6078),_=u(4266),F=u(6142),v=u(8276),V=u(9541),K=u(9404),k=u(8638),R=u(7912),Y=u(6772),G=u(664),rt=u(8123);const vt=/font-weight:\s*normal/,kt=["P","OL","UL"],pt=A=>A&&kt.includes(A.tagName),O=/\bmso-list:[^;]*ignore/i,X=/\bmso-list:[^;]*\bl(\d+)/i,dt=/\bmso-list:[^;]*\blevel(\d+)/i,Q=[function(A){A.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&(N=>{const z=Array.from(N.querySelectorAll("[style*=mso-list]")),j=[],L=[];z.forEach(w=>{(w.getAttribute("style")||"").match(O)?j.push(w):L.push(w)}),j.forEach(w=>w.parentNode?.removeChild(w));const p=N.documentElement.innerHTML,x=L.map(w=>((I,B)=>{const J=I.getAttribute("style"),ot=J?.match(X);if(!ot)return null;const ft=Number(ot[1]),gt=J?.match(dt),_t=gt?Number(gt[1]):1,At=new RegExp(`@list l${ft}:level${_t}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),Ot=B.match(At);return{id:ft,indent:_t,type:Ot&&Ot[1]==="bullet"?"bullet":"ordered",element:I}})(w,p)).filter(w=>w);for(;x.length;){const w=[];let I=x.shift();for(;I;)w.push(I),I=x.length&&x[0]?.element===I.element.nextElementSibling&&x[0].id===I.id?x.shift():null;const B=document.createElement("ul");w.forEach(ft=>{const gt=document.createElement("li");gt.setAttribute("data-list",ft.type),ft.indent>1&>.setAttribute("class","ql-indent-"+(ft.indent-1)),gt.innerHTML=ft.element.innerHTML,B.appendChild(gt)});const J=w[0]?.element,{parentNode:ot}=J??{};J&&ot?.replaceChild(B,J),w.slice(1).forEach(ft=>{let{element:gt}=ft;ot?.removeChild(gt)})}})(A)},function(A){A.querySelector('[id^="docs-internal-guid-"]')&&((N=>{Array.from(N.querySelectorAll('b[style*="font-weight"]')).filter(z=>z.getAttribute("style")?.match(vt)).forEach(z=>{const j=N.createDocumentFragment();j.append(...z.childNodes),z.parentNode?.replaceChild(j,z)})})(A),(N=>{Array.from(N.querySelectorAll("br")).filter(z=>pt(z.previousElementSibling)&&pt(z.nextElementSibling)).forEach(z=>{z.parentNode?.removeChild(z)})})(A))}],at=(0,H.A)("quill:clipboard"),yt=[[Node.TEXT_NODE,function(A,N,z){let j=A.data;if(A.parentElement?.tagName==="O:P")return N.insert(j.trim());if(!d(A)){if(j.trim().length===0&&j.includes(`
`)&&!function(p,x){return p.previousElementSibling&&p.nextElementSibling&&!Nt(p.previousElementSibling,x)&&!Nt(p.nextElementSibling,x)}(A,z))return N;const L=(p,x)=>{const w=x.replace(/[^\u00a0]/g,"");return w.length<1&&p?" ":w};j=j.replace(/\r\n/g," ").replace(/\n/g," "),j=j.replace(/\s\s+/g,L.bind(L,!0)),(A.previousSibling==null&&A.parentElement!=null&&Nt(A.parentElement,z)||A.previousSibling instanceof Element&&Nt(A.previousSibling,z))&&(j=j.replace(/^\s+/,L.bind(L,!1))),(A.nextSibling==null&&A.parentElement!=null&&Nt(A.parentElement,z)||A.nextSibling instanceof Element&&Nt(A.nextSibling,z))&&(j=j.replace(/\s+$/,L.bind(L,!1)))}return N.insert(j)}],[Node.TEXT_NODE,U],["br",function(A,N){return mt(N,`
`)||N.insert(`
`),N}],[Node.ELEMENT_NODE,U],[Node.ELEMENT_NODE,function(A,N,z){const j=z.query(A);if(j==null)return N;if(j.prototype instanceof y.EmbedBlot){const L={},p=j.value(A);if(p!=null)return L[j.blotName]=p,new($())().insert(L,j.formats(A,z))}else if(j.prototype instanceof y.BlockBlot&&!mt(N,`
`)&&N.insert(`
`),"blotName"in j&&"formats"in j&&typeof j.formats=="function")return ct(N,j.blotName,j.formats(A,z),z);return N}],[Node.ELEMENT_NODE,function(A,N,z){const j=y.Attributor.keys(A),L=y.ClassAttributor.keys(A),p=y.StyleAttributor.keys(A),x={};return j.concat(L).concat(p).forEach(w=>{let I=z.query(w,y.Scope.ATTRIBUTE);I!=null&&(x[I.attrName]=I.value(A),x[I.attrName])||(I=Et[w],I==null||I.attrName!==w&&I.keyName!==w||(x[I.attrName]=I.value(A)||void 0),I=Pt[w],I==null||I.attrName!==w&&I.keyName!==w||(I=Pt[w],x[I.attrName]=I.value(A)||void 0))}),Object.entries(x).reduce((w,I)=>{let[B,J]=I;return ct(w,B,J,z)},N)}],[Node.ELEMENT_NODE,function(A,N,z){const j={},L=A.style||{};return L.fontStyle==="italic"&&(j.italic=!0),L.textDecoration==="underline"&&(j.underline=!0),L.textDecoration==="line-through"&&(j.strike=!0),(L.fontWeight?.startsWith("bold")||parseInt(L.fontWeight,10)>=700)&&(j.bold=!0),N=Object.entries(j).reduce((p,x)=>{let[w,I]=x;return ct(p,w,I,z)},N),parseFloat(L.textIndent||0)>0?new($())().insert(" ").concat(N):N}],["li",function(A,N,z){const j=z.query(A);if(j==null||j.blotName!=="list"||!mt(N,`
`))return N;let L=-1,p=A.parentNode;for(;p!=null;)["OL","UL"].includes(p.tagName)&&(L+=1),p=p.parentNode;return L<=0?N:N.reduce((x,w)=>w.insert?w.attributes&&typeof w.attributes.indent=="number"?x.push(w):x.insert(w.insert,{indent:L,...w.attributes||{}}):x,new($()))}],["ol, ul",function(A,N,z){const j=A;let L=j.tagName==="OL"?"ordered":"bullet";const p=j.getAttribute("data-checked");return p&&(L=p==="true"?"checked":"unchecked"),ct(N,"list",L,z)}],["pre",function(A,N,z){const j=z.query("code-block");return ct(N,"code-block",!j||!("formats"in j)||typeof j.formats!="function"||j.formats(A,z),z)}],["tr",function(A,N,z){const j=A.parentElement?.tagName==="TABLE"?A.parentElement:A.parentElement?.parentElement;return j!=null?ct(N,"table",Array.from(j.querySelectorAll("tr")).indexOf(A)+1,z):N}],["b",f("bold")],["i",f("italic")],["strike",f("strike")],["style",function(){return new($())}]],Et=[v.gS,R.Mc].reduce((A,N)=>(A[N.keyName]=N,A),{}),Pt=[v.Hu,V.s,k.JM,R.VL,Y.z,G.r].reduce((A,N)=>(A[N.keyName]=N,A),{});class Ft extends _.A{static DEFAULTS={matchers:[]};constructor(N,z){super(N,z),this.quill.root.addEventListener("copy",j=>this.onCaptureCopy(j,!1)),this.quill.root.addEventListener("cut",j=>this.onCaptureCopy(j,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],yt.concat(this.options.matchers??[]).forEach(j=>{let[L,p]=j;this.addMatcher(L,p)})}addMatcher(N,z){this.matchers.push([N,z])}convert(N){let{html:z,text:j}=N,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(L[K.Ay.blotName])return new($())().insert(j||"",{[K.Ay.blotName]:L[K.Ay.blotName]});if(!z)return new($())().insert(j||"",L);const p=this.convertHTML(z);return mt(p,`
`)&&(p.ops[p.ops.length-1].attributes==null||L.table)?p.compose(new($())().retain(p.length()-1).delete(1)):p}normalizeHTML(N){(z=>{z.documentElement&&Q.forEach(j=>{j(z)})})(N)}convertHTML(N){const z=new DOMParser().parseFromString(N,"text/html");this.normalizeHTML(z);const j=z.body,L=new WeakMap,[p,x]=this.prepareMatching(j,L);return g(this.quill.scroll,j,p,x,L)}dangerouslyPasteHTML(N,z){let j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:F.Ay.sources.API;if(typeof N=="string"){const L=this.convert({html:N,text:""});this.quill.setContents(L,z),this.quill.setSelection(0,F.Ay.sources.SILENT)}else{const L=this.convert({html:z,text:""});this.quill.updateContents(new($())().retain(N).concat(L),j),this.quill.setSelection(N+L.length(),F.Ay.sources.SILENT)}}onCaptureCopy(N){let z=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(N.defaultPrevented)return;N.preventDefault();const[j]=this.quill.selection.getRange();if(j==null)return;const{html:L,text:p}=this.onCopy(j,z);N.clipboardData?.setData("text/plain",p),N.clipboardData?.setData("text/html",L),z&&(0,rt.Xo)({range:j,quill:this.quill})}normalizeURIList(N){return N.split(/\r?\n/).filter(z=>z[0]!=="#").join(`
`)}onCapturePaste(N){if(N.defaultPrevented||!this.quill.isEnabled())return;N.preventDefault();const z=this.quill.getSelection(!0);if(z==null)return;const j=N.clipboardData?.getData("text/html");let L=N.clipboardData?.getData("text/plain");if(!j&&!L){const x=N.clipboardData?.getData("text/uri-list");x&&(L=this.normalizeURIList(x))}const p=Array.from(N.clipboardData?.files||[]);if(!j&&p.length>0)this.quill.uploader.upload(z,p);else{if(j&&p.length>0){const x=new DOMParser().parseFromString(j,"text/html");if(x.body.childElementCount===1&&x.body.firstElementChild?.tagName==="IMG")return void this.quill.uploader.upload(z,p)}this.onPaste(z,{html:j,text:L})}}onCopy(N){const z=this.quill.getText(N);return{html:this.quill.getSemanticHTML(N),text:z}}onPaste(N,z){let{text:j,html:L}=z;const p=this.quill.getFormat(N.index),x=this.convert({text:j,html:L},p);at.log("onPaste",x,{text:j,html:L});const w=new($())().retain(N.index).delete(N.length).concat(x);this.quill.updateContents(w,F.Ay.sources.USER),this.quill.setSelection(w.length()-N.length,F.Ay.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(N,z){const j=[],L=[];return this.matchers.forEach(p=>{const[x,w]=p;switch(x){case Node.TEXT_NODE:L.push(w);break;case Node.ELEMENT_NODE:j.push(w);break;default:Array.from(N.querySelectorAll(x)).forEach(I=>{z.has(I)?z.get(I)?.push(w):z.set(I,[w])})}}),[j,L]}}function ct(A,N,z,j){return j.query(N)?A.reduce((L,p)=>{if(!p.insert)return L;if(p.attributes&&p.attributes[N])return L.push(p);const x=z?{[N]:z}:{};return L.insert(p.insert,{...x,...p.attributes})},new($())):A}function mt(A,N){let z="";for(let j=A.ops.length-1;j>=0&&z.length<N.length;--j){const L=A.ops[j];if(typeof L.insert!="string")break;z=L.insert+z}return z.slice(-1*N.length)===N}function Nt(A,N){if(!(A instanceof Element))return!1;const z=N.query(A);return!(z&&z.prototype instanceof y.EmbedBlot)&&["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(A.tagName.toLowerCase())}const M=new WeakMap;function d(A){return A!=null&&(M.has(A)||(A.tagName==="PRE"?M.set(A,!0):M.set(A,d(A.parentNode))),M.get(A))}function g(A,N,z,j,L){return N.nodeType===N.TEXT_NODE?j.reduce((p,x)=>x(N,p,A),new($())):N.nodeType===N.ELEMENT_NODE?Array.from(N.childNodes||[]).reduce((p,x)=>{let w=g(A,x,z,j,L);return x.nodeType===N.ELEMENT_NODE&&(w=z.reduce((I,B)=>B(x,I,A),w),w=(L.get(x)||[]).reduce((I,B)=>B(x,I,A),w)),p.concat(w)},new($())):new($())}function f(A){return(N,z,j)=>ct(z,A,!0,j)}function U(A,N,z){if(!mt(N,`
`)){if(Nt(A,z)&&(A.childNodes.length>0||A instanceof HTMLParagraphElement))return N.insert(`
`);if(N.length()>0&&A.nextSibling){let j=A.nextSibling;for(;j!=null;){if(Nt(j,z))return N.insert(`
`);const L=z.query(j);if(L&&L.prototype instanceof T.zo)return N.insert(`
`);j=j.firstChild}}}return N}},8123:function(nt,W,u){"use strict";u.d(W,{Ay:function(){return k},Xo:function(){return kt}});var y=u(5123),q=u(3707),$=u(5232),T=u.n($),H=u(6003),_=u(6142),F=u(6078),v=u(4266);const V=(0,F.A)("quill:keyboard"),K=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class k extends v.A{static match(O,X){return!["altKey","ctrlKey","metaKey","shiftKey"].some(dt=>!!X[dt]!==O[dt]&&X[dt]!==null)&&(X.key===O.key||X.key===O.which)}constructor(O,X){super(O,X),this.bindings={},Object.keys(this.options.bindings).forEach(dt=>{this.options.bindings[dt]&&this.addBinding(this.options.bindings[dt])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(O){let X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},dt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const Q=function(at){if(typeof at=="string"||typeof at=="number")at={key:at};else{if(typeof at!="object")return null;at=(0,q.A)(at)}return at.shortKey&&(at[K]=at.shortKey,delete at.shortKey),at}(O);Q!=null?(typeof X=="function"&&(X={handler:X}),typeof dt=="function"&&(dt={handler:dt}),(Array.isArray(Q.key)?Q.key:[Q.key]).forEach(at=>{const yt={...Q,key:at,...X,...dt};this.bindings[yt.key]=this.bindings[yt.key]||[],this.bindings[yt.key].push(yt)})):V.warn("Attempted to add invalid keyboard binding",Q)}listen(){this.quill.root.addEventListener("keydown",O=>{if(O.defaultPrevented||O.isComposing||O.keyCode===229&&(O.key==="Enter"||O.key==="Backspace"))return;const X=(this.bindings[O.key]||[]).concat(this.bindings[O.which]||[]).filter(d=>k.match(O,d));if(X.length===0)return;const dt=_.Ay.find(O.target,!0);if(dt&&dt.scroll!==this.quill.scroll)return;const Q=this.quill.getSelection();if(Q==null||!this.quill.hasFocus())return;const[at,yt]=this.quill.getLine(Q.index),[Et,Pt]=this.quill.getLeaf(Q.index),[Ft,ct]=Q.length===0?[Et,Pt]:this.quill.getLeaf(Q.index+Q.length),mt=Et instanceof H.TextBlot?Et.value().slice(0,Pt):"",Nt=Ft instanceof H.TextBlot?Ft.value().slice(ct):"",M={collapsed:Q.length===0,empty:Q.length===0&&at.length()<=1,format:this.quill.getFormat(Q),line:at,offset:yt,prefix:mt,suffix:Nt,event:O};X.some(d=>{if(d.collapsed!=null&&d.collapsed!==M.collapsed||d.empty!=null&&d.empty!==M.empty||d.offset!=null&&d.offset!==M.offset)return!1;if(Array.isArray(d.format)){if(d.format.every(g=>M.format[g]==null))return!1}else if(typeof d.format=="object"&&!Object.keys(d.format).every(g=>d.format[g]===!0?M.format[g]!=null:d.format[g]===!1?M.format[g]==null:(0,y.A)(d.format[g],M.format[g])))return!1;return!(d.prefix!=null&&!d.prefix.test(M.prefix)||d.suffix!=null&&!d.suffix.test(M.suffix)||d.handler.call(this,Q,M,d)===!0)})&&O.preventDefault()})}handleBackspace(O,X){const dt=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(X.prefix)?2:1;if(O.index===0||this.quill.getLength()<=1)return;let Q={};const[at]=this.quill.getLine(O.index);let yt=new(T())().retain(O.index-dt).delete(dt);if(X.offset===0){const[Et]=this.quill.getLine(O.index-1);if(Et&&!(Et.statics.blotName==="block"&&Et.length()<=1)){const Pt=at.formats(),Ft=this.quill.getFormat(O.index-1,1);if(Q=$.AttributeMap.diff(Pt,Ft)||{},Object.keys(Q).length>0){const ct=new(T())().retain(O.index+at.length()-2).retain(1,Q);yt=yt.compose(ct)}}}this.quill.updateContents(yt,_.Ay.sources.USER),this.quill.focus()}handleDelete(O,X){const dt=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(X.suffix)?2:1;if(O.index>=this.quill.getLength()-dt)return;let Q={};const[at]=this.quill.getLine(O.index);let yt=new(T())().retain(O.index).delete(dt);if(X.offset>=at.length()-1){const[Et]=this.quill.getLine(O.index+1);if(Et){const Pt=at.formats(),Ft=this.quill.getFormat(O.index,1);Q=$.AttributeMap.diff(Pt,Ft)||{},Object.keys(Q).length>0&&(yt=yt.retain(Et.length()-1).retain(1,Q))}}this.quill.updateContents(yt,_.Ay.sources.USER),this.quill.focus()}handleDeleteRange(O){kt({range:O,quill:this.quill}),this.quill.focus()}handleEnter(O,X){const dt=Object.keys(X.format).reduce((at,yt)=>(this.quill.scroll.query(yt,H.Scope.BLOCK)&&!Array.isArray(X.format[yt])&&(at[yt]=X.format[yt]),at),{}),Q=new(T())().retain(O.index).delete(O.length).insert(`
`,dt);this.quill.updateContents(Q,_.Ay.sources.USER),this.quill.setSelection(O.index+1,_.Ay.sources.SILENT),this.quill.focus()}}const R={bindings:{bold:rt("bold"),italic:rt("italic"),underline:rt("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(pt,O){return!(!O.collapsed||O.offset===0)||(this.quill.format("indent","+1",_.Ay.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(pt,O){return!(!O.collapsed||O.offset===0)||(this.quill.format("indent","-1",_.Ay.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(pt,O){O.format.indent!=null?this.quill.format("indent","-1",_.Ay.sources.USER):O.format.list!=null&&this.quill.format("list",!1,_.Ay.sources.USER)}},"indent code-block":Y(!0),"outdent code-block":Y(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(pt){this.quill.deleteText(pt.index-1,1,_.Ay.sources.USER)}},tab:{key:"Tab",handler(pt,O){if(O.format.table)return!0;this.quill.history.cutoff();const X=new(T())().retain(pt.index).delete(pt.length).insert(" ");return this.quill.updateContents(X,_.Ay.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(pt.index+1,_.Ay.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,_.Ay.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(pt,O){const X={list:!1};O.format.indent&&(X.indent=!1),this.quill.formatLine(pt.index,pt.length,X,_.Ay.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(pt){const[O,X]=this.quill.getLine(pt.index),dt={...O.formats(),list:"checked"},Q=new(T())().retain(pt.index).insert(`
`,dt).retain(O.length()-X-1).retain(1,{list:"unchecked"});this.quill.updateContents(Q,_.Ay.sources.USER),this.quill.setSelection(pt.index+1,_.Ay.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(pt,O){const[X,dt]=this.quill.getLine(pt.index),Q=new(T())().retain(pt.index).insert(`
`,O.format).retain(X.length()-dt-1).retain(1,{header:null});this.quill.updateContents(Q,_.Ay.sources.USER),this.quill.setSelection(pt.index+1,_.Ay.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(pt){const O=this.quill.getModule("table");if(O){const[X,dt,Q,at]=O.getTable(pt),yt=function(Pt,Ft,ct,mt){return Ft.prev==null&&Ft.next==null?ct.prev==null&&ct.next==null?mt===0?-1:1:ct.prev==null?-1:1:Ft.prev==null?-1:Ft.next==null?1:null}(0,dt,Q,at);if(yt==null)return;let Et=X.offset();if(yt<0){const Pt=new(T())().retain(Et).insert(`
`);this.quill.updateContents(Pt,_.Ay.sources.USER),this.quill.setSelection(pt.index+1,pt.length,_.Ay.sources.SILENT)}else if(yt>0){Et+=X.length();const Pt=new(T())().retain(Et).insert(`
`);this.quill.updateContents(Pt,_.Ay.sources.USER),this.quill.setSelection(Et,_.Ay.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(pt,O){const{event:X,line:dt}=O,Q=dt.offset(this.quill.scroll);X.shiftKey?this.quill.setSelection(Q-1,_.Ay.sources.USER):this.quill.setSelection(Q+dt.length(),_.Ay.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(pt,O){if(this.quill.scroll.query("list")==null)return!0;const{length:X}=O.prefix,[dt,Q]=this.quill.getLine(pt.index);if(Q>X)return!0;let at;switch(O.prefix.trim()){case"[]":case"[ ]":at="unchecked";break;case"[x]":at="checked";break;case"-":case"*":at="bullet";break;default:at="ordered"}this.quill.insertText(pt.index," ",_.Ay.sources.USER),this.quill.history.cutoff();const yt=new(T())().retain(pt.index-Q).delete(X+1).retain(dt.length()-2-Q).retain(1,{list:at});return this.quill.updateContents(yt,_.Ay.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(pt.index-X,_.Ay.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(pt){const[O,X]=this.quill.getLine(pt.index);let dt=2,Q=O;for(;Q!=null&&Q.length()<=1&&Q.formats()["code-block"];)if(Q=Q.prev,dt-=1,dt<=0){const at=new(T())().retain(pt.index+O.length()-X-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(at,_.Ay.sources.USER),this.quill.setSelection(pt.index-1,_.Ay.sources.SILENT),!1}return!0}},"embed left":G("ArrowLeft",!1),"embed left shift":G("ArrowLeft",!0),"embed right":G("ArrowRight",!1),"embed right shift":G("ArrowRight",!0),"table down":vt(!1),"table up":vt(!0)}};function Y(pt){return{key:"Tab",shiftKey:!pt,format:{"code-block":!0},handler(O,X){let{event:dt}=X;const Q=this.quill.scroll.query("code-block"),{TAB:at}=Q;if(O.length===0&&!dt.shiftKey)return this.quill.insertText(O.index,at,_.Ay.sources.USER),void this.quill.setSelection(O.index+at.length,_.Ay.sources.SILENT);const yt=O.length===0?this.quill.getLines(O.index,1):this.quill.getLines(O);let{index:Et,length:Pt}=O;yt.forEach((Ft,ct)=>{pt?(Ft.insertAt(0,at),ct===0?Et+=at.length:Pt+=at.length):Ft.domNode.textContent.startsWith(at)&&(Ft.deleteAt(0,at.length),ct===0?Et-=at.length:Pt-=at.length)}),this.quill.update(_.Ay.sources.USER),this.quill.setSelection(Et,Pt,_.Ay.sources.SILENT)}}}function G(pt,O){return{key:pt,shiftKey:O,altKey:null,[pt==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(X){let{index:dt}=X;pt==="ArrowRight"&&(dt+=X.length+1);const[Q]=this.quill.getLeaf(dt);return!(Q instanceof H.EmbedBlot&&(pt==="ArrowLeft"?O?this.quill.setSelection(X.index-1,X.length+1,_.Ay.sources.USER):this.quill.setSelection(X.index-1,_.Ay.sources.USER):O?this.quill.setSelection(X.index,X.length+1,_.Ay.sources.USER):this.quill.setSelection(X.index+X.length+1,_.Ay.sources.USER),1))}}}function rt(pt){return{key:pt[0],shortKey:!0,handler(O,X){this.quill.format(pt,!X.format[pt],_.Ay.sources.USER)}}}function vt(pt){return{key:pt?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(O,X){const dt=pt?"prev":"next",Q=X.line,at=Q.parent[dt];if(at!=null){if(at.statics.blotName==="table-row"){let yt=at.children.head,Et=Q;for(;Et.prev!=null;)Et=Et.prev,yt=yt.next;const Pt=yt.offset(this.quill.scroll)+Math.min(X.offset,yt.length()-1);this.quill.setSelection(Pt,0,_.Ay.sources.USER)}}else{const yt=Q.table()[dt];yt!=null&&(pt?this.quill.setSelection(yt.offset(this.quill.scroll)+yt.length()-1,0,_.Ay.sources.USER):this.quill.setSelection(yt.offset(this.quill.scroll),0,_.Ay.sources.USER))}return!1}}}function kt(pt){let{quill:O,range:X}=pt;const dt=O.getLines(X);let Q={};if(dt.length>1){const at=dt[0].formats(),yt=dt[dt.length-1].formats();Q=$.AttributeMap.diff(yt,at)||{}}O.deleteText(X,_.Ay.sources.USER),Object.keys(Q).length>0&&O.formatLine(X.index,1,Q,_.Ay.sources.USER),O.setSelection(X.index,_.Ay.sources.SILENT)}k.DEFAULTS=R},8920:function(nt){"use strict";var W=Object.prototype.hasOwnProperty,u="~";function y(){}function q(_,F,v){this.fn=_,this.context=F,this.once=v||!1}function $(_,F,v,V,K){if(typeof v!="function")throw new TypeError("The listener must be a function");var k=new q(v,V||_,K),R=u?u+F:F;return _._events[R]?_._events[R].fn?_._events[R]=[_._events[R],k]:_._events[R].push(k):(_._events[R]=k,_._eventsCount++),_}function T(_,F){--_._eventsCount==0?_._events=new y:delete _._events[F]}function H(){this._events=new y,this._eventsCount=0}Object.create&&(y.prototype=Object.create(null),new y().__proto__||(u=!1)),H.prototype.eventNames=function(){var _,F,v=[];if(this._eventsCount===0)return v;for(F in _=this._events)W.call(_,F)&&v.push(u?F.slice(1):F);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(_)):v},H.prototype.listeners=function(_){var F=u?u+_:_,v=this._events[F];if(!v)return[];if(v.fn)return[v.fn];for(var V=0,K=v.length,k=new Array(K);V<K;V++)k[V]=v[V].fn;return k},H.prototype.listenerCount=function(_){var F=u?u+_:_,v=this._events[F];return v?v.fn?1:v.length:0},H.prototype.emit=function(_,F,v,V,K,k){var R=u?u+_:_;if(!this._events[R])return!1;var Y,G,rt=this._events[R],vt=arguments.length;if(rt.fn){switch(rt.once&&this.removeListener(_,rt.fn,void 0,!0),vt){case 1:return rt.fn.call(rt.context),!0;case 2:return rt.fn.call(rt.context,F),!0;case 3:return rt.fn.call(rt.context,F,v),!0;case 4:return rt.fn.call(rt.context,F,v,V),!0;case 5:return rt.fn.call(rt.context,F,v,V,K),!0;case 6:return rt.fn.call(rt.context,F,v,V,K,k),!0}for(G=1,Y=new Array(vt-1);G<vt;G++)Y[G-1]=arguments[G];rt.fn.apply(rt.context,Y)}else{var kt,pt=rt.length;for(G=0;G<pt;G++)switch(rt[G].once&&this.removeListener(_,rt[G].fn,void 0,!0),vt){case 1:rt[G].fn.call(rt[G].context);break;case 2:rt[G].fn.call(rt[G].context,F);break;case 3:rt[G].fn.call(rt[G].context,F,v);break;case 4:rt[G].fn.call(rt[G].context,F,v,V);break;default:if(!Y)for(kt=1,Y=new Array(vt-1);kt<vt;kt++)Y[kt-1]=arguments[kt];rt[G].fn.apply(rt[G].context,Y)}}return!0},H.prototype.on=function(_,F,v){return $(this,_,F,v,!1)},H.prototype.once=function(_,F,v){return $(this,_,F,v,!0)},H.prototype.removeListener=function(_,F,v,V){var K=u?u+_:_;if(!this._events[K])return this;if(!F)return T(this,K),this;var k=this._events[K];if(k.fn)k.fn!==F||V&&!k.once||v&&k.context!==v||T(this,K);else{for(var R=0,Y=[],G=k.length;R<G;R++)(k[R].fn!==F||V&&!k[R].once||v&&k[R].context!==v)&&Y.push(k[R]);Y.length?this._events[K]=Y.length===1?Y[0]:Y:T(this,K)}return this},H.prototype.removeAllListeners=function(_){var F;return _?(F=u?u+_:_,this._events[F]&&T(this,F)):(this._events=new y,this._eventsCount=0),this},H.prototype.off=H.prototype.removeListener,H.prototype.addListener=H.prototype.on,H.prefixed=u,H.EventEmitter=H,nt.exports=H},5090:function(nt){var W=-1,u=1,y=0;function q(O,X,dt,Q,at){if(O===X)return O?[[y,O]]:[];if(dt!=null){var yt=function(mt,Nt,M){var d=typeof M=="number"?{index:M,length:0}:M.oldRange,g=typeof M=="number"?null:M.newRange,f=mt.length,U=Nt.length;if(d.length===0&&(g===null||g.length===0)){var A=d.index,N=mt.slice(0,A),z=mt.slice(A),j=g?g.index:null,L=A+U-f;if((j===null||j===L)&&!(L<0||L>U)){var p=Nt.slice(0,L);if((I=Nt.slice(L))===z){var x=Math.min(A,L);if((J=N.slice(0,x))===(ft=p.slice(0,x)))return kt(J,N.slice(x),p.slice(x),z)}}if(j===null||j===A){var w=A,I=(p=Nt.slice(0,w),Nt.slice(w));if(p===N){var B=Math.min(f-w,U-w);if((ot=z.slice(z.length-B))===(gt=I.slice(I.length-B)))return kt(N,z.slice(0,z.length-B),I.slice(0,I.length-B),ot)}}}if(d.length>0&&g&&g.length===0){var J=mt.slice(0,d.index),ot=mt.slice(d.index+d.length);if(!(U<(x=J.length)+(B=ot.length))){var ft=Nt.slice(0,x),gt=Nt.slice(U-B);if(J===ft&&ot===gt)return kt(J,mt.slice(x,f-B),Nt.slice(x,U-B),ot)}}return null}(O,X,dt);if(yt)return yt}var Et=T(O,X),Pt=O.substring(0,Et);Et=_(O=O.substring(Et),X=X.substring(Et));var Ft=O.substring(O.length-Et),ct=function(mt,Nt){var M;if(!mt)return[[u,Nt]];if(!Nt)return[[W,mt]];var d=mt.length>Nt.length?mt:Nt,g=mt.length>Nt.length?Nt:mt,f=d.indexOf(g);if(f!==-1)return M=[[u,d.substring(0,f)],[y,g],[u,d.substring(f+g.length)]],mt.length>Nt.length&&(M[0][0]=M[2][0]=W),M;if(g.length===1)return[[W,mt],[u,Nt]];var U=function(w,I){var B=w.length>I.length?w:I,J=w.length>I.length?I:w;if(B.length<4||2*J.length<B.length)return null;function ot(jt,Gt,oe){for(var ie,Tt,Ht,Xt,te=jt.substring(oe,oe+Math.floor(jt.length/4)),Bt=-1,ae="";(Bt=Gt.indexOf(te,Bt+1))!==-1;){var ue=T(jt.substring(oe),Gt.substring(Bt)),ye=_(jt.substring(0,oe),Gt.substring(0,Bt));ae.length<ye+ue&&(ae=Gt.substring(Bt-ye,Bt)+Gt.substring(Bt,Bt+ue),ie=jt.substring(0,oe-ye),Tt=jt.substring(oe+ue),Ht=Gt.substring(0,Bt-ye),Xt=Gt.substring(Bt+ue))}return 2*ae.length>=jt.length?[ie,Tt,Ht,Xt,ae]:null}var ft,gt,_t,At,Ot,zt=ot(B,J,Math.ceil(B.length/4)),Rt=ot(B,J,Math.ceil(B.length/2));return zt||Rt?(ft=Rt?zt&&zt[4].length>Rt[4].length?zt:Rt:zt,w.length>I.length?(gt=ft[0],_t=ft[1],At=ft[2],Ot=ft[3]):(At=ft[0],Ot=ft[1],gt=ft[2],_t=ft[3]),[gt,_t,At,Ot,ft[4]]):null}(mt,Nt);if(U){var A=U[0],N=U[1],z=U[2],j=U[3],L=U[4],p=q(A,z),x=q(N,j);return p.concat([[y,L]],x)}return function(w,I){for(var B=w.length,J=I.length,ot=Math.ceil((B+J)/2),ft=ot,gt=2*ot,_t=new Array(gt),At=new Array(gt),Ot=0;Ot<gt;Ot++)_t[Ot]=-1,At[Ot]=-1;_t[ft+1]=0,At[ft+1]=0;for(var zt=B-J,Rt=zt%2!=0,jt=0,Gt=0,oe=0,ie=0,Tt=0;Tt<ot;Tt++){for(var Ht=-Tt+jt;Ht<=Tt-Gt;Ht+=2){for(var Xt=ft+Ht,te=(ne=Ht===-Tt||Ht!==Tt&&_t[Xt-1]<_t[Xt+1]?_t[Xt+1]:_t[Xt-1]+1)-Ht;ne<B&&te<J&&w.charAt(ne)===I.charAt(te);)ne++,te++;if(_t[Xt]=ne,ne>B)Gt+=2;else if(te>J)jt+=2;else if(Rt&&(ue=ft+zt-Ht)>=0&&ue<gt&&At[ue]!==-1&&ne>=(ae=B-At[ue]))return $(w,I,ne,te)}for(var Bt=-Tt+oe;Bt<=Tt-ie;Bt+=2){for(var ae,ue=ft+Bt,ye=(ae=Bt===-Tt||Bt!==Tt&&At[ue-1]<At[ue+1]?At[ue+1]:At[ue-1]+1)-Bt;ae<B&&ye<J&&w.charAt(B-ae-1)===I.charAt(J-ye-1);)ae++,ye++;if(At[ue]=ae,ae>B)ie+=2;else if(ye>J)oe+=2;else if(!Rt){var ne;if((Xt=ft+zt-Bt)>=0&&Xt<gt&&_t[Xt]!==-1&&(te=ft+(ne=_t[Xt])-Xt,ne>=(ae=B-ae)))return $(w,I,ne,te)}}}return[[W,w],[u,I]]}(mt,Nt)}(O=O.substring(0,O.length-Et),X=X.substring(0,X.length-Et));return Pt&&ct.unshift([y,Pt]),Ft&&ct.push([y,Ft]),R(ct,at),Q&&function(mt){for(var Nt=!1,M=[],d=0,g=null,f=0,U=0,A=0,N=0,z=0;f<mt.length;)mt[f][0]==y?(M[d++]=f,U=N,A=z,N=0,z=0,g=mt[f][1]):(mt[f][0]==u?N+=mt[f][1].length:z+=mt[f][1].length,g&&g.length<=Math.max(U,A)&&g.length<=Math.max(N,z)&&(mt.splice(M[d-1],0,[W,g]),mt[M[d-1]+1][0]=u,d--,f=--d>0?M[d-1]:-1,U=0,A=0,N=0,z=0,g=null,Nt=!0)),f++;for(Nt&&R(mt),function(w){function I(Gt,oe){if(!Gt||!oe)return 6;var ie=Gt.charAt(Gt.length-1),Tt=oe.charAt(0),Ht=ie.match(F),Xt=Tt.match(F),te=Ht&&ie.match(v),Bt=Xt&&Tt.match(v),ae=te&&ie.match(V),ue=Bt&&Tt.match(V),ye=ae&&Gt.match(K),ne=ue&&oe.match(k);return ye||ne?5:ae||ue?4:Ht&&!te&&Bt?3:te||Bt?2:Ht||Xt?1:0}for(var B=1;B<w.length-1;){if(w[B-1][0]==y&&w[B+1][0]==y){var J=w[B-1][1],ot=w[B][1],ft=w[B+1][1],gt=_(J,ot);if(gt){var _t=ot.substring(ot.length-gt);J=J.substring(0,J.length-gt),ot=_t+ot.substring(0,ot.length-gt),ft=_t+ft}for(var At=J,Ot=ot,zt=ft,Rt=I(J,ot)+I(ot,ft);ot.charAt(0)===ft.charAt(0);){J+=ot.charAt(0),ot=ot.substring(1)+ft.charAt(0),ft=ft.substring(1);var jt=I(J,ot)+I(ot,ft);jt>=Rt&&(Rt=jt,At=J,Ot=ot,zt=ft)}w[B-1][1]!=At&&(At?w[B-1][1]=At:(w.splice(B-1,1),B--),w[B][1]=Ot,zt?w[B+1][1]=zt:(w.splice(B+1,1),B--))}B++}}(mt),f=1;f<mt.length;){if(mt[f-1][0]==W&&mt[f][0]==u){var j=mt[f-1][1],L=mt[f][1],p=H(j,L),x=H(L,j);p>=x?(p>=j.length/2||p>=L.length/2)&&(mt.splice(f,0,[y,L.substring(0,p)]),mt[f-1][1]=j.substring(0,j.length-p),mt[f+1][1]=L.substring(p),f++):(x>=j.length/2||x>=L.length/2)&&(mt.splice(f,0,[y,j.substring(0,x)]),mt[f-1][0]=u,mt[f-1][1]=L.substring(0,L.length-x),mt[f+1][0]=W,mt[f+1][1]=j.substring(x),f++),f++}f++}}(ct),ct}function $(O,X,dt,Q){var at=O.substring(0,dt),yt=X.substring(0,Q),Et=O.substring(dt),Pt=X.substring(Q),Ft=q(at,yt),ct=q(Et,Pt);return Ft.concat(ct)}function T(O,X){if(!O||!X||O.charAt(0)!==X.charAt(0))return 0;for(var dt=0,Q=Math.min(O.length,X.length),at=Q,yt=0;dt<at;)O.substring(yt,at)==X.substring(yt,at)?yt=dt=at:Q=at,at=Math.floor((Q-dt)/2+dt);return Y(O.charCodeAt(at-1))&&at--,at}function H(O,X){var dt=O.length,Q=X.length;if(dt==0||Q==0)return 0;dt>Q?O=O.substring(dt-Q):dt<Q&&(X=X.substring(0,dt));var at=Math.min(dt,Q);if(O==X)return at;for(var yt=0,Et=1;;){var Pt=O.substring(at-Et),Ft=X.indexOf(Pt);if(Ft==-1)return yt;Et+=Ft,Ft!=0&&O.substring(at-Et)!=X.substring(0,Et)||(yt=Et,Et++)}}function _(O,X){if(!O||!X||O.slice(-1)!==X.slice(-1))return 0;for(var dt=0,Q=Math.min(O.length,X.length),at=Q,yt=0;dt<at;)O.substring(O.length-at,O.length-yt)==X.substring(X.length-at,X.length-yt)?yt=dt=at:Q=at,at=Math.floor((Q-dt)/2+dt);return G(O.charCodeAt(O.length-at))&&at--,at}var F=/[^a-zA-Z0-9]/,v=/\s/,V=/[\r\n]/,K=/\n\r?\n$/,k=/^\r?\n\r?\n/;function R(O,X){O.push([y,""]);for(var dt,Q=0,at=0,yt=0,Et="",Pt="";Q<O.length;)if(Q<O.length-1&&!O[Q][1])O.splice(Q,1);else switch(O[Q][0]){case u:yt++,Pt+=O[Q][1],Q++;break;case W:at++,Et+=O[Q][1],Q++;break;case y:var Ft=Q-yt-at-1;if(X){if(Ft>=0&&vt(O[Ft][1])){var ct=O[Ft][1].slice(-1);if(O[Ft][1]=O[Ft][1].slice(0,-1),Et=ct+Et,Pt=ct+Pt,!O[Ft][1]){O.splice(Ft,1),Q--;var mt=Ft-1;O[mt]&&O[mt][0]===u&&(yt++,Pt=O[mt][1]+Pt,mt--),O[mt]&&O[mt][0]===W&&(at++,Et=O[mt][1]+Et,mt--),Ft=mt}}rt(O[Q][1])&&(ct=O[Q][1].charAt(0),O[Q][1]=O[Q][1].slice(1),Et+=ct,Pt+=ct)}if(Q<O.length-1&&!O[Q][1]){O.splice(Q,1);break}if(Et.length>0||Pt.length>0){Et.length>0&&Pt.length>0&&((dt=T(Pt,Et))!==0&&(Ft>=0?O[Ft][1]+=Pt.substring(0,dt):(O.splice(0,0,[y,Pt.substring(0,dt)]),Q++),Pt=Pt.substring(dt),Et=Et.substring(dt)),(dt=_(Pt,Et))!==0&&(O[Q][1]=Pt.substring(Pt.length-dt)+O[Q][1],Pt=Pt.substring(0,Pt.length-dt),Et=Et.substring(0,Et.length-dt)));var Nt=yt+at;Et.length===0&&Pt.length===0?(O.splice(Q-Nt,Nt),Q-=Nt):Et.length===0?(O.splice(Q-Nt,Nt,[u,Pt]),Q=Q-Nt+1):Pt.length===0?(O.splice(Q-Nt,Nt,[W,Et]),Q=Q-Nt+1):(O.splice(Q-Nt,Nt,[W,Et],[u,Pt]),Q=Q-Nt+2)}Q!==0&&O[Q-1][0]===y?(O[Q-1][1]+=O[Q][1],O.splice(Q,1)):Q++,yt=0,at=0,Et="",Pt=""}O[O.length-1][1]===""&&O.pop();var M=!1;for(Q=1;Q<O.length-1;)O[Q-1][0]===y&&O[Q+1][0]===y&&(O[Q][1].substring(O[Q][1].length-O[Q-1][1].length)===O[Q-1][1]?(O[Q][1]=O[Q-1][1]+O[Q][1].substring(0,O[Q][1].length-O[Q-1][1].length),O[Q+1][1]=O[Q-1][1]+O[Q+1][1],O.splice(Q-1,1),M=!0):O[Q][1].substring(0,O[Q+1][1].length)==O[Q+1][1]&&(O[Q-1][1]+=O[Q+1][1],O[Q][1]=O[Q][1].substring(O[Q+1][1].length)+O[Q+1][1],O.splice(Q+1,1),M=!0)),Q++;M&&R(O,X)}function Y(O){return O>=55296&&O<=56319}function G(O){return O>=56320&&O<=57343}function rt(O){return G(O.charCodeAt(0))}function vt(O){return Y(O.charCodeAt(O.length-1))}function kt(O,X,dt,Q){return vt(O)||rt(Q)?null:function(at){for(var yt=[],Et=0;Et<at.length;Et++)at[Et][1].length>0&&yt.push(at[Et]);return yt}([[y,O],[W,X],[u,dt],[y,Q]])}function pt(O,X,dt,Q){return q(O,X,dt,Q,!0)}pt.INSERT=u,pt.DELETE=W,pt.EQUAL=y,nt.exports=pt},9629:function(nt,W,u){nt=u.nmd(nt);var y="__lodash_hash_undefined__",q=9007199254740991,$="[object Arguments]",T="[object Boolean]",H="[object Date]",_="[object Function]",F="[object GeneratorFunction]",v="[object Map]",V="[object Number]",K="[object Object]",k="[object Promise]",R="[object RegExp]",Y="[object Set]",G="[object String]",rt="[object Symbol]",vt="[object WeakMap]",kt="[object ArrayBuffer]",pt="[object DataView]",O="[object Float32Array]",X="[object Float64Array]",dt="[object Int8Array]",Q="[object Int16Array]",at="[object Int32Array]",yt="[object Uint8Array]",Et="[object Uint8ClampedArray]",Pt="[object Uint16Array]",Ft="[object Uint32Array]",ct=/\w*$/,mt=/^\[object .+?Constructor\]$/,Nt=/^(?:0|[1-9]\d*)$/,M={};M[$]=M["[object Array]"]=M[kt]=M[pt]=M[T]=M[H]=M[O]=M[X]=M[dt]=M[Q]=M[at]=M[v]=M[V]=M[K]=M[R]=M[Y]=M[G]=M[rt]=M[yt]=M[Et]=M[Pt]=M[Ft]=!0,M["[object Error]"]=M[_]=M[vt]=!1;var d=typeof u.g=="object"&&u.g&&u.g.Object===Object&&u.g,g=typeof self=="object"&&self&&self.Object===Object&&self,f=d||g||Function("return this")(),U=W&&!W.nodeType&&W,A=U&&nt&&!nt.nodeType&&nt,N=A&&A.exports===U;function z(it,C){return it.set(C[0],C[1]),it}function j(it,C){return it.add(C),it}function L(it,C,Z,ht){var Ct=-1,Jt=it?it.length:0;for(ht&&Jt&&(Z=it[++Ct]);++Ct<Jt;)Z=C(Z,it[Ct],Ct,it);return Z}function p(it){var C=!1;if(it!=null&&typeof it.toString!="function")try{C=!!(it+"")}catch{}return C}function x(it){var C=-1,Z=Array(it.size);return it.forEach(function(ht,Ct){Z[++C]=[Ct,ht]}),Z}function w(it,C){return function(Z){return it(C(Z))}}function I(it){var C=-1,Z=Array(it.size);return it.forEach(function(ht){Z[++C]=ht}),Z}var B,J=Array.prototype,ot=Function.prototype,ft=Object.prototype,gt=f["__core-js_shared__"],_t=(B=/[^.]+$/.exec(gt&>.keys&>.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"",At=ot.toString,Ot=ft.hasOwnProperty,zt=ft.toString,Rt=RegExp("^"+At.call(Ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jt=N?f.Buffer:void 0,Gt=f.Symbol,oe=f.Uint8Array,ie=w(Object.getPrototypeOf,Object),Tt=Object.create,Ht=ft.propertyIsEnumerable,Xt=J.splice,te=Object.getOwnPropertySymbols,Bt=jt?jt.isBuffer:void 0,ae=w(Object.keys,Object),ue=S(f,"DataView"),ye=S(f,"Map"),ne=S(f,"Promise"),Re=S(f,"Set"),ni=S(f,"WeakMap"),qe=S(Object,"create"),hi=Zt(ue),Je=Zt(ye),He=Zt(ne),ti=Zt(Re),Ae=Zt(ni),Se=Gt?Gt.prototype:void 0,Ye=Se?Se.valueOf:void 0;function Ue(it){var C=-1,Z=it?it.length:0;for(this.clear();++C<Z;){var ht=it[C];this.set(ht[0],ht[1])}}function we(it){var C=-1,Z=it?it.length:0;for(this.clear();++C<Z;){var ht=it[C];this.set(ht[0],ht[1])}}function We(it){var C=-1,Z=it?it.length:0;for(this.clear();++C<Z;){var ht=it[C];this.set(ht[0],ht[1])}}function $e(it){this.__data__=new we(it)}function xi(it,C,Z){var ht=it[C];Ot.call(it,C)&&xe(ht,Z)&&(Z!==void 0||C in it)||(it[C]=Z)}function oi(it,C){for(var Z=it.length;Z--;)if(xe(it[Z][0],C))return Z;return-1}function gi(it,C,Z,ht,Ct,Jt,Ut){var Yt;if(ht&&(Yt=Jt?ht(it,Ct,Jt,Ut):ht(it)),Yt!==void 0)return Yt;if(!Ge(it))return it;var de=Me(it);if(de){if(Yt=function($t){var Qt=$t.length,le=$t.constructor(Qt);return Qt&&typeof $t[0]=="string"&&Ot.call($t,"index")&&(le.index=$t.index,le.input=$t.input),le}(it),!C)return function($t,Qt){var le=-1,_e=$t.length;for(Qt||(Qt=Array(_e));++le<_e;)Qt[le]=$t[le];return Qt}(it,Yt)}else{var fe=bt(it),Ee=fe==_||fe==F;if(Xe(it))return function($t,Qt){if(Qt)return $t.slice();var le=new $t.constructor($t.length);return $t.copy(le),le}(it,C);if(fe==K||fe==$||Ee&&!Jt){if(p(it))return Jt?it:{};if(Yt=function($t){return typeof $t.constructor!="function"||Vt($t)?{}:Ge(Qt=ie($t))?Tt(Qt):{};var Qt}(Ee?{}:it),!C)return function($t,Qt){return ut($t,tt($t),Qt)}(it,function($t,Qt){return $t&&ut(Qt,ai(Qt),$t)}(Yt,it))}else{if(!M[fe])return Jt?it:{};Yt=function($t,Qt,le,_e){var Ie,Be=$t.constructor;switch(Qt){case kt:return ui($t);case T:case H:return new Be(+$t);case pt:return function(se,Oe){var si=Oe?ui(se.buffer):se.buffer;return new se.constructor(si,se.byteOffset,se.byteLength)}($t,_e);case O:case X:case dt:case Q:case at:case yt:case Et:case Pt:case Ft:return function(se,Oe){var si=Oe?ui(se.buffer):se.buffer;return new se.constructor(si,se.byteOffset,se.length)}($t,_e);case v:return function(se,Oe,si){return L(Oe?si(x(se),!0):x(se),z,new se.constructor)}($t,_e,le);case V:case G:return new Be($t);case R:return function(se){var Oe=new se.constructor(se.source,ct.exec(se));return Oe.lastIndex=se.lastIndex,Oe}($t);case Y:return function(se,Oe,si){return L(Oe?si(I(se),!0):I(se),j,new se.constructor)}($t,_e,le);case rt:return Ie=$t,Ye?Object(Ye.call(Ie)):{}}}(it,fe,gi,C)}}Ut||(Ut=new $e);var ke=Ut.get(it);if(ke)return ke;if(Ut.set(it,Yt),!de)var ve=Z?function($t){return function(Qt,le,_e){var Ie=le(Qt);return Me(Qt)?Ie:function(Be,se){for(var Oe=-1,si=se.length,re=Be.length;++Oe<si;)Be[re+Oe]=se[Oe];return Be}(Ie,_e(Qt))}($t,ai,tt)}(it):ai(it);return function($t,Qt){for(var le=-1,_e=$t?$t.length:0;++le<_e&&Qt($t[le],le)!==!1;);}(ve||it,function($t,Qt){ve&&($t=it[Qt=$t]),xi(Yt,Qt,gi($t,C,Z,ht,Qt,it,Ut))}),Yt}function ui(it){var C=new it.constructor(it.byteLength);return new oe(C).set(new oe(it)),C}function ut(it,C,Z,ht){Z||(Z={});for(var Ct=-1,Jt=C.length;++Ct<Jt;){var Ut=C[Ct],Yt=ht?ht(Z[Ut],it[Ut],Ut,Z,it):void 0;xi(Z,Ut,Yt===void 0?it[Ut]:Yt)}return Z}function b(it,C){var Z,ht,Ct=it.__data__;return((ht=typeof(Z=C))=="string"||ht=="number"||ht=="symbol"||ht=="boolean"?Z!=="__proto__":Z===null)?Ct[typeof C=="string"?"string":"hash"]:Ct.map}function S(it,C){var Z=function(ht,Ct){return ht?.[Ct]}(it,C);return function(ht){return!(!Ge(ht)||(Ct=ht,_t&&_t in Ct))&&(pi(ht)||p(ht)?Rt:mt).test(Zt(ht));var Ct}(Z)?Z:void 0}Ue.prototype.clear=function(){this.__data__=qe?qe(null):{}},Ue.prototype.delete=function(it){return this.has(it)&&delete this.__data__[it]},Ue.prototype.get=function(it){var C=this.__data__;if(qe){var Z=C[it];return Z===y?void 0:Z}return Ot.call(C,it)?C[it]:void 0},Ue.prototype.has=function(it){var C=this.__data__;return qe?C[it]!==void 0:Ot.call(C,it)},Ue.prototype.set=function(it,C){return this.__data__[it]=qe&&C===void 0?y:C,this},we.prototype.clear=function(){this.__data__=[]},we.prototype.delete=function(it){var C=this.__data__,Z=oi(C,it);return!(Z<0||(Z==C.length-1?C.pop():Xt.call(C,Z,1),0))},we.prototype.get=function(it){var C=this.__data__,Z=oi(C,it);return Z<0?void 0:C[Z][1]},we.prototype.has=function(it){return oi(this.__data__,it)>-1},we.prototype.set=function(it,C){var Z=this.__data__,ht=oi(Z,it);return ht<0?Z.push([it,C]):Z[ht][1]=C,this},We.prototype.clear=function(){this.__data__={hash:new Ue,map:new(ye||we),string:new Ue}},We.prototype.delete=function(it){return b(this,it).delete(it)},We.prototype.get=function(it){return b(this,it).get(it)},We.prototype.has=function(it){return b(this,it).has(it)},We.prototype.set=function(it,C){return b(this,it).set(it,C),this},$e.prototype.clear=function(){this.__data__=new we},$e.prototype.delete=function(it){return this.__data__.delete(it)},$e.prototype.get=function(it){return this.__data__.get(it)},$e.prototype.has=function(it){return this.__data__.has(it)},$e.prototype.set=function(it,C){var Z=this.__data__;if(Z instanceof we){var ht=Z.__data__;if(!ye||ht.length<199)return ht.push([it,C]),this;Z=this.__data__=new We(ht)}return Z.set(it,C),this};var tt=te?w(te,Object):function(){return[]},bt=function(it){return zt.call(it)};function St(it,C){return!!(C=C??q)&&(typeof it=="number"||Nt.test(it))&&it>-1&&it%1==0&&it<C}function Vt(it){var C=it&&it.constructor;return it===(typeof C=="function"&&C.prototype||ft)}function Zt(it){if(it!=null){try{return At.call(it)}catch{}try{return it+""}catch{}}return""}function xe(it,C){return it===C||it!=it&&C!=C}(ue&&bt(new ue(new ArrayBuffer(1)))!=pt||ye&&bt(new ye)!=v||ne&&bt(ne.resolve())!=k||Re&&bt(new Re)!=Y||ni&&bt(new ni)!=vt)&&(bt=function(it){var C=zt.call(it),Z=C==K?it.constructor:void 0,ht=Z?Zt(Z):void 0;if(ht)switch(ht){case hi:return pt;case Je:return v;case He:return k;case ti:return Y;case Ae:return vt}return C});var Me=Array.isArray;function je(it){return it!=null&&function(C){return typeof C=="number"&&C>-1&&C%1==0&&C<=q}(it.length)&&!pi(it)}var Xe=Bt||function(){return!1};function pi(it){var C=Ge(it)?zt.call(it):"";return C==_||C==F}function Ge(it){var C=typeof it;return!!it&&(C=="object"||C=="function")}function ai(it){return je(it)?function(C,Z){var ht=Me(C)||function(Yt){return function(de){return function(fe){return!!fe&&typeof fe=="object"}(de)&&je(de)}(Yt)&&Ot.call(Yt,"callee")&&(!Ht.call(Yt,"callee")||zt.call(Yt)==$)}(C)?function(Yt,de){for(var fe=-1,Ee=Array(Yt);++fe<Yt;)Ee[fe]=de(fe);return Ee}(C.length,String):[],Ct=ht.length,Jt=!!Ct;for(var Ut in C)!Z&&!Ot.call(C,Ut)||Jt&&(Ut=="length"||St(Ut,Ct))||ht.push(Ut);return ht}(it):function(C){if(!Vt(C))return ae(C);var Z=[];for(var ht in Object(C))Ot.call(C,ht)&&ht!="constructor"&&Z.push(ht);return Z}(it)}nt.exports=function(it){return gi(it,!0,!0)}},4162:function(nt,W,u){nt=u.nmd(nt);var y="__lodash_hash_undefined__",q=1,$=2,T=9007199254740991,H="[object Arguments]",_="[object Array]",F="[object AsyncFunction]",v="[object Boolean]",V="[object Date]",K="[object Error]",k="[object Function]",R="[object GeneratorFunction]",Y="[object Map]",G="[object Number]",rt="[object Null]",vt="[object Object]",kt="[object Promise]",pt="[object Proxy]",O="[object RegExp]",X="[object Set]",dt="[object String]",Q="[object Undefined]",at="[object WeakMap]",yt="[object ArrayBuffer]",Et="[object DataView]",Pt=/^\[object .+?Constructor\]$/,Ft=/^(?:0|[1-9]\d*)$/,ct={};ct["[object Float32Array]"]=ct["[object Float64Array]"]=ct["[object Int8Array]"]=ct["[object Int16Array]"]=ct["[object Int32Array]"]=ct["[object Uint8Array]"]=ct["[object Uint8ClampedArray]"]=ct["[object Uint16Array]"]=ct["[object Uint32Array]"]=!0,ct[H]=ct[_]=ct[yt]=ct[v]=ct[Et]=ct[V]=ct[K]=ct[k]=ct[Y]=ct[G]=ct[vt]=ct[O]=ct[X]=ct[dt]=ct[at]=!1;var mt=typeof u.g=="object"&&u.g&&u.g.Object===Object&&u.g,Nt=typeof self=="object"&&self&&self.Object===Object&&self,M=mt||Nt||Function("return this")(),d=W&&!W.nodeType&&W,g=d&&nt&&!nt.nodeType&&nt,f=g&&g.exports===d,U=f&&mt.process,A=function(){try{return U&&U.binding&&U.binding("util")}catch{}}(),N=A&&A.isTypedArray;function z(C,Z){for(var ht=-1,Ct=C==null?0:C.length;++ht<Ct;)if(Z(C[ht],ht,C))return!0;return!1}function j(C){var Z=-1,ht=Array(C.size);return C.forEach(function(Ct,Jt){ht[++Z]=[Jt,Ct]}),ht}function L(C){var Z=-1,ht=Array(C.size);return C.forEach(function(Ct){ht[++Z]=Ct}),ht}var p,x,w,I=Array.prototype,B=Function.prototype,J=Object.prototype,ot=M["__core-js_shared__"],ft=B.toString,gt=J.hasOwnProperty,_t=(p=/[^.]+$/.exec(ot&&ot.keys&&ot.keys.IE_PROTO||""))?"Symbol(src)_1."+p:"",At=J.toString,Ot=RegExp("^"+ft.call(gt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=f?M.Buffer:void 0,Rt=M.Symbol,jt=M.Uint8Array,Gt=J.propertyIsEnumerable,oe=I.splice,ie=Rt?Rt.toStringTag:void 0,Tt=Object.getOwnPropertySymbols,Ht=zt?zt.isBuffer:void 0,Xt=(x=Object.keys,w=Object,function(C){return x(w(C))}),te=b(M,"DataView"),Bt=b(M,"Map"),ae=b(M,"Promise"),ue=b(M,"Set"),ye=b(M,"WeakMap"),ne=b(Object,"create"),Re=St(te),ni=St(Bt),qe=St(ae),hi=St(ue),Je=St(ye),He=Rt?Rt.prototype:void 0,ti=He?He.valueOf:void 0;function Ae(C){var Z=-1,ht=C==null?0:C.length;for(this.clear();++Z<ht;){var Ct=C[Z];this.set(Ct[0],Ct[1])}}function Se(C){var Z=-1,ht=C==null?0:C.length;for(this.clear();++Z<ht;){var Ct=C[Z];this.set(Ct[0],Ct[1])}}function Ye(C){var Z=-1,ht=C==null?0:C.length;for(this.clear();++Z<ht;){var Ct=C[Z];this.set(Ct[0],Ct[1])}}function Ue(C){var Z=-1,ht=C==null?0:C.length;for(this.__data__=new Ye;++Z<ht;)this.add(C[Z])}function we(C){var Z=this.__data__=new Se(C);this.size=Z.size}function We(C,Z){for(var ht=C.length;ht--;)if(Vt(C[ht][0],Z))return ht;return-1}function $e(C){return C==null?C===void 0?Q:rt:ie&&ie in Object(C)?function(Z){var ht=gt.call(Z,ie),Ct=Z[ie];try{Z[ie]=void 0;var Jt=!0}catch{}var Ut=At.call(Z);return Jt&&(ht?Z[ie]=Ct:delete Z[ie]),Ut}(C):function(Z){return At.call(Z)}(C)}function xi(C){return Ge(C)&&$e(C)==H}function oi(C,Z,ht,Ct,Jt){return C===Z||(C==null||Z==null||!Ge(C)&&!Ge(Z)?C!=C&&Z!=Z:function(Ut,Yt,de,fe,Ee,ke){var ve=xe(Ut),$t=xe(Yt),Qt=ve?_:tt(Ut),le=$t?_:tt(Yt),_e=(Qt=Qt==H?vt:Qt)==vt,Ie=(le=le==H?vt:le)==vt,Be=Qt==le;if(Be&&Me(Ut)){if(!Me(Yt))return!1;ve=!0,_e=!1}if(Be&&!_e)return ke||(ke=new we),ve||ai(Ut)?gi(Ut,Yt,de,fe,Ee,ke):function(pe,he,vi,ri,Vi,ei,Fe){switch(vi){case Et:if(pe.byteLength!=he.byteLength||pe.byteOffset!=he.byteOffset)return!1;pe=pe.buffer,he=he.buffer;case yt:return!(pe.byteLength!=he.byteLength||!ei(new jt(pe),new jt(he)));case v:case V:case G:return Vt(+pe,+he);case K:return pe.name==he.name&&pe.message==he.message;case O:case dt:return pe==he+"";case Y:var mi=j;case X:var Pi=ri&q;if(mi||(mi=L),pe.size!=he.size&&!Pi)return!1;var Ke=Fe.get(pe);if(Ke)return Ke==he;ri|=$,Fe.set(pe,he);var di=gi(mi(pe),mi(he),ri,Vi,ei,Fe);return Fe.delete(pe),di;case"[object Symbol]":if(ti)return ti.call(pe)==ti.call(he)}return!1}(Ut,Yt,Qt,de,fe,Ee,ke);if(!(de&q)){var se=_e&>.call(Ut,"__wrapped__"),Oe=Ie&>.call(Yt,"__wrapped__");if(se||Oe){var si=se?Ut.value():Ut,re=Oe?Yt.value():Yt;return ke||(ke=new we),Ee(si,re,de,fe,ke)}}return!!Be&&(ke||(ke=new we),function(pe,he,vi,ri,Vi,ei){var Fe=vi&q,mi=ui(pe),Pi=mi.length;if(Pi!=ui(he).length&&!Fe)return!1;for(var Ke=Pi;Ke--;){var di=mi[Ke];if(!(Fe?di in he:gt.call(he,di)))return!1}var Hi=ei.get(pe);if(Hi&&ei.get(he))return Hi==he;var Ri=!0;ei.set(pe,he),ei.set(he,pe);for(var Di=Fe;++Ke<Pi;){var qi=pe[di=mi[Ke]],wi=he[di];if(ri)var en=Fe?ri(wi,qi,di,he,pe,ei):ri(qi,wi,di,pe,he,ei);if(!(en===void 0?qi===wi||Vi(qi,wi,vi,ri,ei):en)){Ri=!1;break}Di||(Di=di=="constructor")}if(Ri&&!Di){var bi=pe.constructor,Ii=he.constructor;bi==Ii||!("constructor"in pe)||!("constructor"in he)||typeof bi=="function"&&bi instanceof bi&&typeof Ii=="function"&&Ii instanceof Ii||(Ri=!1)}return ei.delete(pe),ei.delete(he),Ri}(Ut,Yt,de,fe,Ee,ke))}(C,Z,ht,Ct,oi,Jt))}function gi(C,Z,ht,Ct,Jt,Ut){var Yt=ht&q,de=C.length,fe=Z.length;if(de!=fe&&!(Yt&&fe>de))return!1;var Ee=Ut.get(C);if(Ee&&Ut.get(Z))return Ee==Z;var ke=-1,ve=!0,$t=ht&$?new Ue:void 0;for(Ut.set(C,Z),Ut.set(Z,C);++ke<de;){var Qt=C[ke],le=Z[ke];if(Ct)var _e=Yt?Ct(le,Qt,ke,Z,C,Ut):Ct(Qt,le,ke,C,Z,Ut);if(_e!==void 0){if(_e)continue;ve=!1;break}if($t){if(!z(Z,function(Ie,Be){if(se=Be,!$t.has(se)&&(Qt===Ie||Jt(Qt,Ie,ht,Ct,Ut)))return $t.push(Be);var se})){ve=!1;break}}else if(Qt!==le&&!Jt(Qt,le,ht,Ct,Ut)){ve=!1;break}}return Ut.delete(C),Ut.delete(Z),ve}function ui(C){return function(Z,ht,Ct){var Jt=ht(Z);return xe(Z)?Jt:function(Ut,Yt){for(var de=-1,fe=Yt.length,Ee=Ut.length;++de<fe;)Ut[Ee+de]=Yt[de];return Ut}(Jt,Ct(Z))}(C,it,S)}function ut(C,Z){var ht,Ct,Jt=C.__data__;return((Ct=typeof(ht=Z))=="string"||Ct=="number"||Ct=="symbol"||Ct=="boolean"?ht!=="__proto__":ht===null)?Jt[typeof Z=="string"?"string":"hash"]:Jt.map}function b(C,Z){var ht=function(Ct,Jt){return Ct?.[Jt]}(C,Z);return function(Ct){return!(!pi(Ct)||function(Jt){return!!_t&&_t in Jt}(Ct))&&(je(Ct)?Ot:Pt).test(St(Ct))}(ht)?ht:void 0}Ae.prototype.clear=function(){this.__data__=ne?ne(null):{},this.size=0},Ae.prototype.delete=function(C){var Z=this.has(C)&&delete this.__data__[C];return this.size-=Z?1:0,Z},Ae.prototype.get=function(C){var Z=this.__data__;if(ne){var ht=Z[C];return ht===y?void 0:ht}return gt.call(Z,C)?Z[C]:void 0},Ae.prototype.has=function(C){var Z=this.__data__;return ne?Z[C]!==void 0:gt.call(Z,C)},Ae.prototype.set=function(C,Z){var ht=this.__data__;return this.size+=this.has(C)?0:1,ht[C]=ne&&Z===void 0?y:Z,this},Se.prototype.clear=function(){this.__data__=[],this.size=0},Se.prototype.delete=function(C){var Z=this.__data__,ht=We(Z,C);return!(ht<0||(ht==Z.length-1?Z.pop():oe.call(Z,ht,1),--this.size,0))},Se.prototype.get=function(C){var Z=this.__data__,ht=We(Z,C);return ht<0?void 0:Z[ht][1]},Se.prototype.has=function(C){return We(this.__data__,C)>-1},Se.prototype.set=function(C,Z){var ht=this.__data__,Ct=We(ht,C);return Ct<0?(++this.size,ht.push([C,Z])):ht[Ct][1]=Z,this},Ye.prototype.clear=function(){this.size=0,this.__data__={hash:new Ae,map:new(Bt||Se),string:new Ae}},Ye.prototype.delete=function(C){var Z=ut(this,C).delete(C);return this.size-=Z?1:0,Z},Ye.prototype.get=function(C){return ut(this,C).get(C)},Ye.prototype.has=function(C){return ut(this,C).has(C)},Ye.prototype.set=function(C,Z){var ht=ut(this,C),Ct=ht.size;return ht.set(C,Z),this.size+=ht.size==Ct?0:1,this},Ue.prototype.add=Ue.prototype.push=function(C){return this.__data__.set(C,y),this},Ue.prototype.has=function(C){return this.__data__.has(C)},we.prototype.clear=function(){this.__data__=new Se,this.size=0},we.prototype.delete=function(C){var Z=this.__data__,ht=Z.delete(C);return this.size=Z.size,ht},we.prototype.get=function(C){return this.__data__.get(C)},we.prototype.has=function(C){return this.__data__.has(C)},we.prototype.set=function(C,Z){var ht=this.__data__;if(ht instanceof Se){var Ct=ht.__data__;if(!Bt||Ct.length<199)return Ct.push([C,Z]),this.size=++ht.size,this;ht=this.__data__=new Ye(Ct)}return ht.set(C,Z),this.size=ht.size,this};var S=Tt?function(C){return C==null?[]:(C=Object(C),function(Z,ht){for(var Ct=-1,Jt=Z==null?0:Z.length,Ut=0,Yt=[];++Ct<Jt;){var de=Z[Ct];fe=de,Gt.call(C,fe)&&(Yt[Ut++]=de)}var fe;return Yt}(Tt(C)))}:function(){return[]},tt=$e;function bt(C,Z){return!!(Z=Z??T)&&(typeof C=="number"||Ft.test(C))&&C>-1&&C%1==0&&C<Z}function St(C){if(C!=null){try{return ft.call(C)}catch{}try{return C+""}catch{}}return""}function Vt(C,Z){return C===Z||C!=C&&Z!=Z}(te&&tt(new te(new ArrayBuffer(1)))!=Et||Bt&&tt(new Bt)!=Y||ae&&tt(ae.resolve())!=kt||ue&&tt(new ue)!=X||ye&&tt(new ye)!=at)&&(tt=function(C){var Z=$e(C),ht=Z==vt?C.constructor:void 0,Ct=ht?St(ht):"";if(Ct)switch(Ct){case Re:return Et;case ni:return Y;case qe:return kt;case hi:return X;case Je:return at}return Z});var Zt=xi(function(){return arguments}())?xi:function(C){return Ge(C)&>.call(C,"callee")&&!Gt.call(C,"callee")},xe=Array.isArray,Me=Ht||function(){return!1};function je(C){if(!pi(C))return!1;var Z=$e(C);return Z==k||Z==R||Z==F||Z==pt}function Xe(C){return typeof C=="number"&&C>-1&&C%1==0&&C<=T}function pi(C){var Z=typeof C;return C!=null&&(Z=="object"||Z=="function")}function Ge(C){return C!=null&&typeof C=="object"}var ai=N?function(C){return function(Z){return C(Z)}}(N):function(C){return Ge(C)&&Xe(C.length)&&!!ct[$e(C)]};function it(C){return(Z=C)!=null&&Xe(Z.length)&&!je(Z)?function(ht,Ct){var Jt=xe(ht),Ut=!Jt&&Zt(ht),Yt=!Jt&&!Ut&&Me(ht),de=!Jt&&!Ut&&!Yt&&ai(ht),fe=Jt||Ut||Yt||de,Ee=fe?function($t,Qt){for(var le=-1,_e=Array($t);++le<$t;)_e[le]=Qt(le);return _e}(ht.length,String):[],ke=Ee.length;for(var ve in ht)!Ct&&!gt.call(ht,ve)||fe&&(ve=="length"||Yt&&(ve=="offset"||ve=="parent")||de&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||bt(ve,ke))||Ee.push(ve);return Ee}(C):function(ht){if(Jt=(Ct=ht)&&Ct.constructor,Ct!==(typeof Jt=="function"&&Jt.prototype||J))return Xt(ht);var Ct,Jt,Ut=[];for(var Yt in Object(ht))gt.call(ht,Yt)&&Yt!="constructor"&&Ut.push(Yt);return Ut}(C);var Z}nt.exports=function(C,Z){return oi(C,Z)}},1270:function(nt,W,u){"use strict";Object.defineProperty(W,"__esModule",{value:!0});const y=u(9629),q=u(4162);var $;(function(T){T.compose=function(H={},_={},F=!1){typeof H!="object"&&(H={}),typeof _!="object"&&(_={});let v=y(_);F||(v=Object.keys(v).reduce((V,K)=>(v[K]!=null&&(V[K]=v[K]),V),{}));for(const V in H)H[V]!==void 0&&_[V]===void 0&&(v[V]=H[V]);return Object.keys(v).length>0?v:void 0},T.diff=function(H={},_={}){typeof H!="object"&&(H={}),typeof _!="object"&&(_={});const F=Object.keys(H).concat(Object.keys(_)).reduce((v,V)=>(q(H[V],_[V])||(v[V]=_[V]===void 0?null:_[V]),v),{});return Object.keys(F).length>0?F:void 0},T.invert=function(H={},_={}){H=H||{};const F=Object.keys(_).reduce((v,V)=>(_[V]!==H[V]&&H[V]!==void 0&&(v[V]=_[V]),v),{});return Object.keys(H).reduce((v,V)=>(H[V]!==_[V]&&_[V]===void 0&&(v[V]=null),v),F)},T.transform=function(H,_,F=!1){if(typeof H!="object")return _;if(typeof _!="object")return;if(!F)return _;const v=Object.keys(_).reduce((V,K)=>(H[K]===void 0&&(V[K]=_[K]),V),{});return Object.keys(v).length>0?v:void 0}})($||($={})),W.default=$},5232:function(nt,W,u){"use strict";Object.defineProperty(W,"__esModule",{value:!0}),W.AttributeMap=W.OpIterator=W.Op=void 0;const y=u(5090),q=u(9629),$=u(4162),T=u(1270);W.AttributeMap=T.default;const H=u(4123);W.Op=H.default;const _=u(7033);W.OpIterator=_.default;const F="\0",v=(K,k)=>{if(typeof K!="object"||K===null)throw new Error("cannot retain a "+typeof K);if(typeof k!="object"||k===null)throw new Error("cannot retain a "+typeof k);const R=Object.keys(K)[0];if(!R||R!==Object.keys(k)[0])throw new Error(`embed types not matched: ${R} != ${Object.keys(k)[0]}`);return[R,K[R],k[R]]};class V{constructor(k){Array.isArray(k)?this.ops=k:k!=null&&Array.isArray(k.ops)?this.ops=k.ops:this.ops=[]}static registerEmbed(k,R){this.handlers[k]=R}static unregisterEmbed(k){delete this.handlers[k]}static getHandler(k){const R=this.handlers[k];if(!R)throw new Error(`no handlers for embed type "${k}"`);return R}insert(k,R){const Y={};return typeof k=="string"&&k.length===0?this:(Y.insert=k,R!=null&&typeof R=="object"&&Object.keys(R).length>0&&(Y.attributes=R),this.push(Y))}delete(k){return k<=0?this:this.push({delete:k})}retain(k,R){if(typeof k=="number"&&k<=0)return this;const Y={retain:k};return R!=null&&typeof R=="object"&&Object.keys(R).length>0&&(Y.attributes=R),this.push(Y)}push(k){let R=this.ops.length,Y=this.ops[R-1];if(k=q(k),typeof Y=="object"){if(typeof k.delete=="number"&&typeof Y.delete=="number")return this.ops[R-1]={delete:Y.delete+k.delete},this;if(typeof Y.delete=="number"&&k.insert!=null&&(R-=1,Y=this.ops[R-1],typeof Y!="object"))return this.ops.unshift(k),this;if($(k.attributes,Y.attributes)){if(typeof k.insert=="string"&&typeof Y.insert=="string")return this.ops[R-1]={insert:Y.insert+k.insert},typeof k.attributes=="object"&&(this.ops[R-1].attributes=k.attributes),this;if(typeof k.retain=="number"&&typeof Y.retain=="number")return this.ops[R-1]={retain:Y.retain+k.retain},typeof k.attributes=="object"&&(this.ops[R-1].attributes=k.attributes),this}}return R===this.ops.length?this.ops.push(k):this.ops.splice(R,0,k),this}chop(){const k=this.ops[this.ops.length-1];return k&&typeof k.retain=="number"&&!k.attributes&&this.ops.pop(),this}filter(k){return this.ops.filter(k)}forEach(k){this.ops.forEach(k)}map(k){return this.ops.map(k)}partition(k){const R=[],Y=[];return this.forEach(G=>{(k(G)?R:Y).push(G)}),[R,Y]}reduce(k,R){return this.ops.reduce(k,R)}changeLength(){return this.reduce((k,R)=>R.insert?k+H.default.length(R):R.delete?k-R.delete:k,0)}length(){return this.reduce((k,R)=>k+H.default.length(R),0)}slice(k=0,R=1/0){const Y=[],G=new _.default(this.ops);let rt=0;for(;rt<R&&G.hasNext();){let vt;rt<k?vt=G.next(k-rt):(vt=G.next(R-rt),Y.push(vt)),rt+=H.default.length(vt)}return new V(Y)}compose(k){const R=new _.default(this.ops),Y=new _.default(k.ops),G=[],rt=Y.peek();if(rt!=null&&typeof rt.retain=="number"&&rt.attributes==null){let kt=rt.retain;for(;R.peekType()==="insert"&&R.peekLength()<=kt;)kt-=R.peekLength(),G.push(R.next());rt.retain-kt>0&&Y.next(rt.retain-kt)}const vt=new V(G);for(;R.hasNext()||Y.hasNext();)if(Y.peekType()==="insert")vt.push(Y.next());else if(R.peekType()==="delete")vt.push(R.next());else{const kt=Math.min(R.peekLength(),Y.peekLength()),pt=R.next(kt),O=Y.next(kt);if(O.retain){const X={};if(typeof pt.retain=="number")X.retain=typeof O.retain=="number"?kt:O.retain;else if(typeof O.retain=="number")pt.retain==null?X.insert=pt.insert:X.retain=pt.retain;else{const Q=pt.retain==null?"insert":"retain",[at,yt,Et]=v(pt[Q],O.retain),Pt=V.getHandler(at);X[Q]={[at]:Pt.compose(yt,Et,Q==="retain")}}const dt=T.default.compose(pt.attributes,O.attributes,typeof pt.retain=="number");if(dt&&(X.attributes=dt),vt.push(X),!Y.hasNext()&&$(vt.ops[vt.ops.length-1],X)){const Q=new V(R.rest());return vt.concat(Q).chop()}}else typeof O.delete=="number"&&(typeof pt.retain=="number"||typeof pt.retain=="object"&&pt.retain!==null)&&vt.push(O)}return vt.chop()}concat(k){const R=new V(this.ops.slice());return k.ops.length>0&&(R.push(k.ops[0]),R.ops=R.ops.concat(k.ops.slice(1))),R}diff(k,R){if(this.ops===k.ops)return new V;const Y=[this,k].map(pt=>pt.map(O=>{if(O.insert!=null)return typeof O.insert=="string"?O.insert:F;throw new Error("diff() called "+(pt===k?"on":"with")+" non-document")}).join("")),G=new V,rt=y(Y[0],Y[1],R,!0),vt=new _.default(this.ops),kt=new _.default(k.ops);return rt.forEach(pt=>{let O=pt[1].length;for(;O>0;){let X=0;switch(pt[0]){case y.INSERT:X=Math.min(kt.peekLength(),O),G.push(kt.next(X));break;case y.DELETE:X=Math.min(O,vt.peekLength()),vt.next(X),G.delete(X);break;case y.EQUAL:X=Math.min(vt.peekLength(),kt.peekLength(),O);const dt=vt.next(X),Q=kt.next(X);$(dt.insert,Q.insert)?G.retain(X,T.default.diff(dt.attributes,Q.attributes)):G.push(Q).delete(X)}O-=X}}),G.chop()}eachLine(k,R=`
`){const Y=new _.default(this.ops);let G=new V,rt=0;for(;Y.hasNext();){if(Y.peekType()!=="insert")return;const vt=Y.peek(),kt=H.default.length(vt)-Y.peekLength(),pt=typeof vt.insert=="string"?vt.insert.indexOf(R,kt)-kt:-1;if(pt<0)G.push(Y.next());else if(pt>0)G.push(Y.next(pt));else{if(k(G,Y.next(1).attributes||{},rt)===!1)return;rt+=1,G=new V}}G.length()>0&&k(G,{},rt)}invert(k){const R=new V;return this.reduce((Y,G)=>{if(G.insert)R.delete(H.default.length(G));else{if(typeof G.retain=="number"&&G.attributes==null)return R.retain(G.retain),Y+G.retain;if(G.delete||typeof G.retain=="number"){const rt=G.delete||G.retain;return k.slice(Y,Y+rt).forEach(vt=>{G.delete?R.push(vt):G.retain&&G.attributes&&R.retain(H.default.length(vt),T.default.invert(G.attributes,vt.attributes))}),Y+rt}if(typeof G.retain=="object"&&G.retain!==null){const rt=k.slice(Y,Y+1),vt=new _.default(rt.ops).next(),[kt,pt,O]=v(G.retain,vt.insert),X=V.getHandler(kt);return R.retain({[kt]:X.invert(pt,O)},T.default.invert(G.attributes,vt.attributes)),Y+1}}return Y},0),R.chop()}transform(k,R=!1){if(R=!!R,typeof k=="number")return this.transformPosition(k,R);const Y=k,G=new _.default(this.ops),rt=new _.default(Y.ops),vt=new V;for(;G.hasNext()||rt.hasNext();)if(G.peekType()!=="insert"||!R&&rt.peekType()==="insert")if(rt.peekType()==="insert")vt.push(rt.next());else{const kt=Math.min(G.peekLength(),rt.peekLength()),pt=G.next(kt),O=rt.next(kt);if(pt.delete)continue;if(O.delete)vt.push(O);else{const X=pt.retain,dt=O.retain;let Q=typeof dt=="object"&&dt!==null?dt:kt;if(typeof X=="object"&&X!==null&&typeof dt=="object"&&dt!==null){const at=Object.keys(X)[0];if(at===Object.keys(dt)[0]){const yt=V.getHandler(at);yt&&(Q={[at]:yt.transform(X[at],dt[at],R)})}}vt.retain(Q,T.default.transform(pt.attributes,O.attributes,R))}}else vt.retain(H.default.length(G.next()));return vt.chop()}transformPosition(k,R=!1){R=!!R;const Y=new _.default(this.ops);let G=0;for(;Y.hasNext()&&G<=k;){const rt=Y.peekLength(),vt=Y.peekType();Y.next(),vt!=="delete"?(vt==="insert"&&(G<k||!R)&&(k+=rt),G+=rt):k-=Math.min(rt,k-G)}return k}}V.Op=H.default,V.OpIterator=_.default,V.AttributeMap=T.default,V.handlers={},W.default=V,nt.exports=V,nt.exports.default=V},4123:function(nt,W){"use strict";var u;Object.defineProperty(W,"__esModule",{value:!0}),function(y){y.length=function(q){return typeof q.delete=="number"?q.delete:typeof q.retain=="number"?q.retain:typeof q.retain=="object"&&q.retain!==null?1:typeof q.insert=="string"?q.insert.length:1}}(u||(u={})),W.default=u},7033:function(nt,W,u){"use strict";Object.defineProperty(W,"__esModule",{value:!0});const y=u(4123);W.default=class{constructor(q){this.ops=q,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(q){q||(q=1/0);const $=this.ops[this.index];if($){const T=this.offset,H=y.default.length($);if(q>=H-T?(q=H-T,this.index+=1,this.offset=0):this.offset+=q,typeof $.delete=="number")return{delete:q};{const _={};return $.attributes&&(_.attributes=$.attributes),typeof $.retain=="number"?_.retain=q:typeof $.retain=="object"&&$.retain!==null?_.retain=$.retain:typeof $.insert=="string"?_.insert=$.insert.substr(T,q):_.insert=$.insert,_}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?y.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const q=this.ops[this.index];return q?typeof q.delete=="number"?"delete":typeof q.retain=="number"||typeof q.retain=="object"&&q.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const q=this.offset,$=this.index,T=this.next(),H=this.ops.slice(this.index);return this.offset=q,this.index=$,[T].concat(H)}}return[]}}},8820:function(nt,W,u){"use strict";u.d(W,{A:function(){return H}});var y=u(8138),q=function(_,F){for(var v=_.length;v--;)if((0,y.A)(_[v][0],F))return v;return-1},$=Array.prototype.splice;function T(_){var F=-1,v=_==null?0:_.length;for(this.clear();++F<v;){var V=_[F];this.set(V[0],V[1])}}T.prototype.clear=function(){this.__data__=[],this.size=0},T.prototype.delete=function(_){var F=this.__data__,v=q(F,_);return!(v<0||(v==F.length-1?F.pop():$.call(F,v,1),--this.size,0))},T.prototype.get=function(_){var F=this.__data__,v=q(F,_);return v<0?void 0:F[v][1]},T.prototype.has=function(_){return q(this.__data__,_)>-1},T.prototype.set=function(_,F){var v=this.__data__,V=q(v,_);return V<0?(++this.size,v.push([_,F])):v[V][1]=F,this};var H=T},2461:function(nt,W,u){"use strict";var y=u(2281),q=u(5507),$=(0,y.A)(q.A,"Map");W.A=$},3558:function(nt,W,u){"use strict";u.d(W,{A:function(){return K}});var y=(0,u(2281).A)(Object,"create"),q=Object.prototype.hasOwnProperty,$=Object.prototype.hasOwnProperty;function T(k){var R=-1,Y=k==null?0:k.length;for(this.clear();++R<Y;){var G=k[R];this.set(G[0],G[1])}}T.prototype.clear=function(){this.__data__=y?y(null):{},this.size=0},T.prototype.delete=function(k){var R=this.has(k)&&delete this.__data__[k];return this.size-=R?1:0,R},T.prototype.get=function(k){var R=this.__data__;if(y){var Y=R[k];return Y==="__lodash_hash_undefined__"?void 0:Y}return q.call(R,k)?R[k]:void 0},T.prototype.has=function(k){var R=this.__data__;return y?R[k]!==void 0:$.call(R,k)},T.prototype.set=function(k,R){var Y=this.__data__;return this.size+=this.has(k)?0:1,Y[k]=y&&R===void 0?"__lodash_hash_undefined__":R,this};var H=T,_=u(8820),F=u(2461),v=function(k,R){var Y,G,rt=k.__data__;return((G=typeof(Y=R))=="string"||G=="number"||G=="symbol"||G=="boolean"?Y!=="__proto__":Y===null)?rt[typeof R=="string"?"string":"hash"]:rt.map};function V(k){var R=-1,Y=k==null?0:k.length;for(this.clear();++R<Y;){var G=k[R];this.set(G[0],G[1])}}V.prototype.clear=function(){this.size=0,this.__data__={hash:new H,map:new(F.A||_.A),string:new H}},V.prototype.delete=function(k){var R=v(this,k).delete(k);return this.size-=R?1:0,R},V.prototype.get=function(k){return v(this,k).get(k)},V.prototype.has=function(k){return v(this,k).has(k)},V.prototype.set=function(k,R){var Y=v(this,k),G=Y.size;return Y.set(k,R),this.size+=Y.size==G?0:1,this};var K=V},2673:function(nt,W,u){"use strict";u.d(W,{A:function(){return H}});var y=u(8820),q=u(2461),$=u(3558);function T(_){var F=this.__data__=new y.A(_);this.size=F.size}T.prototype.clear=function(){this.__data__=new y.A,this.size=0},T.prototype.delete=function(_){var F=this.__data__,v=F.delete(_);return this.size=F.size,v},T.prototype.get=function(_){return this.__data__.get(_)},T.prototype.has=function(_){return this.__data__.has(_)},T.prototype.set=function(_,F){var v=this.__data__;if(v instanceof y.A){var V=v.__data__;if(!q.A||V.length<199)return V.push([_,F]),this.size=++v.size,this;v=this.__data__=new $.A(V)}return v.set(_,F),this.size=v.size,this};var H=T},439:function(nt,W,u){"use strict";var y=u(5507).A.Symbol;W.A=y},7218:function(nt,W,u){"use strict";var y=u(5507).A.Uint8Array;W.A=y},6753:function(nt,W,u){"use strict";u.d(W,{A:function(){return F}});var y=u(8412),q=u(723),$=u(776),T=u(3767),H=u(5755),_=Object.prototype.hasOwnProperty,F=function(v,V){var K=(0,q.A)(v),k=!K&&(0,y.A)(v),R=!K&&!k&&(0,$.A)(v),Y=!K&&!k&&!R&&(0,H.A)(v),G=K||k||R||Y,rt=G?function(pt,O){for(var X=-1,dt=Array(pt);++X<pt;)dt[X]=O(X);return dt}(v.length,String):[],vt=rt.length;for(var kt in v)!V&&!_.call(v,kt)||G&&(kt=="length"||R&&(kt=="offset"||kt=="parent")||Y&&(kt=="buffer"||kt=="byteLength"||kt=="byteOffset")||(0,T.A)(kt,vt))||rt.push(kt);return rt}},802:function(nt,W){"use strict";W.A=function(u,y){for(var q=-1,$=y.length,T=u.length;++q<$;)u[T+q]=y[q];return u}},6437:function(nt,W,u){"use strict";var y=u(6770),q=u(8138),$=Object.prototype.hasOwnProperty;W.A=function(T,H,_){var F=T[H];$.call(T,H)&&(0,q.A)(F,_)&&(_!==void 0||H in T)||(0,y.A)(T,H,_)}},6770:function(nt,W,u){"use strict";var y=u(7889);W.A=function(q,$,T){$=="__proto__"&&y.A?(0,y.A)(q,$,{configurable:!0,enumerable:!0,value:T,writable:!0}):q[$]=T}},1381:function(nt,W,u){"use strict";var y=u(802),q=u(723);W.A=function($,T,H){var _=T($);return(0,q.A)($)?_:(0,y.A)(_,H($))}},2159:function(nt,W,u){"use strict";u.d(W,{A:function(){return v}});var y=u(439),q=Object.prototype,$=q.hasOwnProperty,T=q.toString,H=y.A?y.A.toStringTag:void 0,_=Object.prototype.toString,F=y.A?y.A.toStringTag:void 0,v=function(V){return V==null?V===void 0?"[object Undefined]":"[object Null]":F&&F in Object(V)?function(K){var k=$.call(K,H),R=K[H];try{K[H]=void 0;var Y=!0}catch{}var G=T.call(K);return Y&&(k?K[H]=R:delete K[H]),G}(V):function(K){return _.call(K)}(V)}},5771:function(nt,W){"use strict";W.A=function(u){return function(y){return u(y)}}},2899:function(nt,W,u){"use strict";var y=u(7218);W.A=function(q){var $=new q.constructor(q.byteLength);return new y.A($).set(new y.A(q)),$}},3812:function(nt,W,u){"use strict";var y=u(5507),q=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$=q&&typeof module=="object"&&module&&!module.nodeType&&module,T=$&&$.exports===q?y.A.Buffer:void 0,H=T?T.allocUnsafe:void 0;W.A=function(_,F){if(F)return _.slice();var v=_.length,V=H?H(v):new _.constructor(v);return _.copy(V),V}},1827:function(nt,W,u){"use strict";var y=u(2899);W.A=function(q,$){var T=$?(0,y.A)(q.buffer):q.buffer;return new q.constructor(T,q.byteOffset,q.length)}},4405:function(nt,W){"use strict";W.A=function(u,y){var q=-1,$=u.length;for(y||(y=Array($));++q<$;)y[q]=u[q];return y}},9601:function(nt,W,u){"use strict";var y=u(6437),q=u(6770);W.A=function($,T,H,_){var F=!H;H||(H={});for(var v=-1,V=T.length;++v<V;){var K=T[v],k=_?_(H[K],$[K],K,H,$):void 0;k===void 0&&(k=$[K]),F?(0,q.A)(H,K,k):(0,y.A)(H,K,k)}return H}},7889:function(nt,W,u){"use strict";var y=u(2281),q=function(){try{var $=(0,y.A)(Object,"defineProperty");return $({},"",{}),$}catch{}}();W.A=q},9646:function(nt,W){"use strict";var u=typeof global=="object"&&global&&global.Object===Object&&global;W.A=u},2816:function(nt,W,u){"use strict";var y=u(1381),q=u(9844),$=u(3169);W.A=function(T){return(0,y.A)(T,$.A,q.A)}},2281:function(nt,W,u){"use strict";u.d(W,{A:function(){return G}});var y,q=u(7572),$=u(5507).A["__core-js_shared__"],T=(y=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",H=u(659),_=u(1543),F=/^\[object .+?Constructor\]$/,v=Function.prototype,V=Object.prototype,K=v.toString,k=V.hasOwnProperty,R=RegExp("^"+K.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=function(rt){return!(!(0,H.A)(rt)||(vt=rt,T&&T in vt))&&((0,q.A)(rt)?R:F).test((0,_.A)(rt));var vt},G=function(rt,vt){var kt=function(pt,O){return pt?.[O]}(rt,vt);return Y(kt)?kt:void 0}},8769:function(nt,W,u){"use strict";var y=(0,u(2217).A)(Object.getPrototypeOf,Object);W.A=y},9844:function(nt,W,u){"use strict";u.d(W,{A:function(){return T}});var y=u(6935),q=Object.prototype.propertyIsEnumerable,$=Object.getOwnPropertySymbols,T=$?function(H){return H==null?[]:(H=Object(H),function(_,F){for(var v=-1,V=_==null?0:_.length,K=0,k=[];++v<V;){var R=_[v];F(R,v,_)&&(k[K++]=R)}return k}($(H),function(_){return q.call(H,_)}))}:y.A},7995:function(nt,W,u){"use strict";u.d(W,{A:function(){return dt}});var y=u(2281),q=u(5507),$=(0,y.A)(q.A,"DataView"),T=u(2461),H=(0,y.A)(q.A,"Promise"),_=(0,y.A)(q.A,"Set"),F=(0,y.A)(q.A,"WeakMap"),v=u(2159),V=u(1543),K="[object Map]",k="[object Promise]",R="[object Set]",Y="[object WeakMap]",G="[object DataView]",rt=(0,V.A)($),vt=(0,V.A)(T.A),kt=(0,V.A)(H),pt=(0,V.A)(_),O=(0,V.A)(F),X=v.A;($&&X(new $(new ArrayBuffer(1)))!=G||T.A&&X(new T.A)!=K||H&&X(H.resolve())!=k||_&&X(new _)!=R||F&&X(new F)!=Y)&&(X=function(Q){var at=(0,v.A)(Q),yt=at=="[object Object]"?Q.constructor:void 0,Et=yt?(0,V.A)(yt):"";if(Et)switch(Et){case rt:return G;case vt:return K;case kt:return k;case pt:return R;case O:return Y}return at});var dt=X},1683:function(nt,W,u){"use strict";u.d(W,{A:function(){return _}});var y=u(659),q=Object.create,$=function(){function F(){}return function(v){if(!(0,y.A)(v))return{};if(q)return q(v);F.prototype=v;var V=new F;return F.prototype=void 0,V}}(),T=u(8769),H=u(501),_=function(F){return typeof F.constructor!="function"||(0,H.A)(F)?{}:$((0,T.A)(F))}},3767:function(nt,W){"use strict";var u=/^(?:0|[1-9]\d*)$/;W.A=function(y,q){var $=typeof y;return!!(q=q??9007199254740991)&&($=="number"||$!="symbol"&&u.test(y))&&y>-1&&y%1==0&&y<q}},501:function(nt,W){"use strict";var u=Object.prototype;W.A=function(y){var q=y&&y.constructor;return y===(typeof q=="function"&&q.prototype||u)}},8795:function(nt,W,u){"use strict";var y=u(9646),q=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$=q&&typeof module=="object"&&module&&!module.nodeType&&module,T=$&&$.exports===q&&y.A.process,H=function(){try{return $&&$.require&&$.require("util").types||T&&T.binding&&T.binding("util")}catch{}}();W.A=H},2217:function(nt,W){"use strict";W.A=function(u,y){return function(q){return u(y(q))}}},5507:function(nt,W,u){"use strict";var y=u(9646),q=typeof self=="object"&&self&&self.Object===Object&&self,$=y.A||q||Function("return this")();W.A=$},1543:function(nt,W){"use strict";var u=Function.prototype.toString;W.A=function(y){if(y!=null){try{return u.call(y)}catch{}try{return y+""}catch{}}return""}},3707:function(nt,W,u){"use strict";u.d(W,{A:function(){return p}});var y=u(2673),q=u(6437),$=u(9601),T=u(3169),H=u(2624),_=u(3812),F=u(4405),v=u(9844),V=u(802),K=u(8769),k=u(6935),R=Object.getOwnPropertySymbols?function(x){for(var w=[];x;)(0,V.A)(w,(0,v.A)(x)),x=(0,K.A)(x);return w}:k.A,Y=u(2816),G=u(1381),rt=function(x){return(0,G.A)(x,H.A,R)},vt=u(7995),kt=Object.prototype.hasOwnProperty,pt=u(2899),O=/\w*$/,X=u(439),dt=X.A?X.A.prototype:void 0,Q=dt?dt.valueOf:void 0,at=u(1827),yt=function(x,w,I){var B,J,ot,ft=x.constructor;switch(w){case"[object ArrayBuffer]":return(0,pt.A)(x);case"[object Boolean]":case"[object Date]":return new ft(+x);case"[object DataView]":return function(gt,_t){var At=_t?(0,pt.A)(gt.buffer):gt.buffer;return new gt.constructor(At,gt.byteOffset,gt.byteLength)}(x,I);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return(0,at.A)(x,I);case"[object Map]":case"[object Set]":return new ft;case"[object Number]":case"[object String]":return new ft(x);case"[object RegExp]":return(ot=new(J=x).constructor(J.source,O.exec(J))).lastIndex=J.lastIndex,ot;case"[object Symbol]":return B=x,Q?Object(Q.call(B)):{}}},Et=u(1683),Pt=u(723),Ft=u(776),ct=u(7948),mt=u(5771),Nt=u(8795),M=Nt.A&&Nt.A.isMap,d=M?(0,mt.A)(M):function(x){return(0,ct.A)(x)&&(0,vt.A)(x)=="[object Map]"},g=u(659),f=Nt.A&&Nt.A.isSet,U=f?(0,mt.A)(f):function(x){return(0,ct.A)(x)&&(0,vt.A)(x)=="[object Set]"},A="[object Arguments]",N="[object Function]",z="[object Object]",j={};j[A]=j["[object Array]"]=j["[object ArrayBuffer]"]=j["[object DataView]"]=j["[object Boolean]"]=j["[object Date]"]=j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Map]"]=j["[object Number]"]=j[z]=j["[object RegExp]"]=j["[object Set]"]=j["[object String]"]=j["[object Symbol]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j["[object Error]"]=j[N]=j["[object WeakMap]"]=!1;var L=function x(w,I,B,J,ot,ft){var gt,_t=1&I,At=2&I,Ot=4&I;if(B&&(gt=ot?B(w,J,ot,ft):B(w)),gt!==void 0)return gt;if(!(0,g.A)(w))return w;var zt=(0,Pt.A)(w);if(zt){if(gt=function(Tt){var Ht=Tt.length,Xt=new Tt.constructor(Ht);return Ht&&typeof Tt[0]=="string"&&kt.call(Tt,"index")&&(Xt.index=Tt.index,Xt.input=Tt.input),Xt}(w),!_t)return(0,F.A)(w,gt)}else{var Rt=(0,vt.A)(w),jt=Rt==N||Rt=="[object GeneratorFunction]";if((0,Ft.A)(w))return(0,_.A)(w,_t);if(Rt==z||Rt==A||jt&&!ot){if(gt=At||jt?{}:(0,Et.A)(w),!_t)return At?function(Tt,Ht){return(0,$.A)(Tt,R(Tt),Ht)}(w,function(Tt,Ht){return Tt&&(0,$.A)(Ht,(0,H.A)(Ht),Tt)}(gt,w)):function(Tt,Ht){return(0,$.A)(Tt,(0,v.A)(Tt),Ht)}(w,function(Tt,Ht){return Tt&&(0,$.A)(Ht,(0,T.A)(Ht),Tt)}(gt,w))}else{if(!j[Rt])return ot?w:{};gt=yt(w,Rt,_t)}}ft||(ft=new y.A);var Gt=ft.get(w);if(Gt)return Gt;ft.set(w,gt),U(w)?w.forEach(function(Tt){gt.add(x(Tt,I,B,Tt,w,ft))}):d(w)&&w.forEach(function(Tt,Ht){gt.set(Ht,x(Tt,I,B,Ht,w,ft))});var oe=Ot?At?rt:Y.A:At?H.A:T.A,ie=zt?void 0:oe(w);return function(Tt,Ht){for(var Xt=-1,te=Tt==null?0:Tt.length;++Xt<te&&Ht(Tt[Xt],Xt,Tt)!==!1;);}(ie||w,function(Tt,Ht){ie&&(Tt=w[Ht=Tt]),(0,q.A)(gt,Ht,x(Tt,I,B,Ht,w,ft))}),gt},p=function(x){return L(x,5)}},8138:function(nt,W){"use strict";W.A=function(u,y){return u===y||u!=u&&y!=y}},8412:function(nt,W,u){"use strict";u.d(W,{A:function(){return v}});var y=u(2159),q=u(7948),$=function(V){return(0,q.A)(V)&&(0,y.A)(V)=="[object Arguments]"},T=Object.prototype,H=T.hasOwnProperty,_=T.propertyIsEnumerable,F=$(function(){return arguments}())?$:function(V){return(0,q.A)(V)&&H.call(V,"callee")&&!_.call(V,"callee")},v=F},723:function(nt,W){"use strict";var u=Array.isArray;W.A=u},3628:function(nt,W,u){"use strict";var y=u(7572),q=u(1628);W.A=function($){return $!=null&&(0,q.A)($.length)&&!(0,y.A)($)}},776:function(nt,W,u){"use strict";u.d(W,{A:function(){return H}});var y=u(5507),q=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$=q&&typeof module=="object"&&module&&!module.nodeType&&module,T=$&&$.exports===q?y.A.Buffer:void 0,H=(T?T.isBuffer:void 0)||function(){return!1}},5123:function(nt,W,u){"use strict";u.d(W,{A:function(){return Ft}});var y=u(2673),q=u(3558);function $(ct){var mt=-1,Nt=ct==null?0:ct.length;for(this.__data__=new q.A;++mt<Nt;)this.add(ct[mt])}$.prototype.add=$.prototype.push=function(ct){return this.__data__.set(ct,"__lodash_hash_undefined__"),this},$.prototype.has=function(ct){return this.__data__.has(ct)};var T=$,H=function(ct,mt){for(var Nt=-1,M=ct==null?0:ct.length;++Nt<M;)if(mt(ct[Nt],Nt,ct))return!0;return!1},_=function(ct,mt,Nt,M,d,g){var f=1&Nt,U=ct.length,A=mt.length;if(U!=A&&!(f&&A>U))return!1;var N=g.get(ct),z=g.get(mt);if(N&&z)return N==mt&&z==ct;var j=-1,L=!0,p=2&Nt?new T:void 0;for(g.set(ct,mt),g.set(mt,ct);++j<U;){var x=ct[j],w=mt[j];if(M)var I=f?M(w,x,j,mt,ct,g):M(x,w,j,ct,mt,g);if(I!==void 0){if(I)continue;L=!1;break}if(p){if(!H(mt,function(B,J){if(ot=J,!p.has(ot)&&(x===B||d(x,B,Nt,M,g)))return p.push(J);var ot})){L=!1;break}}else if(x!==w&&!d(x,w,Nt,M,g)){L=!1;break}}return g.delete(ct),g.delete(mt),L},F=u(439),v=u(7218),V=u(8138),K=function(ct){var mt=-1,Nt=Array(ct.size);return ct.forEach(function(M,d){Nt[++mt]=[d,M]}),Nt},k=function(ct){var mt=-1,Nt=Array(ct.size);return ct.forEach(function(M){Nt[++mt]=M}),Nt},R=F.A?F.A.prototype:void 0,Y=R?R.valueOf:void 0,G=u(2816),rt=Object.prototype.hasOwnProperty,vt=u(7995),kt=u(723),pt=u(776),O=u(5755),X="[object Arguments]",dt="[object Array]",Q="[object Object]",at=Object.prototype.hasOwnProperty,yt=function(ct,mt,Nt,M,d,g){var f=(0,kt.A)(ct),U=(0,kt.A)(mt),A=f?dt:(0,vt.A)(ct),N=U?dt:(0,vt.A)(mt),z=(A=A==X?Q:A)==Q,j=(N=N==X?Q:N)==Q,L=A==N;if(L&&(0,pt.A)(ct)){if(!(0,pt.A)(mt))return!1;f=!0,z=!1}if(L&&!z)return g||(g=new y.A),f||(0,O.A)(ct)?_(ct,mt,Nt,M,d,g):function(B,J,ot,ft,gt,_t,At){switch(ot){case"[object DataView]":if(B.byteLength!=J.byteLength||B.byteOffset!=J.byteOffset)return!1;B=B.buffer,J=J.buffer;case"[object ArrayBuffer]":return!(B.byteLength!=J.byteLength||!_t(new v.A(B),new v.A(J)));case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,V.A)(+B,+J);case"[object Error]":return B.name==J.name&&B.message==J.message;case"[object RegExp]":case"[object String]":return B==J+"";case"[object Map]":var Ot=K;case"[object Set]":var zt=1&ft;if(Ot||(Ot=k),B.size!=J.size&&!zt)return!1;var Rt=At.get(B);if(Rt)return Rt==J;ft|=2,At.set(B,J);var jt=_(Ot(B),Ot(J),ft,gt,_t,At);return At.delete(B),jt;case"[object Symbol]":if(Y)return Y.call(B)==Y.call(J)}return!1}(ct,mt,A,Nt,M,d,g);if(!(1&Nt)){var p=z&&at.call(ct,"__wrapped__"),x=j&&at.call(mt,"__wrapped__");if(p||x){var w=p?ct.value():ct,I=x?mt.value():mt;return g||(g=new y.A),d(w,I,Nt,M,g)}}return!!L&&(g||(g=new y.A),function(B,J,ot,ft,gt,_t){var At=1&ot,Ot=(0,G.A)(B),zt=Ot.length;if(zt!=(0,G.A)(J).length&&!At)return!1;for(var Rt=zt;Rt--;){var jt=Ot[Rt];if(!(At?jt in J:rt.call(J,jt)))return!1}var Gt=_t.get(B),oe=_t.get(J);if(Gt&&oe)return Gt==J&&oe==B;var ie=!0;_t.set(B,J),_t.set(J,B);for(var Tt=At;++Rt<zt;){var Ht=B[jt=Ot[Rt]],Xt=J[jt];if(ft)var te=At?ft(Xt,Ht,jt,J,B,_t):ft(Ht,Xt,jt,B,J,_t);if(!(te===void 0?Ht===Xt||gt(Ht,Xt,ot,ft,_t):te)){ie=!1;break}Tt||(Tt=jt=="constructor")}if(ie&&!Tt){var Bt=B.constructor,ae=J.constructor;Bt==ae||!("constructor"in B)||!("constructor"in J)||typeof Bt=="function"&&Bt instanceof Bt&&typeof ae=="function"&&ae instanceof ae||(ie=!1)}return _t.delete(B),_t.delete(J),ie}(ct,mt,Nt,M,d,g))},Et=u(7948),Pt=function ct(mt,Nt,M,d,g){return mt===Nt||(mt==null||Nt==null||!(0,Et.A)(mt)&&!(0,Et.A)(Nt)?mt!=mt&&Nt!=Nt:yt(mt,Nt,M,d,ct,g))},Ft=function(ct,mt){return Pt(ct,mt)}},7572:function(nt,W,u){"use strict";var y=u(2159),q=u(659);W.A=function($){if(!(0,q.A)($))return!1;var T=(0,y.A)($);return T=="[object Function]"||T=="[object GeneratorFunction]"||T=="[object AsyncFunction]"||T=="[object Proxy]"}},1628:function(nt,W){"use strict";W.A=function(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=9007199254740991}},659:function(nt,W){"use strict";W.A=function(u){var y=typeof u;return u!=null&&(y=="object"||y=="function")}},7948:function(nt,W){"use strict";W.A=function(u){return u!=null&&typeof u=="object"}},5755:function(nt,W,u){"use strict";u.d(W,{A:function(){return v}});var y=u(2159),q=u(1628),$=u(7948),T={};T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T["[object Arguments]"]=T["[object Array]"]=T["[object ArrayBuffer]"]=T["[object Boolean]"]=T["[object DataView]"]=T["[object Date]"]=T["[object Error]"]=T["[object Function]"]=T["[object Map]"]=T["[object Number]"]=T["[object Object]"]=T["[object RegExp]"]=T["[object Set]"]=T["[object String]"]=T["[object WeakMap]"]=!1;var H=u(5771),_=u(8795),F=_.A&&_.A.isTypedArray,v=F?(0,H.A)(F):function(V){return(0,$.A)(V)&&(0,q.A)(V.length)&&!!T[(0,y.A)(V)]}},3169:function(nt,W,u){"use strict";u.d(W,{A:function(){return _}});var y=u(6753),q=u(501),$=(0,u(2217).A)(Object.keys,Object),T=Object.prototype.hasOwnProperty,H=u(3628),_=function(F){return(0,H.A)(F)?(0,y.A)(F):function(v){if(!(0,q.A)(v))return $(v);var V=[];for(var K in Object(v))T.call(v,K)&&K!="constructor"&&V.push(K);return V}(F)}},2624:function(nt,W,u){"use strict";u.d(W,{A:function(){return F}});var y=u(6753),q=u(659),$=u(501),T=Object.prototype.hasOwnProperty,H=function(v){if(!(0,q.A)(v))return function(R){var Y=[];if(R!=null)for(var G in Object(R))Y.push(G);return Y}(v);var V=(0,$.A)(v),K=[];for(var k in v)(k!="constructor"||!V&&T.call(v,k))&&K.push(k);return K},_=u(3628),F=function(v){return(0,_.A)(v)?(0,y.A)(v,!0):H(v)}},8347:function(nt,W,u){"use strict";u.d(W,{A:function(){return x}});var y,q,$,T,H=u(2673),_=u(6770),F=u(8138),v=function(w,I,B){(B!==void 0&&!(0,F.A)(w[I],B)||B===void 0&&!(I in w))&&(0,_.A)(w,I,B)},V=function(w,I,B){for(var J=-1,ot=Object(w),ft=B(w),gt=ft.length;gt--;){var _t=ft[++J];if(I(ot[_t],_t,ot)===!1)break}return w},K=u(3812),k=u(1827),R=u(4405),Y=u(1683),G=u(8412),rt=u(723),vt=u(3628),kt=u(7948),pt=u(776),O=u(7572),X=u(659),dt=u(2159),Q=u(8769),at=Function.prototype,yt=Object.prototype,Et=at.toString,Pt=yt.hasOwnProperty,Ft=Et.call(Object),ct=u(5755),mt=function(w,I){if((I!=="constructor"||typeof w[I]!="function")&&I!="__proto__")return w[I]},Nt=u(9601),M=u(2624),d=function(w,I,B,J,ot,ft,gt){var _t,At=mt(w,B),Ot=mt(I,B),zt=gt.get(Ot);if(zt)v(w,B,zt);else{var Rt=ft?ft(At,Ot,B+"",w,I,gt):void 0,jt=Rt===void 0;if(jt){var Gt=(0,rt.A)(Ot),oe=!Gt&&(0,pt.A)(Ot),ie=!Gt&&!oe&&(0,ct.A)(Ot);Rt=Ot,Gt||oe||ie?(0,rt.A)(At)?Rt=At:(_t=At,(0,kt.A)(_t)&&(0,vt.A)(_t)?Rt=(0,R.A)(At):oe?(jt=!1,Rt=(0,K.A)(Ot,!0)):ie?(jt=!1,Rt=(0,k.A)(Ot,!0)):Rt=[]):function(Tt){if(!(0,kt.A)(Tt)||(0,dt.A)(Tt)!="[object Object]")return!1;var Ht=(0,Q.A)(Tt);if(Ht===null)return!0;var Xt=Pt.call(Ht,"constructor")&&Ht.constructor;return typeof Xt=="function"&&Xt instanceof Xt&&Et.call(Xt)==Ft}(Ot)||(0,G.A)(Ot)?(Rt=At,(0,G.A)(At)?Rt=function(Tt){return(0,Nt.A)(Tt,(0,M.A)(Tt))}(At):(0,X.A)(At)&&!(0,O.A)(At)||(Rt=(0,Y.A)(Ot))):jt=!1}jt&&(gt.set(Ot,Rt),ot(Rt,Ot,J,ft,gt),gt.delete(Ot)),v(w,B,Rt)}},g=function w(I,B,J,ot,ft){I!==B&&V(B,function(gt,_t){if(ft||(ft=new H.A),(0,X.A)(gt))d(I,B,_t,J,w,ot,ft);else{var At=ot?ot(mt(I,_t),gt,_t+"",I,B,ft):void 0;At===void 0&&(At=gt),v(I,_t,At)}},M.A)},f=function(w){return w},U=Math.max,A=u(7889),N=A.A?function(w,I){return(0,A.A)(w,"toString",{configurable:!0,enumerable:!1,value:(B=I,function(){return B}),writable:!0});var B}:f,z=Date.now,j=(y=N,q=0,$=0,function(){var w=z(),I=16-(w-$);if($=w,I>0){if(++q>=800)return arguments[0]}else q=0;return y.apply(void 0,arguments)}),L=function(w,I){return j(function(B,J,ot){return J=U(J===void 0?B.length-1:J,0),function(){for(var ft=arguments,gt=-1,_t=U(ft.length-J,0),At=Array(_t);++gt<_t;)At[gt]=ft[J+gt];gt=-1;for(var Ot=Array(J+1);++gt<J;)Ot[gt]=ft[gt];return Ot[J]=ot(At),function(zt,Rt,jt){switch(jt.length){case 0:return zt.call(Rt);case 1:return zt.call(Rt,jt[0]);case 2:return zt.call(Rt,jt[0],jt[1]);case 3:return zt.call(Rt,jt[0],jt[1],jt[2])}return zt.apply(Rt,jt)}(B,this,Ot)}}(w,I,f),w+"")},p=u(3767),x=(T=function(w,I,B){g(w,I,B)},L(function(w,I){var B=-1,J=I.length,ot=J>1?I[J-1]:void 0,ft=J>2?I[2]:void 0;for(ot=T.length>3&&typeof ot=="function"?(J--,ot):void 0,ft&&function(_t,At,Ot){if(!(0,X.A)(Ot))return!1;var zt=typeof At;return!!(zt=="number"?(0,vt.A)(Ot)&&(0,p.A)(At,Ot.length):zt=="string"&&At in Ot)&&(0,F.A)(Ot[At],_t)}(I[0],I[1],ft)&&(ot=J<3?void 0:ot,J=1),w=Object(w);++B<J;){var gt=I[B];gt&&T(w,gt,B)}return w}))},6935:function(nt,W){"use strict";W.A=function(){return[]}},6003:function(nt,W,u){"use strict";u.r(W),u.d(W,{Attributor:function(){return q},AttributorStore:function(){return K},BlockBlot:function(){return Q},ClassAttributor:function(){return F},ContainerBlot:function(){return yt},EmbedBlot:function(){return Et},InlineBlot:function(){return X},LeafBlot:function(){return G},ParentBlot:function(){return pt},Registry:function(){return H},Scope:function(){return y},ScrollBlot:function(){return ct},StyleAttributor:function(){return V},TextBlot:function(){return Nt}});var y=(M=>(M[M.TYPE=3]="TYPE",M[M.LEVEL=12]="LEVEL",M[M.ATTRIBUTE=13]="ATTRIBUTE",M[M.BLOT=14]="BLOT",M[M.INLINE=7]="INLINE",M[M.BLOCK=11]="BLOCK",M[M.BLOCK_BLOT=10]="BLOCK_BLOT",M[M.INLINE_BLOT=6]="INLINE_BLOT",M[M.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",M[M.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",M[M.ANY=15]="ANY",M))(y||{});class q{constructor(d,g,f={}){this.attrName=d,this.keyName=g;const U=y.TYPE&y.ATTRIBUTE;this.scope=f.scope!=null?f.scope&y.LEVEL|U:y.ATTRIBUTE,f.whitelist!=null&&(this.whitelist=f.whitelist)}static keys(d){return Array.from(d.attributes).map(g=>g.name)}add(d,g){return!!this.canAdd(d,g)&&(d.setAttribute(this.keyName,g),!0)}canAdd(d,g){return this.whitelist==null||(typeof g=="string"?this.whitelist.indexOf(g.replace(/["']/g,""))>-1:this.whitelist.indexOf(g)>-1)}remove(d){d.removeAttribute(this.keyName)}value(d){const g=d.getAttribute(this.keyName);return this.canAdd(d,g)&&g?g:""}}class $ extends Error{constructor(d){super(d="[Parchment] "+d),this.message=d,this.name=this.constructor.name}}const T=class Ps{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(d,g=!1){if(d==null)return null;if(this.blots.has(d))return this.blots.get(d)||null;if(g){let f=null;try{f=d.parentNode}catch{return null}return this.find(f,g)}return null}create(d,g,f){const U=this.query(g);if(U==null)throw new $(`Unable to create ${g} blot`);const A=U,N=g instanceof Node||g.nodeType===Node.TEXT_NODE?g:A.create(f),z=new A(d,N,f);return Ps.blots.set(z.domNode,z),z}find(d,g=!1){return Ps.find(d,g)}query(d,g=y.ANY){let f;return typeof d=="string"?f=this.types[d]||this.attributes[d]:d instanceof Text||d.nodeType===Node.TEXT_NODE?f=this.types.text:typeof d=="number"?d&y.LEVEL&y.BLOCK?f=this.types.block:d&y.LEVEL&y.INLINE&&(f=this.types.inline):d instanceof Element&&((d.getAttribute("class")||"").split(/\s+/).some(U=>(f=this.classes[U],!!f)),f=f||this.tags[d.tagName]),f==null?null:"scope"in f&&g&y.LEVEL&f.scope&&g&y.TYPE&f.scope?f:null}register(...d){return d.map(g=>{const f="blotName"in g,U="attrName"in g;if(!f&&!U)throw new $("Invalid definition");if(f&&g.blotName==="abstract")throw new $("Cannot register abstract class");const A=f?g.blotName:U?g.attrName:void 0;return this.types[A]=g,U?typeof g.keyName=="string"&&(this.attributes[g.keyName]=g):f&&(g.className&&(this.classes[g.className]=g),g.tagName&&(Array.isArray(g.tagName)?g.tagName=g.tagName.map(N=>N.toUpperCase()):g.tagName=g.tagName.toUpperCase(),(Array.isArray(g.tagName)?g.tagName:[g.tagName]).forEach(N=>{(this.tags[N]==null||g.className==null)&&(this.tags[N]=g)}))),g})}};T.blots=new WeakMap;let H=T;function _(M,d){return(M.getAttribute("class")||"").split(/\s+/).filter(g=>g.indexOf(`${d}-`)===0)}const F=class extends q{static keys(M){return(M.getAttribute("class")||"").split(/\s+/).map(d=>d.split("-").slice(0,-1).join("-"))}add(M,d){return!!this.canAdd(M,d)&&(this.remove(M),M.classList.add(`${this.keyName}-${d}`),!0)}remove(M){_(M,this.keyName).forEach(d=>{M.classList.remove(d)}),M.classList.length===0&&M.removeAttribute("class")}value(M){const d=(_(M,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(M,d)?d:""}};function v(M){const d=M.split("-"),g=d.slice(1).map(f=>f[0].toUpperCase()+f.slice(1)).join("");return d[0]+g}const V=class extends q{static keys(M){return(M.getAttribute("style")||"").split(";").map(d=>d.split(":")[0].trim())}add(M,d){return!!this.canAdd(M,d)&&(M.style[v(this.keyName)]=d,!0)}remove(M){M.style[v(this.keyName)]="",M.getAttribute("style")||M.removeAttribute("style")}value(M){const d=M.style[v(this.keyName)];return this.canAdd(M,d)?d:""}},K=class{constructor(M){this.attributes={},this.domNode=M,this.build()}attribute(M,d){d?M.add(this.domNode,d)&&(M.value(this.domNode)!=null?this.attributes[M.attrName]=M:delete this.attributes[M.attrName]):(M.remove(this.domNode),delete this.attributes[M.attrName])}build(){this.attributes={};const M=H.find(this.domNode);if(M==null)return;const d=q.keys(this.domNode),g=F.keys(this.domNode),f=V.keys(this.domNode);d.concat(g).concat(f).forEach(U=>{const A=M.scroll.query(U,y.ATTRIBUTE);A instanceof q&&(this.attributes[A.attrName]=A)})}copy(M){Object.keys(this.attributes).forEach(d=>{const g=this.attributes[d].value(this.domNode);M.format(d,g)})}move(M){this.copy(M),Object.keys(this.attributes).forEach(d=>{this.attributes[d].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((M,d)=>(M[d]=this.attributes[d].value(this.domNode),M),{})}},k=class{constructor(M,d){this.scroll=M,this.domNode=d,H.blots.set(d,this),this.prev=null,this.next=null}static create(M){if(this.tagName==null)throw new $("Blot definition missing tagName");let d,g;return Array.isArray(this.tagName)?(typeof M=="string"?(g=M.toUpperCase(),parseInt(g,10).toString()===g&&(g=parseInt(g,10))):typeof M=="number"&&(g=M),d=typeof g=="number"?document.createElement(this.tagName[g-1]):g&&this.tagName.indexOf(g)>-1?document.createElement(g):document.createElement(this.tagName[0])):d=document.createElement(this.tagName),this.className&&d.classList.add(this.className),d}get statics(){return this.constructor}attach(){}clone(){const M=this.domNode.cloneNode(!1);return this.scroll.create(M)}detach(){this.parent!=null&&this.parent.removeChild(this),H.blots.delete(this.domNode)}deleteAt(M,d){this.isolate(M,d).remove()}formatAt(M,d,g,f){const U=this.isolate(M,d);if(this.scroll.query(g,y.BLOT)!=null&&f)U.wrap(g,f);else if(this.scroll.query(g,y.ATTRIBUTE)!=null){const A=this.scroll.create(this.statics.scope);U.wrap(A),A.format(g,f)}}insertAt(M,d,g){const f=g==null?this.scroll.create("text",d):this.scroll.create(d,g),U=this.split(M);this.parent.insertBefore(f,U||void 0)}isolate(M,d){const g=this.split(M);if(g==null)throw new Error("Attempt to isolate at end");return g.split(d),g}length(){return 1}offset(M=this.parent){return this.parent==null||this===M?0:this.parent.children.offset(this)+this.parent.offset(M)}optimize(M){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(M,d){const g=typeof M=="string"?this.scroll.create(M,d):M;return this.parent!=null&&(this.parent.insertBefore(g,this.next||void 0),this.remove()),g}split(M,d){return M===0?this:this.next}update(M,d){}wrap(M,d){const g=typeof M=="string"?this.scroll.create(M,d):M;if(this.parent!=null&&this.parent.insertBefore(g,this.next||void 0),typeof g.appendChild!="function")throw new $(`Cannot wrap ${M}`);return g.appendChild(this),g}};k.blotName="abstract";let R=k;const Y=class extends R{static value(M){return!0}index(M,d){return this.domNode===M||this.domNode.compareDocumentPosition(M)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(d,1):-1}position(M,d){let g=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return M>0&&(g+=1),[this.parent.domNode,g]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Y.scope=y.INLINE_BLOT;const G=Y;class rt{constructor(){this.head=null,this.tail=null,this.length=0}append(...d){if(this.insertBefore(d[0],null),d.length>1){const g=d.slice(1);this.append(...g)}}at(d){const g=this.iterator();let f=g();for(;f&&d>0;)d-=1,f=g();return f}contains(d){const g=this.iterator();let f=g();for(;f;){if(f===d)return!0;f=g()}return!1}indexOf(d){const g=this.iterator();let f=g(),U=0;for(;f;){if(f===d)return U;U+=1,f=g()}return-1}insertBefore(d,g){d!=null&&(this.remove(d),d.next=g,g!=null?(d.prev=g.prev,g.prev!=null&&(g.prev.next=d),g.prev=d,g===this.head&&(this.head=d)):this.tail!=null?(this.tail.next=d,d.prev=this.tail,this.tail=d):(d.prev=null,this.head=this.tail=d),this.length+=1)}offset(d){let g=0,f=this.head;for(;f!=null;){if(f===d)return g;g+=f.length(),f=f.next}return-1}remove(d){this.contains(d)&&(d.prev!=null&&(d.prev.next=d.next),d.next!=null&&(d.next.prev=d.prev),d===this.head&&(this.head=d.next),d===this.tail&&(this.tail=d.prev),this.length-=1)}iterator(d=this.head){return()=>{const g=d;return d!=null&&(d=d.next),g}}find(d,g=!1){const f=this.iterator();let U=f();for(;U;){const A=U.length();if(d<A||g&&d===A&&(U.next==null||U.next.length()!==0))return[U,d];d-=A,U=f()}return[null,0]}forEach(d){const g=this.iterator();let f=g();for(;f;)d(f),f=g()}forEachAt(d,g,f){if(g<=0)return;const[U,A]=this.find(d);let N=d-A;const z=this.iterator(U);let j=z();for(;j&&N<d+g;){const L=j.length();d>N?f(j,d-N,Math.min(g,N+L-d)):f(j,0,Math.min(L,d+g-N)),N+=L,j=z()}}map(d){return this.reduce((g,f)=>(g.push(d(f)),g),[])}reduce(d,g){const f=this.iterator();let U=f();for(;U;)g=d(g,U),U=f();return g}}function vt(M,d){const g=d.find(M);if(g)return g;try{return d.create(M)}catch{const f=d.create(y.INLINE);return Array.from(M.childNodes).forEach(U=>{f.domNode.appendChild(U)}),M.parentNode&&M.parentNode.replaceChild(f.domNode,M),f.attach(),f}}const kt=class Ti extends R{constructor(d,g){super(d,g),this.uiNode=null,this.build()}appendChild(d){this.insertBefore(d)}attach(){super.attach(),this.children.forEach(d=>{d.attach()})}attachUI(d){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=d,Ti.uiClass&&this.uiNode.classList.add(Ti.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new rt,Array.from(this.domNode.childNodes).filter(d=>d!==this.uiNode).reverse().forEach(d=>{try{const g=vt(d,this.scroll);this.insertBefore(g,this.children.head||void 0)}catch(g){if(g instanceof $)return;throw g}})}deleteAt(d,g){if(d===0&&g===this.length())return this.remove();this.children.forEachAt(d,g,(f,U,A)=>{f.deleteAt(U,A)})}descendant(d,g=0){const[f,U]=this.children.find(g);return d.blotName==null&&d(f)||d.blotName!=null&&f instanceof d?[f,U]:f instanceof Ti?f.descendant(d,U):[null,-1]}descendants(d,g=0,f=Number.MAX_VALUE){let U=[],A=f;return this.children.forEachAt(g,f,(N,z,j)=>{(d.blotName==null&&d(N)||d.blotName!=null&&N instanceof d)&&U.push(N),N instanceof Ti&&(U=U.concat(N.descendants(d,z,A))),A-=j}),U}detach(){this.children.forEach(d=>{d.detach()}),super.detach()}enforceAllowedChildren(){let d=!1;this.children.forEach(g=>{d||this.statics.allowedChildren.some(f=>g instanceof f)||(g.statics.scope===y.BLOCK_BLOT?(g.next!=null&&this.splitAfter(g),g.prev!=null&&this.splitAfter(g.prev),g.parent.unwrap(),d=!0):g instanceof Ti?g.unwrap():g.remove())})}formatAt(d,g,f,U){this.children.forEachAt(d,g,(A,N,z)=>{A.formatAt(N,z,f,U)})}insertAt(d,g,f){const[U,A]=this.children.find(d);if(U)U.insertAt(A,g,f);else{const N=f==null?this.scroll.create("text",g):this.scroll.create(g,f);this.appendChild(N)}}insertBefore(d,g){d.parent!=null&&d.parent.children.remove(d);let f=null;this.children.insertBefore(d,g||null),d.parent=this,g!=null&&(f=g.domNode),(this.domNode.parentNode!==d.domNode||this.domNode.nextSibling!==f)&&this.domNode.insertBefore(d.domNode,f),d.attach()}length(){return this.children.reduce((d,g)=>d+g.length(),0)}moveChildren(d,g){this.children.forEach(f=>{d.insertBefore(f,g)})}optimize(d){if(super.optimize(d),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const g=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(g)}else this.remove()}path(d,g=!1){const[f,U]=this.children.find(d,g),A=[[this,d]];return f instanceof Ti?A.concat(f.path(U,g)):(f!=null&&A.push([f,U]),A)}removeChild(d){this.children.remove(d)}replaceWith(d,g){const f=typeof d=="string"?this.scroll.create(d,g):d;return f instanceof Ti&&this.moveChildren(f),super.replaceWith(f)}split(d,g=!1){if(!g){if(d===0)return this;if(d===this.length())return this.next}const f=this.clone();return this.parent&&this.parent.insertBefore(f,this.next||void 0),this.children.forEachAt(d,this.length(),(U,A,N)=>{const z=U.split(A,g);z!=null&&f.appendChild(z)}),f}splitAfter(d){const g=this.clone();for(;d.next!=null;)g.appendChild(d.next);return this.parent&&this.parent.insertBefore(g,this.next||void 0),g}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(d,g){const f=[],U=[];d.forEach(A=>{A.target===this.domNode&&A.type==="childList"&&(f.push(...A.addedNodes),U.push(...A.removedNodes))}),U.forEach(A=>{if(A.parentNode!=null&&A.tagName!=="IFRAME"&&document.body.compareDocumentPosition(A)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const N=this.scroll.find(A);N!=null&&(N.domNode.parentNode==null||N.domNode.parentNode===this.domNode)&&N.detach()}),f.filter(A=>A.parentNode===this.domNode&&A!==this.uiNode).sort((A,N)=>A===N?0:A.compareDocumentPosition(N)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(A=>{let N=null;A.nextSibling!=null&&(N=this.scroll.find(A.nextSibling));const z=vt(A,this.scroll);(z.next!==N||z.next==null)&&(z.parent!=null&&z.parent.removeChild(this),this.insertBefore(z,N||void 0))}),this.enforceAllowedChildren()}};kt.uiClass="";const pt=kt,O=class tn extends pt{static create(d){return super.create(d)}static formats(d,g){const f=g.query(tn.blotName);if(f==null||d.tagName!==f.tagName){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return d.tagName.toLowerCase()}}constructor(d,g){super(d,g),this.attributes=new K(this.domNode)}format(d,g){if(d!==this.statics.blotName||g){const f=this.scroll.query(d,y.INLINE);if(f==null)return;f instanceof q?this.attributes.attribute(f,g):g&&(d!==this.statics.blotName||this.formats()[d]!==g)&&this.replaceWith(d,g)}else this.children.forEach(f=>{f instanceof tn||(f=f.wrap(tn.blotName,!0)),this.attributes.copy(f)}),this.unwrap()}formats(){const d=this.attributes.values(),g=this.statics.formats(this.domNode,this.scroll);return g!=null&&(d[this.statics.blotName]=g),d}formatAt(d,g,f,U){this.formats()[f]!=null||this.scroll.query(f,y.ATTRIBUTE)?this.isolate(d,g).format(f,U):super.formatAt(d,g,f,U)}optimize(d){super.optimize(d);const g=this.formats();if(Object.keys(g).length===0)return this.unwrap();const f=this.next;f instanceof tn&&f.prev===this&&function(U,A){if(Object.keys(U).length!==Object.keys(A).length)return!1;for(const N in U)if(U[N]!==A[N])return!1;return!0}(g,f.formats())&&(f.moveChildren(this),f.remove())}replaceWith(d,g){const f=super.replaceWith(d,g);return this.attributes.copy(f),f}update(d,g){super.update(d,g),d.some(f=>f.target===this.domNode&&f.type==="attributes")&&this.attributes.build()}wrap(d,g){const f=super.wrap(d,g);return f instanceof tn&&this.attributes.move(f),f}};O.allowedChildren=[O,G],O.blotName="inline",O.scope=y.INLINE_BLOT,O.tagName="SPAN";const X=O,dt=class Rs extends pt{static create(d){return super.create(d)}static formats(d,g){const f=g.query(Rs.blotName);if(f==null||d.tagName!==f.tagName){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return d.tagName.toLowerCase()}}constructor(d,g){super(d,g),this.attributes=new K(this.domNode)}format(d,g){const f=this.scroll.query(d,y.BLOCK);f!=null&&(f instanceof q?this.attributes.attribute(f,g):d!==this.statics.blotName||g?g&&(d!==this.statics.blotName||this.formats()[d]!==g)&&this.replaceWith(d,g):this.replaceWith(Rs.blotName))}formats(){const d=this.attributes.values(),g=this.statics.formats(this.domNode,this.scroll);return g!=null&&(d[this.statics.blotName]=g),d}formatAt(d,g,f,U){this.scroll.query(f,y.BLOCK)!=null?this.format(f,U):super.formatAt(d,g,f,U)}insertAt(d,g,f){if(f==null||this.scroll.query(g,y.INLINE)!=null)super.insertAt(d,g,f);else{const U=this.split(d);if(U==null)throw new Error("Attempt to insertAt after block boundaries");{const A=this.scroll.create(g,f);U.parent.insertBefore(A,U)}}}replaceWith(d,g){const f=super.replaceWith(d,g);return this.attributes.copy(f),f}update(d,g){super.update(d,g),d.some(f=>f.target===this.domNode&&f.type==="attributes")&&this.attributes.build()}};dt.blotName="block",dt.scope=y.BLOCK_BLOT,dt.tagName="P",dt.allowedChildren=[X,dt,G];const Q=dt,at=class extends pt{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(M,d){super.deleteAt(M,d),this.enforceAllowedChildren()}formatAt(M,d,g,f){super.formatAt(M,d,g,f),this.enforceAllowedChildren()}insertAt(M,d,g){super.insertAt(M,d,g),this.enforceAllowedChildren()}optimize(M){super.optimize(M),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};at.blotName="container",at.scope=y.BLOCK_BLOT;const yt=at,Et=class extends G{static formats(M,d){}format(M,d){super.formatAt(0,this.length(),M,d)}formatAt(M,d,g,f){M===0&&d===this.length()?this.format(g,f):super.formatAt(M,d,g,f)}formats(){return this.statics.formats(this.domNode,this.scroll)}},Pt={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Ft=class extends pt{constructor(M,d){super(null,d),this.registry=M,this.scroll=this,this.build(),this.observer=new MutationObserver(g=>{this.update(g)}),this.observer.observe(this.domNode,Pt),this.attach()}create(M,d){return this.registry.create(this,M,d)}find(M,d=!1){const g=this.registry.find(M,d);return g?g.scroll===this?g:d?this.find(g.scroll.domNode.parentNode,!0):null:null}query(M,d=y.ANY){return this.registry.query(M,d)}register(...M){return this.registry.register(...M)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(M,d){this.update(),M===0&&d===this.length()?this.children.forEach(g=>{g.remove()}):super.deleteAt(M,d)}formatAt(M,d,g,f){this.update(),super.formatAt(M,d,g,f)}insertAt(M,d,g){this.update(),super.insertAt(M,d,g)}optimize(M=[],d={}){super.optimize(d);const g=d.mutationsMap||new WeakMap;let f=Array.from(this.observer.takeRecords());for(;f.length>0;)M.push(f.pop());const U=(z,j=!0)=>{z==null||z===this||z.domNode.parentNode!=null&&(g.has(z.domNode)||g.set(z.domNode,[]),j&&U(z.parent))},A=z=>{g.has(z.domNode)&&(z instanceof pt&&z.children.forEach(A),g.delete(z.domNode),z.optimize(d))};let N=M;for(let z=0;N.length>0;z+=1){if(z>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(N.forEach(j=>{const L=this.find(j.target,!0);L!=null&&(L.domNode===j.target&&(j.type==="childList"?(U(this.find(j.previousSibling,!1)),Array.from(j.addedNodes).forEach(p=>{const x=this.find(p,!1);U(x,!1),x instanceof pt&&x.children.forEach(w=>{U(w,!1)})})):j.type==="attributes"&&U(L.prev)),U(L))}),this.children.forEach(A),N=Array.from(this.observer.takeRecords()),f=N.slice();f.length>0;)M.push(f.pop())}}update(M,d={}){M=M||this.observer.takeRecords();const g=new WeakMap;M.map(f=>{const U=this.find(f.target,!0);return U==null?null:g.has(U.domNode)?(g.get(U.domNode).push(f),null):(g.set(U.domNode,[f]),U)}).forEach(f=>{f!=null&&f!==this&&g.has(f.domNode)&&f.update(g.get(f.domNode)||[],d)}),d.mutationsMap=g,g.has(this.domNode)&&super.update(g.get(this.domNode),d),this.optimize(M,d)}};Ft.blotName="scroll",Ft.defaultChild=Q,Ft.allowedChildren=[Q,yt],Ft.scope=y.BLOCK_BLOT,Ft.tagName="DIV";const ct=Ft,mt=class No extends G{static create(d){return document.createTextNode(d)}static value(d){return d.data}constructor(d,g){super(d,g),this.text=this.statics.value(this.domNode)}deleteAt(d,g){this.domNode.data=this.text=this.text.slice(0,d)+this.text.slice(d+g)}index(d,g){return this.domNode===d?g:-1}insertAt(d,g,f){f==null?(this.text=this.text.slice(0,d)+g+this.text.slice(d),this.domNode.data=this.text):super.insertAt(d,g,f)}length(){return this.text.length}optimize(d){super.optimize(d),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof No&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(d,g=!1){return[this.domNode,d]}split(d,g=!1){if(!g){if(d===0)return this;if(d===this.length())return this.next}const f=this.scroll.create(this.domNode.splitText(d));return this.parent.insertBefore(f,this.next||void 0),this.text=this.statics.value(this.domNode),f}update(d,g){d.some(f=>f.type==="characterData"&&f.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};mt.blotName="text",mt.scope=y.INLINE_BLOT;const Nt=mt}},Qe={};function It(nt){var W=Qe[nt];if(W!==void 0)return W.exports;var u=Qe[nt]={id:nt,loaded:!1,exports:{}};return De[nt](u,u.exports,It),u.loaded=!0,u.exports}It.n=function(nt){var W=nt&&nt.__esModule?function(){return nt.default}:function(){return nt};return It.d(W,{a:W}),W},It.d=function(nt,W){for(var u in W)It.o(W,u)&&!It.o(nt,u)&&Object.defineProperty(nt,u,{enumerable:!0,get:W[u]})},It.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),It.o=function(nt,W){return Object.prototype.hasOwnProperty.call(nt,W)},It.r=function(nt){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(nt,"__esModule",{value:!0})},It.nmd=function(nt){return nt.paths=[],nt.children||(nt.children=[]),nt};var be={};return function(){"use strict";It.d(be,{default:function(){return ui}});var nt=It(3729),W=It(8276),u=It(7912),y=It(6003);class q extends y.ClassAttributor{add(b,S){let tt=0;if(S==="+1"||S==="-1"){const bt=this.value(b)||0;tt=S==="+1"?bt+1:bt-1}else typeof S=="number"&&(tt=S);return tt===0?(this.remove(b),!0):super.add(b,tt.toString())}canAdd(b,S){return super.canAdd(b,S)||super.canAdd(b,parseInt(S,10))}value(b){return parseInt(super.value(b),10)||void 0}}var $=new q("indent","ql-indent",{scope:y.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]}),T=It(9698);class H extends T.Ay{static blotName="blockquote";static tagName="blockquote"}var _=H;class F extends T.Ay{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(b){return this.tagName.indexOf(b.tagName)+1}}var v=F,V=It(580),K=It(6142);class k extends V.A{}k.blotName="list-container",k.tagName="OL";class R extends T.Ay{static create(b){const S=super.create();return S.setAttribute("data-list",b),S}static formats(b){return b.getAttribute("data-list")||void 0}static register(){K.Ay.register(k)}constructor(b,S){super(b,S);const tt=S.ownerDocument.createElement("span"),bt=St=>{if(!b.isEnabled())return;const Vt=this.statics.formats(S,b);Vt==="checked"?(this.format("list","unchecked"),St.preventDefault()):Vt==="unchecked"&&(this.format("list","checked"),St.preventDefault())};tt.addEventListener("mousedown",bt),tt.addEventListener("touchstart",bt),this.attachUI(tt)}format(b,S){b===this.statics.blotName&&S?this.domNode.setAttribute("data-list",S):super.format(b,S)}}R.blotName="list",R.tagName="LI",k.allowedChildren=[R],R.requiredContainer=k;var Y=It(9541),G=It(8638),rt=It(6772),vt=It(664),kt=It(4850);class pt extends kt.A{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(b){super.optimize(b),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}var O=pt;class X extends kt.A{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(b){const S=super.create(b);return S.setAttribute("href",this.sanitize(b)),S.setAttribute("rel","noopener noreferrer"),S.setAttribute("target","_blank"),S}static formats(b){return b.getAttribute("href")}static sanitize(b){return dt(b,this.PROTOCOL_WHITELIST)?b:this.SANITIZED_URL}format(b,S){b===this.statics.blotName&&S?this.domNode.setAttribute("href",this.constructor.sanitize(S)):super.format(b,S)}}function dt(ut,b){const S=document.createElement("a");S.href=ut;const tt=S.href.slice(0,S.href.indexOf(":"));return b.indexOf(tt)>-1}class Q extends kt.A{static blotName="script";static tagName=["SUB","SUP"];static create(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):super.create(b)}static formats(b){return b.tagName==="SUB"?"sub":b.tagName==="SUP"?"super":void 0}}var at=Q;class yt extends kt.A{static blotName="underline";static tagName="U"}var Et=yt,Pt=It(746);class Ft extends Pt.A{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(b){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const S=super.create(b);return typeof b=="string"&&(window.katex.render(b,S,{throwOnError:!1,errorColor:"#f00"}),S.setAttribute("data-value",b)),S}static value(b){return b.getAttribute("data-value")}html(){const{formula:b}=this.value();return`<span>${b}</span>`}}var ct=Ft;const mt=["alt","height","width"];class Nt extends y.EmbedBlot{static blotName="image";static tagName="IMG";static create(b){const S=super.create(b);return typeof b=="string"&&S.setAttribute("src",this.sanitize(b)),S}static formats(b){return mt.reduce((S,tt)=>(b.hasAttribute(tt)&&(S[tt]=b.getAttribute(tt)),S),{})}static match(b){return/\.(jpe?g|gif|png)$/.test(b)||/^data:image\/.+;base64/.test(b)}static sanitize(b){return dt(b,["http","https","data"])?b:"//:0"}static value(b){return b.getAttribute("src")}format(b,S){mt.indexOf(b)>-1?S?this.domNode.setAttribute(b,S):this.domNode.removeAttribute(b):super.format(b,S)}}var M=Nt;const d=["height","width"];class g extends T.zo{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(b){const S=super.create(b);return S.setAttribute("frameborder","0"),S.setAttribute("allowfullscreen","true"),S.setAttribute("src",this.sanitize(b)),S}static formats(b){return d.reduce((S,tt)=>(b.hasAttribute(tt)&&(S[tt]=b.getAttribute(tt)),S),{})}static sanitize(b){return X.sanitize(b)}static value(b){return b.getAttribute("src")}format(b,S){d.indexOf(b)>-1?S?this.domNode.setAttribute(b,S):this.domNode.removeAttribute(b):super.format(b,S)}html(){const{video:b}=this.value();return`<a href="${b}">${b}</a>`}}var f=g,U=It(9404),A=It(5232),N=It.n(A),z=It(4266),j=It(3036),L=It(4541),p=It(5508),x=It(584);const w=new y.ClassAttributor("code-token","hljs",{scope:y.Scope.INLINE});class I extends kt.A{static formats(b,S){for(;b!=null&&b!==S.domNode;){if(b.classList&&b.classList.contains(U.Ay.className))return super.formats(b,S);b=b.parentNode}}constructor(b,S,tt){super(b,S,tt),w.add(this.domNode,tt)}format(b,S){b!==I.blotName?super.format(b,S):S?w.add(this.domNode,S):(w.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),w.value(this.domNode)||this.unwrap()}}I.blotName="code-token",I.className="ql-token";class B extends U.Ay{static create(b){const S=super.create(b);return typeof b=="string"&&S.setAttribute("data-language",b),S}static formats(b){return b.getAttribute("data-language")||"plain"}static register(){}format(b,S){b===this.statics.blotName&&S?this.domNode.setAttribute("data-language",S):super.format(b,S)}replaceWith(b,S){return this.formatAt(0,this.length(),I.blotName,!1),super.replaceWith(b,S)}}class J extends U.EJ{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(b,S){b===B.blotName&&(this.forceNext=!0,this.children.forEach(tt=>{tt.format(b,S)}))}formatAt(b,S,tt,bt){tt===B.blotName&&(this.forceNext=!0),super.formatAt(b,S,tt,bt)}highlight(b){let S=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.children.head==null)return;const tt=`${Array.from(this.domNode.childNodes).filter(St=>St!==this.uiNode).map(St=>St.textContent).join(`
`)}
`,bt=B.formats(this.children.head.domNode);if(S||this.forceNext||this.cachedText!==tt){if(tt.trim().length>0||this.cachedText==null){const St=this.children.reduce((Zt,xe)=>Zt.concat((0,T.mG)(xe,!1)),new(N())),Vt=b(tt,bt);St.diff(Vt).reduce((Zt,xe)=>{let{retain:Me,attributes:je}=xe;return Me?(je&&Object.keys(je).forEach(Xe=>{[B.blotName,I.blotName].includes(Xe)&&this.formatAt(Zt,Me,Xe,je[Xe])}),Zt+Me):Zt},0)}this.cachedText=tt,this.forceNext=!1}}html(b,S){const[tt]=this.children.find(b);return`<pre data-language="${tt?B.formats(tt.domNode):"plain"}">
${(0,p.X)(this.code(b,S))}
</pre>`}optimize(b){if(super.optimize(b),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const S=B.formats(this.children.head.domNode);S!==this.uiNode.value&&(this.uiNode.value=S)}}}J.allowedChildren=[B],B.requiredContainer=J,B.allowedChildren=[I,L.A,p.A,j.A];class ot extends z.A{static register(){K.Ay.register(I,!0),K.Ay.register(B,!0),K.Ay.register(J,!0)}constructor(b,S){if(super(b,S),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((tt,bt)=>{let{key:St}=bt;return tt[St]=!0,tt},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(K.Ay.events.SCROLL_BLOT_MOUNT,b=>{if(!(b instanceof J))return;const S=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(tt=>{let{key:bt,label:St}=tt;const Vt=S.ownerDocument.createElement("option");Vt.textContent=St,Vt.setAttribute("value",bt),S.appendChild(Vt)}),S.addEventListener("change",()=>{b.format(B.blotName,S.value),this.quill.root.focus(),this.highlight(b,!0)}),b.uiNode==null&&(b.attachUI(S),b.children.head&&(S.value=B.formats(b.children.head.domNode)))})}initTimer(){let b=null;this.quill.on(K.Ay.events.SCROLL_OPTIMIZE,()=>{b&&clearTimeout(b),b=setTimeout(()=>{this.highlight(),b=null},this.options.interval)})}highlight(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,S=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.quill.selection.composing)return;this.quill.update(K.Ay.sources.USER);const tt=this.quill.getSelection();(b==null?this.quill.scroll.descendants(J):[b]).forEach(bt=>{bt.highlight(this.highlightBlot,S)}),this.quill.update(K.Ay.sources.SILENT),tt!=null&&this.quill.setSelection(tt,K.Ay.sources.SILENT)}highlightBlot(b){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(S=this.languages[S]?S:"plain",S==="plain")return(0,p.X)(b).split(`
`).reduce((bt,St,Vt)=>(Vt!==0&&bt.insert(`
`,{[U.Ay.blotName]:S}),bt.insert(St)),new(N()));const tt=this.quill.root.ownerDocument.createElement("div");return tt.classList.add(U.Ay.className),tt.innerHTML=((bt,St,Vt)=>{if(typeof bt.versionString=="string"){const Zt=bt.versionString.split(".")[0];if(parseInt(Zt,10)>=11)return bt.highlight(Vt,{language:St}).value}return bt.highlight(St,Vt).value})(this.options.hljs,S,b),(0,x.hV)(this.quill.scroll,tt,[(bt,St)=>{const Vt=w.value(bt);return Vt?St.compose(new(N())().retain(St.length(),{[I.blotName]:Vt})):St}],[(bt,St)=>bt.data.split(`
`).reduce((Vt,Zt,xe)=>(xe!==0&&Vt.insert(`
`,{[U.Ay.blotName]:S}),Vt.insert(Zt)),St)],new WeakMap)}}ot.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class ft extends T.Ay{static blotName="table";static tagName="TD";static create(b){const S=super.create();return b?S.setAttribute("data-row",b):S.setAttribute("data-row",Ot()),S}static formats(b){if(b.hasAttribute("data-row"))return b.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(b,S){b===ft.blotName&&S?this.domNode.setAttribute("data-row",S):super.format(b,S)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class gt extends V.A{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const b=this.children.head.formats(),S=this.children.tail.formats(),tt=this.next.children.head.formats(),bt=this.next.children.tail.formats();return b.table===S.table&&b.table===tt.table&&b.table===bt.table}return!1}optimize(b){super.optimize(b),this.children.forEach(S=>{if(S.next==null)return;const tt=S.formats(),bt=S.next.formats();if(tt.table!==bt.table){const St=this.splitAfter(S);St&&St.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class _t extends V.A{static blotName="table-body";static tagName="TBODY"}class At extends V.A{static blotName="table-container";static tagName="TABLE";balanceCells(){const b=this.descendants(gt),S=b.reduce((tt,bt)=>Math.max(bt.children.length,tt),0);b.forEach(tt=>{new Array(S-tt.children.length).fill(0).forEach(()=>{let bt;tt.children.head!=null&&(bt=ft.formats(tt.children.head.domNode));const St=this.scroll.create(ft.blotName,bt);tt.appendChild(St),St.optimize()})})}cells(b){return this.rows().map(S=>S.children.at(b))}deleteColumn(b){const[S]=this.descendant(_t);S!=null&&S.children.head!=null&&S.children.forEach(tt=>{const bt=tt.children.at(b);bt?.remove()})}insertColumn(b){const[S]=this.descendant(_t);S!=null&&S.children.head!=null&&S.children.forEach(tt=>{const bt=tt.children.at(b),St=ft.formats(tt.children.head.domNode),Vt=this.scroll.create(ft.blotName,St);tt.insertBefore(Vt,bt)})}insertRow(b){const[S]=this.descendant(_t);if(S==null||S.children.head==null)return;const tt=Ot(),bt=this.scroll.create(gt.blotName);S.children.head.children.forEach(()=>{const Vt=this.scroll.create(ft.blotName,tt);bt.appendChild(Vt)});const St=S.children.at(b);S.insertBefore(bt,St)}rows(){const b=this.children.head;return b==null?[]:b.children.map(S=>S)}}function Ot(){return`row-${Math.random().toString(36).slice(2,6)}`}At.allowedChildren=[_t],_t.requiredContainer=At,_t.allowedChildren=[gt],gt.requiredContainer=_t,gt.allowedChildren=[ft],ft.requiredContainer=gt;class zt extends z.A{static register(){K.Ay.register(ft),K.Ay.register(gt),K.Ay.register(_t),K.Ay.register(At)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(At).forEach(b=>{b.balanceCells()})}deleteColumn(){const[b,,S]=this.getTable();S!=null&&(b.deleteColumn(S.cellOffset()),this.quill.update(K.Ay.sources.USER))}deleteRow(){const[,b]=this.getTable();b!=null&&(b.remove(),this.quill.update(K.Ay.sources.USER))}deleteTable(){const[b]=this.getTable();if(b==null)return;const S=b.offset();b.remove(),this.quill.update(K.Ay.sources.USER),this.quill.setSelection(S,K.Ay.sources.SILENT)}getTable(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(b==null)return[null,null,null,-1];const[S,tt]=this.quill.getLine(b.index);if(S==null||S.statics.blotName!==ft.blotName)return[null,null,null,-1];const bt=S.parent;return[bt.parent.parent,bt,S,tt]}insertColumn(b){const S=this.quill.getSelection();if(!S)return;const[tt,bt,St]=this.getTable(S);if(St==null)return;const Vt=St.cellOffset();tt.insertColumn(Vt+b),this.quill.update(K.Ay.sources.USER);let Zt=bt.rowOffset();b===0&&(Zt+=1),this.quill.setSelection(S.index+Zt,S.length,K.Ay.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(b){const S=this.quill.getSelection();if(!S)return;const[tt,bt,St]=this.getTable(S);if(St==null)return;const Vt=bt.rowOffset();tt.insertRow(Vt+b),this.quill.update(K.Ay.sources.USER),b>0?this.quill.setSelection(S,K.Ay.sources.SILENT):this.quill.setSelection(S.index+bt.children.length,S.length,K.Ay.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(b,S){const tt=this.quill.getSelection();if(tt==null)return;const bt=new Array(b).fill(0).reduce(St=>{const Vt=new Array(S).fill(`
`).join("");return St.insert(Vt,{table:Ot()})},new(N())().retain(tt.index));this.quill.updateContents(bt,K.Ay.sources.USER),this.quill.setSelection(tt.index,K.Ay.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(K.Ay.events.SCROLL_OPTIMIZE,b=>{b.some(S=>!!["TD","TR","TBODY","TABLE"].includes(S.target.tagName)&&(this.quill.once(K.Ay.events.TEXT_CHANGE,(tt,bt,St)=>{St===K.Ay.sources.USER&&this.balanceTables()}),!0))})}}var Rt=zt;const jt=(0,It(6078).A)("quill:toolbar");class Gt extends z.A{constructor(b,S){if(super(b,S),Array.isArray(this.options.container)){const tt=document.createElement("div");tt.setAttribute("role","toolbar"),function(bt,St){Array.isArray(St[0])||(St=[St]),St.forEach(Vt=>{const Zt=document.createElement("span");Zt.classList.add("ql-formats"),Vt.forEach(xe=>{if(typeof xe=="string")oe(Zt,xe);else{const Me=Object.keys(xe)[0],je=xe[Me];Array.isArray(je)?function(Xe,pi,Ge){const ai=document.createElement("select");ai.classList.add(`ql-${pi}`),Ge.forEach(it=>{const C=document.createElement("option");it!==!1?C.setAttribute("value",String(it)):C.setAttribute("selected","selected"),ai.appendChild(C)}),Xe.appendChild(ai)}(Zt,Me,je):oe(Zt,Me,je)}}),bt.appendChild(Zt)})}(tt,this.options.container),b.container?.parentNode?.insertBefore(tt,b.container),this.container=tt}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;this.container instanceof HTMLElement?(this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(tt=>{const bt=this.options.handlers?.[tt];bt&&this.addHandler(tt,bt)}),Array.from(this.container.querySelectorAll("button, select")).forEach(tt=>{this.attach(tt)}),this.quill.on(K.Ay.events.EDITOR_CHANGE,()=>{const[tt]=this.quill.selection.getRange();this.update(tt)})):jt.error("Container required for toolbar",this.options)}addHandler(b,S){this.handlers[b]=S}attach(b){let S=Array.from(b.classList).find(bt=>bt.indexOf("ql-")===0);if(!S)return;if(S=S.slice(3),b.tagName==="BUTTON"&&b.setAttribute("type","button"),this.handlers[S]==null&&this.quill.scroll.query(S)==null)return void jt.warn("ignoring attaching to nonexistent format",S,b);const tt=b.tagName==="SELECT"?"change":"click";b.addEventListener(tt,bt=>{let St;if(b.tagName==="SELECT"){if(b.selectedIndex<0)return;const Zt=b.options[b.selectedIndex];St=!Zt.hasAttribute("selected")&&(Zt.value||!1)}else St=!b.classList.contains("ql-active")&&(b.value||!b.hasAttribute("value")),bt.preventDefault();this.quill.focus();const[Vt]=this.quill.selection.getRange();if(this.handlers[S]!=null)this.handlers[S].call(this,St);else if(this.quill.scroll.query(S).prototype instanceof y.EmbedBlot){if(St=prompt(`Enter ${S}`),!St)return;this.quill.updateContents(new(N())().retain(Vt.index).delete(Vt.length).insert({[S]:St}),K.Ay.sources.USER)}else this.quill.format(S,St,K.Ay.sources.USER);this.update(Vt)}),this.controls.push([S,b])}update(b){const S=b==null?{}:this.quill.getFormat(b);this.controls.forEach(tt=>{const[bt,St]=tt;if(St.tagName==="SELECT"){let Vt=null;if(b==null)Vt=null;else if(S[bt]==null)Vt=St.querySelector("option[selected]");else if(!Array.isArray(S[bt])){let Zt=S[bt];typeof Zt=="string"&&(Zt=Zt.replace(/"/g,'\\"')),Vt=St.querySelector(`option[value="${Zt}"]`)}Vt==null?(St.value="",St.selectedIndex=-1):Vt.selected=!0}else if(b==null)St.classList.remove("ql-active"),St.setAttribute("aria-pressed","false");else if(St.hasAttribute("value")){const Vt=S[bt],Zt=Vt===St.getAttribute("value")||Vt!=null&&Vt.toString()===St.getAttribute("value")||Vt==null&&!St.getAttribute("value");St.classList.toggle("ql-active",Zt),St.setAttribute("aria-pressed",Zt.toString())}else{const Vt=S[bt]!=null;St.classList.toggle("ql-active",Vt),St.setAttribute("aria-pressed",Vt.toString())}})}}function oe(ut,b,S){const tt=document.createElement("button");tt.setAttribute("type","button"),tt.classList.add(`ql-${b}`),tt.setAttribute("aria-pressed","false"),S!=null?(tt.value=S,tt.setAttribute("aria-label",`${b}: ${S}`)):tt.setAttribute("aria-label",b),ut.appendChild(tt)}Gt.DEFAULTS={},Gt.DEFAULTS={container:null,handlers:{clean(){const ut=this.quill.getSelection();if(ut!=null)if(ut.length===0){const b=this.quill.getFormat();Object.keys(b).forEach(S=>{this.quill.scroll.query(S,y.Scope.INLINE)!=null&&this.quill.format(S,!1,K.Ay.sources.USER)})}else this.quill.removeFormat(ut.index,ut.length,K.Ay.sources.USER)},direction(ut){const{align:b}=this.quill.getFormat();ut==="rtl"&&b==null?this.quill.format("align","right",K.Ay.sources.USER):ut||b!=="right"||this.quill.format("align",!1,K.Ay.sources.USER),this.quill.format("direction",ut,K.Ay.sources.USER)},indent(ut){const b=this.quill.getSelection(),S=this.quill.getFormat(b),tt=parseInt(S.indent||0,10);if(ut==="+1"||ut==="-1"){let bt=ut==="+1"?1:-1;S.direction==="rtl"&&(bt*=-1),this.quill.format("indent",tt+bt,K.Ay.sources.USER)}},link(ut){ut===!0&&(ut=prompt("Enter link URL:")),this.quill.format("link",ut,K.Ay.sources.USER)},list(ut){const b=this.quill.getSelection(),S=this.quill.getFormat(b);ut==="check"?S.list==="checked"||S.list==="unchecked"?this.quill.format("list",!1,K.Ay.sources.USER):this.quill.format("list","unchecked",K.Ay.sources.USER):this.quill.format("list",ut,K.Ay.sources.USER)}}};const ie='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>';var Tt={align:{"":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',center:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',right:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',justify:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>'},background:'<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',blockquote:'<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',bold:'<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',clean:'<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',code:ie,"code-block":ie,color:'<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',direction:{"":'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',rtl:'<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>'},formula:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',header:{1:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',2:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',3:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',4:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',5:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',6:'<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>'},italic:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',image:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',indent:{"+1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',"-1":'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>'},link:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',list:{bullet:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',check:'<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',ordered:'<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>'},script:{sub:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',super:'<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>'},strike:'<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',table:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',underline:'<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',video:'<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>'};let Ht=0;function Xt(ut,b){ut.setAttribute(b,`${ut.getAttribute(b)!=="true"}`)}var te=class{constructor(ut){this.select=ut,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",b=>{switch(b.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),b.preventDefault()}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Xt(this.label,"aria-expanded"),Xt(this.options,"aria-hidden")}buildItem(ut){const b=document.createElement("span");b.tabIndex="0",b.setAttribute("role","button"),b.classList.add("ql-picker-item");const S=ut.getAttribute("value");return S&&b.setAttribute("data-value",S),ut.textContent&&b.setAttribute("data-label",ut.textContent),b.addEventListener("click",()=>{this.selectItem(b,!0)}),b.addEventListener("keydown",tt=>{switch(tt.key){case"Enter":this.selectItem(b,!0),tt.preventDefault();break;case"Escape":this.escape(),tt.preventDefault()}}),b}buildLabel(){const ut=document.createElement("span");return ut.classList.add("ql-picker-label"),ut.innerHTML='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>',ut.tabIndex="0",ut.setAttribute("role","button"),ut.setAttribute("aria-expanded","false"),this.container.appendChild(ut),ut}buildOptions(){const ut=document.createElement("span");ut.classList.add("ql-picker-options"),ut.setAttribute("aria-hidden","true"),ut.tabIndex="-1",ut.id=`ql-picker-options-${Ht}`,Ht+=1,this.label.setAttribute("aria-controls",ut.id),this.options=ut,Array.from(this.select.options).forEach(b=>{const S=this.buildItem(b);ut.appendChild(S),b.selected===!0&&this.selectItem(S)}),this.container.appendChild(ut)}buildPicker(){Array.from(this.select.attributes).forEach(ut=>{this.container.setAttribute(ut.name,ut.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(ut){let b=arguments.length>1&&arguments[1]!==void 0&&arguments[1];const S=this.container.querySelector(".ql-selected");ut!==S&&(S?.classList.remove("ql-selected"),ut!=null&&(ut.classList.add("ql-selected"),this.select.selectedIndex=Array.from(ut.parentNode.children).indexOf(ut),ut.hasAttribute("data-value")?this.label.setAttribute("data-value",ut.getAttribute("data-value")):this.label.removeAttribute("data-value"),ut.hasAttribute("data-label")?this.label.setAttribute("data-label",ut.getAttribute("data-label")):this.label.removeAttribute("data-label"),b&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let ut;if(this.select.selectedIndex>-1){const S=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];ut=this.select.options[this.select.selectedIndex],this.selectItem(S)}else this.selectItem(null);const b=ut!=null&&ut!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",b)}},Bt=class extends te{constructor(ut,b){super(ut),this.label.innerHTML=b,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(S=>{S.classList.add("ql-primary")})}buildItem(ut){const b=super.buildItem(ut);return b.style.backgroundColor=ut.getAttribute("value")||"",b}selectItem(ut,b){super.selectItem(ut,b);const S=this.label.querySelector(".ql-color-label"),tt=ut&&ut.getAttribute("data-value")||"";S&&(S.tagName==="line"?S.style.stroke=tt:S.style.fill=tt)}},ae=class extends te{constructor(ut,b){super(ut),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(S=>{S.innerHTML=b[S.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(ut,b){super.selectItem(ut,b);const S=ut||this.defaultItem;if(S!=null){if(this.label.innerHTML===S.innerHTML)return;this.label.innerHTML=S.innerHTML}}},ue=class{constructor(ut,b){this.quill=ut,this.boundsContainer=b||document.body,this.root=ut.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,(S=>{const{overflowY:tt}=getComputedStyle(S,null);return tt!=="visible"&&tt!=="clip"})(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=-1*this.quill.root.scrollTop+"px"}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(ut){const b=ut.left+ut.width/2-this.root.offsetWidth/2,S=ut.bottom+this.quill.root.scrollTop;this.root.style.left=`${b}px`,this.root.style.top=`${S}px`,this.root.classList.remove("ql-flip");const tt=this.boundsContainer.getBoundingClientRect(),bt=this.root.getBoundingClientRect();let St=0;if(bt.right>tt.right&&(St=tt.right-bt.right,this.root.style.left=`${b+St}px`),bt.left<tt.left&&(St=tt.left-bt.left,this.root.style.left=`${b+St}px`),bt.bottom>tt.bottom){const Vt=bt.bottom-bt.top,Zt=ut.bottom-ut.top+Vt;this.root.style.top=S-Zt+"px",this.root.classList.add("ql-flip")}return St}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}},ye=It(8347),ne=It(5374),Re=It(9609);const ni=[!1,"center","right","justify"],qe=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],hi=[!1,"serif","monospace"],Je=["1","2","3",!1],He=["small",!1,"large","huge"];class ti extends Re.A{constructor(b,S){super(b,S);const tt=bt=>{document.body.contains(b.root)?(this.tooltip==null||this.tooltip.root.contains(bt.target)||document.activeElement===this.tooltip.textbox||this.quill.hasFocus()||this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(St=>{St.container.contains(bt.target)||St.close()})):document.body.removeEventListener("click",tt)};b.emitter.listenDOM("click",document.body,tt)}addModule(b){const S=super.addModule(b);return b==="toolbar"&&this.extendToolbar(S),S}buildButtons(b,S){Array.from(b).forEach(tt=>{(tt.getAttribute("class")||"").split(/\s+/).forEach(bt=>{if(bt.startsWith("ql-")&&(bt=bt.slice(3),S[bt]!=null))if(bt==="direction")tt.innerHTML=S[bt][""]+S[bt].rtl;else if(typeof S[bt]=="string")tt.innerHTML=S[bt];else{const St=tt.value||"";St!=null&&S[bt][St]&&(tt.innerHTML=S[bt][St])}})})}buildPickers(b,S){this.pickers=Array.from(b).map(tt=>{if(tt.classList.contains("ql-align")&&(tt.querySelector("option")==null&&Se(tt,ni),typeof S.align=="object"))return new ae(tt,S.align);if(tt.classList.contains("ql-background")||tt.classList.contains("ql-color")){const bt=tt.classList.contains("ql-background")?"background":"color";return tt.querySelector("option")==null&&Se(tt,qe,bt==="background"?"#ffffff":"#000000"),new Bt(tt,S[bt])}return tt.querySelector("option")==null&&(tt.classList.contains("ql-font")?Se(tt,hi):tt.classList.contains("ql-header")?Se(tt,Je):tt.classList.contains("ql-size")&&Se(tt,He)),new te(tt)}),this.quill.on(ne.A.events.EDITOR_CHANGE,()=>{this.pickers.forEach(tt=>{tt.update()})})}}ti.DEFAULTS=(0,ye.A)({},Re.A.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let ut=this.container.querySelector("input.ql-image[type=file]");ut==null&&(ut=document.createElement("input"),ut.setAttribute("type","file"),ut.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),ut.classList.add("ql-image"),ut.addEventListener("change",()=>{const b=this.quill.getSelection(!0);this.quill.uploader.upload(b,ut.files),ut.value=""}),this.container.appendChild(ut)),ut.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Ae extends ue{constructor(b,S){super(b,S),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",b=>{b.key==="Enter"?(this.save(),b.preventDefault()):b.key==="Escape"&&(this.cancel(),b.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;S!=null?this.textbox.value=S:b!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const tt=this.quill.getBounds(this.quill.selection.savedRange);tt!=null&&this.position(tt),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${b}`)||""),this.root.setAttribute("data-mode",b)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:b}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:S}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",b,ne.A.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",b,ne.A.sources.USER)),this.quill.root.scrollTop=S;break}case"video":b=function(S){let tt=S.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||S.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return tt?`${tt[1]||"https"}://www.youtube.com/embed/${tt[2]}?showinfo=0`:(tt=S.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${tt[1]||"https"}://player.vimeo.com/video/${tt[2]}/`:S}(b);case"formula":{if(!b)break;const S=this.quill.getSelection(!0);if(S!=null){const tt=S.index+S.length;this.quill.insertEmbed(tt,this.root.getAttribute("data-mode"),b,ne.A.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(tt+1," ",ne.A.sources.USER),this.quill.setSelection(tt+2,ne.A.sources.USER)}break}}this.textbox.value="",this.hide()}}function Se(ut,b){let S=arguments.length>2&&arguments[2]!==void 0&&arguments[2];b.forEach(tt=>{const bt=document.createElement("option");tt===S?bt.setAttribute("selected","selected"):bt.setAttribute("value",String(tt)),ut.appendChild(bt)})}var Ye=It(8298);const Ue=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class we extends Ae{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(b,S){super(b,S),this.quill.on(ne.A.events.EDITOR_CHANGE,(tt,bt,St,Vt)=>{if(tt===ne.A.events.SELECTION_CHANGE)if(bt!=null&&bt.length>0&&Vt===ne.A.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const Zt=this.quill.getLines(bt.index,bt.length);if(Zt.length===1){const xe=this.quill.getBounds(bt);xe!=null&&this.position(xe)}else{const xe=Zt[Zt.length-1],Me=this.quill.getIndex(xe),je=Math.min(xe.length()-1,bt.index+bt.length-Me),Xe=this.quill.getBounds(new Ye.Q(Me,je));Xe!=null&&this.position(Xe)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(ne.A.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const b=this.quill.getSelection();if(b!=null){const S=this.quill.getBounds(b);S!=null&&this.position(S)}},1)})}cancel(){this.show()}position(b){const S=super.position(b),tt=this.root.querySelector(".ql-tooltip-arrow");return tt.style.marginLeft="",S!==0&&(tt.style.marginLeft=-1*S-tt.offsetWidth/2+"px"),S}}class We extends ti{constructor(b,S){S.modules.toolbar!=null&&S.modules.toolbar.container==null&&(S.modules.toolbar.container=Ue),super(b,S),this.quill.container.classList.add("ql-bubble")}extendToolbar(b){this.tooltip=new we(this.quill,this.options.bounds),b.container!=null&&(this.tooltip.root.appendChild(b.container),this.buildButtons(b.container.querySelectorAll("button"),Tt),this.buildPickers(b.container.querySelectorAll("select"),Tt))}}We.DEFAULTS=(0,ye.A)({},ti.DEFAULTS,{modules:{toolbar:{handlers:{link(ut){ut?this.quill.theme.tooltip.edit():this.quill.format("link",!1,K.Ay.sources.USER)}}}}});const $e=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class xi extends Ae{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",b=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),b.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",b=>{if(this.linkRange!=null){const S=this.linkRange;this.restoreFocus(),this.quill.formatText(S,"link",!1,ne.A.sources.USER),delete this.linkRange}b.preventDefault(),this.hide()}),this.quill.on(ne.A.events.SELECTION_CHANGE,(b,S,tt)=>{if(b!=null){if(b.length===0&&tt===ne.A.sources.USER){const[bt,St]=this.quill.scroll.descendant(X,b.index);if(bt!=null){this.linkRange=new Ye.Q(b.index-St,bt.length());const Vt=X.formats(bt.domNode);this.preview.textContent=Vt,this.preview.setAttribute("href",Vt),this.show();const Zt=this.quill.getBounds(this.linkRange);return void(Zt!=null&&this.position(Zt))}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class oi extends ti{constructor(b,S){S.modules.toolbar!=null&&S.modules.toolbar.container==null&&(S.modules.toolbar.container=$e),super(b,S),this.quill.container.classList.add("ql-snow")}extendToolbar(b){b.container!=null&&(b.container.classList.add("ql-snow"),this.buildButtons(b.container.querySelectorAll("button"),Tt),this.buildPickers(b.container.querySelectorAll("select"),Tt),this.tooltip=new xi(this.quill,this.options.bounds),b.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(S,tt)=>{b.handlers.link.call(b,!tt.format.link)}))}}oi.DEFAULTS=(0,ye.A)({},ti.DEFAULTS,{modules:{toolbar:{handlers:{link(ut){if(ut){const b=this.quill.getSelection();if(b==null||b.length===0)return;let S=this.quill.getText(b);/^\S+@\S+\.\S+$/.test(S)&&S.indexOf("mailto:")!==0&&(S=`mailto:${S}`);const{tooltip:tt}=this.quill.theme;tt.edit("link",S)}else this.quill.format("link",!1,K.Ay.sources.USER)}}}}});var gi=oi;nt.default.register({"attributors/attribute/direction":u.Mc,"attributors/class/align":W.qh,"attributors/class/background":Y.l,"attributors/class/color":G.g3,"attributors/class/direction":u.sY,"attributors/class/font":rt.q,"attributors/class/size":vt.U,"attributors/style/align":W.Hu,"attributors/style/background":Y.s,"attributors/style/color":G.JM,"attributors/style/direction":u.VL,"attributors/style/font":rt.z,"attributors/style/size":vt.r},!0),nt.default.register({"formats/align":W.qh,"formats/direction":u.sY,"formats/indent":$,"formats/background":Y.s,"formats/color":G.JM,"formats/font":rt.q,"formats/size":vt.U,"formats/blockquote":_,"formats/code-block":U.Ay,"formats/header":v,"formats/list":R,"formats/bold":O,"formats/code":U.Cy,"formats/italic":class extends O{static blotName="italic";static tagName=["EM","I"]},"formats/link":X,"formats/script":at,"formats/strike":class extends O{static blotName="strike";static tagName=["S","STRIKE"]},"formats/underline":Et,"formats/formula":ct,"formats/image":M,"formats/video":f,"modules/syntax":ot,"modules/table":Rt,"modules/toolbar":Gt,"themes/bubble":We,"themes/snow":gi,"ui/icons":Tt,"ui/picker":te,"ui/icon-picker":ae,"ui/color-picker":Bt,"ui/tooltip":ue},!0);var ui=nt.default}(),be.default}()});/*!
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/(function(De,Qe){typeof exports=="object"&&typeof module<"u"?module.exports=Qe():typeof define=="function"&&define.amd?define(Qe):(De=typeof globalThis<"u"?globalThis:De||self,De.Chart=Qe())})(this,function(){"use strict";function De(){}const Qe=function(){let i=0;return function(){return i++}}();function It(i){return i===null||typeof i>"u"}function be(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function nt(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}const W=i=>(typeof i=="number"||i instanceof Number)&&isFinite(+i);function u(i,t){return W(i)?i:t}function y(i,t){return typeof i>"u"?t:i}const q=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:i/t,$=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function T(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function H(i,t,e,n){let s,r,o;if(be(i))if(r=i.length,n)for(s=r-1;s>=0;s--)t.call(e,i[s],s);else for(s=0;s<r;s++)t.call(e,i[s],s);else if(nt(i))for(o=Object.keys(i),r=o.length,s=0;s<r;s++)t.call(e,i[o[s]],o[s])}function _(i,t){let e,n,s,r;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function F(i){if(be(i))return i.map(F);if(nt(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=F(i[e[s]]);return t}return i}function v(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function V(i,t,e,n){if(!v(i))return;const s=t[i],r=e[i];nt(s)&&nt(r)?K(s,r,n):t[i]=F(r)}function K(i,t,e){const n=be(t)?t:[t],s=n.length;if(!nt(i))return i;e=e||{};const r=e.merger||V;for(let o=0;o<s;++o){if(t=n[o],!nt(t))continue;const a=Object.keys(t);for(let l=0,c=a.length;l<c;++l)r(a[l],i,t,e)}return i}function k(i,t){return K(i,t,{merger:R})}function R(i,t,e){if(!v(i))return;const n=t[i],s=e[i];nt(n)&&nt(s)?k(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=F(s))}function Y(i,t,e,n){t!==void 0&&console.warn(i+': "'+e+'" is deprecated. Please use "'+n+'" instead')}const G={"":i=>i,x:i=>i.x,y:i=>i.y};function rt(i,t){return(G[t]||(G[t]=vt(t)))(i)}function vt(i){const t=kt(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function kt(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function pt(i){return i.charAt(0).toUpperCase()+i.slice(1)}const O=i=>typeof i<"u",X=i=>typeof i=="function",dt=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Q(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const at=Math.PI,yt=2*at,Et=yt+at,Pt=Number.POSITIVE_INFINITY,Ft=at/180,ct=at/2,mt=at/4,Nt=at*2/3,M=Math.log10,d=Math.sign;function g(i){const t=Math.round(i);i=A(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(M(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function f(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function U(i){return!isNaN(parseFloat(i))&&isFinite(i)}function A(i,t,e){return Math.abs(i-t)<e}function N(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function z(i,t,e){let n,s,r;for(n=0,s=i.length;n<s;n++)r=i[n][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function j(i){return i*(at/180)}function L(i){return i*(180/at)}function p(i){if(!W(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function x(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let r=Math.atan2(n,e);return r<-.5*at&&(r+=yt),{angle:r,distance:s}}function w(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function I(i,t){return(i-t+Et)%yt-at}function B(i){return(i%yt+yt)%yt}function J(i,t,e,n){const s=B(i),r=B(t),o=B(e),a=B(r-s),l=B(o-s),c=B(s-r),h=B(s-o);return s===r||s===o||n&&r===o||a>l&&c<h}function ot(i,t,e){return Math.max(t,Math.min(e,i))}function ft(i){return ot(i,-32768,32767)}function gt(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function _t(i,t,e){e=e||(o=>i[o]<t);let n=i.length-1,s=0,r;for(;n-s>1;)r=s+n>>1,e(r)?s=r:n=r;return{lo:s,hi:n}}const At=(i,t,e,n)=>_t(i,e,n?s=>i[s][t]<=e:s=>i[s][t]<e),Ot=(i,t,e)=>_t(i,e,n=>i[n][t]>=e);function zt(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const Rt=["push","pop","shift","splice","unshift"];function jt(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Rt.forEach(e=>{const n="_onData"+pt(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...r)}),o}})})}function Gt(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(Rt.forEach(r=>{delete i[r]}),delete i._chartjs)}function oe(i){const t=new Set;let e,n;for(e=0,n=i.length;e<n;++e)t.add(i[e]);return t.size===n?i:Array.from(t)}function ie(i,t,e){return t+" "+i+"px "+e}const Tt=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Ht(i,t,e){const n=e||(o=>Array.prototype.slice.call(o));let s=!1,r=[];return function(...o){r=n(o),s||(s=!0,Tt.call(window,()=>{s=!1,i.apply(t,r)}))}}function Xt(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const te=i=>i==="start"?"left":i==="end"?"right":"center",Bt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,ae=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function ue(i,t,e){const n=t.length;let s=0,r=n;if(i._sorted){const{iScale:o,_parsed:a}=i,l=o.axis,{min:c,max:h,minDefined:m,maxDefined:E}=o.getUserBounds();m&&(s=ot(Math.min(At(a,o.axis,c).lo,e?n:At(t,l,o.getPixelForValue(c)).lo),0,n-1)),E?r=ot(Math.max(At(a,o.axis,h,!0).hi+1,e?0:At(t,l,o.getPixelForValue(h),!0).hi+1),s,n)-s:r=n-s}return{start:s,count:r}}function ye(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const r=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),r}class ne{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Tt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const r=n.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),r.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Re=new ne;/*!
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function ni(i){return i+.5|0}const qe=(i,t,e)=>Math.max(Math.min(i,e),t);function hi(i){return qe(ni(i*2.55),0,255)}function Je(i){return qe(ni(i*255),0,255)}function He(i){return qe(ni(i/2.55)/100,0,1)}function ti(i){return qe(ni(i*100),0,100)}const Ae={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},Se=[..."0123456789ABCDEF"],Ye=i=>Se[i&15],Ue=i=>Se[(i&240)>>4]+Se[i&15],we=i=>(i&240)>>4===(i&15),We=i=>we(i.r)&&we(i.g)&&we(i.b)&&we(i.a);function $e(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&Ae[i[1]]*17,g:255&Ae[i[2]]*17,b:255&Ae[i[3]]*17,a:t===5?Ae[i[4]]*17:255}:(t===7||t===9)&&(e={r:Ae[i[1]]<<4|Ae[i[2]],g:Ae[i[3]]<<4|Ae[i[4]],b:Ae[i[5]]<<4|Ae[i[6]],a:t===9?Ae[i[7]]<<4|Ae[i[8]]:255})),e}const xi=(i,t)=>i<255?t(i):"";function oi(i){var t=We(i)?Ye:Ue;return i?"#"+t(i.r)+t(i.g)+t(i.b)+xi(i.a,t):void 0}const gi=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ui(i,t,e){const n=t*Math.min(e,1-e),s=(r,o=(r+i/30)%12)=>e-n*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function ut(i,t,e){const n=(s,r=(s+i/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[n(5),n(3),n(1)]}function b(i,t,e){const n=ui(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function S(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function tt(i){const e=i.r/255,n=i.g/255,s=i.b/255,r=Math.max(e,n,s),o=Math.min(e,n,s),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=S(e,n,s,h,r),l=l*60+.5),[l|0,c||0,a]}function bt(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(Je)}function St(i,t,e){return bt(ui,i,t,e)}function Vt(i,t,e){return bt(b,i,t,e)}function Zt(i,t,e){return bt(ut,i,t,e)}function xe(i){return(i%360+360)%360}function Me(i){const t=gi.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?hi(+t[5]):Je(+t[5]));const s=xe(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?n=Vt(s,r,o):t[1]==="hsv"?n=Zt(s,r,o):n=St(s,r,o),{r:n[0],g:n[1],b:n[2],a:e}}function je(i,t){var e=tt(i);e[0]=xe(e[0]+t),e=St(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Xe(i){if(!i)return;const t=tt(i),e=t[0],n=ti(t[1]),s=ti(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${He(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const pi={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"},Ge={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 ai(){const i={},t=Object.keys(Ge),e=Object.keys(pi);let n,s,r,o,a;for(n=0;n<t.length;n++){for(o=a=t[n],s=0;s<e.length;s++)r=e[s],a=a.replace(r,pi[r]);r=parseInt(Ge[o],16),i[a]=[r>>16&255,r>>8&255,r&255]}return i}let it;function C(i){it||(it=ai(),it.transparent=[0,0,0,0]);const t=it[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Z=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ht(i){const t=Z.exec(i);let e=255,n,s,r;if(t){if(t[7]!==n){const o=+t[7];e=t[8]?hi(o):qe(o*255,0,255)}return n=+t[1],s=+t[3],r=+t[5],n=255&(t[2]?hi(n):qe(n,0,255)),s=255&(t[4]?hi(s):qe(s,0,255)),r=255&(t[6]?hi(r):qe(r,0,255)),{r:n,g:s,b:r,a:e}}}function Ct(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${He(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Jt=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Ut=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Yt(i,t,e){const n=Ut(He(i.r)),s=Ut(He(i.g)),r=Ut(He(i.b));return{r:Je(Jt(n+e*(Ut(He(t.r))-n))),g:Je(Jt(s+e*(Ut(He(t.g))-s))),b:Je(Jt(r+e*(Ut(He(t.b))-r))),a:i.a+e*(t.a-i.a)}}function de(i,t,e){if(i){let n=tt(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=St(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function fe(i,t){return i&&Object.assign(t||{},i)}function Ee(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Je(i[3]))):(t=fe(i,{r:0,g:0,b:0,a:1}),t.a=Je(t.a)),t}function ke(i){return i.charAt(0)==="r"?ht(i):Me(i)}class ve{constructor(t){if(t instanceof ve)return t;const e=typeof t;let n;e==="object"?n=Ee(t):e==="string"&&(n=$e(t)||C(t)||ke(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=fe(this._rgb);return t&&(t.a=He(t.a)),t}set rgb(t){this._rgb=Ee(t)}rgbString(){return this._valid?Ct(this._rgb):void 0}hexString(){return this._valid?oi(this._rgb):void 0}hslString(){return this._valid?Xe(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,n.r=255&c*n.r+r*s.r+.5,n.g=255&c*n.g+r*s.g+.5,n.b=255&c*n.b+r*s.b+.5,n.a=o*n.a+(1-o)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=Yt(this._rgb,t._rgb,e)),this}clone(){return new ve(this.rgb)}alpha(t){return this._rgb.a=Je(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ni(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return de(this._rgb,2,t),this}darken(t){return de(this._rgb,2,-t),this}saturate(t){return de(this._rgb,1,t),this}desaturate(t){return de(this._rgb,1,-t),this}rotate(t){return je(this._rgb,t),this}}function $t(i){return new ve(i)}function Qt(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function le(i){return Qt(i)?i:$t(i)}function _e(i){return Qt(i)?i:$t(i).saturate(.5).darken(.1).hexString()}const Ie=Object.create(null),Be=Object.create(null);function se(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const r=e[n];i=i[r]||(i[r]=Object.create(null))}return i}function Oe(i,t,e){return typeof t=="string"?K(se(i,t),e):K(se(i,""),t)}class si{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,n)=>_e(n.backgroundColor),this.hoverBorderColor=(e,n)=>_e(n.borderColor),this.hoverColor=(e,n)=>_e(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)}set(t,e){return Oe(this,t,e)}get(t){return se(this,t)}describe(t,e){return Oe(Be,t,e)}override(t,e){return Oe(Ie,t,e)}route(t,e,n,s){const r=se(this,t),o=se(this,n),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return nt(l)?Object.assign({},c,l):y(l,c)},set(l){this[a]=l}}})}}var re=new si({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function pe(){return typeof window<"u"&&typeof document<"u"}function he(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function vi(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const ri=i=>window.getComputedStyle(i,null);function Vi(i,t){return ri(i).getPropertyValue(t)}const ei=["top","right","bottom","left"];function Fe(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=ei[s];n[r]=parseFloat(i[t+"-"+r+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const mi=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Pi(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:r}=n;let o=!1,a,l;if(mi(s,r,i.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function Ke(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=ri(e),r=s.boxSizing==="border-box",o=Fe(s,"padding"),a=Fe(s,"border","width"),{x:l,y:c,box:h}=Pi(i,e),m=o.left+(h&&a.left),E=o.top+(h&&a.top);let{width:P,height:D}=t;return r&&(P-=o.width+a.width,D-=o.height+a.height),{x:Math.round((l-m)/P*e.width/n),y:Math.round((c-E)/D*e.height/n)}}function di(i,t,e){let n,s;if(t===void 0||e===void 0){const r=he(i);if(!r)t=i.clientWidth,e=i.clientHeight;else{const o=r.getBoundingClientRect(),a=ri(r),l=Fe(a,"border","width"),c=Fe(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,n=vi(a.maxWidth,r,"clientWidth"),s=vi(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:n||Pt,maxHeight:s||Pt}}const Hi=i=>Math.round(i*10)/10;function Ri(i,t,e,n){const s=ri(i),r=Fe(s,"margin"),o=vi(s.maxWidth,i,"clientWidth")||Pt,a=vi(s.maxHeight,i,"clientHeight")||Pt,l=di(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const m=Fe(s,"border","width"),E=Fe(s,"padding");c-=E.width+m.width,h-=E.height+m.height}return c=Math.max(0,c-r.width),h=Math.max(0,n?Math.floor(c/n):h-r.height),c=Hi(Math.min(c,o,l.maxWidth)),h=Hi(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Hi(c/2)),{width:c,height:h}}function Di(i,t,e){const n=t||1,s=Math.floor(i.height*n),r=Math.floor(i.width*n);i.height=s/n,i.width=r/n;const o=i.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${i.height}px`,o.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||o.height!==s||o.width!==r?(i.currentDevicePixelRatio=n,o.height=s,o.width=r,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const qi=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function wi(i,t){const e=Vi(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function en(i){return!i||It(i.size)||It(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function bi(i,t,e,n,s){let r=t[s];return r||(r=t[s]=i.measureText(s).width,e.push(s)),r>n&&(n=r),n}function Ii(i,t,e,n){n=n||{};let s=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},r=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let o=0;const a=e.length;let l,c,h,m,E;for(l=0;l<a;l++)if(m=e[l],m!=null&&be(m)!==!0)o=bi(i,s,r,o,m);else if(be(m))for(c=0,h=m.length;c<h;c++)E=m[c],E!=null&&!be(E)&&(o=bi(i,s,r,o,E));i.restore();const P=r.length/2;if(P>e.length){for(l=0;l<P;l++)delete s[r[l]];r.splice(0,P)}return o}function ki(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function $n(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function yn(i,t,e,n){Kn(i,t,e,n,null)}function Kn(i,t,e,n,s){let r,o,a,l,c,h;const m=t.pointStyle,E=t.rotation,P=t.radius;let D=(E||0)*Ft;if(m&&typeof m=="object"&&(r=m.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(D),i.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),i.restore();return}if(!(isNaN(P)||P<=0)){switch(i.beginPath(),m){default:s?i.ellipse(e,n,s/2,P,0,0,yt):i.arc(e,n,P,0,yt),i.closePath();break;case"triangle":i.moveTo(e+Math.sin(D)*P,n-Math.cos(D)*P),D+=Nt,i.lineTo(e+Math.sin(D)*P,n-Math.cos(D)*P),D+=Nt,i.lineTo(e+Math.sin(D)*P,n-Math.cos(D)*P),i.closePath();break;case"rectRounded":c=P*.516,l=P-c,o=Math.cos(D+mt)*l,a=Math.sin(D+mt)*l,i.arc(e-o,n-a,c,D-at,D-ct),i.arc(e+a,n-o,c,D-ct,D),i.arc(e+o,n+a,c,D,D+ct),i.arc(e-a,n+o,c,D+ct,D+at),i.closePath();break;case"rect":if(!E){l=Math.SQRT1_2*P,h=s?s/2:l,i.rect(e-h,n-l,2*h,2*l);break}D+=mt;case"rectRot":o=Math.cos(D)*P,a=Math.sin(D)*P,i.moveTo(e-o,n-a),i.lineTo(e+a,n-o),i.lineTo(e+o,n+a),i.lineTo(e-a,n+o),i.closePath();break;case"crossRot":D+=mt;case"cross":o=Math.cos(D)*P,a=Math.sin(D)*P,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a),i.moveTo(e+a,n-o),i.lineTo(e-a,n+o);break;case"star":o=Math.cos(D)*P,a=Math.sin(D)*P,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a),i.moveTo(e+a,n-o),i.lineTo(e-a,n+o),D+=mt,o=Math.cos(D)*P,a=Math.sin(D)*P,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a),i.moveTo(e+a,n-o),i.lineTo(e-a,n+o);break;case"line":o=s?s/2:Math.cos(D)*P,a=Math.sin(D)*P,i.moveTo(e-o,n-a),i.lineTo(e+o,n+a);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(D)*P,n+Math.sin(D)*P);break}i.fill(),t.borderWidth>0&&i.stroke()}}function Ui(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function nn(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function sn(i){i.restore()}function Ds(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;i.lineTo(r,t.y),i.lineTo(r,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function qs(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function Si(i,t,e,n,s,r={}){const o=be(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,Oo(i,r),l=0;l<o.length;++l)c=o[l],a&&(r.strokeColor&&(i.strokeStyle=r.strokeColor),It(r.strokeWidth)||(i.lineWidth=r.strokeWidth),i.strokeText(c,e,n,r.maxWidth)),i.fillText(c,e,n,r.maxWidth),Lo(i,e,n,c,r),n+=s.lineHeight;i.restore()}function Oo(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),It(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function Lo(i,t,e,n,s){if(s.strikethrough||s.underline){const r=i.measureText(n),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(o,h),i.lineTo(a,h),i.stroke()}}function Wi(i,t){const{x:e,y:n,w:s,h:r,radius:o}=t;i.arc(e+o.topLeft,n+o.topLeft,o.topLeft,-ct,at,!0),i.lineTo(e,n+r-o.bottomLeft),i.arc(e+o.bottomLeft,n+r-o.bottomLeft,o.bottomLeft,at,ct,!0),i.lineTo(e+s-o.bottomRight,n+r),i.arc(e+s-o.bottomRight,n+r-o.bottomRight,o.bottomRight,ct,0,!0),i.lineTo(e+s,n+o.topRight),i.arc(e+s-o.topRight,n+o.topRight,o.topRight,0,-ct,!0),i.lineTo(e+o.topLeft,n)}function xn(i,t=[""],e=i,n,s=()=>i[0]){O(n)||(n=Fs("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:n,_getTarget:s,override:o=>xn([o,...i],t,e,n)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete i[0][a],!0},get(o,a){return Is(o,a,()=>Io(a,t,i,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(o,a){return zs(o).includes(a)},ownKeys(o){return zs(o)},set(o,a,l){const c=o._storage||(o._storage=s());return o[a]=c[a]=l,delete o._keys,!0}})}function ji(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Yn(i,n),setContext:r=>ji(i,r,e,n),override:r=>ji(i.override(r),t,e,n)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete i[o],!0},get(r,o,a){return Is(r,o,()=>Co(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(i,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,o)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(r,o){return Reflect.has(i,o)},ownKeys(){return Reflect.ownKeys(i)},set(r,o,a){return i[o]=a,delete r[o],!0}})}function Yn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:X(e)?e:()=>e,isIndexable:X(n)?n:()=>n}}const Mo=(i,t)=>i?i+pt(t):t,Xn=(i,t)=>nt(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Is(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const n=e();return i[t]=n,n}function Co(i,t,e){const{_proxy:n,_context:s,_subProxy:r,_descriptors:o}=i;let a=n[t];return X(a)&&o.isScriptable(t)&&(a=To(t,a,i,e)),be(a)&&a.length&&(a=Po(t,a,i,o.isIndexable)),Xn(t,a)&&(a=ji(a,s,r&&r[t],o)),a}function To(i,t,e,n){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);return a.add(i),t=t(r,o||n),a.delete(i),Xn(i,t)&&(t=Gn(s._scopes,s,i,t)),t}function Po(i,t,e,n){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(O(r.index)&&n(i))t=t[r.index%t.length];else if(nt(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const m=Gn(c,s,i,h);t.push(ji(m,r,o&&o[i],a))}}return t}function js(i,t,e){return X(i)?i(t,e):i}const Ro=(i,t)=>i===!0?t:typeof i=="string"?rt(t,i):void 0;function Do(i,t,e,n,s){for(const r of t){const o=Ro(e,r);if(o){i.add(o);const a=js(o._fallback,e,s);if(O(a)&&a!==e&&a!==n)return a}else if(o===!1&&O(n)&&e!==n)return null}return!1}function Gn(i,t,e,n){const s=t._rootScopes,r=js(t._fallback,e,n),o=[...i,...s],a=new Set;a.add(n);let l=Bs(a,o,e,r||e,n);return l===null||O(r)&&r!==e&&(l=Bs(a,o,r,l,n),l===null)?!1:xn(Array.from(a),[""],s,r,()=>qo(t,e,n))}function Bs(i,t,e,n,s){for(;e;)e=Do(i,t,e,n,s);return e}function qo(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return be(s)&&nt(e)?e:s}function Io(i,t,e,n){let s;for(const r of t)if(s=Fs(Mo(r,i),e),O(s))return Xn(i,s)?Gn(e,n,i,s):s}function Fs(i,t){for(const e of t){if(!e)continue;const n=e[i];if(O(n))return n}}function zs(i){let t=i._keys;return t||(t=i._keys=jo(i._scopes)),t}function jo(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function Zn(i,t,e,n){const{iScale:s}=i,{key:r="r"}=this._parsing,o=new Array(n);let a,l,c,h;for(a=0,l=n;a<l;++a)c=a+e,h=t[c],o[a]={r:s.parse(rt(h,r),c)};return o}const Bo=Number.EPSILON||1e-14,$i=(i,t)=>t<i.length&&!i[t].skip&&i[t],Vs=i=>i==="x"?"y":"x";function Hs(i,t,e,n){const s=i.skip?t:i,r=t,o=e.skip?t:e,a=w(r,s),l=w(o,r);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const m=n*c,E=n*h;return{previous:{x:r.x-m*(o.x-s.x),y:r.y-m*(o.y-s.y)},next:{x:r.x+E*(o.x-s.x),y:r.y+E*(o.y-s.y)}}}function Fo(i,t,e){const n=i.length;let s,r,o,a,l,c=$i(i,0);for(let h=0;h<n-1;++h)if(l=c,c=$i(i,h+1),!(!l||!c)){if(A(t[h],0,Bo)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],r=e[h+1]/t[h],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[h]=s*o*t[h],e[h+1]=r*o*t[h])}}function zo(i,t,e="x"){const n=Vs(e),s=i.length;let r,o,a,l=$i(i,0);for(let c=0;c<s;++c){if(o=a,a=l,l=$i(i,c+1),!a)continue;const h=a[e],m=a[n];o&&(r=(h-o[e])/3,a[`cp1${e}`]=h-r,a[`cp1${n}`]=m-r*t[c]),l&&(r=(l[e]-h)/3,a[`cp2${e}`]=h+r,a[`cp2${n}`]=m+r*t[c])}}function Us(i,t="x"){const e=Vs(t),n=i.length,s=Array(n).fill(0),r=Array(n);let o,a,l,c=$i(i,0);for(o=0;o<n;++o)if(a=l,l=c,c=$i(i,o+1),!!l){if(c){const h=c[t]-l[t];s[o]=h!==0?(c[e]-l[e])/h:0}r[o]=a?c?d(s[o-1])!==d(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Fo(i,s,r),zo(i,r,t)}function vn(i,t,e){return Math.max(Math.min(i,e),t)}function Vo(i,t){let e,n,s,r,o,a=Ui(i[0],t);for(e=0,n=i.length;e<n;++e)o=r,r=a,a=e<n-1&&Ui(i[e+1],t),r&&(s=i[e],o&&(s.cp1x=vn(s.cp1x,t.left,t.right),s.cp1y=vn(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=vn(s.cp2x,t.left,t.right),s.cp2y=vn(s.cp2y,t.top,t.bottom)))}function Ws(i,t,e,n,s){let r,o,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Us(i,s);else{let c=n?i[i.length-1]:i[0];for(r=0,o=i.length;r<o;++r)a=i[r],l=Hs(c,a,i[Math.min(r+1,o-(n?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Vo(i,e)}const _n=i=>i===0||i===1,$s=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*yt/e)),Ks=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*yt/e)+1,Ki={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*ct)+1,easeOutSine:i=>Math.sin(i*ct),easeInOutSine:i=>-.5*(Math.cos(at*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>_n(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>_n(i)?i:$s(i,.075,.3),easeOutElastic:i=>_n(i)?i:Ks(i,.075,.3),easeInOutElastic(i){return _n(i)?i:i<.5?.5*$s(i*2,.1125,.45):.5+.5*Ks(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ki.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ki.easeInBounce(i*2)*.5:Ki.easeOutBounce(i*2-1)*.5+.5};function Ei(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Ys(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Xs(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},r={x:t.cp1x,y:t.cp1y},o=Ei(i,s,e),a=Ei(s,r,e),l=Ei(r,t,e),c=Ei(o,a,e),h=Ei(a,l,e);return Ei(c,h,e)}const Gs=new Map;function Ho(i,t){t=t||{};const e=i+JSON.stringify(t);let n=Gs.get(e);return n||(n=new Intl.NumberFormat(i,t),Gs.set(e,n)),n}function Yi(i,t,e){return Ho(t,e).format(i)}const Uo=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Wo=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Zs(i,t){const e=(""+i).match(Uo);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const $o=i=>+i||0;function An(i,t){const e={},n=nt(t),s=n?Object.keys(t):t,r=nt(i)?n?o=>y(i[o],i[t[o]]):o=>i[o]:()=>i;for(const o of s)e[o]=$o(r(o));return e}function Qn(i){return An(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Ni(i){return An(i,["topLeft","topRight","bottomLeft","bottomRight"])}function ze(i){const t=Qn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ce(i,t){i=i||{},t=t||re.font;let e=y(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=y(i.style,t.style);n&&!(""+n).match(Wo)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:y(i.family,t.family),lineHeight:Zs(y(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:y(i.weight,t.weight),string:""};return s.string=en(s),s}function Xi(i,t,e,n){let s=!0,r,o,a;for(r=0,o=i.length;r<o;++r)if(a=i[r],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),e!==void 0&&be(a)&&(a=a[e%a.length],s=!1),a!==void 0))return n&&!s&&(n.cacheable=!1),a}function Qs(i,t,e){const{min:n,max:s}=i,r=$(t,(s-n)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(n,-Math.abs(r)),max:o(s,r)}}function _i(i,t){return Object.assign(Object.create(i),t)}const Ko=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},Yo=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Bi(i,t,e){return i?Ko(t,e):Yo()}function Jn(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function ts(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Js(i){return i==="angle"?{between:J,compare:I,normalize:B}:{between:gt,compare:(t,e)=>t-e,normalize:t=>t}}function tr({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Xo(i,t,e){const{property:n,start:s,end:r}=e,{between:o,normalize:a}=Js(n),l=t.length;let{start:c,end:h,loop:m}=i,E,P;if(m){for(c+=l,h+=l,E=0,P=l;E<P&&o(a(t[c%l][n]),s,r);++E)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:m,style:i.style}}function es(i,t,e){if(!e)return[i];const{property:n,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=Js(n),{start:h,end:m,loop:E,style:P}=Xo(i,t,e),D=[];let et=!1,st=null,lt,xt,Mt;const Lt=()=>l(s,Mt,lt)&&a(s,Mt)!==0,wt=()=>a(r,lt)===0||l(r,Mt,lt),Dt=()=>et||Lt(),qt=()=>!et||wt();for(let Kt=h,Wt=h;Kt<=m;++Kt)xt=t[Kt%o],!xt.skip&&(lt=c(xt[n]),lt!==Mt&&(et=l(lt,s,r),st===null&&Dt()&&(st=a(lt,s)===0?Kt:Wt),st!==null&&qt()&&(D.push(tr({start:st,end:Kt,loop:E,count:o,style:P})),st=null),Wt=Kt,Mt=lt));return st!==null&&D.push(tr({start:st,end:m,loop:E,count:o,style:P})),D}function is(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const r=es(n[s],i.points,t);r.length&&e.push(...r)}return e}function Go(i,t,e,n){let s=0,r=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&i[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Zo(i,t,e,n){const s=i.length,r=[];let o=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?a.skip||(n=!1,r.push({start:t%s,end:(l-1)%s,loop:n}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:n}),r}function er(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const r=!!i._loop,{start:o,end:a}=Go(e,s,r,n);if(n===!0)return ir(i,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!i._fullLoop&&o===0&&a===s-1;return ir(i,Zo(e,o,l,c),e,t)}function ir(i,t,e,n){return!n||!n.setContext||!e?t:Qo(i,t,e,n)}function Qo(i,t,e,n){const s=i._chart.getContext(),r=nr(i.options),{_datasetIndex:o,options:{spanGaps:a}}=i,l=e.length,c=[];let h=r,m=t[0].start,E=m;function P(D,et,st,lt){const xt=a?-1:1;if(D!==et){for(D+=l;e[D%l].skip;)D-=xt;for(;e[et%l].skip;)et+=xt;D%l!==et%l&&(c.push({start:D%l,end:et%l,loop:st,style:lt}),h=lt,m=et%l)}}for(const D of t){m=a?m:D.start;let et=e[m%l],st;for(E=m+1;E<=D.end;E++){const lt=e[E%l];st=nr(n.setContext(_i(s,{type:"segment",p0:et,p1:lt,p0DataIndex:(E-1)%l,p1DataIndex:E%l,datasetIndex:o}))),Jo(st,h)&&P(m,E-1,D.loop,h),et=lt,h=st}m<E-1&&P(m,E-1,D.loop,h)}return c}function nr(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Jo(i,t){return t&&JSON.stringify(i)!==JSON.stringify(t)}var ta=Object.freeze({__proto__:null,easingEffects:Ki,isPatternOrGradient:Qt,color:le,getHoverColor:_e,noop:De,uid:Qe,isNullOrUndef:It,isArray:be,isObject:nt,isFinite:W,finiteOrDefault:u,valueOrDefault:y,toPercentage:q,toDimension:$,callback:T,each:H,_elementsEqual:_,clone:F,_merger:V,merge:K,mergeIf:k,_mergerIf:R,_deprecated:Y,resolveObjectKey:rt,_splitKey:kt,_capitalize:pt,defined:O,isFunction:X,setsEqual:dt,_isClickEvent:Q,toFontString:en,_measureText:bi,_longestText:Ii,_alignPixel:ki,clearCanvas:$n,drawPoint:yn,drawPointLegend:Kn,_isPointInArea:Ui,clipArea:nn,unclipArea:sn,_steppedLineTo:Ds,_bezierCurveTo:qs,renderText:Si,addRoundedRectPath:Wi,_lookup:_t,_lookupByKey:At,_rlookupByKey:Ot,_filterBetween:zt,listenArrayEvents:jt,unlistenArrayEvents:Gt,_arrayUnique:oe,_createResolver:xn,_attachContext:ji,_descriptors:Yn,_parseObjectDataRadialScale:Zn,splineCurve:Hs,splineCurveMonotone:Us,_updateBezierControlPoints:Ws,_isDomSupported:pe,_getParentNode:he,getStyle:Vi,getRelativePosition:Ke,getMaximumSize:Ri,retinaScale:Di,supportsEventListenerOptions:qi,readUsedSize:wi,fontString:ie,requestAnimFrame:Tt,throttled:Ht,debounce:Xt,_toLeftRightCenter:te,_alignStartEnd:Bt,_textX:ae,_getStartAndCountOfVisiblePoints:ue,_scaleRangesChanged:ye,_pointInLine:Ei,_steppedInterpolation:Ys,_bezierInterpolation:Xs,formatNumber:Yi,toLineHeight:Zs,_readValueToProps:An,toTRBL:Qn,toTRBLCorners:Ni,toPadding:ze,toFont:Ce,resolve:Xi,_addGrace:Qs,createContext:_i,PI:at,TAU:yt,PITAU:Et,INFINITY:Pt,RAD_PER_DEG:Ft,HALF_PI:ct,QUARTER_PI:mt,TWO_THIRDS_PI:Nt,log10:M,sign:d,niceNum:g,_factorize:f,isNumber:U,almostEquals:A,almostWhole:N,_setMinAndMaxByKey:z,toRadians:j,toDegrees:L,_decimalPlaces:p,getAngleFromPoint:x,distanceBetweenPoints:w,_angleDiff:I,_normalizeAngle:B,_angleBetween:J,_limitValue:ot,_int16Range:ft,_isBetween:gt,getRtlAdapter:Bi,overrideTextDirection:Jn,restoreTextDirection:ts,_boundSegment:es,_boundSegments:is,_computeSegments:er});function ea(i,t,e,n){const{controller:s,data:r,_sorted:o}=i,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?Ot:At;if(n){if(s._sharedOptions){const c=r[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const m=l(r,t,e-h),E=l(r,t,e+h);return{lo:m.lo,hi:E.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function rn(i,t,e,n,s){const r=i.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:h}=r[a],{lo:m,hi:E}=ea(r[a],t,o,s);for(let P=m;P<=E;++P){const D=h[P];D.skip||n(D,c,P)}}}function ia(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const r=t?Math.abs(n.x-s.x):0,o=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function ns(i,t,e,n,s){const r=[];return!s&&!i.isPointInArea(t)||rn(i,e,t,function(a,l,c){!s&&!Ui(a,i.chartArea,0)||a.inRange(t.x,t.y,n)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function na(i,t,e,n){let s=[];function r(o,a,l){const{startAngle:c,endAngle:h}=o.getProps(["startAngle","endAngle"],n),{angle:m}=x(o,{x:t.x,y:t.y});J(m,c,h)&&s.push({element:o,datasetIndex:a,index:l})}return rn(i,e,t,r),s}function sa(i,t,e,n,s,r){let o=[];const a=ia(e);let l=Number.POSITIVE_INFINITY;function c(h,m,E){const P=h.inRange(t.x,t.y,s);if(n&&!P)return;const D=h.getCenterPoint(s);if(!(!!r||i.isPointInArea(D))&&!P)return;const st=a(t,D);st<l?(o=[{element:h,datasetIndex:m,index:E}],l=st):st===l&&o.push({element:h,datasetIndex:m,index:E})}return rn(i,e,t,c),o}function ss(i,t,e,n,s,r){return!r&&!i.isPointInArea(t)?[]:e==="r"&&!n?na(i,t,e,s):sa(i,t,e,n,s,r)}function sr(i,t,e,n,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return rn(i,e,t,(l,c,h)=>{l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:r}var rr={evaluateInteractionItems:rn,modes:{index(i,t,e,n){const s=Ke(t,i),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?ns(i,s,r,n,o):ss(i,s,r,!1,n,o),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,m=c.data[h];m&&!m.skip&&l.push({element:m,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=Ke(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?ns(i,s,r,n,o):ss(i,s,r,!1,n,o);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,n){const s=Ke(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;return ns(i,s,r,n,o)},nearest(i,t,e,n){const s=Ke(t,i),r=e.axis||"xy",o=e.includeInvisible||!1;return ss(i,s,r,e.intersect,n,o)},x(i,t,e,n){const s=Ke(t,i);return sr(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=Ke(t,i);return sr(i,s,"y",e.intersect,n)}}};const or=["left","top","right","bottom"];function on(i,t){return i.filter(e=>e.pos===t)}function ar(i,t){return i.filter(e=>or.indexOf(e.pos)===-1&&e.box.axis===t)}function an(i,t){return i.sort((e,n)=>{const s=t?n:e,r=t?e:n;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function ra(i){const t=[];let e,n,s,r,o,a;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function oa(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:r}=e;if(!n||!or.includes(s))continue;const o=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function aa(i,t){const e=oa(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=i.length;r<o;++r){a=i[r];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=h?h*s:l&&t.availableHeight)}return e}function la(i){const t=ra(i),e=an(t.filter(c=>c.box.fullSize),!0),n=an(on(t,"left"),!0),s=an(on(t,"right")),r=an(on(t,"top"),!0),o=an(on(t,"bottom")),a=ar(t,"x"),l=ar(t,"y");return{fullSize:e,leftAndTop:n.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:on(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function lr(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function cr(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function ca(i,t,e,n){const{pos:s,box:r}=e,o=i.maxPadding;if(!nt(s)){e.size&&(i[s]-=e.size);const m=n[e.stack]||{size:0,count:1};m.size=Math.max(m.size,e.horizontal?r.height:r.width),e.size=m.size/m.count,i[s]+=e.size}r.getPadding&&cr(o,r.getPadding());const a=Math.max(0,t.outerWidth-lr(o,i,"left","right")),l=Math.max(0,t.outerHeight-lr(o,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function ha(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function ua(i,t){const e=t.maxPadding;function n(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return n(i?["left","right"]:["top","bottom"])}function ln(i,t,e,n){const s=[];let r,o,a,l,c,h;for(r=0,o=i.length,c=0;r<o;++r){a=i[r],l=a.box,l.update(a.width||t.w,a.height||t.h,ua(a.horizontal,t));const{same:m,other:E}=ca(t,e,a,n);c|=m&&s.length,h=h||E,l.fullSize||s.push(a)}return c&&ln(s,t,e,n)||h}function wn(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function hr(i,t,e,n){const s=e.padding;let{x:r,y:o}=t;for(const a of i){const l=a.box,c=n[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const m=t.w*h,E=c.size||l.height;O(c.start)&&(o=c.start),l.fullSize?wn(l,s.left,o,e.outerWidth-s.right-s.left,E):wn(l,t.left+c.placed,o,m,E),c.start=o,c.placed+=m,o=l.bottom}else{const m=t.h*h,E=c.size||l.width;O(c.start)&&(r=c.start),l.fullSize?wn(l,r,s.top,E,e.outerHeight-s.bottom-s.top):wn(l,r,t.top+c.placed,E,m),c.start=r,c.placed+=m,r=l.right}}t.x=r,t.y=o}re.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Ve={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,n){if(!i)return;const s=ze(i.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=la(i.boxes),l=a.vertical,c=a.horizontal;H(i.boxes,et=>{typeof et.beforeLayout=="function"&&et.beforeLayout()});const h=l.reduce((et,st)=>st.box.options&&st.box.options.display===!1?et:et+1,0)||1,m=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),E=Object.assign({},s);cr(E,ze(n));const P=Object.assign({maxPadding:E,w:r,h:o,x:s.left,y:s.top},s),D=aa(l.concat(c),m);ln(a.fullSize,P,m,D),ln(l,P,m,D),ln(c,P,m,D)&&ln(l,P,m,D),ha(P),hr(a.leftAndTop,P,m,D),P.x+=P.w,P.y+=P.h,hr(a.rightAndBottom,P,m,D),i.chartArea={left:P.left,top:P.top,right:P.left+P.w,bottom:P.top+P.h,height:P.h,width:P.w},H(a.chartArea,et=>{const st=et.box;Object.assign(st,i.chartArea),st.update(P.w,P.h,{left:0,top:0,right:0,bottom:0})})}};class rs{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class ur extends rs{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const kn="$chartjs",da={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},dr=i=>i===null||i==="";function fa(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[kn]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",dr(s)){const r=wi(i,"width");r!==void 0&&(i.width=r)}if(dr(n))if(i.style.height==="")i.height=i.width/(t||2);else{const r=wi(i,"height");r!==void 0&&(i.height=r)}return i}const fr=qi?{passive:!0}:!1;function ga(i,t,e){i.addEventListener(t,e,fr)}function pa(i,t,e){i.canvas.removeEventListener(t,e,fr)}function ma(i,t){const e=da[i.type]||i.type,{x:n,y:s}=Ke(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Sn(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function ba(i,t,e){const n=i.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Sn(a.addedNodes,n),o=o&&!Sn(a.removedNodes,n);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function ya(i,t,e){const n=i.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||Sn(a.removedNodes,n),o=o&&!Sn(a.addedNodes,n);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const cn=new Map;let gr=0;function pr(){const i=window.devicePixelRatio;i!==gr&&(gr=i,cn.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function xa(i,t){cn.size||window.addEventListener("resize",pr),cn.set(i,t)}function va(i){cn.delete(i),cn.size||window.removeEventListener("resize",pr)}function _a(i,t,e){const n=i.canvas,s=n&&he(n);if(!s)return;const r=Ht((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},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(s),xa(i,r),o}function os(i,t,e){e&&e.disconnect(),t==="resize"&&va(i)}function Aa(i,t,e){const n=i.canvas,s=Ht(r=>{i.ctx!==null&&e(ma(r,i))},i,r=>{const o=r[0];return[o,o.offsetX,o.offsetY]});return ga(n,t,s),s}class mr extends rs{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(fa(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[kn])return!1;const n=e[kn].initial;["height","width"].forEach(r=>{const o=n[r];It(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=n.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[kn],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:ba,detach:ya,resize:_a}[e]||Aa;s[e]=o(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:os,detach:os,resize:os}[e]||pa)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Ri(t,e,n,s)}isAttached(t){const e=he(t);return!!(e&&e.isConnected)}}function br(i){return!pe()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?ur:mr}var yr=Object.freeze({__proto__:null,_detectPlatform:br,BasePlatform:rs,BasicPlatform:ur,DomPlatform:mr});const xr="transparent",wa={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=le(i||xr),s=n.valid&&le(t||xr);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class vr{constructor(t,e,n,s){const r=e[n];s=Xi([t.to,s,r,t.from]);const o=Xi([t.from,r,s]);this._active=!0,this._fn=t.fn||wa[t.type||typeof o],this._easing=Ki[t.easing]||Ki.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Xi([t.to,e,s,t.from]),this._from=Xi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<n),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/n%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}const ka=["x","y","borderWidth","radius","tension"],Sa=["color","borderColor","backgroundColor"];re.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Ea=Object.keys(re.animation);re.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:i=>i!=="onProgress"&&i!=="onComplete"&&i!=="fn"}),re.set("animations",{colors:{type:"color",properties:Sa},numbers:{type:"number",properties:ka}}),re.describe("animations",{_fallback:"animation"}),re.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:i=>i|0}}}});class as{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!nt(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const s=t[n];if(!nt(s))return;const r={};for(const o of Ea)r[o]=s[o];(be(s.properties)&&s.properties||[n]).forEach(o=>{(o===n||!e.has(o))&&e.set(o,r)})})}_animateOptions(t,e){const n=e.options,s=Oa(t,n);if(!s)return[];const r=this._createAnimations(s,n);return n.$shared&&Na(t.options.$animations,n).then(()=>{t.options=n},()=>{}),r}_createAnimations(t,e){const n=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),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"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let m=r[c];const E=n.get(c);if(m)if(E&&m.active()){m.update(E,h,a);continue}else m.cancel();if(!E||!E.duration){t[c]=h;continue}r[c]=m=new vr(E,t,c,h),s.push(m)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return Re.add(this._chart,n),!0}}function Na(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const r=i[n[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Oa(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function _r(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:n?r:s,end:n?s:r}}function La(i,t,e){if(e===!1)return!1;const n=_r(i,e),s=_r(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Ma(i){let t,e,n,s;return nt(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Ar(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,r;for(s=0,r=n.length;s<r;++s)e.push(n[s].index);return e}function wr(i,t,e,n={}){const s=i.keys,r=n.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(n.all)continue;break}c=i.values[l],W(c)&&(r||t===0||d(t)===d(c))&&(t+=c)}return t}}function Ca(i){const t=Object.keys(i),e=new Array(t.length);let n,s,r;for(n=0,s=t.length;n<s;++n)r=t[n],e[n]={x:r,y:i[r]};return e}function kr(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Ta(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Pa(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Ra(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function Sr(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const r=i[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function Er(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=n,l=r.axis,c=o.axis,h=Ta(r,o,n),m=t.length;let E;for(let P=0;P<m;++P){const D=t[P],{[l]:et,[c]:st}=D,lt=D._stacks||(D._stacks={});E=lt[c]=Ra(s,h,et),E[a]=st,E._top=Sr(E,o,!0,n.type),E._bottom=Sr(E,o,!1,n.type)}}function ls(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function Da(i,t){return _i(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function qa(i,t,e){return _i(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function hn(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const r=s._stacks;if(!r||r[n]===void 0||r[n][e]===void 0)return;delete r[n][e]}}}const cs=i=>i==="reset"||i==="none",Nr=(i,t)=>t?i:Object.assign({},i),Ia=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Ar(e,!0),values:null};class li{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=kr(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&hn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(m,E,P,D)=>m==="x"?E:m==="r"?D:P,r=e.xAxisID=y(n.xAxisID,ls(t,"x")),o=e.yAxisID=y(n.yAxisID,ls(t,"y")),a=e.rAxisID=y(n.rAxisID,ls(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),h=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.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 e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Gt(this._data,this),t._stacked&&hn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(nt(e))this._data=Ca(e);else if(n!==e){if(n){Gt(n,this);const s=this._cachedMeta;hn(s),s._parsed=[]}e&&Object.isExtensible(e)&&jt(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=kr(e.vScale,e),e.stack!==n.stack&&(s=!0,hn(e),e.stack=n.stack),this._resyncElements(t),(s||r!==e._stacked)&&Er(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:r,_stacked:o}=n,a=r.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,m,E;if(this._parsing===!1)n._parsed=s,n._sorted=!0,E=s;else{be(s[t])?E=this.parseArrayData(n,s,t,e):nt(s[t])?E=this.parseObjectData(n,s,t,e):E=this.parsePrimitiveData(n,s,t,e);const P=()=>m[a]===null||c&&m[a]<c[a];for(h=0;h<e;++h)n._parsed[h+t]=m=E[h],l&&(P()&&(l=!1),c=m);n._sorted=l}o&&Er(this,E)}parsePrimitiveData(t,e,n,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),h=r===o,m=new Array(s);let E,P,D;for(E=0,P=s;E<P;++E)D=E+n,m[E]={[a]:h||r.parse(c[D],D),[l]:o.parse(e[D],D)};return m}parseArrayData(t,e,n,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,h,m;for(l=0,c=s;l<c;++l)h=l+n,m=e[h],a[l]={x:r.parse(m[0],h),y:o.parse(m[1],h)};return a}parseObjectData(t,e,n,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,m,E,P;for(h=0,m=s;h<m;++h)E=h+n,P=e[E],c[h]={x:r.parse(rt(P,a),E),y:o.parse(rt(P,l),E)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:Ar(s,!0),values:e._stacks[t.axis]};return wr(a,o,r.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const r=n[e.axis];let o=r===null?NaN:r;const a=s&&n._stacks[e.axis];s&&a&&(s.values=a,o=wr(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,r=n._sorted&&t===n.iScale,o=s.length,a=this._getOtherScale(t),l=Ia(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:m}=Pa(a);let E,P;function D(){P=s[E];const et=P[a.axis];return!W(P[t.axis])||h>et||m<et}for(E=0;E<o&&!(!D()&&(this.updateRangeFromParsed(c,t,P,l),r));++E);if(r){for(E=o-1;E>=0;--E)if(!D()){this.updateRangeFromParsed(c,t,P,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],W(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Ma(y(this.options.clip,La(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let h;for(n.dataset&&n.dataset.draw(t,r,a,l),h=a;h<a+l;++h){const m=s[h];m.hidden||(m.active&&c?o.push(m):m.draw(t,r))}for(h=0;h<o.length;++h)o[h].draw(t,r)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=qa(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Da(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&O(n);if(a)return Nr(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),m=s?[`${t}Hover`,"hover",t,""]:[t,""],E=c.getOptionScopes(this.getDataset(),h),P=Object.keys(re.elements[t]),D=()=>this.getContext(n,s),et=c.resolveNamedOptions(E,P,D,m);return et.$shared&&(et.$shared=l,r[o]=Object.freeze(Nr(et,l))),et}_resolveAnimations(t,e,n){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,m=h.datasetAnimationScopeKeys(this._type,e),E=h.getOptionScopes(this.getDataset(),m);l=h.createResolver(E,this.getContext(t,n,e))}const c=new as(s,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,e){return!e||cs(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(n),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,n),{sharedOptions:r,includeOptions:o}}updateElement(t,e,n,s){cs(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!cs(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=n.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,n=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),n&&this.updateElements(r,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&hn(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}li.defaults={},li.prototype.datasetElementType=null,li.prototype.dataElementType=null;class ci{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return U(this.x)&&U(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(r=>{s[r]=n[r]&&n[r].active()?n[r]._to:this[r]}),s}}ci.defaults={},ci.defaultRoutes=void 0;const Or={values(i){return be(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,r=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=ja(i,e)}const o=M(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Yi(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=i/Math.pow(10,Math.floor(M(i)));return n===1||n===2||n===5?Or.numeric.call(this,i,t,e):""}};function ja(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var un={formatters:Or};re.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:un.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),re.route("scale.ticks","color","","color"),re.route("scale.grid","color","","borderColor"),re.route("scale.grid","borderColor","","borderColor"),re.route("scale.title","color","","color"),re.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"}),re.describe("scales",{_fallback:"scale"}),re.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function Ba(i,t){const e=i.options.ticks,n=e.maxTicksLimit||Fa(i),s=e.major.enabled?Va(t):[],r=s.length,o=s[0],a=s[r-1],l=[];if(r>n)return Ha(t,l,s,r/n),l;const c=za(s,t,n);if(r>0){let h,m;const E=r>1?Math.round((a-o)/(r-1)):null;for(En(t,l,c,It(E)?0:o-E,o),h=0,m=r-1;h<m;h++)En(t,l,c,s[h],s[h+1]);return En(t,l,c,a,It(E)?t.length:a+E),l}return En(t,l,c),l}function Fa(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function za(i,t,e){const n=Ua(i),s=t.length/e;if(!n)return Math.max(s,1);const r=f(n);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function Va(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function Ha(i,t,e,n){let s=0,r=e[0],o;for(n=Math.ceil(n),o=0;o<i.length;o++)o===r&&(t.push(i[o]),s++,r=e[s*n])}function En(i,t,e,n,s){const r=y(n,0),o=Math.min(y(s,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-n,e=l/Math.floor(l/e)),h=r;h<0;)a++,h=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===h&&(t.push(i[c]),a++,h=Math.round(r+a*e))}function Ua(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const Wa=i=>i==="left"?"right":i==="right"?"left":i,Lr=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e;function Mr(i,t){const e=[],n=i.length/t,s=i.length;let r=0;for(;r<s;r+=n)e.push(i[Math.floor(r)]);return e}function $a(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),r=i._startPixel,o=i._endPixel,a=1e-6;let l=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(l-r,o-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function Ka(i,t){H(i,e=>{const n=e.gc,s=n.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[n[r]];n.splice(0,s)}})}function dn(i){return i.drawTicks?i.tickLength:0}function Cr(i,t){if(!i.display)return 0;const e=Ce(i.font,t),n=ze(i.padding);return(be(i.text)?i.text.length:1)*e.lineHeight+n.height}function Ya(i,t){return _i(i,{scale:t,type:"scale"})}function Xa(i,t,e){return _i(i,{tick:e,index:t,type:"tick"})}function Ga(i,t,e){let n=te(i);return(e&&t!=="right"||!e&&t==="right")&&(n=Wa(n)),n}function Za(i,t,e,n){const{top:s,left:r,bottom:o,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let m=0,E,P,D;const et=o-s,st=a-r;if(i.isHorizontal()){if(P=Bt(n,r,a),nt(e)){const lt=Object.keys(e)[0],xt=e[lt];D=h[lt].getPixelForValue(xt)+et-t}else e==="center"?D=(c.bottom+c.top)/2+et-t:D=Lr(i,e,t);E=a-r}else{if(nt(e)){const lt=Object.keys(e)[0],xt=e[lt];P=h[lt].getPixelForValue(xt)-st+t}else e==="center"?P=(c.left+c.right)/2-st+t:P=Lr(i,e,t);D=Bt(n,o,s),m=e==="left"?-ct:ct}return{titleX:P,titleY:D,maxWidth:E,rotation:m}}class Oi extends ci{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:s}=this;return t=u(t,Number.POSITIVE_INFINITY),e=u(e,Number.NEGATIVE_INFINITY),n=u(n,Number.POSITIVE_INFINITY),s=u(s,Number.NEGATIVE_INFINITY),{min:u(t,n),max:u(e,s),minDefined:W(t),maxDefined:W(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:n};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(n=Math.max(n,o.max));return e=r&&e>n?n:e,n=s&&e>n?e:n,{min:u(e,u(n,e)),max:u(n,u(e,n))}}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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){T(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Qs(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Mr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Ba(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,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){T(this.options.afterUpdate,[this])}beforeSetDimensions(){T(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(){T(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),T(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){T(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,r;for(n=0,s=t.length;n<s;n++)r=t[n],r.label=T(e.callback,[r.value,n,t],this)}afterTickToLabelConversion(){T(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){T(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=this.ticks.length,s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),m=h.widest.width,E=h.highest.height,P=ot(this.chart.width-m,0,this.maxWidth);a=t.offset?this.maxWidth/n:P/(n-1),m+6>a&&(a=P/(n-(t.offset?.5:1)),l=this.maxHeight-dn(t.grid)-e.padding-Cr(t.title,this.chart.options.font),c=Math.sqrt(m*m+E*E),o=L(Math.min(Math.asin(ot((h.highest.height+6)/a,-1,1)),Math.asin(ot(l/c,-1,1))-Math.asin(ot(E/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){T(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){T(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Cr(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=dn(r)+l):(t.height=this.maxHeight,t.width=dn(r)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:m,highest:E}=this._getLabelSizes(),P=n.padding*2,D=j(this.labelRotation),et=Math.cos(D),st=Math.sin(D);if(a){const lt=n.mirror?0:st*m.width+et*E.height;t.height=Math.min(this.maxHeight,t.height+lt+P)}else{const lt=n.mirror?0:et*m.width+st*E.height;t.width=Math.min(this.maxWidth,t.width+lt+P)}this._calculatePadding(c,h,st,et)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){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,m=this.right-this.getPixelForTick(this.ticks.length-1);let E=0,P=0;l?c?(E=s*t.width,P=n*e.height):(E=n*t.height,P=s*e.width):r==="start"?P=e.width:r==="end"?E=t.width:r!=="inner"&&(E=t.width/2,P=e.width/2),this.paddingLeft=Math.max((E-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((P-m+o)*this.width/(this.width-m),0)}else{let h=e.height/2,m=t.height/2;r==="start"?(h=0,m=t.height):r==="end"&&(h=e.height,m=0),this.paddingTop=h+o,this.paddingBottom=m+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(){T(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)It(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Mr(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length)}return t}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:s}=this,r=[],o=[];let a=0,l=0,c,h,m,E,P,D,et,st,lt,xt,Mt;for(c=0;c<e;++c){if(E=t[c].label,P=this._resolveTickFontOptions(c),n.font=D=P.string,et=s[D]=s[D]||{data:{},gc:[]},st=P.lineHeight,lt=xt=0,!It(E)&&!be(E))lt=bi(n,et.data,et.gc,lt,E),xt=st;else if(be(E))for(h=0,m=E.length;h<m;++h)Mt=E[h],!It(Mt)&&!be(Mt)&&(lt=bi(n,et.data,et.gc,lt,Mt),xt+=st);r.push(lt),o.push(xt),a=Math.max(lt,a),l=Math.max(xt,l)}Ka(s,e);const Lt=r.indexOf(a),wt=o.indexOf(l),Dt=qt=>({width:r[qt]||0,height:o[qt]||0});return{first:Dt(0),last:Dt(e-1),widest:Dt(Lt),highest:Dt(wt),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ft(this._alignToPixels?ki(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=Xa(this.getContext(),t,n))}return this.$context||(this.$context=Ya(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=j(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),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*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:r,position:o}=s,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),m=dn(r),E=[],P=r.setContext(this.getContext()),D=P.drawBorder?P.borderWidth:0,et=D/2,st=function(ee){return ki(n,ee,D)};let lt,xt,Mt,Lt,wt,Dt,qt,Kt,Wt,ge,me,ce;if(o==="top")lt=st(this.bottom),Dt=this.bottom-m,Kt=lt-et,ge=st(t.top)+et,ce=t.bottom;else if(o==="bottom")lt=st(this.top),ge=t.top,ce=st(t.bottom)-et,Dt=lt+et,Kt=this.top+m;else if(o==="left")lt=st(this.right),wt=this.right-m,qt=lt-et,Wt=st(t.left)+et,me=t.right;else if(o==="right")lt=st(this.left),Wt=t.left,me=st(t.right)-et,wt=lt+et,qt=this.left+m;else if(e==="x"){if(o==="center")lt=st((t.top+t.bottom)/2+.5);else if(nt(o)){const ee=Object.keys(o)[0],Pe=o[ee];lt=st(this.chart.scales[ee].getPixelForValue(Pe))}ge=t.top,ce=t.bottom,Dt=lt+et,Kt=Dt+m}else if(e==="y"){if(o==="center")lt=st((t.left+t.right)/2);else if(nt(o)){const ee=Object.keys(o)[0],Pe=o[ee];lt=st(this.chart.scales[ee].getPixelForValue(Pe))}wt=lt-et,qt=wt-m,Wt=t.left,me=t.right}const Te=y(s.ticks.maxTicksLimit,h),Ze=Math.max(1,Math.ceil(h/Te));for(xt=0;xt<h;xt+=Ze){const ee=r.setContext(this.getContext(xt)),Pe=ee.lineWidth,Le=ee.color,zi=ee.borderDash||[],Ls=ee.borderDashOffset,Qi=ee.tickWidth,Wn=ee.tickColor,Ji=ee.tickBorderDash||[],bn=ee.tickBorderDashOffset;Mt=$a(this,xt,a),Mt!==void 0&&(Lt=ki(n,Mt,Pe),l?wt=qt=Wt=me=Lt:Dt=Kt=ge=ce=Lt,E.push({tx1:wt,ty1:Dt,tx2:qt,ty2:Kt,x1:Wt,y1:ge,x2:me,y2:ce,width:Pe,color:Le,borderDash:zi,borderDashOffset:Ls,tickWidth:Qi,tickColor:Wn,tickBorderDash:Ji,tickBorderDashOffset:bn}))}return this._ticksLength=h,this._borderValue=lt,E}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:r}=n,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:m}=r,E=dn(n.grid),P=E+h,D=m?-h:P,et=-j(this.labelRotation),st=[];let lt,xt,Mt,Lt,wt,Dt,qt,Kt,Wt,ge,me,ce,Te="middle";if(s==="top")Dt=this.bottom-D,qt=this._getXAxisLabelAlignment();else if(s==="bottom")Dt=this.top+D,qt=this._getXAxisLabelAlignment();else if(s==="left"){const ee=this._getYAxisLabelAlignment(E);qt=ee.textAlign,wt=ee.x}else if(s==="right"){const ee=this._getYAxisLabelAlignment(E);qt=ee.textAlign,wt=ee.x}else if(e==="x"){if(s==="center")Dt=(t.top+t.bottom)/2+P;else if(nt(s)){const ee=Object.keys(s)[0],Pe=s[ee];Dt=this.chart.scales[ee].getPixelForValue(Pe)+P}qt=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")wt=(t.left+t.right)/2-P;else if(nt(s)){const ee=Object.keys(s)[0],Pe=s[ee];wt=this.chart.scales[ee].getPixelForValue(Pe)}qt=this._getYAxisLabelAlignment(E).textAlign}e==="y"&&(l==="start"?Te="top":l==="end"&&(Te="bottom"));const Ze=this._getLabelSizes();for(lt=0,xt=a.length;lt<xt;++lt){Mt=a[lt],Lt=Mt.label;const ee=r.setContext(this.getContext(lt));Kt=this.getPixelForTick(lt)+r.labelOffset,Wt=this._resolveTickFontOptions(lt),ge=Wt.lineHeight,me=be(Lt)?Lt.length:1;const Pe=me/2,Le=ee.color,zi=ee.textStrokeColor,Ls=ee.textStrokeWidth;let Qi=qt;o?(wt=Kt,qt==="inner"&&(lt===xt-1?Qi=this.options.reverse?"left":"right":lt===0?Qi=this.options.reverse?"right":"left":Qi="center"),s==="top"?c==="near"||et!==0?ce=-me*ge+ge/2:c==="center"?ce=-Ze.highest.height/2-Pe*ge+ge:ce=-Ze.highest.height+ge/2:c==="near"||et!==0?ce=ge/2:c==="center"?ce=Ze.highest.height/2-Pe*ge:ce=Ze.highest.height-me*ge,m&&(ce*=-1)):(Dt=Kt,ce=(1-me)*ge/2);let Wn;if(ee.showLabelBackdrop){const Ji=ze(ee.backdropPadding),bn=Ze.heights[lt],Ms=Ze.widths[lt];let Cs=Dt+ce-Ji.top,Ts=wt-Ji.left;switch(Te){case"middle":Cs-=bn/2;break;case"bottom":Cs-=bn;break}switch(qt){case"center":Ts-=Ms/2;break;case"right":Ts-=Ms;break}Wn={left:Ts,top:Cs,width:Ms+Ji.width,height:bn+Ji.height,color:ee.backdropColor}}st.push({rotation:et,label:Lt,font:Wt,color:Le,strokeColor:zi,strokeWidth:Ls,textOffset:ce,textAlign:Qi,textBaseline:Te,translation:[wt,Dt],backdrop:Wn})}return st}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-j(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,h;return e==="left"?s?(h=this.right+r,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+r,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="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,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.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:e,options:{grid:n}}=this,s=n.setContext(this.getContext()),r=n.drawBorder?s.borderWidth:0;if(!r)return;const o=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let l,c,h,m;this.isHorizontal()?(l=ki(t,this.left,r)-r/2,c=ki(t,this.right,o)+o/2,h=m=a):(h=ki(t,this.top,r)-r/2,m=ki(t,this.bottom,o)+o/2,l=c=a),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(l,h),e.lineTo(c,m),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&nn(n,s);const r=this._labelItems||(this._labelItems=this._computeLabelItems(t));let o,a;for(o=0,a=r.length;o<a;++o){const l=r[o],c=l.font,h=l.label;l.backdrop&&(n.fillStyle=l.backdrop.color,n.fillRect(l.backdrop.left,l.backdrop.top,l.backdrop.width,l.backdrop.height));let m=l.textOffset;Si(n,h,0,m,c,l)}s&&sn(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const r=Ce(n.font),o=ze(n.padding),a=n.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||nt(e)?(l+=o.bottom,be(n.text)&&(l+=r.lineHeight*(n.text.length-1))):l+=o.top;const{titleX:c,titleY:h,maxWidth:m,rotation:E}=Za(this,l,e,a);Si(t,n.text,0,0,r,{color:n.color,maxWidth:m,rotation:E,textAlign:Ga(a,e,s),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,e=t.ticks&&t.ticks.z||0,n=y(t.grid&&t.grid.z,-1);return!this._isVisible()||this.draw!==Oi.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:n,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Ce(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Nn{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;tl(e)&&(n=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Qa(t,o,n),this.override&&re.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in re[s]&&(delete re[s][n],this.override&&delete Ie[n])}}function Qa(i,t,e){const n=K(Object.create(null),[e?re.get(e):{},re.get(t),i.defaults]);re.set(t,n),i.defaultRoutes&&Ja(t,i.defaultRoutes),i.descriptors&&re.describe(t,i.descriptors)}function Ja(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),r=[i].concat(n).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");re.route(r,s,l,a)})}function tl(i){return"id"in i&&"defaults"in i}class el{constructor(){this.controllers=new Nn(li,"datasets",!0),this.elements=new Nn(ci,"elements"),this.plugins=new Nn(Object,"plugins"),this.scales=new Nn(Oi,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(s=>{const r=n||this._getRegistryForType(s);n||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):H(s,o=>{const a=n||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,n){const s=pt(t);T(n["before"+s],[],n),e[t](n),T(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var fi=new el;class il{constructor(){this._init=[]}notify(t,e,n,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,n);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,n,s){s=s||{};for(const r of t){const o=r.plugin,a=o[n],l=[e,s,r.options];if(T(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){It(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,s=y(n.options&&n.options.plugins,{}),r=nl(n);return s===!1&&!e?[]:rl(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function nl(i){const t={},e=[],n=Object.keys(fi.plugins.items);for(let r=0;r<n.length;r++)e.push(fi.getPlugin(n[r]));const s=i.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function sl(i,t){return!t&&i===!1?null:i===!0?{}:i}function rl(i,{plugins:t,localIds:e},n,s){const r=[],o=i.getContext();for(const a of t){const l=a.id,c=sl(n[l],s);c!==null&&r.push({plugin:a,options:ol(i.config,{plugin:a,local:e[l]},c,o)})}return r}function ol(i,{plugin:t,local:e},n,s){const r=i.pluginScopeKeys(t),o=i.getOptionScopes(n,r);return e&&t.defaults&&o.push(t.defaults),i.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function hs(i,t){const e=re.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function al(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function ll(i,t){return i===t?"_index_":"_value_"}function cl(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function us(i,t){return i==="x"||i==="y"?i:t.axis||cl(t.position)||i.charAt(0).toLowerCase()}function hl(i,t){const e=Ie[i.type]||{scales:{}},n=t.scales||{},s=hs(i.type,t),r=Object.create(null),o=Object.create(null);return Object.keys(n).forEach(a=>{const l=n[a];if(!nt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=us(a,l),h=ll(c,s),m=e.scales||{};r[c]=r[c]||a,o[a]=k(Object.create(null),[{axis:c},l,m[c],m[h]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,c=a.indexAxis||hs(l,t),m=(Ie[l]||{}).scales||{};Object.keys(m).forEach(E=>{const P=al(E,c),D=a[P+"AxisID"]||r[P]||P;o[D]=o[D]||Object.create(null),k(o[D],[{axis:P},n[D],m[E]])})}),Object.keys(o).forEach(a=>{const l=o[a];k(l,[re.scales[l.type],re.scale])}),o}function Tr(i){const t=i.options||(i.options={});t.plugins=y(t.plugins,{}),t.scales=hl(i,t)}function Pr(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function ul(i){return i=i||{},i.data=Pr(i.data),Tr(i),i}const Rr=new Map,Dr=new Set;function On(i,t){let e=Rr.get(i);return e||(e=t(),Rr.set(i,e),Dr.add(e)),e}const fn=(i,t,e)=>{const n=rt(t,e);n!==void 0&&i.add(n)};class dl{constructor(t){this._config=ul(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=Pr(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(),Tr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return On(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return On(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return On(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return On(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:r}=this,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(m=>fn(l,t,m))),h.forEach(m=>fn(l,s,m)),h.forEach(m=>fn(l,Ie[r]||{},m)),h.forEach(m=>fn(l,re,m)),h.forEach(m=>fn(l,Be,m))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Dr.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ie[e]||{},re.datasets[e]||{},{type:e},re,Be]}resolveNamedOptions(t,e,n,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=qr(this._resolverCache,t,s);let l=o;if(gl(o,e)){r.$shared=!1,n=X(n)?n():n;const c=this.createResolver(t,n,a);l=ji(o,n,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,n=[""],s){const{resolver:r}=qr(this._resolverCache,t,n);return nt(e)?ji(r,e,void 0,s):r}}function qr(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let r=n.get(s);return r||(r={resolver:xn(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,r)),r}const fl=i=>nt(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||X(i[e]),!1);function gl(i,t){const{isScriptable:e,isIndexable:n}=Yn(i);for(const s of t){const r=e(s),o=n(s),a=(o||r)&&i[s];if(r&&(X(a)||fl(a))||o&&be(a))return!0}return!1}var pl="3.9.1";const ml=["top","bottom","left","right","chartArea"];function Ir(i,t){return i==="top"||i==="bottom"||ml.indexOf(i)===-1&&t==="x"}function jr(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function Br(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),T(e&&e.onComplete,[i],t)}function bl(i){const t=i.chart,e=t.options.animation;T(e&&e.onProgress,[i],t)}function Fr(i){return pe()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ln={},zr=i=>{const t=Fr(i);return Object.values(Ln).filter(e=>e.canvas===t).pop()};function yl(i,t,e){const n=Object.keys(i);for(const s of n){const r=+s;if(r>=t){const o=i[s];delete i[s],(e>0||r>t)&&(i[r+e]=o)}}}function xl(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}class Ne{constructor(t,e){const n=this.config=new dl(e),s=Fr(t),r=zr(s);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=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||br(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Qe(),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 il,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Xt(m=>this.update(m),o.resizeDelay||0),this._dataChanges=[],Ln[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Re.listen(this,"complete",Br),Re.listen(this,"progress",bl),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:r}=this;return It(t)?e&&r?r:s?n/s: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Di(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return $n(this.canvas,this.ctx),this}stop(){return Re.stop(this),this}resize(t,e){Re.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Di(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),T(n.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};H(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=us(o,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),H(r,o=>{const a=o.options,l=a.id,c=us(l,a),h=y(a.type,o.dtype);(a.position===void 0||Ir(a.position,c)!==Ir(o.dposition))&&(a.position=o.dposition),s[l]=!0;let m=null;if(l in n&&n[l].type===h)m=n[l];else{const E=fi.getScale(h);m=new E({id:l,type:h,ctx:this.ctx,chart:this}),n[m.id]=m}m.init(a,t)}),H(s,(o,a)=>{o||delete n[a]}),H(n,o=>{Ve.configure(this,o,o.options),Ve.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,r)=>s.index-r.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(jr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const r=e[n];let o=this.getDatasetMeta(n);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=a,o.indexAxis=r.indexAxis||hs(a,this.options),o.order=r.order||0,o.index=n,o.label=""+r.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const l=fi.getController(a),{datasetElementType:c,dataElementType:h}=re.datasets[a];Object.assign(l.prototype,{dataElementType:fi.getElement(h),datasetElementType:c&&fi.getElement(c)}),o.controller=new l(this,n),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){H(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.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:m}=this.getDatasetMeta(c),E=!s&&r.indexOf(m)===-1;m.buildOrUpdateElements(E),o=Math.max(+m.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),s||H(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(jr("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){H(this.scales,t=>{Ve.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!dt(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:r}of e){const o=n==="_removeElements"?-r:r;yl(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=n(0);for(let r=1;r<e;r++)if(!dt(s,n(r)))return;return Array.from(s).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;Ve.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],H(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,X(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Re.has(this)?this.attached&&!Re.running(this)&&Re.start(this):(this.draw(),Br({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resize(n,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,s=!n.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&nn(e,{left:n.left===!1?0:r.left-n.left,right:n.right===!1?this.width:r.right+n.right,top:n.top===!1?0:r.top-n.top,bottom:n.bottom===!1?this.height:r.bottom+n.bottom}),t.controller.draw(),s&&sn(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Ui(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const r=rr.modes[e];return typeof r=="function"?r(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=_i(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);O(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(r,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Re.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),$n(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Ln[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};H(this.options.events,r=>n(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",r),n("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){H(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},H(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=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}});!_(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const s=this.options.hover,r=(l,c)=>l.filter(h=>!c.some(m=>h.datasetIndex===m.datasetIndex&&h.index===m.index)),o=r(e,t),a=n?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(r||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,n,o),l=Q(t),c=xl(t,this._lastEvent,n,l);n&&(this._lastEvent=null,T(r.onHover,[t,a,this],this),l&&T(r.onClick,[t,a,this],this));const h=!_(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}}const Vr=()=>H(Ne.instances,i=>i._plugins.invalidate()),Li=!0;Object.defineProperties(Ne,{defaults:{enumerable:Li,value:re},instances:{enumerable:Li,value:Ln},overrides:{enumerable:Li,value:Ie},registry:{enumerable:Li,value:fi},version:{enumerable:Li,value:pl},getChart:{enumerable:Li,value:zr},register:{enumerable:Li,value:(...i)=>{fi.add(...i),Vr()}},unregister:{enumerable:Li,value:(...i)=>{fi.remove(...i),Vr()}}});function Fi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ds{constructor(t){this.options=t||{}}init(t){}formats(){return Fi()}parse(t,e){return Fi()}format(t,e){return Fi()}add(t,e,n){return Fi()}diff(t,e,n){return Fi()}startOf(t,e,n){return Fi()}endOf(t,e){return Fi()}}ds.override=function(i){Object.assign(ds.prototype,i)};var Hr={_date:ds};function vl(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,r=e.length;s<r;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=oe(n.sort((s,r)=>s-r))}return i._cache.$bar}function _l(i){const t=i.iScale,e=vl(t,i.type);let n=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(O(a)&&(n=Math.min(n,Math.abs(o-a)||n)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return n}function Al(i,t,e,n){const s=e.barThickness;let r,o;return It(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*n,o=1),{chunk:r/n,ratio:o,start:t.pixels[i]-r/2}}function wl(i,t,e,n){const s=t.pixels,r=s[i];let o=i>0?s[i-1]:null,a=i<s.length-1?s[i+1]:null;const l=e.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/n,ratio:e.barPercentage,start:c}}function kl(i,t,e,n){const s=e.parse(i[0],n),r=e.parse(i[1],n),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function Ur(i,t,e,n){return be(i)?kl(i,t,e,n):t[e.axis]=e.parse(i,n),t}function Wr(i,t,e,n){const s=i.iScale,r=i.vScale,o=s.getLabels(),a=s===r,l=[];let c,h,m,E;for(c=e,h=e+n;c<h;++c)E=t[c],m={},m[s.axis]=a||s.parse(o[c],c),l.push(Ur(E,m,r,c));return l}function fs(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function Sl(i,t,e){return i!==0?d(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function El(i){let t,e,n,s,r;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:n,reverse:t,top:s,bottom:r}}function Nl(i,t,e,n){let s=t.borderSkipped;const r={};if(!s){i.borderSkipped=r;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:h}=El(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=h:(r[$r(h,o,a,l)]=!0,s=c)),r[$r(s,o,a,l)]=!0,i.borderSkipped=r}function $r(i,t,e,n){return n?(i=Ol(i,t,e),i=Kr(i,e,t)):i=Kr(i,t,e),i}function Ol(i,t,e){return i===t?e:i===e?t:i}function Kr(i,t,e){return i==="start"?t:i==="end"?e:i}function Ll(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class Mn extends li{parsePrimitiveData(t,e,n,s){return Wr(t,e,n,s)}parseArrayData(t,e,n,s){return Wr(t,e,n,s)}parseObjectData(t,e,n,s){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,m=[];let E,P,D,et;for(E=n,P=n+s;E<P;++E)et=e[E],D={},D[r.axis]=r.parse(rt(et,c),E),m.push(Ur(rt(et,h),D,o,E));return m}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const r=n._custom;r&&e===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 e=this._cachedMeta,{iScale:n,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=fs(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:m,includeOptions:E}=this._getSharedOptions(e,s);for(let P=e;P<e+n;P++){const D=this.getParsed(P),et=r||It(D[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(P),st=this._calculateBarIndexPixels(P,h),lt=(D._stacks||{})[a.axis],xt={horizontal:c,base:et.base,enableBorderRadius:!lt||fs(D._custom)||o===lt._top||o===lt._bottom,x:c?et.head:st.center,y:c?st.center:et.head,height:c?st.size:Math.abs(et.size),width:c?Math.abs(et.size):st.size};E&&(xt.options=m||this.resolveDataElementOptions(P,t[P].active?"active":s));const Mt=xt.options||t[P].options;Nl(xt,Mt,lt,o),Ll(xt,Mt,h.ratio),this.updateElement(t[P],P,xt,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),r=n.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(It(h)||isNaN(h))return!0};for(const l of s)if(!(e!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));const a=t.barThickness;return{min:a||_l(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n},options:{base:s,minBarLength:r}}=this,o=s||0,a=this.getParsed(t),l=a._custom,c=fs(l);let h=a[e.axis],m=0,E=n?this.applyStack(e,a,n):h,P,D;E!==h&&(m=E-h,E=h),c&&(h=l.barStart,E=l.barEnd-l.barStart,h!==0&&d(h)!==d(l.barEnd)&&(m=0),m+=h);const et=!It(s)&&!c?s:m;let st=e.getPixelForValue(et);if(this.chart.getDataVisibility(t)?P=e.getPixelForValue(m+E):P=st,D=P-st,Math.abs(D)<r){D=Sl(D,e,o)*r,h===o&&(st-=D/2);const lt=e.getPixelForDecimal(0),xt=e.getPixelForDecimal(1),Mt=Math.min(lt,xt),Lt=Math.max(lt,xt);st=Math.max(Math.min(st,Lt),Mt),P=st+D}if(st===e.getPixelForValue(o)){const lt=d(D)*e.getLineWidthForValue(o)/2;st+=lt,D-=lt}return{size:D,base:st,head:P,center:P+D/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,r=s.skipNull,o=y(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?wl(t,e,s,c):Al(t,e,s,c),m=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=h.start+h.chunk*m+h.chunk/2,l=Math.min(o,h.chunk*h.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&n[r].draw(this._ctx)}}Mn.id="bar",Mn.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Mn.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Cn extends li{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){const r=super.parsePrimitiveData(t,e,n,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+n).radius;return r}parseArrayData(t,e,n,s){const r=super.parseArrayData(t,e,n,s);for(let o=0;o<r.length;o++){const a=e[n+o];r[o]._custom=y(a[2],this.resolveDataElementOptions(o+n).radius)}return r}parseObjectData(t,e,n,s){const r=super.parseObjectData(t,e,n,s);for(let o=0;o<r.length;o++){const a=e[n+o];r[o]._custom=y(a&&a.r&&+a.r,this.resolveDataElementOptions(o+n).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:s}=e,r=this.getParsed(t),o=n.getLabelForValue(r.x),a=s.getLabelForValue(r.y),l=r._custom;return{label:e.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=o.axis,m=a.axis;for(let E=e;E<e+n;E++){const P=t[E],D=!r&&this.getParsed(E),et={},st=et[h]=r?o.getPixelForDecimal(.5):o.getPixelForValue(D[h]),lt=et[m]=r?a.getBasePixel():a.getPixelForValue(D[m]);et.skip=isNaN(st)||isNaN(lt),c&&(et.options=l||this.resolveDataElementOptions(E,P.active?"active":s),r&&(et.options.radius=0)),this.updateElement(P,E,et,s)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=y(n&&n._custom,r),s}}Cn.id="bubble",Cn.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Cn.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function Ml(i,t,e){let n=1,s=1,r=0,o=0;if(t<yt){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),m=Math.cos(l),E=Math.sin(l),P=(Mt,Lt,wt)=>J(Mt,a,l,!0)?1:Math.max(Lt,Lt*e,wt,wt*e),D=(Mt,Lt,wt)=>J(Mt,a,l,!0)?-1:Math.min(Lt,Lt*e,wt,wt*e),et=P(0,c,m),st=P(ct,h,E),lt=D(at,c,m),xt=D(at+ct,h,E);n=(et-lt)/2,s=(st-xt)/2,r=-(et+lt)/2,o=-(st+xt)/2}return{ratioX:n,ratioY:s,offsetX:r,offsetY:o}}class Gi extends li{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let r=l=>+n[l];if(nt(n[t])){const{key:l="value"}=this._parsing;r=c=>+rt(n[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return j(this.options.rotation-90)}_getCircumference(){return j(this.options.circumference)}_getRotationExtents(){let t=yt,e=-yt;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){const s=this.chart.getDatasetMeta(n).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-o)/2,0),l=Math.min(q(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:m}=this._getRotationExtents(),{ratioX:E,ratioY:P,offsetX:D,offsetY:et}=Ml(m,h,l),st=(n.width-o)/E,lt=(n.height-o)/P,xt=Math.max(Math.min(st,lt)/2,0),Mt=$(this.options.radius,xt),Lt=Math.max(Mt*l,0),wt=(Mt-Lt)/this._getVisibleDatasetWeightTotal();this.offsetX=D*Mt,this.offsetY=et*Mt,s.total=this.calculateTotal(),this.outerRadius=Mt-wt*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-wt*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/yt)}updateElements(t,e,n,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,h=(a.left+a.right)/2,m=(a.top+a.bottom)/2,E=r&&c.animateScale,P=E?0:this.innerRadius,D=E?0:this.outerRadius,{sharedOptions:et,includeOptions:st}=this._getSharedOptions(e,s);let lt=this._getRotation(),xt;for(xt=0;xt<e;++xt)lt+=this._circumference(xt,r);for(xt=e;xt<e+n;++xt){const Mt=this._circumference(xt,r),Lt=t[xt],wt={x:h+this.offsetX,y:m+this.offsetY,startAngle:lt,endAngle:lt+Mt,circumference:Mt,outerRadius:D,innerRadius:P};st&&(wt.options=et||this.resolveDataElementOptions(xt,Lt.active?"active":s)),lt+=Mt,this.updateElement(Lt,xt,wt,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(r))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?yt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],r=Yi(e._parsed[t],n.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=n.data.datasets.length;s<r;++s)if(n.isDatasetVisible(s)){o=n.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const r=this.resolveDataElementOptions(n);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(y(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Gi.id="doughnut",Gi.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},Gi.descriptors={_scriptable:i=>i!=="spacing",_indexable:i=>i!=="spacing"},Gi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((n,s)=>{const o=i.getDatasetMeta(0).controller.getStyle(s);return{text:n,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(s),index:s}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let t=i.label;const e=": "+i.formattedValue;return be(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};class Tn extends li{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=ue(e,s,o);this._drawStart=a,this._drawCount=l,ye(e)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,n,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:m}=this._getSharedOptions(e,s),E=o.axis,P=a.axis,{spanGaps:D,segment:et}=this.options,st=U(D)?D:Number.POSITIVE_INFINITY,lt=this.chart._animationsDisabled||r||s==="none";let xt=e>0&&this.getParsed(e-1);for(let Mt=e;Mt<e+n;++Mt){const Lt=t[Mt],wt=this.getParsed(Mt),Dt=lt?Lt:{},qt=It(wt[P]),Kt=Dt[E]=o.getPixelForValue(wt[E],Mt),Wt=Dt[P]=r||qt?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,wt,l):wt[P],Mt);Dt.skip=isNaN(Kt)||isNaN(Wt)||qt,Dt.stop=Mt>0&&Math.abs(wt[E]-xt[E])>st,et&&(Dt.parsed=wt,Dt.raw=c.data[Mt]),m&&(Dt.options=h||this.resolveDataElementOptions(Mt,Lt.active?"active":s)),lt||this.updateElement(Lt,Mt,Dt,s),xt=wt}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Tn.id="line",Tn.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Tn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Pn extends li{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],r=Yi(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,n,s){return Zn.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,m=c.yCenter,E=c.getIndexAngle(0)-.5*at;let P=E,D;const et=360/this.countVisibleElements();for(D=0;D<e;++D)P+=this._computeAngle(D,s,et);for(D=e;D<e+n;D++){const st=t[D];let lt=P,xt=P+this._computeAngle(D,s,et),Mt=o.getDataVisibility(D)?c.getDistanceFromCenterForValue(this.getParsed(D).r):0;P=xt,r&&(l.animateScale&&(Mt=0),l.animateRotate&&(lt=xt=E));const Lt={x:h,y:m,innerRadius:0,outerRadius:Mt,startAngle:lt,endAngle:xt,options:this.resolveDataElementOptions(D,st.active?"active":s)};this.updateElement(st,D,Lt,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?j(this.resolveDataElementOptions(t,e).angle||n):0}}Pn.id="polarArea",Pn.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Pn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((n,s)=>{const o=i.getDatasetMeta(0).controller.getStyle(s);return{text:n,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(s),index:s}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class gs extends Gi{}gs.id="pie",gs.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Rn extends li{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return Zn.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(n.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(n,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+n;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),h=r.getPointPositionForValue(a,this.getParsed(a).r),m=o?r.xCenter:h.x,E=o?r.yCenter:h.y,P={x:m,y:E,angle:h.angle,skip:isNaN(m)||isNaN(E),options:c};this.updateElement(l,a,P,s)}}}Rn.id="radar",Rn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Rn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Dn extends li{update(t){const e=this._cachedMeta,{data:n=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=ue(e,n,s);if(this._drawStart=r,this._drawCount=o,ye(e)&&(r=0,o=n.length),this.options.showLine){const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}this.updateElements(n,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=fi.getElement("line")),super.addElements()}updateElements(t,e,n,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),m=this.getSharedOptions(h),E=this.includeOptions(s,m),P=o.axis,D=a.axis,{spanGaps:et,segment:st}=this.options,lt=U(et)?et:Number.POSITIVE_INFINITY,xt=this.chart._animationsDisabled||r||s==="none";let Mt=e>0&&this.getParsed(e-1);for(let Lt=e;Lt<e+n;++Lt){const wt=t[Lt],Dt=this.getParsed(Lt),qt=xt?wt:{},Kt=It(Dt[D]),Wt=qt[P]=o.getPixelForValue(Dt[P],Lt),ge=qt[D]=r||Kt?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,Dt,l):Dt[D],Lt);qt.skip=isNaN(Wt)||isNaN(ge)||Kt,qt.stop=Lt>0&&Math.abs(Dt[P]-Mt[P])>lt,st&&(qt.parsed=Dt,qt.raw=c.data[Lt]),E&&(qt.options=m||this.resolveDataElementOptions(Lt,wt.active?"active":s)),xt||this.updateElement(wt,Lt,qt,s),Mt=Dt}this.updateSharedOptions(m,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}Dn.id="scatter",Dn.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Dn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(i){return"("+i.label+", "+i.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Yr=Object.freeze({__proto__:null,BarController:Mn,BubbleController:Cn,DoughnutController:Gi,LineController:Tn,PolarAreaController:Pn,PieController:gs,RadarController:Rn,ScatterController:Dn});function Xr(i,t,e){const{startAngle:n,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;i.beginPath(),i.arc(r,o,a,n-c,e+c),l>s?(c=s/l,i.arc(r,o,l,e+c,n-c,!0)):i.arc(r,o,s,e+ct,n-ct),i.closePath(),i.clip()}function Cl(i){return An(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Tl(i,t,e,n){const s=Cl(i.options.borderRadius),r=(e-t)/2,o=Math.min(r,n*t/2),a=l=>{const c=(e-Math.min(r,l))*n/2;return ot(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ot(s.innerStart,0,o),innerEnd:ot(s.innerEnd,0,o)}}function Zi(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function ps(i,t,e,n,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,m=Math.max(t.outerRadius+n+e-c,0),E=h>0?h+n+e+c:0;let P=0;const D=s-l;if(n){const ee=h>0?h-n:0,Pe=m>0?m-n:0,Le=(ee+Pe)/2,zi=Le!==0?D*Le/(Le+n):D;P=(D-zi)/2}const et=Math.max(.001,D*m-e/at)/m,st=(D-et)/2,lt=l+st+P,xt=s-st-P,{outerStart:Mt,outerEnd:Lt,innerStart:wt,innerEnd:Dt}=Tl(t,E,m,xt-lt),qt=m-Mt,Kt=m-Lt,Wt=lt+Mt/qt,ge=xt-Lt/Kt,me=E+wt,ce=E+Dt,Te=lt+wt/me,Ze=xt-Dt/ce;if(i.beginPath(),r){if(i.arc(o,a,m,Wt,ge),Lt>0){const Le=Zi(Kt,ge,o,a);i.arc(Le.x,Le.y,Lt,ge,xt+ct)}const ee=Zi(ce,xt,o,a);if(i.lineTo(ee.x,ee.y),Dt>0){const Le=Zi(ce,Ze,o,a);i.arc(Le.x,Le.y,Dt,xt+ct,Ze+Math.PI)}if(i.arc(o,a,E,xt-Dt/E,lt+wt/E,!0),wt>0){const Le=Zi(me,Te,o,a);i.arc(Le.x,Le.y,wt,Te+Math.PI,lt-ct)}const Pe=Zi(qt,lt,o,a);if(i.lineTo(Pe.x,Pe.y),Mt>0){const Le=Zi(qt,Wt,o,a);i.arc(Le.x,Le.y,Mt,lt-ct,Wt)}}else{i.moveTo(o,a);const ee=Math.cos(Wt)*m+o,Pe=Math.sin(Wt)*m+a;i.lineTo(ee,Pe);const Le=Math.cos(ge)*m+o,zi=Math.sin(ge)*m+a;i.lineTo(Le,zi)}i.closePath()}function Pl(i,t,e,n,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){ps(i,t,e,n,o+yt,s);for(let c=0;c<r;++c)i.fill();isNaN(a)||(l=o+a%yt,a%yt===0&&(l+=yt))}return ps(i,t,e,n,l,s),i.fill(),l}function Rl(i,t,e){const{x:n,y:s,startAngle:r,pixelMargin:o,fullCircles:a}=t,l=Math.max(t.outerRadius-o,0),c=t.innerRadius+o;let h;for(e&&Xr(i,t,r+yt),i.beginPath(),i.arc(n,s,c,r+yt,r,!0),h=0;h<a;++h)i.stroke();for(i.beginPath(),i.arc(n,s,l,r,r+yt),h=0;h<a;++h)i.stroke()}function Dl(i,t,e,n,s,r){const{options:o}=t,{borderWidth:a,borderJoinStyle:l}=o,c=o.borderAlign==="inner";a&&(c?(i.lineWidth=a*2,i.lineJoin=l||"round"):(i.lineWidth=a,i.lineJoin=l||"bevel"),t.fullCircles&&Rl(i,t,c),c&&Xr(i,t,s),ps(i,t,e,n,s,r),i.stroke())}class qn extends ci{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.getProps(["x","y"],n),{angle:r,distance:o}=x(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),E=this.options.spacing/2,D=y(m,l-a)>=yt||J(r,a,l),et=gt(o,c+E,h+E);return D&&et}getCenterPoint(t){const{x:e,y:n,startAngle:s,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(s+r)/2,m=(o+a+c+l)/2;return{x:e+Math.cos(h)*m,y:n+Math.sin(h)*m}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,s=(e.offset||0)/2,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>yt?Math.floor(n/yt):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=at&&(a=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const l=Pl(t,this,a,r,o);Dl(t,this,a,r,l,o),t.restore()}}qn.id="arc",qn.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},qn.defaultRoutes={backgroundColor:"backgroundColor"};function Gr(i,t,e=t){i.lineCap=y(e.borderCapStyle,t.borderCapStyle),i.setLineDash(y(e.borderDash,t.borderDash)),i.lineDashOffset=y(e.borderDashOffset,t.borderDashOffset),i.lineJoin=y(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=y(e.borderWidth,t.borderWidth),i.strokeStyle=y(e.borderColor,t.borderColor)}function ql(i,t,e){i.lineTo(e.x,e.y)}function Il(i){return i.stepped?Ds:i.tension||i.cubicInterpolationMode==="monotone"?qs:ql}function Zr(i,t,e={}){const n=i.length,{start:s=0,end:r=n-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),h=s<o&&r<o||s>a&&r>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function jl(i,t,e,n){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Zr(s,e,n),h=Il(r);let{move:m=!0,reverse:E}=n||{},P,D,et;for(P=0;P<=c;++P)D=s[(a+(E?c-P:P))%o],!D.skip&&(m?(i.moveTo(D.x,D.y),m=!1):h(i,et,D,E,r.stepped),et=D);return l&&(D=s[(a+(E?c:0))%o],h(i,et,D,E,r.stepped)),!!l}function Bl(i,t,e,n){const s=t.points,{count:r,start:o,ilen:a}=Zr(s,e,n),{move:l=!0,reverse:c}=n||{};let h=0,m=0,E,P,D,et,st,lt;const xt=Lt=>(o+(c?a-Lt:Lt))%r,Mt=()=>{et!==st&&(i.lineTo(h,st),i.lineTo(h,et),i.lineTo(h,lt))};for(l&&(P=s[xt(0)],i.moveTo(P.x,P.y)),E=0;E<=a;++E){if(P=s[xt(E)],P.skip)continue;const Lt=P.x,wt=P.y,Dt=Lt|0;Dt===D?(wt<et?et=wt:wt>st&&(st=wt),h=(m*h+Lt)/++m):(Mt(),i.lineTo(Lt,wt),D=Dt,m=0,et=st=wt),lt=wt}Mt()}function ms(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Bl:jl}function Fl(i){return i.stepped?Ys:i.tension||i.cubicInterpolationMode==="monotone"?Xs:Ei}function zl(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),Gr(i,t.options),i.stroke(s)}function Vl(i,t,e,n){const{segments:s,options:r}=t,o=ms(t);for(const a of s)Gr(i,r,a.style),i.beginPath(),o(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const Hl=typeof Path2D=="function";function Ul(i,t,e,n){Hl&&!t.options.segment?zl(i,t,e,n):Vl(i,t,e,n)}class Mi extends ci{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;Ws(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=er(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],r=this.points,o=is(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=Fl(n);let c,h;for(c=0,h=o.length;c<h;++c){const{start:m,end:E}=o[c],P=r[m],D=r[E];if(P===D){a.push(P);continue}const et=Math.abs((s-P[e])/(D[e]-P[e])),st=l(P,D,et,n.stepped);st[e]=t[e],a.push(st)}return a.length===1?a[0]:a}pathSegment(t,e,n){return ms(this)(t,this,e,n)}path(t,e,n){const s=this.segments,r=ms(this);let o=this._loop;e=e||0,n=n||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+n-1});return!!o}draw(t,e,n,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Ul(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Mi.id="line",Mi.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Mi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Mi.descriptors={_scriptable:!0,_indexable:i=>i!=="borderDash"&&i!=="fill"};function Qr(i,t,e,n){const s=i.options,{[e]:r}=i.getProps([e],n);return Math.abs(t-r)<s.radius+s.hitRadius}class In extends ci{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Qr(this,t,"x",e)}inYRange(t,e){return Qr(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!Ui(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,yn(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}In.id="point",In.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},In.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function Jr(i,t){const{x:e,y:n,base:s,width:r,height:o}=i.getProps(["x","y","base","width","height"],t);let a,l,c,h,m;return i.horizontal?(m=o/2,a=Math.min(e,s),l=Math.max(e,s),c=n-m,h=n+m):(m=r/2,a=e-m,l=e+m,c=Math.min(n,s),h=Math.max(n,s)),{left:a,top:c,right:l,bottom:h}}function Ci(i,t,e,n){return i?0:ot(t,e,n)}function Wl(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,r=Qn(n);return{t:Ci(s.top,r.top,0,e),r:Ci(s.right,r.right,0,t),b:Ci(s.bottom,r.bottom,0,e),l:Ci(s.left,r.left,0,t)}}function $l(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,r=Ni(s),o=Math.min(t,e),a=i.borderSkipped,l=n||nt(s);return{topLeft:Ci(!l||a.top||a.left,r.topLeft,0,o),topRight:Ci(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Ci(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Ci(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Kl(i){const t=Jr(i),e=t.right-t.left,n=t.bottom-t.top,s=Wl(i,e/2,n/2),r=$l(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function bs(i,t,e,n){const s=t===null,r=e===null,a=i&&!(s&&r)&&Jr(i,n);return a&&(s||gt(t,a.left,a.right))&&(r||gt(e,a.top,a.bottom))}function Yl(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Xl(i,t){i.rect(t.x,t.y,t.w,t.h)}function ys(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,r=(i.x+i.w!==e.x+e.w?t:0)-n,o=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+r,h:i.h+o,radius:i.radius}}class jn extends ci{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:n,backgroundColor:s}}=this,{inner:r,outer:o}=Kl(this),a=Yl(o.radius)?Wi:Xl;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,ys(o,e,r)),t.clip(),a(t,ys(r,-e,o)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,ys(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return bs(this,t,e,n)}inXRange(t,e){return bs(this,t,null,e)}inYRange(t,e){return bs(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}jn.id="bar",jn.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},jn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var xs=Object.freeze({__proto__:null,ArcElement:qn,LineElement:Mi,PointElement:In,BarElement:jn});function Gl(i,t,e,n,s){const r=s.samples||n;if(r>=e)return i.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let h=t,m,E,P,D,et;for(o[l++]=i[h],m=0;m<r-2;m++){let st=0,lt=0,xt;const Mt=Math.floor((m+1)*a)+1+t,Lt=Math.min(Math.floor((m+2)*a)+1,e)+t,wt=Lt-Mt;for(xt=Mt;xt<Lt;xt++)st+=i[xt].x,lt+=i[xt].y;st/=wt,lt/=wt;const Dt=Math.floor(m*a)+1+t,qt=Math.min(Math.floor((m+1)*a)+1,e)+t,{x:Kt,y:Wt}=i[h];for(P=D=-1,xt=Dt;xt<qt;xt++)D=.5*Math.abs((Kt-st)*(i[xt].y-Wt)-(Kt-i[xt].x)*(lt-Wt)),D>P&&(P=D,E=i[xt],et=xt);o[l++]=E,h=et}return o[l++]=i[c],o}function Zl(i,t,e,n){let s=0,r=0,o,a,l,c,h,m,E,P,D,et;const st=[],lt=t+e-1,xt=i[t].x,Lt=i[lt].x-xt;for(o=t;o<t+e;++o){a=i[o],l=(a.x-xt)/Lt*n,c=a.y;const wt=l|0;if(wt===h)c<D?(D=c,m=o):c>et&&(et=c,E=o),s=(r*s+a.x)/++r;else{const Dt=o-1;if(!It(m)&&!It(E)){const qt=Math.min(m,E),Kt=Math.max(m,E);qt!==P&&qt!==Dt&&st.push({...i[qt],x:s}),Kt!==P&&Kt!==Dt&&st.push({...i[Kt],x:s})}o>0&&Dt!==P&&st.push(i[Dt]),st.push(a),h=wt,r=0,D=et=c,m=E=P=o}}return st}function to(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{value:t})}}function eo(i){i.data.datasets.forEach(t=>{to(t)})}function Ql(i,t){const e=t.length;let n=0,s;const{iScale:r}=i,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(n=ot(At(t,r.axis,o).lo,0,e-1)),c?s=ot(At(t,r.axis,a).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var Jl={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){eo(i);return}const n=i.width;i.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=i.getDatasetMeta(r),c=o||s.data;if(Xi([a,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const h=i.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||i.options.parsing)return;let{start:m,count:E}=Ql(l,c);const P=e.threshold||4*n;if(E<=P){to(s);return}It(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(et){this._data=et}}));let D;switch(e.algorithm){case"lttb":D=Gl(c,m,E,n,e);break;case"min-max":D=Zl(c,m,E,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=D})},destroy(i){eo(i)}};function tc(i,t,e){const n=i.segments,s=i.points,r=t.points,o=[];for(const a of n){let{start:l,end:c}=a;c=_s(l,c,s);const h=vs(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:h,start:s[l],end:s[c]});continue}const m=is(t,h);for(const E of m){const P=vs(e,r[E.start],r[E.end],E.loop),D=es(a,s,P);for(const et of D)o.push({source:et,target:E,start:{[e]:io(h,P,"start",Math.max)},end:{[e]:io(h,P,"end",Math.min)}})}}return o}function vs(i,t,e,n){if(n)return;let s=t[i],r=e[i];return i==="angle"&&(s=B(s),r=B(r)),{property:i,start:s,end:r}}function ec(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=_s(o,a,s);const l=s[o],c=s[a];n!==null?(r.push({x:l.x,y:n}),r.push({x:c.x,y:n})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function _s(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function io(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function no(i,t){let e=[],n=!1;return be(i)?(n=!0,e=i):e=ec(i,t),e.length?new Mi({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function so(i){return i&&i.fill!==!1}function ic(i,t,e){let s=i[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!W(s))return s;if(o=i[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function nc(i,t,e){const n=ac(i);if(nt(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return W(s)&&Math.floor(s)===s?sc(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function sc(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function rc(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:nt(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function oc(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:nt(i)?n=i.value:n=t.getBaseValue(),n}function ac(i){const t=i.options,e=t.fill;let n=y(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function lc(i){const{scale:t,index:e,line:n}=i,s=[],r=n.segments,o=n.points,a=cc(t,e);a.push(no({x:null,y:t.bottom},n));for(let l=0;l<r.length;l++){const c=r[l];for(let h=c.start;h<=c.end;h++)hc(s,o[h],a)}return new Mi({points:s,options:{}})}function cc(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const r=n[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function hc(i,t,e){const n=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=uc(r,t,"x");if(!(!l||o&&a)){if(o)n.unshift(l);else if(i.push(l),!a)break}}i.push(...n)}function uc(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],r=i.segments,o=i.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const h=r[c],m=o[h.start][e],E=o[h.end][e];if(gt(s,m,E)){a=s===m,l=s===E;break}}return{first:a,last:l,point:n}}class ro{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:yt},t.arc(s,r,o,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:n+Math.sin(r)*s,angle:r}}}function dc(i){const{chart:t,fill:e,line:n}=i;if(W(e))return fc(t,e);if(e==="stack")return lc(i);if(e==="shape")return!0;const s=gc(i);return s instanceof ro?s:no(s,n)}function fc(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function gc(i){return(i.scale||{}).getPointPositionForValue?mc(i):pc(i)}function pc(i){const{scale:t={},fill:e}=i,n=rc(e,t);if(W(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function mc(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,r=n.reverse?t.max:t.min,o=oc(e,t,r),a=[];if(n.grid.circular){const l=t.getPointPositionForValue(0,r);return new ro({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function As(i,t,e){const n=dc(t),{line:s,scale:r,axis:o}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:m=c}=l||{};n&&s.points.length&&(nn(i,e),bc(i,{line:s,target:n,above:h,below:m,area:e,scale:r,axis:o}),sn(i))}function bc(i,t){const{line:e,target:n,above:s,below:r,area:o,scale:a}=t,l=e._loop?"angle":t.axis;i.save(),l==="x"&&r!==s&&(oo(i,n,o.top),ao(i,{line:e,target:n,color:s,scale:a,property:l}),i.restore(),i.save(),oo(i,n,o.bottom)),ao(i,{line:e,target:n,color:r,scale:a,property:l}),i.restore()}function oo(i,t,e){const{segments:n,points:s}=t;let r=!0,o=!1;i.beginPath();for(const a of n){const{start:l,end:c}=a,h=s[l],m=s[_s(l,c,s)];r?(i.moveTo(h.x,h.y),r=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),o=!!t.pathSegment(i,a,{move:o}),o?i.closePath():i.lineTo(m.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function ao(i,t){const{line:e,target:n,property:s,color:r,scale:o}=t,a=tc(e,n,s);for(const{source:l,target:c,start:h,end:m}of a){const{style:{backgroundColor:E=r}={}}=l,P=n!==!0;i.save(),i.fillStyle=E,yc(i,o,P&&vs(s,h,m)),i.beginPath();const D=!!e.pathSegment(i,l);let et;if(P){D?i.closePath():lo(i,n,m,s);const st=!!n.pathSegment(i,c,{move:D,reverse:!0});et=D&&st,et||lo(i,n,h,s)}i.closePath(),i.fill(et?"evenodd":"nonzero"),i.restore()}}function yc(i,t,e){const{top:n,bottom:s}=t.chart.chartArea,{property:r,start:o,end:a}=e||{};r==="x"&&(i.beginPath(),i.rect(o,n,a-o,s-n),i.clip())}function lo(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var xc={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<n;++o)r=i.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof Mi&&(l={visible:i.isDatasetVisible(o),index:o,fill:nc(a,o,n),chart:i,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<n;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=ic(s,o,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),r=i.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),n&&a.fill&&As(i.ctx,a,r))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const r=n[s].$filler;so(r)&&As(i.ctx,r,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!so(n)||e.drawTime!=="beforeDatasetDraw"||As(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const co=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},vc=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class ho extends ci{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=T(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=Ce(n.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=co(n,r);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(o,r,a,l)+10):(h=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let m=t;r.textAlign="left",r.textBaseline="middle";let E=-1,P=-h;return this.legendItems.forEach((D,et)=>{const st=n+e/2+r.measureText(D.text).width;(et===0||c[c.length-1]+st+2*a>o)&&(m+=h,c[c.length-(et>0?0:1)]=0,P+=h,E++),l[et]={left:0,top:P,row:E,width:st,height:s},c[c.length-1]+=st+a}),m}_fitCols(t,e,n,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=o-t;let m=a,E=0,P=0,D=0,et=0;return this.legendItems.forEach((st,lt)=>{const xt=n+e/2+r.measureText(st.text).width;lt>0&&P+s+2*a>h&&(m+=E+a,c.push({width:E,height:P}),D+=E+a,et++,E=P=0),l[lt]={left:D,top:P,col:et,width:xt,height:s},E=Math.max(E,xt),P+=s+a}),m+=E,c.push({width:E,height:P}),m}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:r}}=this,o=Bi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Bt(n,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=Bt(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Bt(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=Bt(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;nn(t,this),this._draw(),sn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:r,labels:o}=t,a=re.color,l=Bi(t.rtl,this.left,this.width),c=Ce(o.font),{color:h,padding:m}=o,E=c.size,P=E/2;let D;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:et,boxHeight:st,itemHeight:lt}=co(o,E),xt=function(qt,Kt,Wt){if(isNaN(et)||et<=0||isNaN(st)||st<0)return;s.save();const ge=y(Wt.lineWidth,1);if(s.fillStyle=y(Wt.fillStyle,a),s.lineCap=y(Wt.lineCap,"butt"),s.lineDashOffset=y(Wt.lineDashOffset,0),s.lineJoin=y(Wt.lineJoin,"miter"),s.lineWidth=ge,s.strokeStyle=y(Wt.strokeStyle,a),s.setLineDash(y(Wt.lineDash,[])),o.usePointStyle){const me={radius:st*Math.SQRT2/2,pointStyle:Wt.pointStyle,rotation:Wt.rotation,borderWidth:ge},ce=l.xPlus(qt,et/2),Te=Kt+P;Kn(s,me,ce,Te,o.pointStyleWidth&&et)}else{const me=Kt+Math.max((E-st)/2,0),ce=l.leftForLtr(qt,et),Te=Ni(Wt.borderRadius);s.beginPath(),Object.values(Te).some(Ze=>Ze!==0)?Wi(s,{x:ce,y:me,w:et,h:st,radius:Te}):s.rect(ce,me,et,st),s.fill(),ge!==0&&s.stroke()}s.restore()},Mt=function(qt,Kt,Wt){Si(s,Wt.text,qt,Kt+lt/2,c,{strikethrough:Wt.hidden,textAlign:l.textAlign(Wt.textAlign)})},Lt=this.isHorizontal(),wt=this._computeTitleHeight();Lt?D={x:Bt(r,this.left+m,this.right-n[0]),y:this.top+m+wt,line:0}:D={x:this.left+m,y:Bt(r,this.top+wt+m,this.bottom-e[0].height),line:0},Jn(this.ctx,t.textDirection);const Dt=lt+m;this.legendItems.forEach((qt,Kt)=>{s.strokeStyle=qt.fontColor||h,s.fillStyle=qt.fontColor||h;const Wt=s.measureText(qt.text).width,ge=l.textAlign(qt.textAlign||(qt.textAlign=o.textAlign)),me=et+P+Wt;let ce=D.x,Te=D.y;l.setWidth(this.width),Lt?Kt>0&&ce+me+m>this.right&&(Te=D.y+=Dt,D.line++,ce=D.x=Bt(r,this.left+m,this.right-n[D.line])):Kt>0&&Te+Dt>this.bottom&&(ce=D.x=ce+e[D.line].width+m,D.line++,Te=D.y=Bt(r,this.top+wt+m,this.bottom-e[D.line].height));const Ze=l.x(ce);xt(Ze,Te,qt),ce=ae(ge,ce+et+P,Lt?ce+me:this.right,t.rtl),Mt(l.x(ce),Te,qt),Lt?D.x+=me+m:D.y+=Dt}),ts(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=Ce(e.font),s=ze(e.padding);if(!e.display)return;const r=Bi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=n.size/2,c=s.top+l;let h,m=this.left,E=this.width;if(this.isHorizontal())E=Math.max(...this.lineWidths),h=this.top+c,m=Bt(t.align,m,this.right-E);else{const D=this.columnSizes.reduce((et,st)=>Math.max(et,st.height),0);h=c+Bt(t.align,this.top,this.bottom-D-t.labels.padding-this._computeTitleHeight())}const P=Bt(a,m,m+E);o.textAlign=r.textAlign(te(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=n.string,Si(o,e.text,P,h,n)}_computeTitleHeight(){const t=this.options.title,e=Ce(t.font),n=ze(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,r;if(gt(t,this.left,this.right)&>(e,this.top,this.bottom)){for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(s=r[n],gt(t,s.left,s.left+s.width)&>(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!_c(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=vc(s,n);s&&!r&&T(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!r&&T(e.onHover,[t,n,this],this)}else n&&T(e.onClick,[t,n,this],this)}}function _c(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Ac={id:"legend",_element:ho,start(i,t,e){const n=i.legend=new ho({ctx:i.ctx,options:e,chart:i});Ve.configure(i,n,e),Ve.addBox(i,n)},stop(i){Ve.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;Ve.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:r}}=i.legend.options;return i._getSortedDatasetMetas().map(o=>{const a=o.controller.getStyle(e?0:void 0),l=ze(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:n||a.pointStyle,rotation:a.rotation,textAlign:s||a.textAlign,borderRadius:0,datasetIndex:o.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class ws extends ci{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=be(n.text)?n.text.length:1;this._padding=ze(n.padding);const r=s*Ce(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,h,m;return this.isHorizontal()?(h=Bt(a,n,r),m=e+t,c=r-n):(o.position==="left"?(h=n+t,m=Bt(a,s,e),l=at*-.5):(h=r-t,m=Bt(a,e,s),l=at*.5),c=s-e),{titleX:h,titleY:m,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=Ce(e.font),r=n.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Si(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:te(e.align),textBaseline:"middle",translation:[o,a]})}}function wc(i,t){const e=new ws({ctx:i.ctx,options:t,chart:i});Ve.configure(i,e,t),Ve.addBox(i,e),i.titleBlock=e}var kc={id:"title",_element:ws,start(i,t,e){wc(i,e)},stop(i){const t=i.titleBlock;Ve.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;Ve.configure(i,n,e),n.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Bn=new WeakMap;var Sc={id:"subtitle",start(i,t,e){const n=new ws({ctx:i.ctx,options:e,chart:i});Ve.configure(i,n,e),Ve.addBox(i,n),Bn.set(i,n)},stop(i){Ve.removeBox(i,Bn.get(i)),Bn.delete(i)},beforeUpdate(i,t,e){const n=Bn.get(i);Ve.configure(i,n,e),n.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const gn={average(i){if(!i.length)return!1;let t,e,n=0,s=0,r=0;for(t=0,e=i.length;t<e;++t){const o=i[t].element;if(o&&o.hasValue()){const a=o.tooltipPosition();n+=a.x,s+=a.y,++r}}return{x:n/r,y:s/r}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=i.length;r<o;++r){const l=i[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=w(t,c);h<s&&(s=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,n=l.y}return{x:e,y:n}}};function yi(i,t){return t&&(be(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Ai(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
`)>-1?i.split(`
`):i}function Ec(i,t){const{element:e,datasetIndex:n,index:s}=t,r=i.getDatasetMeta(n).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:i,label:o,parsed:r.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function uo(i,t){const e=i.chart.ctx,{body:n,footer:s,title:r}=i,{boxWidth:o,boxHeight:a}=t,l=Ce(t.bodyFont),c=Ce(t.titleFont),h=Ce(t.footerFont),m=r.length,E=s.length,P=n.length,D=ze(t.padding);let et=D.height,st=0,lt=n.reduce((Lt,wt)=>Lt+wt.before.length+wt.lines.length+wt.after.length,0);if(lt+=i.beforeBody.length+i.afterBody.length,m&&(et+=m*c.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),lt){const Lt=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;et+=P*Lt+(lt-P)*l.lineHeight+(lt-1)*t.bodySpacing}E&&(et+=t.footerMarginTop+E*h.lineHeight+(E-1)*t.footerSpacing);let xt=0;const Mt=function(Lt){st=Math.max(st,e.measureText(Lt).width+xt)};return e.save(),e.font=c.string,H(i.title,Mt),e.font=l.string,H(i.beforeBody.concat(i.afterBody),Mt),xt=t.displayColors?o+2+t.boxPadding:0,H(n,Lt=>{H(Lt.before,Mt),H(Lt.lines,Mt),H(Lt.after,Mt)}),xt=0,e.font=h.string,H(i.footer,Mt),e.restore(),st+=D.width,{width:st,height:et}}function Nc(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function Oc(i,t,e,n){const{x:s,width:r}=n,o=e.caretSize+e.caretPadding;if(i==="left"&&s+r+o>t.width||i==="right"&&s-r-o<0)return!0}function Lc(i,t,e,n){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=i;let c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Oc(c,i,t,e)&&(c="center"),c}function fo(i,t,e){const n=e.yAlign||t.yAlign||Nc(i,e);return{xAlign:e.xAlign||t.xAlign||Lc(i,t,e,n),yAlign:n}}function Mc(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Cc(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function go(i,t,e,n){const{caretSize:s,caretPadding:r,cornerRadius:o}=i,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:h,topRight:m,bottomLeft:E,bottomRight:P}=Ni(o);let D=Mc(t,a);const et=Cc(t,l,c);return l==="center"?a==="left"?D+=c:a==="right"&&(D-=c):a==="left"?D-=Math.max(h,E)+s:a==="right"&&(D+=Math.max(m,P)+s),{x:ot(D,0,n.width-t.width),y:ot(et,0,n.height-t.height)}}function Fn(i,t,e){const n=ze(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function po(i){return yi([],Ai(i))}function Tc(i,t,e){return _i(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function mo(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}class ks extends ci{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||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,r=new as(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Tc(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=n.beforeTitle.apply(this,[t]),r=n.title.apply(this,[t]),o=n.afterTitle.apply(this,[t]);let a=[];return a=yi(a,Ai(s)),a=yi(a,Ai(r)),a=yi(a,Ai(o)),a}getBeforeBody(t,e){return po(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:n}=e,s=[];return H(t,r=>{const o={before:[],lines:[],after:[]},a=mo(n,r);yi(o.before,Ai(a.beforeLabel.call(this,r))),yi(o.lines,a.label.call(this,r)),yi(o.after,Ai(a.afterLabel.call(this,r))),s.push(o)}),s}getAfterBody(t,e){return po(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:n}=e,s=n.beforeFooter.apply(this,[t]),r=n.footer.apply(this,[t]),o=n.afterFooter.apply(this,[t]);let a=[];return a=yi(a,Ai(s)),a=yi(a,Ai(r)),a=yi(a,Ai(o)),a}_createItems(t){const e=this._active,n=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Ec(this.chart,e[l]));return t.filter&&(a=a.filter((h,m,E)=>t.filter(h,m,E,n))),t.itemSort&&(a=a.sort((h,m)=>t.itemSort(h,m,n))),H(a,h=>{const m=mo(t.callbacks,h);s.push(m.labelColor.call(this,h)),r.push(m.labelPointStyle.call(this,h)),o.push(m.labelTextColor.call(this,h))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=gn[n.position].call(this,s,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const l=this._size=uo(this,n),c=Object.assign({},a,l),h=fo(this.chart,n,c),m=go(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:m.x,y:m.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&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const r=this.getCaretPosition(t,n,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:m}=Ni(a),{x:E,y:P}=t,{width:D,height:et}=e;let st,lt,xt,Mt,Lt,wt;return r==="center"?(Lt=P+et/2,s==="left"?(st=E,lt=st-o,Mt=Lt+o,wt=Lt-o):(st=E+D,lt=st+o,Mt=Lt-o,wt=Lt+o),xt=st):(s==="left"?lt=E+Math.max(l,h)+o:s==="right"?lt=E+D-Math.max(c,m)-o:lt=this.caretX,r==="top"?(Mt=P,Lt=Mt-o,st=lt-o,xt=lt+o):(Mt=P+et,Lt=Mt+o,st=lt+o,xt=lt-o),wt=Mt),{x1:st,x2:lt,x3:xt,y1:Mt,y2:Lt,y3:wt}}drawTitle(t,e,n){const s=this.title,r=s.length;let o,a,l;if(r){const c=Bi(n.rtl,this.x,this.width);for(t.x=Fn(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",o=Ce(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,s,r){const o=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c,boxPadding:h}=r,m=Ce(r.bodyFont),E=Fn(this,"left",r),P=s.x(E),D=l<m.lineHeight?(m.lineHeight-l)/2:0,et=e.y+D;if(r.usePointStyle){const st={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},lt=s.leftForLtr(P,c)+c/2,xt=et+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,yn(t,st,lt,xt),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,yn(t,st,lt,xt)}else{t.lineWidth=nt(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 st=s.leftForLtr(P,c-h),lt=s.leftForLtr(s.xPlus(P,1),c-h-2),xt=Ni(o.borderRadius);Object.values(xt).some(Mt=>Mt!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Wi(t,{x:st,y:et,w:c,h:l,radius:xt}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Wi(t,{x:lt,y:et+1,w:c-2,h:l-2,radius:xt}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(st,et,c,l),t.strokeRect(st,et,c,l),t.fillStyle=o.backgroundColor,t.fillRect(lt,et+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=n,m=Ce(n.bodyFont);let E=m.lineHeight,P=0;const D=Bi(n.rtl,this.x,this.width),et=function(Kt){e.fillText(Kt,D.x(t.x+P),t.y+E/2),t.y+=E+r},st=D.textAlign(o);let lt,xt,Mt,Lt,wt,Dt,qt;for(e.textAlign=o,e.textBaseline="middle",e.font=m.string,t.x=Fn(this,st,n),e.fillStyle=n.bodyColor,H(this.beforeBody,et),P=a&&st!=="right"?o==="center"?c/2+h:c+2+h:0,Lt=0,Dt=s.length;Lt<Dt;++Lt){for(lt=s[Lt],xt=this.labelTextColors[Lt],e.fillStyle=xt,H(lt.before,et),Mt=lt.lines,a&&Mt.length&&(this._drawColorBox(e,t,Lt,D,n),E=Math.max(m.lineHeight,l)),wt=0,qt=Mt.length;wt<qt;++wt)et(Mt[wt]),E=m.lineHeight;H(lt.after,et)}P=0,E=m.lineHeight,H(this.afterBody,et),t.y-=r}drawFooter(t,e,n){const s=this.footer,r=s.length;let o,a;if(r){const l=Bi(n.rtl,this.x,this.width);for(t.x=Fn(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=l.textAlign(n.footerAlign),e.textBaseline="middle",o=Ce(n.footerFont),e.fillStyle=n.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:h}=n,{topLeft:m,topRight:E,bottomLeft:P,bottomRight:D}=Ni(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+m,l),o==="top"&&this.drawCaret(t,e,n,s),e.lineTo(a+c-E,l),e.quadraticCurveTo(a+c,l,a+c,l+E),o==="center"&&r==="right"&&this.drawCaret(t,e,n,s),e.lineTo(a+c,l+h-D),e.quadraticCurveTo(a+c,l+h,a+c-D,l+h),o==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(a+P,l+h),e.quadraticCurveTo(a,l+h,a,l+h-P),o==="center"&&r==="left"&&this.drawCaret(t,e,n,s),e.lineTo(a,l+m),e.quadraticCurveTo(a,l,a+m,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,r=n&&n.y;if(s||r){const o=gn[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=uo(this,t),l=Object.assign({},o,this._size),c=fo(e,t,l),h=go(t,l,c,e);(s._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 e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=ze(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,s,e),Jn(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),ts(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=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=!_(n,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,n),a=this._positionChanged(o,t),l=e||!_(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e;const o=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:n,caretY:s,options:r}=this,o=gn[r.position].call(this,t,e);return o!==!1&&(n!==o.x||s!==o.y)}}ks.positioners=gn;var Pc={id:"tooltip",_element:ks,positioners:gn,afterInit(i,t,e){e&&(i.tooltip=new ks({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",e)===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,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:{beforeTitle:De,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:De,beforeBody:De,beforeLabel:De,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return It(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:De,afterBody:De,beforeFooter:De,footer:De,afterFooter:De}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},bo=Object.freeze({__proto__:null,Decimation:Jl,Filler:xc,Legend:Ac,SubTitle:Sc,Title:kc,Tooltip:Pc});const Rc=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Dc(i,t,e,n){const s=i.indexOf(t);if(s===-1)return Rc(i,t,e,n);const r=i.lastIndexOf(t);return s!==r?e:s}const qc=(i,t)=>i===null?null:ot(Math.round(i),0,t);class zn extends Oi{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:r}of e)n[s]===r&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(It(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:Dc(n,t,y(e,t),this._addedLabels),qc(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}zn.id="category",zn.defaults={ticks:{callback:zn.prototype.getLabelForValue}};function Ic(i,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:h,maxDigits:m,includeBounds:E}=i,P=r||1,D=h-1,{min:et,max:st}=t,lt=!It(o),xt=!It(a),Mt=!It(c),Lt=(st-et)/(m+1);let wt=g((st-et)/D/P)*P,Dt,qt,Kt,Wt;if(wt<1e-14&&!lt&&!xt)return[{value:et},{value:st}];Wt=Math.ceil(st/wt)-Math.floor(et/wt),Wt>D&&(wt=g(Wt*wt/D/P)*P),It(l)||(Dt=Math.pow(10,l),wt=Math.ceil(wt*Dt)/Dt),s==="ticks"?(qt=Math.floor(et/wt)*wt,Kt=Math.ceil(st/wt)*wt):(qt=et,Kt=st),lt&&xt&&r&&N((a-o)/r,wt/1e3)?(Wt=Math.round(Math.min((a-o)/wt,h)),wt=(a-o)/Wt,qt=o,Kt=a):Mt?(qt=lt?o:qt,Kt=xt?a:Kt,Wt=c-1,wt=(Kt-qt)/Wt):(Wt=(Kt-qt)/wt,A(Wt,Math.round(Wt),wt/1e3)?Wt=Math.round(Wt):Wt=Math.ceil(Wt));const ge=Math.max(p(wt),p(qt));Dt=Math.pow(10,It(l)?ge:l),qt=Math.round(qt*Dt)/Dt,Kt=Math.round(Kt*Dt)/Dt;let me=0;for(lt&&(E&&qt!==o?(e.push({value:o}),qt<o&&me++,A(Math.round((qt+me*wt)*Dt)/Dt,o,yo(o,Lt,i))&&me++):qt<o&&me++);me<Wt;++me)e.push({value:Math.round((qt+me*wt)*Dt)/Dt});return xt&&E&&Kt!==a?e.length&&A(e[e.length-1].value,a,yo(a,Lt,i))?e[e.length-1].value=a:e.push({value:a}):(!xt||Kt===a)&&e.push({value:Kt}),e}function yo(i,t,{horizontal:e,minRotation:n}){const s=j(n),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+i).length;return Math.min(t/r,o)}class Vn extends Oi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return It(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=n?r:l;if(t){const l=d(s),c=d(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=Ic(s,r);return t.bounds==="ticks"&&z(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 e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Yi(t,this.chart.options.locale,this.options.ticks.format)}}class Ss extends Vn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?t:0,this.max=W(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=j(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Ss.id="linear",Ss.defaults={ticks:{callback:un.formatters.numeric}};function xo(i){return i/Math.pow(10,Math.floor(M(i)))===1}function jc(i,t){const e=Math.floor(M(t.max)),n=Math.ceil(t.max/Math.pow(10,e)),s=[];let r=u(i.min,Math.pow(10,Math.floor(M(t.min)))),o=Math.floor(M(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:r,major:xo(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o<e||o===e&&a<n);const c=u(i.max,r);return s.push({value:c,major:xo(r)}),s}class Es extends Oi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=Vn.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return W(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?Math.max(0,t):null,this.max=W(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const r=l=>n=t?n:l,o=l=>s=e?s:l,a=(l,c)=>Math.pow(10,Math.floor(M(l))+c);n===s&&(n<=0?(r(1),o(10)):(r(a(n,-1)),o(a(s,1)))),n<=0&&r(a(s,-1)),s<=0&&o(a(n,1)),this._zero&&this.min!==this._suggestedMin&&n===a(this.min,0)&&r(a(n,-1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=jc(e,this);return t.bounds==="ticks"&&z(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":Yi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=M(t),this._valueRange=M(this.max)-M(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(M(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}Es.id="logarithmic",Es.defaults={ticks:{callback:un.formatters.logarithmic,major:{enabled:!0}}};function Ns(i){const t=i.ticks;if(t.display&&i.display){const e=ze(t.backdropPadding);return y(t.font&&t.font.size,re.font.size)+e.height}return 0}function Bc(i,t,e){return e=be(e)?e:[e],{w:Ii(i,t.string,e),h:e.length*t.lineHeight}}function vo(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function Fc(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],r=i._pointLabels.length,o=i.options.pointLabels,a=o.centerPointLabels?at/r:0;for(let l=0;l<r;l++){const c=o.setContext(i.getPointLabelContext(l));s[l]=c.padding;const h=i.getPointPosition(l,i.drawingArea+s[l],a),m=Ce(c.font),E=Bc(i.ctx,m,i._pointLabels[l]);n[l]=E;const P=B(i.getIndexAngle(l)+a),D=Math.round(L(P)),et=vo(D,h.x,E.w,0,180),st=vo(D,h.y,E.h,90,270);zc(e,t,P,et,st)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Vc(i,n,s)}function zc(i,t,e,n,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;n.start<t.l?(a=(t.l-n.start)/r,i.l=Math.min(i.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/r,i.r=Math.max(i.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,i.t=Math.min(i.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,i.b=Math.max(i.b,t.b+l))}function Vc(i,t,e){const n=[],s=i._pointLabels.length,r=i.options,o=Ns(r)/2,a=i.drawingArea,l=r.pointLabels.centerPointLabels?at/s:0;for(let c=0;c<s;c++){const h=i.getPointPosition(c,a+o+e[c],l),m=Math.round(L(B(h.angle+ct))),E=t[c],P=Wc(h.y,E.h,m),D=Hc(m),et=Uc(h.x,E.w,D);n.push({x:h.x,y:P,textAlign:D,left:et,top:P,right:et+E.w,bottom:P+E.h})}return n}function Hc(i){return i===0||i===180?"center":i<180?"left":"right"}function Uc(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function Wc(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function $c(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const r=n.setContext(i.getPointLabelContext(s)),o=Ce(r.font),{x:a,y:l,textAlign:c,left:h,top:m,right:E,bottom:P}=i._pointLabelItems[s],{backdropColor:D}=r;if(!It(D)){const et=Ni(r.borderRadius),st=ze(r.backdropPadding);e.fillStyle=D;const lt=h-st.left,xt=m-st.top,Mt=E-h+st.width,Lt=P-m+st.height;Object.values(et).some(wt=>wt!==0)?(e.beginPath(),Wi(e,{x:lt,y:xt,w:Mt,h:Lt,radius:et}),e.fill()):e.fillRect(lt,xt,Mt,Lt)}Si(e,i._pointLabels[s],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function _o(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,yt);else{let r=i.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<n;o++)r=i.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function Kc(i,t,e,n){const s=i.ctx,r=t.circular,{color:o,lineWidth:a}=t;!r&&!n||!o||!a||e<0||(s.save(),s.strokeStyle=o,s.lineWidth=a,s.setLineDash(t.borderDash),s.lineDashOffset=t.borderDashOffset,s.beginPath(),_o(i,e,r,n),s.closePath(),s.stroke(),s.restore())}function Yc(i,t,e){return _i(i,{label:e,index:t,type:"pointLabel"})}class pn extends Vn{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=ze(Ns(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=W(t)&&!isNaN(t)?t:0,this.max=W(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ns(this.options))}generateTickLabels(t){Vn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=T(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?Fc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=yt/(this._pointLabels.length||1),n=this.options.startAngle||0;return B(t*e+j(n))}getDistanceFromCenterForValue(t){if(It(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(It(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return Yc(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-ct+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),_o(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s}=e,r=this._pointLabels.length;let o,a,l;if(e.pointLabels.display&&$c(this,r),s.display&&this.ticks.forEach((c,h)=>{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);const m=s.setContext(this.getContext(h-1));Kc(this,m,a,r)}}),n.display){for(t.save(),o=r-1;o>=0;o--){const c=n.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:m}=c;!m||!h||(t.lineWidth=m,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=Ce(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const m=ze(c.backdropPadding);t.fillRect(-o/2-m.left,-r-h.size/2-m.top,o+m.width,h.size+m.height)}Si(t,a.label,0,-r,h,{color:c.color})}),t.restore()}drawTitle(){}}pn.id="radialLinear",pn.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:un.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}},pn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},pn.descriptors={angleLines:{_fallback:"grid"}};const Hn={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}},ii=Object.keys(Hn);function Xc(i,t){return i-t}function Ao(i,t){if(It(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:r}=i._parseOpts;let o=t;return typeof n=="function"&&(o=n(o)),W(o)||(o=typeof n=="string"?e.parse(o,n):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(U(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function wo(i,t,e,n){const s=ii.length;for(let r=ii.indexOf(i);r<s-1;++r){const o=Hn[ii[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=n)return ii[r]}return ii[s-1]}function Gc(i,t,e,n,s){for(let r=ii.length-1;r>=ii.indexOf(e);r--){const o=ii[r];if(Hn[o].common&&i._adapter.diff(s,n,o)>=t-1)return o}return ii[e?ii.indexOf(e):0]}function Zc(i){for(let t=ii.indexOf(i)+1,e=ii.length;t<e;++t)if(Hn[ii[t]].common)return ii[t]}function ko(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=_t(e,t),r=e[n]>=t?e[n]:e[s];i[r]=!0}}function Qc(i,t,e,n){const s=i._adapter,r=+s.startOf(t[0].value,n),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,n))l=e[a],l>=0&&(t[l].major=!0);return t}function So(i,t,e){const n=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,n.push({value:a,major:!1});return r===0||!e?n:Qc(i,n,s,e)}class mn extends Oi{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const n=t.time||(t.time={}),s=this._adapter=new Hr._date(t.adapters.date);s.init(e),k(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Ao(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,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))),s=W(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),r=W(r)&&!isNaN(r)?r:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=zt(s,r,o);return this._unit=e.unit||(n.autoSkip?wo(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):Gc(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Zc(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),So(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t){let e=0,n=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?n=r:n=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=ot(e,0,o),n=ot(n,0,o),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,r=s.time,o=r.unit||wo(r.minUnit,e,n,this._getLabelCapacity(e)),a=y(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=U(l)||l===!0,h={};let m=e,E,P;if(c&&(m=+t.startOf(m,"isoWeek",l)),m=+t.startOf(m,c?"day":o),t.diff(n,e,o)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+o);const D=s.ticks.source==="data"&&this.getDataTimestamps();for(E=m,P=0;E<n;E=+t.add(E,a,o),P++)ko(h,E,D);return(E===n||s.bounds==="ticks"||P===1)&&ko(h,E,D),Object.keys(h).sort((et,st)=>et-st).map(et=>+et)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,s){const r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],h=l&&o[l],m=n[e],E=l&&h&&m&&m.major,P=this._adapter.format(t,s||(E?h:c)),D=r.ticks.callback;return D?T(D,[P,e,n],this):P}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=j(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*r+a*o,h:n*o+a*r}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,r=this._tickFormatFunction(t,0,So(this,[t],this._majorUnit),s),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||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(Ao(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return oe(t.sort(Xc))}}mn.id="time",mn.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function Un(i,t,e){let n=0,s=i.length-1,r,o,a,l;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=At(i,"pos",t)),{pos:r,time:a}=i[n],{pos:o,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=At(i,"time",t)),{time:r,pos:a}=i[n],{time:o,pos:l}=i[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class Os extends mn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Un(e,this.min),this._tableRange=Un(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],r=[];let o,a,l,c,h;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,a=s.length;o<a;++o)h=s[o+1],l=s[o-1],c=s[o],Math.round((h+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Un(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Un(this._table,n*this._tableRange+this._minPos,!0)}}Os.id="timeseries",Os.defaults=mn.defaults;var Eo=Object.freeze({__proto__:null,CategoryScale:zn,LinearScale:Ss,LogarithmicScale:Es,RadialLinearScale:pn,TimeScale:mn,TimeSeriesScale:Os});return Ne.register(Yr,Eo,xs,bo),Ne.helpers={...ta},Ne._adapters=Hr,Ne.Animation=vr,Ne.Animations=as,Ne.animator=Re,Ne.controllers=fi.controllers.items,Ne.DatasetController=li,Ne.Element=ci,Ne.elements=xs,Ne.Interaction=rr,Ne.layouts=Ve,Ne.platforms=yr,Ne.Scale=Oi,Ne.Ticks=un,Object.assign(Ne,Yr,Eo,xs,bo,yr),Ne.Chart=Ne,typeof window<"u"&&(window.Chart=Ne),Ne});