diff --git a/angular.json b/angular.json index 55e8271..095b2f3 100644 --- a/angular.json +++ b/angular.json @@ -20,7 +20,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "dist/new-rdv-app", + "outputPath": "dist/new-rdv-app/browser", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", @@ -60,7 +60,7 @@ { "type": "initial", "maximumWarning": "1.7mb", - "maximumError": "1.7mb" + "maximumError": "2mb" }, { "type": "anyComponentStyle", @@ -124,6 +124,64 @@ ], "scripts": [] } + }, + "server": { + "builder": "@angular-devkit/build-angular:server", + "options": { + "outputPath": "dist/new-rdv-app/server", + "main": "server.ts", + "tsConfig": "tsconfig.server.json" + }, + "configurations": { + "production": { + "outputHashing": "media", + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ] + }, + "development": { + "optimization": false, + "sourceMap": true, + "extractLicenses": false + } + }, + "defaultConfiguration": "production" + }, + "serve-ssr": { + "builder": "@nguniversal/builders:ssr-dev-server", + "configurations": { + "development": { + "browserTarget": "new-rdv-app:build:development", + "serverTarget": "new-rdv-app:server:development" + }, + "production": { + "browserTarget": "new-rdv-app:build:production", + "serverTarget": "new-rdv-app:server:production" + } + }, + "defaultConfiguration": "development" + }, + "prerender": { + "builder": "@nguniversal/builders:prerender", + "options": { + "routes": [ + "/" + ] + }, + "configurations": { + "production": { + "browserTarget": "new-rdv-app:build:production", + "serverTarget": "new-rdv-app:server:production" + }, + "development": { + "browserTarget": "new-rdv-app:build:development", + "serverTarget": "new-rdv-app:server:development" + } + }, + "defaultConfiguration": "production" } } } diff --git a/dist/new-rdv-app/browser/197.c0e4561aaa90c0ab.js b/dist/new-rdv-app/browser/197.c0e4561aaa90c0ab.js new file mode 100644 index 0000000..aa5a92c --- /dev/null +++ b/dist/new-rdv-app/browser/197.c0e4561aaa90c0ab.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunknew_rdv_app=self.webpackChunknew_rdv_app||[]).push([[197],{197:(F,d,u)=>{u.r(d),u.d(d,{NotFoundModule:()=>m});var c=u(6895),r=u(9116),n=u(4650),l=u(6188);const s=[{path:"",component:(()=>{class o{constructor(){}ngOnInit(){}}return o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=n.Xpm({type:o,selectors:[["app-not-found"]],decls:3,vars:3,template:function(t,N){1&t&&(n.TgZ(0,"p"),n._uU(1),n.ALo(2,"translate"),n.qZA()),2&t&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"not-found works!")))},dependencies:[l.X$]}),o})()}];let a=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=n.oAB({type:o}),o.\u0275inj=n.cJS({imports:[r.Bz.forChild(s),r.Bz]}),o})();var p=u(9552);let m=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=n.oAB({type:o}),o.\u0275inj=n.cJS({imports:[c.ez,a,p.m]}),o})()}}]); \ No newline at end of file diff --git a/dist/new-rdv-app/browser/36.0b2af48f611a2b9c.js b/dist/new-rdv-app/browser/36.0b2af48f611a2b9c.js new file mode 100644 index 0000000..28a9586 --- /dev/null +++ b/dist/new-rdv-app/browser/36.0b2af48f611a2b9c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunknew_rdv_app=self.webpackChunknew_rdv_app||[]).push([[36],{50:(A,v,i)=>{i.d(v,{R:()=>t});var t=(()=>{return(o=t||(t={})).PENDING="PENDING",o.APPROVED="APPROVED",o.FINISHED="FINISHED",o.CANCELED="CANCELED",o.DELETED="DELETED",t;var o})()},4286:(A,v,i)=>{i.d(v,{b:()=>h});var t=i(5861),o=i(50),_=i(4004),m=i(4650),g=i(7407),f=i(7694);let h=(()=>{class u{constructor(a,e){this.fireStore=a,this.translatingService=e}createRendezvous(a,e){var n=this;return(0,t.Z)(function*(){if(!e.email)throw"You need Email to create new Rendezvous!";return a.createdAt=new Date,a.createdBy=e.email,a.rdvState=o.R.PENDING,yield n.fireStore.collection("Rendezvous").add(a)})()}deleteRendezvous(a,e,n){var r=this;return(0,t.Z)(function*(){return e.createdAt=new Date(e.createdAt),e.lastUpdate&&"Not Updated"!==e.lastUpdate&&(e.lastUpdate=new Date(e.lastUpdate)),e.rdvState=o.R.DELETED,e.deletedAt=new Date,e.deletedBy=n.email,yield r.fireStore.collection("Rendezvous").doc(a).update(e)})()}updateRendezvous(a,e){var n=this;return(0,t.Z)(function*(){return e.lastUpdate=new Date,yield n.fireStore.collection("Rendezvous").doc(a).update(e)})()}approveRendezvous(a,e,n){var r=this;return(0,t.Z)(function*(){return e.createdAt=new Date(e.createdAt),e.lastUpdate&&"Not Updated"!==e.lastUpdate&&(e.lastUpdate=new Date(e.lastUpdate)),e.rdvState=o.R.APPROVED,e.approvedAt=new Date,e.approvedBy=n.email,yield r.fireStore.collection("Rendezvous").doc(a).update(e)})()}finishRendezvous(a,e){var n=this;return(0,t.Z)(function*(){return e.createdAt=new Date(e.createdAt),e.lastUpdate&&"Not Updated"!==e.lastUpdate&&(e.lastUpdate=new Date(e.lastUpdate)),e.approvedAt&&(e.approvedAt=new Date(e.approvedAt)),e.rdvDate&&(e.rdvDate=new Date(e.rdvDate)),e.rdvState=o.R.FINISHED,e.finishedAt=new Date,yield n.fireStore.collection("Rendezvous").doc(a).update(e)})()}cancelRendezvous(a,e,n){var r=this;return(0,t.Z)(function*(){return e.createdAt=new Date(e.createdAt),e.lastUpdate&&"Not Updated"!==e.lastUpdate&&(e.lastUpdate=new Date(e.lastUpdate)),e.approvedAt&&(e.approvedAt=new Date(e.approvedAt)),e.rdvDate&&(e.rdvDate=new Date(e.rdvDate)),e.rdvState=o.R.CANCELED,e.canceledAt=new Date,e.canceledBy=n.email,yield r.fireStore.collection("Rendezvous").doc(a).update(e)})()}getRDVsByState(a,e,n,r){return this.fireStore.collection("Rendezvous",c=>{const s=c.where("rdvState","==",a).orderBy(e).limit(5);return"NEXT"===n?s.startAfter(r):"PREVIOUS"===n?s.endBefore(r):s}).snapshotChanges().pipe((0,_.U)(c=>{let s=1;return c.map(d=>{const p=d.payload.doc.data();return{...p,rdvID:d.payload.doc.id,createdAt:this.translatingService.convertToDateString(p.createdAt),lastUpdate:this.getLastUpdate(p.lastUpdate),rdvDate:p.rdvDate?this.translatingService.convertToDateString(p.rdvDate):void 0,approvedAt:p.approvedAt?this.translatingService.convertToDateString(p.approvedAt):void 0,finishedAt:p.finishedAt?this.translatingService.convertToDateString(p.finishedAt):void 0,canceledAt:p.canceledAt?this.translatingService.convertToDateString(p.canceledAt):void 0,deletedAt:p.deletedAt?this.translatingService.convertToDateString(p.deletedAt):void 0,order:s++}})}))}getRDVsByEmailAndState(a,e,n){return this.fireStore.collection("Rendezvous",r=>r.where("createdBy","==",a).where("rdvState","==",e).orderBy(n)).snapshotChanges().pipe((0,_.U)(r=>{let c=1;return r.map(s=>{const d=s.payload.doc.data();return{...d,rdvID:s.payload.doc.id,createdAt:this.translatingService.convertToDateString(d.createdAt),lastUpdate:this.getLastUpdate(d.lastUpdate),rdvDate:d.rdvDate?this.translatingService.convertToDateString(d.rdvDate):void 0,approvedAt:d.approvedAt?this.translatingService.convertToDateString(d.approvedAt):void 0,finishedAt:d.finishedAt?this.translatingService.convertToDateString(d.finishedAt):void 0,canceledAt:d.canceledAt?this.translatingService.convertToDateString(d.canceledAt):void 0,deletedAt:d.deletedAt?this.translatingService.convertToDateString(d.deletedAt):void 0,order:c++}})}))}getAllRendezvous(){return this.fireStore.collection("Rendezvous",a=>a.orderBy("createdAt")).snapshotChanges().pipe((0,_.U)(a=>{let e=1;return a.map(n=>{const r=n.payload.doc.data();return{...r,rdvID:n.payload.doc.id,createdAt:this.translatingService.convertToDateString(r.createdAt),lastUpdate:this.getLastUpdate(r.lastUpdate),rdvDate:r.rdvDate?this.translatingService.convertToDateString(r.rdvDate):void 0,approvedAt:r.approvedAt?this.translatingService.convertToDateString(r.approvedAt):void 0,finishedAt:r.finishedAt?this.translatingService.convertToDateString(r.finishedAt):void 0,canceledAt:r.canceledAt?this.translatingService.convertToDateString(r.canceledAt):void 0,deletedAt:r.deletedAt?this.translatingService.convertToDateString(r.deletedAt):void 0,order:e++}})}))}getDocByID(a){return this.fireStore.collection("Rendezvous").doc(a)}getLastUpdate(a){return a&&"Not Updated"!==a?this.translatingService.convertToDateString(a):"Not Updated"}}return u.\u0275fac=function(a){return new(a||u)(m.LFG(g.ST),m.LFG(f.o))},u.\u0275prov=m.Yz7({token:u,factory:u.\u0275fac,providedIn:"root"}),u})()},362:(A,v,i)=>{i.d(v,{X:()=>e});var t=i(4650),o=i(4006),_=i(6895),m=i(6188);function g(n,r){1&n&&(t.TgZ(0,"p",10),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&n&&(t.xp6(1),t.Oqu(t.lcZ(2,1,"invalid name")))}function f(n,r){1&n&&(t.TgZ(0,"p",10),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&n&&(t.xp6(1),t.Oqu(t.lcZ(2,1,"Phone Number must contain 10 digit numbers")))}function h(n,r){1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&n&&(t.xp6(1),t.Oqu(t.lcZ(2,1,"Add Rendezvous")))}function u(n,r){1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&n&&(t.xp6(1),t.Oqu(t.lcZ(2,1,"Update Rendezvous")))}function l(n,r){if(1&n){const c=t.EpF();t.TgZ(0,"button",11),t.NdJ("click",function(){t.CHM(c);const d=t.oxw();return t.KtG(d.deleteRDV())}),t._uU(1),t.ALo(2,"translate"),t.qZA()}2&n&&(t.xp6(1),t.Oqu(t.lcZ(2,1,"Delete Rendezvous")))}const a=function(n){return{"full-width-btn":n}};let e=(()=>{class n{constructor(c){this.formBuilder=c,this.rdvFormValue=new t.vpe,this.deleteRDVid=new t.vpe}ngOnInit(){this.rdvID=this.rdv?.rdvID,this.initForm()}initForm(){const c=this.rdv?.displayName,s=this.rdv?.phoneNumber;this.rdvform=this.formBuilder.group({displayName:[c,[o.kI.required,o.kI.pattern(/.*\S.*/)]],phoneNumber:[s,[o.kI.required,o.kI.pattern(/^(\+213|0)?[0-9]{9}$/)]]})}submitForm(){this.rdvform.invalid||this.rdvFormValue.emit(this.rdvform.value)}deleteRDV(){this.deleteRDVid.emit(this.rdvID)}}return n.\u0275fac=function(c){return new(c||n)(t.Y36(o.QS))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-rdv-form"]],inputs:{rdv:"rdv",showDeleteBtn:"showDeleteBtn"},outputs:{rdvFormValue:"rdvFormValue",deleteRDVid:"deleteRDVid"},decls:14,vars:16,consts:[[1,"form",3,"formGroup"],[1,"name-div"],["type","text","formControlName","displayName",1,"input-form",3,"placeholder"],["class","danger-msg",4,"ngIf"],[1,"mobile-div"],["type","tel","formControlName","phoneNumber",1,"input-form",3,"placeholder"],[1,"btns-container"],[1,"btn","btn-success",3,"disabled","ngClass","click"],[4,"ngIf"],["class","btn btn-danger",3,"click",4,"ngIf"],[1,"danger-msg"],[1,"btn","btn-danger",3,"click"]],template:function(c,s){1&c&&(t.TgZ(0,"form",0)(1,"div",1),t._UZ(2,"input",2),t.ALo(3,"translate"),t.YNc(4,g,3,3,"p",3),t.qZA(),t.TgZ(5,"div",4),t._UZ(6,"input",5),t.ALo(7,"translate"),t.YNc(8,f,3,3,"p",3),t.qZA(),t.TgZ(9,"div",6)(10,"button",7),t.NdJ("click",function(){return s.submitForm()}),t.YNc(11,h,3,3,"span",8),t.YNc(12,u,3,3,"span",8),t.qZA(),t.YNc(13,l,3,3,"button",9),t.qZA()()),2&c&&(t.Q6J("formGroup",s.rdvform),t.xp6(2),t.s9C("placeholder",t.lcZ(3,10,"Enter a name")),t.xp6(2),t.Q6J("ngIf",s.rdvform.controls.displayName.touched&&s.rdvform.controls.displayName.invalid),t.xp6(2),t.s9C("placeholder",t.lcZ(7,12,"Phone Number")),t.xp6(2),t.Q6J("ngIf",s.rdvform.controls.phoneNumber.touched&&s.rdvform.controls.phoneNumber.invalid),t.xp6(2),t.Q6J("disabled",s.rdvform.invalid)("ngClass",t.VKq(14,a,!s.rdvID||!s.showDeleteBtn)),t.xp6(1),t.Q6J("ngIf",!s.rdvID),t.xp6(1),t.Q6J("ngIf",s.rdvID),t.xp6(1),t.Q6J("ngIf",s.rdvID&&s.showDeleteBtn))},dependencies:[_.mk,_.O5,o._Y,o.Fj,o.JJ,o.JL,o.sg,o.u,m.X$],styles:[".name-div[_ngcontent-%COMP%], .mobile-div[_ngcontent-%COMP%], .error-msg-div[_ngcontent-%COMP%]{margin:15px 0}.btns-container[_ngcontent-%COMP%]{display:flex;margin-top:25px}.btn[_ngcontent-%COMP%]{width:50%}.full-width-btn[_ngcontent-%COMP%]{width:100%}.btn-success[_ngcontent-%COMP%]{margin-right:7px}.btn-danger[_ngcontent-%COMP%]{margin-left:7px}"]}),n})()},6912:(A,v,i)=>{i.d(v,{a:()=>f});var t=i(4650),o=i(5415),_=i(7579),m=i(6518),g=i(6188);let f=(()=>{class h{constructor(l,a){this.authService=l,this.translate=a,this.updateInfosEvent=new t.vpe,this.loadMoreData=new t.vpe,this.dtOptions={},this.dtTrigger=new _.x,this.tableBTNs=e=>e?[{extend:"colvis",className:"export-btns"},{extend:"csv",className:"export-btns"},{extend:"excel",className:"export-btns"}]:[]}ngOnChanges(l){l.infos&&this.rerenderTable()}ngOnInit(){this.dtOptions=this.tableOptions(this.infos,this.tableCols,this.currentUser?.email,this.showBtns),window.onresize=()=>this.rerenderTable()}ngAfterViewInit(){this.dtTrigger.next(this.dtOptions)}ngOnDestroy(){this.dtTrigger.unsubscribe()}tableOptions(l,a,e,n){return{data:l,columns:a,responsive:!0,pagingType:"full_numbers",pageLength:5,lengthMenu:[3,5,10,25,50,100],dom:"Bfrtip",initComplete:(r,c)=>{$("button").removeClass("dt-button"),$("button").removeClass("buttons-excel"),$("button").removeClass("buttons-html5 "),$("#DataTables_Table_0_next").on("click",()=>this.loadMoreData.emit())},buttons:this.tableBTNs(n),rowCallback:(r,c,s)=>{const d=this;$(r).addClass("t-row"),$(r).css({"white-space":"nowrap"});let p=c;if(p.createdBy===e||this.canCRUD){const D=document.createElement("button");D.textContent=this.translate.instant("Edit"),D.setAttribute("id","tableBtn"),D.classList.add("btn","btn-dark"),D.onclick=()=>d.updateInfosEvent.emit(p);const E=$(r.lastChild);E.addClass("row-btn-container"),E.children("button").remove(),E.append(D)}return r},language:{processing:this.translate.instant("Processing..."),search:this.translate.instant("Search:"),lengthMenu:this.translate.instant("Show _MENU_ entries"),info:this.translate.instant("Showing _START_ to _END_ of _TOTAL_ entries"),infoEmpty:this.translate.instant("Showing 0 to 0 of 0 entries"),infoFiltered:this.translate.instant("(filtered from _MAX_ total entries)"),infoPostFix:"",loadingRecords:this.translate.instant("Loading..."),zeroRecords:this.translate.instant("No matching records found"),emptyTable:this.translate.instant("No data available in table"),paginate:{first:this.translate.instant("First"),previous:this.translate.instant("Previous"),next:this.translate.instant("Next"),last:this.translate.instant("Last")},aria:{sortAscending:this.translate.instant(": activate to sort column ascending"),sortDescending:this.translate.instant(": activate to sort column descending")}}}}rerenderTable(){this.dtOptions&&this.dtElement&&this.dtElement.dtInstance.then(l=>{l.destroy(),this.dtOptions.data=this.infos,this.dtTrigger.next(this.dtOptions)})}get canCRUD(){return this.authService.canCRUDrendezvous(this.currentUser)}}return h.\u0275fac=function(l){return new(l||h)(t.Y36(m.e),t.Y36(g.sK))},h.\u0275cmp=t.Xpm({type:h,selectors:[["app-table"]],viewQuery:function(l,a){if(1&l&&t.Gf(o.G,5),2&l){let e;t.iGM(e=t.CRH())&&(a.dtElement=e.first)}},inputs:{infos:"infos",tableCols:"tableCols",currentUser:"currentUser",showBtns:"showBtns"},outputs:{updateInfosEvent:"updateInfosEvent",loadMoreData:"loadMoreData"},features:[t.TTD],decls:2,vars:2,consts:[[2,"overflow","scroll","overflow-y","hidden","padding","5px"],["datatable","",1,"table","table-responsive","row-border",2,"color","var(--template-color)",3,"dtOptions","dtTrigger"]],template:function(l,a){1&l&&(t.TgZ(0,"div",0),t._UZ(1,"table",1),t.qZA()),2&l&&(t.xp6(1),t.Q6J("dtOptions",a.dtOptions)("dtTrigger",a.dtTrigger))},dependencies:[o.G]}),h})()}}]); \ No newline at end of file diff --git a/dist/new-rdv-app/browser/3rdpartylicenses.txt b/dist/new-rdv-app/browser/3rdpartylicenses.txt new file mode 100644 index 0000000..b5c91a4 --- /dev/null +++ b/dist/new-rdv-app/browser/3rdpartylicenses.txt @@ -0,0 +1,936 @@ +@angular/animations +MIT + +@angular/cdk +MIT +The MIT License + +Copyright (c) 2022 Google LLC. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +@angular/common +MIT + +@angular/core +MIT + +@angular/fire +MIT + +@angular/forms +MIT + +@angular/material +MIT +The MIT License + +Copyright (c) 2022 Google LLC. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +@angular/platform-browser +MIT + +@angular/router +MIT + +@angular/service-worker +MIT + +@babel/runtime +MIT +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +@firebase/analytics +Apache-2.0 + +@firebase/app +Apache-2.0 + +@firebase/app-check +Apache-2.0 + +@firebase/app-compat +Apache-2.0 + +@firebase/auth +Apache-2.0 + +@firebase/auth-compat +Apache-2.0 + +@firebase/component +Apache-2.0 + +@firebase/firestore +Apache-2.0 + +@firebase/firestore-compat +Apache-2.0 + +@firebase/installations +Apache-2.0 + +@firebase/logger +Apache-2.0 + +@firebase/messaging +Apache-2.0 + +@firebase/remote-config +Apache-2.0 + +@firebase/storage +Apache-2.0 + +@firebase/storage-compat +Apache-2.0 + +@firebase/util +Apache-2.0 + +@firebase/webchannel-wrapper +Apache-2.0 + +@ngx-translate/core +MIT + +@ngx-translate/http-loader +MIT + +angular-datatables +MIT +The MIT License + +Copyright (c) Louis Lin (l-lin.github.io) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +bootstrap +MIT +The MIT License (MIT) + +Copyright (c) 2011-2021 Twitter, Inc. +Copyright (c) 2011-2021 The Bootstrap Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +chart.js +MIT +The MIT License (MIT) + +Copyright (c) 2014-2022 Chart.js Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +datatables.net-bs5 +MIT +The MIT License (MIT) + +Copyright SpryMedia Limited and other contributors +http://datatables.net + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +datatables.net-buttons-dt +MIT +The MIT License (MIT) + +Copyright SpryMedia Limited and other contributors +http://datatables.net + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +datatables.net-colreorder-dt +MIT +The MIT License (MIT) + +Copyright SpryMedia Limited and other contributors +http://datatables.net + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +firebase/analytics + +firebase/app + +firebase/app-check + +firebase/compat/app + +firebase/compat/auth + +firebase/compat/firestore + +firebase/compat/storage + +firebase/messaging + +firebase/remote-config + +google-libphonenumber +(MIT AND Apache-2.0) +This package is licensed under MIT: + +The MIT License (MIT) + +Copyright (c) 2015 Rui Marinho + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------- + +The bundled Google Closure Library is licensed under Apache 2.0: + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + +idb +ISC +ISC License (ISC) +Copyright (c) 2016, Jake Archibald + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +intl-tel-input +MIT +The MIT License (MIT) + +Copyright (c) 2014-2016 Jack O'Connor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +lodash-es +MIT +Copyright OpenJS Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. + + +ng2-charts +ISC + +ngx-bootstrap +MIT +The MIT License (MIT) + +Copyright (c) 2015-2017 Valor Software +Copyright (c) 2015-2017 Dmitriy Shekhovtsov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + +ngx-image-cropper +MIT +MIT License + +Copyright (c) 2019 Martijn Willekens + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +ngx-intl-tel-input +MIT +MIT License + +Copyright (c) 2018 webcat12345 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +rxjs +Apache-2.0 + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + +tslib +0BSD +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +zone.js +MIT +The MIT License + +Copyright (c) 2010-2022 Google LLC. https://angular.io/license + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/dist/new-rdv-app/browser/469.9b8970333e7ad9a6.js b/dist/new-rdv-app/browser/469.9b8970333e7ad9a6.js new file mode 100644 index 0000000..6ac84cc --- /dev/null +++ b/dist/new-rdv-app/browser/469.9b8970333e7ad9a6.js @@ -0,0 +1 @@ +(self.webpackChunknew_rdv_app=self.webpackChunknew_rdv_app||[]).push([[469],{6469:(t,o,n)=>{"use strict";n.r(o),n.d(o,{AuthModule:()=>uo});var r=n(6895),u=n(4006),m=n(5861),N=n(2084),s=n(4650),P=n(6518),L=n(3385),O=n(9116),R=n(5724);class U{constructor(p,l){this.open=p,this.close=l||p}isManual(){return"manual"===this.open||"manual"===this.close}}const Ie={hover:["mouseover","mouseout"],focus:["focusin","focusout"]};const v=typeof window<"u"&&window||{};let k;function te(){return typeof v>"u"||(typeof v.__theme>"u"?(k||(k=function Ve(){if(typeof document>"u")return null;const i=document.createElement("span");i.innerText="test bs version",document.body.appendChild(i),i.classList.add("d-none");const p=i.getBoundingClientRect();return document.body.removeChild(i),p&&0===p.top?"bs4":"bs3"}()),"bs3"===k):"bs4"!==v.__theme)}typeof console>"u"||console;var He=n(9300),je=n(7579),ke=n(6451),he=n(4968),Ye=n(9646),Ze=n(4408),ze=n(727);const Y={schedule(i){let p=requestAnimationFrame,l=cancelAnimationFrame;const{delegate:h}=Y;h&&(p=h.requestAnimationFrame,l=h.cancelAnimationFrame);const _=p(y=>{l=void 0,i(y)});return new ze.w0(()=>l?.(_))},requestAnimationFrame(...i){const{delegate:p}=Y;return(p?.requestAnimationFrame||requestAnimationFrame)(...i)},cancelAnimationFrame(...i){const{delegate:p}=Y;return(p?.cancelAnimationFrame||cancelAnimationFrame)(...i)},delegate:void 0};var Ke=n(7565);const Je=new class qe extends Ke.v{flush(p){this._active=!0,this._scheduled=void 0;const{actions:l}=this;let h,_=-1;p=p||l.shift();const y=l.length;do{if(h=p.execute(p.state,p.delay))break}while(++_0?super.requestAsyncId(p,l,h):(p.actions.push(this),p._scheduled||(p._scheduled=Y.requestAnimationFrame(()=>p.flush(void 0))))}recycleAsyncId(p,l,h=0){if(null!=h&&h>0||null==h&&this.delay>0)return super.recycleAsyncId(p,l,h);0===p.actions.length&&(Y.cancelAnimationFrame(l),p._scheduled=void 0)}});function x(i,p){if(1!==i.nodeType)return[];const h=i.ownerDocument.defaultView.getComputedStyle(i,null);return p?h[p]:h}function oe(i){return"HTML"===i.nodeName?i:i.parentNode||i.host}function ne(i){if(!i)return document.body;switch(i.nodeName){case"HTML":case"BODY":return i.ownerDocument.body;case"#document":return i.body}const{overflow:p,overflowX:l,overflowY:h}=x(i);return/(auto|scroll|overlay)/.test(String(p)+String(h)+String(l))?i:ne(oe(i))}const me=typeof window<"u"&&typeof document<"u",fe=me&&!(!window.MSInputMethodContext||!document.documentMode),$e=me&&!(!window.MSInputMethodContext||!/MSIE 10/.test(navigator.userAgent));function G(i){return 11===i?fe:10===i?$e:fe||$e}function re(i){if(!i)return document.documentElement;const p=G(10)?document.body:null;let h,l=i.offsetParent||null;for(;l===p&&i.nextElementSibling&&h!==i.nextElementSibling;)h=i.nextElementSibling,l=h.offsetParent;const _=l&&l.nodeName;return _&&"BODY"!==_&&"HTML"!==_?-1!==["TH","TD","TABLE"].indexOf(l.nodeName)&&"static"===x(l,"position")?re(l):l:h?h.ownerDocument.documentElement:document.documentElement}function ie(i){return null!==i.parentNode?ie(i.parentNode):i}function X(i,p){if(!(i&&i.nodeType&&p&&p.nodeType))return document.documentElement;const l=i.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_FOLLOWING,h=l?i:p,_=l?p:i,y=document.createRange();y.setStart(h,0),y.setEnd(_,0);const{commonAncestorContainer:S}=y;if(i!==S&&p!==S||h.contains(_))return function Xe(i){const{nodeName:p}=i;return"BODY"!==p&&("HTML"===p||re(i.firstElementChild)===i)}(S)?S:re(S);const T=ie(i);return T.host?X(T.host,p):X(i,ie(p).host)}function _e(i,p){const l="x"===p?"Left":"Top",h="Left"===l?"Right":"Bottom";return parseFloat(i[`border${l}Width`])+parseFloat(i[`border${h}Width`])}function be(i,p,l,h){return Math.max(p[`offset${i}`],p[`scroll${i}`],l[`client${i}`],l[`offset${i}`],l[`scroll${i}`],G(10)?parseInt(l[`offset${i}`],10)+parseInt(h["margin"+("Height"===i?"Top":"Left")],10)+parseInt(h["margin"+("Height"===i?"Bottom":"Right")],10):0)}function Ne(i){const p=i.body,l=i.documentElement,h=G(10)&&getComputedStyle(l);return{height:be("Height",p,l,h),width:be("Width",p,l,h)}}function H(i,p="top"){const l="top"===p?"scrollTop":"scrollLeft",h=i.nodeName;if("BODY"===h||"HTML"===h){const _=i.ownerDocument.documentElement;return(i.ownerDocument.scrollingElement||_)[l]}return i[l]}function Z(i){return Object.assign(Object.assign({},i),{right:i.left+i.width,bottom:i.top+i.height})}function ye(i){let p={};try{if(G(10)){p=i.getBoundingClientRect();const E=H(i,"top"),C=H(i,"left");p.top+=E,p.left+=C,p.bottom+=E,p.right+=C}else p=i.getBoundingClientRect()}catch{return}const l={left:p.left,top:p.top,width:p.right-p.left,height:p.bottom-p.top},h="HTML"===i.nodeName?Ne(i.ownerDocument):{};let S=i.offsetWidth-(h.width||i.clientWidth||l.right-l.left),T=i.offsetHeight-(h.height||i.clientHeight||l.bottom-l.top);if(S||T){const E=x(i);S-=_e(E,"x"),T-=_e(E,"y"),l.width-=S,l.height-=T}return Z(l)}function de(i,p,l=!1){const h=G(10),_="HTML"===p.nodeName,y=ye(i),S=ye(p),T=ne(i),E=x(p),C=parseFloat(E.borderTopWidth),A=parseFloat(E.borderLeftWidth);l&&_&&(S.top=Math.max(S.top,0),S.left=Math.max(S.left,0));let M=Z({top:y.top-S.top-C,left:y.left-S.left-A,width:y.width,height:y.height});if(M.marginTop=0,M.marginLeft=0,!h&&_){const I=parseFloat(E.marginTop),D=parseFloat(E.marginLeft);M.top-=C-I,M.bottom-=C-I,M.left-=A-D,M.right-=A-D,M.marginTop=I,M.marginLeft=D}return(h&&!l?p.contains(T):p===T&&"BODY"!==T.nodeName)&&(M=function Qe(i,p,l=!1){const h=H(p,"top"),_=H(p,"left"),y=l?-1:1;return i.top+=h*y,i.bottom+=h*y,i.left+=_*y,i.right+=_*y,i}(M,p)),M}function Se(i){const p=i.nodeName;return"BODY"!==p&&"HTML"!==p&&("fixed"===x(i,"position")||Se(oe(i)))}function Te(i){if(!i||!i.parentElement||G())return document.documentElement;let p=i.parentElement;for(;p&&"none"===x(p,"transform");)p=p.parentElement;return p||document.documentElement}function se(i,p,l=0,h,_=!1){let y={top:0,left:0};const S=_?Te(i):X(i,p);if("viewport"===h)y=function et(i,p=!1){const l=i.ownerDocument.documentElement,h=de(i,l),_=Math.max(l.clientWidth,window.innerWidth||0),y=Math.max(l.clientHeight,window.innerHeight||0),S=p?0:H(l),T=p?0:H(l,"left");return Z({top:S-Number(h.top)+Number(h.marginTop),left:T-Number(h.left)+Number(h.marginLeft),width:_,height:y})}(S,_);else{let T;"scrollParent"===h?(T=ne(oe(p)),"BODY"===T.nodeName&&(T=i.ownerDocument.documentElement)):T="window"===h?i.ownerDocument.documentElement:h;const E=de(T,S,_);if("HTML"!==T.nodeName||Se(S))y=E;else{const{height:C,width:A}=Ne(i.ownerDocument);y.top+=E.top-E.marginTop,y.bottom=Number(C)+Number(E.top),y.left+=E.left-E.marginLeft,y.right=Number(A)+Number(E.left)}}return y.left+=l,y.top+=l,y.right-=l,y.bottom-=l,y}function tt({width:i,height:p}){return i*p}function Ee(i,p,l,h,_=["top","bottom","right","left"],y="viewport",S=0){if(-1===i.indexOf("auto"))return i;const T=se(l,h,S,y),E={top:{width:T.width,height:p.top-T.top},right:{width:T.right-p.right,height:T.height},bottom:{width:T.width,height:T.bottom-p.bottom},left:{width:p.left-T.left,height:T.height}},C=Object.keys(E).map(D=>Object.assign(Object.assign({key:D},E[D]),{area:tt(E[D])})).sort((D,F)=>F.area-D.area);let A=C.filter(({width:D,height:F})=>D>=l.clientWidth&&F>=l.clientHeight);A=A.filter(D=>_.some(F=>F===D.key));const M=A.length>0?A[0].key:C[0].key,I=i.split(" ")[1];return l.className=l.className.replace(/bs-tooltip-auto/g,`bs-tooltip-${M}`),M+(I?`-${I}`:"")}function Pe(i){const l=i.ownerDocument.defaultView.getComputedStyle(i),h=parseFloat(l.marginTop||0)+parseFloat(l.marginBottom||0),_=parseFloat(l.marginLeft||0)+parseFloat(l.marginRight||0);return{width:Number(i.offsetWidth)+_,height:Number(i.offsetHeight)+h}}function Ce(i,p,l=null){return de(p,l?Te(i):X(i,p),l)}function ae(i,p,l){const h=l.split(" ")[0],_=Pe(i),y={width:_.width,height:_.height},S=-1!==["right","left"].indexOf(h),T=S?"top":"left",E=S?"left":"top",C=S?"height":"width",A=S?"width":"height";return y[T]=p[T]+p[C]/2-_[C]/2,y[E]=h===E?p[E]-_[A]:p[function nt(i){const p={left:"right",right:"left",bottom:"top",top:"bottom"};return i.replace(/left|right|bottom|top/g,l=>p[l])}(E)],y}function Ae(i,p){return i&&i.modifiers&&i.modifiers[p]&&i.modifiers[p].enabled}function Re(i,p,l){Object.keys(p).forEach(h=>{let _="";-1!==["width","height","top","right","bottom","left"].indexOf(h)&&function it(i){return""!==i&&!isNaN(parseFloat(i))&&isFinite(i)}(p[h])&&(_="px"),l?l.setStyle(i,h,`${String(p[h])}${_}`):i.style[h]=String(p[h])+_})}function st(i){let p=i.offsets.target;const l=i.instance.target.querySelector(".arrow");if(!l)return i;const h=-1!==["left","right"].indexOf(i.placement.split(" ")[0]),_=h?"height":"width",y=h?"Top":"Left",S=y.toLowerCase(),T=h?"left":"top",E=h?"bottom":"right",C=Pe(l)[_],A=i.placement.split(" ")[1];i.offsets.host[E]-Cp[E]&&(p[S]+=Number(i.offsets.host[S])+Number(C)-Number(p[E])),p=Z(p);const M=x(i.instance.target),I=parseFloat(M[`margin${y}`]),D=parseFloat(M[`border${y}Width`]);let F;if(A){const ee=parseFloat(M.borderRadius),B=Number(I+D+ee);F=S===A?Number(i.offsets.host[S])+B:Number(i.offsets.host[S])+Number(i.offsets.host[_]-B)}else F=Number(i.offsets.host[S])+Number(i.offsets.host[_]/2-C/2);let j=F-p[S]-I-D;return j=Math.max(Math.min(p[_]-C,j),0),i.offsets.arrow={[S]:Math.round(j),[T]:""},i.instance.arrow=l,i}function at(i){if(i.offsets.target=Z(i.offsets.target),!Ae(i.options,"flip"))return i.offsets.target=Object.assign(Object.assign({},i.offsets.target),ae(i.instance.target,i.offsets.host,i.placement)),i;const p=se(i.instance.target,i.instance.host,0,"viewport",!1);let l=i.placement.split(" ")[0],h=i.placement.split(" ")[1]||"";const T=Ee("auto",i.offsets.host,i.instance.target,i.instance.host,i.options.allowedPositions),E=[l,T];return E.forEach((C,A)=>{if(l!==C||E.length===A+1)return i;l=i.placement.split(" ")[0];const M="left"===l&&Math.floor(i.offsets.target.right)>Math.floor(i.offsets.host.left)||"right"===l&&Math.floor(i.offsets.target.left)Math.floor(i.offsets.host.top)||"bottom"===l&&Math.floor(i.offsets.target.top)Math.floor(p.right),F=Math.floor(i.offsets.target.top)Math.floor(p.bottom),ee="left"===l&&I||"right"===l&&D||"top"===l&&F||"bottom"===l&&j,B=-1!==["top","bottom"].indexOf(l),Ue=B&&"left"===h&&I||B&&"right"===h&&D||!B&&"left"===h&&F||!B&&"right"===h&&j;(M||ee||Ue)&&((M||ee)&&(l=E[A+1]),Ue&&(h=function rt(i){return"right"===i?"left":"left"===i?"right":i}(h)),i.placement=l+(h?` ${h}`:""),i.offsets.target=Object.assign(Object.assign({},i.offsets.target),ae(i.instance.target,i.offsets.host,i.placement)))}),i}function ut(i){if(!Ae(i.options,"preventOverflow"))return i;const p="transform",l=i.instance.target.style,{top:h,left:_,[p]:y}=l;l.top="",l.left="",l[p]="";const S=se(i.instance.target,i.instance.host,0,"scrollParent",!1);l.top=h,l.left=_,l[p]=y;const E={primary(A){let M=i.offsets.target[A];return i.offsets.target[A]S[A]&&(I=Math.min(i.offsets.target[M],S[A]-("right"===A?i.offsets.target.width:i.offsets.target.height))),{[M]:I}}};let C;return["left","right","top","bottom"].forEach(A=>{C=-1!==["left","top"].indexOf(A)?"primary":"secondary",i.offsets.target=Object.assign(Object.assign({},i.offsets.target),E[C](A))}),i}function lt(i){const p=i.placement,l=p.split(" ")[0],h=p.split(" ")[1];if(h){const{host:_,target:y}=i.offsets,S=-1!==["bottom","top"].indexOf(l),T=S?"left":"top",E=S?"width":"height",C={start:{[T]:_[T]},end:{[T]:_[T]+_[E]-y[E]}};i.offsets.target=Object.assign(Object.assign({},y),{[T]:T===h?C.start[T]:C.end[T]})}return i}const pt=new class ct{position(p,l,h=!0){return this.offset(p,l,!1)}offset(p,l,h=!0){return Ce(l,p)}positionElements(p,l,h,_,y){return[at,lt,ut,st].reduce((T,E)=>E(T),function gt(i,p,l,h){const _=Ce(i,p);!l.match(/^(auto)*\s*(left|right|top|bottom)*$/)&&!l.match(/^(left|right|top|bottom)*(?: (left|right|top|bottom))?\s*(start|end)*$/)&&(l="auto");const y=!!l.match(/auto/g);let S=l.match(/auto\s(left|right|top|bottom)/)?l.split(" ")[1]||"auto":l;const T=S.match(/^(left|right|top|bottom)* ?(?!\1)(left|right|top|bottom)?/);T&&(S=T[1]+(T[2]?` ${T[2]}`:"")),-1!==["left right","right left","top bottom","bottom top"].indexOf(S)&&(S="auto");const E=ae(i,_,S);return S=Ee(S,_,i,p,h?h.allowedPositions:void 0),{options:h,instance:{target:i,host:p,arrow:null},offsets:{target:E,host:_,arrow:null},positionFixed:!1,placement:S,placementAuto:y}}(l,p,h,y))}};let Me=(()=>{class i{constructor(l,h,_){this.update$$=new je.x,this.positionElements=new Map,this.isDisabled=!1,(0,r.NF)(_)&&l.runOutsideAngular(()=>{this.triggerEvent$=(0,ke.T)((0,he.R)(window,"scroll",{passive:!0}),(0,he.R)(window,"resize",{passive:!0}),(0,Ye.of)(0,Je),this.update$$),this.triggerEvent$.subscribe(()=>{this.isDisabled||this.positionElements.forEach(y=>{!function ht(i,p,l,h,_,y){const S=pt.positionElements(i,p,l,h,_),T=function ot(i){return{width:i.offsets.target.width,height:i.offsets.target.height,left:Math.floor(i.offsets.target.left),top:Math.round(i.offsets.target.top),bottom:Math.round(i.offsets.target.bottom),right:Math.floor(i.offsets.target.right)}}(S);Re(p,{"will-change":"transform",top:"0px",left:"0px",transform:`translate3d(${T.left}px, ${T.top}px, 0px)`},y),S.instance.arrow&&Re(S.instance.arrow,S.offsets.arrow,y),function dt(i,p){const l=i.instance.target;let h=l.className;i.placementAuto&&(h=h.replace(/bs-popover-auto/g,`bs-popover-${i.placement}`),h=h.replace(/bs-tooltip-auto/g,`bs-tooltip-${i.placement}`),h=h.replace(/\sauto/g,` ${i.placement}`),-1!==h.indexOf("popover")&&-1===h.indexOf("popover-auto")&&(h+=" popover-auto"),-1!==h.indexOf("tooltip")&&-1===h.indexOf("tooltip-auto")&&(h+=" tooltip-auto")),h=h.replace(/left|right|top|bottom/g,`${i.placement.split(" ")[0]}`),p?p.setAttribute(l,"class",h):l.className=h}(S,y)}(Q(y.target),Q(y.element),y.attachment,y.appendToBody,this.options,h.createRenderer(null,null))})})})}position(l){this.addPositionElement(l)}get event$(){return this.triggerEvent$}disable(){this.isDisabled=!0}enable(){this.isDisabled=!1}addPositionElement(l){this.positionElements.set(Q(l.element),l)}calcPosition(){this.update$$.next()}deletePositionElement(l){this.positionElements.delete(Q(l))}setOptions(l){this.options=l}}return i.\u0275fac=function(l){return new(l||i)(s.LFG(s.R0b),s.LFG(s.FYo),s.LFG(s.Lbi))},i.\u0275prov=s.Yz7({token:i,factory:i.\u0275fac}),i})();function Q(i){return"string"==typeof i?document.querySelector(i):i instanceof s.SBq?i.nativeElement:i}class z{constructor(p,l,h){this.nodes=p,this.viewRef=l,this.componentRef=h}}class mt{constructor(p,l,h,_,y,S,T,E){this._viewContainerRef=p,this._renderer=l,this._elementRef=h,this._injector=_,this._componentFactoryResolver=y,this._ngZone=S,this._applicationRef=T,this._posService=E,this.onBeforeShow=new s.vpe,this.onShown=new s.vpe,this.onBeforeHide=new s.vpe,this.onHidden=new s.vpe,this._providers=[],this._isHiding=!1,this.containerDefaultSelector="body",this._listenOpts={},this._globalListener=Function.prototype}get isShown(){return!this._isHiding&&!!this._componentRef}attach(p){return this._componentFactory=this._componentFactoryResolver.resolveComponentFactory(p),this}to(p){return this.container=p||this.container,this}position(p){return this.attachment=p.attachment||this.attachment,this._elementRef=p.target||this._elementRef,this}provide(p){return this._providers.push(p),this}show(p={}){if(this._subscribePositioning(),this._innerComponent=null,!this._componentRef){this.onBeforeShow.emit(),this._contentRef=this._getContentRef(p.content,p.context,p.initialState);const l=s.zs3.create({providers:this._providers,parent:this._injector});this._componentRef=this._componentFactory.create(l,this._contentRef.nodes),this._applicationRef.attachView(this._componentRef.hostView),this.instance=this._componentRef.instance,Object.assign(this._componentRef.instance,p),this.container instanceof s.SBq&&this.container.nativeElement.appendChild(this._componentRef.location.nativeElement),"string"==typeof this.container&&typeof document<"u"&&(document.querySelector(this.container)||document.querySelector(this.containerDefaultSelector)).appendChild(this._componentRef.location.nativeElement),!this.container&&this._elementRef&&this._elementRef.nativeElement.parentElement&&this._elementRef.nativeElement.parentElement.appendChild(this._componentRef.location.nativeElement),this._contentRef.componentRef&&(this._innerComponent=this._contentRef.componentRef.instance,this._contentRef.componentRef.changeDetectorRef.markForCheck(),this._contentRef.componentRef.changeDetectorRef.detectChanges()),this._componentRef.changeDetectorRef.markForCheck(),this._componentRef.changeDetectorRef.detectChanges(),this.onShown.emit(p.id?{id:p.id}:this._componentRef.instance)}return this._registerOutsideClick(),this._componentRef}hide(p){if(!this._componentRef)return this;this._posService.deletePositionElement(this._componentRef.location),this.onBeforeHide.emit(this._componentRef.instance);const l=this._componentRef.location.nativeElement;return l.parentNode.removeChild(l),this._contentRef.componentRef&&this._contentRef.componentRef.destroy(),this._viewContainerRef&&this._contentRef.viewRef&&this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._contentRef.viewRef)),this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._contentRef=null,this._componentRef=null,this._removeGlobalListener(),this.onHidden.emit(p?{id:p}:null),this}toggle(){this.isShown?this.hide():this.show()}dispose(){this.isShown&&this.hide(),this._unsubscribePositioning(),this._unregisterListenersFn&&this._unregisterListenersFn()}listen(p){this.triggers=p.triggers||this.triggers,this._listenOpts.outsideClick=p.outsideClick,this._listenOpts.outsideEsc=p.outsideEsc,p.target=p.target||this._elementRef.nativeElement;const l=this._listenOpts.hide=()=>p.hide?p.hide():void this.hide(),h=this._listenOpts.show=y=>{p.show?p.show(y):this.show(y),y()};return this._unregisterListenersFn=function Fe(i,p){const l=function ce(i,p=Ie){const l=(i||"").trim();if(0===l.length)return[];const h=l.split(/\s+/).map(y=>y.split(":")).map(y=>{const S=p[y[0]]||y;return new U(S[0],S[1])}),_=h.filter(y=>y.isManual());if(_.length>1)throw new Error("Triggers parse error: only one manual trigger is allowed");if(1===_.length&&h.length>1)throw new Error("Triggers parse error: manual trigger can't be mixed with other triggers");return h}(p.triggers),h=p.target;if(1===l.length&&l[0].isManual())return Function.prototype;const _=[],y=[],S=()=>{y.forEach(T=>_.push(T())),y.length=0};return l.forEach(T=>{const E=T.open===T.close,C=E?p.toggle:p.show;E||y.push(()=>i.listen(h,T.close,p.hide)),_.push(i.listen(h,T.open,()=>C(S)))}),()=>{_.forEach(T=>T())}}(this._renderer,{target:p.target,triggers:p.triggers,show:h,hide:l,toggle:y=>{this.isShown?l():h(y)}}),this}_removeGlobalListener(){this._globalListener&&(this._globalListener(),this._globalListener=null)}attachInline(p,l){return this._inlineViewRef=p.createEmbeddedView(l),this}_registerOutsideClick(){if(this._componentRef&&this._componentRef.location){if(this._listenOpts.outsideClick){const p=this._componentRef.location.nativeElement;setTimeout(()=>{this._globalListener=function we(i,p){return p.outsideClick?i.listen("document","click",l=>{p.target&&p.target.contains(l.target)||p.targets&&p.targets.some(h=>h.contains(l.target))||p.hide()}):Function.prototype}(this._renderer,{targets:[p,this._elementRef.nativeElement],outsideClick:this._listenOpts.outsideClick,hide:()=>this._listenOpts.hide()})})}this._listenOpts.outsideEsc&&(this._globalListener=function xe(i,p){return p.outsideEsc?i.listen("document","keyup.esc",l=>{p.target&&p.target.contains(l.target)||p.targets&&p.targets.some(h=>h.contains(l.target))||p.hide()}):Function.prototype}(this._renderer,{targets:[this._componentRef.location.nativeElement,this._elementRef.nativeElement],outsideEsc:this._listenOpts.outsideEsc,hide:()=>this._listenOpts.hide()}))}}getInnerComponent(){return this._innerComponent}_subscribePositioning(){this._zoneSubscription||!this.attachment||(this.onShown.subscribe(()=>{this._posService.position({element:this._componentRef.location,target:this._elementRef,attachment:this.attachment,appendToBody:"body"===this.container})}),this._zoneSubscription=this._ngZone.onStable.subscribe(()=>{!this._componentRef||this._posService.calcPosition()}))}_unsubscribePositioning(){!this._zoneSubscription||(this._zoneSubscription.unsubscribe(),this._zoneSubscription=null)}_getContentRef(p,l,h){if(!p)return new z([]);if(p instanceof s.Rgc){if(this._viewContainerRef){const y=this._viewContainerRef.createEmbeddedView(p,l);return y.markForCheck(),new z([y.rootNodes],y)}const _=p.createEmbeddedView({});return this._applicationRef.attachView(_),new z([_.rootNodes],_)}if("function"==typeof p){const _=this._componentFactoryResolver.resolveComponentFactory(p),y=s.zs3.create({providers:this._providers,parent:this._injector}),S=_.create(y);return Object.assign(S.instance,h),this._applicationRef.attachView(S.hostView),new z([[S.location.nativeElement]],S.hostView,S)}return new z([[this._renderer.createText(`${p}`)]])}}let Oe=(()=>{class i{constructor(l,h,_,y,S){this._componentFactoryResolver=l,this._ngZone=h,this._injector=_,this._posService=y,this._applicationRef=S}createLoader(l,h,_){return new mt(h,_,l,this._injector,this._componentFactoryResolver,this._ngZone,this._applicationRef,this._posService)}}return i.\u0275fac=function(l){return new(l||i)(s.LFG(s._Vd),s.LFG(s.R0b),s.LFG(s.zs3),s.LFG(Me),s.LFG(s.z2F))},i.\u0275prov=s.Yz7({token:i,factory:i.\u0275fac}),i})();var W=n(7340);const ft=["*"];let $t=(()=>{class i{constructor(){this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1}}return i.\u0275fac=function(l){return new(l||i)},i.\u0275prov=(0,s.Yz7)({factory:function(){return new i},token:i,providedIn:"root"}),i})(),V=(()=>{class i{constructor(){this.direction="down",this.isOpenChange=new s.vpe,this.isDisabledChange=new s.vpe,this.toggleClick=new s.vpe,this.dropdownMenu=new Promise(l=>{this.resolveDropdownMenu=l})}}return i.\u0275fac=function(l){return new(l||i)},i.\u0275prov=s.Yz7({token:i,factory:i.\u0275fac}),i})();const Le=[(0,W.oB)({height:0,overflow:"hidden"}),(0,W.jt)("220ms cubic-bezier(0, 0, 0.2, 1)",(0,W.oB)({height:"*",overflow:"hidden"}))];let bt=(()=>{class i{constructor(l,h,_,y,S){this._state=l,this.cd=h,this._renderer=_,this._element=y,this.isOpen=!1,this._factoryDropDownAnimation=S.build(Le),this._subscription=l.isOpenChange.subscribe(T=>{this.isOpen=T;const E=this._element.nativeElement.querySelector(".dropdown-menu");this._renderer.addClass(this._element.nativeElement.querySelector("div"),"open"),E&&!te()&&(this._renderer.addClass(E,"show"),E.classList.contains("dropdown-menu-right")&&(this._renderer.setStyle(E,"left","auto"),this._renderer.setStyle(E,"right","0")),"up"===this.direction&&(this._renderer.setStyle(E,"top","auto"),this._renderer.setStyle(E,"transform","translateY(-101%)"))),E&&this._state.isAnimated&&this._factoryDropDownAnimation.create(E).play(),this.cd.markForCheck(),this.cd.detectChanges()})}get direction(){return this._state.direction}_contains(l){return this._element.nativeElement.contains(l)}ngOnDestroy(){this._subscription.unsubscribe()}}return i.\u0275fac=function(l){return new(l||i)(s.Y36(V),s.Y36(s.sBO),s.Y36(s.Qsj),s.Y36(s.SBq),s.Y36(W._j))},i.\u0275cmp=s.Xpm({type:i,selectors:[["bs-dropdown-container"]],hostAttrs:[2,"display","block","position","absolute","z-index","1040"],ngContentSelectors:ft,decls:2,vars:8,template:function(l,h){1&l&&(s.F$t(),s.TgZ(0,"div"),s.Hsn(1),s.qZA()),2&l&&s.ekj("dropup","up"===h.direction)("dropdown","down"===h.direction)("show",h.isOpen)("open",h.isOpen)},dependencies:function(){return[ge]},encapsulation:2,changeDetection:0}),i})(),ge=(()=>{class i{constructor(l,h,_,y,S,T,E){this._elementRef=l,this._renderer=h,this._viewContainerRef=_,this._cis=y,this._state=S,this._config=T,this._isInlineOpen=!1,this._subscriptions=[],this._isInited=!1,this._state.autoClose=this._config.autoClose,this._state.insideClick=this._config.insideClick,this._state.isAnimated=this._config.isAnimated,this._factoryDropDownAnimation=E.build(Le),this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:V,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange}set autoClose(l){this._state.autoClose=l}get autoClose(){return this._state.autoClose}set isAnimated(l){this._state.isAnimated=l}get isAnimated(){return this._state.isAnimated}set insideClick(l){this._state.insideClick=l}get insideClick(){return this._state.insideClick}set isDisabled(l){this._isDisabled=l,this._state.isDisabledChange.emit(l),l&&this.hide()}get isDisabled(){return this._isDisabled}get isOpen(){return this._showInline?this._isInlineOpen:this._dropdown.isShown}set isOpen(l){l?this.show():this.hide()}get isBs4(){return!te()}get _showInline(){return!this.container}ngOnInit(){this._isInited||(this._isInited=!0,this._dropdown.listen({outsideClick:!1,triggers:this.triggers,show:()=>this.show()}),this._subscriptions.push(this._state.toggleClick.subscribe(l=>this.toggle(l))),this._subscriptions.push(this._state.isDisabledChange.pipe((0,He.h)(l=>l)).subscribe(l=>this.hide())))}show(){if(!this.isOpen&&!this.isDisabled){if(this._showInline)return this._inlinedMenu||this._state.dropdownMenu.then(l=>{this._dropdown.attachInline(l.viewContainer,l.templateRef),this._inlinedMenu=this._dropdown._inlineViewRef,this.addBs4Polyfills(),this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode,"open"),this.playAnimation()}).catch(),this.addBs4Polyfills(),this._isInlineOpen=!0,this.onShown.emit(!0),this._state.isOpenChange.emit(!0),void this.playAnimation();this._state.dropdownMenu.then(l=>{const h=this.dropup||typeof this.dropup<"u"&&this.dropup;this._state.direction=h?"up":"down";const _=this.placement||(h?"top start":"bottom start");this._dropdown.attach(bt).to(this.container).position({attachment:_}).show({content:l.templateRef,placement:_}),this._state.isOpenChange.emit(!0)}).catch()}}hide(){!this.isOpen||(this._showInline?(this.removeShowClass(),this.removeDropupStyles(),this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))}toggle(l){return this.isOpen||!l?this.hide():this.show()}_contains(l){return this._elementRef.nativeElement.contains(l.target)||this._dropdown.instance&&this._dropdown.instance._contains(l.target)}ngOnDestroy(){for(const l of this._subscriptions)l.unsubscribe();this._dropdown.dispose()}addBs4Polyfills(){te()||(this.addShowClass(),this.checkRightAlignment(),this.addDropupStyles())}playAnimation(){this._state.isAnimated&&this._inlinedMenu&&setTimeout(()=>{this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play()})}addShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.addClass(this._inlinedMenu.rootNodes[0],"show")}removeShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.removeClass(this._inlinedMenu.rootNodes[0],"show")}checkRightAlignment(){if(this._inlinedMenu&&this._inlinedMenu.rootNodes[0]){const l=this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-right");this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"left",l?"auto":"0"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"right",l?"0":"auto")}}addDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"top",this.dropup?"auto":"100%"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"transform",this.dropup?"translateY(-101%)":"translateY(0)"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"bottom","auto"))}removeDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"top"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"transform"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"bottom"))}}return i.\u0275fac=function(l){return new(l||i)(s.Y36(s.SBq),s.Y36(s.Qsj),s.Y36(s.s_b),s.Y36(Oe),s.Y36(V),s.Y36($t),s.Y36(W._j))},i.\u0275dir=s.lG2({type:i,selectors:[["","bsDropdown",""],["","dropdown",""]],hostVars:6,hostBindings:function(l,h){2&l&&s.ekj("dropup",h.dropup)("open",h.isOpen)("show",h.isOpen&&h.isBs4)},inputs:{autoClose:"autoClose",isAnimated:"isAnimated",insideClick:"insideClick",isDisabled:"isDisabled",isOpen:"isOpen",placement:"placement",triggers:"triggers",container:"container",dropup:"dropup"},outputs:{onShown:"onShown",onHidden:"onHidden",isOpenChange:"isOpenChange"},exportAs:["bs-dropdown"],features:[s._Bn([V])]}),i})(),Nt=(()=>{class i{constructor(l,h,_){l.resolveDropdownMenu({templateRef:_,viewContainer:h})}}return i.\u0275fac=function(l){return new(l||i)(s.Y36(V),s.Y36(s.s_b),s.Y36(s.Rgc))},i.\u0275dir=s.lG2({type:i,selectors:[["","bsDropdownMenu",""],["","dropdownMenu",""]],exportAs:["bs-dropdown-menu"]}),i})(),yt=(()=>{class i{constructor(l,h,_,y,S){this._changeDetectorRef=l,this._dropdown=h,this._element=_,this._renderer=y,this._state=S,this.isDisabled=null,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(T=>{this.isOpen=T,T?(this._documentClickListener=this._renderer.listen("document","click",E=>{this._state.autoClose&&2!==E.button&&!this._element.nativeElement.contains(E.target)&&(!this._state.insideClick||!this._dropdown._contains(E))&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())}),this._escKeyUpListener=this._renderer.listen(this._element.nativeElement,"keyup.esc",()=>{this._state.autoClose&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())})):(this._documentClickListener(),this._escKeyUpListener())})),this._subscriptions.push(this._state.isDisabledChange.subscribe(T=>this.isDisabled=T||null))}onClick(){this.isDisabled||this._state.toggleClick.emit(!0)}ngOnDestroy(){this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener();for(const l of this._subscriptions)l.unsubscribe()}}return i.\u0275fac=function(l){return new(l||i)(s.Y36(s.sBO),s.Y36(ge),s.Y36(s.SBq),s.Y36(s.Qsj),s.Y36(V))},i.\u0275dir=s.lG2({type:i,selectors:[["","bsDropdownToggle",""],["","dropdownToggle",""]],hostVars:3,hostBindings:function(l,h){1&l&&s.NdJ("click",function(){return h.onClick()}),2&l&&s.uIk("aria-haspopup",!0)("disabled",h.isDisabled)("aria-expanded",h.isOpen)},exportAs:["bs-dropdown-toggle"]}),i})(),St=(()=>{class i{static forRoot(l){return{ngModule:i,providers:[Oe,Me,V]}}}return i.\u0275fac=function(l){return new(l||i)},i.\u0275mod=s.oAB({type:i}),i.\u0275inj=s.cJS({}),i})();const Tt=["countryList"];function Et(i,p){if(1&i&&(s.TgZ(0,"div",9),s._uU(1),s.qZA()),2&i){const l=s.oxw();s.xp6(1),s.hij("+",l.selectedCountry.dialCode,"")}}function Pt(i,p){if(1&i){const l=s.EpF();s.TgZ(0,"div",17)(1,"input",18),s.NdJ("ngModelChange",function(_){s.CHM(l);const y=s.oxw(2);return s.KtG(y.countrySearchText=_)})("keyup",function(){s.CHM(l);const _=s.oxw(2);return s.KtG(_.searchCountry())})("click",function(_){return _.stopPropagation()}),s.qZA()()}if(2&i){const l=s.oxw(2);s.xp6(1),s.Q6J("ngModel",l.countrySearchText)("placeholder",l.searchCountryPlaceholder)}}function Ct(i,p){if(1&i){const l=s.EpF();s.TgZ(0,"li",19),s.NdJ("click",function(){const y=s.CHM(l).$implicit,S=s.oxw(2),T=s.MAs(8);return s.KtG(S.onCountrySelect(y,T))}),s.TgZ(1,"div",20),s._UZ(2,"div",3),s.qZA(),s.TgZ(3,"span",21),s._uU(4),s.qZA(),s.TgZ(5,"span",22),s._uU(6),s.qZA()()}if(2&i){const l=p.$implicit;s.Q6J("id",l.htmlId+"-preferred"),s.xp6(2),s.Q6J("ngClass",l.flagClass),s.xp6(2),s.Oqu(l.name),s.xp6(2),s.hij("+",l.dialCode,"")}}function At(i,p){1&i&&s._UZ(0,"li",23)}function Rt(i,p){if(1&i){const l=s.EpF();s.TgZ(0,"li",24),s.NdJ("click",function(){const y=s.CHM(l).$implicit,S=s.oxw(2),T=s.MAs(8);return s.KtG(S.onCountrySelect(y,T))}),s.TgZ(1,"div",20),s._UZ(2,"div",3),s.qZA(),s.TgZ(3,"span",21),s._uU(4),s.qZA(),s.TgZ(5,"span",22),s._uU(6),s.qZA()()}if(2&i){const l=p.$implicit;s.Q6J("id",l.htmlId),s.xp6(2),s.Q6J("ngClass",l.flagClass),s.xp6(2),s.Oqu(l.name),s.xp6(2),s.hij("+",l.dialCode,"")}}function Mt(i,p){if(1&i&&(s.TgZ(0,"div",10),s.YNc(1,Pt,2,2,"div",11),s.TgZ(2,"ul",12,13),s.YNc(4,Ct,7,4,"li",14),s.YNc(5,At,1,0,"li",15),s.YNc(6,Rt,7,4,"li",16),s.qZA()()),2&i){const l=s.oxw();s.xp6(1),s.Q6J("ngIf",l.searchCountryFlag&&l.searchCountryField),s.xp6(3),s.Q6J("ngForOf",l.preferredCountriesInDropDown),s.xp6(1),s.Q6J("ngIf",null==l.preferredCountriesInDropDown?null:l.preferredCountriesInDropDown.length),s.xp6(1),s.Q6J("ngForOf",l.allCountries)}}const Ot=function(i){return{disabled:i}};var $=(()=>{return(i=$||($={})).Afghanistan="af",i.Albania="al",i.Algeria="dz",i.AmericanSamoa="as",i.Andorra="ad",i.Angola="ao",i.Anguilla="ai",i.AntiguaAndBarbuda="ag",i.Argentina="ar",i.Armenia="am",i.Aruba="aw",i.Australia="au",i.Austria="at",i.Azerbaijan="az",i.Bahamas="bs",i.Bahrain="bh",i.Bangladesh="bd",i.Barbados="bb",i.Belarus="by",i.Belgium="be",i.Belize="bz",i.Benin="bj",i.Bermuda="bm",i.Bhutan="bt",i.Bolivia="bo",i.BosniaAndHerzegovina="ba",i.Botswana="bw",i.Brazil="br",i.BritishIndianOceanTerritory="io",i.BritishVirginIslands="vg",i.Brunei="bn",i.Bulgaria="bg",i.BurkinaFaso="bf",i.Burundi="bi",i.Cambodia="kh",i.Cameroon="cm",i.Canada="ca",i.CapeVerde="cv",i.CaribbeanNetherlands="bq",i.CaymanIslands="ky",i.CentralAfricanRepublic="cf",i.Chad="td",i.Chile="cl",i.China="cn",i.ChristmasIsland="cx",i.Cocos="cc",i.Colombia="co",i.Comoros="km",i.CongoDRCJamhuriYaKidemokrasiaYaKongo="cd",i.CongoRepublicCongoBrazzaville="cg",i.CookIslands="ck",i.CostaRica="cr",i.C\u00f4teDIvoire="ci",i.Croatia="hr",i.Cuba="cu",i.Cura\u00e7ao="cw",i.Cyprus="cy",i.CzechRepublic="cz",i.Denmark="dk",i.Djibouti="dj",i.Dominica="dm",i.DominicanRepublic="do",i.Ecuador="ec",i.Egypt="eg",i.ElSalvador="sv",i.EquatorialGuinea="gq",i.Eritrea="er",i.Estonia="ee",i.Ethiopia="et",i.FalklandIslands="fk",i.FaroeIslands="fo",i.Fiji="fj",i.Finland="fi",i.France="fr",i.FrenchGuiana="gf",i.FrenchPolynesia="pf",i.Gabon="ga",i.Gambia="gm",i.Georgia="ge",i.Germany="de",i.Ghana="gh",i.Gibraltar="gi",i.Greece="gr",i.Greenland="gl",i.Grenada="gd",i.Guadeloupe="gp",i.Guam="gu",i.Guatemala="gt",i.Guernsey="gg",i.Guinea="gn",i.GuineaBissau="gw",i.Guyana="gy",i.Haiti="ht",i.Honduras="hn",i.HongKong="hk",i.Hungary="hu",i.Iceland="is",i.India="in",i.Indonesia="id",i.Iran="ir",i.Iraq="iq",i.Ireland="ie",i.IsleOfMan="im",i.Israel="il",i.Italy="it",i.Jamaica="jm",i.Japan="jp",i.Jersey="je",i.Jordan="jo",i.Kazakhstan="kz",i.Kenya="ke",i.Kiribati="ki",i.Kosovo="xk",i.Kuwait="kw",i.Kyrgyzstan="kg",i.Laos="la",i.Latvia="lv",i.Lebanon="lb",i.Lesotho="ls",i.Liberia="lr",i.Libya="ly",i.Liechtenstein="li",i.Lithuania="lt",i.Luxembourg="lu",i.Macau="mo",i.Macedonia="mk",i.Madagascar="mg",i.Malawi="mw",i.Malaysia="my",i.Maldives="mv",i.Mali="ml",i.Malta="mt",i.MarshallIslands="mh",i.Martinique="mq",i.Mauritania="mr",i.Mauritius="mu",i.Mayotte="yt",i.Mexico="mx",i.Micronesia="fm",i.Moldova="md",i.Monaco="mc",i.Mongolia="mn",i.Montenegro="me",i.Montserrat="ms",i.Morocco="ma",i.Mozambique="mz",i.Myanmar="mm",i.Namibia="na",i.Nauru="nr",i.Nepal="np",i.Netherlands="nl",i.NewCaledonia="nc",i.NewZealand="nz",i.Nicaragua="ni",i.Niger="ne",i.Nigeria="ng",i.Niue="nu",i.NorfolkIsland="nf",i.NorthKorea="kp",i.NorthernMarianaIslands="mp",i.Norway="no",i.Oman="om",i.Pakistan="pk",i.Palau="pw",i.Palestine="ps",i.Panama="pa",i.PapuaNewGuinea="pg",i.Paraguay="py",i.Peru="pe",i.Philippines="ph",i.Poland="pl",i.Portugal="pt",i.PuertoRico="pr",i.Qatar="qa",i.R\u00e9union="re",i.Romania="ro",i.Russia="ru",i.Rwanda="rw",i.SaintBarth\u00e9lemy="bl",i.SaintHelena="sh",i.SaintKittsAndNevis="kn",i.SaintLucia="lc",i.SaintMartin="mf",i.SaintPierreAndMiquelon="pm",i.SaintVincentAndTheGrenadines="vc",i.Samoa="ws",i.SanMarino="sm",i.S\u00e3oTom\u00e9AndPr\u00edncipe="st",i.SaudiArabia="sa",i.Senegal="sn",i.Serbia="rs",i.Seychelles="sc",i.SierraLeone="sl",i.Singapore="sg",i.SintMaarten="sx",i.Slovakia="sk",i.Slovenia="si",i.SolomonIslands="sb",i.Somalia="so",i.SouthAfrica="za",i.SouthKorea="kr",i.SouthSudan="ss",i.Spain="es",i.SriLanka="lk",i.Sudan="sd",i.Suriname="sr",i.SvalbardAndJanMayen="sj",i.Swaziland="sz",i.Sweden="se",i.Switzerland="ch",i.Syria="sy",i.Taiwan="tw",i.Tajikistan="tj",i.Tanzania="tz",i.Thailand="th",i.TimorLeste="tl",i.Togo="tg",i.Tokelau="tk",i.Tonga="to",i.TrinidadAndTobago="tt",i.Tunisia="tn",i.Turkey="tr",i.Turkmenistan="tm",i.TurksAndCaicosIslands="tc",i.Tuvalu="tv",i.USVirginIslands="vi",i.Uganda="ug",i.Ukraine="ua",i.UnitedArabEmirates="ae",i.UnitedKingdom="gb",i.UnitedStates="us",i.Uruguay="uy",i.Uzbekistan="uz",i.Vanuatu="vu",i.VaticanCity="va",i.Venezuela="ve",i.Vietnam="vn",i.WallisAndFutuna="wf",i.WesternSahara="eh",i.Yemen="ye",i.Zambia="zm",i.Zimbabwe="zw",i.\u00c5landIslands="ax",$;var i})();let De=(()=>{class i{constructor(){this.allCountries=[["Afghanistan (\u202b\u0627\u0641\u063a\u0627\u0646\u0633\u062a\u0627\u0646\u202c\u200e)",$.Afghanistan,"93"],["Albania (Shqip\xebri)",$.Albania,"355"],["Algeria (\u202b\u0627\u0644\u062c\u0632\u0627\u0626\u0631\u202c\u200e)",$.Algeria,"213"],["American Samoa","as","1",1,["684"]],["Andorra",$.Andorra,"376"],["Angola",$.Angola,"244"],["Anguilla","ai","1",1,["264"]],["Antigua and Barbuda","ag","1",1,["268"]],["Argentina",$.Argentina,"54"],["Armenia (\u0540\u0561\u0575\u0561\u057d\u057f\u0561\u0576)",$.Armenia,"374"],["Aruba",$.Aruba,"297"],["Australia",$.Australia,"61",0],["Austria (\xd6sterreich)",$.Austria,"43"],["Azerbaijan (Az\u0259rbaycan)",$.Azerbaijan,"994"],["Bahamas","bs","1",1,["242"]],["Bahrain (\u202b\u0627\u0644\u0628\u062d\u0631\u064a\u0646\u202c\u200e)",$.Bahrain,"973"],["Bangladesh (\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)",$.Bangladesh,"880"],["Barbados","bb","1",1,["246"]],["Belarus (\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u044c)",$.Belarus,"375"],["Belgium (Belgi\xeb)",$.Belgium,"32"],["Belize",$.Belize,"501"],["Benin (B\xe9nin)",$.Benin,"229"],["Bermuda","bm","1",1,["441"]],["Bhutan (\u0f60\u0f56\u0fb2\u0f74\u0f42)",$.Bhutan,"975"],["Bolivia",$.Bolivia,"591"],["Bosnia and Herzegovina (\u0411\u043e\u0441\u043d\u0430 \u0438 \u0425\u0435\u0440\u0446\u0435\u0433\u043e\u0432\u0438\u043d\u0430)",$.BosniaAndHerzegovina,"387"],["Botswana",$.Botswana,"267"],["Brazil (Brasil)",$.Brazil,"55"],["British Indian Ocean Territory",$.BritishIndianOceanTerritory,"246"],["British Virgin Islands","vg","1",1,["284"]],["Brunei",$.Brunei,"673"],["Bulgaria (\u0411\u044a\u043b\u0433\u0430\u0440\u0438\u044f)",$.Bulgaria,"359"],["Burkina Faso",$.BurkinaFaso,"226"],["Burundi (Uburundi)",$.Burundi,"257"],["Cambodia (\u1780\u1798\u17d2\u1796\u17bb\u1787\u17b6)",$.Cambodia,"855"],["Cameroon (Cameroun)",$.Cameroon,"237"],["Canada",$.Canada,"1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)",$.CapeVerde,"238"],["Caribbean Netherlands",$.CaribbeanNetherlands,"599",1],["Cayman Islands","ky","1",1,["345"]],["Central African Republic (R\xe9publique centrafricaine)",$.CentralAfricanRepublic,"236"],["Chad (Tchad)",$.Chad,"235"],["Chile",$.Chile,"56"],["China (\u4e2d\u56fd)",$.China,"86"],["Christmas Island",$.ChristmasIsland,"61",2],["Cocos (Keeling) Islands",$.Cocos,"61",1],["Colombia",$.Colombia,"57"],["Comoros (\u202b\u062c\u0632\u0631 \u0627\u0644\u0642\u0645\u0631\u202c\u200e)",$.Comoros,"269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)",$.CongoDRCJamhuriYaKidemokrasiaYaKongo,"243"],["Congo (Republic) (Congo-Brazzaville)",$.CongoRepublicCongoBrazzaville,"242"],["Cook Islands",$.CookIslands,"682"],["Costa Rica",$.CostaRica,"506"],["C\xf4te d\u2019Ivoire",$.C\u00f4teDIvoire,"225"],["Croatia (Hrvatska)",$.Croatia,"385"],["Cuba",$.Cuba,"53"],["Cura\xe7ao",$.Cura\u00e7ao,"599",0],["Cyprus (\u039a\u03cd\u03c0\u03c1\u03bf\u03c2)",$.Cyprus,"357"],["Czech Republic (\u010cesk\xe1 republika)",$.CzechRepublic,"420"],["Denmark (Danmark)",$.Denmark,"45"],["Djibouti",$.Djibouti,"253"],["Dominica",$.Dominica,"1767"],["Dominican Republic (Rep\xfablica Dominicana)",$.DominicanRepublic,"1",2,["809","829","849"]],["Ecuador",$.Ecuador,"593"],["Egypt (\u202b\u0645\u0635\u0631\u202c\u200e)",$.Egypt,"20"],["El Salvador",$.ElSalvador,"503"],["Equatorial Guinea (Guinea Ecuatorial)",$.EquatorialGuinea,"240"],["Eritrea",$.Eritrea,"291"],["Estonia (Eesti)",$.Estonia,"372"],["Ethiopia",$.Ethiopia,"251"],["Falkland Islands (Islas Malvinas)",$.FalklandIslands,"500"],["Faroe Islands (F\xf8royar)",$.FaroeIslands,"298"],["Fiji",$.Fiji,"679"],["Finland (Suomi)",$.Finland,"358",0],["France",$.France,"33"],["French Guiana (Guyane fran\xe7aise)",$.FrenchGuiana,"594"],["French Polynesia (Polyn\xe9sie fran\xe7aise)",$.FrenchPolynesia,"689"],["Gabon",$.Gabon,"241"],["Gambia",$.Gambia,"220"],["Georgia (\u10e1\u10d0\u10e5\u10d0\u10e0\u10d7\u10d5\u10d4\u10da\u10dd)",$.Georgia,"995"],["Germany (Deutschland)",$.Germany,"49"],["Ghana (Gaana)",$.Ghana,"233"],["Gibraltar",$.Gibraltar,"350"],["Greece (\u0395\u03bb\u03bb\u03ac\u03b4\u03b1)",$.Greece,"30"],["Greenland (Kalaallit Nunaat)",$.Greenland,"299"],["Grenada",$.Grenada,"1473"],["Guadeloupe",$.Guadeloupe,"590",0],["Guam","gu","1",1,["671"]],["Guatemala",$.Guatemala,"502"],["Guernsey",$.Guernsey,"44",1,[1481]],["Guinea (Guin\xe9e)",$.Guinea,"224"],["Guinea-Bissau (Guin\xe9 Bissau)",$.GuineaBissau,"245"],["Guyana",$.Guyana,"592"],["Haiti",$.Haiti,"509"],["Honduras",$.Honduras,"504"],["Hong Kong (\u9999\u6e2f)",$.HongKong,"852"],["Hungary (Magyarorsz\xe1g)",$.Hungary,"36"],["Iceland (\xcdsland)",$.Iceland,"354"],["India (\u092d\u093e\u0930\u0924)",$.India,"91"],["Indonesia",$.Indonesia,"62"],["Iran (\u202b\u0627\u06cc\u0631\u0627\u0646\u202c\u200e)",$.Iran,"98"],["Iraq (\u202b\u0627\u0644\u0639\u0631\u0627\u0642\u202c\u200e)",$.Iraq,"964"],["Ireland",$.Ireland,"353"],["Isle of Man",$.IsleOfMan,"44",2,[1624]],["Israel (\u202b\u05d9\u05e9\u05e8\u05d0\u05dc\u202c\u200e)",$.Israel,"972"],["Italy (Italia)",$.Italy,"39",0],["Jamaica","jm","1",1,["876"]],["Japan (\u65e5\u672c)",$.Japan,"81"],["Jersey",$.Jersey,"44",3,[1534]],["Jordan (\u202b\u0627\u0644\u0623\u0631\u062f\u0646\u202c\u200e)",$.Jordan,"962"],["Kazakhstan (\u041a\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043d)",$.Kazakhstan,"7",1],["Kenya",$.Kenya,"254"],["Kiribati",$.Kiribati,"686"],["Kosovo",$.Kosovo,"383"],["Kuwait (\u202b\u0627\u0644\u0643\u0648\u064a\u062a\u202c\u200e)",$.Kuwait,"965"],["Kyrgyzstan (\u041a\u044b\u0440\u0433\u044b\u0437\u0441\u0442\u0430\u043d)",$.Kyrgyzstan,"996"],["Laos (\u0ea5\u0eb2\u0ea7)",$.Laos,"856"],["Latvia (Latvija)",$.Latvia,"371"],["Lebanon (\u202b\u0644\u0628\u0646\u0627\u0646\u202c\u200e)",$.Lebanon,"961"],["Lesotho",$.Lesotho,"266"],["Liberia",$.Liberia,"231"],["Libya (\u202b\u0644\u064a\u0628\u064a\u0627\u202c\u200e)",$.Libya,"218"],["Liechtenstein",$.Liechtenstein,"423"],["Lithuania (Lietuva)",$.Lithuania,"370"],["Luxembourg",$.Luxembourg,"352"],["Macau (\u6fb3\u9580)",$.Macau,"853"],["Macedonia (FYROM) (\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0438\u0458\u0430)",$.Macedonia,"389"],["Madagascar (Madagasikara)",$.Madagascar,"261"],["Malawi",$.Malawi,"265"],["Malaysia",$.Malaysia,"60"],["Maldives",$.Maldives,"960"],["Mali",$.Mali,"223"],["Malta",$.Malta,"356"],["Marshall Islands",$.MarshallIslands,"692"],["Martinique",$.Martinique,"596"],["Mauritania (\u202b\u0645\u0648\u0631\u064a\u062a\u0627\u0646\u064a\u0627\u202c\u200e)",$.Mauritania,"222"],["Mauritius (Moris)",$.Mauritius,"230"],["Mayotte",$.Mayotte,"262",1],["Mexico (M\xe9xico)",$.Mexico,"52"],["Micronesia",$.Micronesia,"691"],["Moldova (Republica Moldova)",$.Moldova,"373"],["Monaco",$.Monaco,"377"],["Mongolia (\u041c\u043e\u043d\u0433\u043e\u043b)",$.Mongolia,"976"],["Montenegro (Crna Gora)",$.Montenegro,"382"],["Montserrat","ms","1",1,["664"]],["Morocco (\u202b\u0627\u0644\u0645\u063a\u0631\u0628\u202c\u200e)",$.Morocco,"212",0],["Mozambique (Mo\xe7ambique)",$.Mozambique,"258"],["Myanmar (Burma) (\u1019\u103c\u1014\u103a\u1019\u102c)",$.Myanmar,"95"],["Namibia (Namibi\xeb)",$.Namibia,"264"],["Nauru",$.Nauru,"674"],["Nepal (\u0928\u0947\u092a\u093e\u0932)",$.Nepal,"977"],["Netherlands (Nederland)",$.Netherlands,"31"],["New Caledonia (Nouvelle-Cal\xe9donie)",$.NewCaledonia,"687"],["New Zealand",$.NewZealand,"64"],["Nicaragua",$.Nicaragua,"505"],["Niger (Nijar)",$.Niger,"227"],["Nigeria",$.Nigeria,"234"],["Niue",$.Niue,"683"],["Norfolk Island",$.NorfolkIsland,"672"],["North Korea (\uc870\uc120 \ubbfc\uc8fc\uc8fc\uc758 \uc778\ubbfc \uacf5\ud654\uad6d)",$.NorthKorea,"850"],["Northern Mariana Islands",$.NorthernMarianaIslands,"1670"],["Norway (Norge)",$.Norway,"47",0],["Oman (\u202b\u0639\u064f\u0645\u0627\u0646\u202c\u200e)",$.Oman,"968"],["Pakistan (\u202b\u067e\u0627\u06a9\u0633\u062a\u0627\u0646\u202c\u200e)",$.Pakistan,"92"],["Palau",$.Palau,"680"],["Palestine (\u202b\u0641\u0644\u0633\u0637\u064a\u0646\u202c\u200e)",$.Palestine,"970"],["Panama (Panam\xe1)",$.Panama,"507"],["Papua New Guinea",$.PapuaNewGuinea,"675"],["Paraguay",$.Paraguay,"595"],["Peru (Per\xfa)",$.Peru,"51"],["Philippines",$.Philippines,"63"],["Poland (Polska)",$.Poland,"48"],["Portugal",$.Portugal,"351"],["Puerto Rico",$.PuertoRico,"1",3,["787","939"]],["Qatar (\u202b\u0642\u0637\u0631\u202c\u200e)",$.Qatar,"974"],["R\xe9union (La R\xe9union)",$.R\u00e9union,"262",0],["Romania (Rom\xe2nia)",$.Romania,"40"],["Russia (\u0420\u043e\u0441\u0441\u0438\u044f)",$.Russia,"7",0],["Rwanda",$.Rwanda,"250"],["Saint Barth\xe9lemy (Saint-Barth\xe9lemy)",$.SaintBarth\u00e9lemy,"590",1],["Saint Helena",$.SaintHelena,"290"],["Saint Kitts and Nevis",$.SaintKittsAndNevis,"1869"],["Saint Lucia","lc","1",1,["758"]],["Saint Martin (Saint-Martin (partie fran\xe7aise))",$.SaintMartin,"590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)",$.SaintPierreAndMiquelon,"508"],["Saint Vincent and the Grenadines","vc","1",1,["784"]],["Samoa",$.Samoa,"685"],["San Marino",$.SanMarino,"378"],["S\xe3o Tom\xe9 and Pr\xedncipe (S\xe3o Tom\xe9 e Pr\xedncipe)",$.S\u00e3oTom\u00e9AndPr\u00edncipe,"239"],["Saudi Arabia (\u202b\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0639\u0631\u0628\u064a\u0629 \u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629\u202c\u200e)",$.SaudiArabia,"966"],["Senegal (S\xe9n\xe9gal)",$.Senegal,"221"],["Serbia (\u0421\u0440\u0431\u0438\u0458\u0430)",$.Serbia,"381"],["Seychelles",$.Seychelles,"248"],["Sierra Leone",$.SierraLeone,"232"],["Singapore",$.Singapore,"65"],["Sint Maarten","sx","1",1,["721"]],["Slovakia (Slovensko)",$.Slovakia,"421"],["Slovenia (Slovenija)",$.Slovenia,"386"],["Solomon Islands",$.SolomonIslands,"677"],["Somalia (Soomaaliya)",$.Somalia,"252"],["South Africa",$.SouthAfrica,"27"],["South Korea (\ub300\ud55c\ubbfc\uad6d)",$.SouthKorea,"82"],["South Sudan (\u202b\u062c\u0646\u0648\u0628 \u0627\u0644\u0633\u0648\u062f\u0627\u0646\u202c\u200e)",$.SouthSudan,"211"],["Spain (Espa\xf1a)",$.Spain,"34"],["Sri Lanka (\u0dc1\u0dca\u200d\u0dbb\u0dd3 \u0dbd\u0d82\u0d9a\u0dcf\u0dc0)",$.SriLanka,"94"],["Sudan (\u202b\u0627\u0644\u0633\u0648\u062f\u0627\u0646\u202c\u200e)",$.Sudan,"249"],["Suriname",$.Suriname,"597"],["Svalbard and Jan Mayen",$.SvalbardAndJanMayen,"47",1],["Swaziland",$.Swaziland,"268"],["Sweden (Sverige)",$.Sweden,"46"],["Switzerland (Schweiz)",$.Switzerland,"41"],["Syria (\u202b\u0633\u0648\u0631\u064a\u0627\u202c\u200e)",$.Syria,"963"],["Taiwan (\u53f0\u7063)",$.Taiwan,"886"],["Tajikistan",$.Tajikistan,"992"],["Tanzania",$.Tanzania,"255"],["Thailand (\u0e44\u0e17\u0e22)",$.Thailand,"66"],["Timor-Leste",$.TimorLeste,"670"],["Togo",$.Togo,"228"],["Tokelau",$.Tokelau,"690"],["Tonga",$.Tonga,"676"],["Trinidad and Tobago","tt","1",1,["868"]],["Tunisia (\u202b\u062a\u0648\u0646\u0633\u202c\u200e)",$.Tunisia,"216"],["Turkey (T\xfcrkiye)",$.Turkey,"90"],["Turkmenistan",$.Turkmenistan,"993"],["Turks and Caicos Islands",$.TurksAndCaicosIslands,"1649"],["Tuvalu",$.Tuvalu,"688"],["U.S. Virgin Islands","vi","1",1,["340"]],["Uganda",$.Uganda,"256"],["Ukraine (\u0423\u043a\u0440\u0430\u0457\u043d\u0430)",$.Ukraine,"380"],["United Arab Emirates (\u202b\u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062a \u0627\u0644\u0639\u0631\u0628\u064a\u0629 \u0627\u0644\u0645\u062a\u062d\u062f\u0629\u202c\u200e)",$.UnitedArabEmirates,"971"],["United Kingdom",$.UnitedKingdom,"44",0],["United States",$.UnitedStates,"1",0],["Uruguay",$.Uruguay,"598"],["Uzbekistan (O\u02bbzbekiston)",$.Uzbekistan,"998"],["Vanuatu",$.Vanuatu,"678"],["Vatican City (Citt\xe0 del Vaticano)",$.VaticanCity,"39",1],["Venezuela",$.Venezuela,"58"],["Vietnam (Vi\u1ec7t Nam)",$.Vietnam,"84"],["Wallis and Futuna",$.WallisAndFutuna,"681"],["Western Sahara (\u202b\u0627\u0644\u0635\u062d\u0631\u0627\u0621 \u0627\u0644\u063a\u0631\u0628\u064a\u0629\u202c\u200e)",$.WesternSahara,"212",1],["Yemen (\u202b\u0627\u0644\u064a\u0645\u0646\u202c\u200e)",$.Yemen,"967"],["Zambia",$.Zambia,"260"],["Zimbabwe",$.Zimbabwe,"263"],["\xc5land Islands",$.\u00c5landIslands,"358",1]]}}return i.\u0275fac=function(l){return new(l||i)},i.\u0275prov=s.Yz7({token:i,factory:i.\u0275fac}),i})();var w=(()=>{return(i=w||(w={})).DialCode="dialCode",i.Iso2="iso2",i.Name="name",i.All="all",w;var i})();const Lt=i=>{if(!i.value)return;const p=i.nativeElement,l=p?p.querySelector('input[type="tel"]'):void 0;if(l){const _=l.getAttribute("validation");if("true"===_){const y=i.errors&&!0===i.errors.required,S={validatePhoneNumber:{valid:!1}};let T;l.setCustomValidity("Invalid field.");try{T=R.PhoneNumberUtil.getInstance().parse(i.value.number,i.value.countryCode)}catch{if(y)return S;l.setCustomValidity("")}if(i.value){if(!T)return S;if(!R.PhoneNumberUtil.getInstance().isValidNumberForRegion(T,i.value.countryCode))return S;l.setCustomValidity("")}}else"false"===_&&(l.setCustomValidity(""),i.clearValidators())}};var K=(()=>{return(i=K||(K={})).International="INTERNATIONAL",i.National="NATIONAL",K;var i})();let q=(()=>{class i{constructor(l,h){this.controlDir=l,this.host=h}ngOnInit(){this.controlDir.control&&(this.controlDir.control.nativeElement=this.host.nativeElement)}}return i.\u0275fac=function(l){return new(l||i)(s.Y36(u.a5),s.Y36(s.SBq))},i.\u0275dir=s.lG2({type:i,selectors:[["","ngModel",""],["","formControl",""],["","formControlName",""]]}),i})(),Dt=(()=>{class i{constructor(l){this.countryCodeData=l,this.value="",this.preferredCountries=[],this.enablePlaceholder=!0,this.numberFormat=K.International,this.cssClass="form-control",this.onlyCountries=[],this.enableAutoCountrySelect=!0,this.searchCountryFlag=!1,this.searchCountryField=[w.All],this.searchCountryPlaceholder="Search Country",this.selectFirstCountry=!0,this.phoneValidation=!0,this.inputId="phone",this.separateDialCode=!1,this.countryChange=new s.vpe,this.selectedCountry={areaCodes:void 0,dialCode:"",htmlId:"",flagClass:"",iso2:"",name:"",placeHolder:"",priority:0},this.phoneNumber="",this.allCountries=[],this.preferredCountriesInDropDown=[],this.phoneUtil=R.PhoneNumberUtil.getInstance(),this.disabled=!1,this.errors=["Phone number is required."],this.countrySearchText="",this.onTouched=()=>{},this.propagateChange=h=>{},function Be(i){k=i}("bs4")}ngOnInit(){this.init()}ngOnChanges(l){const h=l.selectedCountryISO;this.allCountries&&h&&h.currentValue!==h.previousValue&&this.updateSelectedCountry(),l.preferredCountries&&this.updatePreferredCountries(),this.checkSeparateDialCodeStyle()}init(){this.fetchCountryData(),this.preferredCountries.length&&this.updatePreferredCountries(),this.onlyCountries.length&&(this.allCountries=this.allCountries.filter(l=>this.onlyCountries.includes(l.iso2))),this.selectFirstCountry&&this.setSelectedCountry(this.preferredCountriesInDropDown.length?this.preferredCountriesInDropDown[0]:this.allCountries[0]),this.updateSelectedCountry(),this.checkSeparateDialCodeStyle()}setSelectedCountry(l){this.selectedCountry=l,this.countryChange.emit(l)}searchCountry(){if(!this.countrySearchText)return void this.countryList.nativeElement.querySelector(".iti__country-list li").scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});const l=this.countrySearchText.toLowerCase(),h=this.allCountries.filter(_=>{if(this.searchCountryField.indexOf(w.All)>-1){if(_.iso2.toLowerCase().startsWith(l)||_.name.toLowerCase().startsWith(l)||_.dialCode.startsWith(this.countrySearchText))return _}else if(this.searchCountryField.indexOf(w.Iso2)>-1&&_.iso2.toLowerCase().startsWith(l)||this.searchCountryField.indexOf(w.Name)>-1&&_.name.toLowerCase().startsWith(l)||this.searchCountryField.indexOf(w.DialCode)>-1&&_.dialCode.startsWith(this.countrySearchText))return _});if(h.length>0){const _=this.countryList.nativeElement.querySelector("#"+h[0].htmlId);_&&_.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}this.checkSeparateDialCodeStyle()}onPhoneNumberChange(){let l;if(this.phoneNumber&&"object"==typeof this.phoneNumber){const _=this.phoneNumber;this.phoneNumber=_.number,l=_.countryCode}this.value=this.phoneNumber,l=l||this.selectedCountry.iso2;const h=this.getParsedNumber(this.phoneNumber,l);if(this.enableAutoCountrySelect&&(l=h&&h.getCountryCode()?this.getCountryIsoCode(h.getCountryCode(),h):this.selectedCountry.iso2,l&&l!==this.selectedCountry.iso2)){const _=this.allCountries.sort((y,S)=>y.priority-S.priority).find(y=>y.iso2===l);_&&(this.selectedCountry=_)}if(l=l||this.selectedCountry.iso2,this.checkSeparateDialCodeStyle(),this.value){const _=h?this.phoneUtil.format(h,R.PhoneNumberFormat.INTERNATIONAL):"";this.separateDialCode&&_&&(this.value=this.removeDialCode(_)),this.propagateChange({number:this.value,internationalNumber:_,nationalNumber:h?this.phoneUtil.format(h,R.PhoneNumberFormat.NATIONAL):"",e164Number:h?this.phoneUtil.format(h,R.PhoneNumberFormat.E164):"",countryCode:l.toUpperCase(),dialCode:"+"+this.selectedCountry.dialCode})}else this.propagateChange(null)}onCountrySelect(l,h){if(this.setSelectedCountry(l),this.checkSeparateDialCodeStyle(),this.phoneNumber&&this.phoneNumber.length>0){this.value=this.phoneNumber;const _=this.getParsedNumber(this.phoneNumber,this.selectedCountry.iso2),y=_?this.phoneUtil.format(_,R.PhoneNumberFormat.INTERNATIONAL):"";this.separateDialCode&&y&&(this.value=this.removeDialCode(y)),this.propagateChange({number:this.value,internationalNumber:y,nationalNumber:_?this.phoneUtil.format(_,R.PhoneNumberFormat.NATIONAL):"",e164Number:_?this.phoneUtil.format(_,R.PhoneNumberFormat.E164):"",countryCode:this.selectedCountry.iso2.toUpperCase(),dialCode:"+"+this.selectedCountry.dialCode})}else this.propagateChange(null);h.focus()}onInputKeyPress(l){!/[0-9\+\-\(\)\ ]/.test(l.key)&&(!l.ctrlKey||!/[axcv]/.test(l.key))&&!["ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End","Insert","Delete","Backspace"].includes(l.key)&&l.preventDefault()}registerOnChange(l){this.propagateChange=l}registerOnTouched(l){this.onTouched=l}setDisabledState(l){this.disabled=l}writeValue(l){void 0===l&&this.init(),this.phoneNumber=l,setTimeout(()=>{this.onPhoneNumberChange()},1)}resolvePlaceholder(){let l="";return this.customPlaceholder?l=this.customPlaceholder:this.selectedCountry.placeHolder&&(l=this.selectedCountry.placeHolder,this.separateDialCode&&(l=this.removeDialCode(l))),l}getParsedNumber(l,h){let _;try{_=this.phoneUtil.parse(l,h.toUpperCase())}catch{}return _}checkSeparateDialCodeStyle(){this.separateDialCodeClass=this.separateDialCode&&this.selectedCountry?"separate-dial-code iti-sdc-"+(this.selectedCountry.dialCode.length+1):""}removeDialCode(l){const h=this.getParsedNumber(l,this.selectedCountry.iso2);return(l=this.phoneUtil.format(h,R.PhoneNumberFormat[this.numberFormat])).startsWith("+")&&this.separateDialCode&&(l=l.substr(l.indexOf(" ")+1)),l}getCountryIsoCode(l,h){const _=h.values_[2].toString(),y=this.allCountries.filter(C=>C.dialCode===l.toString()),S=y.find(C=>void 0===C.areaCodes),T=y.filter(C=>void 0!==C.areaCodes);let E=S?S.iso2:void 0;return T.forEach(C=>{C.areaCodes.forEach(A=>{_.startsWith(A)&&(E=C.iso2)})}),E}getPhoneNumberPlaceHolder(l){try{return this.phoneUtil.format(this.phoneUtil.getExampleNumber(l),R.PhoneNumberFormat[this.numberFormat])}catch(h){return h}}fetchCountryData(){this.allCountries=[],this.countryCodeData.allCountries.forEach(l=>{const h={name:l[0].toString(),iso2:l[1].toString(),dialCode:l[2].toString(),priority:+l[3]||0,areaCodes:l[4]||void 0,htmlId:`iti-0__item-${l[1].toString()}`,flagClass:`iti__${l[1].toString().toLocaleLowerCase()}`,placeHolder:""};this.enablePlaceholder&&(h.placeHolder=this.getPhoneNumberPlaceHolder(h.iso2.toUpperCase())),this.allCountries.push(h)})}updatePreferredCountries(){this.preferredCountries.length&&(this.preferredCountriesInDropDown=[],this.preferredCountries.forEach(l=>{const h=this.allCountries.filter(_=>_.iso2===l);this.preferredCountriesInDropDown.push(h[0])}))}updateSelectedCountry(){this.selectedCountryISO&&(this.selectedCountry=this.allCountries.find(l=>l.iso2.toLowerCase()===this.selectedCountryISO.toLowerCase()),this.selectedCountry&&(this.phoneNumber?this.onPhoneNumberChange():this.propagateChange(null)))}}return i.\u0275fac=function(l){return new(l||i)(s.Y36(De))},i.\u0275cmp=s.Xpm({type:i,selectors:[["ngx-intl-tel-input"]],viewQuery:function(l,h){if(1&l&&s.Gf(Tt,5),2&l){let _;s.iGM(_=s.CRH())&&(h.countryList=_.first)}},inputs:{value:"value",preferredCountries:"preferredCountries",enablePlaceholder:"enablePlaceholder",customPlaceholder:"customPlaceholder",numberFormat:"numberFormat",cssClass:"cssClass",onlyCountries:"onlyCountries",enableAutoCountrySelect:"enableAutoCountrySelect",searchCountryFlag:"searchCountryFlag",searchCountryField:"searchCountryField",searchCountryPlaceholder:"searchCountryPlaceholder",maxLength:"maxLength",selectFirstCountry:"selectFirstCountry",selectedCountryISO:"selectedCountryISO",phoneValidation:"phoneValidation",inputId:"inputId",separateDialCode:"separateDialCode"},outputs:{countryChange:"countryChange"},features:[s._Bn([De,{provide:u.JU,useExisting:(0,s.Gpc)(()=>i),multi:!0},{provide:u.Cf,useValue:Lt,multi:!0}]),s.TTD],decls:9,vars:14,consts:[[1,"iti","iti--allow-dropdown",3,"ngClass"],["dropdown","",1,"iti__flag-container",3,"ngClass","isDisabled"],["dropdownToggle","",1,"iti__selected-flag","dropdown-toggle"],[1,"iti__flag",3,"ngClass"],["class","selected-dial-code",4,"ngIf"],[1,"iti__arrow"],["class","dropdown-menu country-dropdown",4,"dropdownMenu"],["type","tel","autocomplete","off",3,"id","ngClass","ngModel","disabled","placeholder","blur","keypress","ngModelChange"],["focusable",""],[1,"selected-dial-code"],[1,"dropdown-menu","country-dropdown"],["class","search-container",4,"ngIf"],[1,"iti__country-list"],["countryList",""],["class","iti__country iti__preferred",3,"id","click",4,"ngFor","ngForOf"],["class","iti__divider",4,"ngIf"],["class","iti__country iti__standard",3,"id","click",4,"ngFor","ngForOf"],[1,"search-container"],["id","country-search-box","autofocus","",3,"ngModel","placeholder","ngModelChange","keyup","click"],[1,"iti__country","iti__preferred",3,"id","click"],[1,"iti__flag-box"],[1,"iti__country-name"],[1,"iti__dial-code"],[1,"iti__divider"],[1,"iti__country","iti__standard",3,"id","click"]],template:function(l,h){1&l&&(s.TgZ(0,"div",0)(1,"div",1)(2,"div",2),s._UZ(3,"div",3),s.YNc(4,Et,2,1,"div",4),s._UZ(5,"div",5),s.qZA(),s.YNc(6,Mt,7,4,"div",6),s.qZA(),s.TgZ(7,"input",7,8),s.NdJ("blur",function(){return h.onTouched()})("keypress",function(y){return h.onInputKeyPress(y)})("ngModelChange",function(y){return h.phoneNumber=y})("ngModelChange",function(){return h.onPhoneNumberChange()}),s.qZA()()),2&l&&(s.Q6J("ngClass",h.separateDialCodeClass),s.xp6(1),s.Q6J("ngClass",s.VKq(12,Ot,h.disabled))("isDisabled",h.disabled),s.xp6(2),s.Q6J("ngClass",(null==h.selectedCountry?null:h.selectedCountry.flagClass)||""),s.xp6(1),s.Q6J("ngIf",h.separateDialCode),s.xp6(3),s.Q6J("id",h.inputId)("ngClass",h.cssClass)("ngModel",h.phoneNumber)("disabled",h.disabled)("placeholder",h.resolvePlaceholder()),s.uIk("maxLength",h.maxLength)("validation",h.phoneValidation))},dependencies:[r.mk,ge,yt,r.O5,Nt,u.Fj,u.JJ,u.On,q,r.sg],styles:['.dropup[_ngcontent-%COMP%], .dropright[_ngcontent-%COMP%], .dropdown[_ngcontent-%COMP%], .dropleft[_ngcontent-%COMP%]{position:relative}.dropdown-toggle[_ngcontent-%COMP%]{white-space:nowrap}.dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle[_ngcontent-%COMP%]:empty:after{margin-left:0}.dropdown-menu[_ngcontent-%COMP%]{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left[_ngcontent-%COMP%]{right:auto;left:0}.dropdown-menu-right[_ngcontent-%COMP%]{right:0;left:auto}@media (min-width: 576px){.dropdown-menu-sm-left[_ngcontent-%COMP%]{right:auto;left:0}.dropdown-menu-sm-right[_ngcontent-%COMP%]{right:0;left:auto}}@media (min-width: 768px){.dropdown-menu-md-left[_ngcontent-%COMP%]{right:auto;left:0}.dropdown-menu-md-right[_ngcontent-%COMP%]{right:0;left:auto}}@media (min-width: 992px){.dropdown-menu-lg-left[_ngcontent-%COMP%]{right:auto;left:0}.dropdown-menu-lg-right[_ngcontent-%COMP%]{right:0;left:auto}}@media (min-width: 1200px){.dropdown-menu-xl-left[_ngcontent-%COMP%]{right:auto;left:0}.dropdown-menu-xl-right[_ngcontent-%COMP%]{right:0;left:auto}}.dropup[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:empty:after{margin-left:0}.dropright[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:empty:after{margin-left:0}.dropright[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{vertical-align:0}.dropleft[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropleft[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:none}.dropleft[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:empty:after{margin-left:0}.dropleft[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:before{vertical-align:0}.dropdown-menu[x-placement^=top][_ngcontent-%COMP%], .dropdown-menu[x-placement^=right][_ngcontent-%COMP%], .dropdown-menu[x-placement^=bottom][_ngcontent-%COMP%], .dropdown-menu[x-placement^=left][_ngcontent-%COMP%]{right:auto;bottom:auto}.dropdown-divider[_ngcontent-%COMP%]{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item[_ngcontent-%COMP%]{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item[_ngcontent-%COMP%]:hover, .dropdown-item[_ngcontent-%COMP%]:focus{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active[_ngcontent-%COMP%], .dropdown-item[_ngcontent-%COMP%]:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled[_ngcontent-%COMP%], .dropdown-item[_ngcontent-%COMP%]:disabled{color:#6c757d;pointer-events:none;background-color:transparent}.dropdown-menu.show[_ngcontent-%COMP%]{display:block}.dropdown-header[_ngcontent-%COMP%]{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text[_ngcontent-%COMP%]{display:block;padding:.25rem 1.5rem;color:#212529}',"li.iti__country[_ngcontent-%COMP%]:hover{background-color:#0000000d}.iti__selected-flag.dropdown-toggle[_ngcontent-%COMP%]:after{content:none}.iti__flag-container.disabled[_ngcontent-%COMP%]{cursor:default!important}.iti.iti--allow-dropdown[_ngcontent-%COMP%] .flag-container.disabled[_ngcontent-%COMP%]:hover .iti__selected-flag[_ngcontent-%COMP%]{background:none}.country-dropdown[_ngcontent-%COMP%]{border:1px solid #ccc;width:-moz-fit-content;width:fit-content;padding:1px;border-collapse:collapse}.search-container[_ngcontent-%COMP%]{position:relative}.search-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%;border:none;border-bottom:1px solid #ccc;padding-left:10px}.search-icon[_ngcontent-%COMP%]{position:absolute;z-index:2;width:25px;margin:1px 10px}.iti__country-list[_ngcontent-%COMP%]{position:relative;border:none}.iti[_ngcontent-%COMP%] input#country-search-box[_ngcontent-%COMP%]{padding-left:6px}.iti[_ngcontent-%COMP%] .selected-dial-code[_ngcontent-%COMP%]{margin-left:6px}.iti.separate-dial-code[_ngcontent-%COMP%] .iti__selected-flag[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-2[_ngcontent-%COMP%] .iti__selected-flag[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-3[_ngcontent-%COMP%] .iti__selected-flag[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-4[_ngcontent-%COMP%] .iti__selected-flag[_ngcontent-%COMP%]{width:93px}.iti.separate-dial-code[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-2[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-3[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-4[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:98px}"]}),i})();const vt=St.forRoot();let Ut=(()=>{class i{}return i.\u0275fac=function(l){return new(l||i)},i.\u0275mod=s.oAB({type:i}),i.\u0275inj=s.cJS({imports:[[r.ez,u.u5,u.UX,vt]]}),i})();var ue=n(6188);function It(i,p){1&i&&(s.TgZ(0,"p",11),s._uU(1),s.ALo(2,"translate"),s.qZA()),2&i&&(s.xp6(1),s.hij(" ",s.lcZ(2,1,"Email is invalid")," "))}function Ft(i,p){if(1&i&&(s.TgZ(0,"div",11),s._uU(1),s.qZA()),2&i){const l=s.oxw();s.xp6(1),s.Oqu(l.firebaseErrorMessage)}}function wt(i,p){1&i&&(s.TgZ(0,"div",12)(1,"span",13),s._uU(2),s.ALo(3,"translate"),s.qZA()()),2&i&&(s.xp6(2),s.Oqu(s.lcZ(3,1,"A link has been sent to your email address!")))}let xt=(()=>{class i{constructor(l,h,_){this.authService=l,this.angularFireAuth=h,this.formBuilder=_,this.mailSent=!1,this.forgotPasswordForm=this.formBuilder.group({email:["",[u.kI.required,u.kI.email]]})}ngOnInit(){this.angularFireAuth.authState.subscribe(l=>{l&&this.forgotPasswordForm.patchValue({email:l.email})})}retrievePassword(){var l=this;return(0,m.Z)(function*(){try{yield l.authService.resetPassword(l.forgotPasswordForm.value.email),l.mailSent=!0}catch(h){(0,N.kY)(h)&&(l.firebaseErrorMessage=h.message)}})()}}return i.\u0275fac=function(l){return new(l||i)(s.Y36(P.e),s.Y36(L.zQ),s.Y36(u.QS))},i.\u0275cmp=s.Xpm({type:i,selectors:[["app-forgot-password"]],decls:26,vars:23,consts:[["id","container"],[1,"form","facebook-style",3,"formGroup","ngSubmit"],[2,"opacity","0.7"],[2,"margin","35px 0"],["type","email","formControlName","email",1,"form-control",3,"placeholder"],["class","warning-message",4,"ngIf"],[2,"margin-top","15px"],[1,"btn","btn-info",3,"disabled"],["style","margin-top: 15px; text-align: center;",4,"ngIf"],[2,"text-align","center"],["routerLink","/auth/login"],[1,"warning-message"],[2,"margin-top","15px","text-align","center"],[1,"text-success"]],template:function(l,h){1&l&&(s.TgZ(0,"div",0)(1,"form",1),s.NdJ("ngSubmit",function(){return h.retrievePassword()}),s.TgZ(2,"h1"),s._uU(3),s.ALo(4,"translate"),s.qZA(),s.TgZ(5,"p",2),s._uU(6),s.ALo(7,"translate"),s.qZA(),s._UZ(8,"hr",3),s.TgZ(9,"div"),s._UZ(10,"input",4),s.ALo(11,"translate"),s.YNc(12,It,3,3,"p",5),s.qZA(),s.YNc(13,Ft,2,1,"div",5),s.TgZ(14,"div",6)(15,"button",7),s._uU(16),s.ALo(17,"translate"),s.qZA()(),s.YNc(18,wt,4,3,"div",8),s._UZ(19,"hr",3),s.TgZ(20,"div",9),s._uU(21),s.ALo(22,"translate"),s.TgZ(23,"a",10),s._uU(24),s.ALo(25,"translate"),s.qZA()()()()),2&l&&(s.xp6(1),s.Q6J("formGroup",h.forgotPasswordForm),s.xp6(2),s.Oqu(s.lcZ(4,11,"Find your account")),s.xp6(3),s.Oqu(s.lcZ(7,13,"Enter your e-mail address so we can send you a reset password link.")),s.xp6(4),s.s9C("placeholder",s.lcZ(11,15,"Email")),s.xp6(2),s.Q6J("ngIf",h.forgotPasswordForm.controls.email.touched&&h.forgotPasswordForm.controls.email.invalid),s.xp6(1),s.Q6J("ngIf",h.firebaseErrorMessage),s.xp6(2),s.Q6J("disabled",h.mailSent||h.forgotPasswordForm.invalid),s.xp6(1),s.hij(" ",s.lcZ(17,17,"Reset my password")," "),s.xp6(2),s.Q6J("ngIf",h.mailSent),s.xp6(3),s.hij("",s.lcZ(22,19,"Go back to login?")," "),s.xp6(3),s.Oqu(s.lcZ(25,21,"Log In")))},dependencies:[r.O5,O.yS,u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,q,ue.X$],styles:["#container[_ngcontent-%COMP%]{min-height:100vh}.form[_ngcontent-%COMP%]{min-width:300px;max-width:550px;padding:15px;margin:15px auto}.warning-message[_ngcontent-%COMP%]{color:#fd335b;font-size:small;padding:0 5px;margin:11px 0;border-radius:3px}.btn[_ngcontent-%COMP%]{width:100%;margin-top:15px}.text-success[_ngcontent-%COMP%]{font-size:large}"]}),i})();function Vt(i,p){1&i&&(s.TgZ(0,"p",18),s._uU(1),s.ALo(2,"translate"),s.qZA()),2&i&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"Email is invalid")))}function Bt(i,p){1&i&&(s.TgZ(0,"p",18),s._uU(1),s.ALo(2,"translate"),s.qZA()),2&i&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"Password must contain at least 6 characters")))}function Gt(i,p){if(1&i&&(s.TgZ(0,"div",19)(1,"span"),s._uU(2),s.qZA()()),2&i){const l=s.oxw();s.xp6(2),s.Oqu(l.errorMessage)}}const ve=function(i){return{warning:i}};let Ht=(()=>{class i{constructor(l,h,_){this.router=l,this.formBuilder=h,this.authService=_,this.showPhoneTemplate=!1,this.loginForm=this.formBuilder.group({email:["",[u.kI.required,u.kI.email]],password:["",[u.kI.required,u.kI.pattern(/[0-9a-zA-Z]{6,}/)]]})}ngOnInit(){this.authService.getUser().subscribe(l=>{l&&this.router.navigate(["home"])})}onSubmitForm(){var l=this;return(0,m.Z)(function*(){const h=l.loginForm.controls.email.value,_=l.loginForm.controls.password.value;try{yield l.authService.logIn(h,_),l.router.navigate(["home"])}catch(y){(0,N.kY)(y)&&(l.errorMessage=y.message)}})()}loginWithGoogle(){var l=this;return(0,m.Z)(function*(){try{yield l.authService.signinWithGoogle()}catch(h){l.errorMessage=h}})()}}return i.\u0275fac=function(l){return new(l||i)(s.Y36(O.F0),s.Y36(u.QS),s.Y36(P.e))},i.\u0275cmp=s.Xpm({type:i,selectors:[["app-login"]],decls:33,vars:29,consts:[[1,"form-container","facebook-style"],[2,"margin","15px","text-align","center","cursor","pointer","color","chocolate","border","1px solid chocolate","padding","11px",3,"click"],["routerLink","/auth/phone-auth",2,"margin","0 15px 15px 15px","text-align","center","cursor","pointer","color","teal","border","1px solid teal","padding","5px"],["autocomplete","off",1,"signup-form",3,"formGroup","ngSubmit"],[1,"form-section","email"],["for","email"],["type","email","formControlName","email",1,"form-control",3,"ngClass"],["class","warning-message",4,"ngIf"],[1,"form-section","password"],["for","password"],["type","password","formControlName","password",1,"form-control",3,"ngClass"],["class","error-message",4,"ngIf"],["type","submit",1,"btn","btn-success",3,"disabled"],[2,"text-align","center"],["routerLink","/auth/forgot-password",1,"link"],[1,"hr"],[2,"margin-top","25px","text-align","center"],["routerLink","/auth/signup",1,"link"],[1,"warning-message"],[1,"error-message"]],template:function(l,h){1&l&&(s.TgZ(0,"div",0)(1,"div",1),s.NdJ("click",function(){return h.loginWithGoogle()}),s._uU(2," Continue with Google "),s.qZA(),s.TgZ(3,"div",2),s._uU(4," continue with Phone Number "),s.qZA(),s.TgZ(5,"form",3),s.NdJ("ngSubmit",function(){return h.onSubmitForm()}),s.TgZ(6,"div",4)(7,"label",5),s._uU(8),s.ALo(9,"translate"),s.qZA(),s._UZ(10,"input",6),s.YNc(11,Vt,3,3,"p",7),s.qZA(),s.TgZ(12,"div",8)(13,"label",9),s._uU(14),s.ALo(15,"translate"),s.qZA(),s._UZ(16,"input",10),s.YNc(17,Bt,3,3,"p",7),s.qZA(),s.YNc(18,Gt,3,1,"div",11),s.TgZ(19,"button",12),s._uU(20),s.ALo(21,"translate"),s.qZA(),s.TgZ(22,"div",13)(23,"a",14),s._uU(24),s.ALo(25,"translate"),s.qZA()(),s._UZ(26,"hr",15),s.TgZ(27,"div",16),s._uU(28),s.ALo(29,"translate"),s.TgZ(30,"a",17),s._uU(31),s.ALo(32,"translate"),s.qZA()()()()),2&l&&(s.xp6(5),s.Q6J("formGroup",h.loginForm),s.xp6(3),s.Oqu(s.lcZ(9,13,"Email")),s.xp6(2),s.Q6J("ngClass",s.VKq(25,ve,h.loginForm.controls.email.invalid&&h.loginForm.controls.email.touched)),s.xp6(1),s.Q6J("ngIf",h.loginForm.controls.email.invalid&&h.loginForm.controls.email.touched),s.xp6(3),s.Oqu(s.lcZ(15,15,"Password")),s.xp6(2),s.Q6J("ngClass",s.VKq(27,ve,h.loginForm.controls.password.invalid&&h.loginForm.controls.password.touched)),s.xp6(1),s.Q6J("ngIf",h.loginForm.controls.password.invalid&&h.loginForm.controls.password.touched),s.xp6(1),s.Q6J("ngIf",h.errorMessage),s.xp6(1),s.Q6J("disabled",h.loginForm.invalid),s.xp6(1),s.Oqu(s.lcZ(21,17,"Log In")),s.xp6(4),s.hij("",s.lcZ(25,19,"Forgot Password"),"?"),s.xp6(4),s.hij(" ",s.lcZ(29,21,"You don not have an account")," "),s.xp6(3),s.Oqu(s.lcZ(32,23,"Sign Up")))},dependencies:[r.mk,r.O5,O.rH,O.yS,u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,q,ue.X$],styles:[".form-container[_ngcontent-%COMP%]{width:50%;margin:25px auto;padding:25px 15px}.form-section[_ngcontent-%COMP%]{margin-bottom:5px}.btn[_ngcontent-%COMP%]{width:100%;margin:15px 0}.link[_ngcontent-%COMP%]{text-decoration:none}.link[_ngcontent-%COMP%]:hover{text-decoration:underline}.warning-message[_ngcontent-%COMP%]{color:#fd335b;font-size:smaller;padding:0 5px;border-radius:3px}.warning[_ngcontent-%COMP%]{border:1px solid rgb(253,51,91)}.error-message[_ngcontent-%COMP%]{background-color:#ffd1da;color:#ff093a;font-size:small;padding:7px;border-radius:3px}@media only screen and (max-width: 800px){.form-container[_ngcontent-%COMP%]{width:90%}}@media only screen and (max-width: 500px){.form-container[_ngcontent-%COMP%]{width:95%}}"]}),i})();function jt(i,p){1&i&&(s.TgZ(0,"p",25),s._uU(1),s.ALo(2,"translate"),s.qZA()),2&i&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"First Name is invalid")))}function kt(i,p){1&i&&(s.TgZ(0,"p",25),s._uU(1),s.ALo(2,"translate"),s.qZA()),2&i&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"Last Name is invalid")))}function Yt(i,p){1&i&&(s.TgZ(0,"p",25),s._uU(1),s.ALo(2,"translate"),s.qZA()),2&i&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"Email is invalid")))}function Zt(i,p){1&i&&(s.TgZ(0,"p",25),s._uU(1),s.ALo(2,"translate"),s.qZA()),2&i&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"Phone Number must contain 10 digit numbers")))}function zt(i,p){1&i&&(s.TgZ(0,"p",25),s._uU(1),s.ALo(2,"translate"),s.qZA()),2&i&&(s.xp6(1),s.Oqu(s.lcZ(2,1,"Password must contain at least 6 characters")))}function Wt(i,p){if(1&i&&(s.TgZ(0,"div",26)(1,"span"),s._uU(2),s.qZA()()),2&i){const l=s.oxw();s.xp6(2),s.Oqu(l.errorMessage)}}const J=function(i){return{warning:i}};let Kt=(()=>{class i{constructor(l,h,_){this.formBuilder=l,this.authService=h,this.router=_,this.isFormSubmitted=!1,this.signupForm=this.formBuilder.group({firstName:["",[u.kI.required,u.kI.pattern(/.*\S.*/)]],lastName:["",[u.kI.required,u.kI.pattern(/.*\S.*/)]],email:["",[u.kI.required,u.kI.email]],phoneNumber:["",[u.kI.required,u.kI.pattern(/^(\+213|0)?[0-9]{9}$/)]],password:["",[u.kI.required,u.kI.pattern(/[0-9a-zA-Z]{6,}/)]]})}ngOnInit(){this.authService.getUser().subscribe(l=>{l&&this.router.navigate(["home"])})}onSubmitForm(){var l=this;return(0,m.Z)(function*(){if(l.signupForm.invalid)return;let h=l.signupForm.controls.password.value,_=l.signupForm.value;delete _.password;try{yield l.authService.createNewUser(_,h),l.router.navigate(["/home"])}catch(y){l.errorMessage=(0,N.kY)(y)?y.message:y}})()}}return i.\u0275fac=function(l){return new(l||i)(s.Y36(u.QS),s.Y36(P.e),s.Y36(O.F0))},i.\u0275cmp=s.Xpm({type:i,selectors:[["app-signup"]],decls:49,vars:50,consts:[[1,"form-container","facebook-style"],["autocomplete","off",1,"signup-form",3,"formGroup","ngSubmit"],[1,"form-title"],[2,"margin-top","-20px","font-size","15px","opacity","0.8"],[1,"hr"],[1,"form-section","first-name"],["for","firstName"],["type","text","formControlName","firstName",1,"form-control",3,"ngClass"],["class","warning-message",4,"ngIf"],[1,"form-section","last-name"],["for","lastName"],["type","text","formControlName","lastName",1,"form-control",3,"ngClass"],[1,"form-section","email"],["for","email"],["type","email","formControlName","email",1,"form-control",3,"ngClass"],[1,"form-section","phone-number"],["for","phoneNumber"],["type","tel","formControlName","phoneNumber",1,"form-control",3,"ngClass"],[1,"form-section","password"],["for","password"],["type","password","formControlName","password",1,"form-control",3,"ngClass"],["class","error-message",4,"ngIf"],["type","submit",1,"btn","btn-success",3,"disabled"],[1,"link",2,"margin-top","25px","text-align","center"],["routerLink","/auth/login"],[1,"warning-message"],[1,"error-message"]],template:function(l,h){1&l&&(s.TgZ(0,"div",0)(1,"form",1),s.NdJ("ngSubmit",function(){return h.onSubmitForm()}),s.TgZ(2,"h2",2),s._uU(3),s.ALo(4,"translate"),s.qZA(),s.TgZ(5,"div",3),s._uU(6),s.ALo(7,"translate"),s.qZA(),s._UZ(8,"hr",4),s.TgZ(9,"div",5)(10,"label",6),s._uU(11),s.ALo(12,"translate"),s.qZA(),s._UZ(13,"input",7),s.YNc(14,jt,3,3,"p",8),s.qZA(),s.TgZ(15,"div",9)(16,"label",10),s._uU(17),s.ALo(18,"translate"),s.qZA(),s._UZ(19,"input",11),s.YNc(20,kt,3,3,"p",8),s.qZA(),s.TgZ(21,"div",12)(22,"label",13),s._uU(23),s.ALo(24,"translate"),s.qZA(),s._UZ(25,"input",14),s.YNc(26,Yt,3,3,"p",8),s.qZA(),s.TgZ(27,"div",15)(28,"label",16),s._uU(29),s.ALo(30,"translate"),s.qZA(),s._UZ(31,"input",17),s.YNc(32,Zt,3,3,"p",8),s.qZA(),s.TgZ(33,"div",18)(34,"label",19),s._uU(35),s.ALo(36,"translate"),s.qZA(),s._UZ(37,"input",20),s.YNc(38,zt,3,3,"p",8),s.qZA(),s.YNc(39,Wt,3,1,"div",21),s.TgZ(40,"button",22),s._uU(41,"Submit"),s.qZA(),s._UZ(42,"hr",4),s.TgZ(43,"div",23),s._uU(44),s.ALo(45,"translate"),s.TgZ(46,"a",24),s._uU(47),s.ALo(48,"translate"),s.qZA()()()()),2&l&&(s.xp6(1),s.Q6J("formGroup",h.signupForm),s.xp6(2),s.Oqu(s.lcZ(4,22,"Sign Up")),s.xp6(3),s.Oqu(s.lcZ(7,24,"It is quick and easy")),s.xp6(5),s.Oqu(s.lcZ(12,26,"First Name")),s.xp6(2),s.Q6J("ngClass",s.VKq(40,J,h.signupForm.controls.firstName.invalid&&h.signupForm.controls.firstName.touched)),s.xp6(1),s.Q6J("ngIf",h.signupForm.controls.firstName.invalid&&h.signupForm.controls.firstName.touched),s.xp6(3),s.Oqu(s.lcZ(18,28,"Last Name")),s.xp6(2),s.Q6J("ngClass",s.VKq(42,J,h.signupForm.controls.lastName.invalid&&h.signupForm.controls.lastName.touched)),s.xp6(1),s.Q6J("ngIf",h.signupForm.controls.lastName.invalid&&h.signupForm.controls.lastName.touched),s.xp6(3),s.Oqu(s.lcZ(24,30,"Email")),s.xp6(2),s.Q6J("ngClass",s.VKq(44,J,h.signupForm.controls.email.invalid&&h.signupForm.controls.email.touched)),s.xp6(1),s.Q6J("ngIf",h.signupForm.controls.email.invalid&&h.signupForm.controls.email.touched),s.xp6(3),s.Oqu(s.lcZ(30,32,"Phone Number")),s.xp6(2),s.Q6J("ngClass",s.VKq(46,J,h.signupForm.controls.phoneNumber.invalid&&h.signupForm.controls.phoneNumber.touched)),s.xp6(1),s.Q6J("ngIf",h.signupForm.controls.phoneNumber.invalid&&h.signupForm.controls.phoneNumber.touched),s.xp6(3),s.Oqu(s.lcZ(36,34,"Password")),s.xp6(2),s.Q6J("ngClass",s.VKq(48,J,h.signupForm.controls.password.invalid&&h.signupForm.controls.password.touched)),s.xp6(1),s.Q6J("ngIf",h.signupForm.controls.password.invalid&&h.signupForm.controls.password.touched),s.xp6(1),s.Q6J("ngIf",h.errorMessage),s.xp6(1),s.Q6J("disabled",h.signupForm.invalid),s.xp6(4),s.hij(" ",s.lcZ(45,36,"Already have an account"),"? "),s.xp6(3),s.Oqu(s.lcZ(48,38,"Sign in")))},dependencies:[r.mk,r.O5,O.yS,u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,q,ue.X$],styles:[".form-container[_ngcontent-%COMP%]{width:50%;margin:25px auto;padding:25px 15px}.signup-form[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto;grid-gap:11px}.form-section[_ngcontent-%COMP%]{margin-bottom:5px}.btn[_ngcontent-%COMP%], .error-message[_ngcontent-%COMP%], .link[_ngcontent-%COMP%], .form-title[_ngcontent-%COMP%], .password[_ngcontent-%COMP%], .hr[_ngcontent-%COMP%]{grid-column-start:1;grid-column-end:3}.btn[_ngcontent-%COMP%]{margin-top:25px}.warning-message[_ngcontent-%COMP%]{color:#fd335b;font-size:smaller;padding:0 5px;border-radius:3px}.warning[_ngcontent-%COMP%]{border:1px solid rgb(253,51,91)}.error-message[_ngcontent-%COMP%]{background-color:#ffd1da;color:#ff093a;font-size:small;padding:7px;border-radius:3px}@media only screen and (max-width: 800px){.form-container[_ngcontent-%COMP%]{width:90%}}@media only screen and (max-width: 500px){.form-container[_ngcontent-%COMP%]{width:98%}.form-section[_ngcontent-%COMP%]{grid-column-start:1;grid-column-end:3}}"]}),i})();var qt=n(127);function Jt(i,p){1&i&&(s.TgZ(0,"div",5)(1,"button",6),s._uU(2,"Go back to Login"),s.qZA()())}function Xt(i,p){1&i&&(s.TgZ(0,"span"),s._uU(1," Phone number is required. "),s.qZA())}function Qt(i,p){1&i&&(s.TgZ(0,"span"),s._uU(1," Phone number must be 10 numbers "),s.qZA())}function eo(i,p){if(1&i&&(s.TgZ(0,"small",14),s.YNc(1,Xt,2,0,"span",3),s.YNc(2,Qt,2,0,"span",3),s.qZA()),2&i){const l=s.oxw(2);s.xp6(1),s.Q6J("ngIf",null==l.phoneForm.controls.phone.errors?null:l.phoneForm.controls.phone.errors.required),s.xp6(1),s.Q6J("ngIf",l.phoneForm.controls.phone.errors)}}const to=function(i,p){return[i,p]};function oo(i,p){if(1&i){const l=s.EpF();s.TgZ(0,"form",7,8)(2,"div",9),s._UZ(3,"ngx-intl-tel-input",10),s.TgZ(4,"div",11),s.YNc(5,eo,3,2,"small",4),s.qZA()(),s._UZ(6,"div",12),s.TgZ(7,"div")(8,"button",13),s.NdJ("click",function(){s.CHM(l);const _=s.oxw();return s.KtG(_.sendVerificationCode())}),s._uU(9," Send Verification Code "),s.qZA()()()}if(2&i){const l=s.oxw();s.Q6J("formGroup",l.phoneForm),s.xp6(3),s.Q6J("cssClass","form-control")("enableAutoCountrySelect",!0)("enablePlaceholder",!0)("customPlaceholder","Enter Your Number")("searchCountryFlag",!0)("searchCountryField",s.WLB(15,to,l.searchCountryField.Iso2,l.searchCountryField.Name))("selectFirstCountry",!1)("selectedCountryISO",l.countryISO.Algeria)("maxLength",10)("phoneValidation",!0)("separateDialCode",!0)("numberFormat",l.phoneNumberFormat.National),s.xp6(2),s.Q6J("ngIf",!l.phoneForm.controls.phone.valid&&l.phoneForm.controls.phone.touched),s.xp6(3),s.Q6J("disabled",l.sendingCode)}}function no(i,p){1&i&&(s.TgZ(0,"div",21),s._uU(1," Verification Code sent successfully "),s.qZA())}function ro(i,p){if(1&i){const l=s.EpF();s.TgZ(0,"div"),s.YNc(1,no,2,0,"div",15),s.TgZ(2,"label",16),s._uU(3,"Enter your verification code here"),s.qZA(),s.TgZ(4,"input",17),s.NdJ("ngModelChange",function(_){s.CHM(l);const y=s.oxw();return s.KtG(y.verificationCode=_)}),s.qZA(),s.TgZ(5,"div",18)(6,"button",19),s.NdJ("click",function(){s.CHM(l);const _=s.oxw();return s.KtG(_.vefifyLoginCode())}),s._uU(7,"Vefify Code"),s.qZA(),s.TgZ(8,"button",20),s.NdJ("click",function(){s.CHM(l);const _=s.oxw();return _.codeSent=!1,s.KtG(_.phoneForm.reset())}),s._uU(9,"Reset"),s.qZA()()()}if(2&i){const l=s.oxw();s.xp6(1),s.Q6J("ngIf",l.codeSent),s.xp6(3),s.Q6J("ngModel",l.verificationCode)}}function io(i,p){if(1&i&&(s.TgZ(0,"div",14),s._uU(1),s.qZA()),2&i){const l=s.oxw();s.xp6(1),s.Oqu(l.errMsg)}}const so=[{path:"signup",component:Kt},{path:"login",component:Ht},{path:"phone-auth",component:(()=>{class i{constructor(l,h,_,y){this.router=l,this.afAuth=h,this.formBuilder=_,this.authService=y,this.searchCountryField=w,this.countryISO=$,this.phoneNumberFormat=K,this.sendingCode=!1,this.codeSent=!1,this.phoneForm=this.formBuilder.group({phone:[void 0,[u.kI.required]]})}ngOnInit(){}sendVerificationCode(){var l=this;return(0,m.Z)(function*(){const h=l.phoneForm.controls.phone.value;if(h){try{l.sendingCode=!0,l.reCaptchaVerifier=new qt.Z.auth.RecaptchaVerifier("reCaptcha-container",{size:"invisible"});const _=yield l.afAuth.signInWithPhoneNumber(h.e164Number,l.reCaptchaVerifier);localStorage.setItem("verificationId",JSON.stringify(_.verificationId)),l.codeSent=!0}catch(_){l.errMsg=_}l.sendingCode=!1}else l.errMsg="Input field is empty!"})()}vefifyLoginCode(){var l=this;return(0,m.Z)(function*(){try{yield l.authService.vefifyPhoneNumberAndSignin(l.verificationCode),l.router.navigate(["home"]),l.codeSent=!1}catch(h){l.errMsg=h}})()}}return i.\u0275fac=function(l){return new(l||i)(s.Y36(O.F0),s.Y36(L.zQ),s.Y36(u.QS),s.Y36(P.e))},i.\u0275cmp=s.Xpm({type:i,selectors:[["app-phone-auth"]],decls:5,vars:4,consts:[[1,"sec-container","facebook-style"],["style","margin-bottom: 15px;",4,"ngIf"],[3,"formGroup",4,"ngIf"],[4,"ngIf"],["class","alert alert-danger",4,"ngIf"],[2,"margin-bottom","15px"],["routerLink","/auth/login",1,"btn","btn-info"],[3,"formGroup"],["f","ngForm"],[1,"wrapper"],["name","phone","formControlName","phone",3,"cssClass","enableAutoCountrySelect","enablePlaceholder","customPlaceholder","searchCountryFlag","searchCountryField","selectFirstCountry","selectedCountryISO","maxLength","phoneValidation","separateDialCode","numberFormat"],[2,"margin-top","20px","margin-bottom","10px"],["id","reCaptcha-container"],[1,"btn","btn-success",3,"disabled","click"],[1,"alert","alert-danger"],["class","alert alert-success","style","margin-bottom: 15px;",4,"ngIf"],["for","code"],["type","text","name","code",1,"form-control",3,"ngModel","ngModelChange"],[2,"display","flex","justify-content","space-around","margin-top","15px"],[1,"btn","btn-success",3,"click"],[1,"btn","btn-primary",3,"click"],[1,"alert","alert-success",2,"margin-bottom","15px"]],template:function(l,h){1&l&&(s.TgZ(0,"section",0),s.YNc(1,Jt,3,0,"div",1),s.YNc(2,oo,10,18,"form",2),s.YNc(3,ro,10,2,"div",3),s.YNc(4,io,2,1,"div",4),s.qZA()),2&l&&(s.xp6(1),s.Q6J("ngIf",!h.codeSent),s.xp6(1),s.Q6J("ngIf",!h.codeSent),s.xp6(1),s.Q6J("ngIf",h.codeSent),s.xp6(1),s.Q6J("ngIf",h.errMsg))},dependencies:[r.O5,O.rH,u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,u.On,Dt,q],styles:[".sec-container[_ngcontent-%COMP%]{max-width:500px;min-width:300px;margin:25px auto;padding:25px 15px}@media only screen and (max-width: 530px){.sec-container[_ngcontent-%COMP%]{margin-inline:15px}}"]}),i})()},{path:"forgot-password",component:xt}];let ao=(()=>{class i{}return i.\u0275fac=function(l){return new(l||i)},i.\u0275mod=s.oAB({type:i}),i.\u0275inj=s.cJS({imports:[O.Bz.forChild(so),O.Bz]}),i})();var go=n(9552);let uo=(()=>{class i{}return i.\u0275fac=function(l){return new(l||i)},i.\u0275mod=s.oAB({type:i}),i.\u0275inj=s.cJS({imports:[r.ez,ao,u.UX,u.u5,go.m,Ut]}),i})()},5724:module=>{var t;t=function(){var define,module,exports;return function t(o,n,r){function u(s,P){if(!n[s]){if(!o[s]){if(m)return m(s,!0);var O=new Error("Cannot find module '"+s+"'");throw O.code="MODULE_NOT_FOUND",O}var R=n[s]={exports:{}};o[s][0].call(R.exports,function(U){return u(o[s][1][U]||U)},R,R.exports,t,o,n,r)}return n[s].exports}for(var m=void 0,N=0;N=u}},"es6","es3"),$jscomp.findInternal=function(t,o,n){t instanceof String&&(t=String(t));for(var r=t.length,u=0;u=m}},"es6","es3"),$jscomp.polyfill("String.prototype.repeat",function(t){return t||function(o){var n=$jscomp.checkStringArgs(this,null,"repeat");if(0>o||1342177279>>=1)&&(n+=n);return r}},"es6","es3"),$jscomp.initSymbol=function(){},$jscomp.polyfill("Symbol",function(t){if(t)return t;var o=function(u,m){this.$jscomp$symbol$id_=u,$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:m})};o.prototype.toString=function(){return this.$jscomp$symbol$id_};var n=0,r=function(u){if(this instanceof r)throw new TypeError("Symbol is not a constructor");return new o("jscomp_symbol_"+(u||"")+"_"+n++,u)};return r},"es6","es3"),$jscomp.polyfill("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var o="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n(n=n||0)&&(n=Math.max(n+u,0));n"u"||r.execScript("var "+t[0]);for(var u;t.length&&(u=t.shift());)if(t.length||void 0===o)r=r[u]&&r[u]!==Object.prototype[u]?r[u]:r[u]={};else if(!n&&goog.isObject(o)&&goog.isObject(r[u]))for(var m in o)o.hasOwnProperty(m)&&(r[u][m]=o[m]);else r[u]=o},goog.define=function(t,o){if(!COMPILED){var n=goog.global.CLOSURE_UNCOMPILED_DEFINES,r=goog.global.CLOSURE_DEFINES;n&&void 0===n.nodeType&&Object.prototype.hasOwnProperty.call(n,t)?o=n[t]:r&&void 0===r.nodeType&&Object.prototype.hasOwnProperty.call(r,t)&&(o=r[t])}return o},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(t){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");if(!COMPILED&&goog.isProvided_(t))throw Error('Namespace "'+t+'" already declared.');goog.constructNamespace_(t)},goog.constructNamespace_=function(t,o,n){if(!COMPILED){delete goog.implicitNamespaces_[t];for(var r=t;(r=r.substring(0,r.lastIndexOf(".")))&&!goog.getObjectByName(r);)goog.implicitNamespaces_[r]=!0}goog.exportPath_(t,o,n)},goog.getScriptNonce=function(t){return t&&t!=goog.global?goog.getScriptNonce_(t.document):(null===goog.cspNonce_&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)},goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.cspNonce_=null,goog.getScriptNonce_=function(t){return(t=t.querySelector&&t.querySelector("script[nonce]"))&&(t=t.nonce||t.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(t)?t:""},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(t){if("string"!=typeof t||!t||-1==t.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+t+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");if(goog.moduleLoaderState_.moduleName=t,!COMPILED){if(goog.isProvided_(t))throw Error('Namespace "'+t+'" already declared.');delete goog.implicitNamespaces_[t]}},goog.module.get=function(t){return goog.module.getInternal_(t)},goog.module.getInternal_=function(t){if(!COMPILED){if(t in goog.loadedModules_)return goog.loadedModules_[t].exports;if(!goog.implicitNamespaces_[t])return(t=goog.getObjectByName(t))??null}return null},goog.ModuleType={ES6:"es6",GOOG:"goog"},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var t=goog.global.$jscomp;return!!t&&"function"==typeof t.getCurrentModulePath&&!!t.getCurrentModulePath()},goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInGoogModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(t){if(!COMPILED){if(!goog.isInEs6ModuleLoader_())throw Error("goog.declareModuleId may only be called from within an ES6 module");if(goog.moduleLoaderState_&&goog.moduleLoaderState_.moduleName)throw Error("goog.declareModuleId may only be called once per module.");if(t in goog.loadedModules_)throw Error('Module with namespace "'+t+'" already exists.')}if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=t;else{var o=goog.global.$jscomp;if(!o||"function"!=typeof o.getCurrentModulePath)throw Error('Module with namespace "'+t+'" has been loaded incorrectly.');o=o.require(o.getCurrentModulePath()),goog.loadedModules_[t]={exports:o,type:goog.ModuleType.ES6,moduleId:t}}},goog.setTestOnly=function(t){if(goog.DISALLOW_TEST_ONLY_CODE)throw t=t||"",Error("Importing test-only code into non-debug environment"+(t?": "+t:"."))},goog.forwardDeclare=function(t){},COMPILED||(goog.isProvided_=function(t){return t in goog.loadedModules_||!goog.implicitNamespaces_[t]&&null!=goog.getObjectByName(t)},goog.implicitNamespaces_={"goog.module":!0}),goog.getObjectByName=function(t,o){t=t.split("."),o=o||goog.global;for(var n=0;n>>0),goog.uidCounter_=0,goog.cloneObject=function(t){var o=goog.typeOf(t);if("object"==o||"array"==o){if("function"==typeof t.clone)return t.clone();for(var n in o="array"==o?[]:{},t)o[n]=goog.cloneObject(t[n]);return o}return t},goog.bindNative_=function(t,o,n){return t.call.apply(t.bind,arguments)},goog.bindJs_=function(t,o,n){if(!t)throw Error();if(2").replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&")),o&&(t=t.replace(/\{\$([^}]+)}/g,function(r,u){return null!=o&&u in o?o[u]:r})),t},goog.getMsgWithFallback=function(t,o){return t},goog.exportSymbol=function(t,o,n){goog.exportPath_(t,o,!0,n)},goog.exportProperty=function(t,o,n){t[o]=n},goog.inherits=function(t,o){function n(){}n.prototype=o.prototype,t.superClass_=o.prototype,t.prototype=new n,t.prototype.constructor=t,t.base=function(r,u,m){for(var N=Array(arguments.length-2),s=2;s{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')}),a("es7",function(){return b("2 ** 2 == 4")}),a("es8",function(){return b("async () => 1, true")}),a("es9",function(){return b("({...rest} = {}), true")}),a("es_next",function(){return!1}),{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(t,o){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;if(!this.requiresTranspilation_){var n=this.createRequiresTranspilation_();this.requiresTranspilation_=n.map,this.transpilationTarget_=this.transpilationTarget_||n.target}if(t in this.requiresTranspilation_)return!!this.requiresTranspilation_[t]||!(!goog.inHtmlDocument_()||"es6"!=o||"noModule"in goog.global.document.createElement("script"));throw Error("Unknown language mode: "+t)},goog.Transpiler.prototype.transpile=function(t,o){return goog.transpile_(t,o,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(t){return t.replace(/<\/(SCRIPT)/gi,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={},this.idToPath_={},this.written_={},this.loadingDeps_=[],this.depsToLoad_=[],this.paused_=!1,this.factory_=new goog.DependencyFactory(goog.transpiler_),this.deferredCallbacks_={},this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(t,o){function n(){r&&(goog.global.setTimeout(r,0),r=null)}var r=o;if(t.length){o=[];for(var u=0;u<\/script>';m+="",m=goog.Dependency.defer_?m+"document.getElementById('script-"+u+"').onload = function() {\n goog.Dependency.callback_('"+u+"', this);\n};\n":m+"goog.Dependency.callback_('"+u+"', document.getElementById('script-"+u+"'));",m+="<\/script>",o.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(m):m)}else{var N=o.createElement("script");N.defer=goog.Dependency.defer_,N.async=!1,n&&(N.nonce=n),goog.DebugLoader_.IS_OLD_IE_?(t.pause(),N.onreadystatechange=function(){("loaded"==N.readyState||"complete"==N.readyState)&&(t.loaded(),t.resume())}):N.onload=function(){N.onload=null,t.loaded()},N.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path,o.head.appendChild(N)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."),t.loaded()):t.pause()},goog.Es6ModuleDependency=function(t,o,n,r,u){goog.Dependency.call(this,t,o,n,r,u)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(t){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?t.loaded():t.pause();else if(goog.inHtmlDocument_()){var r=goog.global.document,u=this;if(goog.isDocumentLoading_()){var m=function o(L,O){var R="",U=goog.getScriptNonce();U&&(R=' nonce="'+U+'"'),L=O?' + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/new-rdv-app/browser/manifest.webmanifest b/dist/new-rdv-app/browser/manifest.webmanifest new file mode 100644 index 0000000..88e8299 --- /dev/null +++ b/dist/new-rdv-app/browser/manifest.webmanifest @@ -0,0 +1,59 @@ +{ + "name": "new-rdv-app", + "short_name": "new-rdv-app", + "theme_color": "#1976d2", + "background_color": "#fafafa", + "display": "standalone", + "scope": "./", + "start_url": "./", + "icons": [ + { + "src": "assets/icons/icon-72x72.png", + "sizes": "72x72", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "assets/icons/icon-96x96.png", + "sizes": "96x96", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "assets/icons/icon-128x128.png", + "sizes": "128x128", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "assets/icons/icon-144x144.png", + "sizes": "144x144", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "assets/icons/icon-152x152.png", + "sizes": "152x152", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "assets/icons/icon-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "assets/icons/icon-384x384.png", + "sizes": "384x384", + "type": "image/png", + "purpose": "maskable any" + }, + { + "src": "assets/icons/icon-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable any" + } + ] +} diff --git a/dist/new-rdv-app/browser/ngsw-worker.js b/dist/new-rdv-app/browser/ngsw-worker.js new file mode 100755 index 0000000..ca04540 --- /dev/null +++ b/dist/new-rdv-app/browser/ngsw-worker.js @@ -0,0 +1,1845 @@ +(() => { + var __defProp = Object.defineProperty; + var __defProps = Object.defineProperties; + var __getOwnPropDescs = Object.getOwnPropertyDescriptors; + var __getOwnPropSymbols = Object.getOwnPropertySymbols; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __propIsEnum = Object.prototype.propertyIsEnumerable; + var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; + var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; + }; + var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/named-cache-storage.mjs + var NamedCacheStorage = class { + constructor(original, cacheNamePrefix) { + this.original = original; + this.cacheNamePrefix = cacheNamePrefix; + } + delete(cacheName) { + return this.original.delete(`${this.cacheNamePrefix}:${cacheName}`); + } + has(cacheName) { + return this.original.has(`${this.cacheNamePrefix}:${cacheName}`); + } + async keys() { + const prefix = `${this.cacheNamePrefix}:`; + const allCacheNames = await this.original.keys(); + const ownCacheNames = allCacheNames.filter((name) => name.startsWith(prefix)); + return ownCacheNames.map((name) => name.slice(prefix.length)); + } + match(request, options) { + return this.original.match(request, options); + } + async open(cacheName) { + const cache = await this.original.open(`${this.cacheNamePrefix}:${cacheName}`); + return Object.assign(cache, { name: cacheName }); + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/adapter.mjs + var Adapter = class { + constructor(scopeUrl, caches) { + this.scopeUrl = scopeUrl; + const parsedScopeUrl = this.parseUrl(this.scopeUrl); + this.origin = parsedScopeUrl.origin; + this.caches = new NamedCacheStorage(caches, `ngsw:${parsedScopeUrl.path}`); + } + newRequest(input, init) { + return new Request(input, init); + } + newResponse(body, init) { + return new Response(body, init); + } + newHeaders(headers) { + return new Headers(headers); + } + isClient(source) { + return source instanceof Client; + } + get time() { + return Date.now(); + } + normalizeUrl(url) { + const parsed = this.parseUrl(url, this.scopeUrl); + return parsed.origin === this.origin ? parsed.path : url; + } + parseUrl(url, relativeTo) { + const parsed = !relativeTo ? new URL(url) : new URL(url, relativeTo); + return { origin: parsed.origin, path: parsed.pathname, search: parsed.search }; + } + timeout(ms) { + return new Promise((resolve) => { + setTimeout(() => resolve(), ms); + }); + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/database.mjs + var NotFound = class { + constructor(table, key) { + this.table = table; + this.key = key; + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/db-cache.mjs + var CacheDatabase = class { + constructor(adapter2) { + this.adapter = adapter2; + this.cacheNamePrefix = "db"; + this.tables = /* @__PURE__ */ new Map(); + } + "delete"(name) { + if (this.tables.has(name)) { + this.tables.delete(name); + } + return this.adapter.caches.delete(`${this.cacheNamePrefix}:${name}`); + } + async list() { + const prefix = `${this.cacheNamePrefix}:`; + const allCacheNames = await this.adapter.caches.keys(); + const dbCacheNames = allCacheNames.filter((name) => name.startsWith(prefix)); + return dbCacheNames.map((name) => name.slice(prefix.length)); + } + async open(name, cacheQueryOptions) { + if (!this.tables.has(name)) { + const cache = await this.adapter.caches.open(`${this.cacheNamePrefix}:${name}`); + const table = new CacheTable(name, cache, this.adapter, cacheQueryOptions); + this.tables.set(name, table); + } + return this.tables.get(name); + } + }; + var CacheTable = class { + constructor(name, cache, adapter2, cacheQueryOptions) { + this.name = name; + this.cache = cache; + this.adapter = adapter2; + this.cacheQueryOptions = cacheQueryOptions; + this.cacheName = this.cache.name; + } + request(key) { + return this.adapter.newRequest("/" + key); + } + "delete"(key) { + return this.cache.delete(this.request(key), this.cacheQueryOptions); + } + keys() { + return this.cache.keys().then((requests) => requests.map((req) => req.url.slice(1))); + } + read(key) { + return this.cache.match(this.request(key), this.cacheQueryOptions).then((res) => { + if (res === void 0) { + return Promise.reject(new NotFound(this.name, key)); + } + return res.json(); + }); + } + write(key, value) { + return this.cache.put(this.request(key), this.adapter.newResponse(JSON.stringify(value))); + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/api.mjs + var UpdateCacheStatus; + (function(UpdateCacheStatus2) { + UpdateCacheStatus2[UpdateCacheStatus2["NOT_CACHED"] = 0] = "NOT_CACHED"; + UpdateCacheStatus2[UpdateCacheStatus2["CACHED_BUT_UNUSED"] = 1] = "CACHED_BUT_UNUSED"; + UpdateCacheStatus2[UpdateCacheStatus2["CACHED"] = 2] = "CACHED"; + })(UpdateCacheStatus || (UpdateCacheStatus = {})); + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/error.mjs + var SwCriticalError = class extends Error { + constructor() { + super(...arguments); + this.isCritical = true; + } + }; + function errorToString(error) { + if (error instanceof Error) { + return `${error.message} +${error.stack}`; + } else { + return `${error}`; + } + } + var SwUnrecoverableStateError = class extends SwCriticalError { + constructor() { + super(...arguments); + this.isUnrecoverableState = true; + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/sha1.mjs + function sha1(str) { + const utf8 = str; + const words32 = stringToWords32(utf8, Endian.Big); + return _sha1(words32, utf8.length * 8); + } + function sha1Binary(buffer) { + const words32 = arrayBufferToWords32(buffer, Endian.Big); + return _sha1(words32, buffer.byteLength * 8); + } + function _sha1(words32, len) { + const w = []; + let [a, b, c, d, e] = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + words32[len >> 5] |= 128 << 24 - len % 32; + words32[(len + 64 >> 9 << 4) + 15] = len; + for (let i = 0; i < words32.length; i += 16) { + const [h0, h1, h2, h3, h4] = [a, b, c, d, e]; + for (let j = 0; j < 80; j++) { + if (j < 16) { + w[j] = words32[i + j]; + } else { + w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1); + } + const [f, k] = fk(j, b, c, d); + const temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32); + [e, d, c, b, a] = [d, c, rol32(b, 30), a, temp]; + } + [a, b, c, d, e] = [add32(a, h0), add32(b, h1), add32(c, h2), add32(d, h3), add32(e, h4)]; + } + return byteStringToHexString(words32ToByteString([a, b, c, d, e])); + } + function add32(a, b) { + return add32to64(a, b)[1]; + } + function add32to64(a, b) { + const low = (a & 65535) + (b & 65535); + const high = (a >>> 16) + (b >>> 16) + (low >>> 16); + return [high >>> 16, high << 16 | low & 65535]; + } + function rol32(a, count) { + return a << count | a >>> 32 - count; + } + var Endian; + (function(Endian2) { + Endian2[Endian2["Little"] = 0] = "Little"; + Endian2[Endian2["Big"] = 1] = "Big"; + })(Endian || (Endian = {})); + function fk(index, b, c, d) { + if (index < 20) { + return [b & c | ~b & d, 1518500249]; + } + if (index < 40) { + return [b ^ c ^ d, 1859775393]; + } + if (index < 60) { + return [b & c | b & d | c & d, 2400959708]; + } + return [b ^ c ^ d, 3395469782]; + } + function stringToWords32(str, endian) { + const size = str.length + 3 >>> 2; + const words32 = []; + for (let i = 0; i < size; i++) { + words32[i] = wordAt(str, i * 4, endian); + } + return words32; + } + function arrayBufferToWords32(buffer, endian) { + const size = buffer.byteLength + 3 >>> 2; + const words32 = []; + const view = new Uint8Array(buffer); + for (let i = 0; i < size; i++) { + words32[i] = wordAt(view, i * 4, endian); + } + return words32; + } + function byteAt(str, index) { + if (typeof str === "string") { + return index >= str.length ? 0 : str.charCodeAt(index) & 255; + } else { + return index >= str.byteLength ? 0 : str[index] & 255; + } + } + function wordAt(str, index, endian) { + let word = 0; + if (endian === Endian.Big) { + for (let i = 0; i < 4; i++) { + word += byteAt(str, index + i) << 24 - 8 * i; + } + } else { + for (let i = 0; i < 4; i++) { + word += byteAt(str, index + i) << 8 * i; + } + } + return word; + } + function words32ToByteString(words32) { + return words32.reduce((str, word) => str + word32ToByteString(word), ""); + } + function word32ToByteString(word) { + let str = ""; + for (let i = 0; i < 4; i++) { + str += String.fromCharCode(word >>> 8 * (3 - i) & 255); + } + return str; + } + function byteStringToHexString(str) { + let hex = ""; + for (let i = 0; i < str.length; i++) { + const b = byteAt(str, i); + hex += (b >>> 4).toString(16) + (b & 15).toString(16); + } + return hex.toLowerCase(); + } + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/assets.mjs + var AssetGroup = class { + constructor(scope2, adapter2, idle, config, hashes, db, cacheNamePrefix) { + this.scope = scope2; + this.adapter = adapter2; + this.idle = idle; + this.config = config; + this.hashes = hashes; + this.db = db; + this.inFlightRequests = /* @__PURE__ */ new Map(); + this.urls = []; + this.patterns = []; + this.name = config.name; + this.urls = config.urls.map((url) => adapter2.normalizeUrl(url)); + this.patterns = config.patterns.map((pattern) => new RegExp(pattern)); + this.cache = adapter2.caches.open(`${cacheNamePrefix}:${config.name}:cache`); + this.metadata = this.db.open(`${cacheNamePrefix}:${config.name}:meta`, config.cacheQueryOptions); + } + async cacheStatus(url) { + const cache = await this.cache; + const meta = await this.metadata; + const req = this.adapter.newRequest(url); + const res = await cache.match(req, this.config.cacheQueryOptions); + if (res === void 0) { + return UpdateCacheStatus.NOT_CACHED; + } + try { + const data = await meta.read(req.url); + if (!data.used) { + return UpdateCacheStatus.CACHED_BUT_UNUSED; + } + } catch (_) { + } + return UpdateCacheStatus.CACHED; + } + async getCacheNames() { + const [cache, metadata] = await Promise.all([ + this.cache, + this.metadata + ]); + return [cache.name, metadata.cacheName]; + } + async handleFetch(req, _event) { + const url = this.adapter.normalizeUrl(req.url); + if (this.urls.indexOf(url) !== -1 || this.patterns.some((pattern) => pattern.test(url))) { + const cache = await this.cache; + const cachedResponse = await cache.match(req, this.config.cacheQueryOptions); + if (cachedResponse !== void 0) { + if (this.hashes.has(url)) { + return cachedResponse; + } else { + if (await this.needToRevalidate(req, cachedResponse)) { + this.idle.schedule(`revalidate(${cache.name}): ${req.url}`, async () => { + await this.fetchAndCacheOnce(req); + }); + } + return cachedResponse; + } + } + const res = await this.fetchAndCacheOnce(this.adapter.newRequest(req.url)); + return res.clone(); + } else { + return null; + } + } + async needToRevalidate(req, res) { + if (res.headers.has("Cache-Control")) { + const cacheControl = res.headers.get("Cache-Control"); + const cacheDirectives = cacheControl.split(",").map((v) => v.trim()).map((v) => v.split("=")); + cacheDirectives.forEach((v) => v[0] = v[0].toLowerCase()); + const maxAgeDirective = cacheDirectives.find((v) => v[0] === "max-age"); + const cacheAge = maxAgeDirective ? maxAgeDirective[1] : void 0; + if (!cacheAge) { + return true; + } + try { + const maxAge = 1e3 * parseInt(cacheAge); + let ts; + try { + const metaTable = await this.metadata; + ts = (await metaTable.read(req.url)).ts; + } catch (e) { + const date = res.headers.get("Date"); + if (date === null) { + return true; + } + ts = Date.parse(date); + } + const age = this.adapter.time - ts; + return age < 0 || age > maxAge; + } catch (e) { + return true; + } + } else if (res.headers.has("Expires")) { + const expiresStr = res.headers.get("Expires"); + try { + return this.adapter.time > Date.parse(expiresStr); + } catch (e) { + return true; + } + } else { + return true; + } + } + async fetchFromCacheOnly(url) { + const cache = await this.cache; + const metaTable = await this.metadata; + const request = this.adapter.newRequest(url); + const response = await cache.match(request, this.config.cacheQueryOptions); + if (response === void 0) { + return null; + } + let metadata = void 0; + try { + metadata = await metaTable.read(request.url); + } catch (e) { + } + return { response, metadata }; + } + async unhashedResources() { + const cache = await this.cache; + return (await cache.keys()).map((request) => this.adapter.normalizeUrl(request.url)).filter((url) => !this.hashes.has(url)); + } + async fetchAndCacheOnce(req, used = true) { + if (this.inFlightRequests.has(req.url)) { + return this.inFlightRequests.get(req.url); + } + const fetchOp = this.fetchFromNetwork(req); + this.inFlightRequests.set(req.url, fetchOp); + try { + const res = await fetchOp; + if (!res.ok) { + throw new Error(`Response not Ok (fetchAndCacheOnce): request for ${req.url} returned response ${res.status} ${res.statusText}`); + } + try { + const cache = await this.cache; + await cache.put(req, res.clone()); + if (!this.hashes.has(this.adapter.normalizeUrl(req.url))) { + const meta = { ts: this.adapter.time, used }; + const metaTable = await this.metadata; + await metaTable.write(req.url, meta); + } + return res; + } catch (err) { + throw new SwCriticalError(`Failed to update the caches for request to '${req.url}' (fetchAndCacheOnce): ${errorToString(err)}`); + } + } finally { + this.inFlightRequests.delete(req.url); + } + } + async fetchFromNetwork(req, redirectLimit = 3) { + const res = await this.cacheBustedFetchFromNetwork(req); + if (res["redirected"] && !!res.url) { + if (redirectLimit === 0) { + throw new SwCriticalError(`Response hit redirect limit (fetchFromNetwork): request redirected too many times, next is ${res.url}`); + } + return this.fetchFromNetwork(this.adapter.newRequest(res.url), redirectLimit - 1); + } + return res; + } + async cacheBustedFetchFromNetwork(req) { + const url = this.adapter.normalizeUrl(req.url); + if (this.hashes.has(url)) { + const canonicalHash = this.hashes.get(url); + let response = await this.safeFetch(req); + let makeCacheBustedRequest = response.ok; + if (makeCacheBustedRequest) { + const fetchedHash = sha1Binary(await response.clone().arrayBuffer()); + makeCacheBustedRequest = fetchedHash !== canonicalHash; + } + if (makeCacheBustedRequest) { + const cacheBustReq = this.adapter.newRequest(this.cacheBust(req.url)); + response = await this.safeFetch(cacheBustReq); + if (response.ok) { + const cacheBustedHash = sha1Binary(await response.clone().arrayBuffer()); + if (canonicalHash !== cacheBustedHash) { + throw new SwCriticalError(`Hash mismatch (cacheBustedFetchFromNetwork): ${req.url}: expected ${canonicalHash}, got ${cacheBustedHash} (after cache busting)`); + } + } + } + if (!response.ok && response.status === 404) { + throw new SwUnrecoverableStateError(`Failed to retrieve hashed resource from the server. (AssetGroup: ${this.config.name} | URL: ${url})`); + } + return response; + } else { + return this.safeFetch(req); + } + } + async maybeUpdate(updateFrom, req, cache) { + const url = this.adapter.normalizeUrl(req.url); + if (this.hashes.has(url)) { + const hash = this.hashes.get(url); + const res = await updateFrom.lookupResourceWithHash(url, hash); + if (res !== null) { + await cache.put(req, res); + return true; + } + } + return false; + } + cacheBust(url) { + return url + (url.indexOf("?") === -1 ? "?" : "&") + "ngsw-cache-bust=" + Math.random(); + } + async safeFetch(req) { + try { + return await this.scope.fetch(req); + } catch (e) { + return this.adapter.newResponse("", { + status: 504, + statusText: "Gateway Timeout" + }); + } + } + }; + var PrefetchAssetGroup = class extends AssetGroup { + async initializeFully(updateFrom) { + const cache = await this.cache; + await this.urls.reduce(async (previous, url) => { + await previous; + const req = this.adapter.newRequest(url); + const alreadyCached = await cache.match(req, this.config.cacheQueryOptions) !== void 0; + if (alreadyCached) { + return; + } + if (updateFrom !== void 0 && await this.maybeUpdate(updateFrom, req, cache)) { + return; + } + await this.fetchAndCacheOnce(req, false); + }, Promise.resolve()); + if (updateFrom !== void 0) { + const metaTable = await this.metadata; + await (await updateFrom.previouslyCachedResources()).filter((url) => this.urls.indexOf(url) !== -1 || this.patterns.some((pattern) => pattern.test(url))).reduce(async (previous, url) => { + await previous; + const req = this.adapter.newRequest(url); + const alreadyCached = await cache.match(req, this.config.cacheQueryOptions) !== void 0; + if (alreadyCached) { + return; + } + const res = await updateFrom.lookupResourceWithoutHash(url); + if (res === null || res.metadata === void 0) { + return; + } + await cache.put(req, res.response); + await metaTable.write(req.url, __spreadProps(__spreadValues({}, res.metadata), { used: false })); + }, Promise.resolve()); + } + } + }; + var LazyAssetGroup = class extends AssetGroup { + async initializeFully(updateFrom) { + if (updateFrom === void 0) { + return; + } + const cache = await this.cache; + await this.urls.reduce(async (previous, url) => { + await previous; + const req = this.adapter.newRequest(url); + const alreadyCached = await cache.match(req, this.config.cacheQueryOptions) !== void 0; + if (alreadyCached) { + return; + } + const updated = await this.maybeUpdate(updateFrom, req, cache); + if (this.config.updateMode === "prefetch" && !updated) { + const cacheStatus = await updateFrom.recentCacheStatus(url); + if (cacheStatus !== UpdateCacheStatus.CACHED) { + return; + } + await this.fetchAndCacheOnce(req, false); + } + }, Promise.resolve()); + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/data.mjs + var LruList = class { + constructor(state) { + if (state === void 0) { + state = { + head: null, + tail: null, + map: {}, + count: 0 + }; + } + this.state = state; + } + get size() { + return this.state.count; + } + pop() { + if (this.state.tail === null) { + return null; + } + const url = this.state.tail; + this.remove(url); + return url; + } + remove(url) { + const node = this.state.map[url]; + if (node === void 0) { + return false; + } + if (this.state.head === url) { + if (node.next === null) { + this.state.head = null; + this.state.tail = null; + this.state.map = {}; + this.state.count = 0; + return true; + } + const next = this.state.map[node.next]; + next.previous = null; + this.state.head = next.url; + node.next = null; + delete this.state.map[url]; + this.state.count--; + return true; + } + const previous = this.state.map[node.previous]; + previous.next = node.next; + if (node.next !== null) { + this.state.map[node.next].previous = node.previous; + } else { + this.state.tail = node.previous; + } + node.next = null; + node.previous = null; + delete this.state.map[url]; + this.state.count--; + return true; + } + accessed(url) { + if (this.state.head === url) { + return; + } + const node = this.state.map[url] || { url, next: null, previous: null }; + if (this.state.map[url] !== void 0) { + this.remove(url); + } + if (this.state.head !== null) { + this.state.map[this.state.head].previous = url; + } + node.next = this.state.head; + this.state.head = url; + if (this.state.tail === null) { + this.state.tail = url; + } + this.state.map[url] = node; + this.state.count++; + } + }; + var DataGroup = class { + constructor(scope2, adapter2, config, db, debugHandler, cacheNamePrefix) { + this.scope = scope2; + this.adapter = adapter2; + this.config = config; + this.db = db; + this.debugHandler = debugHandler; + this._lru = null; + this.patterns = config.patterns.map((pattern) => new RegExp(pattern)); + this.cache = adapter2.caches.open(`${cacheNamePrefix}:${config.name}:cache`); + this.lruTable = this.db.open(`${cacheNamePrefix}:${config.name}:lru`, config.cacheQueryOptions); + this.ageTable = this.db.open(`${cacheNamePrefix}:${config.name}:age`, config.cacheQueryOptions); + } + async lru() { + if (this._lru === null) { + const table = await this.lruTable; + try { + this._lru = new LruList(await table.read("lru")); + } catch (e) { + this._lru = new LruList(); + } + } + return this._lru; + } + async syncLru() { + if (this._lru === null) { + return; + } + const table = await this.lruTable; + try { + return table.write("lru", this._lru.state); + } catch (err) { + this.debugHandler.log(err, `DataGroup(${this.config.name}@${this.config.version}).syncLru()`); + } + } + async handleFetch(req, event) { + if (!this.patterns.some((pattern) => pattern.test(req.url))) { + return null; + } + const lru = await this.lru(); + switch (req.method) { + case "OPTIONS": + return null; + case "GET": + case "HEAD": + switch (this.config.strategy) { + case "freshness": + return this.handleFetchWithFreshness(req, event, lru); + case "performance": + return this.handleFetchWithPerformance(req, event, lru); + default: + throw new Error(`Unknown strategy: ${this.config.strategy}`); + } + default: + const wasCached = lru.remove(req.url); + if (wasCached) { + await this.clearCacheForUrl(req.url); + } + await this.syncLru(); + return this.safeFetch(req); + } + } + async handleFetchWithPerformance(req, event, lru) { + var _a; + const okToCacheOpaque = (_a = this.config.cacheOpaqueResponses) != null ? _a : false; + let res = null; + const fromCache = await this.loadFromCache(req, lru); + if (fromCache !== null) { + res = fromCache.res; + if (this.config.refreshAheadMs !== void 0 && fromCache.age >= this.config.refreshAheadMs) { + event.waitUntil(this.safeCacheResponse(req, this.safeFetch(req), lru, okToCacheOpaque)); + } + } + if (res !== null) { + return res; + } + const [timeoutFetch, networkFetch] = this.networkFetchWithTimeout(req); + res = await timeoutFetch; + if (res === void 0) { + res = this.adapter.newResponse(null, { status: 504, statusText: "Gateway Timeout" }); + event.waitUntil(this.safeCacheResponse(req, networkFetch, lru, okToCacheOpaque)); + } else { + await this.safeCacheResponse(req, res, lru, okToCacheOpaque); + } + return res; + } + async handleFetchWithFreshness(req, event, lru) { + var _a; + const okToCacheOpaque = (_a = this.config.cacheOpaqueResponses) != null ? _a : true; + const [timeoutFetch, networkFetch] = this.networkFetchWithTimeout(req); + let res; + try { + res = await timeoutFetch; + } catch (e) { + res = void 0; + } + if (res === void 0) { + event.waitUntil(this.safeCacheResponse(req, networkFetch, lru, okToCacheOpaque)); + const fromCache = await this.loadFromCache(req, lru); + res = fromCache !== null ? fromCache.res : null; + } else { + await this.safeCacheResponse(req, res, lru, okToCacheOpaque); + } + if (res !== null) { + return res; + } + return networkFetch; + } + networkFetchWithTimeout(req) { + if (this.config.timeoutMs !== void 0) { + const networkFetch = this.scope.fetch(req); + const safeNetworkFetch = (async () => { + try { + return await networkFetch; + } catch (e) { + return this.adapter.newResponse(null, { + status: 504, + statusText: "Gateway Timeout" + }); + } + })(); + const networkFetchUndefinedError = (async () => { + try { + return await networkFetch; + } catch (e) { + return void 0; + } + })(); + const timeout = this.adapter.timeout(this.config.timeoutMs); + return [Promise.race([networkFetchUndefinedError, timeout]), safeNetworkFetch]; + } else { + const networkFetch = this.safeFetch(req); + return [networkFetch, networkFetch]; + } + } + async safeCacheResponse(req, resOrPromise, lru, okToCacheOpaque) { + try { + const res = await resOrPromise; + try { + await this.cacheResponse(req, res, lru, okToCacheOpaque); + } catch (err) { + this.debugHandler.log(err, `DataGroup(${this.config.name}@${this.config.version}).safeCacheResponse(${req.url}, status: ${res.status})`); + } + } catch (e) { + } + } + async loadFromCache(req, lru) { + const cache = await this.cache; + let res = await cache.match(req, this.config.cacheQueryOptions); + if (res !== void 0) { + try { + const ageTable = await this.ageTable; + const age = this.adapter.time - (await ageTable.read(req.url)).age; + if (age <= this.config.maxAge) { + lru.accessed(req.url); + return { res, age }; + } + } catch (e) { + } + lru.remove(req.url); + await this.clearCacheForUrl(req.url); + await this.syncLru(); + } + return null; + } + async cacheResponse(req, res, lru, okToCacheOpaque = false) { + if (!(res.ok || okToCacheOpaque && res.type === "opaque")) { + return; + } + if (lru.size >= this.config.maxSize) { + const evictedUrl = lru.pop(); + if (evictedUrl !== null) { + await this.clearCacheForUrl(evictedUrl); + } + } + lru.accessed(req.url); + await (await this.cache).put(req, res.clone()); + const ageTable = await this.ageTable; + await ageTable.write(req.url, { age: this.adapter.time }); + await this.syncLru(); + } + async cleanup() { + await Promise.all([ + this.cache.then((cache) => this.adapter.caches.delete(cache.name)), + this.ageTable.then((table) => this.db.delete(table.name)), + this.lruTable.then((table) => this.db.delete(table.name)) + ]); + } + async getCacheNames() { + const [cache, ageTable, lruTable] = await Promise.all([ + this.cache, + this.ageTable, + this.lruTable + ]); + return [cache.name, ageTable.cacheName, lruTable.cacheName]; + } + async clearCacheForUrl(url) { + const [cache, ageTable] = await Promise.all([this.cache, this.ageTable]); + await Promise.all([ + cache.delete(this.adapter.newRequest(url, { method: "GET" }), this.config.cacheQueryOptions), + cache.delete(this.adapter.newRequest(url, { method: "HEAD" }), this.config.cacheQueryOptions), + ageTable.delete(url) + ]); + } + async safeFetch(req) { + try { + return this.scope.fetch(req); + } catch (e) { + return this.adapter.newResponse(null, { + status: 504, + statusText: "Gateway Timeout" + }); + } + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/app-version.mjs + var BACKWARDS_COMPATIBILITY_NAVIGATION_URLS = [ + { positive: true, regex: "^/.*$" }, + { positive: false, regex: "^/.*\\.[^/]*$" }, + { positive: false, regex: "^/.*__" } + ]; + var AppVersion = class { + constructor(scope2, adapter2, database, idle, debugHandler, manifest, manifestHash) { + this.scope = scope2; + this.adapter = adapter2; + this.database = database; + this.debugHandler = debugHandler; + this.manifest = manifest; + this.manifestHash = manifestHash; + this.hashTable = /* @__PURE__ */ new Map(); + this.indexUrl = this.adapter.normalizeUrl(this.manifest.index); + this._okay = true; + Object.keys(manifest.hashTable).forEach((url) => { + this.hashTable.set(adapter2.normalizeUrl(url), manifest.hashTable[url]); + }); + const assetCacheNamePrefix = `${manifestHash}:assets`; + this.assetGroups = (manifest.assetGroups || []).map((config) => { + switch (config.installMode) { + case "prefetch": + return new PrefetchAssetGroup(scope2, adapter2, idle, config, this.hashTable, database, assetCacheNamePrefix); + case "lazy": + return new LazyAssetGroup(scope2, adapter2, idle, config, this.hashTable, database, assetCacheNamePrefix); + } + }); + this.dataGroups = (manifest.dataGroups || []).map((config) => new DataGroup(scope2, adapter2, config, database, debugHandler, `${config.version}:data`)); + manifest.navigationUrls = manifest.navigationUrls || BACKWARDS_COMPATIBILITY_NAVIGATION_URLS; + const includeUrls = manifest.navigationUrls.filter((spec) => spec.positive); + const excludeUrls = manifest.navigationUrls.filter((spec) => !spec.positive); + this.navigationUrls = { + include: includeUrls.map((spec) => new RegExp(spec.regex)), + exclude: excludeUrls.map((spec) => new RegExp(spec.regex)) + }; + } + get okay() { + return this._okay; + } + async initializeFully(updateFrom) { + try { + await this.assetGroups.reduce(async (previous, group) => { + await previous; + return group.initializeFully(updateFrom); + }, Promise.resolve()); + } catch (err) { + this._okay = false; + throw err; + } + } + async handleFetch(req, event) { + const asset = await this.assetGroups.reduce(async (potentialResponse, group) => { + const resp = await potentialResponse; + if (resp !== null) { + return resp; + } + return group.handleFetch(req, event); + }, Promise.resolve(null)); + if (asset !== null) { + return asset; + } + const data = await this.dataGroups.reduce(async (potentialResponse, group) => { + const resp = await potentialResponse; + if (resp !== null) { + return resp; + } + return group.handleFetch(req, event); + }, Promise.resolve(null)); + if (data !== null) { + return data; + } + if (this.adapter.normalizeUrl(req.url) !== this.indexUrl && this.isNavigationRequest(req)) { + if (this.manifest.navigationRequestStrategy === "freshness") { + try { + return await this.scope.fetch(req); + } catch (e) { + } + } + return this.handleFetch(this.adapter.newRequest(this.indexUrl), event); + } + return null; + } + isNavigationRequest(req) { + if (req.mode !== "navigate") { + return false; + } + if (!this.acceptsTextHtml(req)) { + return false; + } + const urlPrefix = this.scope.registration.scope.replace(/\/$/, ""); + const url = req.url.startsWith(urlPrefix) ? req.url.slice(urlPrefix.length) : req.url; + const urlWithoutQueryOrHash = url.replace(/[?#].*$/, ""); + return this.navigationUrls.include.some((regex) => regex.test(urlWithoutQueryOrHash)) && !this.navigationUrls.exclude.some((regex) => regex.test(urlWithoutQueryOrHash)); + } + async lookupResourceWithHash(url, hash) { + if (!this.hashTable.has(url)) { + return null; + } + if (this.hashTable.get(url) !== hash) { + return null; + } + const cacheState = await this.lookupResourceWithoutHash(url); + return cacheState && cacheState.response; + } + lookupResourceWithoutHash(url) { + return this.assetGroups.reduce(async (potentialResponse, group) => { + const resp = await potentialResponse; + if (resp !== null) { + return resp; + } + return group.fetchFromCacheOnly(url); + }, Promise.resolve(null)); + } + previouslyCachedResources() { + return this.assetGroups.reduce(async (resources, group) => (await resources).concat(await group.unhashedResources()), Promise.resolve([])); + } + async recentCacheStatus(url) { + return this.assetGroups.reduce(async (current, group) => { + const status = await current; + if (status === UpdateCacheStatus.CACHED) { + return status; + } + const groupStatus = await group.cacheStatus(url); + if (groupStatus === UpdateCacheStatus.NOT_CACHED) { + return status; + } + return groupStatus; + }, Promise.resolve(UpdateCacheStatus.NOT_CACHED)); + } + async getCacheNames() { + const allGroupCacheNames = await Promise.all([ + ...this.assetGroups.map((group) => group.getCacheNames()), + ...this.dataGroups.map((group) => group.getCacheNames()) + ]); + return [].concat(...allGroupCacheNames); + } + get appData() { + return this.manifest.appData || null; + } + acceptsTextHtml(req) { + const accept = req.headers.get("Accept"); + if (accept === null) { + return false; + } + const values = accept.split(","); + return values.some((value) => value.trim().toLowerCase() === "text/html"); + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/debug.mjs + var SW_VERSION = "14.0.3"; + var DEBUG_LOG_BUFFER_SIZE = 100; + var DebugHandler = class { + constructor(driver, adapter2) { + this.driver = driver; + this.adapter = adapter2; + this.debugLogA = []; + this.debugLogB = []; + } + async handleFetch(req) { + const [state, versions, idle] = await Promise.all([ + this.driver.debugState(), + this.driver.debugVersions(), + this.driver.debugIdleState() + ]); + const msgState = `NGSW Debug Info: + +Driver version: ${SW_VERSION} +Driver state: ${state.state} (${state.why}) +Latest manifest hash: ${state.latestHash || "none"} +Last update check: ${this.since(state.lastUpdateCheck)}`; + const msgVersions = versions.map((version) => `=== Version ${version.hash} === + +Clients: ${version.clients.join(", ")}`).join("\n\n"); + const msgIdle = `=== Idle Task Queue === +Last update tick: ${this.since(idle.lastTrigger)} +Last update run: ${this.since(idle.lastRun)} +Task queue: +${idle.queue.map((v) => " * " + v).join("\n")} + +Debug log: +${this.formatDebugLog(this.debugLogB)} +${this.formatDebugLog(this.debugLogA)} +`; + return this.adapter.newResponse(`${msgState} + +${msgVersions} + +${msgIdle}`, { headers: this.adapter.newHeaders({ "Content-Type": "text/plain" }) }); + } + since(time) { + if (time === null) { + return "never"; + } + let age = this.adapter.time - time; + const days = Math.floor(age / 864e5); + age = age % 864e5; + const hours = Math.floor(age / 36e5); + age = age % 36e5; + const minutes = Math.floor(age / 6e4); + age = age % 6e4; + const seconds = Math.floor(age / 1e3); + const millis = age % 1e3; + return (days > 0 ? `${days}d` : "") + (hours > 0 ? `${hours}h` : "") + (minutes > 0 ? `${minutes}m` : "") + (seconds > 0 ? `${seconds}s` : "") + (millis > 0 ? `${millis}u` : ""); + } + log(value, context = "") { + if (this.debugLogA.length === DEBUG_LOG_BUFFER_SIZE) { + this.debugLogB = this.debugLogA; + this.debugLogA = []; + } + if (typeof value !== "string") { + value = this.errorToString(value); + } + this.debugLogA.push({ value, time: this.adapter.time, context }); + } + errorToString(err) { + return `${err.name}(${err.message}, ${err.stack})`; + } + formatDebugLog(log) { + return log.map((entry) => `[${this.since(entry.time)}] ${entry.value} ${entry.context}`).join("\n"); + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/idle.mjs + var IdleScheduler = class { + constructor(adapter2, delay, maxDelay, debug) { + this.adapter = adapter2; + this.delay = delay; + this.maxDelay = maxDelay; + this.debug = debug; + this.queue = []; + this.scheduled = null; + this.empty = Promise.resolve(); + this.emptyResolve = null; + this.lastTrigger = null; + this.lastRun = null; + this.oldestScheduledAt = null; + } + async trigger() { + var _a; + this.lastTrigger = this.adapter.time; + if (this.queue.length === 0) { + return; + } + if (this.scheduled !== null) { + this.scheduled.cancel = true; + } + const scheduled = { + cancel: false + }; + this.scheduled = scheduled; + const now = this.adapter.time; + const maxDelay = Math.max(0, ((_a = this.oldestScheduledAt) != null ? _a : now) + this.maxDelay - now); + const delay = Math.min(maxDelay, this.delay); + await this.adapter.timeout(delay); + if (scheduled.cancel) { + return; + } + this.scheduled = null; + await this.execute(); + } + async execute() { + this.lastRun = this.adapter.time; + while (this.queue.length > 0) { + const queue = this.queue; + this.queue = []; + await queue.reduce(async (previous, task) => { + await previous; + try { + await task.run(); + } catch (err) { + this.debug.log(err, `while running idle task ${task.desc}`); + } + }, Promise.resolve()); + } + if (this.emptyResolve !== null) { + this.emptyResolve(); + this.emptyResolve = null; + } + this.empty = Promise.resolve(); + this.oldestScheduledAt = null; + } + schedule(desc, run) { + this.queue.push({ desc, run }); + if (this.emptyResolve === null) { + this.empty = new Promise((resolve) => { + this.emptyResolve = resolve; + }); + } + if (this.oldestScheduledAt === null) { + this.oldestScheduledAt = this.adapter.time; + } + } + get size() { + return this.queue.length; + } + get taskDescriptions() { + return this.queue.map((task) => task.desc); + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/manifest.mjs + function hashManifest(manifest) { + return sha1(JSON.stringify(manifest)); + } + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/msg.mjs + function isMsgCheckForUpdates(msg) { + return msg.action === "CHECK_FOR_UPDATES"; + } + function isMsgActivateUpdate(msg) { + return msg.action === "ACTIVATE_UPDATE"; + } + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/src/driver.mjs + var IDLE_DELAY = 5e3; + var MAX_IDLE_DELAY = 3e4; + var SUPPORTED_CONFIG_VERSION = 1; + var NOTIFICATION_OPTION_NAMES = [ + "actions", + "badge", + "body", + "data", + "dir", + "icon", + "image", + "lang", + "renotify", + "requireInteraction", + "silent", + "tag", + "timestamp", + "title", + "vibrate" + ]; + var DriverReadyState; + (function(DriverReadyState2) { + DriverReadyState2[DriverReadyState2["NORMAL"] = 0] = "NORMAL"; + DriverReadyState2[DriverReadyState2["EXISTING_CLIENTS_ONLY"] = 1] = "EXISTING_CLIENTS_ONLY"; + DriverReadyState2[DriverReadyState2["SAFE_MODE"] = 2] = "SAFE_MODE"; + })(DriverReadyState || (DriverReadyState = {})); + var Driver = class { + constructor(scope2, adapter2, db) { + this.scope = scope2; + this.adapter = adapter2; + this.db = db; + this.state = DriverReadyState.NORMAL; + this.stateMessage = "(nominal)"; + this.initialized = null; + this.clientVersionMap = /* @__PURE__ */ new Map(); + this.versions = /* @__PURE__ */ new Map(); + this.latestHash = null; + this.lastUpdateCheck = null; + this.scheduledNavUpdateCheck = false; + this.loggedInvalidOnlyIfCachedRequest = false; + this.ngswStatePath = this.adapter.parseUrl("ngsw/state", this.scope.registration.scope).path; + this.controlTable = this.db.open("control"); + this.scope.addEventListener("install", (event) => { + event.waitUntil(this.scope.skipWaiting()); + }); + this.scope.addEventListener("activate", (event) => { + event.waitUntil((async () => { + await this.scope.clients.claim(); + this.idle.schedule("activate: cleanup-old-sw-caches", async () => { + try { + await this.cleanupOldSwCaches(); + } catch (err) { + this.debugger.log(err, "cleanupOldSwCaches @ activate: cleanup-old-sw-caches"); + } + }); + })()); + if (this.scope.registration.active !== null) { + this.scope.registration.active.postMessage({ action: "INITIALIZE" }); + } + }); + this.scope.addEventListener("fetch", (event) => this.onFetch(event)); + this.scope.addEventListener("message", (event) => this.onMessage(event)); + this.scope.addEventListener("push", (event) => this.onPush(event)); + this.scope.addEventListener("notificationclick", (event) => this.onClick(event)); + this.debugger = new DebugHandler(this, this.adapter); + this.idle = new IdleScheduler(this.adapter, IDLE_DELAY, MAX_IDLE_DELAY, this.debugger); + } + onFetch(event) { + const req = event.request; + const scopeUrl = this.scope.registration.scope; + const requestUrlObj = this.adapter.parseUrl(req.url, scopeUrl); + if (req.headers.has("ngsw-bypass") || /[?&]ngsw-bypass(?:[=&]|$)/i.test(requestUrlObj.search)) { + return; + } + if (requestUrlObj.path === this.ngswStatePath) { + event.respondWith(this.debugger.handleFetch(req)); + return; + } + if (this.state === DriverReadyState.SAFE_MODE) { + event.waitUntil(this.idle.trigger()); + return; + } + if (requestUrlObj.origin.startsWith("http:") && scopeUrl.startsWith("https:")) { + this.debugger.log(`Ignoring passive mixed content request: Driver.fetch(${req.url})`); + return; + } + if (req.cache === "only-if-cached" && req.mode !== "same-origin") { + if (!this.loggedInvalidOnlyIfCachedRequest) { + this.loggedInvalidOnlyIfCachedRequest = true; + this.debugger.log(`Ignoring invalid request: 'only-if-cached' can be set only with 'same-origin' mode`, `Driver.fetch(${req.url}, cache: ${req.cache}, mode: ${req.mode})`); + } + return; + } + event.respondWith(this.handleFetch(event)); + } + onMessage(event) { + if (this.state === DriverReadyState.SAFE_MODE) { + return; + } + const data = event.data; + if (!data || !data.action) { + return; + } + event.waitUntil((async () => { + if (data.action === "INITIALIZE") { + return this.ensureInitialized(event); + } + if (!this.adapter.isClient(event.source)) { + return; + } + await this.ensureInitialized(event); + await this.handleMessage(data, event.source); + })()); + } + onPush(msg) { + if (!msg.data) { + return; + } + msg.waitUntil(this.handlePush(msg.data.json())); + } + onClick(event) { + event.waitUntil(this.handleClick(event.notification, event.action)); + } + async ensureInitialized(event) { + if (this.initialized !== null) { + return this.initialized; + } + try { + this.initialized = this.initialize(); + await this.initialized; + } catch (error) { + this.state = DriverReadyState.SAFE_MODE; + this.stateMessage = `Initialization failed due to error: ${errorToString(error)}`; + throw error; + } finally { + event.waitUntil(this.idle.trigger()); + } + } + async handleMessage(msg, from) { + if (isMsgCheckForUpdates(msg)) { + const action = this.checkForUpdate(); + await this.completeOperation(from, action, msg.nonce); + } else if (isMsgActivateUpdate(msg)) { + const action = this.updateClient(from); + await this.completeOperation(from, action, msg.nonce); + } + } + async handlePush(data) { + await this.broadcast({ + type: "PUSH", + data + }); + if (!data.notification || !data.notification.title) { + return; + } + const desc = data.notification; + let options = {}; + NOTIFICATION_OPTION_NAMES.filter((name) => desc.hasOwnProperty(name)).forEach((name) => options[name] = desc[name]); + await this.scope.registration.showNotification(desc["title"], options); + } + async handleClick(notification, action) { + var _a, _b, _c; + notification.close(); + const options = {}; + NOTIFICATION_OPTION_NAMES.filter((name) => name in notification).forEach((name) => options[name] = notification[name]); + const notificationAction = action === "" || action === void 0 ? "default" : action; + const onActionClick = (_b = (_a = notification == null ? void 0 : notification.data) == null ? void 0 : _a.onActionClick) == null ? void 0 : _b[notificationAction]; + const urlToOpen = new URL((_c = onActionClick == null ? void 0 : onActionClick.url) != null ? _c : "", this.scope.registration.scope).href; + switch (onActionClick == null ? void 0 : onActionClick.operation) { + case "openWindow": + await this.scope.clients.openWindow(urlToOpen); + break; + case "focusLastFocusedOrOpen": { + let matchingClient = await this.getLastFocusedMatchingClient(this.scope); + if (matchingClient) { + await (matchingClient == null ? void 0 : matchingClient.focus()); + } else { + await this.scope.clients.openWindow(urlToOpen); + } + break; + } + case "navigateLastFocusedOrOpen": { + let matchingClient = await this.getLastFocusedMatchingClient(this.scope); + if (matchingClient) { + matchingClient = await matchingClient.navigate(urlToOpen); + await (matchingClient == null ? void 0 : matchingClient.focus()); + } else { + await this.scope.clients.openWindow(urlToOpen); + } + break; + } + default: + break; + } + await this.broadcast({ + type: "NOTIFICATION_CLICK", + data: { action, notification: options } + }); + } + async getLastFocusedMatchingClient(scope2) { + const windowClients = await scope2.clients.matchAll({ type: "window" }); + return windowClients[0]; + } + async completeOperation(client, promise, nonce) { + const response = { type: "OPERATION_COMPLETED", nonce }; + try { + client.postMessage(__spreadProps(__spreadValues({}, response), { + result: await promise + })); + } catch (e) { + client.postMessage(__spreadProps(__spreadValues({}, response), { + error: e.toString() + })); + } + } + async updateClient(client) { + const existing = this.clientVersionMap.get(client.id); + if (existing === this.latestHash) { + return false; + } + let previous = void 0; + if (existing !== void 0) { + const existingVersion = this.versions.get(existing); + previous = this.mergeHashWithAppData(existingVersion.manifest, existing); + } + this.clientVersionMap.set(client.id, this.latestHash); + await this.sync(); + const current = this.versions.get(this.latestHash); + const notice = { + type: "UPDATE_ACTIVATED", + previous, + current: this.mergeHashWithAppData(current.manifest, this.latestHash) + }; + client.postMessage(notice); + return true; + } + async handleFetch(event) { + try { + await this.ensureInitialized(event); + } catch (e) { + return this.safeFetch(event.request); + } + if (event.request.mode === "navigate" && !this.scheduledNavUpdateCheck) { + this.scheduledNavUpdateCheck = true; + this.idle.schedule("check-updates-on-navigation", async () => { + this.scheduledNavUpdateCheck = false; + await this.checkForUpdate(); + }); + } + const appVersion = await this.assignVersion(event); + let res = null; + try { + if (appVersion !== null) { + try { + res = await appVersion.handleFetch(event.request, event); + } catch (err) { + if (err.isUnrecoverableState) { + await this.notifyClientsAboutUnrecoverableState(appVersion, err.message); + } + if (err.isCritical) { + this.debugger.log(err, `Driver.handleFetch(version: ${appVersion.manifestHash})`); + await this.versionFailed(appVersion, err); + return this.safeFetch(event.request); + } + throw err; + } + } + if (res === null) { + return this.safeFetch(event.request); + } + return res; + } finally { + event.waitUntil(this.idle.trigger()); + } + } + async initialize() { + const table = await this.controlTable; + let manifests, assignments, latest; + try { + [manifests, assignments, latest] = await Promise.all([ + table.read("manifests"), + table.read("assignments"), + table.read("latest") + ]); + if (!this.versions.has(latest.latest) && !manifests.hasOwnProperty(latest.latest)) { + this.debugger.log(`Missing manifest for latest version hash ${latest.latest}`, "initialize: read from DB"); + throw new Error(`Missing manifest for latest hash ${latest.latest}`); + } + this.idle.schedule("init post-load (update)", async () => { + await this.checkForUpdate(); + }); + } catch (_) { + const manifest = await this.fetchLatestManifest(); + const hash = hashManifest(manifest); + manifests = { [hash]: manifest }; + assignments = {}; + latest = { latest: hash }; + await Promise.all([ + table.write("manifests", manifests), + table.write("assignments", assignments), + table.write("latest", latest) + ]); + } + this.idle.schedule("init post-load (cleanup)", async () => { + await this.cleanupCaches(); + }); + Object.keys(manifests).forEach((hash) => { + const manifest = manifests[hash]; + if (!this.versions.has(hash)) { + this.versions.set(hash, new AppVersion(this.scope, this.adapter, this.db, this.idle, this.debugger, manifest, hash)); + } + }); + Object.keys(assignments).forEach((clientId) => { + const hash = assignments[clientId]; + if (this.versions.has(hash)) { + this.clientVersionMap.set(clientId, hash); + } else { + this.clientVersionMap.set(clientId, latest.latest); + this.debugger.log(`Unknown version ${hash} mapped for client ${clientId}, using latest instead`, `initialize: map assignments`); + } + }); + this.latestHash = latest.latest; + if (!this.versions.has(latest.latest)) { + throw new Error(`Invariant violated (initialize): latest hash ${latest.latest} has no known manifest`); + } + await Promise.all(Object.keys(manifests).map(async (hash) => { + try { + await this.scheduleInitialization(this.versions.get(hash)); + } catch (err) { + this.debugger.log(err, `initialize: schedule init of ${hash}`); + return false; + } + })); + } + lookupVersionByHash(hash, debugName = "lookupVersionByHash") { + if (!this.versions.has(hash)) { + throw new Error(`Invariant violated (${debugName}): want AppVersion for ${hash} but not loaded`); + } + return this.versions.get(hash); + } + async assignVersion(event) { + const clientId = event.resultingClientId || event.clientId; + if (clientId) { + if (this.clientVersionMap.has(clientId)) { + const hash = this.clientVersionMap.get(clientId); + let appVersion = this.lookupVersionByHash(hash, "assignVersion"); + if (this.state === DriverReadyState.NORMAL && hash !== this.latestHash && appVersion.isNavigationRequest(event.request)) { + if (this.latestHash === null) { + throw new Error(`Invariant violated (assignVersion): latestHash was null`); + } + const client = await this.scope.clients.get(clientId); + if (client) { + await this.updateClient(client); + } + appVersion = this.lookupVersionByHash(this.latestHash, "assignVersion"); + } + return appVersion; + } else { + if (this.state !== DriverReadyState.NORMAL) { + return null; + } + if (this.latestHash === null) { + throw new Error(`Invariant violated (assignVersion): latestHash was null`); + } + this.clientVersionMap.set(clientId, this.latestHash); + await this.sync(); + return this.lookupVersionByHash(this.latestHash, "assignVersion"); + } + } else { + if (this.state !== DriverReadyState.NORMAL) { + return null; + } + if (this.latestHash === null) { + throw new Error(`Invariant violated (assignVersion): latestHash was null`); + } + return this.lookupVersionByHash(this.latestHash, "assignVersion"); + } + } + async fetchLatestManifest(ignoreOfflineError = false) { + const res = await this.safeFetch(this.adapter.newRequest("ngsw.json?ngsw-cache-bust=" + Math.random())); + if (!res.ok) { + if (res.status === 404) { + await this.deleteAllCaches(); + await this.scope.registration.unregister(); + } else if ((res.status === 503 || res.status === 504) && ignoreOfflineError) { + return null; + } + throw new Error(`Manifest fetch failed! (status: ${res.status})`); + } + this.lastUpdateCheck = this.adapter.time; + return res.json(); + } + async deleteAllCaches() { + const cacheNames = await this.adapter.caches.keys(); + await Promise.all(cacheNames.map((name) => this.adapter.caches.delete(name))); + } + async scheduleInitialization(appVersion) { + const initialize = async () => { + try { + await appVersion.initializeFully(); + } catch (err) { + this.debugger.log(err, `initializeFully for ${appVersion.manifestHash}`); + await this.versionFailed(appVersion, err); + } + }; + if (this.scope.registration.scope.indexOf("://localhost") > -1) { + return initialize(); + } + this.idle.schedule(`initialization(${appVersion.manifestHash})`, initialize); + } + async versionFailed(appVersion, err) { + const broken = Array.from(this.versions.entries()).find(([hash, version]) => version === appVersion); + if (broken === void 0) { + return; + } + const brokenHash = broken[0]; + if (this.latestHash === brokenHash) { + this.state = DriverReadyState.EXISTING_CLIENTS_ONLY; + this.stateMessage = `Degraded due to: ${errorToString(err)}`; + } + } + async setupUpdate(manifest, hash) { + try { + const newVersion = new AppVersion(this.scope, this.adapter, this.db, this.idle, this.debugger, manifest, hash); + if (manifest.configVersion !== SUPPORTED_CONFIG_VERSION) { + await this.deleteAllCaches(); + await this.scope.registration.unregister(); + throw new Error(`Invalid config version: expected ${SUPPORTED_CONFIG_VERSION}, got ${manifest.configVersion}.`); + } + await newVersion.initializeFully(this); + this.versions.set(hash, newVersion); + this.latestHash = hash; + if (this.state === DriverReadyState.EXISTING_CLIENTS_ONLY) { + this.state = DriverReadyState.NORMAL; + this.stateMessage = "(nominal)"; + } + await this.sync(); + await this.notifyClientsAboutVersionReady(manifest, hash); + } catch (e) { + await this.notifyClientsAboutVersionInstallationFailed(manifest, hash, e); + throw e; + } + } + async checkForUpdate() { + let hash = "(unknown)"; + try { + const manifest = await this.fetchLatestManifest(true); + if (manifest === null) { + this.debugger.log("Check for update aborted. (Client or server offline.)"); + return false; + } + hash = hashManifest(manifest); + if (this.versions.has(hash)) { + await this.notifyClientsAboutNoNewVersionDetected(manifest, hash); + return false; + } + await this.notifyClientsAboutVersionDetected(manifest, hash); + await this.setupUpdate(manifest, hash); + return true; + } catch (err) { + this.debugger.log(err, `Error occurred while updating to manifest ${hash}`); + this.state = DriverReadyState.EXISTING_CLIENTS_ONLY; + this.stateMessage = `Degraded due to failed initialization: ${errorToString(err)}`; + return false; + } + } + async sync() { + const table = await this.controlTable; + const manifests = {}; + this.versions.forEach((version, hash) => { + manifests[hash] = version.manifest; + }); + const assignments = {}; + this.clientVersionMap.forEach((hash, clientId) => { + assignments[clientId] = hash; + }); + const latest = { + latest: this.latestHash + }; + await Promise.all([ + table.write("manifests", manifests), + table.write("assignments", assignments), + table.write("latest", latest) + ]); + } + async cleanupCaches() { + try { + const activeClients = new Set((await this.scope.clients.matchAll()).map((client) => client.id)); + const knownClients = Array.from(this.clientVersionMap.keys()); + const obsoleteClients = knownClients.filter((id) => !activeClients.has(id)); + obsoleteClients.forEach((id) => this.clientVersionMap.delete(id)); + const usedVersions = new Set(this.clientVersionMap.values()); + const obsoleteVersions = Array.from(this.versions.keys()).filter((version) => !usedVersions.has(version) && version !== this.latestHash); + obsoleteVersions.forEach((version) => this.versions.delete(version)); + await this.sync(); + const allCaches = await this.adapter.caches.keys(); + const usedCaches = new Set(await this.getCacheNames()); + const cachesToDelete = allCaches.filter((name) => !usedCaches.has(name)); + await Promise.all(cachesToDelete.map((name) => this.adapter.caches.delete(name))); + } catch (err) { + this.debugger.log(err, "cleanupCaches"); + } + } + async cleanupOldSwCaches() { + const caches = this.adapter.caches.original; + const cacheNames = await caches.keys(); + const oldSwCacheNames = cacheNames.filter((name) => /^ngsw:(?!\/)/.test(name)); + await Promise.all(oldSwCacheNames.map((name) => caches.delete(name))); + } + lookupResourceWithHash(url, hash) { + return Array.from(this.versions.values()).reduce(async (prev, version) => { + if (await prev !== null) { + return prev; + } + return version.lookupResourceWithHash(url, hash); + }, Promise.resolve(null)); + } + async lookupResourceWithoutHash(url) { + await this.initialized; + const version = this.versions.get(this.latestHash); + return version ? version.lookupResourceWithoutHash(url) : null; + } + async previouslyCachedResources() { + await this.initialized; + const version = this.versions.get(this.latestHash); + return version ? version.previouslyCachedResources() : []; + } + async recentCacheStatus(url) { + const version = this.versions.get(this.latestHash); + return version ? version.recentCacheStatus(url) : UpdateCacheStatus.NOT_CACHED; + } + mergeHashWithAppData(manifest, hash) { + return { + hash, + appData: manifest.appData + }; + } + async notifyClientsAboutUnrecoverableState(appVersion, reason) { + const broken = Array.from(this.versions.entries()).find(([hash, version]) => version === appVersion); + if (broken === void 0) { + return; + } + const brokenHash = broken[0]; + const affectedClients = Array.from(this.clientVersionMap.entries()).filter(([clientId, hash]) => hash === brokenHash).map(([clientId]) => clientId); + await Promise.all(affectedClients.map(async (clientId) => { + const client = await this.scope.clients.get(clientId); + if (client) { + client.postMessage({ type: "UNRECOVERABLE_STATE", reason }); + } + })); + } + async notifyClientsAboutVersionInstallationFailed(manifest, hash, error) { + await this.initialized; + const clients = await this.scope.clients.matchAll(); + await Promise.all(clients.map(async (client) => { + client.postMessage({ + type: "VERSION_INSTALLATION_FAILED", + version: this.mergeHashWithAppData(manifest, hash), + error: errorToString(error) + }); + })); + } + async notifyClientsAboutNoNewVersionDetected(manifest, hash) { + await this.initialized; + const clients = await this.scope.clients.matchAll(); + await Promise.all(clients.map(async (client) => { + client.postMessage({ type: "NO_NEW_VERSION_DETECTED", version: this.mergeHashWithAppData(manifest, hash) }); + })); + } + async notifyClientsAboutVersionDetected(manifest, hash) { + await this.initialized; + const clients = await this.scope.clients.matchAll(); + await Promise.all(clients.map(async (client) => { + const version = this.clientVersionMap.get(client.id); + if (version === void 0) { + return; + } + client.postMessage({ type: "VERSION_DETECTED", version: this.mergeHashWithAppData(manifest, hash) }); + })); + } + async notifyClientsAboutVersionReady(manifest, hash) { + await this.initialized; + const clients = await this.scope.clients.matchAll(); + await Promise.all(clients.map(async (client) => { + const version = this.clientVersionMap.get(client.id); + if (version === void 0) { + return; + } + if (version === this.latestHash) { + return; + } + const current = this.versions.get(version); + const notice = { + type: "VERSION_READY", + currentVersion: this.mergeHashWithAppData(current.manifest, version), + latestVersion: this.mergeHashWithAppData(manifest, hash) + }; + client.postMessage(notice); + })); + } + async broadcast(msg) { + const clients = await this.scope.clients.matchAll(); + clients.forEach((client) => { + client.postMessage(msg); + }); + } + async debugState() { + return { + state: DriverReadyState[this.state], + why: this.stateMessage, + latestHash: this.latestHash, + lastUpdateCheck: this.lastUpdateCheck + }; + } + async debugVersions() { + return Array.from(this.versions.keys()).map((hash) => { + const version = this.versions.get(hash); + const clients = Array.from(this.clientVersionMap.entries()).filter(([clientId, version2]) => version2 === hash).map(([clientId, version2]) => clientId); + return { + hash, + manifest: version.manifest, + clients, + status: "" + }; + }); + } + async debugIdleState() { + return { + queue: this.idle.taskDescriptions, + lastTrigger: this.idle.lastTrigger, + lastRun: this.idle.lastRun + }; + } + async safeFetch(req) { + try { + return await this.scope.fetch(req); + } catch (err) { + this.debugger.log(err, `Driver.fetch(${req.url})`); + return this.adapter.newResponse(null, { + status: 504, + statusText: "Gateway Timeout" + }); + } + } + async getCacheNames() { + const controlTable = await this.controlTable; + const appVersions = Array.from(this.versions.values()); + const appVersionCacheNames = await Promise.all(appVersions.map((version) => version.getCacheNames())); + return [controlTable.cacheName].concat(...appVersionCacheNames); + } + }; + + // bazel-out/k8-fastbuild-ST-2e5f3376adb5/bin/packages/service-worker/worker/main.mjs + var scope = self; + var adapter = new Adapter(scope.registration.scope, self.caches); + new Driver(scope, adapter, new CacheDatabase(adapter)); +})(); +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ diff --git a/dist/new-rdv-app/browser/ngsw.json b/dist/new-rdv-app/browser/ngsw.json new file mode 100644 index 0000000..6359e35 --- /dev/null +++ b/dist/new-rdv-app/browser/ngsw.json @@ -0,0 +1,117 @@ +{ + "configVersion": 1, + "timestamp": 1656244242655, + "index": "/index.html", + "assetGroups": [ + { + "name": "app", + "installMode": "prefetch", + "updateMode": "prefetch", + "cacheQueryOptions": { + "ignoreVary": true + }, + "urls": [ + "/197.c0e4561aaa90c0ab.js", + "/284.080a966852a2fffd.js", + "/36.0b2af48f611a2b9c.js", + "/469.9b8970333e7ad9a6.js", + "/552.e376aad2beb26812.js", + "/642.5bacad77981cd0f1.js", + "/698.60a53f9859f16a57.js", + "/781.f3f51c530228233b.js", + "/865.0c5ee2805ad12526.js", + "/common.8526cc0c86c704ea.js", + "/favicon.ico", + "/index.html", + "/main.3f950e6f7b445ac5.js", + "/manifest.webmanifest", + "/polyfills.0d8fe348695c3f2d.js", + "/runtime.b68279f25a4cbb2d.js", + "/scripts.b571a1a434247553.js", + "/styles.fc48f9fa10d80069.css" + ], + "patterns": [] + }, + { + "name": "assets", + "installMode": "lazy", + "updateMode": "prefetch", + "cacheQueryOptions": { + "ignoreVary": true + }, + "urls": [ + "/assets/i18n/ar.json", + "/assets/i18n/en.json", + "/assets/i18n/fr.json", + "/assets/icons/icon-128x128.png", + "/assets/icons/icon-144x144.png", + "/assets/icons/icon-152x152.png", + "/assets/icons/icon-192x192.png", + "/assets/icons/icon-384x384.png", + "/assets/icons/icon-512x512.png", + "/assets/icons/icon-72x72.png", + "/assets/icons/icon-96x96.png", + "/assets/rendezvous-icon.svg", + "/assets/unknown-profile-picture.jpg", + "/flags.f73aa829a0084837.png", + "/flags@2x.2704c069d12ee746.png" + ], + "patterns": [] + } + ], + "dataGroups": [], + "hashTable": { + "/197.c0e4561aaa90c0ab.js": "0572e2307ae74c3c2b7da895ed5411cabcbab49e", + "/284.080a966852a2fffd.js": "acb8b9e29b46fec394c504810d4b3ff6a4417c63", + "/36.0b2af48f611a2b9c.js": "5ae5662e2dfb5f4d934b8095355d590bef85b575", + "/469.9b8970333e7ad9a6.js": "185c16a523aceb80210c61df935c29b35967a58b", + "/552.e376aad2beb26812.js": "7d8cfd88b7cb9d3b5c5fa988a19d2c126c3f19a9", + "/642.5bacad77981cd0f1.js": "8f693bc4b76c506203f316642a5add4f228b62e6", + "/698.60a53f9859f16a57.js": "96b59e059e81a9edd061bbc36f012827c41d48de", + "/781.f3f51c530228233b.js": "829bdbbd699963ffbe23b1aba9aa964ccc28de32", + "/865.0c5ee2805ad12526.js": "6543487e821eef44ef2ffc9856d56d25c7b6e970", + "/assets/i18n/ar.json": "df36cc5c21ac88f53d7e27c2acfc82052d974f1e", + "/assets/i18n/en.json": "cd82c6fac079578bcc4f10f8030ef6c95c8de174", + "/assets/i18n/fr.json": "f73136fca8e2bba91ac547d159834cf4be358494", + "/assets/icons/icon-128x128.png": "dae3b6ed49bdaf4327b92531d4b5b4a5d30c7532", + "/assets/icons/icon-144x144.png": "b0bd89982e08f9bd2b642928f5391915b74799a7", + "/assets/icons/icon-152x152.png": "7479a9477815dfd9668d60f8b3b2fba709b91310", + "/assets/icons/icon-192x192.png": "1abd80d431a237a853ce38147d8c63752f10933b", + "/assets/icons/icon-384x384.png": "329749cd6393768d3131ed6304c136b1ca05f2fd", + "/assets/icons/icon-512x512.png": "559d9c4318b45a1f2b10596bbb4c960fe521dbcc", + "/assets/icons/icon-72x72.png": "c457e56089a36952cd67156f9996bc4ce54a5ed9", + "/assets/icons/icon-96x96.png": "3914125a4b445bf111c5627875fc190f560daa41", + "/assets/rendezvous-icon.svg": "98f99d18e06a0aa540b03c659ee65ca9e683f67b", + "/assets/unknown-profile-picture.jpg": "1c7abe3f7b2474275db66ba1e2ae70c504bcce37", + "/common.8526cc0c86c704ea.js": "e2f1c9b607567ac87876af41addef4dc5c17722d", + "/favicon.ico": "22f6a4a3bcaafafb0254e0f2fa4ceb89e505e8b2", + "/flags.f73aa829a0084837.png": "21572c9751e5a3dc20395befa0fcb349c32c4811", + "/flags@2x.2704c069d12ee746.png": "d6f843711c3cfe6d9a037e4c61d293f563e55802", + "/index.html": "86401124fcf6d1f748017b568d967b81e6640611", + "/main.3f950e6f7b445ac5.js": "079ac1b5ab7e825593ba1b51733ca1305ca5210f", + "/manifest.webmanifest": "6e92940ddd3929a35e9970d996b37d992b4f1050", + "/polyfills.0d8fe348695c3f2d.js": "5aef646e01ce8203fd5381660a5eafec3000d503", + "/runtime.b68279f25a4cbb2d.js": "52a5e2ee1468a6d5c7e2270217e2905104ce4375", + "/scripts.b571a1a434247553.js": "132591d51282519592fd3065dc433a9ce1bb1c25", + "/styles.fc48f9fa10d80069.css": "89e077154aa0077bc3ee3e20bb5e84109d96cbde" + }, + "navigationUrls": [ + { + "positive": true, + "regex": "^\\/.*$" + }, + { + "positive": false, + "regex": "^\\/(?:.+\\/)?[^/]*\\.[^/]*$" + }, + { + "positive": false, + "regex": "^\\/(?:.+\\/)?[^/]*__[^/]*$" + }, + { + "positive": false, + "regex": "^\\/(?:.+\\/)?[^/]*__[^/]*\\/.*$" + } + ], + "navigationRequestStrategy": "performance" +} \ No newline at end of file diff --git a/dist/new-rdv-app/browser/safety-worker.js b/dist/new-rdv-app/browser/safety-worker.js new file mode 100755 index 0000000..d98014b --- /dev/null +++ b/dist/new-rdv-app/browser/safety-worker.js @@ -0,0 +1,26 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +// tslint:disable:no-console + +self.addEventListener('install', event => { + self.skipWaiting(); +}); + +self.addEventListener('activate', event => { + event.waitUntil(self.clients.claim()); + + event.waitUntil(self.registration.unregister().then(() => { + console.log('NGSW Safety Worker - unregistered old service worker'); + })); + + event.waitUntil(caches.keys().then(cacheNames => { + const ngswCacheNames = cacheNames.filter(name => /^ngsw:/.test(name)); + return Promise.all(ngswCacheNames.map(name => caches.delete(name))); + })); +}); diff --git a/dist/new-rdv-app/browser/worker-basic.min.js b/dist/new-rdv-app/browser/worker-basic.min.js new file mode 100755 index 0000000..d98014b --- /dev/null +++ b/dist/new-rdv-app/browser/worker-basic.min.js @@ -0,0 +1,26 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +// tslint:disable:no-console + +self.addEventListener('install', event => { + self.skipWaiting(); +}); + +self.addEventListener('activate', event => { + event.waitUntil(self.clients.claim()); + + event.waitUntil(self.registration.unregister().then(() => { + console.log('NGSW Safety Worker - unregistered old service worker'); + })); + + event.waitUntil(caches.keys().then(cacheNames => { + const ngswCacheNames = cacheNames.filter(name => /^ngsw:/.test(name)); + return Promise.all(ngswCacheNames.map(name => caches.delete(name))); + })); +}); diff --git a/dist/new-rdv-app/server/117.js b/dist/new-rdv-app/server/117.js new file mode 100644 index 0000000..4b81244 --- /dev/null +++ b/dist/new-rdv-app/server/117.js @@ -0,0 +1 @@ +"use strict";var __defProp=Object.defineProperty,__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});exports.id=117,exports.ids=[117],exports.modules={81117:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ProfileModule:()=>ProfileModule});var common=__webpack_require__(69808),router=__webpack_require__(74202),auth_guard=__webpack_require__(36471),asyncToGenerator=__webpack_require__(15861),cjs=__webpack_require__(76477),utilities=__webpack_require__(83670),core=__webpack_require__(5e3),users_service=__webpack_require__(94961),operators=__webpack_require__(83292),angular_fire=__webpack_require__(94293),angular_fire_compat=__webpack_require__(12011),index_esm2017=__webpack_require__(63942),esm_index_esm2017=__webpack_require__(49681),index_node_esm=__webpack_require__(90665),lib=(__webpack_require__(12781),__webpack_require__(74627)),dist_esm_index_esm2017=__webpack_require__(34859);class StorageError extends index_node_esm.ZR{constructor(code,message){super(prependCode(code),`Firebase Storage: ${message} (${prependCode(code)})`),this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,StorageError.prototype)}_codeEquals(code){return prependCode(code)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(serverResponse){this.customData.serverResponse=serverResponse,this.customData.serverResponse?this.message=`${this._baseMessage}\n${this.customData.serverResponse}`:this.message=this._baseMessage}}function prependCode(code){return"storage/"+code}function unknown(){return new StorageError("unknown","An unknown error occurred, please check the error payload for server response.")}function objectNotFound(path){return new StorageError("object-not-found","Object '"+path+"' does not exist.")}function quotaExceeded(bucket){return new StorageError("quota-exceeded","Quota for bucket '"+bucket+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function unauthenticated(){return new StorageError("unauthenticated","User is not authenticated, please authenticate using Firebase Authentication and try again.")}function unauthorizedApp(){return new StorageError("unauthorized-app","This app does not have permission to access Firebase Storage on this project.")}function unauthorized(path){return new StorageError("unauthorized","User does not have permission to access '"+path+"'.")}function retryLimitExceeded(){return new StorageError("retry-limit-exceeded","Max retry time for operation exceeded, please try again.")}function canceled(){return new StorageError("canceled","User canceled the upload/download.")}function invalidUrl(url){return new StorageError("invalid-url","Invalid URL '"+url+"'.")}function invalidDefaultBucket(bucket){return new StorageError("invalid-default-bucket","Invalid default bucket '"+bucket+"'.")}function noDefaultBucket(){return new StorageError("no-default-bucket","No default bucket found. Did you set the 'storageBucket' property when initializing the app?")}function cannotSliceBlob(){return new StorageError("cannot-slice-blob","Cannot slice blob for upload. Please retry the upload.")}function serverFileWrongSize(){return new StorageError("server-file-wrong-size","Server recorded incorrect upload file size, please retry the upload.")}function noDownloadURL(){return new StorageError("no-download-url","The given file does not have any download URLs.")}function invalidArgument(message){return new StorageError("invalid-argument",message)}function appDeleted(){return new StorageError("app-deleted","The Firebase app was deleted.")}function invalidRootOperation(name){return new StorageError("invalid-root-operation","The operation '"+name+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function invalidFormat(format,message){return new StorageError("invalid-format","String does not match format '"+format+"': "+message)}function internalError(message){throw new StorageError("internal-error","Internal error: "+message)}__name(StorageError,"StorageError"),__name(prependCode,"prependCode"),__name(unknown,"unknown"),__name(objectNotFound,"objectNotFound"),__name(quotaExceeded,"quotaExceeded"),__name(unauthenticated,"unauthenticated"),__name(unauthorizedApp,"unauthorizedApp"),__name(unauthorized,"unauthorized"),__name(retryLimitExceeded,"retryLimitExceeded"),__name(canceled,"canceled"),__name(invalidUrl,"invalidUrl"),__name(invalidDefaultBucket,"invalidDefaultBucket"),__name(noDefaultBucket,"noDefaultBucket"),__name(cannotSliceBlob,"cannotSliceBlob"),__name(serverFileWrongSize,"serverFileWrongSize"),__name(noDownloadURL,"noDownloadURL"),__name(invalidArgument,"invalidArgument"),__name(appDeleted,"appDeleted"),__name(invalidRootOperation,"invalidRootOperation"),__name(invalidFormat,"invalidFormat"),__name(internalError,"internalError");class Location{constructor(bucket,path){this.bucket=bucket,this.path_=path}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const encode=encodeURIComponent;return"/b/"+encode(this.bucket)+"/o/"+encode(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(bucketString,host){let bucketLocation;try{bucketLocation=Location.makeFromUrl(bucketString,host)}catch{return new Location(bucketString,"")}if(""===bucketLocation.path)return bucketLocation;throw invalidDefaultBucket(bucketString)}static makeFromUrl(url,host){let location=null;function gsModify(loc){"/"===loc.path.charAt(loc.path.length-1)&&(loc.path_=loc.path_.slice(0,-1))}__name(gsModify,"gsModify");const gsRegex=new RegExp("^gs://([A-Za-z0-9.\\-_]+)(/(.*))?$","i");function httpModify(loc){loc.path_=decodeURIComponent(loc.path)}__name(httpModify,"httpModify");const firebaseStorageHost=host.replace(/[.]/g,"\\."),groups=[{regex:gsRegex,indices:{bucket:1,path:3},postModify:gsModify},{regex:new RegExp(`^https?://${firebaseStorageHost}/v[A-Za-z0-9_]+/b/([A-Za-z0-9.\\-_]+)/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:httpModify},{regex:new RegExp(`^https?://${"firebasestorage.googleapis.com"===host?"(?:storage.googleapis.com|storage.cloud.google.com)":host}/([A-Za-z0-9.\\-_]+)/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:httpModify}];for(let i=0;i{retryTimeoutId=null,f(handler,canceled2())},millis)}function clearGlobalTimeout(){globalTimeoutId&&clearTimeout(globalTimeoutId)}function handler(success,...args){if(triggeredCallback)return void clearGlobalTimeout();if(success)return clearGlobalTimeout(),void triggerCallback.call(null,success,...args);if(canceled2()||hitTimeout)return clearGlobalTimeout(),void triggerCallback.call(null,success,...args);let waitMillis;waitSeconds<64&&(waitSeconds*=2),1===cancelState?(cancelState=2,waitMillis=0):waitMillis=1e3*(waitSeconds+Math.random()),callWithDelay(waitMillis)}__name(triggerCallback,"triggerCallback"),__name(callWithDelay,"callWithDelay"),__name(clearGlobalTimeout,"clearGlobalTimeout"),__name(handler,"handler");let stopped=!1;function stop2(wasTimeout){stopped||(stopped=!0,clearGlobalTimeout(),!triggeredCallback&&(null!==retryTimeoutId?(wasTimeout||(cancelState=2),clearTimeout(retryTimeoutId),callWithDelay(0)):wasTimeout||(cancelState=1)))}return __name(stop2,"stop"),callWithDelay(0),globalTimeoutId=setTimeout(()=>{hitTimeout=!0,stop2(!0)},timeout),stop2}function stop(id){id(!1)}function isJustDef(p){return void 0!==p}function isFunction(p){return"function"==typeof p}function isNonArrayObject(p){return"object"==typeof p&&!Array.isArray(p)}function isString(p){return"string"==typeof p||p instanceof String}function isNativeBlob(p){return isNativeBlobDefined()&&p instanceof Blob}function isNativeBlobDefined(){return"undefined"!=typeof Blob}function validateNumber(argument,minValue,maxValue,value){if(valuemaxValue)throw invalidArgument(`Invalid value for '${argument}'. Expected ${maxValue} or less.`)}function makeUrl(urlPart,host,protocol){let origin=host;return null==protocol&&(origin=`https://${host}`),`${protocol}://${origin}/v0${urlPart}`}function makeQueryString(params){const encode=encodeURIComponent;let queryPart="?";for(const key in params)if(params.hasOwnProperty(key)){queryPart=queryPart+(encode(key)+"="+encode(params[key]))+"&"}return queryPart=queryPart.slice(0,-1),queryPart}var ErrorCode,ErrorCode2;__name(FailRequest,"FailRequest"),__name(start,"start"),__name(stop,"stop"),__name(isJustDef,"isJustDef"),__name(isFunction,"isFunction"),__name(isNonArrayObject,"isNonArrayObject"),__name(isString,"isString"),__name(isNativeBlob,"isNativeBlob"),__name(isNativeBlobDefined,"isNativeBlobDefined"),__name(validateNumber,"validateNumber"),__name(makeUrl,"makeUrl"),__name(makeQueryString,"makeQueryString"),(ErrorCode2=ErrorCode||(ErrorCode={}))[ErrorCode2.NO_ERROR=0]="NO_ERROR",ErrorCode2[ErrorCode2.NETWORK_ERROR=1]="NETWORK_ERROR",ErrorCode2[ErrorCode2.ABORT=2]="ABORT";class NetworkRequest{constructor(url_,method_,headers_,body_,successCodes_,additionalRetryCodes_,callback_,errorCallback_,timeout_,progressCallback_,connectionFactory_){this.url_=url_,this.method_=method_,this.headers_=headers_,this.body_=body_,this.successCodes_=successCodes_,this.additionalRetryCodes_=additionalRetryCodes_,this.callback_=callback_,this.errorCallback_=errorCallback_,this.timeout_=timeout_,this.progressCallback_=progressCallback_,this.connectionFactory_=connectionFactory_,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((resolve,reject)=>{this.resolve_=resolve,this.reject_=reject,this.start_()})}start_(){const doTheRequest=__name((backoffCallback,canceled2)=>{if(canceled2)return void backoffCallback(!1,new RequestEndStatus(!1,null,!0));const connection=this.connectionFactory_();this.pendingConnection_=connection;const progressListener=__name(progressEvent=>{const loaded=progressEvent.loaded,total=progressEvent.lengthComputable?progressEvent.total:-1;null!==this.progressCallback_&&this.progressCallback_(loaded,total)},"progressListener");null!==this.progressCallback_&&connection.addUploadProgressListener(progressListener),connection.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&connection.removeUploadProgressListener(progressListener),this.pendingConnection_=null;const hitServer=connection.getErrorCode()===ErrorCode.NO_ERROR,status=connection.getStatus();if(!hitServer||this.isRetryStatusCode_(status)){const wasCanceled=connection.getErrorCode()===ErrorCode.ABORT;return void backoffCallback(!1,new RequestEndStatus(!1,null,wasCanceled))}const successCode=-1!==this.successCodes_.indexOf(status);backoffCallback(!0,new RequestEndStatus(successCode,connection))})},"doTheRequest"),backoffDone=__name((requestWentThrough,status)=>{const resolve=this.resolve_,reject=this.reject_,connection=status.connection;if(status.wasSuccessCode)try{const result=this.callback_(connection,connection.getResponse());isJustDef(result)?resolve(result):resolve()}catch(e){reject(e)}else if(null!==connection){const err=unknown();err.serverResponse=connection.getErrorText(),this.errorCallback_?reject(this.errorCallback_(connection,err)):reject(err)}else if(status.canceled){reject(this.appDelete_?appDeleted():canceled())}else{reject(retryLimitExceeded())}},"backoffDone");this.canceled_?backoffDone(!1,new RequestEndStatus(!1,null,!0)):this.backoffId_=start(doTheRequest,backoffDone,this.timeout_)}getPromise(){return this.promise_}cancel(appDelete){this.canceled_=!0,this.appDelete_=appDelete||!1,null!==this.backoffId_&&stop(this.backoffId_),null!==this.pendingConnection_&&this.pendingConnection_.abort()}isRetryStatusCode_(status){const isFiveHundredCode=status>=500&&status<600,isExtraRetryCode=-1!==[408,429].indexOf(status),isRequestSpecificRetryCode=-1!==this.additionalRetryCodes_.indexOf(status);return isFiveHundredCode||isExtraRetryCode||isRequestSpecificRetryCode}}__name(NetworkRequest,"NetworkRequest");class RequestEndStatus{constructor(wasSuccessCode,connection,canceled2){this.wasSuccessCode=wasSuccessCode,this.connection=connection,this.canceled=!!canceled2}}function addAuthHeader_(headers,authToken){null!==authToken&&authToken.length>0&&(headers.Authorization="Firebase "+authToken)}function addVersionHeader_(headers,firebaseVersion){headers["X-Firebase-Storage-Version"]="webjs/"+(null!=firebaseVersion?firebaseVersion:"AppManager")}function addGmpidHeader_(headers,appId){appId&&(headers["X-Firebase-GMPID"]=appId)}function addAppCheckHeader_(headers,appCheckToken){null!==appCheckToken&&(headers["X-Firebase-AppCheck"]=appCheckToken)}function makeRequest(requestInfo,appId,authToken,appCheckToken,requestFactory,firebaseVersion){const queryPart=makeQueryString(requestInfo.urlParams),url=requestInfo.url+queryPart,headers=Object.assign({},requestInfo.headers);return addGmpidHeader_(headers,appId),addAuthHeader_(headers,authToken),addVersionHeader_(headers,firebaseVersion),addAppCheckHeader_(headers,appCheckToken),new NetworkRequest(url,requestInfo.method,headers,requestInfo.body,requestInfo.successCodes,requestInfo.additionalRetryCodes,requestInfo.handler,requestInfo.errorHandler,requestInfo.timeout,requestInfo.progressCallback,requestFactory)}function getBlobBuilder(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function getBlob$1(...args){const BlobBuilder2=getBlobBuilder();if(void 0!==BlobBuilder2){const bb=new BlobBuilder2;for(let i=0;i>6,128|63&c);else if(55296==(64512&c))if(i>18,128|c>>12&63,128|c>>6&63,128|63&c)}else b.push(239,191,189);else 56320==(64512&c)?b.push(239,191,189):b.push(224|c>>12,128|c>>6&63,128|63&c)}return new Uint8Array(b)}function percentEncodedBytes_(value){let decoded;try{decoded=decodeURIComponent(value)}catch{throw invalidFormat(StringFormat.DATA_URL,"Malformed data URL.")}return utf8Bytes_(decoded)}function base64Bytes_(format,value){switch(format){case StringFormat.BASE64:{const hasMinus=-1!==value.indexOf("-"),hasUnder=-1!==value.indexOf("_");if(hasMinus||hasUnder)throw invalidFormat(format,"Invalid character '"+(hasMinus?"-":"_")+"' found: is it base64url encoded?");break}case StringFormat.BASE64URL:{const hasPlus=-1!==value.indexOf("+"),hasSlash=-1!==value.indexOf("/");if(hasPlus||hasSlash)throw invalidFormat(format,"Invalid character '"+(hasPlus?"+":"/")+"' found: is it base64 encoded?");value=value.replace(/-/g,"+").replace(/_/g,"/");break}}let bytes;try{bytes=decodeBase64(value)}catch{throw invalidFormat(format,"Invalid character found")}const array=new Uint8Array(bytes.length);for(let i=0;i][;base64],");const middle=matches[1]||null;null!=middle&&(this.base64=endsWith(middle,";base64"),this.contentType=this.base64?middle.substring(0,middle.length-7):middle),this.rest=dataURL.substring(dataURL.indexOf(",")+1)}}function dataURLBytes_(dataUrl){const parts=new DataURLParts(dataUrl);return parts.base64?base64Bytes_(StringFormat.BASE64,parts.rest):percentEncodedBytes_(parts.rest)}function dataURLContentType_(dataUrl){return new DataURLParts(dataUrl).contentType}function endsWith(s,end){return s.length>=end.length&&s.substring(s.length-end.length)===end}__name(DataURLParts,"DataURLParts"),__name(dataURLBytes_,"dataURLBytes_"),__name(dataURLContentType_,"dataURLContentType_"),__name(endsWith,"endsWith");class FbsBlob{constructor(data,elideCopy){let size=0,blobType="";isNativeBlob(data)?(this.data_=data,size=data.size,blobType=data.type):data instanceof ArrayBuffer?(elideCopy?this.data_=new Uint8Array(data):(this.data_=new Uint8Array(data.byteLength),this.data_.set(new Uint8Array(data))),size=this.data_.length):data instanceof Uint8Array&&(elideCopy?this.data_=data:(this.data_=new Uint8Array(data.length),this.data_.set(data)),size=data.length),this.size_=size,this.type_=blobType}size(){return this.size_}type(){return this.type_}slice(startByte,endByte){if(isNativeBlob(this.data_)){const sliced=sliceBlob(this.data_,startByte,endByte);return null===sliced?null:new FbsBlob(sliced)}{const slice=new Uint8Array(this.data_.buffer,startByte,endByte-startByte);return new FbsBlob(slice,!0)}}static getBlob(...args){if(isNativeBlobDefined()){const blobby=args.map(val=>val instanceof FbsBlob?val.data_:val);return new FbsBlob(getBlob$1.apply(null,blobby))}{const uint8Arrays=args.map(val=>isString(val)?dataFromString(StringFormat.RAW,val).data:val.data_);let finalLength=0;uint8Arrays.forEach(array=>{finalLength+=array.byteLength});const merged=new Uint8Array(finalLength);let index=0;return uint8Arrays.forEach(array=>{for(let i=0;icomponent.length>0).join("/");return 0===path.length?canonicalChildPath:path+"/"+canonicalChildPath}function lastComponent(path){const index=path.lastIndexOf("/",path.length-2);return-1===index?path:path.slice(index+1)}function noXform_(metadata,value){return value}__name(FbsBlob,"FbsBlob"),__name(jsonObjectOrNull,"jsonObjectOrNull"),__name(index_node_esm_parent,"index_node_esm_parent"),__name(child,"child"),__name(lastComponent,"lastComponent"),__name(noXform_,"noXform_");class Mapping{constructor(server,local,writable,xform){this.server=server,this.local=local||server,this.writable=!!writable,this.xform=xform||noXform_}}__name(Mapping,"Mapping");let mappings_=null;function xformPath(fullPath){return!isString(fullPath)||fullPath.length<2?fullPath:lastComponent(fullPath)}function getMappings(){if(mappings_)return mappings_;const mappings=[];function mappingsXformPath(_metadata,fullPath){return xformPath(fullPath)}mappings.push(new Mapping("bucket")),mappings.push(new Mapping("generation")),mappings.push(new Mapping("metageneration")),mappings.push(new Mapping("name","fullPath",!0)),__name(mappingsXformPath,"mappingsXformPath");const nameMapping=new Mapping("name");function xformSize(_metadata,size){return void 0!==size?Number(size):size}nameMapping.xform=mappingsXformPath,mappings.push(nameMapping),__name(xformSize,"xformSize");const sizeMapping=new Mapping("size");return sizeMapping.xform=xformSize,mappings.push(sizeMapping),mappings.push(new Mapping("timeCreated")),mappings.push(new Mapping("updated")),mappings.push(new Mapping("md5Hash",null,!0)),mappings.push(new Mapping("cacheControl",null,!0)),mappings.push(new Mapping("contentDisposition",null,!0)),mappings.push(new Mapping("contentEncoding",null,!0)),mappings.push(new Mapping("contentLanguage",null,!0)),mappings.push(new Mapping("contentType",null,!0)),mappings.push(new Mapping("metadata","customMetadata",!0)),mappings_=mappings,mappings_}function addRef(metadata,service){function generateRef(){const bucket=metadata.bucket,path=metadata.fullPath,loc=new Location(bucket,path);return service._makeStorageReference(loc)}__name(generateRef,"generateRef"),Object.defineProperty(metadata,"ref",{get:generateRef})}function fromResource(service,resource,mappings){const metadata={type:"file"},len=mappings.length;for(let i=0;i{const bucket=metadata.bucket,path=metadata.fullPath;return makeUrl("/b/"+encode(bucket)+"/o/"+encode(path),host,protocol)+makeQueryString({alt:"media",token})})[0]}function toResourceString(metadata,mappings){const resource={},len=mappings.length;for(let i=0;i0&&(urlParams.delimiter=delimiter),pageToken&&(urlParams.pageToken=pageToken),maxResults&&(urlParams.maxResults=maxResults);const url=makeUrl(location.bucketOnlyServerUrl(),service.host,service._protocol),timeout=service.maxOperationRetryTime,requestInfo=new RequestInfo(url,"GET",listHandler(service,location.bucket),timeout);return requestInfo.urlParams=urlParams,requestInfo.errorHandler=sharedErrorHandler(location),requestInfo}function getBytes$1(service,location,maxDownloadSizeBytes){const url=makeUrl(location.fullServerUrl(),service.host,service._protocol)+"?alt=media",timeout=service.maxOperationRetryTime,requestInfo=new RequestInfo(url,"GET",(_,data)=>data,timeout);return requestInfo.errorHandler=objectErrorHandler(location),void 0!==maxDownloadSizeBytes&&(requestInfo.headers.Range=`bytes=0-${maxDownloadSizeBytes}`,requestInfo.successCodes=[200,206]),requestInfo}function getDownloadUrl(service,location,mappings){const url=makeUrl(location.fullServerUrl(),service.host,service._protocol),timeout=service.maxOperationRetryTime,requestInfo=new RequestInfo(url,"GET",downloadUrlHandler(service,mappings),timeout);return requestInfo.errorHandler=objectErrorHandler(location),requestInfo}function updateMetadata$2(service,location,metadata,mappings){const url=makeUrl(location.fullServerUrl(),service.host,service._protocol),body=toResourceString(metadata,mappings),timeout=service.maxOperationRetryTime,requestInfo=new RequestInfo(url,"PATCH",metadataHandler(service,mappings),timeout);return requestInfo.headers={"Content-Type":"application/json; charset=utf-8"},requestInfo.body=body,requestInfo.errorHandler=objectErrorHandler(location),requestInfo}function deleteObject$2(service,location){const url=makeUrl(location.fullServerUrl(),service.host,service._protocol),timeout=service.maxOperationRetryTime;function handler(_xhr,_text){}__name(handler,"handler");const requestInfo=new RequestInfo(url,"DELETE",handler,timeout);return requestInfo.successCodes=[200,204],requestInfo.errorHandler=objectErrorHandler(location),requestInfo}function determineContentType_(metadata,blob){return metadata&&metadata.contentType||blob&&blob.type()||"application/octet-stream"}function metadataForUpload_(location,blob,metadata){const metadataClone=Object.assign({},metadata);return metadataClone.fullPath=location.path,metadataClone.size=blob.size(),metadataClone.contentType||(metadataClone.contentType=determineContentType_(null,blob)),metadataClone}function multipartUpload(service,location,mappings,blob,metadata){const urlPart=location.bucketOnlyServerUrl(),headers={"X-Goog-Upload-Protocol":"multipart"};function genBoundary(){let str="";for(let i=0;i<2;i++)str+=Math.random().toString().slice(2);return str}__name(genBoundary,"genBoundary");const boundary=genBoundary();headers["Content-Type"]="multipart/related; boundary="+boundary;const metadata_=metadataForUpload_(location,blob,metadata),preBlobPart="--"+boundary+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+toResourceString(metadata_,mappings)+"\r\n--"+boundary+"\r\nContent-Type: "+metadata_.contentType+"\r\n\r\n",postBlobPart="\r\n--"+boundary+"--",body=FbsBlob.getBlob(preBlobPart,blob,postBlobPart);if(null===body)throw cannotSliceBlob();const urlParams={name:metadata_.fullPath},url=makeUrl(urlPart,service.host,service._protocol),timeout=service.maxUploadRetryTime,requestInfo=new RequestInfo(url,"POST",metadataHandler(service,mappings),timeout);return requestInfo.urlParams=urlParams,requestInfo.headers=headers,requestInfo.body=body.uploadData(),requestInfo.errorHandler=sharedErrorHandler(location),requestInfo}__name(RequestInfo,"RequestInfo"),__name(handlerCheck,"handlerCheck"),__name(metadataHandler,"metadataHandler"),__name(listHandler,"listHandler"),__name(downloadUrlHandler,"downloadUrlHandler"),__name(sharedErrorHandler,"sharedErrorHandler"),__name(objectErrorHandler,"objectErrorHandler"),__name(getMetadata$2,"getMetadata$2"),__name(list$2,"list$2"),__name(getBytes$1,"getBytes$1"),__name(getDownloadUrl,"getDownloadUrl"),__name(updateMetadata$2,"updateMetadata$2"),__name(deleteObject$2,"deleteObject$2"),__name(determineContentType_,"determineContentType_"),__name(metadataForUpload_,"metadataForUpload_"),__name(multipartUpload,"multipartUpload");class ResumableUploadStatus{constructor(current,total,finalized,metadata){this.current=current,this.total=total,this.finalized=!!finalized,this.metadata=metadata||null}}function checkResumeHeader_(xhr,allowed){let status=null;try{status=xhr.getResponseHeader("X-Goog-Upload-Status")}catch{handlerCheck(!1)}return handlerCheck(!!status&&-1!==(allowed||["active"]).indexOf(status)),status}function createResumableUpload(service,location,mappings,blob,metadata){const urlPart=location.bucketOnlyServerUrl(),metadataForUpload=metadataForUpload_(location,blob,metadata),urlParams={name:metadataForUpload.fullPath},url=makeUrl(urlPart,service.host,service._protocol),headers={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${blob.size()}`,"X-Goog-Upload-Header-Content-Type":metadataForUpload.contentType,"Content-Type":"application/json; charset=utf-8"},body=toResourceString(metadataForUpload,mappings),timeout=service.maxUploadRetryTime;function handler(xhr){let url2;checkResumeHeader_(xhr);try{url2=xhr.getResponseHeader("X-Goog-Upload-URL")}catch{handlerCheck(!1)}return handlerCheck(isString(url2)),url2}__name(handler,"handler");const requestInfo=new RequestInfo(url,"POST",handler,timeout);return requestInfo.urlParams=urlParams,requestInfo.headers=headers,requestInfo.body=body,requestInfo.errorHandler=sharedErrorHandler(location),requestInfo}function getResumableUploadStatus(service,location,url,blob){function handler(xhr){const status=checkResumeHeader_(xhr,["active","final"]);let sizeString=null;try{sizeString=xhr.getResponseHeader("X-Goog-Upload-Size-Received")}catch{handlerCheck(!1)}sizeString||handlerCheck(!1);const size=Number(sizeString);return handlerCheck(!isNaN(size)),new ResumableUploadStatus(size,blob.size(),"final"===status)}__name(handler,"handler");const timeout=service.maxUploadRetryTime,requestInfo=new RequestInfo(url,"POST",handler,timeout);return requestInfo.headers={"X-Goog-Upload-Command":"query"},requestInfo.errorHandler=sharedErrorHandler(location),requestInfo}__name(ResumableUploadStatus,"ResumableUploadStatus"),__name(checkResumeHeader_,"checkResumeHeader_"),__name(createResumableUpload,"createResumableUpload"),__name(getResumableUploadStatus,"getResumableUploadStatus");function continueResumableUpload(location,service,url,blob,chunkSize,mappings,status,progressCallback){const status_=new ResumableUploadStatus(0,0);if(status?(status_.current=status.current,status_.total=status.total):(status_.current=0,status_.total=blob.size()),blob.size()!==status_.total)throw serverFileWrongSize();const bytesLeft=status_.total-status_.current;let bytesToUpload=bytesLeft;chunkSize>0&&(bytesToUpload=Math.min(bytesToUpload,chunkSize));const startByte=status_.current,endByte=startByte+bytesToUpload,headers={"X-Goog-Upload-Command":bytesToUpload===bytesLeft?"upload, finalize":"upload","X-Goog-Upload-Offset":`${status_.current}`},body=blob.slice(startByte,endByte);if(null===body)throw cannotSliceBlob();function handler(xhr,text){const uploadStatus=checkResumeHeader_(xhr,["active","final"]),newCurrent=status_.current+bytesToUpload,size=blob.size();let metadata;return metadata="final"===uploadStatus?metadataHandler(service,mappings)(xhr,text):null,new ResumableUploadStatus(newCurrent,size,"final"===uploadStatus,metadata)}__name(handler,"handler");const timeout=service.maxUploadRetryTime,requestInfo=new RequestInfo(url,"POST",handler,timeout);return requestInfo.headers=headers,requestInfo.body=body.uploadData(),requestInfo.progressCallback=progressCallback||null,requestInfo.errorHandler=sharedErrorHandler(location),requestInfo}__name(continueResumableUpload,"continueResumableUpload");const TaskEvent={STATE_CHANGED:"state_changed"},TaskState={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function taskStateFromInternalTaskState(state){switch(state){case"running":case"pausing":case"canceling":return TaskState.RUNNING;case"paused":return TaskState.PAUSED;case"success":return TaskState.SUCCESS;case"canceled":return TaskState.CANCELED;default:return TaskState.ERROR}}__name(taskStateFromInternalTaskState,"taskStateFromInternalTaskState");class Observer{constructor(nextOrObserver,error,complete){if(isFunction(nextOrObserver)||null!=error||null!=complete)this.next=nextOrObserver,this.error=null!=error?error:void 0,this.complete=null!=complete?complete:void 0;else{const observer=nextOrObserver;this.next=observer.next,this.error=observer.error,this.complete=observer.complete}}}function index_node_esm_async(f){return(...argsToForward)=>{Promise.resolve().then(()=>f(...argsToForward))}}__name(Observer,"Observer"),__name(index_node_esm_async,"index_node_esm_async");class FetchConnection{constructor(){this.errorText_="",this.sent_=!1,this.fetch_=lib.ZP,this.errorCode_=ErrorCode.NO_ERROR}send(url,method,body,headers){var _this=this;return(0,asyncToGenerator.Z)(function*(){var _a;if(_this.sent_)throw internalError("cannot .send() more than once");_this.sent_=!0;try{const response=yield _this.fetch_(url,{method,headers:headers||{},body});_this.headers_=response.headers,_this.statusCode_=response.status,_this.errorCode_=ErrorCode.NO_ERROR,_this.body_=yield response.arrayBuffer()}catch(e){_this.errorText_=null===(_a=e)||void 0===_a?void 0:_a.message,_this.statusCode_=0,_this.errorCode_=ErrorCode.NETWORK_ERROR}})()}getErrorCode(){if(void 0===this.errorCode_)throw internalError("cannot .getErrorCode() before receiving response");return this.errorCode_}getStatus(){if(void 0===this.statusCode_)throw internalError("cannot .getStatus() before receiving response");return this.statusCode_}getErrorText(){return this.errorText_}abort(){}getResponseHeader(header){if(!this.headers_)throw internalError("cannot .getResponseHeader() before receiving response");return this.headers_.get(header)}addUploadProgressListener(listener){}removeUploadProgressListener(listener){}}__name(FetchConnection,"FetchConnection");class FetchTextConnection extends FetchConnection{getResponse(){if(!this.body_)throw internalError("cannot .getResponse() before receiving response");return Buffer.from(this.body_).toString("utf-8")}}function newTextConnection(){return new FetchTextConnection}__name(FetchTextConnection,"FetchTextConnection"),__name(newTextConnection,"newTextConnection");class FetchBytesConnection extends(null){getResponse(){if(!this.body_)throw internalError("cannot .getResponse() before sending");return this.body_}}function newBytesConnection(){return new FetchBytesConnection}__name(FetchBytesConnection,"FetchBytesConnection"),__name(newBytesConnection,"newBytesConnection");class FetchStreamConnection extends(null){constructor(){super(...arguments),this.stream_=null}send(url,method,body,headers){var _this2=this;return _asyncToGenerator(function*(){var _a;if(_this2.sent_)throw internalError("cannot .send() more than once");_this2.sent_=!0;try{const response=yield _this2.fetch_(url,{method,headers:headers||{},body});_this2.headers_=response.headers,_this2.statusCode_=response.status,_this2.errorCode_=ErrorCode.NO_ERROR,_this2.stream_=response.body}catch(e){_this2.errorText_=null===(_a=e)||void 0===_a?void 0:_a.message,_this2.statusCode_=0,_this2.errorCode_=ErrorCode.NETWORK_ERROR}})()}getResponse(){if(!this.stream_)throw internalError("cannot .getResponse() before sending");return this.stream_}}function newStreamConnection(){return new FetchStreamConnection}__name(FetchStreamConnection,"FetchStreamConnection"),__name(newStreamConnection,"newStreamConnection");class UploadTask{constructor(ref2,blob,metadata=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=ref2,this._blob=blob,this._metadata=metadata,this._mappings=getMappings(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=error=>{this._request=void 0,this._chunkMultiplier=1,error._codeEquals("canceled")?(this._needToFetchStatus=!0,this.completeTransitions_()):(this._error=error,this._transition("error"))},this._metadataErrorHandler=error=>{this._request=void 0,error._codeEquals("canceled")?this.completeTransitions_():(this._error=error,this._transition("error"))},this._promise=new Promise((resolve,reject)=>{this._resolve=resolve,this._reject=reject,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){const sizeBefore=this._transferred;return loaded=>this._updateProgress(sizeBefore+loaded)}_shouldDoResumable(blob){return blob.size()>262144}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this._continueUpload():this._oneShotUpload())}_resolveToken(callback){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([authToken,appCheckToken])=>{switch(this._state){case"running":callback(authToken,appCheckToken);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((authToken,appCheckToken)=>{const requestInfo=createResumableUpload(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),createRequest=this._ref.storage._makeRequest(requestInfo,newTextConnection,authToken,appCheckToken);this._request=createRequest,createRequest.getPromise().then(url=>{this._request=void 0,this._uploadUrl=url,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const url=this._uploadUrl;this._resolveToken((authToken,appCheckToken)=>{const requestInfo=getResumableUploadStatus(this._ref.storage,this._ref._location,url,this._blob),statusRequest=this._ref.storage._makeRequest(requestInfo,newTextConnection,authToken,appCheckToken);this._request=statusRequest,statusRequest.getPromise().then(status=>{this._request=void 0,this._updateProgress(status.current),this._needToFetchStatus=!1,status.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const chunkSize=262144*this._chunkMultiplier,status=new ResumableUploadStatus(this._transferred,this._blob.size()),url=this._uploadUrl;this._resolveToken((authToken,appCheckToken)=>{let requestInfo;try{requestInfo=continueResumableUpload(this._ref._location,this._ref.storage,url,this._blob,chunkSize,this._mappings,status,this._makeProgressCallback())}catch(e){return this._error=e,void this._transition("error")}const uploadRequest=this._ref.storage._makeRequest(requestInfo,newTextConnection,authToken,appCheckToken);this._request=uploadRequest,uploadRequest.getPromise().then(newStatus=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(newStatus.current),newStatus.finalized?(this._metadata=newStatus.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){262144*this._chunkMultiplier<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((authToken,appCheckToken)=>{const requestInfo=getMetadata$2(this._ref.storage,this._ref._location,this._mappings),metadataRequest=this._ref.storage._makeRequest(requestInfo,newTextConnection,authToken,appCheckToken);this._request=metadataRequest,metadataRequest.getPromise().then(metadata=>{this._request=void 0,this._metadata=metadata,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((authToken,appCheckToken)=>{const requestInfo=multipartUpload(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),multipartRequest=this._ref.storage._makeRequest(requestInfo,newTextConnection,authToken,appCheckToken);this._request=multipartRequest,multipartRequest.getPromise().then(metadata=>{this._request=void 0,this._metadata=metadata,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(transferred){const old=this._transferred;this._transferred=transferred,this._transferred!==old&&this._notifyObservers()}_transition(state){if(this._state!==state)switch(state){case"canceling":case"pausing":this._state=state,void 0!==this._request&&this._request.cancel();break;case"running":const wasPaused="paused"===this._state;this._state=state,wasPaused&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=state,this._notifyObservers();break;case"canceled":this._error=canceled(),this._state=state,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){const externalState=taskStateFromInternalTaskState(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:externalState,metadata:this._metadata,task:this,ref:this._ref}}on(type,nextOrObserver,error,completed){const observer=new Observer(nextOrObserver||void 0,error||void 0,completed||void 0);return this._addObserver(observer),()=>{this._removeObserver(observer)}}then(onFulfilled,onRejected){return this._promise.then(onFulfilled,onRejected)}catch(onRejected){return this.then(null,onRejected)}_addObserver(observer){this._observers.push(observer),this._notifyObserver(observer)}_removeObserver(observer){const i=this._observers.indexOf(observer);-1!==i&&this._observers.splice(i,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEach(observer=>{this._notifyObserver(observer)})}_finishPromise(){if(void 0!==this._resolve){let triggered=!0;switch(taskStateFromInternalTaskState(this._state)){case TaskState.SUCCESS:index_node_esm_async(this._resolve.bind(null,this.snapshot))();break;case TaskState.CANCELED:case TaskState.ERROR:index_node_esm_async(this._reject.bind(null,this._error))();break;default:triggered=!1}triggered&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(observer){switch(taskStateFromInternalTaskState(this._state)){case TaskState.RUNNING:case TaskState.PAUSED:observer.next&&index_node_esm_async(observer.next.bind(observer,this.snapshot))();break;case TaskState.SUCCESS:observer.complete&&index_node_esm_async(observer.complete.bind(observer))();break;case TaskState.CANCELED:case TaskState.ERROR:default:observer.error&&index_node_esm_async(observer.error.bind(observer,this._error))()}}resume(){const valid="paused"===this._state||"pausing"===this._state;return valid&&this._transition("running"),valid}pause(){const valid="running"===this._state;return valid&&this._transition("pausing"),valid}cancel(){const valid="running"===this._state||"pausing"===this._state;return valid&&this._transition("canceling"),valid}}__name(UploadTask,"UploadTask");class Reference{constructor(_service,location){this._service=_service,this._location=location instanceof Location?location:Location.makeFromUrl(location,_service.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(service,location){return new Reference(service,location)}get root(){const location=new Location(this._location.bucket,"");return this._newRef(this._service,location)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return lastComponent(this._location.path)}get storage(){return this._service}get parent(){const newPath=index_node_esm_parent(this._location.path);if(null===newPath)return null;const location=new Location(this._location.bucket,newPath);return new Reference(this._service,location)}_throwIfRoot(name){if(""===this._location.path)throw invalidRootOperation(name)}}function getBytesInternal(ref2,maxDownloadSizeBytes){ref2._throwIfRoot("getBytes");const requestInfo=getBytes$1(ref2.storage,ref2._location,maxDownloadSizeBytes);return ref2.storage.makeRequestWithTokens(requestInfo,newBytesConnection).then(bytes=>void 0!==maxDownloadSizeBytes?bytes.slice(0,maxDownloadSizeBytes):bytes)}function getStreamInternal(ref2,maxDownloadSizeBytes){ref2._throwIfRoot("getStream");const requestInfo=getBytes$1(ref2.storage,ref2._location,maxDownloadSizeBytes),result=void 0!==maxDownloadSizeBytes?new Transform(__name(n=>{let missingBytes=n;return{transform(chunk,encoding,callback){chunk.lengthstream.pipe(result)).catch(e=>result.destroy(e)),result}function uploadBytes$1(ref2,data,metadata){ref2._throwIfRoot("uploadBytes");const requestInfo=multipartUpload(ref2.storage,ref2._location,getMappings(),new FbsBlob(data,!0),metadata);return ref2.storage.makeRequestWithTokens(requestInfo,newTextConnection).then(finalMetadata=>({metadata:finalMetadata,ref:ref2}))}function uploadBytesResumable$1(ref2,data,metadata){return ref2._throwIfRoot("uploadBytesResumable"),new UploadTask(ref2,new FbsBlob(data),metadata)}function uploadString$1(ref2,value,format=StringFormat.RAW,metadata){ref2._throwIfRoot("uploadString");const data=dataFromString(format,value),metadataClone=Object.assign({},metadata);return null==metadataClone.contentType&&null!=data.contentType&&(metadataClone.contentType=data.contentType),uploadBytes$1(ref2,data.data,metadataClone)}function listAll$1(ref2){const accumulator={prefixes:[],items:[]};return listAllHelper(ref2,accumulator).then(()=>accumulator)}function listAllHelper(_x,_x2,_x3){return _listAllHelper.apply(this,arguments)}function _listAllHelper(){return(_listAllHelper=(0,asyncToGenerator.Z)(function*(ref2,accumulator,pageToken){const nextPage=yield list$1(ref2,{pageToken});accumulator.prefixes.push(...nextPage.prefixes),accumulator.items.push(...nextPage.items),null!=nextPage.nextPageToken&&(yield listAllHelper(ref2,accumulator,nextPage.nextPageToken))})).apply(this,arguments)}function list$1(ref2,options){null!=options&&"number"==typeof options.maxResults&&validateNumber("options.maxResults",1,1e3,options.maxResults);const op=options||{},requestInfo=list$2(ref2.storage,ref2._location,"/",op.pageToken,op.maxResults);return ref2.storage.makeRequestWithTokens(requestInfo,newTextConnection)}function getMetadata$1(ref2){ref2._throwIfRoot("getMetadata");const requestInfo=getMetadata$2(ref2.storage,ref2._location,getMappings());return ref2.storage.makeRequestWithTokens(requestInfo,newTextConnection)}function updateMetadata$1(ref2,metadata){ref2._throwIfRoot("updateMetadata");const requestInfo=updateMetadata$2(ref2.storage,ref2._location,metadata,getMappings());return ref2.storage.makeRequestWithTokens(requestInfo,newTextConnection)}function getDownloadURL$1(ref2){ref2._throwIfRoot("getDownloadURL");const requestInfo=getDownloadUrl(ref2.storage,ref2._location,getMappings());return ref2.storage.makeRequestWithTokens(requestInfo,newTextConnection).then(url=>{if(null===url)throw noDownloadURL();return url})}function deleteObject$1(ref2){ref2._throwIfRoot("deleteObject");const requestInfo=deleteObject$2(ref2.storage,ref2._location);return ref2.storage.makeRequestWithTokens(requestInfo,newTextConnection)}function _getChild$1(ref2,childPath){const newPath=child(ref2._location.path,childPath),location=new Location(ref2._location.bucket,newPath);return new Reference(ref2.storage,location)}function isUrl(path){return/^[A-Za-z]+:\/\//.test(path)}function refFromURL(service,url){return new Reference(service,url)}function refFromPath(ref2,path){if(ref2 instanceof FirebaseStorageImpl){const service=ref2;if(null==service._bucket)throw noDefaultBucket();const reference=new Reference(service,service._bucket);return null!=path?refFromPath(reference,path):reference}return void 0!==path?_getChild$1(ref2,path):ref2}function ref$1(serviceOrRef,pathOrUrl){if(pathOrUrl&&isUrl(pathOrUrl)){if(serviceOrRef instanceof FirebaseStorageImpl)return refFromURL(serviceOrRef,pathOrUrl);throw invalidArgument("To use ref(service, url), the first argument must be a Storage instance.")}return refFromPath(serviceOrRef,pathOrUrl)}function extractBucket(host,config){const bucketString=null==config?void 0:config.storageBucket;return null==bucketString?null:Location.makeFromBucketSpec(bucketString,host)}function connectStorageEmulator$1(storage,host,port,options={}){storage.host=`${host}:${port}`,storage._protocol="http";const{mockUserToken}=options;mockUserToken&&(storage._overrideAuthToken="string"==typeof mockUserToken?mockUserToken:(0,index_node_esm.Sg)(mockUserToken,storage.app.options.projectId))}__name(Reference,"Reference"),__name(getBytesInternal,"getBytesInternal"),__name(getStreamInternal,"getStreamInternal"),__name(uploadBytes$1,"uploadBytes$1"),__name(uploadBytesResumable$1,"uploadBytesResumable$1"),__name(uploadString$1,"uploadString$1"),__name(listAll$1,"listAll$1"),__name(listAllHelper,"listAllHelper"),__name(_listAllHelper,"_listAllHelper"),__name(list$1,"list$1"),__name(getMetadata$1,"getMetadata$1"),__name(updateMetadata$1,"updateMetadata$1"),__name(getDownloadURL$1,"getDownloadURL$1"),__name(deleteObject$1,"deleteObject$1"),__name(_getChild$1,"_getChild$1"),__name(isUrl,"isUrl"),__name(refFromURL,"refFromURL"),__name(refFromPath,"refFromPath"),__name(ref$1,"ref$1"),__name(extractBucket,"extractBucket"),__name(connectStorageEmulator$1,"connectStorageEmulator$1");class FirebaseStorageImpl{constructor(app,_authProvider,_appCheckProvider,_url,_firebaseVersion){this.app=app,this._authProvider=_authProvider,this._appCheckProvider=_appCheckProvider,this._url=_url,this._firebaseVersion=_firebaseVersion,this._bucket=null,this._host="firebasestorage.googleapis.com",this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=_url?Location.makeFromBucketSpec(_url,this._host):extractBucket(this._host,this.app.options)}get host(){return this._host}set host(host){this._host=host,null!=this._url?this._bucket=Location.makeFromBucketSpec(this._url,host):this._bucket=extractBucket(host,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(time){validateNumber("time",0,Number.POSITIVE_INFINITY,time),this._maxUploadRetryTime=time}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(time){validateNumber("time",0,Number.POSITIVE_INFINITY,time),this._maxOperationRetryTime=time}_getAuthToken(){var _this3=this;return(0,asyncToGenerator.Z)(function*(){if(_this3._overrideAuthToken)return _this3._overrideAuthToken;const auth=_this3._authProvider.getImmediate({optional:!0});if(auth){const tokenData=yield auth.getToken();if(null!==tokenData)return tokenData.accessToken}return null})()}_getAppCheckToken(){var _this4=this;return(0,asyncToGenerator.Z)(function*(){const appCheck=_this4._appCheckProvider.getImmediate({optional:!0});return appCheck?(yield appCheck.getToken()).token:null})()}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(request=>request.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(loc){return new Reference(this,loc)}_makeRequest(requestInfo,requestFactory,authToken,appCheckToken){if(this._deleted)return new FailRequest(appDeleted());{const request=makeRequest(requestInfo,this._appId,authToken,appCheckToken,requestFactory,this._firebaseVersion);return this._requests.add(request),request.getPromise().then(()=>this._requests.delete(request),()=>this._requests.delete(request)),request}}makeRequestWithTokens(requestInfo,requestFactory){var _this5=this;return(0,asyncToGenerator.Z)(function*(){const[authToken,appCheckToken]=yield Promise.all([_this5._getAuthToken(),_this5._getAppCheckToken()]);return _this5._makeRequest(requestInfo,requestFactory,authToken,appCheckToken).getPromise()})()}}__name(FirebaseStorageImpl,"FirebaseStorageImpl");function uploadBytesResumable(ref2,data,metadata){return uploadBytesResumable$1(ref2=(0,index_node_esm.m9)(ref2),data,metadata)}function getMetadata(ref2){return getMetadata$1(ref2=(0,index_node_esm.m9)(ref2))}function updateMetadata(ref2,metadata){return updateMetadata$1(ref2=(0,index_node_esm.m9)(ref2),metadata)}function list(ref2,options){return list$1(ref2=(0,index_node_esm.m9)(ref2),options)}function listAll(ref2){return listAll$1(ref2=(0,index_node_esm.m9)(ref2))}function getDownloadURL(ref2){return getDownloadURL$1(ref2=(0,index_node_esm.m9)(ref2))}function deleteObject(ref2){return deleteObject$1(ref2=(0,index_node_esm.m9)(ref2))}function ref(serviceOrRef,pathOrUrl){return ref$1(serviceOrRef=(0,index_node_esm.m9)(serviceOrRef),pathOrUrl)}function _getChild(ref2,childPath){return _getChild$1(ref2,childPath)}function connectStorageEmulator(storage,host,port,options={}){connectStorageEmulator$1(storage,host,port,options)}function factory(container,{instanceIdentifier:url}){const app=container.getProvider("app").getImmediate(),authProvider=container.getProvider("auth-internal"),appCheckProvider=container.getProvider("app-check-internal");return new FirebaseStorageImpl(app,authProvider,appCheckProvider,url,esm_index_esm2017.SDK_VERSION)}function registerStorage(){(0,esm_index_esm2017._registerComponent)(new dist_esm_index_esm2017.wA("storage",factory,"PUBLIC").setMultipleInstances(!0)),(0,esm_index_esm2017.registerVersion)("@firebase/storage","0.9.8")}__name(function getBytes(ref2,maxDownloadSizeBytes){return getBytesInternal(ref2=getModularInstance(ref2),maxDownloadSizeBytes)},"getBytes"),__name(function uploadBytes(ref2,data,metadata){return uploadBytes$1(ref2=getModularInstance(ref2),data,metadata)},"uploadBytes"),__name(function uploadString(ref2,value,format,metadata){return uploadString$1(ref2=getModularInstance(ref2),value,format,metadata)},"uploadString"),__name(uploadBytesResumable,"uploadBytesResumable"),__name(getMetadata,"getMetadata"),__name(updateMetadata,"updateMetadata"),__name(list,"list"),__name(listAll,"listAll"),__name(getDownloadURL,"getDownloadURL"),__name(deleteObject,"deleteObject"),__name(ref,"ref"),__name(_getChild,"_getChild"),__name(function getStorage(app=getApp(),bucketUrl){return app=getModularInstance(app),_getProvider(app,"storage").getImmediate({identifier:bucketUrl})},"getStorage"),__name(connectStorageEmulator,"connectStorageEmulator"),__name(function getBlob(ref2,maxDownloadSizeBytes){throw new Error("getBlob() is only available in Browser-like environments")},"getBlob"),__name(function getStream(ref2,maxDownloadSizeBytes){return getStreamInternal(ref2=getModularInstance(ref2),maxDownloadSizeBytes)},"getStream"),__name(factory,"factory"),__name(registerStorage,"registerStorage"),registerStorage();class UploadTaskSnapshotCompat{constructor(_delegate,task,ref2){this._delegate=_delegate,this.task=task,this.ref=ref2}get bytesTransferred(){return this._delegate.bytesTransferred}get metadata(){return this._delegate.metadata}get state(){return this._delegate.state}get totalBytes(){return this._delegate.totalBytes}}__name(UploadTaskSnapshotCompat,"UploadTaskSnapshotCompat");class UploadTaskCompat{constructor(_delegate,_ref){this._delegate=_delegate,this._ref=_ref,this.cancel=this._delegate.cancel.bind(this._delegate),this.catch=this._delegate.catch.bind(this._delegate),this.pause=this._delegate.pause.bind(this._delegate),this.resume=this._delegate.resume.bind(this._delegate)}get snapshot(){return new UploadTaskSnapshotCompat(this._delegate.snapshot,this,this._ref)}then(onFulfilled,onRejected){return this._delegate.then(snapshot=>{if(onFulfilled)return onFulfilled(new UploadTaskSnapshotCompat(snapshot,this,this._ref))},onRejected)}on(type,nextOrObserver,error,completed){let wrappedNextOrObserver;return nextOrObserver&&(wrappedNextOrObserver="function"==typeof nextOrObserver?__name(taskSnapshot=>nextOrObserver(new UploadTaskSnapshotCompat(taskSnapshot,this,this._ref)),"wrappedNextOrObserver"):{next:nextOrObserver.next?taskSnapshot=>nextOrObserver.next(new UploadTaskSnapshotCompat(taskSnapshot,this,this._ref)):void 0,complete:nextOrObserver.complete||void 0,error:nextOrObserver.error||void 0}),this._delegate.on(type,wrappedNextOrObserver,error||void 0,completed||void 0)}}__name(UploadTaskCompat,"UploadTaskCompat");class ListResultCompat{constructor(_delegate,_service){this._delegate=_delegate,this._service=_service}get prefixes(){return this._delegate.prefixes.map(ref2=>new ReferenceCompat(ref2,this._service))}get items(){return this._delegate.items.map(ref2=>new ReferenceCompat(ref2,this._service))}get nextPageToken(){return this._delegate.nextPageToken||null}}__name(ListResultCompat,"ListResultCompat");class ReferenceCompat{constructor(_delegate,storage){this._delegate=_delegate,this.storage=storage}get name(){return this._delegate.name}get bucket(){return this._delegate.bucket}get fullPath(){return this._delegate.fullPath}toString(){return this._delegate.toString()}child(childPath){const reference=_getChild(this._delegate,childPath);return new ReferenceCompat(reference,this.storage)}get root(){return new ReferenceCompat(this._delegate.root,this.storage)}get parent(){const reference=this._delegate.parent;return null==reference?null:new ReferenceCompat(reference,this.storage)}put(data,metadata){return this._throwIfRoot("put"),new UploadTaskCompat(uploadBytesResumable(this._delegate,data,metadata),this)}putString(value,format=StringFormat.RAW,metadata){this._throwIfRoot("putString");const data=dataFromString(format,value),metadataClone=Object.assign({},metadata);return null==metadataClone.contentType&&null!=data.contentType&&(metadataClone.contentType=data.contentType),new UploadTaskCompat(new UploadTask(this._delegate,new FbsBlob(data.data,!0),metadataClone),this)}listAll(){return listAll(this._delegate).then(r=>new ListResultCompat(r,this.storage))}list(options){return list(this._delegate,options||void 0).then(r=>new ListResultCompat(r,this.storage))}getMetadata(){return getMetadata(this._delegate)}updateMetadata(metadata){return updateMetadata(this._delegate,metadata)}getDownloadURL(){return getDownloadURL(this._delegate)}delete(){return this._throwIfRoot("delete"),deleteObject(this._delegate)}_throwIfRoot(name){if(""===this._delegate._location.path)throw invalidRootOperation(name)}}__name(ReferenceCompat,"ReferenceCompat");class StorageServiceCompat{constructor(app,_delegate){this.app=app,this._delegate=_delegate}get maxOperationRetryTime(){return this._delegate.maxOperationRetryTime}get maxUploadRetryTime(){return this._delegate.maxUploadRetryTime}ref(path){if(index_esm2017_isUrl(path))throw invalidArgument("ref() expected a child path but got a URL, use refFromURL instead.");return new ReferenceCompat(ref(this._delegate,path),this)}refFromURL(url){if(!index_esm2017_isUrl(url))throw invalidArgument("refFromURL() expected a full URL but got a child path, use ref() instead.");try{Location.makeFromUrl(url,this._delegate.host)}catch{throw invalidArgument("refFromUrl() expected a valid full URL but got an invalid one.")}return new ReferenceCompat(ref(this._delegate,url),this)}setMaxUploadRetryTime(time){this._delegate.maxUploadRetryTime=time}setMaxOperationRetryTime(time){this._delegate.maxOperationRetryTime=time}useEmulator(host,port,options={}){connectStorageEmulator(this._delegate,host,port,options)}}function index_esm2017_isUrl(path){return/^[A-Za-z]+:\/\//.test(path)}__name(StorageServiceCompat,"StorageServiceCompat"),__name(index_esm2017_isUrl,"index_esm2017_isUrl");function index_esm2017_factory(container,{instanceIdentifier:url}){const app=container.getProvider("app-compat").getImmediate(),storageExp=container.getProvider("storage").getImmediate({identifier:url});return new StorageServiceCompat(app,storageExp)}function index_esm2017_registerStorage(instance){const namespaceExports={TaskState,TaskEvent,StringFormat,Storage:StorageServiceCompat,Reference:ReferenceCompat};instance.INTERNAL.registerComponent(new dist_esm_index_esm2017.wA("storage-compat",index_esm2017_factory,"PUBLIC").setServiceProps(namespaceExports).setMultipleInstances(!0)),instance.registerVersion("@firebase/storage-compat","0.1.16")}__name(index_esm2017_factory,"index_esm2017_factory"),__name(index_esm2017_registerStorage,"index_esm2017_registerStorage"),index_esm2017_registerStorage(index_esm2017.Z);var angular_fire_app_check=__webpack_require__(87589),platform_browser=__webpack_require__(22313),dist=__webpack_require__(59607);function fromTask(task){return new cjs.Observable(subscriber=>{const progress=__name(snap=>subscriber.next(snap),"progress"),error=__name(e=>subscriber.error(e),"error"),complete=__name(()=>subscriber.complete(),"complete");progress(task.snapshot);const unsub=task.on("state_changed",progress);return task.then(snapshot=>{progress(snapshot),complete()},e=>{progress(task.snapshot),error(e)}),__name(function(){unsub()},"unsubscribe")}).pipe((0,operators.bh)(0))}function createUploadTask(task){const inner$=fromTask(task);return{task,then:task.then.bind(task),catch:task.catch.bind(task),pause:task.pause.bind(task),cancel:task.cancel.bind(task),resume:task.resume.bind(task),snapshotChanges:()=>inner$,percentageChanges:()=>inner$.pipe((0,operators.UI)(s=>s.bytesTransferred/s.totalBytes*100))}}function createStorageRef(ref2){return{getDownloadURL:()=>(0,cjs.of)(void 0).pipe(angular_fire.fc,(0,operators.wt)(()=>ref2.getDownloadURL()),angular_fire.iC),getMetadata:()=>(0,cjs.of)(void 0).pipe(angular_fire.fc,(0,operators.wt)(()=>ref2.getMetadata()),angular_fire.iC),delete:()=>(0,cjs.from)(ref2.delete()),child:path=>createStorageRef(ref2.child(path)),updateMetadata:meta=>(0,cjs.from)(ref2.updateMetadata(meta)),put:(data,metadata)=>createUploadTask(ref2.put(data,metadata)),putString:(data,format,metadata)=>createUploadTask(ref2.putString(data,format,metadata)),list:options=>(0,cjs.from)(ref2.list(options)),listAll:()=>(0,cjs.from)(ref2.listAll())}}__name(fromTask,"fromTask"),__name(createUploadTask,"createUploadTask"),__name(createStorageRef,"createStorageRef");const BUCKET=new core.OlP("angularfire2.storageBucket"),MAX_UPLOAD_RETRY_TIME=new core.OlP("angularfire2.storage.maxUploadRetryTime"),MAX_OPERATION_RETRY_TIME=new core.OlP("angularfire2.storage.maxOperationRetryTime"),USE_EMULATOR=new core.OlP("angularfire2.storage.use-emulator");class AngularFireStorage{constructor(options,name,storageBucket,platformId,zone,schedulers,maxUploadRetryTime,maxOperationRetryTime,_useEmulator,_appCheckInstances){const app=(0,angular_fire_compat.on)(options,zone,name);this.storage=(0,angular_fire_compat.cc)(`${app.name}.storage.${storageBucket}`,"AngularFireStorage",app.name,()=>{const storage=zone.runOutsideAngular(()=>app.storage(storageBucket||void 0)),useEmulator=_useEmulator;return useEmulator&&storage.useEmulator(...useEmulator),maxUploadRetryTime&&storage.setMaxUploadRetryTime(maxUploadRetryTime),maxOperationRetryTime&&storage.setMaxOperationRetryTime(maxOperationRetryTime),storage},[maxUploadRetryTime,maxOperationRetryTime])}ref(path){return createStorageRef(this.storage.ref(path))}refFromURL(path){return createStorageRef(this.storage.refFromURL(path))}upload(path,data,metadata){return createStorageRef(this.storage.ref(path)).put(data,metadata)}}__name(AngularFireStorage,"AngularFireStorage"),AngularFireStorage.\u0275fac=__name(function(t){return new(t||AngularFireStorage)(core.LFG(angular_fire_compat.Dh),core.LFG(angular_fire_compat.xv,8),core.LFG(BUCKET,8),core.LFG(core.Lbi),core.LFG(core.R0b),core.LFG(angular_fire.HU),core.LFG(MAX_UPLOAD_RETRY_TIME,8),core.LFG(MAX_OPERATION_RETRY_TIME,8),core.LFG(USE_EMULATOR,8),core.LFG(angular_fire_app_check.nm,8))},"AngularFireStorage_Factory"),AngularFireStorage.\u0275prov=core.Yz7({token:AngularFireStorage,factory:AngularFireStorage.\u0275fac,providedIn:"any"});class GetDownloadURLPipe{constructor(storage,cdr,state){this.storage=storage,this.state=state,this.asyncPipe=new common.Ov(cdr)}transform(path){var _a;if(path!==this.path){this.path=path;const key=(0,platform_browser.Cb)(`|getDownloadURL|${path}`),existing=null===(_a=this.state)||void 0===_a?void 0:_a.get(key,void 0);this.downloadUrl$=existing?(0,cjs.of)(existing):this.storage.ref(path).getDownloadURL().pipe((0,operators.bw)(it=>{var _a2;return null===(_a2=this.state)||void 0===_a2?void 0:_a2.set(key,it)}))}return this.asyncPipe.transform(this.downloadUrl$)}ngOnDestroy(){this.asyncPipe.ngOnDestroy()}}__name(GetDownloadURLPipe,"GetDownloadURLPipe"),GetDownloadURLPipe.\u0275fac=__name(function(t){return new(t||GetDownloadURLPipe)(core.Y36(AngularFireStorage,16),core.Y36(core.sBO,16),core.Y36(platform_browser.ki,24))},"GetDownloadURLPipe_Factory"),GetDownloadURLPipe.\u0275pipe=core.Yjl({name:"getDownloadURL",type:GetDownloadURLPipe,pure:!1});class GetDownloadURLPipeModule{}__name(GetDownloadURLPipeModule,"GetDownloadURLPipeModule"),GetDownloadURLPipeModule.\u0275fac=__name(function(t){return new(t||GetDownloadURLPipeModule)},"GetDownloadURLPipeModule_Factory"),GetDownloadURLPipeModule.\u0275mod=core.oAB({type:GetDownloadURLPipeModule}),GetDownloadURLPipeModule.\u0275inj=core.cJS({});class AngularFireStorageModule{constructor(){dist.Z.registerVersion("angularfire",angular_fire.q4.full,"gcs-compat")}}__name(AngularFireStorageModule,"AngularFireStorageModule"),AngularFireStorageModule.\u0275fac=__name(function(t){return new(t||AngularFireStorageModule)},"AngularFireStorageModule_Factory"),AngularFireStorageModule.\u0275mod=core.oAB({type:AngularFireStorageModule}),AngularFireStorageModule.\u0275inj=core.cJS({providers:[AngularFireStorage],imports:[GetDownloadURLPipeModule]});var edit_profile_component=__webpack_require__(42824),tslib_es6=__webpack_require__(70655);const _c0=["wrapper"],_c1=["sourceImage"];function ImageCropperComponent_img_2_Template(rf,ctx){if(1&rf){const _r5=core.EpF();core.TgZ(0,"img",4,5),core.NdJ("load",__name(function(){core.CHM(_r5);const ctx_r4=core.oxw();return core.KtG(ctx_r4.imageLoadedInView())},"ImageCropperComponent_img_2_Template_img_load_0_listener"))("mousedown",__name(function($event){core.CHM(_r5);const ctx_r6=core.oxw();return core.KtG(ctx_r6.startMove($event,ctx_r6.moveTypes.Drag))},"ImageCropperComponent_img_2_Template_img_mousedown_0_listener"))("touchstart",__name(function($event){core.CHM(_r5);const ctx_r7=core.oxw();return core.KtG(ctx_r7.startMove($event,ctx_r7.moveTypes.Drag))},"ImageCropperComponent_img_2_Template_img_touchstart_0_listener")),core.qZA()}if(2&rf){const ctx_r1=core.oxw();core.Udp("visibility",ctx_r1.imageVisible?"visible":"hidden")("transform",ctx_r1.safeTransformStyle),core.ekj("ngx-ic-draggable",!ctx_r1.disabled&&ctx_r1.allowMoveImage),core.Q6J("src",ctx_r1.safeImgDataUrl,core.LSH)}}function ImageCropperComponent_div_4_ng_container_2_Template(rf,ctx){if(1&rf){const _r10=core.EpF();core.ynx(0),core.TgZ(1,"span",9),core.NdJ("mousedown",__name(function($event){core.CHM(_r10);const ctx_r9=core.oxw(2);return core.KtG(ctx_r9.startMove($event,ctx_r9.moveTypes.Resize,"topleft"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_mousedown_1_listener"))("touchstart",__name(function($event){core.CHM(_r10);const ctx_r11=core.oxw(2);return core.KtG(ctx_r11.startMove($event,ctx_r11.moveTypes.Resize,"topleft"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_touchstart_1_listener")),core._UZ(2,"span",10),core.qZA(),core.TgZ(3,"span",11),core._UZ(4,"span",10),core.qZA(),core.TgZ(5,"span",12),core.NdJ("mousedown",__name(function($event){core.CHM(_r10);const ctx_r12=core.oxw(2);return core.KtG(ctx_r12.startMove($event,ctx_r12.moveTypes.Resize,"topright"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_mousedown_5_listener"))("touchstart",__name(function($event){core.CHM(_r10);const ctx_r13=core.oxw(2);return core.KtG(ctx_r13.startMove($event,ctx_r13.moveTypes.Resize,"topright"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_touchstart_5_listener")),core._UZ(6,"span",10),core.qZA(),core.TgZ(7,"span",13),core._UZ(8,"span",10),core.qZA(),core.TgZ(9,"span",14),core.NdJ("mousedown",__name(function($event){core.CHM(_r10);const ctx_r14=core.oxw(2);return core.KtG(ctx_r14.startMove($event,ctx_r14.moveTypes.Resize,"bottomright"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_mousedown_9_listener"))("touchstart",__name(function($event){core.CHM(_r10);const ctx_r15=core.oxw(2);return core.KtG(ctx_r15.startMove($event,ctx_r15.moveTypes.Resize,"bottomright"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_touchstart_9_listener")),core._UZ(10,"span",10),core.qZA(),core.TgZ(11,"span",15),core._UZ(12,"span",10),core.qZA(),core.TgZ(13,"span",16),core.NdJ("mousedown",__name(function($event){core.CHM(_r10);const ctx_r16=core.oxw(2);return core.KtG(ctx_r16.startMove($event,ctx_r16.moveTypes.Resize,"bottomleft"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_mousedown_13_listener"))("touchstart",__name(function($event){core.CHM(_r10);const ctx_r17=core.oxw(2);return core.KtG(ctx_r17.startMove($event,ctx_r17.moveTypes.Resize,"bottomleft"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_touchstart_13_listener")),core._UZ(14,"span",10),core.qZA(),core.TgZ(15,"span",17),core._UZ(16,"span",10),core.qZA(),core.TgZ(17,"span",18),core.NdJ("mousedown",__name(function($event){core.CHM(_r10);const ctx_r18=core.oxw(2);return core.KtG(ctx_r18.startMove($event,ctx_r18.moveTypes.Resize,"top"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_mousedown_17_listener"))("touchstart",__name(function($event){core.CHM(_r10);const ctx_r19=core.oxw(2);return core.KtG(ctx_r19.startMove($event,ctx_r19.moveTypes.Resize,"top"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_touchstart_17_listener")),core.qZA(),core.TgZ(18,"span",19),core.NdJ("mousedown",__name(function($event){core.CHM(_r10);const ctx_r20=core.oxw(2);return core.KtG(ctx_r20.startMove($event,ctx_r20.moveTypes.Resize,"right"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_mousedown_18_listener"))("touchstart",__name(function($event){core.CHM(_r10);const ctx_r21=core.oxw(2);return core.KtG(ctx_r21.startMove($event,ctx_r21.moveTypes.Resize,"right"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_touchstart_18_listener")),core.qZA(),core.TgZ(19,"span",20),core.NdJ("mousedown",__name(function($event){core.CHM(_r10);const ctx_r22=core.oxw(2);return core.KtG(ctx_r22.startMove($event,ctx_r22.moveTypes.Resize,"bottom"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_mousedown_19_listener"))("touchstart",__name(function($event){core.CHM(_r10);const ctx_r23=core.oxw(2);return core.KtG(ctx_r23.startMove($event,ctx_r23.moveTypes.Resize,"bottom"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_touchstart_19_listener")),core.qZA(),core.TgZ(20,"span",21),core.NdJ("mousedown",__name(function($event){core.CHM(_r10);const ctx_r24=core.oxw(2);return core.KtG(ctx_r24.startMove($event,ctx_r24.moveTypes.Resize,"left"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_mousedown_20_listener"))("touchstart",__name(function($event){core.CHM(_r10);const ctx_r25=core.oxw(2);return core.KtG(ctx_r25.startMove($event,ctx_r25.moveTypes.Resize,"left"))},"ImageCropperComponent_div_4_ng_container_2_Template_span_touchstart_20_listener")),core.qZA(),core.BQk()}}function ImageCropperComponent_div_4_Template(rf,ctx){if(1&rf){const _r27=core.EpF();core.TgZ(0,"div",6),core.NdJ("keydown",__name(function($event){core.CHM(_r27);const ctx_r26=core.oxw();return core.KtG(ctx_r26.keyboardAccess($event))},"ImageCropperComponent_div_4_Template_div_keydown_0_listener")),core.TgZ(1,"div",7),core.NdJ("mousedown",__name(function($event){core.CHM(_r27);const ctx_r28=core.oxw();return core.KtG(ctx_r28.startMove($event,ctx_r28.moveTypes.Move))},"ImageCropperComponent_div_4_Template_div_mousedown_1_listener"))("touchstart",__name(function($event){core.CHM(_r27);const ctx_r29=core.oxw();return core.KtG(ctx_r29.startMove($event,ctx_r29.moveTypes.Move))},"ImageCropperComponent_div_4_Template_div_touchstart_1_listener")),core.qZA(),core.YNc(2,ImageCropperComponent_div_4_ng_container_2_Template,21,0,"ng-container",8),core.qZA()}if(2&rf){const ctx_r2=core.oxw();core.Udp("top",ctx_r2.cropper.y1,"px")("left",ctx_r2.cropper.x1,"px")("width",ctx_r2.cropper.x2-ctx_r2.cropper.x1,"px")("height",ctx_r2.cropper.y2-ctx_r2.cropper.y1,"px")("margin-left","center"===ctx_r2.alignImage?ctx_r2.marginLeft:null)("visibility",ctx_r2.imageVisible?"visible":"hidden"),core.ekj("ngx-ic-round",ctx_r2.roundCropper),core.xp6(2),core.Q6J("ngIf",!ctx_r2.hideResizeSquares)}}__name(ImageCropperComponent_img_2_Template,"ImageCropperComponent_img_2_Template"),__name(ImageCropperComponent_div_4_ng_container_2_Template,"ImageCropperComponent_div_4_ng_container_2_Template"),__name(ImageCropperComponent_div_4_Template,"ImageCropperComponent_div_4_Template");class CropperSettings{constructor(){this.format="png",this.maintainAspectRatio=!0,this.transform={},this.aspectRatio=1,this.resizeToWidth=0,this.resizeToHeight=0,this.cropperMinWidth=0,this.cropperMinHeight=0,this.cropperMaxHeight=0,this.cropperMaxWidth=0,this.cropperStaticWidth=0,this.cropperStaticHeight=0,this.canvasRotation=0,this.initialStepSize=3,this.roundCropper=!1,this.onlyScaleDown=!1,this.imageQuality=92,this.autoCrop=!0,this.backgroundColor=null,this.containWithinAspectRatio=!1,this.hideResizeSquares=!1,this.alignImage="center",this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20,this.cropperScaledMaxWidth=20,this.cropperScaledMaxHeight=20,this.stepSize=this.initialStepSize}setOptions(options){Object.keys(options).filter(k=>k in this).forEach(k=>this[k]=options[k]),this.validateOptions()}setOptionsFromChanges(changes){Object.keys(changes).filter(k=>k in this).forEach(k=>this[k]=changes[k].currentValue),this.validateOptions()}validateOptions(){if(this.maintainAspectRatio&&!this.aspectRatio)throw new Error("`aspectRatio` should > 0 when `maintainAspectRatio` is enabled")}}var MoveTypes,MoveTypes2;function getPositionForKey(key){switch(key){case"ArrowUp":return"top";case"ArrowRight":return"right";case"ArrowDown":return"bottom";default:return"left"}}function getInvertedPositionForKey(key){switch(key){case"ArrowUp":return"bottom";case"ArrowRight":return"left";case"ArrowDown":return"top";default:return"right"}}function getEventForKey(key,stepSize){switch(key){case"ArrowUp":return{clientX:0,clientY:-1*stepSize};case"ArrowRight":return{clientX:stepSize,clientY:0};case"ArrowDown":return{clientX:0,clientY:stepSize};default:return{clientX:-1*stepSize,clientY:0}}}function resizeCanvas(canvas,width,height){const width_source=canvas.width,height_source=canvas.height,ratio_w=width_source/(width=Math.round(width)),ratio_h=height_source/(height=Math.round(height)),ratio_w_half=Math.ceil(ratio_w/2),ratio_h_half=Math.ceil(ratio_h/2),ctx=canvas.getContext("2d");if(ctx){const img=ctx.getImageData(0,0,width_source,height_source),img2=ctx.createImageData(width,height),data=img.data,data2=img2.data;for(let j=0;j=1)continue;weight=2*w*w*w-3*w*w+1;const pos_x=4*(xx+yy*width_source);gx_a+=weight*data[pos_x+3],weights_alpha+=weight,data[pos_x+3]<255&&(weight=weight*data[pos_x+3]/250),gx_r+=weight*data[pos_x],gx_g+=weight*data[pos_x+1],gx_b+=weight*data[pos_x+2],weights+=weight}}data2[x2]=gx_r/weights,data2[x2+1]=gx_g/weights,data2[x2+2]=gx_b/weights,data2[x2+3]=gx_a/weights_alpha}canvas.width=width,canvas.height=height,ctx.putImageData(img2,0,0)}}function percentage(percent,totalValue){return percent/100*totalValue}__name(CropperSettings,"CropperSettings"),(MoveTypes2=MoveTypes||(MoveTypes={})).Drag="drag",MoveTypes2.Move="move",MoveTypes2.Resize="resize",MoveTypes2.Pinch="pinch",__name(getPositionForKey,"getPositionForKey"),__name(getInvertedPositionForKey,"getInvertedPositionForKey"),__name(getEventForKey,"getEventForKey"),__name(resizeCanvas,"resizeCanvas"),__name(percentage,"percentage");class CropService{crop(sourceImage,loadedImage,cropper,settings){const imagePosition=this.getImagePosition(sourceImage,loadedImage,cropper,settings),width=imagePosition.x2-imagePosition.x1,height=imagePosition.y2-imagePosition.y1,cropCanvas=document.createElement("canvas");cropCanvas.width=width,cropCanvas.height=height;const ctx=cropCanvas.getContext("2d");if(!ctx)return null;null!=settings.backgroundColor&&(ctx.fillStyle=settings.backgroundColor,ctx.fillRect(0,0,width,height));const scaleX=(settings.transform.scale||1)*(settings.transform.flipH?-1:1),scaleY=(settings.transform.scale||1)*(settings.transform.flipV?-1:1),transformedImage=loadedImage.transformed;ctx.setTransform(scaleX,0,0,scaleY,transformedImage.size.width/2,transformedImage.size.height/2),ctx.translate(-imagePosition.x1/scaleX,-imagePosition.y1/scaleY),ctx.rotate((settings.transform.rotate||0)*Math.PI/180);const translateH=settings.transform.translateH?percentage(settings.transform.translateH,transformedImage.size.width):0,translateV=settings.transform.translateV?percentage(settings.transform.translateV,transformedImage.size.height):0;ctx.drawImage(transformedImage.image,translateH-transformedImage.size.width/2,translateV-transformedImage.size.height/2);const output={width,height,imagePosition,cropperPosition:Object.assign({},cropper)};settings.containWithinAspectRatio&&(output.offsetImagePosition=this.getOffsetImagePosition(sourceImage,loadedImage,cropper,settings));const resizeRatio=this.getResizeRatio(width,height,settings);return 1!==resizeRatio&&(output.width=Math.round(width*resizeRatio),output.height=settings.maintainAspectRatio?Math.round(output.width/settings.aspectRatio):Math.round(height*resizeRatio),resizeCanvas(cropCanvas,output.width,output.height)),output.base64=cropCanvas.toDataURL("image/"+settings.format,this.getQuality(settings)),output}getImagePosition(sourceImage,loadedImage,cropper,settings){const sourceImageElement=sourceImage.nativeElement,ratio=loadedImage.transformed.size.width/sourceImageElement.offsetWidth,out={x1:Math.round(cropper.x1*ratio),y1:Math.round(cropper.y1*ratio),x2:Math.round(cropper.x2*ratio),y2:Math.round(cropper.y2*ratio)};return settings.containWithinAspectRatio||(out.x1=Math.max(out.x1,0),out.y1=Math.max(out.y1,0),out.x2=Math.min(out.x2,loadedImage.transformed.size.width),out.y2=Math.min(out.y2,loadedImage.transformed.size.height)),out}getOffsetImagePosition(sourceImage,loadedImage,cropper,settings){const canvasRotation=settings.canvasRotation+loadedImage.exifTransform.rotate,sourceImageElement=sourceImage.nativeElement,ratio=loadedImage.transformed.size.width/sourceImageElement.offsetWidth;let offsetX,offsetY;canvasRotation%2?(offsetX=(loadedImage.transformed.size.width-loadedImage.original.size.height)/2,offsetY=(loadedImage.transformed.size.height-loadedImage.original.size.width)/2):(offsetX=(loadedImage.transformed.size.width-loadedImage.original.size.width)/2,offsetY=(loadedImage.transformed.size.height-loadedImage.original.size.height)/2);const out={x1:Math.round(cropper.x1*ratio)-offsetX,y1:Math.round(cropper.y1*ratio)-offsetY,x2:Math.round(cropper.x2*ratio)-offsetX,y2:Math.round(cropper.y2*ratio)-offsetY};return settings.containWithinAspectRatio||(out.x1=Math.max(out.x1,0),out.y1=Math.max(out.y1,0),out.x2=Math.min(out.x2,loadedImage.transformed.size.width),out.y2=Math.min(out.y2,loadedImage.transformed.size.height)),out}getResizeRatio(width,height,settings){const ratioWidth=settings.resizeToWidth/width,ratioHeight=settings.resizeToHeight/height,ratios=new Array;settings.resizeToWidth>0&&ratios.push(ratioWidth),settings.resizeToHeight>0&&ratios.push(ratioHeight);const result=0===ratios.length?1:Math.min(...ratios);return result>1&&!settings.onlyScaleDown?result:Math.min(result,1)}getQuality(settings){return Math.min(1,Math.max(0,settings.imageQuality/100))}}__name(CropService,"CropService"),CropService.\u0275fac=__name(function(t){return new(t||CropService)},"CropService_Factory"),CropService.\u0275prov=core.Yz7({token:CropService,factory:CropService.\u0275fac,providedIn:"root"});class CropperPositionService{resetCropperPosition(sourceImage,cropperPosition,settings){if(null==sourceImage||!sourceImage.nativeElement)return;const sourceImageElement=sourceImage.nativeElement;if(settings.cropperStaticHeight&&settings.cropperStaticWidth)cropperPosition.x1=0,cropperPosition.x2=sourceImageElement.offsetWidth>settings.cropperStaticWidth?settings.cropperStaticWidth:sourceImageElement.offsetWidth,cropperPosition.y1=0,cropperPosition.y2=sourceImageElement.offsetHeight>settings.cropperStaticHeight?settings.cropperStaticHeight:sourceImageElement.offsetHeight;else{const cropperWidth=Math.min(settings.cropperScaledMaxWidth,sourceImageElement.offsetWidth),cropperHeight=Math.min(settings.cropperScaledMaxHeight,sourceImageElement.offsetHeight);if(settings.maintainAspectRatio)if(sourceImageElement.offsetWidth/settings.aspectRatiomaxSize.width&&(cropperPosition.x1-=cropperPosition.x2-maxSize.width,cropperPosition.x2=maxSize.width),cropperPosition.y1<0?(cropperPosition.y2-=cropperPosition.y1,cropperPosition.y1=0):cropperPosition.y2>maxSize.height&&(cropperPosition.y1-=cropperPosition.y2-maxSize.height,cropperPosition.y2=maxSize.height)}settings.maintainAspectRatio&&this.checkAspectRatio(moveStart.position,cropperPosition,maxSize,settings)}checkAspectRatio(position,cropperPosition,maxSize,settings){let overflowX=0,overflowY=0;switch(position){case"top":cropperPosition.x2=cropperPosition.x1+(cropperPosition.y2-cropperPosition.y1)*settings.aspectRatio,overflowX=Math.max(cropperPosition.x2-maxSize.width,0),overflowY=Math.max(0-cropperPosition.y1,0),(overflowX>0||overflowY>0)&&(cropperPosition.x2-=overflowY*settings.aspectRatio>overflowX?overflowY*settings.aspectRatio:overflowX,cropperPosition.y1+=overflowY*settings.aspectRatio>overflowX?overflowY:overflowX/settings.aspectRatio);break;case"bottom":cropperPosition.x2=cropperPosition.x1+(cropperPosition.y2-cropperPosition.y1)*settings.aspectRatio,overflowX=Math.max(cropperPosition.x2-maxSize.width,0),overflowY=Math.max(cropperPosition.y2-maxSize.height,0),(overflowX>0||overflowY>0)&&(cropperPosition.x2-=overflowY*settings.aspectRatio>overflowX?overflowY*settings.aspectRatio:overflowX,cropperPosition.y2-=overflowY*settings.aspectRatio>overflowX?overflowY:overflowX/settings.aspectRatio);break;case"topleft":cropperPosition.y1=cropperPosition.y2-(cropperPosition.x2-cropperPosition.x1)/settings.aspectRatio,overflowX=Math.max(0-cropperPosition.x1,0),overflowY=Math.max(0-cropperPosition.y1,0),(overflowX>0||overflowY>0)&&(cropperPosition.x1+=overflowY*settings.aspectRatio>overflowX?overflowY*settings.aspectRatio:overflowX,cropperPosition.y1+=overflowY*settings.aspectRatio>overflowX?overflowY:overflowX/settings.aspectRatio);break;case"topright":cropperPosition.y1=cropperPosition.y2-(cropperPosition.x2-cropperPosition.x1)/settings.aspectRatio,overflowX=Math.max(cropperPosition.x2-maxSize.width,0),overflowY=Math.max(0-cropperPosition.y1,0),(overflowX>0||overflowY>0)&&(cropperPosition.x2-=overflowY*settings.aspectRatio>overflowX?overflowY*settings.aspectRatio:overflowX,cropperPosition.y1+=overflowY*settings.aspectRatio>overflowX?overflowY:overflowX/settings.aspectRatio);break;case"right":case"bottomright":cropperPosition.y2=cropperPosition.y1+(cropperPosition.x2-cropperPosition.x1)/settings.aspectRatio,overflowX=Math.max(cropperPosition.x2-maxSize.width,0),overflowY=Math.max(cropperPosition.y2-maxSize.height,0),(overflowX>0||overflowY>0)&&(cropperPosition.x2-=overflowY*settings.aspectRatio>overflowX?overflowY*settings.aspectRatio:overflowX,cropperPosition.y2-=overflowY*settings.aspectRatio>overflowX?overflowY:overflowX/settings.aspectRatio);break;case"left":case"bottomleft":cropperPosition.y2=cropperPosition.y1+(cropperPosition.x2-cropperPosition.x1)/settings.aspectRatio,overflowX=Math.max(0-cropperPosition.x1,0),overflowY=Math.max(cropperPosition.y2-maxSize.height,0),(overflowX>0||overflowY>0)&&(cropperPosition.x1+=overflowY*settings.aspectRatio>overflowX?overflowY*settings.aspectRatio:overflowX,cropperPosition.y2-=overflowY*settings.aspectRatio>overflowX?overflowY:overflowX/settings.aspectRatio);break;case"center":cropperPosition.x2=cropperPosition.x1+(cropperPosition.y2-cropperPosition.y1)*settings.aspectRatio,cropperPosition.y2=cropperPosition.y1+(cropperPosition.x2-cropperPosition.x1)/settings.aspectRatio;const overflowX1=Math.max(0-cropperPosition.x1,0),overflowX2=Math.max(cropperPosition.x2-maxSize.width,0),overflowY1=Math.max(cropperPosition.y2-maxSize.height,0),overflowY2=Math.max(0-cropperPosition.y1,0);(overflowX1>0||overflowX2>0||overflowY1>0||overflowY2>0)&&(cropperPosition.x1+=overflowY1*settings.aspectRatio>overflowX1?overflowY1*settings.aspectRatio:overflowX1,cropperPosition.x2-=overflowY2*settings.aspectRatio>overflowX2?overflowY2*settings.aspectRatio:overflowX2,cropperPosition.y1+=overflowY2*settings.aspectRatio>overflowX2?overflowY2:overflowX2/settings.aspectRatio,cropperPosition.y2-=overflowY1*settings.aspectRatio>overflowX1?overflowY1:overflowX1/settings.aspectRatio)}}getClientX(event){var _a;return(null===(_a=event.touches)||void 0===_a?void 0:_a[0].clientX)||event.clientX||0}getClientY(event){var _a;return(null===(_a=event.touches)||void 0===_a?void 0:_a[0].clientY)||event.clientY||0}}__name(CropperPositionService,"CropperPositionService"),CropperPositionService.\u0275fac=__name(function(t){return new(t||CropperPositionService)},"CropperPositionService_Factory"),CropperPositionService.\u0275prov=core.Yz7({token:CropperPositionService,factory:CropperPositionService.\u0275fac,providedIn:"root"});function supportsAutomaticRotation(){return new Promise(resolve=>{const img=new Image;img.onload=()=>{const supported=1===img.width&&2===img.height;resolve(supported)},img.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q=="})}function getTransformationsFromExifData(exifRotationOrBase64Image){switch("string"==typeof exifRotationOrBase64Image&&(exifRotationOrBase64Image=getExifRotation(exifRotationOrBase64Image)),exifRotationOrBase64Image){case 2:return{rotate:0,flip:!0};case 3:return{rotate:2,flip:!1};case 4:return{rotate:2,flip:!0};case 5:return{rotate:1,flip:!0};case 6:return{rotate:1,flip:!1};case 7:return{rotate:3,flip:!0};case 8:return{rotate:3,flip:!1};default:return{rotate:0,flip:!1}}}function getExifRotation(imageBase64){const view=new DataView(base64ToArrayBuffer(imageBase64));if(65496!==view.getUint16(0,!1))return-2;const length=view.byteLength;let offset=2;for(;offset{const fileReader=new FileReader;fileReader.onload=event=>{this.loadImage(event.target.result,file.type,cropperSettings).then(resolve).catch(reject)},fileReader.readAsDataURL(file)})}loadImage(imageBase64,imageType,cropperSettings){return this.isValidImageType(imageType)?this.loadBase64Image(imageBase64,cropperSettings):Promise.reject(new Error("Invalid image type"))}isValidImageType(type){return/image\/(png|jpg|jpeg|bmp|gif|tiff|webp|x-icon|vnd.microsoft.icon)/.test(type)}loadImageFromURL(url,cropperSettings){return new Promise((resolve,reject)=>{const img=new Image;img.onerror=()=>reject,img.onload=()=>{const canvas=document.createElement("canvas"),context=canvas.getContext("2d");canvas.width=img.width,canvas.height=img.height,null==context||context.drawImage(img,0,0),this.loadBase64Image(canvas.toDataURL(),cropperSettings).then(resolve)},img.crossOrigin="anonymous",img.src=url})}loadBase64Image(imageBase64,cropperSettings){return new Promise((resolve,reject)=>{const originalImage=new Image;originalImage.onload=()=>resolve({originalImage,originalBase64:imageBase64}),originalImage.onerror=reject,originalImage.src=imageBase64}).then(res=>this.transformImageBase64(res,cropperSettings))}transformImageBase64(res,cropperSettings){return(0,tslib_es6.__awaiter)(this,void 0,void 0,function*(){const autoRotate=yield this.autoRotateSupported,exifTransform=yield getTransformationsFromExifData(autoRotate?-1:res.originalBase64);if(!res.originalImage||!res.originalImage.complete)return Promise.reject(new Error("No image loaded"));const loadedImage={original:{base64:res.originalBase64,image:res.originalImage,size:{width:res.originalImage.naturalWidth,height:res.originalImage.naturalHeight}},exifTransform};return this.transformLoadedImage(loadedImage,cropperSettings)})}transformLoadedImage(loadedImage,cropperSettings){return(0,tslib_es6.__awaiter)(this,void 0,void 0,function*(){const canvasRotation=cropperSettings.canvasRotation+loadedImage.exifTransform.rotate,originalSize={width:loadedImage.original.image.naturalWidth,height:loadedImage.original.image.naturalHeight};if(0===canvasRotation&&!loadedImage.exifTransform.flip&&!cropperSettings.containWithinAspectRatio)return{original:{base64:loadedImage.original.base64,image:loadedImage.original.image,size:Object.assign({},originalSize)},transformed:{base64:loadedImage.original.base64,image:loadedImage.original.image,size:Object.assign({},originalSize)},exifTransform:loadedImage.exifTransform};const transformedSize=this.getTransformedSize(originalSize,loadedImage.exifTransform,cropperSettings),canvas=document.createElement("canvas");canvas.width=transformedSize.width,canvas.height=transformedSize.height;const ctx=canvas.getContext("2d");null==ctx||ctx.setTransform(loadedImage.exifTransform.flip?-1:1,0,0,1,canvas.width/2,canvas.height/2),null==ctx||ctx.rotate(Math.PI*(canvasRotation/2)),null==ctx||ctx.drawImage(loadedImage.original.image,-originalSize.width/2,-originalSize.height/2);const transformedBase64=canvas.toDataURL(),transformedImage=yield this.loadImageFromBase64(transformedBase64);return{original:{base64:loadedImage.original.base64,image:loadedImage.original.image,size:Object.assign({},originalSize)},transformed:{base64:transformedBase64,image:transformedImage,size:{width:transformedImage.width,height:transformedImage.height}},exifTransform:loadedImage.exifTransform}})}loadImageFromBase64(imageBase64){return new Promise((resolve,reject)=>{const image=new Image;image.onload=()=>resolve(image),image.onerror=reject,image.src=imageBase64})}getTransformedSize(originalSize,exifTransform,cropperSettings){const canvasRotation=cropperSettings.canvasRotation+exifTransform.rotate;if(cropperSettings.containWithinAspectRatio){if(canvasRotation%2){const minWidthToContain=originalSize.width*cropperSettings.aspectRatio,minHeightToContain=originalSize.height/cropperSettings.aspectRatio;return{width:Math.max(originalSize.height,minWidthToContain),height:Math.max(originalSize.width,minHeightToContain)}}{const minWidthToContain=originalSize.height*cropperSettings.aspectRatio,minHeightToContain=originalSize.width/cropperSettings.aspectRatio;return{width:Math.max(originalSize.width,minWidthToContain),height:Math.max(originalSize.height,minHeightToContain)}}}return canvasRotation%2?{height:originalSize.width,width:originalSize.height}:{width:originalSize.width,height:originalSize.height}}}__name(LoadImageService,"LoadImageService"),LoadImageService.\u0275fac=__name(function(t){return new(t||LoadImageService)},"LoadImageService_Factory"),LoadImageService.\u0275prov=core.Yz7({token:LoadImageService,factory:LoadImageService.\u0275fac,providedIn:"root"});class ImageCropperComponent{constructor(cropService,cropperPositionService,loadImageService,sanitizer,cd){this.cropService=cropService,this.cropperPositionService=cropperPositionService,this.loadImageService=loadImageService,this.sanitizer=sanitizer,this.cd=cd,this.Hammer=(null==window?void 0:window.Hammer)||null,this.settings=new CropperSettings,this.setImageMaxSizeRetries=0,this.marginLeft="0px",this.maxSize={width:0,height:0},this.moveTypes=MoveTypes,this.imageVisible=!1,this.format=this.settings.format,this.transform={},this.maintainAspectRatio=this.settings.maintainAspectRatio,this.aspectRatio=this.settings.aspectRatio,this.resizeToWidth=this.settings.resizeToWidth,this.resizeToHeight=this.settings.resizeToHeight,this.cropperMinWidth=this.settings.cropperMinWidth,this.cropperMinHeight=this.settings.cropperMinHeight,this.cropperMaxHeight=this.settings.cropperMaxHeight,this.cropperMaxWidth=this.settings.cropperMaxWidth,this.cropperStaticWidth=this.settings.cropperStaticWidth,this.cropperStaticHeight=this.settings.cropperStaticHeight,this.canvasRotation=this.settings.canvasRotation,this.initialStepSize=this.settings.initialStepSize,this.roundCropper=this.settings.roundCropper,this.onlyScaleDown=this.settings.onlyScaleDown,this.imageQuality=this.settings.imageQuality,this.autoCrop=this.settings.autoCrop,this.backgroundColor=this.settings.backgroundColor,this.containWithinAspectRatio=this.settings.containWithinAspectRatio,this.hideResizeSquares=this.settings.hideResizeSquares,this.allowMoveImage=!1,this.cropper={x1:-100,y1:-100,x2:1e4,y2:1e4},this.alignImage=this.settings.alignImage,this.disabled=!1,this.imageCropped=new core.vpe,this.startCropImage=new core.vpe,this.imageLoaded=new core.vpe,this.cropperReady=new core.vpe,this.loadImageFailed=new core.vpe,this.transformChange=new core.vpe,this.reset()}ngOnChanges(changes){var _a;this.onChangesUpdateSettings(changes),this.onChangesInputImage(changes),(null===(_a=this.loadedImage)||void 0===_a?void 0:_a.original.image.complete)&&(changes.containWithinAspectRatio||changes.canvasRotation)&&this.loadImageService.transformLoadedImage(this.loadedImage,this.settings).then(res=>this.setLoadedImage(res)).catch(err=>this.loadImageError(err)),(changes.cropper||changes.maintainAspectRatio||changes.aspectRatio)&&(this.setMaxSize(),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize(),this.maintainAspectRatio&&(changes.maintainAspectRatio||changes.aspectRatio)?this.resetCropperPosition():changes.cropper&&(this.checkCropperPosition(!1),this.doAutoCrop()),this.cd.markForCheck()),changes.transform&&(this.transform=this.transform||{},this.setCssTransform(),this.doAutoCrop(),this.cd.markForCheck())}onChangesUpdateSettings(changes){this.settings.setOptionsFromChanges(changes),this.settings.cropperStaticHeight&&this.settings.cropperStaticWidth&&this.settings.setOptions({hideResizeSquares:!0,cropperMinWidth:this.settings.cropperStaticWidth,cropperMinHeight:this.settings.cropperStaticHeight,cropperMaxHeight:this.settings.cropperStaticHeight,cropperMaxWidth:this.settings.cropperStaticWidth,maintainAspectRatio:!1})}onChangesInputImage(changes){(changes.imageChangedEvent||changes.imageURL||changes.imageBase64||changes.imageFile)&&this.reset(),changes.imageChangedEvent&&this.isValidImageChangedEvent()&&this.loadImageFile(this.imageChangedEvent.target.files[0]),changes.imageURL&&this.imageURL&&this.loadImageFromURL(this.imageURL),changes.imageBase64&&this.imageBase64&&this.loadBase64Image(this.imageBase64),changes.imageFile&&this.imageFile&&this.loadImageFile(this.imageFile)}isValidImageChangedEvent(){var _a,_b,_c;return(null===(_c=null===(_b=null===(_a=this.imageChangedEvent)||void 0===_a?void 0:_a.target)||void 0===_b?void 0:_b.files)||void 0===_c?void 0:_c.length)>0}setCssTransform(){this.safeTransformStyle=this.sanitizer.bypassSecurityTrustStyle("scaleX("+(this.transform.scale||1)*(this.transform.flipH?-1:1)+")scaleY("+(this.transform.scale||1)*(this.transform.flipV?-1:1)+")rotate("+(this.transform.rotate||0)+`deg)translate(${this.transform.translateH||0}%, ${this.transform.translateV||0}%)`)}ngOnInit(){this.settings.stepSize=this.initialStepSize,this.activatePinchGesture()}reset(){this.imageVisible=!1,this.loadedImage=void 0,this.safeImgDataUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.moveStart={active:!1,type:null,position:null,x1:0,y1:0,x2:0,y2:0,clientX:0,clientY:0},this.maxSize={width:0,height:0},this.cropper.x1=-100,this.cropper.y1=-100,this.cropper.x2=1e4,this.cropper.y2=1e4}loadImageFile(file){this.loadImageService.loadImageFile(file,this.settings).then(res=>this.setLoadedImage(res)).catch(err=>this.loadImageError(err))}loadBase64Image(imageBase64){this.loadImageService.loadBase64Image(imageBase64,this.settings).then(res=>this.setLoadedImage(res)).catch(err=>this.loadImageError(err))}loadImageFromURL(url){this.loadImageService.loadImageFromURL(url,this.settings).then(res=>this.setLoadedImage(res)).catch(err=>this.loadImageError(err))}setLoadedImage(loadedImage){this.loadedImage=loadedImage,this.safeImgDataUrl=this.sanitizer.bypassSecurityTrustResourceUrl(loadedImage.transformed.base64),this.cd.markForCheck()}loadImageError(error){console.error(error),this.loadImageFailed.emit()}imageLoadedInView(){null!=this.loadedImage&&(this.imageLoaded.emit(this.loadedImage),this.setImageMaxSizeRetries=0,setTimeout(()=>this.checkImageMaxSizeRecursively()))}checkImageMaxSizeRecursively(){this.setImageMaxSizeRetries>40?this.loadImageFailed.emit():this.sourceImageLoaded()?(this.setMaxSize(),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize(),this.resetCropperPosition(),this.cropperReady.emit(Object.assign({},this.maxSize)),this.cd.markForCheck()):(this.setImageMaxSizeRetries++,setTimeout(()=>this.checkImageMaxSizeRecursively(),50))}sourceImageLoaded(){var _a,_b;return(null===(_b=null===(_a=this.sourceImage)||void 0===_a?void 0:_a.nativeElement)||void 0===_b?void 0:_b.offsetWidth)>0}onResize(){!this.loadedImage||(this.resizeCropperPosition(),this.setMaxSize(),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize())}activatePinchGesture(){if(this.Hammer){const hammer=new this.Hammer(this.wrapper.nativeElement);hammer.get("pinch").set({enable:!0}),hammer.on("pinchmove",this.onPinch.bind(this)),hammer.on("pinchend",this.pinchStop.bind(this)),hammer.on("pinchstart",this.startPinch.bind(this))}else(0,core.X6Q)()&&console.warn("[NgxImageCropper] Could not find HammerJS - Pinch Gesture won't work")}resizeCropperPosition(){const sourceImageElement=this.sourceImage.nativeElement;(this.maxSize.width!==sourceImageElement.offsetWidth||this.maxSize.height!==sourceImageElement.offsetHeight)&&(this.cropper.x1=this.cropper.x1*sourceImageElement.offsetWidth/this.maxSize.width,this.cropper.x2=this.cropper.x2*sourceImageElement.offsetWidth/this.maxSize.width,this.cropper.y1=this.cropper.y1*sourceImageElement.offsetHeight/this.maxSize.height,this.cropper.y2=this.cropper.y2*sourceImageElement.offsetHeight/this.maxSize.height)}resetCropperPosition(){this.cropperPositionService.resetCropperPosition(this.sourceImage,this.cropper,this.settings),this.doAutoCrop(),this.imageVisible=!0}keyboardAccess(event){this.changeKeyboardStepSize(event),this.keyboardMoveCropper(event)}changeKeyboardStepSize(event){const key=+event.key;key>=1&&key<=9&&(this.settings.stepSize=key)}keyboardMoveCropper(event){if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(event.key))return;const moveType=event.shiftKey?MoveTypes.Resize:MoveTypes.Move,position=event.altKey?getInvertedPositionForKey(event.key):getPositionForKey(event.key),moveEvent=getEventForKey(event.key,this.settings.stepSize);event.preventDefault(),event.stopPropagation(),this.startMove({clientX:0,clientY:0},moveType,position),this.moveImg(moveEvent),this.moveStop()}startMove(event,moveType,position=null){var _a,_b;this.disabled||(null===(_a=this.moveStart)||void 0===_a?void 0:_a.active)&&(null===(_b=this.moveStart)||void 0===_b?void 0:_b.type)===MoveTypes.Pinch||moveType===MoveTypes.Drag&&!this.allowMoveImage||(event.preventDefault&&event.preventDefault(),this.moveStart=Object.assign({active:!0,type:moveType,position,transform:Object.assign({},this.transform),clientX:this.cropperPositionService.getClientX(event),clientY:this.cropperPositionService.getClientY(event)},this.cropper))}startPinch(event){!this.safeImgDataUrl||(event.preventDefault&&event.preventDefault(),this.moveStart=Object.assign({active:!0,type:MoveTypes.Pinch,position:"center",clientX:this.cropper.x1+(this.cropper.x2-this.cropper.x1)/2,clientY:this.cropper.y1+(this.cropper.y2-this.cropper.y1)/2},this.cropper))}moveImg(event){var _a,_b;if(this.moveStart.active){if(event.stopPropagation&&event.stopPropagation(),event.preventDefault&&event.preventDefault(),this.moveStart.type===MoveTypes.Move)this.cropperPositionService.move(event,this.moveStart,this.cropper),this.checkCropperPosition(!0);else if(this.moveStart.type===MoveTypes.Resize)!this.cropperStaticWidth&&!this.cropperStaticHeight&&this.cropperPositionService.resize(event,this.moveStart,this.cropper,this.maxSize,this.settings),this.checkCropperPosition(!1);else if(this.moveStart.type===MoveTypes.Drag){const diffX=this.cropperPositionService.getClientX(event)-this.moveStart.clientX,diffY=this.cropperPositionService.getClientY(event)-this.moveStart.clientY;this.transform=Object.assign(Object.assign({},this.transform),{translateH:((null===(_a=this.moveStart.transform)||void 0===_a?void 0:_a.translateH)||0)+diffX,translateV:((null===(_b=this.moveStart.transform)||void 0===_b?void 0:_b.translateV)||0)+diffY}),this.setCssTransform()}this.cd.detectChanges()}}onPinch(event){this.moveStart.active&&(event.stopPropagation&&event.stopPropagation(),event.preventDefault&&event.preventDefault(),this.moveStart.type===MoveTypes.Pinch&&(this.cropperPositionService.resize(event,this.moveStart,this.cropper,this.maxSize,this.settings),this.checkCropperPosition(!1)),this.cd.detectChanges())}setMaxSize(){if(this.sourceImage){const sourceImageElement=this.sourceImage.nativeElement;this.maxSize.width=sourceImageElement.offsetWidth,this.maxSize.height=sourceImageElement.offsetHeight,this.marginLeft=this.sanitizer.bypassSecurityTrustStyle("calc(50% - "+this.maxSize.width/2+"px)")}}setCropperScaledMinSize(){var _a,_b;null!==(_b=null===(_a=this.loadedImage)||void 0===_a?void 0:_a.transformed)&&void 0!==_b&&_b.image?(this.setCropperScaledMinWidth(),this.setCropperScaledMinHeight()):(this.settings.cropperScaledMinWidth=20,this.settings.cropperScaledMinHeight=20)}setCropperScaledMinWidth(){this.settings.cropperScaledMinWidth=this.cropperMinWidth>0?Math.max(20,this.cropperMinWidth/this.loadedImage.transformed.image.width*this.maxSize.width):20}setCropperScaledMinHeight(){this.maintainAspectRatio?this.settings.cropperScaledMinHeight=Math.max(20,this.settings.cropperScaledMinWidth/this.aspectRatio):this.cropperMinHeight>0?this.settings.cropperScaledMinHeight=Math.max(20,this.cropperMinHeight/this.loadedImage.transformed.image.height*this.maxSize.height):this.settings.cropperScaledMinHeight=20}setCropperScaledMaxSize(){var _a,_b;if(null!==(_b=null===(_a=this.loadedImage)||void 0===_a?void 0:_a.transformed)&&void 0!==_b&&_b.image){const ratio=this.loadedImage.transformed.size.width/this.maxSize.width;this.settings.cropperScaledMaxWidth=this.cropperMaxWidth>20?this.cropperMaxWidth/ratio:this.maxSize.width,this.settings.cropperScaledMaxHeight=this.cropperMaxHeight>20?this.cropperMaxHeight/ratio:this.maxSize.height,this.maintainAspectRatio&&(this.settings.cropperScaledMaxWidth>this.settings.cropperScaledMaxHeight*this.aspectRatio?this.settings.cropperScaledMaxWidth=this.settings.cropperScaledMaxHeight*this.aspectRatio:this.settings.cropperScaledMaxWidththis.maxSize.width&&(this.cropper.x1-=maintainSize?this.cropper.x2-this.maxSize.width:0,this.cropper.x2=this.maxSize.width),this.cropper.y2>this.maxSize.height&&(this.cropper.y1-=maintainSize?this.cropper.y2-this.maxSize.height:0,this.cropper.y2=this.maxSize.height)}moveStop(){var _a;this.moveStart.active&&(this.moveStart.active=!1,(null===(_a=this.moveStart)||void 0===_a?void 0:_a.type)===MoveTypes.Drag?this.transformChange.emit(this.transform):this.doAutoCrop())}pinchStop(){this.moveStart.active&&(this.moveStart.active=!1,this.doAutoCrop())}doAutoCrop(){this.autoCrop&&this.crop()}crop(){var _a,_b;if(null!=(null===(_b=null===(_a=this.loadedImage)||void 0===_a?void 0:_a.transformed)||void 0===_b?void 0:_b.image)){this.startCropImage.emit();const output=this.cropService.crop(this.sourceImage,this.loadedImage,this.cropper,this.settings);return null!=output&&this.imageCropped.emit(output),output}return null}}__name(ImageCropperComponent,"ImageCropperComponent"),ImageCropperComponent.\u0275fac=__name(function(t){return new(t||ImageCropperComponent)(core.Y36(CropService),core.Y36(CropperPositionService),core.Y36(LoadImageService),core.Y36(platform_browser.H7),core.Y36(core.sBO))},"ImageCropperComponent_Factory"),ImageCropperComponent.\u0275cmp=core.Xpm({type:ImageCropperComponent,selectors:[["image-cropper"]],viewQuery:__name(function(rf,ctx){if(1&rf&&(core.Gf(_c0,7),core.Gf(_c1,5)),2&rf){let _t;core.iGM(_t=core.CRH())&&(ctx.wrapper=_t.first),core.iGM(_t=core.CRH())&&(ctx.sourceImage=_t.first)}},"ImageCropperComponent_Query"),hostVars:4,hostBindings:__name(function(rf,ctx){1&rf&&core.NdJ("resize",__name(function(){return ctx.onResize()},"ImageCropperComponent_resize_HostBindingHandler"),!1,core.Jf7)("mousemove",__name(function($event){return ctx.moveImg($event)},"ImageCropperComponent_mousemove_HostBindingHandler"),!1,core.evT)("touchmove",__name(function($event){return ctx.moveImg($event)},"ImageCropperComponent_touchmove_HostBindingHandler"),!1,core.evT)("mouseup",__name(function(){return ctx.moveStop()},"ImageCropperComponent_mouseup_HostBindingHandler"),!1,core.evT)("touchend",__name(function(){return ctx.moveStop()},"ImageCropperComponent_touchend_HostBindingHandler"),!1,core.evT),2&rf&&(core.Udp("text-align",ctx.alignImage),core.ekj("disabled",ctx.disabled))},"ImageCropperComponent_HostBindings"),inputs:{imageChangedEvent:"imageChangedEvent",imageURL:"imageURL",imageBase64:"imageBase64",imageFile:"imageFile",format:"format",transform:"transform",maintainAspectRatio:"maintainAspectRatio",aspectRatio:"aspectRatio",resizeToWidth:"resizeToWidth",resizeToHeight:"resizeToHeight",cropperMinWidth:"cropperMinWidth",cropperMinHeight:"cropperMinHeight",cropperMaxHeight:"cropperMaxHeight",cropperMaxWidth:"cropperMaxWidth",cropperStaticWidth:"cropperStaticWidth",cropperStaticHeight:"cropperStaticHeight",canvasRotation:"canvasRotation",initialStepSize:"initialStepSize",roundCropper:"roundCropper",onlyScaleDown:"onlyScaleDown",imageQuality:"imageQuality",autoCrop:"autoCrop",backgroundColor:"backgroundColor",containWithinAspectRatio:"containWithinAspectRatio",hideResizeSquares:"hideResizeSquares",allowMoveImage:"allowMoveImage",cropper:"cropper",alignImage:"alignImage",disabled:"disabled"},outputs:{imageCropped:"imageCropped",startCropImage:"startCropImage",imageLoaded:"imageLoaded",cropperReady:"cropperReady",loadImageFailed:"loadImageFailed",transformChange:"transformChange"},features:[core.TTD],decls:5,vars:10,consts:[["wrapper",""],["class","ngx-ic-source-image",3,"src","visibility","transform","ngx-ic-draggable","load","mousedown","touchstart",4,"ngIf"],[1,"ngx-ic-overlay"],["class","ngx-ic-cropper","tabindex","0",3,"ngx-ic-round","top","left","width","height","margin-left","visibility","keydown",4,"ngIf"],[1,"ngx-ic-source-image",3,"src","load","mousedown","touchstart"],["sourceImage",""],["tabindex","0",1,"ngx-ic-cropper",3,"keydown"],[1,"ngx-ic-move",3,"mousedown","touchstart"],[4,"ngIf"],[1,"ngx-ic-resize","ngx-ic-topleft",3,"mousedown","touchstart"],[1,"ngx-ic-square"],[1,"ngx-ic-resize","ngx-ic-top"],[1,"ngx-ic-resize","ngx-ic-topright",3,"mousedown","touchstart"],[1,"ngx-ic-resize","ngx-ic-right"],[1,"ngx-ic-resize","ngx-ic-bottomright",3,"mousedown","touchstart"],[1,"ngx-ic-resize","ngx-ic-bottom"],[1,"ngx-ic-resize","ngx-ic-bottomleft",3,"mousedown","touchstart"],[1,"ngx-ic-resize","ngx-ic-left"],[1,"ngx-ic-resize-bar","ngx-ic-top",3,"mousedown","touchstart"],[1,"ngx-ic-resize-bar","ngx-ic-right",3,"mousedown","touchstart"],[1,"ngx-ic-resize-bar","ngx-ic-bottom",3,"mousedown","touchstart"],[1,"ngx-ic-resize-bar","ngx-ic-left",3,"mousedown","touchstart"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",null,0),core.YNc(2,ImageCropperComponent_img_2_Template,2,7,"img",1),core._UZ(3,"div",2),core.YNc(4,ImageCropperComponent_div_4_Template,3,15,"div",3),core.qZA()),2&rf&&(core.Udp("background",ctx.imageVisible&&ctx.backgroundColor),core.xp6(2),core.Q6J("ngIf",ctx.safeImgDataUrl),core.xp6(1),core.Udp("width",ctx.maxSize.width,"px")("height",ctx.maxSize.height,"px")("margin-left","center"===ctx.alignImage?ctx.marginLeft:null),core.xp6(1),core.Q6J("ngIf",ctx.imageVisible))},"ImageCropperComponent_Template"),dependencies:[common.O5],styles:['[_nghost-%COMP%]{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center}[_nghost-%COMP%] > div[_ngcontent-%COMP%]{width:100%;position:relative}[_nghost-%COMP%] > div[_ngcontent-%COMP%] img.ngx-ic-source-image[_ngcontent-%COMP%]{max-width:100%;max-height:100%;transform-origin:center}[_nghost-%COMP%] > div[_ngcontent-%COMP%] img.ngx-ic-source-image.ngx-ic-draggable[_ngcontent-%COMP%]{user-drag:none;-webkit-user-drag:none;user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;cursor:grab}[_nghost-%COMP%] .ngx-ic-overlay[_ngcontent-%COMP%]{position:absolute;pointer-events:none;touch-action:none;outline:var(--cropper-overlay-color, white) solid 100vw;top:0;left:0}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%]{position:absolute;display:flex;color:#53535c;background:transparent;outline:rgba(255,255,255,.3) solid 100vw;outline:var(--cropper-outline-color, rgba(255, 255, 255, .3)) solid 100vw;touch-action:none}@media (orientation: portrait){[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%]{outline-width:100vh}}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%]:after{position:absolute;content:"";top:0;bottom:0;left:0;right:0;pointer-events:none;border:dashed 1px;opacity:.75;color:inherit;z-index:1}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-move[_ngcontent-%COMP%]{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%]:focus .ngx-ic-move[_ngcontent-%COMP%]{border-color:#1e90ff;border-width:2px}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize[_ngcontent-%COMP%]{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize[_ngcontent-%COMP%] .ngx-ic-square[_ngcontent-%COMP%]{display:inline-block;background:#53535C;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-topleft[_ngcontent-%COMP%]{top:-12px;left:-12px;cursor:nwse-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-top[_ngcontent-%COMP%]{top:-12px;left:calc(50% - 12px);cursor:ns-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-topright[_ngcontent-%COMP%]{top:-12px;right:-12px;cursor:nesw-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-right[_ngcontent-%COMP%]{top:calc(50% - 12px);right:-12px;cursor:ew-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-bottomright[_ngcontent-%COMP%]{bottom:-12px;right:-12px;cursor:nwse-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-bottom[_ngcontent-%COMP%]{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-bottomleft[_ngcontent-%COMP%]{bottom:-12px;left:-12px;cursor:nesw-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize.ngx-ic-left[_ngcontent-%COMP%]{top:calc(50% - 12px);left:-12px;cursor:ew-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar[_ngcontent-%COMP%]{position:absolute;z-index:1}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar.ngx-ic-top[_ngcontent-%COMP%]{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar.ngx-ic-right[_ngcontent-%COMP%]{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar.ngx-ic-bottom[_ngcontent-%COMP%]{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar.ngx-ic-left[_ngcontent-%COMP%]{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}[_nghost-%COMP%] .ngx-ic-cropper.ngx-ic-round[_ngcontent-%COMP%]{outline-color:transparent}[_nghost-%COMP%] .ngx-ic-cropper.ngx-ic-round[_ngcontent-%COMP%]:after{border-radius:100%;box-shadow:0 0 0 100vw #ffffff4d;box-shadow:0 0 0 100vw var(--cropper-outline-color, rgba(255, 255, 255, .3))}@media (orientation: portrait){[_nghost-%COMP%] .ngx-ic-cropper.ngx-ic-round[_ngcontent-%COMP%]:after{box-shadow:0 0 0 100vh #ffffff4d;box-shadow:0 0 0 100vh var(--cropper-outline-color, rgba(255, 255, 255, .3))}}[_nghost-%COMP%] .ngx-ic-cropper.ngx-ic-round[_ngcontent-%COMP%] .ngx-ic-move[_ngcontent-%COMP%]{border-radius:100%}.disabled[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize[_ngcontent-%COMP%], .disabled[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-resize-bar[_ngcontent-%COMP%], .disabled[_nghost-%COMP%] .ngx-ic-cropper[_ngcontent-%COMP%] .ngx-ic-move[_ngcontent-%COMP%]{display:none}'],changeDetection:0});class ImageCropperModule{}__name(ImageCropperModule,"ImageCropperModule"),ImageCropperModule.\u0275fac=__name(function(t){return new(t||ImageCropperModule)},"ImageCropperModule_Factory"),ImageCropperModule.\u0275mod=core.oAB({type:ImageCropperModule}),ImageCropperModule.\u0275inj=core.cJS({imports:[[common.ez]]}),__name(function base64ToFile(base64Image){const split=base64Image.split(","),type=split[0].replace("data:","").replace(";base64",""),byteString=atob(split[1]),ab=new ArrayBuffer(byteString.length),ia=new Uint8Array(ab);for(let i=0;ithis.editProfilePopup=!0}ngOnInit(){const uid=this.route.snapshot.params.id;this.usersService.getCurrentProfile(uid).subscribe(value=>this.user=value)}updateProfile(data){var _this=this;return(0,asyncToGenerator.Z)(function*(){try{yield _this.usersService.updateProfile(_this.user.uid,data),_this.hideEditProfilePopUp(),_this.hideEditPicPopup()}catch(error){_this.errorMsg=error}})()}hideEditProfilePopUp(){this.editProfilePopup=!1,this.errorMsg=""}hideEditPicPopup(){this.editPicPopup=!1,this.uploading=!1,this.errorMsg="",this.percentage=(0,cjs.of)(void 0),this.imageFile=null,this.croppedImage=null}fileChangeEvent(event){event.target.files[0]&&(this.imageFile=event,this.errorMsg="",this.editPicPopup=!0)}imageCropped(event){this.croppedImage=event.base64}loadImageFailed(){this.imageFile=null,this.errorMsg="Please, Load a valid image",setTimeout(()=>{this.hideEditPicPopup()},3e3)}saveImg(){this.uploadPhoto(this.croppedImage)}uploadPhoto(event){var _this2=this;return(0,asyncToGenerator.Z)(function*(){if(!event)return;_this2.uploading=!0;const image=yield(0,utilities.Bo)(event),filePath=`profile-pictures/${_this2.user.uid}`,fileRef=_this2.afStorage.ref(filePath),task=_this2.afStorage.upload(filePath,image);_this2.percentage=task.percentageChanges(),task.snapshotChanges().pipe((0,cjs.finalize)(()=>{fileRef.getDownloadURL().subscribe(url=>{url&&(_this2.user.imageURL=url,_this2.updateProfile(_this2.user).then(()=>_this2.hideEditPicPopup()))})})).subscribe()})()}hideAllPopups(){this.hideEditProfilePopUp(),this.uploading||this.hideEditPicPopup()}}__name(ProfileComponent,"ProfileComponent"),ProfileComponent.\u0275fac=__name(function(t){return new(t||ProfileComponent)(core.Y36(router.gz),core.Y36(users_service.f),core.Y36(AngularFireStorage))},"ProfileComponent_Factory"),ProfileComponent.\u0275cmp=core.Xpm({type:ProfileComponent,selectors:[["app-profile"]],decls:5,vars:4,consts:[[1,"global-container"],["class","profile-container facebook-style",4,"ngIf"],["class","popup-modal facebook-style",4,"ngIf"],["class","overlay",3,"click",4,"ngIf"],[1,"profile-container","facebook-style"],[1,"img-container",3,"click"],["alt","User's profile picture",1,"profile-photo",3,"src"],[1,"upload-icon-container"],[1,"fas","fa-upload",3,"title"],["type","file","accept","image/*",2,"display","none",3,"change"],["editPicInput",""],[1,"profile-info-container"],[1,"profile-section"],[1,"profile-section",2,"text-align","center"],[2,"font-size","small"],[1,"profile-section",2,"text-align","left","margin","15px 0"],[1,"user-infos"],[1,"fas","fa-envelope"],[1,"span-info"],[1,"fas","fa-phone-square-alt"],[1,"edit-btn",3,"click"],[1,"popup-modal","facebook-style"],[1,"popup-modal-header"],[1,"title"],["class","close-btn",3,"title","click",4,"ngIf"],[1,"popup-modal-body"],["class","img-cropper-container",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["class","progress-container",4,"ngIf"],["class","alert alert-danger",4,"ngIf"],[1,"close-btn",3,"title","click"],[1,"img-cropper-container"],["format","png",3,"imageChangedEvent","maintainAspectRatio","resizeToWidth","aspectRatio","imageCropped","loadImageFailed"],[1,"btn","btn-success",3,"click"],[1,"progress-container"],[1,"text-warning"],[2,"display","flex","flex-wrap","nowrap"],["max","100",2,"width","100%",3,"value"],[4,"ngIf"],[1,"alert","alert-danger"],[3,"profileInfos","updatedValues"],["class","text-danger",4,"ngIf"],[1,"text-danger"],[1,"overlay",3,"click"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0),core.YNc(1,ProfileComponent_div_1_Template,34,19,"div",1),core.YNc(2,ProfileComponent_div_2_Template,11,8,"div",2),core.YNc(3,ProfileComponent_div_3_Template,11,8,"div",2),core.YNc(4,ProfileComponent_div_4_Template,1,0,"div",3),core.qZA()),2&rf&&(core.xp6(1),core.Q6J("ngIf",ctx.user),core.xp6(1),core.Q6J("ngIf",ctx.editPicPopup),core.xp6(1),core.Q6J("ngIf",ctx.editProfilePopup),core.xp6(1),core.Q6J("ngIf",ctx.editProfilePopup||ctx.editPicPopup))},"ProfileComponent_Template"),dependencies:[common.O5,edit_profile_component.z,ImageCropperComponent,common.Ov,common.JJ,common.uU,ngx_translate_core.X$],styles:[".global-container[_ngcontent-%COMP%]{position:relative;min-height:90vh}.profile-container[_ngcontent-%COMP%]{margin:15px auto;padding:15px;width:max-content;min-width:max-content;height:max-content;display:grid;grid-template-columns:repeat(2,minmax(max-content,1fr));gap:15px;justify-content:center;align-items:center}.img-container[_ngcontent-%COMP%]{position:relative;margin:15px;height:250px;display:flex;justify-content:center;align-items:center;margin-inline:auto}.profile-info-container[_ngcontent-%COMP%]{margin:15px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;height:100%}.img-container[_ngcontent-%COMP%]:hover{filter:brightness(75%);transition:.2s}.img-container[_ngcontent-%COMP%]:hover .fa-upload[_ngcontent-%COMP%]{display:inherit}.profile-photo[_ngcontent-%COMP%]{width:100%;height:100%;margin-inline:auto;border-radius:50%;cursor:pointer}.upload-icon-container[_ngcontent-%COMP%]{position:absolute;top:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.fa-upload[_ngcontent-%COMP%]{font-size:4rem;color:#fff;display:none;cursor:pointer}.user-infos[_ngcontent-%COMP%]{margin-block:5px}.span-info[_ngcontent-%COMP%]{margin-left:7px}.edit-btn[_ngcontent-%COMP%]{height:-moz-fit-content;height:fit-content;padding:.25rem .5rem;margin-left:5px;align-self:center;background-color:var(--mainToSide-color);color:var(--popup-bg-color);border:none;border-radius:3px}.edit-btn[_ngcontent-%COMP%]:hover{filter:brightness(.9)}.img-cropper-container[_ngcontent-%COMP%]{width:100%;height:300px;text-align:center}.popup-modal-body[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{width:100%}.progress-container[_ngcontent-%COMP%]{margin-top:15px}@media screen and (max-width: 650px){.profile-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:max-content;height:100%}}"]});const routes=[{path:"",component:ProfileComponent,canActivate:[auth_guard.a]}];class ProfileRoutingModule{}__name(ProfileRoutingModule,"ProfileRoutingModule"),ProfileRoutingModule.\u0275fac=__name(function(t){return new(t||ProfileRoutingModule)},"ProfileRoutingModule_Factory"),ProfileRoutingModule.\u0275mod=core.oAB({type:ProfileRoutingModule}),ProfileRoutingModule.\u0275inj=core.cJS({imports:[router.Bz.forChild(routes),router.Bz]});var shared_module=__webpack_require__(83436),fesm2015_core=__webpack_require__(64234),a11y=__webpack_require__(85536);const button_c0=["mat-button",""],button_c1=["*"],BUTTON_HOST_ATTRIBUTES=["mat-button","mat-flat-button","mat-icon-button","mat-raised-button","mat-stroked-button","mat-mini-fab","mat-fab"],_MatButtonBase=(0,fesm2015_core.pj)((0,fesm2015_core.Id)((0,fesm2015_core.Kr)(class{constructor(_elementRef){this._elementRef=_elementRef}})));class MatButton extends _MatButtonBase{constructor(elementRef,_focusMonitor,_animationMode){super(elementRef),this._focusMonitor=_focusMonitor,this._animationMode=_animationMode,this.isRoundButton=this._hasHostAttributes("mat-fab","mat-mini-fab"),this.isIconButton=this._hasHostAttributes("mat-icon-button");for(const attr of BUTTON_HOST_ATTRIBUTES)this._hasHostAttributes(attr)&&this._getHostElement().classList.add(attr);elementRef.nativeElement.classList.add("mat-button-base"),this.isRoundButton&&(this.color="accent")}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}focus(origin,options){origin?this._focusMonitor.focusVia(this._getHostElement(),origin,options):this._getHostElement().focus(options)}_getHostElement(){return this._elementRef.nativeElement}_isRippleDisabled(){return this.disableRipple||this.disabled}_hasHostAttributes(...attributes){return attributes.some(attribute=>this._getHostElement().hasAttribute(attribute))}}__name(MatButton,"MatButton"),MatButton.\u0275fac=__name(function(t){return new(t||MatButton)(core.Y36(core.SBq),core.Y36(a11y.tE),core.Y36(core.QbO,8))},"MatButton_Factory"),MatButton.\u0275cmp=core.Xpm({type:MatButton,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-icon-button",""],["button","mat-fab",""],["button","mat-mini-fab",""],["button","mat-stroked-button",""],["button","mat-flat-button",""]],viewQuery:__name(function(rf,ctx){if(1&rf&&core.Gf(fesm2015_core.wG,5),2&rf){let _t;core.iGM(_t=core.CRH())&&(ctx.ripple=_t.first)}},"MatButton_Query"),hostAttrs:[1,"mat-focus-indicator"],hostVars:5,hostBindings:__name(function(rf,ctx){2&rf&&(core.uIk("disabled",ctx.disabled||null),core.ekj("_mat-animation-noopable","NoopAnimations"===ctx._animationMode)("mat-button-disabled",ctx.disabled))},"MatButton_HostBindings"),inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color"},exportAs:["matButton"],features:[core.qOj],attrs:button_c0,ngContentSelectors:button_c1,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:__name(function(rf,ctx){1&rf&&(core.F$t(),core.TgZ(0,"span",0),core.Hsn(1),core.qZA(),core._UZ(2,"span",1)(3,"span",2)),2&rf&&(core.xp6(2),core.ekj("mat-button-ripple-round",ctx.isRoundButton||ctx.isIconButton),core.Q6J("matRippleDisabled",ctx._isRippleDisabled())("matRippleCentered",ctx.isIconButton)("matRippleTrigger",ctx._getHostElement()))},"MatButton_Template"),dependencies:[fesm2015_core.wG],styles:[".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:.04}@media(hover: none){.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-icon-button,.mat-stroked-button,.mat-flat-button{box-sizing:border-box;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-button.mat-button-disabled,.mat-icon-button.mat-button-disabled,.mat-stroked-button.mat-button-disabled,.mat-flat-button.mat-button-disabled{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button.mat-button-disabled{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-ripple.mat-ripple,.mat-stroked-button .mat-button-focus-overlay{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab.mat-button-disabled{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}.mat-fab._mat-animation-noopable{transition:none !important;animation:none !important}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab.mat-button-disabled{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button i,.mat-icon-button .mat-icon{line-height:24px}.mat-button-ripple.mat-ripple,.mat-button-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1),background-color 200ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}"],encapsulation:2,changeDetection:0});class MatAnchor extends MatButton{constructor(focusMonitor,elementRef,animationMode,_ngZone){super(elementRef,focusMonitor,animationMode),this._ngZone=_ngZone,this._haltDisabledEvents=event=>{this.disabled&&(event.preventDefault(),event.stopImmediatePropagation())}}ngAfterViewInit(){super.ngAfterViewInit(),this._ngZone?this._ngZone.runOutsideAngular(()=>{this._elementRef.nativeElement.addEventListener("click",this._haltDisabledEvents)}):this._elementRef.nativeElement.addEventListener("click",this._haltDisabledEvents)}ngOnDestroy(){super.ngOnDestroy(),this._elementRef.nativeElement.removeEventListener("click",this._haltDisabledEvents)}}__name(MatAnchor,"MatAnchor"),MatAnchor.\u0275fac=__name(function(t){return new(t||MatAnchor)(core.Y36(a11y.tE),core.Y36(core.SBq),core.Y36(core.QbO,8),core.Y36(core.R0b,8))},"MatAnchor_Factory"),MatAnchor.\u0275cmp=core.Xpm({type:MatAnchor,selectors:[["a","mat-button",""],["a","mat-raised-button",""],["a","mat-icon-button",""],["a","mat-fab",""],["a","mat-mini-fab",""],["a","mat-stroked-button",""],["a","mat-flat-button",""]],hostAttrs:[1,"mat-focus-indicator"],hostVars:7,hostBindings:__name(function(rf,ctx){2&rf&&(core.uIk("tabindex",ctx.disabled?-1:ctx.tabIndex)("disabled",ctx.disabled||null)("aria-disabled",ctx.disabled.toString()),core.ekj("_mat-animation-noopable","NoopAnimations"===ctx._animationMode)("mat-button-disabled",ctx.disabled))},"MatAnchor_HostBindings"),inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex"},exportAs:["matButton","matAnchor"],features:[core.qOj],attrs:button_c0,ngContentSelectors:button_c1,decls:4,vars:5,consts:[[1,"mat-button-wrapper"],["matRipple","",1,"mat-button-ripple",3,"matRippleDisabled","matRippleCentered","matRippleTrigger"],[1,"mat-button-focus-overlay"]],template:__name(function(rf,ctx){1&rf&&(core.F$t(),core.TgZ(0,"span",0),core.Hsn(1),core.qZA(),core._UZ(2,"span",1)(3,"span",2)),2&rf&&(core.xp6(2),core.ekj("mat-button-ripple-round",ctx.isRoundButton||ctx.isIconButton),core.Q6J("matRippleDisabled",ctx._isRippleDisabled())("matRippleCentered",ctx.isIconButton)("matRippleTrigger",ctx._getHostElement()))},"MatAnchor_Template"),dependencies:[fesm2015_core.wG],styles:[".mat-button .mat-button-focus-overlay,.mat-icon-button .mat-button-focus-overlay{opacity:0}.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:.04}@media(hover: none){.mat-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay,.mat-stroked-button:hover:not(.mat-button-disabled) .mat-button-focus-overlay{opacity:0}}.mat-button,.mat-icon-button,.mat-stroked-button,.mat-flat-button{box-sizing:border-box;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-button.mat-button-disabled,.mat-icon-button.mat-button-disabled,.mat-stroked-button.mat-button-disabled,.mat-flat-button.mat-button-disabled{cursor:default}.mat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-button.cdk-program-focused .mat-button-focus-overlay,.mat-icon-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-icon-button.cdk-program-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-stroked-button.cdk-program-focused .mat-button-focus-overlay,.mat-flat-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-flat-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-button::-moz-focus-inner,.mat-icon-button::-moz-focus-inner,.mat-stroked-button::-moz-focus-inner,.mat-flat-button::-moz-focus-inner{border:0}.mat-raised-button{box-sizing:border-box;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button.mat-button-disabled{cursor:default}.mat-raised-button.cdk-keyboard-focused .mat-button-focus-overlay,.mat-raised-button.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-raised-button::-moz-focus-inner{border:0}.mat-raised-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-stroked-button{border:1px solid currentColor;padding:0 15px;line-height:34px}.mat-stroked-button .mat-button-ripple.mat-ripple,.mat-stroked-button .mat-button-focus-overlay{top:-1px;left:-1px;right:-1px;bottom:-1px}.mat-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:56px;height:56px;padding:0;flex-shrink:0}.mat-fab::-moz-focus-inner{border:0}.mat-fab.mat-button-disabled{cursor:default}.mat-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-fab::-moz-focus-inner{border:0}.mat-fab._mat-animation-noopable{transition:none !important;animation:none !important}.mat-fab .mat-button-wrapper{padding:16px 0;display:inline-block;line-height:24px}.mat-mini-fab{box-sizing:border-box;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);display:inline-block;white-space:nowrap;text-decoration:none;vertical-align:baseline;text-align:center;margin:0;min-width:64px;line-height:36px;padding:0 16px;border-radius:4px;overflow:visible;transform:translate3d(0, 0, 0);transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);min-width:0;border-radius:50%;width:40px;height:40px;padding:0;flex-shrink:0}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab.mat-button-disabled{cursor:default}.mat-mini-fab.cdk-keyboard-focused .mat-button-focus-overlay,.mat-mini-fab.cdk-program-focused .mat-button-focus-overlay{opacity:.12}.mat-mini-fab::-moz-focus-inner{border:0}.mat-mini-fab._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mini-fab .mat-button-wrapper{padding:8px 0;display:inline-block;line-height:24px}.mat-icon-button{padding:0;min-width:0;width:40px;height:40px;flex-shrink:0;line-height:40px;border-radius:50%}.mat-icon-button i,.mat-icon-button .mat-icon{line-height:24px}.mat-button-ripple.mat-ripple,.mat-button-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-button-ripple.mat-ripple:not(:empty){transform:translateZ(0)}.mat-button-focus-overlay{opacity:0;transition:opacity 200ms cubic-bezier(0.35, 0, 0.25, 1),background-color 200ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-button-focus-overlay{transition:none}.mat-button-ripple-round{border-radius:50%;z-index:1}.mat-button .mat-button-wrapper>*,.mat-flat-button .mat-button-wrapper>*,.mat-stroked-button .mat-button-wrapper>*,.mat-raised-button .mat-button-wrapper>*,.mat-icon-button .mat-button-wrapper>*,.mat-fab .mat-button-wrapper>*,.mat-mini-fab .mat-button-wrapper>*{vertical-align:middle}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button{display:inline-flex;justify-content:center;align-items:center;font-size:inherit;width:2.5em;height:2.5em}.cdk-high-contrast-active .mat-button,.cdk-high-contrast-active .mat-flat-button,.cdk-high-contrast-active .mat-raised-button,.cdk-high-contrast-active .mat-icon-button,.cdk-high-contrast-active .mat-fab,.cdk-high-contrast-active .mat-mini-fab{outline:solid 1px}.cdk-high-contrast-active .mat-button-base.cdk-keyboard-focused,.cdk-high-contrast-active .mat-button-base.cdk-program-focused{outline:solid 3px}"],encapsulation:2,changeDetection:0});class MatButtonModule{}__name(MatButtonModule,"MatButtonModule"),MatButtonModule.\u0275fac=__name(function(t){return new(t||MatButtonModule)},"MatButtonModule_Factory"),MatButtonModule.\u0275mod=core.oAB({type:MatButtonModule}),MatButtonModule.\u0275inj=core.cJS({imports:[fesm2015_core.si,fesm2015_core.BQ,fesm2015_core.BQ]});class ProfileModule{}__name(ProfileModule,"ProfileModule"),ProfileModule.\u0275fac=__name(function(t){return new(t||ProfileModule)},"ProfileModule_Factory"),ProfileModule.\u0275mod=core.oAB({type:ProfileModule}),ProfileModule.\u0275inj=core.cJS({imports:[common.ez,ProfileRoutingModule,shared_module.m,ImageCropperModule,MatButtonModule]})},42824:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{z:()=>EditProfileComponent});var _angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5e3),_angular_forms__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(93075),src_app_models_user__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(65783),src_app_auth_services_auth_service__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(16518),_angular_common__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(69808),_ngx_translate_core__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(81981);function EditProfileComponent_p_7_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"p",14),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(2,1,"First Name is invalid")))}function EditProfileComponent_p_13_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"p",14),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(2,1,"Last Name is invalid")))}function EditProfileComponent_p_19_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"p",14),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(2,1,"Phone Number must contain 10 digit numbers")))}function EditProfileComponent_div_20_option_5_Template(rf,ctx){if(1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"option",19),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()),2&rf){const role_r5=ctx.$implicit;_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("value",role_r5),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(role_r5)}}function EditProfileComponent_div_20_Template(rf,ctx){if(1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"div",15)(1,"label",16),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(3,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(4,"select",17),_angular_core__WEBPACK_IMPORTED_MODULE_2__.YNc(5,EditProfileComponent_div_20_option_5_Template,2,2,"option",18),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()()),2&rf){const ctx_r3=_angular_core__WEBPACK_IMPORTED_MODULE_2__.oxw();_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(3,2,"Role")),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngForOf",ctx_r3.roles)}}__name(EditProfileComponent_p_7_Template,"EditProfileComponent_p_7_Template"),__name(EditProfileComponent_p_13_Template,"EditProfileComponent_p_13_Template"),__name(EditProfileComponent_p_19_Template,"EditProfileComponent_p_19_Template"),__name(EditProfileComponent_div_20_option_5_Template,"EditProfileComponent_div_20_option_5_Template"),__name(EditProfileComponent_div_20_Template,"EditProfileComponent_div_20_Template");const _c0=__name(function(a0){return{"danger-input":a0}},"_c0");class EditProfileComponent{constructor(formBuilder,authService){this.formBuilder=formBuilder,this.authService=authService,this.roles=[],this.updatedValues=new _angular_core__WEBPACK_IMPORTED_MODULE_2__.vpe,Object.entries(src_app_models_user__WEBPACK_IMPORTED_MODULE_0__.K).forEach(([key,value])=>this.roles.push(value))}ngOnInit(){var _a,_b,_c,_d;this.editProfileForm=this.formBuilder.group({firstName:[null===(_a=this.profileInfos)||void 0===_a?void 0:_a.firstName,[_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.required,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.pattern(/.*\S.*/)]],lastName:[null===(_b=this.profileInfos)||void 0===_b?void 0:_b.lastName,[_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.required,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.pattern(/.*\S.*/)]],phoneNumber:[null===(_c=this.profileInfos)||void 0===_c?void 0:_c.phoneNumber,[_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.required,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.pattern(/^(\+213|0)?[0-9]{9}$/)]],role:[null===(_d=this.profileInfos)||void 0===_d?void 0:_d.role,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.required]})}submitForm(){this.updatedValues.emit(this.editProfileForm.value)}get isAdmin(){return this.authService.canCRUDusers(this.currentUser)}}__name(EditProfileComponent,"EditProfileComponent"),EditProfileComponent.\u0275fac=__name(function(t){return new(t||EditProfileComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y36(_angular_forms__WEBPACK_IMPORTED_MODULE_3__.QS),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y36(src_app_auth_services_auth_service__WEBPACK_IMPORTED_MODULE_1__.e))},"EditProfileComponent_Factory"),EditProfileComponent.\u0275cmp=_angular_core__WEBPACK_IMPORTED_MODULE_2__.Xpm({type:EditProfileComponent,selectors:[["app-edit-profile"]],inputs:{profileInfos:"profileInfos",currentUser:"currentUser"},outputs:{updatedValues:"updatedValues"},decls:24,vars:27,consts:[[1,"edit-profile-container"],[1,"signup-form",3,"formGroup"],[1,"form-section","first-name"],["for","firstName"],["type","text","formControlName","firstName",1,"input-form",3,"ngClass"],["class","danger-msg",4,"ngIf"],[1,"form-section","last-name"],["for","lastName"],["type","text","formControlName","lastName",1,"input-form",3,"ngClass"],[1,"form-section","phone-number"],["for","phoneNumber"],["type","tel","formControlName","phoneNumber",1,"input-form",3,"ngClass"],["class","form-section role",4,"ngIf"],[1,"btn","btn-success",3,"disabled","click"],[1,"danger-msg"],[1,"form-section","role"],["for","role"],["formControlName","role",1,"form-select"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:__name(function(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"div",0)(1,"form",1)(2,"div",2)(3,"label",3),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(4),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(5,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__._UZ(6,"input",4),_angular_core__WEBPACK_IMPORTED_MODULE_2__.YNc(7,EditProfileComponent_p_7_Template,3,3,"p",5),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(8,"div",6)(9,"label",7),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(10),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(11,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__._UZ(12,"input",8),_angular_core__WEBPACK_IMPORTED_MODULE_2__.YNc(13,EditProfileComponent_p_13_Template,3,3,"p",5),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(14,"div",9)(15,"label",10),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(16),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(17,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__._UZ(18,"input",11),_angular_core__WEBPACK_IMPORTED_MODULE_2__.YNc(19,EditProfileComponent_p_19_Template,3,3,"p",5),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.YNc(20,EditProfileComponent_div_20_Template,6,4,"div",12),_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(21,"button",13),_angular_core__WEBPACK_IMPORTED_MODULE_2__.NdJ("click",__name(function(){return ctx.submitForm()},"EditProfileComponent_Template_button_click_21_listener")),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(22),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(23,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()()()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("formGroup",ctx.editProfileForm),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(5,13,"First Name")),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_2__.VKq(21,_c0,ctx.editProfileForm.controls.firstName.invalid&&ctx.editProfileForm.controls.firstName.touched)),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngIf",ctx.editProfileForm.controls.firstName.invalid&&ctx.editProfileForm.controls.firstName.touched),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(11,15,"Last Name")),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_2__.VKq(23,_c0,ctx.editProfileForm.controls.lastName.invalid&&ctx.editProfileForm.controls.lastName.touched)),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngIf",ctx.editProfileForm.controls.lastName.invalid&&ctx.editProfileForm.controls.lastName.touched),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(17,17,"Phone Number")),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_2__.VKq(25,_c0,ctx.editProfileForm.controls.phoneNumber.invalid&&ctx.editProfileForm.controls.phoneNumber.touched)),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngIf",ctx.editProfileForm.controls.phoneNumber.invalid&&ctx.editProfileForm.controls.phoneNumber.touched),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngIf",ctx.isAdmin),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("disabled",ctx.editProfileForm.invalid),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.hij(" ",_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(23,19,"Save")," "))},"EditProfileComponent_Template"),dependencies:[_angular_common__WEBPACK_IMPORTED_MODULE_4__.mk,_angular_common__WEBPACK_IMPORTED_MODULE_4__.sg,_angular_common__WEBPACK_IMPORTED_MODULE_4__.O5,_angular_forms__WEBPACK_IMPORTED_MODULE_3__._Y,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.YN,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.Kr,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.Fj,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.EJ,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.JJ,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.JL,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.sg,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.u,_ngx_translate_core__WEBPACK_IMPORTED_MODULE_5__.X$],styles:[".form-section[_ngcontent-%COMP%]{margin-bottom:15px;text-align:left}.btn-success[_ngcontent-%COMP%]{width:100%}"]})},83436:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>SharedModule});var common=__webpack_require__(69808),angular_datatables=__webpack_require__(65415),fesm2015_forms=__webpack_require__(93075),core=__webpack_require__(5e3),chart_esm=__webpack_require__(34393),operators=__webpack_require__(83292);function listCacheClear(){this.__data__=[],this.size=0}__name(listCacheClear,"listCacheClear");const _listCacheClear=listCacheClear;function eq(value,other){return value===other||value!=value&&other!=other}__name(eq,"eq");const lodash_es_eq=eq;function assocIndexOf(array,key){for(var length=array.length;length--;)if(lodash_es_eq(array[length][0],key))return length;return-1}__name(assocIndexOf,"assocIndexOf");const _assocIndexOf=assocIndexOf;var splice=Array.prototype.splice;function listCacheDelete(key){var data=this.__data__,index=_assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)}__name(listCacheDelete,"listCacheDelete");const _listCacheDelete=listCacheDelete;function listCacheGet(key){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?void 0:data[index][1]}__name(listCacheGet,"listCacheGet");const _listCacheGet=listCacheGet;function listCacheHas(key){return _assocIndexOf(this.__data__,key)>-1}__name(listCacheHas,"listCacheHas");const _listCacheHas=listCacheHas;function listCacheSet(key,value){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}__name(listCacheSet,"listCacheSet");const _listCacheSet=listCacheSet;function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index-1&&value%1==0&&value<=9007199254740991}__name(isLength,"isLength");const lodash_es_isLength=isLength;function isArrayLike(value){return null!=value&&lodash_es_isLength(value.length)&&!lodash_es_isFunction(value)}__name(isArrayLike,"isArrayLike");const lodash_es_isArrayLike=isArrayLike;function isArrayLikeObject(value){return lodash_es_isObjectLike(value)&&lodash_es_isArrayLike(value)}__name(isArrayLikeObject,"isArrayLikeObject");const lodash_es_isArrayLikeObject=isArrayLikeObject;function stubFalse(){return!1}__name(stubFalse,"stubFalse");const lodash_es_stubFalse=stubFalse;var isBuffer_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,isBuffer_freeModule=isBuffer_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,isBuffer_Buffer=isBuffer_freeModule&&isBuffer_freeModule.exports===isBuffer_freeExports?_root.Buffer:void 0;const lodash_es_isBuffer=(isBuffer_Buffer?isBuffer_Buffer.isBuffer:void 0)||lodash_es_stubFalse;var isPlainObject_funcProto=Function.prototype,isPlainObject_objectProto=Object.prototype,isPlainObject_funcToString=isPlainObject_funcProto.toString,isPlainObject_hasOwnProperty=isPlainObject_objectProto.hasOwnProperty,objectCtorString=isPlainObject_funcToString.call(Object);function isPlainObject(value){if(!lodash_es_isObjectLike(value)||"[object Object]"!=_baseGetTag(value))return!1;var proto=_getPrototype(value);if(null===proto)return!0;var Ctor=isPlainObject_hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&isPlainObject_funcToString.call(Ctor)==objectCtorString}__name(isPlainObject,"isPlainObject");const lodash_es_isPlainObject=isPlainObject;var typedArrayTags={};function baseIsTypedArray(value){return lodash_es_isObjectLike(value)&&lodash_es_isLength(value.length)&&!!typedArrayTags[_baseGetTag(value)]}typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1,__name(baseIsTypedArray,"baseIsTypedArray");const _baseIsTypedArray=baseIsTypedArray;function baseUnary(func){return function(value){return func(value)}}__name(baseUnary,"baseUnary");const _baseUnary=baseUnary;var _nodeUtil_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,_nodeUtil_freeModule=_nodeUtil_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=_nodeUtil_freeModule&&_nodeUtil_freeModule.exports===_nodeUtil_freeExports&&_freeGlobal.process,nodeUtil=function(){try{return _nodeUtil_freeModule&&_nodeUtil_freeModule.require&&_nodeUtil_freeModule.require("util").types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}();var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;const lodash_es_isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray;function safeGet(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]}__name(safeGet,"safeGet");const _safeGet=safeGet;var _assignValue_hasOwnProperty=Object.prototype.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];(!_assignValue_hasOwnProperty.call(object,key)||!lodash_es_eq(objValue,value)||void 0===value&&!(key in object))&&_baseAssignValue(object,key,value)}__name(assignValue,"assignValue");const _assignValue=assignValue;function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index-1&&value%1==0&&value0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)}}__name(shortOut,"shortOut");const _setToString=shortOut(_baseSetToString);function baseRest(func,start){return _setToString(_overRest(func,start,lodash_es_identity),func+"")}__name(baseRest,"baseRest");const _baseRest=baseRest;function isIterateeCall(value,index,object){if(!lodash_es_isObject(object))return!1;var type=typeof index;return!!("number"==type?lodash_es_isArrayLike(object)&&_isIndex(index,object.length):"string"==type&&index in object)&&lodash_es_eq(object[index],value)}__name(isIterateeCall,"isIterateeCall");const _isIterateeCall=isIterateeCall;function createAssigner(assigner){return _baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&_isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++indexthis.themeChanged(r)))}ngOnChanges(changes){const requireRender=["type"],propertyNames=Object.getOwnPropertyNames(changes);if(propertyNames.some(key=>requireRender.includes(key))||propertyNames.every(key=>changes[key].isFirstChange()))this.render();else{const config=this.getChartConfiguration();this.chart&&(Object.assign(this.chart.config.data,config.data),Object.assign(this.chart.config.plugins,config.plugins),Object.assign(this.chart.config.options,config.options)),this.update()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(s=>s.unsubscribe())}render(){return this.chart&&this.chart.destroy(),this.zone.runOutsideAngular(()=>this.chart=new chart_esm.kL(this.ctx,this.getChartConfiguration()))}update(duration){this.chart&&this.zone.runOutsideAngular(()=>{var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.update(duration)})}hideDataset(index,hidden){this.chart&&(this.chart.getDatasetMeta(index).hidden=hidden,this.update())}isDatasetHidden(index){var _a,_b;return null===(_b=null===(_a=this.chart)||void 0===_a?void 0:_a.getDatasetMeta(index))||void 0===_b?void 0:_b.hidden}toBase64Image(){var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.toBase64Image()}themeChanged(options){this.themeOverrides=options,this.chart&&(Object.assign(this.chart.config.options,this.getChartOptions()),this.update())}getChartOptions(){return lodash_es_merge({onHover:(event,active)=>{!this.chartHover.observed&&!this.chartHover.observers.length||this.zone.run(()=>this.chartHover.emit({event,active}))},onClick:(event,active)=>{!this.chartClick.observed&&!this.chartClick.observers.length||this.zone.run(()=>this.chartClick.emit({event,active}))}},this.themeOverrides,this.options,{plugins:{legend:{display:this.legend}}})}getChartConfiguration(){return{type:this.type,data:this.getChartData(),plugins:this.plugins,options:this.getChartOptions()}}getChartData(){return this.data?this.data:{labels:this.labels||[],datasets:this.datasets||[]}}}__name(BaseChartDirective,"BaseChartDirective"),BaseChartDirective.\u0275fac=__name(function(t){return new(t||BaseChartDirective)(core.Y36(core.SBq),core.Y36(core.R0b),core.Y36(ThemeService))},"BaseChartDirective_Factory"),BaseChartDirective.\u0275dir=core.lG2({type:BaseChartDirective,selectors:[["canvas","baseChart",""]],inputs:{type:"type",legend:"legend",data:"data",options:"options",plugins:"plugins",labels:"labels",datasets:"datasets"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[core.TTD]});const baseColors=[[255,99,132],[54,162,235],[255,206,86],[231,233,237],[75,192,192],[151,187,205],[220,220,220],[247,70,74],[70,191,189],[253,180,92],[148,159,177],[77,83,96]],builtInDefaults={datasets:{line:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.4),borderColor:context=>rgba(generateColor(context.datasetIndex),1),pointBackgroundColor:context=>rgba(generateColor(context.datasetIndex),1),pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:context=>rgba(generateColor(context.datasetIndex),.8)},bar:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.6),borderColor:context=>rgba(generateColor(context.datasetIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.datasetIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.datasetIndex),1)},get radar(){return this.line},doughnut:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:"#fff",hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),1),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get pie(){return this.doughnut},polarArea:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:context=>rgba(generateColor(context.dataIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get bubble(){return this.doughnut},get scatter(){return this.doughnut},get area(){return this.polarArea}}};function rgba(colour,alpha){return"rgba("+colour.concat(alpha).join(",")+")"}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getRandomColor(){return[getRandomInt(0,255),getRandomInt(0,255),getRandomInt(0,255)]}function generateColor(index=0){return baseColors[index]||getRandomColor()}__name(rgba,"rgba"),__name(getRandomInt,"getRandomInt"),__name(getRandomColor,"getRandomColor"),__name(generateColor,"generateColor"),chart_esm.kL.register(chart_esm.Dx,chart_esm.u,chart_esm.Gu,chart_esm.De,chart_esm.ST,chart_esm.jn,chart_esm.od,chart_esm.f$,chart_esm.uw,chart_esm.vn,chart_esm.ZL,chart_esm.jI,chart_esm.qi,chart_esm.Xi,chart_esm.l7,chart_esm.tt,chart_esm.CV,chart_esm.N0,chart_esm.ho,chart_esm.RM);class NgChartsConfiguration{}__name(NgChartsConfiguration,"NgChartsConfiguration"),NgChartsConfiguration.\u0275fac=__name(function(t){return new(t||NgChartsConfiguration)},"NgChartsConfiguration_Factory"),NgChartsConfiguration.\u0275prov=core.Yz7({token:NgChartsConfiguration,factory:NgChartsConfiguration.\u0275fac,providedIn:"root"});class NgChartsModule{constructor(config){null!=config&&config.plugins&&chart_esm.kL.register(...null==config?void 0:config.plugins);const ngChartsDefaults=lodash_es_merge(builtInDefaults,(null==config?void 0:config.defaults)||{});chart_esm.ce.set(ngChartsDefaults)}static forRoot(config){return{ngModule:NgChartsModule,providers:[{provide:NgChartsConfiguration,useValue:config}]}}}__name(NgChartsModule,"NgChartsModule"),NgChartsModule.\u0275fac=__name(function(t){return new(t||NgChartsModule)(core.LFG(NgChartsConfiguration,8))},"NgChartsModule_Factory"),NgChartsModule.\u0275mod=core.oAB({type:NgChartsModule}),NgChartsModule.\u0275inj=core.cJS({imports:[[]]});var http=__webpack_require__(40520),ngx_translate_core=__webpack_require__(81981),ngx_translate_http_loader=__webpack_require__(80040);function HttpLoaderFactory(http2){return new ngx_translate_http_loader.w(http2)}__name(HttpLoaderFactory,"HttpLoaderFactory");class SharedModule{}__name(SharedModule,"SharedModule"),SharedModule.\u0275fac=__name(function(t){return new(t||SharedModule)},"SharedModule_Factory"),SharedModule.\u0275mod=core.oAB({type:SharedModule}),SharedModule.\u0275inj=core.cJS({imports:[common.ez,angular_datatables.T,fesm2015_forms.UX,fesm2015_forms.u5,NgChartsModule,http.JF,ngx_translate_core.aw.forChild({loader:{provide:ngx_translate_core.Zw,useFactory:HttpLoaderFactory,deps:[http.eN]}}),ngx_translate_core.aw]})},34393:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{qi:()=>ArcElement,vn:()=>BarController,ZL:()=>BarElement,N0:()=>BubbleController,uw:()=>CategoryScale,kL:()=>Chart,jI:()=>DoughnutController,Gu:()=>index,De:()=>plugin_legend,ST:()=>LineController,jn:()=>LineElement,f$:()=>LinearScale,tt:()=>PieController,od:()=>PointElement,CV:()=>PolarAreaController,Xi:()=>RadarController,l7:()=>RadialLinearScale,ho:()=>ScatterController,RM:()=>TimeSeriesScale,Dx:()=>plugin_title,u:()=>plugin_tooltip,ce:()=>defaults}),__name(function fontString(pixelSize,fontStyle,fontFamily){return fontStyle+" "+pixelSize+"px "+fontFamily},"fontString");const requestAnimFrame="undefined"==typeof window?function(callback2){return callback2()}:window.requestAnimationFrame;function throttled(fn,thisArg,updateFn){const updateArgs=updateFn||(args2=>Array.prototype.slice.call(args2));let ticking=!1,args=[];return function(...rest){args=updateArgs(rest),ticking||(ticking=!0,requestAnimFrame.call(window,()=>{ticking=!1,fn.apply(thisArg,args)}))}}function debounce(fn,delay){let timeout;return function(...args){return delay?(clearTimeout(timeout),timeout=setTimeout(fn,delay,args)):fn.apply(this,args),delay}}__name(throttled,"throttled"),__name(debounce,"debounce");const _toLeftRightCenter=__name(align=>"start"===align?"left":"end"===align?"right":"center","_toLeftRightCenter"),_alignStartEnd=__name((align,start,end)=>"start"===align?start:"end"===align?end:(start+end)/2,"_alignStartEnd"),_textX=__name((align,left,right,rtl)=>align===(rtl?"left":"right")?right:"center"===align?(left+right)/2:left,"_textX");function noop(){}__name(noop,"noop");const uid=function(){let id=0;return function(){return id++}}();function isNullOrUndef(value){return null==value}function isArray(value){if(Array.isArray&&Array.isArray(value))return!0;const type=Object.prototype.toString.call(value);return"[object"===type.slice(0,7)&&"Array]"===type.slice(-6)}function isObject(value){return null!==value&&"[object Object]"===Object.prototype.toString.call(value)}__name(isNullOrUndef,"isNullOrUndef"),__name(isArray,"isArray"),__name(isObject,"isObject");const isNumberFinite=__name(value=>("number"==typeof value||value instanceof Number)&&isFinite(+value),"isNumberFinite");function finiteOrDefault(value,defaultValue){return isNumberFinite(value)?value:defaultValue}function valueOrDefault(value,defaultValue){return void 0===value?defaultValue:value}__name(finiteOrDefault,"finiteOrDefault"),__name(valueOrDefault,"valueOrDefault");const toPercentage=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100:value/dimension,"toPercentage"),toDimension=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100*dimension:+value,"toDimension");function callback(fn,args,thisArg){if(fn&&"function"==typeof fn.call)return fn.apply(thisArg,args)}function each(loopable,fn,thisArg,reverse){let i,len,keys;if(isArray(loopable))if(len=loopable.length,reverse)for(i=len-1;i>=0;i--)fn.call(thisArg,loopable[i],i);else for(i=0;ipos;)obj=obj[key.slice(pos,idx)],pos=idx+1,idx=indexOfDotOrLength(key,pos);return obj}function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1)}__name(indexOfDotOrLength,"indexOfDotOrLength"),__name(resolveObjectKey,"resolveObjectKey"),__name(_capitalize,"_capitalize");const defined=__name(value=>void 0!==value,"defined"),isFunction=__name(value=>"function"==typeof value,"isFunction"),setsEqual=__name((a,b)=>{if(a.size!==b.size)return!1;for(const item of a)if(!b.has(item))return!1;return!0},"setsEqual");function _isClickEvent(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}__name(_isClickEvent,"_isClickEvent");const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=2*PI/3,log10=Math.log10,sign=Math.sign;function niceNum(range){const roundedRange=Math.round(range);range=almostEquals(range,roundedRange,range/1e3)?roundedRange:range;const niceRange=Math.pow(10,Math.floor(log10(range))),fraction=range/niceRange;return(fraction<=1?1:fraction<=2?2:fraction<=5?5:10)*niceRange}function _factorize(value){const result=[],sqrt=Math.sqrt(value);let i;for(i=1;ia-b).pop(),result}function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}function almostEquals(x,y,epsilon){return Math.abs(x-y)=x}function _setMinAndMaxByKey(array,target,property){let i,ilen,value;for(i=0,ilen=array.length;iangleToEnd&&startToAngle=Math.min(start,end)-epsilon&&value<=Math.max(start,end)+epsilon}__name(niceNum,"niceNum"),__name(_factorize,"_factorize"),__name(isNumber,"isNumber"),__name(almostEquals,"almostEquals"),__name(almostWhole,"almostWhole"),__name(_setMinAndMaxByKey,"_setMinAndMaxByKey"),__name(toRadians,"toRadians"),__name(toDegrees,"toDegrees"),__name(_decimalPlaces,"_decimalPlaces"),__name(getAngleFromPoint,"getAngleFromPoint"),__name(distanceBetweenPoints,"distanceBetweenPoints"),__name(_angleDiff,"_angleDiff"),__name(_normalizeAngle,"_normalizeAngle"),__name(_angleBetween,"_angleBetween"),__name(_limitValue,"_limitValue"),__name(_int16Range,"_int16Range"),__name(_isBetween,"_isBetween");const atEdge=__name(t=>0===t||1===t,"atEdge"),elasticIn=__name((t,s,p)=>-Math.pow(2,10*(t-=1))*Math.sin((t-s)*TAU/p),"elasticIn"),elasticOut=__name((t,s,p)=>Math.pow(2,-10*t)*Math.sin((t-s)*TAU/p)+1,"elasticOut"),effects={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*HALF_PI),easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>atEdge(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic:t=>atEdge(t)?t:t<.5?.5*elasticIn(2*t,.1125,.45):.5+.5*elasticOut(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let s=1.70158;return(t/=.5)<1?t*t*((1+(s*=1.525))*t-s)*.5:.5*((t-=2)*t*((1+(s*=1.525))*t+s)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,easeInOutBounce:t=>t<.5?.5*effects.easeInBounce(2*t):.5*effects.easeOutBounce(2*t-1)+.5};function round(v){return v+.5|0}__name(round,"round");const lim=__name((v,l,h)=>Math.max(Math.min(v,h),l),"lim");function p2b(v){return lim(round(2.55*v),0,255)}function n2b(v){return lim(round(255*v),0,255)}function b2n(v){return lim(round(v/2.55)/100,0,1)}function n2p(v){return lim(round(100*v),0,100)}__name(p2b,"p2b"),__name(n2b,"n2b"),__name(b2n,"b2n"),__name(n2p,"n2p");const map$1={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},hex=[..."0123456789ABCDEF"],h1=__name(b=>hex[15&b],"h1"),h2=__name(b=>hex[(240&b)>>4]+hex[15&b],"h2"),eq=__name(b=>(240&b)>>4==(15&b),"eq"),isShort=__name(v=>eq(v.r)&&eq(v.g)&&eq(v.b)&&eq(v.a),"isShort");function hexParse(str){var ret,len=str.length;return"#"===str[0]&&(4===len||5===len?ret={r:255&17*map$1[str[1]],g:255&17*map$1[str[2]],b:255&17*map$1[str[3]],a:5===len?17*map$1[str[4]]:255}:(7===len||9===len)&&(ret={r:map$1[str[1]]<<4|map$1[str[2]],g:map$1[str[3]]<<4|map$1[str[4]],b:map$1[str[5]]<<4|map$1[str[6]],a:9===len?map$1[str[7]]<<4|map$1[str[8]]:255})),ret}__name(hexParse,"hexParse");const alpha=__name((a,f)=>a<255?f(a):"","alpha");function hexString(v){var f=isShort(v)?h1:h2;return v?"#"+f(v.r)+f(v.g)+f(v.b)+alpha(v.a,f):void 0}__name(hexString,"hexString");const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(h,s,l){const a=s*Math.min(l,1-l),f=__name((n,k=(n+h/30)%12)=>l-a*Math.max(Math.min(k-3,9-k,1),-1),"f");return[f(0),f(8),f(4)]}function hsv2rgbn(h,s,v){const f=__name((n,k=(n+h/60)%6)=>v-v*s*Math.max(Math.min(k,4-k,1),0),"f");return[f(5),f(3),f(1)]}function hwb2rgbn(h,w,b){const rgb=hsl2rgbn(h,1,.5);let i;for(w+b>1&&(i=1/(w+b),w*=i,b*=i),i=0;i<3;i++)rgb[i]*=1-w-b,rgb[i]+=w;return rgb}function hueValue(r,g,b,d,max){return r===max?(g-b)/d+(g.5?d/(2-max-min):d/(max+min),h=hueValue(r,g,b,d,max),h=60*h+.5),[0|h,s||0,l]}function calln(f,a,b,c){return(Array.isArray(a)?f(a[0],a[1],a[2]):f(a,b,c)).map(n2b)}function hsl2rgb(h,s,l){return calln(hsl2rgbn,h,s,l)}function hwb2rgb(h,w,b){return calln(hwb2rgbn,h,w,b)}function hsv2rgb(h,s,v){return calln(hsv2rgbn,h,s,v)}function hue(h){return(h%360+360)%360}function hueParse(str){const m=HUE_RE.exec(str);let v,a=255;if(!m)return;m[5]!==v&&(a=m[6]?p2b(+m[5]):n2b(+m[5]));const h=hue(+m[2]),p1=+m[3]/100,p2=+m[4]/100;return v="hwb"===m[1]?hwb2rgb(h,p1,p2):"hsv"===m[1]?hsv2rgb(h,p1,p2):hsl2rgb(h,p1,p2),{r:v[0],g:v[1],b:v[2],a}}function rotate(v,deg){var h=rgb2hsl(v);h[0]=hue(h[0]+deg),h=hsl2rgb(h),v.r=h[0],v.g=h[1],v.b=h[2]}function hslString(v){if(!v)return;const a=rgb2hsl(v),h=a[0],s=n2p(a[1]),l=n2p(a[2]);return v.a<255?`hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`:`hsl(${h}, ${s}%, ${l}%)`}__name(hsl2rgbn,"hsl2rgbn"),__name(hsv2rgbn,"hsv2rgbn"),__name(hwb2rgbn,"hwb2rgbn"),__name(hueValue,"hueValue"),__name(rgb2hsl,"rgb2hsl"),__name(calln,"calln"),__name(hsl2rgb,"hsl2rgb"),__name(hwb2rgb,"hwb2rgb"),__name(hsv2rgb,"hsv2rgb"),__name(hue,"hue"),__name(hueParse,"hueParse"),__name(rotate,"rotate"),__name(hslString,"hslString");const map={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"},names$1={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 unpack(){const unpacked={},keys=Object.keys(names$1),tkeys=Object.keys(map);let i,j,k,ok,nk;for(i=0;i>16&255,k>>8&255,255&k]}return unpacked}let names;function nameParse(str){names||(names=unpack(),names.transparent=[0,0,0,0]);const a=names[str.toLowerCase()];return a&&{r:a[0],g:a[1],b:a[2],a:4===a.length?a[3]:255}}__name(unpack,"unpack"),__name(nameParse,"nameParse");const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(str){const m=RGB_RE.exec(str);let r,g,b,a=255;if(m){if(m[7]!==r){const v=+m[7];a=m[8]?p2b(v):lim(255*v,0,255)}return r=+m[1],g=+m[3],b=+m[5],r=255&(m[2]?p2b(r):lim(r,0,255)),g=255&(m[4]?p2b(g):lim(g,0,255)),b=255&(m[6]?p2b(b):lim(b,0,255)),{r,g,b,a}}}function rgbString(v){return v&&(v.a<255?`rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`:`rgb(${v.r}, ${v.g}, ${v.b})`)}__name(rgbParse,"rgbParse"),__name(rgbString,"rgbString");const to=__name(v=>v<=.0031308?12.92*v:1.055*Math.pow(v,1/2.4)-.055,"to"),from=__name(v=>v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4),"from");function interpolate(rgb1,rgb2,t){const r=from(b2n(rgb1.r)),g=from(b2n(rgb1.g)),b=from(b2n(rgb1.b));return{r:n2b(to(r+t*(from(b2n(rgb2.r))-r))),g:n2b(to(g+t*(from(b2n(rgb2.g))-g))),b:n2b(to(b+t*(from(b2n(rgb2.b))-b))),a:rgb1.a+t*(rgb2.a-rgb1.a)}}function modHSL(v,i,ratio){if(v){let tmp=rgb2hsl(v);tmp[i]=Math.max(0,Math.min(tmp[i]+tmp[i]*ratio,0===i?360:1)),tmp=hsl2rgb(tmp),v.r=tmp[0],v.g=tmp[1],v.b=tmp[2]}}function clone(v,proto){return v&&Object.assign(proto||{},v)}function fromObject(input){var v={r:0,g:0,b:0,a:255};return Array.isArray(input)?input.length>=3&&(v={r:input[0],g:input[1],b:input[2],a:255},input.length>3&&(v.a=n2b(input[3]))):(v=clone(input,{r:0,g:0,b:0,a:1})).a=n2b(v.a),v}function functionParse(str){return"r"===str.charAt(0)?rgbParse(str):hueParse(str)}__name(interpolate,"interpolate"),__name(modHSL,"modHSL"),__name(clone,"clone"),__name(fromObject,"fromObject"),__name(functionParse,"functionParse");class Color{constructor(input){if(input instanceof Color)return input;const type=typeof input;let v;"object"===type?v=fromObject(input):"string"===type&&(v=hexParse(input)||nameParse(input)||functionParse(input)),this._rgb=v,this._valid=!!v}get valid(){return this._valid}get rgb(){var v=clone(this._rgb);return v&&(v.a=b2n(v.a)),v}set rgb(obj){this._rgb=fromObject(obj)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(color2,weight){if(color2){const c1=this.rgb,c2=color2.rgb;let w2;const p=weight===w2?.5:weight,w=2*p-1,a=c1.a-c2.a,w1=((w*a==-1?w:(w+a)/(1+w*a))+1)/2;w2=1-w1,c1.r=255&w1*c1.r+w2*c2.r+.5,c1.g=255&w1*c1.g+w2*c2.g+.5,c1.b=255&w1*c1.b+w2*c2.b+.5,c1.a=p*c1.a+(1-p)*c2.a,this.rgb=c1}return this}interpolate(color2,t){return color2&&(this._rgb=interpolate(this._rgb,color2._rgb,t)),this}clone(){return new Color(this.rgb)}alpha(a){return this._rgb.a=n2b(a),this}clearer(ratio){return this._rgb.a*=1-ratio,this}greyscale(){const rgb=this._rgb,val=round(.3*rgb.r+.59*rgb.g+.11*rgb.b);return rgb.r=rgb.g=rgb.b=val,this}opaquer(ratio){return this._rgb.a*=1+ratio,this}negate(){const v=this._rgb;return v.r=255-v.r,v.g=255-v.g,v.b=255-v.b,this}lighten(ratio){return modHSL(this._rgb,2,ratio),this}darken(ratio){return modHSL(this._rgb,2,-ratio),this}saturate(ratio){return modHSL(this._rgb,1,ratio),this}desaturate(ratio){return modHSL(this._rgb,1,-ratio),this}rotate(deg){return rotate(this._rgb,deg),this}}function index_esm(input){return new Color(input)}function isPatternOrGradient(value){if(value&&"object"==typeof value){const type=value.toString();return"[object CanvasPattern]"===type||"[object CanvasGradient]"===type}return!1}function color(value){return isPatternOrGradient(value)?value:index_esm(value)}function getHoverColor(value){return isPatternOrGradient(value)?value:index_esm(value).saturate(.5).darken(.1).hexString()}__name(Color,"Color"),__name(index_esm,"index_esm"),__name(isPatternOrGradient,"isPatternOrGradient"),__name(color,"color"),__name(getHoverColor,"getHoverColor");const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(node,key){if(!key)return node;const keys=key.split(".");for(let i=0,n=keys.length;icontext.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=(ctx,options)=>getHoverColor(options.backgroundColor),this.hoverBorderColor=(ctx,options)=>getHoverColor(options.borderColor),this.hoverColor=(ctx,options)=>getHoverColor(options.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(_descriptors2)}set(scope,values){return set(this,scope,values)}get(scope){return getScope$1(this,scope)}describe(scope,values){return set(descriptors,scope,values)}override(scope,values){return set(overrides,scope,values)}route(scope,name,targetScope,targetName){const scopeObject=getScope$1(this,scope),targetScopeObject=getScope$1(this,targetScope),privateName="_"+name;Object.defineProperties(scopeObject,{[privateName]:{value:scopeObject[name],writable:!0},[name]:{enumerable:!0,get(){const local=this[privateName],target=targetScopeObject[targetName];return isObject(local)?Object.assign({},target,local):valueOrDefault(local,target)},set(value){this[privateName]=value}}})}}__name(Defaults,"Defaults");var defaults=new Defaults({_scriptable:name=>!name.startsWith("on"),_indexable:name=>"events"!==name,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function toFontString(font){return!font||isNullOrUndef(font.size)||isNullOrUndef(font.family)?null:(font.style?font.style+" ":"")+(font.weight?font.weight+" ":"")+font.size+"px "+font.family}function _measureText(ctx,data,gc,longest,string){let textWidth=data[string];return textWidth||(textWidth=data[string]=ctx.measureText(string).width,gc.push(string)),textWidth>longest&&(longest=textWidth),longest}function _longestText(ctx,font,arrayOfThings,cache){let data=(cache=cache||{}).data=cache.data||{},gc=cache.garbageCollect=cache.garbageCollect||[];cache.font!==font&&(data=cache.data={},gc=cache.garbageCollect=[],cache.font=font),ctx.save(),ctx.font=font;let longest=0;const ilen=arrayOfThings.length;let i,j,jlen,thing,nestedThing;for(i=0;iarrayOfThings.length){for(i=0;i0&&ctx.stroke()}}function _isPointInArea(point,area,margin){return margin=margin||.5,!area||point&&point.x>area.left-margin&&point.xarea.top-margin&&point.y0&&""!==opts.strokeColor;let i,line;for(ctx.save(),ctx.font=font.string,setRenderOpts(ctx,opts),i=0;i+v||0,"numberOrZero");function _readValueToProps(value,props){const ret={},objProps=isObject(props),keys=objProps?Object.keys(props):props,read=isObject(value)?objProps?prop=>valueOrDefault(value[prop],value[props[prop]]):prop=>value[prop]:()=>value;for(const prop of keys)ret[prop]=numberOrZero(read(prop));return ret}function toTRBL(value){return _readValueToProps(value,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(value){return _readValueToProps(value,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(value){const obj=toTRBL(value);return obj.width=obj.left+obj.right,obj.height=obj.top+obj.bottom,obj}function toFont(options,fallback){options=options||{},fallback=fallback||defaults.font;let size=valueOrDefault(options.size,fallback.size);"string"==typeof size&&(size=parseInt(size,10));let style=valueOrDefault(options.style,fallback.style);style&&!(""+style).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+style+'"'),style="");const font={family:valueOrDefault(options.family,fallback.family),lineHeight:toLineHeight(valueOrDefault(options.lineHeight,fallback.lineHeight),size),size,style,weight:valueOrDefault(options.weight,fallback.weight),string:""};return font.string=toFontString(font),font}function resolve(inputs,context,index2,info){let i,ilen,value,cacheable=!0;for(i=0,ilen=inputs.length;ibeginAtZero&&0===value?0:value+add,"keepZero");return{min:keepZero(min,-Math.abs(change)),max:keepZero(max,change)}}function createContext(parentContext,context){return Object.assign(Object.create(parentContext),context)}function _lookup(table,value,cmp){cmp=cmp||(index2=>table[index2]1;)mid=lo+hi>>1,cmp(mid)?lo=mid:hi=mid;return{lo,hi}}__name(_readValueToProps,"_readValueToProps"),__name(toTRBL,"toTRBL"),__name(toTRBLCorners,"toTRBLCorners"),__name(toPadding,"toPadding"),__name(toFont,"toFont"),__name(resolve,"resolve"),__name(_addGrace,"_addGrace"),__name(createContext,"createContext"),__name(_lookup,"_lookup");const _lookupByKey=__name((table,key,value)=>_lookup(table,value,index2=>table[index2][key]_lookup(table,value,index2=>table[index2][key]>=value),"_rlookupByKey");function _filterBetween(values,min,max){let start=0,end=values.length;for(;startstart&&values[end-1]>max;)end--;return start>0||end{const method="_onData"+_capitalize(key),base=array[key];Object.defineProperty(array,key,{configurable:!0,enumerable:!1,value(...args){const res=base.apply(this,args);return array._chartjs.listeners.forEach(object=>{"function"==typeof object[method]&&object[method](...args)}),res}})}))}function unlistenArrayEvents(array,listener){const stub=array._chartjs;if(!stub)return;const listeners=stub.listeners,index2=listeners.indexOf(listener);-1!==index2&&listeners.splice(index2,1),!(listeners.length>0)&&(arrayEvents.forEach(key=>{delete array[key]}),delete array._chartjs)}function _arrayUnique(items){const set2=new Set;let i,ilen;for(i=0,ilen=items.length;iscopes[0])){defined(fallback)||(fallback=_resolve("_fallback",scopes));const cache={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:scopes,_rootScopes:rootScopes,_fallback:fallback,_getTarget:getTarget,override:scope=>_createResolver([scope,...scopes],prefixes,rootScopes,fallback)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete target._keys,delete scopes[0][prop],!0),get:(target,prop)=>_cached(target,prop,()=>_resolveWithPrefixes(prop,prefixes,scopes,target)),getOwnPropertyDescriptor:(target,prop)=>Reflect.getOwnPropertyDescriptor(target._scopes[0],prop),getPrototypeOf:()=>Reflect.getPrototypeOf(scopes[0]),has:(target,prop)=>getKeysFromAllScopes(target).includes(prop),ownKeys:target=>getKeysFromAllScopes(target),set(target,prop,value){const storage=target._storage||(target._storage=getTarget());return target[prop]=storage[prop]=value,delete target._keys,!0}})}function _attachContext(proxy,context,subProxy,descriptorDefaults){const cache={_cacheable:!1,_proxy:proxy,_context:context,_subProxy:subProxy,_stack:new Set,_descriptors:_descriptors(proxy,descriptorDefaults),setContext:ctx=>_attachContext(proxy,ctx,subProxy,descriptorDefaults),override:scope=>_attachContext(proxy.override(scope),context,subProxy,descriptorDefaults)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete proxy[prop],!0),get:(target,prop,receiver)=>_cached(target,prop,()=>_resolveWithContext(target,prop,receiver)),getOwnPropertyDescriptor:(target,prop)=>target._descriptors.allKeys?Reflect.has(proxy,prop)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(proxy,prop),getPrototypeOf:()=>Reflect.getPrototypeOf(proxy),has:(target,prop)=>Reflect.has(proxy,prop),ownKeys:()=>Reflect.ownKeys(proxy),set:(target,prop,value)=>(proxy[prop]=value,delete target[prop],!0)})}function _descriptors(proxy,defaults2={scriptable:!0,indexable:!0}){const{_scriptable=defaults2.scriptable,_indexable=defaults2.indexable,_allKeys=defaults2.allKeys}=proxy;return{allKeys:_allKeys,scriptable:_scriptable,indexable:_indexable,isScriptable:isFunction(_scriptable)?_scriptable:()=>_scriptable,isIndexable:isFunction(_indexable)?_indexable:()=>_indexable}}__name(listenArrayEvents,"listenArrayEvents"),__name(unlistenArrayEvents,"unlistenArrayEvents"),__name(_arrayUnique,"_arrayUnique"),__name(_createResolver,"_createResolver"),__name(_attachContext,"_attachContext"),__name(_descriptors,"_descriptors");const readKey=__name((prefix,name)=>prefix?prefix+_capitalize(name):name,"readKey"),needsSubResolver=__name((prop,value)=>isObject(value)&&"adapters"!==prop&&(null===Object.getPrototypeOf(value)||value.constructor===Object),"needsSubResolver");function _cached(target,prop,resolve2){if(Object.prototype.hasOwnProperty.call(target,prop))return target[prop];const value=resolve2();return target[prop]=value,value}function _resolveWithContext(target,prop,receiver){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;let value=_proxy[prop];return isFunction(value)&&descriptors2.isScriptable(prop)&&(value=_resolveScriptable(prop,value,target,receiver)),isArray(value)&&value.length&&(value=_resolveArray(prop,value,target,descriptors2.isIndexable)),needsSubResolver(prop,value)&&(value=_attachContext(value,_context,_subProxy&&_subProxy[prop],descriptors2)),value}function _resolveScriptable(prop,value,target,receiver){const{_proxy,_context,_subProxy,_stack}=target;if(_stack.has(prop))throw new Error("Recursion detected: "+Array.from(_stack).join("->")+"->"+prop);return _stack.add(prop),value=value(_context,_subProxy||receiver),_stack.delete(prop),needsSubResolver(prop,value)&&(value=createSubResolver(_proxy._scopes,_proxy,prop,value)),value}function _resolveArray(prop,value,target,isIndexable){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;if(defined(_context.index)&&isIndexable(prop))value=value[_context.index%value.length];else if(isObject(value[0])){const arr=value,scopes=_proxy._scopes.filter(s=>s!==arr);value=[];for(const item of arr){const resolver=createSubResolver(scopes,_proxy,prop,item);value.push(_attachContext(resolver,_context,_subProxy&&_subProxy[prop],descriptors2))}}return value}function resolveFallback(fallback,prop,value){return isFunction(fallback)?fallback(prop,value):fallback}__name(_cached,"_cached"),__name(_resolveWithContext,"_resolveWithContext"),__name(_resolveScriptable,"_resolveScriptable"),__name(_resolveArray,"_resolveArray"),__name(resolveFallback,"resolveFallback");const getScope=__name((key,parent)=>!0===key?parent:"string"==typeof key?resolveObjectKey(parent,key):void 0,"getScope");function addScopes(set2,parentScopes,key,parentFallback,value){for(const parent of parentScopes){const scope=getScope(key,parent);if(scope){set2.add(scope);const fallback=resolveFallback(scope._fallback,key,value);if(defined(fallback)&&fallback!==key&&fallback!==parentFallback)return fallback}else if(!1===scope&&defined(parentFallback)&&key!==parentFallback)return null}return!1}function createSubResolver(parentScopes,resolver,prop,value){const rootScopes=resolver._rootScopes,fallback=resolveFallback(resolver._fallback,prop,value),allScopes=[...parentScopes,...rootScopes],set2=new Set;set2.add(value);let key=addScopesFromKey(set2,allScopes,prop,fallback||prop,value);return!(null===key||defined(fallback)&&fallback!==prop&&(key=addScopesFromKey(set2,allScopes,fallback,key,value),null===key))&&_createResolver(Array.from(set2),[""],rootScopes,fallback,()=>subGetTarget(resolver,prop,value))}function addScopesFromKey(set2,allScopes,key,fallback,item){for(;key;)key=addScopes(set2,allScopes,key,fallback,item);return key}function subGetTarget(resolver,prop,value){const parent=resolver._getTarget();prop in parent||(parent[prop]={});const target=parent[prop];return isArray(target)&&isObject(value)?value:target}function _resolveWithPrefixes(prop,prefixes,scopes,proxy){let value;for(const prefix of prefixes)if(value=_resolve(readKey(prefix,prop),scopes),defined(value))return needsSubResolver(prop,value)?createSubResolver(scopes,proxy,prop,value):value}function _resolve(key,scopes){for(const scope of scopes){if(!scope)continue;const value=scope[key];if(defined(value))return value}}function getKeysFromAllScopes(target){let keys=target._keys;return keys||(keys=target._keys=resolveKeysFromAllScopes(target._scopes)),keys}function resolveKeysFromAllScopes(scopes){const set2=new Set;for(const scope of scopes)for(const key of Object.keys(scope).filter(k=>!k.startsWith("_")))set2.add(key);return Array.from(set2)}function _parseObjectDataRadialScale(meta,data,start,count){const{iScale}=meta,{key="r"}=this._parsing,parsed=new Array(count);let i,ilen,index2,item;for(i=0,ilen=count;ii"x"===indexAxis?"y":"x","getValueAxis");function splineCurve(firstPoint,middlePoint,afterPoint,t){const previous=firstPoint.skip?middlePoint:firstPoint,current=middlePoint,next=afterPoint.skip?middlePoint:afterPoint,d01=distanceBetweenPoints(current,previous),d12=distanceBetweenPoints(next,current);let s01=d01/(d01+d12),s12=d12/(d01+d12);s01=isNaN(s01)?0:s01,s12=isNaN(s12)?0:s12;const fa=t*s01,fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}}}function monotoneAdjust(points,deltaK,mK){const pointsLen=points.length;let alphaK,betaK,tauK,squaredMagnitude,pointCurrent,pointAfter=getPoint(points,0);for(let i=0;i!pt.skip)),"monotone"===options.cubicInterpolationMode)splineCurveMonotone(points,indexAxis);else{let prev=loop?points[points.length-1]:points[0];for(i=0,ilen=points.length;iwindow.getComputedStyle(element,null),"getComputedStyle");function getStyle(el,property){return getComputedStyle(el).getPropertyValue(property)}__name(getStyle,"getStyle");const positions=["top","right","bottom","left"];function getPositionedStyle(styles,style,suffix){const result={};suffix=suffix?"-"+suffix:"";for(let i=0;i<4;i++){const pos=positions[i];result[pos]=parseFloat(styles[style+"-"+pos+suffix])||0}return result.width=result.left+result.right,result.height=result.top+result.bottom,result}__name(getPositionedStyle,"getPositionedStyle");const useOffsetPos=__name((x,y,target)=>(x>0||y>0)&&(!target||!target.shadowRoot),"useOffsetPos");function getCanvasPosition(e,canvas){const touches=e.touches,source=touches&&touches.length?touches[0]:e,{offsetX,offsetY}=source;let x,y,box=!1;if(useOffsetPos(offsetX,offsetY,e.target))x=offsetX,y=offsetY;else{const rect=canvas.getBoundingClientRect();x=source.clientX-rect.left,y=source.clientY-rect.top,box=!0}return{x,y,box}}function getRelativePosition(evt,chart){if("native"in evt)return evt;const{canvas,currentDevicePixelRatio}=chart,style=getComputedStyle(canvas),borderBox="border-box"===style.boxSizing,paddings=getPositionedStyle(style,"padding"),borders=getPositionedStyle(style,"border","width"),{x,y,box}=getCanvasPosition(evt,canvas),xOffset=paddings.left+(box&&borders.left),yOffset=paddings.top+(box&&borders.top);let{width,height}=chart;return borderBox&&(width-=paddings.width+borders.width,height-=paddings.height+borders.height),{x:Math.round((x-xOffset)/width*canvas.width/currentDevicePixelRatio),y:Math.round((y-yOffset)/height*canvas.height/currentDevicePixelRatio)}}function getContainerSize(canvas,width,height){let maxWidth,maxHeight;if(void 0===width||void 0===height){const container=_getParentNode(canvas);if(container){const rect=container.getBoundingClientRect(),containerStyle=getComputedStyle(container),containerBorder=getPositionedStyle(containerStyle,"border","width"),containerPadding=getPositionedStyle(containerStyle,"padding");width=rect.width-containerPadding.width-containerBorder.width,height=rect.height-containerPadding.height-containerBorder.height,maxWidth=parseMaxStyle(containerStyle.maxWidth,container,"clientWidth"),maxHeight=parseMaxStyle(containerStyle.maxHeight,container,"clientHeight")}else width=canvas.clientWidth,height=canvas.clientHeight}return{width,height,maxWidth:maxWidth||INFINITY,maxHeight:maxHeight||INFINITY}}__name(getCanvasPosition,"getCanvasPosition"),__name(getRelativePosition,"getRelativePosition"),__name(getContainerSize,"getContainerSize");const round1=__name(v=>Math.round(10*v)/10,"round1");function getMaximumSize(canvas,bbWidth,bbHeight,aspectRatio){const style=getComputedStyle(canvas),margins=getPositionedStyle(style,"margin"),maxWidth=parseMaxStyle(style.maxWidth,canvas,"clientWidth")||INFINITY,maxHeight=parseMaxStyle(style.maxHeight,canvas,"clientHeight")||INFINITY,containerSize=getContainerSize(canvas,bbWidth,bbHeight);let{width,height}=containerSize;if("content-box"===style.boxSizing){const borders=getPositionedStyle(style,"border","width"),paddings=getPositionedStyle(style,"padding");width-=paddings.width+borders.width,height-=paddings.height+borders.height}return width=Math.max(0,width-margins.width),height=Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height-margins.height),width=round1(Math.min(width,maxWidth,containerSize.maxWidth)),height=round1(Math.min(height,maxHeight,containerSize.maxHeight)),width&&!height&&(height=round1(width/2)),{width,height}}function retinaScale(chart,forceRatio,forceStyle){const pixelRatio=forceRatio||1,deviceHeight=Math.floor(chart.height*pixelRatio),deviceWidth=Math.floor(chart.width*pixelRatio);chart.height=deviceHeight/pixelRatio,chart.width=deviceWidth/pixelRatio;const canvas=chart.canvas;return canvas.style&&(forceStyle||!canvas.style.height&&!canvas.style.width)&&(canvas.style.height=`${chart.height}px`,canvas.style.width=`${chart.width}px`),(chart.currentDevicePixelRatio!==pixelRatio||canvas.height!==deviceHeight||canvas.width!==deviceWidth)&&(chart.currentDevicePixelRatio=pixelRatio,canvas.height=deviceHeight,canvas.width=deviceWidth,chart.ctx.setTransform(pixelRatio,0,0,pixelRatio,0,0),!0)}__name(getMaximumSize,"getMaximumSize"),__name(retinaScale,"retinaScale");const supportsEventListenerOptions=function(){let passiveSupported=!1;try{const options={get passive(){return passiveSupported=!0,!1}};window.addEventListener("test",null,options),window.removeEventListener("test",null,options)}catch{}return passiveSupported}();function readUsedSize(element,property){const value=getStyle(element,property),matches=value&&value.match(/^(\d+)(\.\d+)?px$/);return matches?+matches[1]:void 0}function _pointInLine(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:p1.y+t*(p2.y-p1.y)}}function _steppedInterpolation(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:"middle"===mode?t<.5?p1.y:p2.y:"after"===mode?t<1?p1.y:p2.y:t>0?p2.y:p1.y}}function _bezierInterpolation(p1,p2,t,mode){const cp1={x:p1.cp2x,y:p1.cp2y},cp2={x:p2.cp1x,y:p2.cp1y},a=_pointInLine(p1,cp1,t),b=_pointInLine(cp1,cp2,t),c=_pointInLine(cp2,p2,t),d=_pointInLine(a,b,t),e=_pointInLine(b,c,t);return _pointInLine(d,e,t)}__name(readUsedSize,"readUsedSize"),__name(_pointInLine,"_pointInLine"),__name(_steppedInterpolation,"_steppedInterpolation"),__name(_bezierInterpolation,"_bezierInterpolation");const intlCache=new Map;function getNumberFormat(locale,options){options=options||{};const cacheKey=locale+JSON.stringify(options);let formatter=intlCache.get(cacheKey);return formatter||(formatter=new Intl.NumberFormat(locale,options),intlCache.set(cacheKey,formatter)),formatter}function formatNumber(num,locale,options){return getNumberFormat(locale,options).format(num)}__name(getNumberFormat,"getNumberFormat"),__name(formatNumber,"formatNumber");const getRightToLeftAdapter=__name(function(rectX,width){return{x:x=>rectX+rectX+width-x,setWidth(w){width=w},textAlign:align=>"center"===align?align:"right"===align?"left":"right",xPlus:(x,value)=>x-value,leftForLtr:(x,itemWidth)=>x-itemWidth}},"getRightToLeftAdapter"),getLeftToRightAdapter=__name(function(){return{x:x=>x,setWidth(w){},textAlign:align=>align,xPlus:(x,value)=>x+value,leftForLtr:(x,_itemWidth)=>x}},"getLeftToRightAdapter");function getRtlAdapter(rtl,rectX,width){return rtl?getRightToLeftAdapter(rectX,width):getLeftToRightAdapter()}function overrideTextDirection(ctx,direction){let style,original;("ltr"===direction||"rtl"===direction)&&(style=ctx.canvas.style,original=[style.getPropertyValue("direction"),style.getPropertyPriority("direction")],style.setProperty("direction",direction,"important"),ctx.prevTextDirection=original)}function restoreTextDirection(ctx,original){void 0!==original&&(delete ctx.prevTextDirection,ctx.canvas.style.setProperty("direction",original[0],original[1]))}function propertyFn(property){return"angle"===property?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(a,b)=>a-b,normalize:x=>x}}function normalizeSegment({start,end,count,loop,style}){return{start:start%count,end:end%count,loop:loop&&(end-start+1)%count==0,style}}function getSegment(segment,points,bounds){const{property,start:startBound,end:endBound}=bounds,{between,normalize}=propertyFn(property),count=points.length;let i,ilen,{start,end,loop}=segment;if(loop){for(start+=count,end+=count,i=0,ilen=count;ibetween(startBound,prevValue,value)&&0!==compare(startBound,prevValue),"startIsBefore"),endIsBefore=__name(()=>0===compare(endBound,value)||between(endBound,prevValue,value),"endIsBefore"),shouldStart=__name(()=>inside||startIsBefore(),"shouldStart"),shouldStop=__name(()=>!inside||endIsBefore(),"shouldStop");for(let i=start,prev=start;i<=end;++i)point=points[i%count],!point.skip&&(value=normalize(point[property]),value!==prevValue&&(inside=between(value,startBound,endBound),null===subStart&&shouldStart()&&(subStart=0===compare(value,startBound)?i:prev),null!==subStart&&shouldStop()&&(result.push(normalizeSegment({start:subStart,end:i,loop,count,style})),subStart=null),prev=i,prevValue=value));return null!==subStart&&result.push(normalizeSegment({start:subStart,end,loop,count,style})),result}function _boundSegments(line,bounds){const result=[],segments=line.segments;for(let i=0;istart&&points[end%count].skip;)end--;return end%=count,{start,end}}function solidSegments(points,start,max,loop){const count=points.length,result=[];let end,last=start,prev=points[start];for(end=start+1;end<=max;++end){const cur=points[end%count];cur.skip||cur.stop?prev.skip||(loop=!1,result.push({start:start%count,end:(end-1)%count,loop}),start=last=cur.stop?end:null):(last=end,prev.skip&&(start=end)),prev=cur}return null!==last&&result.push({start:start%count,end:last%count,loop}),result}function _computeSegments(line,segmentOptions){const points=line.points,spanGaps=line.options.spanGaps,count=points.length;if(!count)return[];const loop=!!line._loop,{start,end}=findStartAndEnd(points,count,loop,spanGaps);if(!0===spanGaps)return splitByStyles(line,[{start,end,loop}],points,segmentOptions);return splitByStyles(line,solidSegments(points,start,endfn({chart,initial:anims.initial,numSteps,currentStep:Math.min(date-anims.start,numSteps)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(date=Date.now()){let remaining=0;this._charts.forEach((anims,chart)=>{if(!anims.running||!anims.items.length)return;const items=anims.items;let item,i=items.length-1,draw2=!1;for(;i>=0;--i)item=items[i],item._active?(item._total>anims.duration&&(anims.duration=item._total),item.tick(date),draw2=!0):(items[i]=items[items.length-1],items.pop());draw2&&(chart.draw(),this._notify(chart,anims,date,"progress")),items.length||(anims.running=!1,this._notify(chart,anims,date,"complete"),anims.initial=!1),remaining+=items.length}),this._lastDate=date,0===remaining&&(this._running=!1)}_getAnims(chart){const charts=this._charts;let anims=charts.get(chart);return anims||(anims={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},charts.set(chart,anims)),anims}listen(chart,event,cb){this._getAnims(chart).listeners[event].push(cb)}add(chart,items){!items||!items.length||this._getAnims(chart).items.push(...items)}has(chart){return this._getAnims(chart).items.length>0}start(chart){const anims=this._charts.get(chart);!anims||(anims.running=!0,anims.start=Date.now(),anims.duration=anims.items.reduce((acc,cur)=>Math.max(acc,cur._duration),0),this._refresh())}running(chart){if(!this._running)return!1;const anims=this._charts.get(chart);return!(!anims||!anims.running||!anims.items.length)}stop(chart){const anims=this._charts.get(chart);if(!anims||!anims.items.length)return;const items=anims.items;let i=items.length-1;for(;i>=0;--i)items[i].cancel();anims.items=[],this._notify(chart,anims,Date.now(),"complete")}remove(chart){return this._charts.delete(chart)}}__name(Animator,"Animator");var animator=new Animator;const interpolators={boolean:(from2,to2,factor)=>factor>.5?to2:from2,color(from2,to2,factor){const c0=color(from2||"transparent"),c1=c0.valid&&color(to2||"transparent");return c1&&c1.valid?c1.mix(c0,factor).hexString():to2},number:(from2,to2,factor)=>from2+(to2-from2)*factor};class Animation{constructor(cfg,target,prop,to2){const currentValue=target[prop];to2=resolve([cfg.to,to2,currentValue,cfg.from]);const from2=resolve([cfg.from,currentValue,to2]);this._active=!0,this._fn=cfg.fn||interpolators[cfg.type||typeof from2],this._easing=effects[cfg.easing]||effects.linear,this._start=Math.floor(Date.now()+(cfg.delay||0)),this._duration=this._total=Math.floor(cfg.duration),this._loop=!!cfg.loop,this._target=target,this._prop=prop,this._from=from2,this._to=to2,this._promises=void 0}active(){return this._active}update(cfg,to2,date){if(this._active){this._notify(!1);const currentValue=this._target[this._prop],elapsed=date-this._start,remain=this._duration-elapsed;this._start=date,this._duration=Math.floor(Math.max(remain,cfg.duration)),this._total+=elapsed,this._loop=!!cfg.loop,this._to=resolve([cfg.to,to2,currentValue,cfg.from]),this._from=resolve([cfg.from,currentValue,to2])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(date){const elapsed=date-this._start,duration=this._duration,prop=this._prop,from2=this._from,loop=this._loop,to2=this._to;let factor;if(this._active=from2!==to2&&(loop||elapsed1?2-factor:factor,factor=this._easing(Math.min(1,Math.max(0,factor))),this._target[prop]=this._fn(from2,to2,factor))}wait(){const promises=this._promises||(this._promises=[]);return new Promise((res,rej)=>{promises.push({res,rej})})}_notify(resolved){const method=resolved?"res":"rej",promises=this._promises||[];for(let i=0;i"onProgress"!==name&&"onComplete"!==name&&"fn"!==name}),defaults.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),defaults.describe("animations",{_fallback:"animation"}),defaults.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:v=>0|v}}}});class Animations{constructor(chart,config){this._chart=chart,this._properties=new Map,this.configure(config)}configure(config){if(!isObject(config))return;const animatedProps=this._properties;Object.getOwnPropertyNames(config).forEach(key=>{const cfg=config[key];if(!isObject(cfg))return;const resolved={};for(const option of animationOptions)resolved[option]=cfg[option];(isArray(cfg.properties)&&cfg.properties||[key]).forEach(prop=>{(prop===key||!animatedProps.has(prop))&&animatedProps.set(prop,resolved)})})}_animateOptions(target,values){const newOptions=values.options,options=resolveTargetOptions(target,newOptions);if(!options)return[];const animations=this._createAnimations(options,newOptions);return newOptions.$shared&&awaitAll(target.options.$animations,newOptions).then(()=>{target.options=newOptions},()=>{}),animations}_createAnimations(target,values){const animatedProps=this._properties,animations=[],running=target.$animations||(target.$animations={}),props=Object.keys(values),date=Date.now();let i;for(i=props.length-1;i>=0;--i){const prop=props[i];if("$"===prop.charAt(0))continue;if("options"===prop){animations.push(...this._animateOptions(target,values));continue}const value=values[prop];let animation=running[prop];const cfg=animatedProps.get(prop);if(animation){if(cfg&&animation.active()){animation.update(cfg,value,date);continue}animation.cancel()}cfg&&cfg.duration?(running[prop]=animation=new Animation(cfg,target,prop,value),animations.push(animation)):target[prop]=value}return animations}update(target,values){if(0===this._properties.size)return void Object.assign(target,values);const animations=this._createAnimations(target,values);return animations.length?(animator.add(this._chart,animations),!0):void 0}}function awaitAll(animations,properties){const running=[],keys=Object.keys(properties);for(let i=0;i0||!positive&&value<0)return meta.index}return null}function updateStacks(controller,parsed){const{chart,_cachedMeta:meta}=controller,stacks=chart._stacks||(chart._stacks={}),{iScale,vScale,index:datasetIndex}=meta,iAxis=iScale.axis,vAxis=vScale.axis,key=getStackKey(iScale,vScale,meta),ilen=parsed.length;let stack;for(let i=0;iscales2[key].axis===axis).shift()}function createDatasetContext(parent,index2){return createContext(parent,{active:!1,dataset:void 0,datasetIndex:index2,index:index2,mode:"default",type:"dataset"})}function createDataContext(parent,index2,element){return createContext(parent,{active:!1,dataIndex:index2,parsed:void 0,raw:void 0,element,index:index2,mode:"default",type:"data"})}function clearStacks(meta,items){const datasetIndex=meta.controller.index,axis=meta.vScale&&meta.vScale.axis;if(axis){items=items||meta._parsed;for(const parsed of items){const stacks=parsed._stacks;if(!stacks||void 0===stacks[axis]||void 0===stacks[axis][datasetIndex])return;delete stacks[axis][datasetIndex]}}}__name(Animations,"Animations"),__name(awaitAll,"awaitAll"),__name(resolveTargetOptions,"resolveTargetOptions"),__name(scaleClip,"scaleClip"),__name(defaultClip,"defaultClip"),__name(toClip,"toClip"),__name(getSortedDatasetIndices,"getSortedDatasetIndices"),__name(applyStack,"applyStack"),__name(convertObjectDataToArray,"convertObjectDataToArray"),__name(isStacked,"isStacked"),__name(getStackKey,"getStackKey"),__name(getUserBounds,"getUserBounds"),__name(getOrCreateStack,"getOrCreateStack"),__name(getLastIndexInStack,"getLastIndexInStack"),__name(updateStacks,"updateStacks"),__name(getFirstScaleId,"getFirstScaleId"),__name(createDatasetContext,"createDatasetContext"),__name(createDataContext,"createDataContext"),__name(clearStacks,"clearStacks");const isDirectUpdateMode=__name(mode=>"reset"===mode||"none"===mode,"isDirectUpdateMode"),cloneIfNotShared=__name((cached,shared)=>shared?cached:Object.assign({},cached),"cloneIfNotShared"),createStack=__name((canStack,meta,chart)=>canStack&&!meta.hidden&&meta._stacked&&{keys:getSortedDatasetIndices(chart,!0),values:null},"createStack");class DatasetController{constructor(chart,datasetIndex){this.chart=chart,this._ctx=chart.ctx,this.index=datasetIndex,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 meta=this._cachedMeta;this.configure(),this.linkScales(),meta._stacked=isStacked(meta.vScale,meta),this.addElements()}updateIndex(datasetIndex){this.index!==datasetIndex&&clearStacks(this._cachedMeta),this.index=datasetIndex}linkScales(){const chart=this.chart,meta=this._cachedMeta,dataset=this.getDataset(),chooseId=__name((axis,x,y,r)=>"x"===axis?x:"r"===axis?r:y,"chooseId"),xid=meta.xAxisID=valueOrDefault(dataset.xAxisID,getFirstScaleId(chart,"x")),yid=meta.yAxisID=valueOrDefault(dataset.yAxisID,getFirstScaleId(chart,"y")),rid=meta.rAxisID=valueOrDefault(dataset.rAxisID,getFirstScaleId(chart,"r")),indexAxis=meta.indexAxis,iid=meta.iAxisID=chooseId(indexAxis,xid,yid,rid),vid=meta.vAxisID=chooseId(indexAxis,yid,xid,rid);meta.xScale=this.getScaleForId(xid),meta.yScale=this.getScaleForId(yid),meta.rScale=this.getScaleForId(rid),meta.iScale=this.getScaleForId(iid),meta.vScale=this.getScaleForId(vid)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(scaleID){return this.chart.scales[scaleID]}_getOtherScale(scale){const meta=this._cachedMeta;return scale===meta.iScale?meta.vScale:meta.iScale}reset(){this._update("reset")}_destroy(){const meta=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),meta._stacked&&clearStacks(meta)}_dataCheck(){const dataset=this.getDataset(),data=dataset.data||(dataset.data=[]),_data=this._data;if(isObject(data))this._data=convertObjectDataToArray(data);else if(_data!==data){if(_data){unlistenArrayEvents(_data,this);const meta=this._cachedMeta;clearStacks(meta),meta._parsed=[]}data&&Object.isExtensible(data)&&listenArrayEvents(data,this),this._syncList=[],this._data=data}}addElements(){const meta=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(meta.dataset=new this.datasetElementType)}buildOrUpdateElements(resetNewElements){const meta=this._cachedMeta,dataset=this.getDataset();let stackChanged=!1;this._dataCheck();const oldStacked=meta._stacked;meta._stacked=isStacked(meta.vScale,meta),meta.stack!==dataset.stack&&(stackChanged=!0,clearStacks(meta),meta.stack=dataset.stack),this._resyncElements(resetNewElements),(stackChanged||oldStacked!==meta._stacked)&&updateStacks(this,meta._parsed)}configure(){const config=this.chart.config,scopeKeys=config.datasetScopeKeys(this._type),scopes=config.getOptionScopes(this.getDataset(),scopeKeys,!0);this.options=config.createResolver(scopes,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(start,count){const{_cachedMeta:meta,_data:data}=this,{iScale,_stacked}=meta,iAxis=iScale.axis;let i,cur,parsed,sorted=0===start&&count===data.length||meta._sorted,prev=start>0&&meta._parsed[start-1];if(!1===this._parsing)meta._parsed=data,meta._sorted=!0,parsed=data;else{parsed=isArray(data[start])?this.parseArrayData(meta,data,start,count):isObject(data[start])?this.parseObjectData(meta,data,start,count):this.parsePrimitiveData(meta,data,start,count);const isNotInOrderComparedToPrev=__name(()=>null===cur[iAxis]||prev&&cur[iAxis]otherValue||otherMax=0;--i)if(!_skip()){this.updateRangeFromParsed(range,scale,parsed,stack);break}return range}getAllParsedValues(scale){const parsed=this._cachedMeta._parsed,values=[];let i,ilen,value;for(i=0,ilen=parsed.length;i=0&&index2this.getContext(index2,active),"context"),values=config.resolveNamedOptions(scopes,names2,context,prefixes);return values.$shared&&(values.$shared=sharing,cache[cacheKey]=Object.freeze(cloneIfNotShared(values,sharing))),values}_resolveAnimations(index2,transition,active){const chart=this.chart,cache=this._cachedDataOpts,cacheKey=`animation-${transition}`,cached=cache[cacheKey];if(cached)return cached;let options;if(!1!==chart.options.animation){const config=this.chart.config,scopeKeys=config.datasetAnimationScopeKeys(this._type,transition),scopes=config.getOptionScopes(this.getDataset(),scopeKeys);options=config.createResolver(scopes,this.getContext(index2,active,transition))}const animations=new Animations(chart,options&&options.animations);return options&&options._cacheable&&(cache[cacheKey]=Object.freeze(animations)),animations}getSharedOptions(options){if(options.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},options))}includeOptions(mode,sharedOptions){return!sharedOptions||isDirectUpdateMode(mode)||this.chart._animationsDisabled}updateElement(element,index2,properties,mode){isDirectUpdateMode(mode)?Object.assign(element,properties):this._resolveAnimations(index2,mode).update(element,properties)}updateSharedOptions(sharedOptions,mode,newOptions){sharedOptions&&!isDirectUpdateMode(mode)&&this._resolveAnimations(void 0,mode).update(sharedOptions,newOptions)}_setStyle(element,index2,mode,active){element.active=active;const options=this.getStyle(index2,active);this._resolveAnimations(index2,mode,active).update(element,{options:!active&&this.getSharedOptions(options)||options})}removeHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!1)}setHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!0)}_removeDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!1)}_setDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!0)}_resyncElements(resetNewElements){const data=this._data,elements=this._cachedMeta.data;for(const[method,arg1,arg2]of this._syncList)this[method](arg1,arg2);this._syncList=[];const numMeta=elements.length,numData=data.length,count=Math.min(numData,numMeta);count&&this.parse(0,count),numData>numMeta?this._insertElements(numMeta,numData-numMeta,resetNewElements):numData{for(arr.length+=count,i=arr.length-1;i>=end;i--)arr[i]=arr[i-count]},"move");for(move(data),i=start;ia-b))}return scale._cache.$bar}function computeMinSampleSize(meta){const scale=meta.iScale,values=getAllScaleValues(scale,meta.type);let i,ilen,curr,prev,min=scale._length;const updateMinAndPrev=__name(()=>{32767===curr||-32768===curr||(defined(prev)&&(min=Math.min(min,Math.abs(curr-prev)||min)),prev=curr)},"updateMinAndPrev");for(i=0,ilen=values.length;i0?pixels[index2-1]:null,next=index2Math.abs(max)&&(barStart=max,barEnd=min),item[vScale.axis]=barEnd,item._custom={barStart,barEnd,start:startValue,end:endValue,min,max}}function parseValue(entry,item,vScale,i){return isArray(entry)?parseFloatBar(entry,item,vScale,i):item[vScale.axis]=vScale.parse(entry,i),item}function parseArrayOrPrimitive(meta,data,start,count){const iScale=meta.iScale,vScale=meta.vScale,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=[];let i,ilen,item,entry;for(i=start,ilen=start+count;i=actualBase?1:-1)}function borderProps(properties){let reverse,start,end,top,bottom;return properties.horizontal?(reverse=properties.base>properties.x,start="left",end="right"):(reverse=properties.base=0;--i)max=Math.max(max,data[i].size(this.resolveDataElementOptions(i))/2);return max>0&&max}getLabelAndValue(index2){const meta=this._cachedMeta,{xScale,yScale}=meta,parsed=this.getParsed(index2),x=xScale.getLabelForValue(parsed.x),y=yScale.getLabelForValue(parsed.y),r=parsed._custom;return{label:meta.label,value:"("+x+", "+y+(r?", "+r:"")+")"}}update(mode){const points=this._cachedMeta.data;this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis;for(let i=start;i_angleBetween(angle,startAngle,endAngle,!0)?1:Math.max(a,a*cutout,b,b*cutout),"calcMax"),calcMin=__name((angle,a,b)=>_angleBetween(angle,startAngle,endAngle,!0)?-1:Math.min(a,a*cutout,b,b*cutout),"calcMin"),maxX=calcMax(0,startX,endX),maxY=calcMax(HALF_PI,startY,endY),minX=calcMin(PI,startX,endX),minY=calcMin(PI+HALF_PI,startY,endY);ratioX=(maxX-minX)/2,ratioY=(maxY-minY)/2,offsetX=-(maxX+minX)/2,offsetY=-(maxY+minY)/2}return{ratioX,ratioY,offsetX,offsetY}}__name(BubbleController,"BubbleController"),BubbleController.id="bubble",BubbleController.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},BubbleController.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}},__name(getRatioAndOffset,"getRatioAndOffset");class DoughnutController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(start,count){const data=this.getDataset().data,meta=this._cachedMeta;if(!1===this._parsing)meta._parsed=data;else{let i,ilen,getter=__name(i2=>+data[i2],"getter");if(isObject(data[start])){const{key="value"}=this._parsing;getter=__name(i2=>+resolveObjectKey(data[i2],key),"getter")}for(i=start,ilen=start+count;i0&&!isNaN(value)?TAU*(Math.abs(value)/total):0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2],chart.options.locale);return{label:labels[index2]||"",value}}getMaxBorderWidth(arcs){let max=0;const chart=this.chart;let i,ilen,meta,controller,options;if(!arcs)for(i=0,ilen=chart.data.datasets.length;i"spacing"!==name,_indexable:name=>"spacing"!==name},DoughnutController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label(tooltipItem){let dataLabel=tooltipItem.label;const value=": "+tooltipItem.formattedValue;return isArray(dataLabel)?(dataLabel=dataLabel.slice(),dataLabel[0]+=value):dataLabel+=value,dataLabel}}}}};class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(mode){const meta=this._cachedMeta,{dataset:line,data:points=[],_dataset}=meta,animationsDisabled=this.chart._animationsDisabled;let{start,count}=getStartAndCountOfVisiblePoints(meta,points,animationsDisabled);this._drawStart=start,this._drawCount=count,scaleRangesChanged(meta)&&(start=0,count=points.length),line._chart=this.chart,line._datasetIndex=this.index,line._decimated=!!_dataset._decimated,line.points=points;const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0),options.segment=this.options.segment,this.updateElement(line,void 0,{animated:!animationsDisabled,options},mode),this.updateElements(points,start,count,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale,_stacked,_dataset}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis,{spanGaps,segment}=this.options,maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY,directUpdate=this.chart._animationsDisabled||reset||"none"===mode;let prevParsed=start>0&&this.getParsed(start-1);for(let i=start;i0&&Math.abs(parsed[iAxis]-prevParsed[iAxis])>maxGapLength,segment&&(properties.parsed=parsed,properties.raw=_dataset.data[i]),includeOptions&&(properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?"active":mode)),directUpdate||this.updateElement(point,i,properties,mode),prevParsed=parsed}this.updateSharedOptions(sharedOptions,mode,firstOpts)}getMaxOverflow(){const meta=this._cachedMeta,dataset=meta.dataset,border=dataset.options&&dataset.options.borderWidth||0,data=meta.data||[];if(!data.length)return border;const firstPoint=data[0].size(this.resolveDataElementOptions(0)),lastPoint=data[data.length-1].size(this.resolveDataElementOptions(data.length-1));return Math.max(border,firstPoint,lastPoint)/2}draw(){const meta=this._cachedMeta;meta.dataset.updateControlPoints(this.chart.chartArea,meta.iScale.axis),super.draw()}}function getStartAndCountOfVisiblePoints(meta,points,animationsDisabled){const pointCount=points.length;let start=0,count=pointCount;if(meta._sorted){const{iScale,_parsed}=meta,axis=iScale.axis,{min,max,minDefined,maxDefined}=iScale.getUserBounds();minDefined&&(start=_limitValue(Math.min(_lookupByKey(_parsed,iScale.axis,min).lo,animationsDisabled?pointCount:_lookupByKey(points,axis,iScale.getPixelForValue(min)).lo),0,pointCount-1)),count=maxDefined?_limitValue(Math.max(_lookupByKey(_parsed,iScale.axis,max).hi+1,animationsDisabled?0:_lookupByKey(points,axis,iScale.getPixelForValue(max)).hi+1),start,pointCount)-start:pointCount-start}return{start,count}}function scaleRangesChanged(meta){const{xScale,yScale,_scaleRanges}=meta,newRanges={xmin:xScale.min,xmax:xScale.max,ymin:yScale.min,ymax:yScale.max};if(!_scaleRanges)return meta._scaleRanges=newRanges,!0;const changed=_scaleRanges.xmin!==xScale.min||_scaleRanges.xmax!==xScale.max||_scaleRanges.ymin!==yScale.min||_scaleRanges.ymax!==yScale.max;return Object.assign(_scaleRanges,newRanges),changed}__name(LineController,"LineController"),LineController.id="line",LineController.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},LineController.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}},__name(getStartAndCountOfVisiblePoints,"getStartAndCountOfVisiblePoints"),__name(scaleRangesChanged,"scaleRangesChanged");class PolarAreaController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2].r,chart.options.locale);return{label:labels[index2]||"",value}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const arcs=this._cachedMeta.data;this._updateRadius(),this.updateElements(arcs,0,arcs.length,mode)}getMinMax(){const meta=this._cachedMeta,range={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return meta.data.forEach((element,index2)=>{const parsed=this.getParsed(index2).r;!isNaN(parsed)&&this.chart.getDataVisibility(index2)&&(parsedrange.max&&(range.max=parsed))}),range}_updateRadius(){const chart=this.chart,chartArea=chart.chartArea,opts=chart.options,minSize=Math.min(chartArea.right-chartArea.left,chartArea.bottom-chartArea.top),outerRadius=Math.max(minSize/2,0),radiusLength=(outerRadius-Math.max(opts.cutoutPercentage?outerRadius/100*opts.cutoutPercentage:1,0))/chart.getVisibleDatasetCount();this.outerRadius=outerRadius-radiusLength*this.index,this.innerRadius=this.outerRadius-radiusLength}updateElements(arcs,start,count,mode){const reset="reset"===mode,chart=this.chart,animationOpts=chart.options.animation,scale=this._cachedMeta.rScale,centerX=scale.xCenter,centerY=scale.yCenter,datasetStartAngle=scale.getIndexAngle(0)-.5*PI;let i,angle=datasetStartAngle;const defaultAngle=360/this.countVisibleElements();for(i=0;i{!isNaN(this.getParsed(index2).r)&&this.chart.getDataVisibility(index2)&&count++}),count}_computeAngle(index2,mode,defaultAngle){return this.chart.getDataVisibility(index2)?toRadians(this.resolveDataElementOptions(index2,mode).angle||defaultAngle):0}}__name(PolarAreaController,"PolarAreaController"),PolarAreaController.id="polarArea",PolarAreaController.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},PolarAreaController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label:context=>context.chart.data.labels[context.dataIndex]+": "+context.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class PieController extends DoughnutController{}__name(PieController,"PieController"),PieController.id="pie",PieController.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class RadarController extends DatasetController{getLabelAndValue(index2){const vScale=this._cachedMeta.vScale,parsed=this.getParsed(index2);return{label:vScale.getLabels()[index2],value:""+vScale.getLabelForValue(parsed[vScale.axis])}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const meta=this._cachedMeta,line=meta.dataset,points=meta.data||[],labels=meta.iScale.getLabels();if(line.points=points,"resize"!==mode){const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0);const properties={_loop:!0,_fullLoop:labels.length===points.length,options};this.updateElement(line,void 0,properties,mode)}this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const scale=this._cachedMeta.rScale,reset="reset"===mode;for(let i=start;i"",label:item=>"("+item.label+", "+item.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function chart_esm_abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}__name(chart_esm_abstract,"chart_esm_abstract");class DateAdapter{constructor(options){this.options=options||{}}formats(){return chart_esm_abstract()}parse(value,format){return chart_esm_abstract()}format(timestamp,format){return chart_esm_abstract()}add(timestamp,amount,unit){return chart_esm_abstract()}diff(a,b,unit){return chart_esm_abstract()}startOf(timestamp,unit,weekday){return chart_esm_abstract()}endOf(timestamp,unit){return chart_esm_abstract()}}__name(DateAdapter,"DateAdapter"),DateAdapter.override=function(members){Object.assign(DateAdapter.prototype,members)};var adapters={_date:DateAdapter};function binarySearch(metaset,axis,value,intersect){const{controller,data,_sorted}=metaset,iScale=controller._cachedMeta.iScale;if(iScale&&axis===iScale.axis&&"r"!==axis&&_sorted&&data.length){const lookupMethod=iScale._reversePixels?_rlookupByKey:_lookupByKey;if(!intersect)return lookupMethod(data,axis,value);if(controller._sharedOptions){const el=data[0],range="function"==typeof el.getRange&&el.getRange(axis);if(range){const start=lookupMethod(data,axis,value-range),end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi}}}}return{lo:0,hi:data.length-1}}function evaluateInteractionItems(chart,axis,position,handler,intersect){const metasets=chart.getSortedVisibleDatasetMetas(),value=position[axis];for(let i=0,ilen=metasets.length;i{element[rangeMethod](position[axis],useFinalPosition)&&(items.push({element,datasetIndex,index:index2}),intersectsItem=intersectsItem||element.inRange(position.x,position.y,useFinalPosition))}),intersect&&!intersectsItem?[]:items}__name(binarySearch,"binarySearch"),__name(evaluateInteractionItems,"evaluateInteractionItems"),__name(getDistanceMetricForAxis,"getDistanceMetricForAxis"),__name(getIntersectItems,"getIntersectItems"),__name(getNearestRadialItems,"getNearestRadialItems"),__name(getNearestCartesianItems,"getNearestCartesianItems"),__name(getNearestItems,"getNearestItems"),__name(getAxisItems,"getAxisItems");var Interaction={evaluateInteractionItems,modes:{index(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"x",includeInvisible=options.includeInvisible||!1,items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible),elements=[];return items.length?(chart.getSortedVisibleDatasetMetas().forEach(meta=>{const index2=items[0].index,element=meta.data[index2];element&&!element.skip&&elements.push({element,datasetIndex:meta.index,index:index2})}),elements):[]},dataset(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;let items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible);if(items.length>0){const datasetIndex=items[0].datasetIndex,data=chart.getDatasetMeta(datasetIndex).data;items=[];for(let i=0;igetIntersectItems(chart,getRelativePosition(e,chart),options.axis||"xy",useFinalPosition,options.includeInvisible||!1),nearest(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;return getNearestItems(chart,position,axis,options.intersect,useFinalPosition,includeInvisible)},x:(chart,e,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e,chart),"x",options.intersect,useFinalPosition),y:(chart,e,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e,chart),"y",options.intersect,useFinalPosition)}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(array,position){return array.filter(v=>v.pos===position)}function filterDynamicPositionByAxis(array,axis){return array.filter(v=>-1===STATIC_POSITIONS.indexOf(v.pos)&&v.box.axis===axis)}function sortByWeight(array,reverse){return array.sort((a,b)=>{const v0=reverse?b:a,v1=reverse?a:b;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight})}function wrapBoxes(boxes){const layoutBoxes=[];let i,ilen,box,pos,stack,stackWeight;for(i=0,ilen=(boxes||[]).length;iwrap.box.fullSize),!0),left=sortByWeight(filterByPosition(layoutBoxes,"left"),!0),right=sortByWeight(filterByPosition(layoutBoxes,"right")),top=sortByWeight(filterByPosition(layoutBoxes,"top"),!0),bottom=sortByWeight(filterByPosition(layoutBoxes,"bottom")),centerHorizontal=filterDynamicPositionByAxis(layoutBoxes,"x"),centerVertical=filterDynamicPositionByAxis(layoutBoxes,"y");return{fullSize,leftAndTop:left.concat(top),rightAndBottom:right.concat(centerVertical).concat(bottom).concat(centerHorizontal),chartArea:filterByPosition(layoutBoxes,"chartArea"),vertical:left.concat(right).concat(centerVertical),horizontal:top.concat(bottom).concat(centerHorizontal)}}function getCombinedMax(maxPadding,chartArea,a,b){return Math.max(maxPadding[a],chartArea[a])+Math.max(maxPadding[b],chartArea[b])}function updateMaxPadding(maxPadding,boxPadding){maxPadding.top=Math.max(maxPadding.top,boxPadding.top),maxPadding.left=Math.max(maxPadding.left,boxPadding.left),maxPadding.bottom=Math.max(maxPadding.bottom,boxPadding.bottom),maxPadding.right=Math.max(maxPadding.right,boxPadding.right)}function updateDims(chartArea,params,layout,stacks){const{pos,box}=layout,maxPadding=chartArea.maxPadding;if(!isObject(pos)){layout.size&&(chartArea[pos]-=layout.size);const stack=stacks[layout.stack]||{size:0,count:1};stack.size=Math.max(stack.size,layout.horizontal?box.height:box.width),layout.size=stack.size/stack.count,chartArea[pos]+=layout.size}box.getPadding&&updateMaxPadding(maxPadding,box.getPadding());const newWidth=Math.max(0,params.outerWidth-getCombinedMax(maxPadding,chartArea,"left","right")),newHeight=Math.max(0,params.outerHeight-getCombinedMax(maxPadding,chartArea,"top","bottom")),widthChanged=newWidth!==chartArea.w,heightChanged=newHeight!==chartArea.h;return chartArea.w=newWidth,chartArea.h=newHeight,layout.horizontal?{same:widthChanged,other:heightChanged}:{same:heightChanged,other:widthChanged}}function handleMaxPadding(chartArea){const maxPadding=chartArea.maxPadding;function updatePos(pos){const change=Math.max(maxPadding[pos]-chartArea[pos],0);return chartArea[pos]+=change,change}__name(updatePos,"updatePos"),chartArea.y+=updatePos("top"),chartArea.x+=updatePos("left"),updatePos("right"),updatePos("bottom")}function getMargins(horizontal,chartArea){const maxPadding=chartArea.maxPadding;function marginForPositions(positions2){const margin={left:0,top:0,right:0,bottom:0};return positions2.forEach(pos=>{margin[pos]=Math.max(chartArea[pos],maxPadding[pos])}),margin}return __name(marginForPositions,"marginForPositions"),marginForPositions(horizontal?["left","right"]:["top","bottom"])}function fitBoxes(boxes,chartArea,params,stacks){const refitBoxes=[];let i,ilen,layout,box,refit,changed;for(i=0,ilen=boxes.length,refit=0;i{"function"==typeof box.beforeLayout&&box.beforeLayout()});const visibleVerticalBoxCount=verticalBoxes.reduce((total,wrap)=>wrap.box.options&&!1===wrap.box.options.display?total:total+1,0)||1,params=Object.freeze({outerWidth:width,outerHeight:height,padding,availableWidth,availableHeight,vBoxMaxWidth:availableWidth/2/visibleVerticalBoxCount,hBoxMaxHeight:availableHeight/2}),maxPadding=Object.assign({},padding);updateMaxPadding(maxPadding,toPadding(minPadding));const chartArea=Object.assign({maxPadding,w:availableWidth,h:availableHeight,x:padding.left,y:padding.top},padding),stacks=setLayoutDims(verticalBoxes.concat(horizontalBoxes),params);fitBoxes(boxes.fullSize,chartArea,params,stacks),fitBoxes(verticalBoxes,chartArea,params,stacks),fitBoxes(horizontalBoxes,chartArea,params,stacks)&&fitBoxes(verticalBoxes,chartArea,params,stacks),handleMaxPadding(chartArea),placeBoxes(boxes.leftAndTop,chartArea,params,stacks),chartArea.x+=chartArea.w,chartArea.y+=chartArea.h,placeBoxes(boxes.rightAndBottom,chartArea,params,stacks),chart.chartArea={left:chartArea.left,top:chartArea.top,right:chartArea.left+chartArea.w,bottom:chartArea.top+chartArea.h,height:chartArea.h,width:chartArea.w},each(boxes.chartArea,layout=>{const box=layout.box;Object.assign(box,chart.chartArea),box.update(chartArea.w,chartArea.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(canvas,aspectRatio){}releaseContext(context){return!1}addEventListener(chart,type,listener){}removeEventListener(chart,type,listener){}getDevicePixelRatio(){return 1}getMaximumSize(element,width,height,aspectRatio){return width=Math.max(0,width||element.width),height=height||element.height,{width,height:Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height)}}isAttached(canvas){return!0}updateConfig(config){}}__name(BasePlatform,"BasePlatform");class BasicPlatform extends BasePlatform{acquireContext(item){return item&&item.getContext&&item.getContext("2d")||null}updateConfig(config){config.options.animation=!1}}__name(BasicPlatform,"BasicPlatform");const EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=__name(value=>null===value||""===value,"isNullOrEmpty");function initCanvas(canvas,aspectRatio){const style=canvas.style,renderHeight=canvas.getAttribute("height"),renderWidth=canvas.getAttribute("width");if(canvas.$chartjs={initial:{height:renderHeight,width:renderWidth,style:{display:style.display,height:style.height,width:style.width}}},style.display=style.display||"block",style.boxSizing=style.boxSizing||"border-box",isNullOrEmpty(renderWidth)){const displayWidth=readUsedSize(canvas,"width");void 0!==displayWidth&&(canvas.width=displayWidth)}if(isNullOrEmpty(renderHeight))if(""===canvas.style.height)canvas.height=canvas.width/(aspectRatio||2);else{const displayHeight=readUsedSize(canvas,"height");void 0!==displayHeight&&(canvas.height=displayHeight)}return canvas}__name(initCanvas,"initCanvas");const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(node,type,listener){node.addEventListener(type,listener,eventListenerOptions)}function removeListener(chart,type,listener){chart.canvas.removeEventListener(type,listener,eventListenerOptions)}function fromNativeEvent(event,chart){const type=EVENT_TYPES[event.type]||event.type,{x,y}=getRelativePosition(event,chart);return{type,chart,native:event,x:void 0!==x?x:null,y:void 0!==y?y:null}}function nodeListContains(nodeList,canvas){for(const node of nodeList)if(node===canvas||node.contains(canvas))return!0}function createAttachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.addedNodes,canvas),trigger=trigger&&!nodeListContains(entry.removedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}function createDetachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.removedNodes,canvas),trigger=trigger&&!nodeListContains(entry.addedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}__name(addListener,"addListener"),__name(removeListener,"removeListener"),__name(fromNativeEvent,"fromNativeEvent"),__name(nodeListContains,"nodeListContains"),__name(createAttachObserver,"createAttachObserver"),__name(createDetachObserver,"createDetachObserver");const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const dpr=window.devicePixelRatio;dpr!==oldDevicePixelRatio&&(oldDevicePixelRatio=dpr,drpListeningCharts.forEach((resize,chart)=>{chart.currentDevicePixelRatio!==dpr&&resize()}))}function listenDevicePixelRatioChanges(chart,resize){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(chart,resize)}function unlistenDevicePixelRatioChanges(chart){drpListeningCharts.delete(chart),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(chart,type,listener){const canvas=chart.canvas,container=canvas&&_getParentNode(canvas);if(!container)return;const resize=throttled((width,height)=>{const w=container.clientWidth;listener(width,height),w{const entry=entries[0],width=entry.contentRect.width,height=entry.contentRect.height;0===width&&0===height||resize(width,height)});return observer.observe(container),listenDevicePixelRatioChanges(chart,resize),observer}function releaseObserver(chart,type,observer){observer&&observer.disconnect(),"resize"===type&&unlistenDevicePixelRatioChanges(chart)}function createProxyAndListen(chart,type,listener){const canvas=chart.canvas,proxy=throttled(event=>{null!==chart.ctx&&listener(fromNativeEvent(event,chart))},chart,args=>{const event=args[0];return[event,event.offsetX,event.offsetY]});return addListener(canvas,type,proxy),proxy}__name(onWindowResize,"onWindowResize"),__name(listenDevicePixelRatioChanges,"listenDevicePixelRatioChanges"),__name(unlistenDevicePixelRatioChanges,"unlistenDevicePixelRatioChanges"),__name(createResizeObserver,"createResizeObserver"),__name(releaseObserver,"releaseObserver"),__name(createProxyAndListen,"createProxyAndListen");class DomPlatform extends BasePlatform{acquireContext(canvas,aspectRatio){const context=canvas&&canvas.getContext&&canvas.getContext("2d");return context&&context.canvas===canvas?(initCanvas(canvas,aspectRatio),context):null}releaseContext(context){const canvas=context.canvas;if(!canvas.$chartjs)return!1;const initial=canvas.$chartjs.initial;["height","width"].forEach(prop=>{const value=initial[prop];isNullOrUndef(value)?canvas.removeAttribute(prop):canvas.setAttribute(prop,value)});const style=initial.style||{};return Object.keys(style).forEach(key=>{canvas.style[key]=style[key]}),canvas.width=canvas.width,delete canvas.$chartjs,!0}addEventListener(chart,type,listener){this.removeEventListener(chart,type);const proxies=chart.$proxies||(chart.$proxies={}),handler={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[type]||createProxyAndListen;proxies[type]=handler(chart,type,listener)}removeEventListener(chart,type){const proxies=chart.$proxies||(chart.$proxies={}),proxy=proxies[type];proxy&&(({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[type]||removeListener)(chart,type,proxy),proxies[type]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(canvas,width,height,aspectRatio){return getMaximumSize(canvas,width,height,aspectRatio)}isAttached(canvas){const container=_getParentNode(canvas);return!(!container||!container.isConnected)}}function _detectPlatform(canvas){return!_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&canvas instanceof OffscreenCanvas?BasicPlatform:DomPlatform}__name(DomPlatform,"DomPlatform"),__name(_detectPlatform,"_detectPlatform");class Element{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(useFinalPosition){const{x,y}=this.getProps(["x","y"],useFinalPosition);return{x,y}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(props,final){const anims=this.$animations;if(!final||!anims)return this;const ret={};return props.forEach(prop=>{ret[prop]=anims[prop]&&anims[prop].active()?anims[prop]._to:this[prop]}),ret}}__name(Element,"Element"),Element.defaults={},Element.defaultRoutes=void 0;const formatters={values:value=>isArray(value)?value:""+value,numeric(tickValue,index2,ticks){if(0===tickValue)return"0";const locale=this.chart.options.locale;let notation,delta=tickValue;if(ticks.length>1){const maxTick=Math.max(Math.abs(ticks[0].value),Math.abs(ticks[ticks.length-1].value));(maxTick<1e-4||maxTick>1e15)&&(notation="scientific"),delta=calculateDelta(tickValue,ticks)}const logDelta=log10(Math.abs(delta)),numDecimal=Math.max(Math.min(-1*Math.floor(logDelta),20),0),options={notation,minimumFractionDigits:numDecimal,maximumFractionDigits:numDecimal};return Object.assign(options,this.options.ticks.format),formatNumber(tickValue,locale,options)},logarithmic(tickValue,index2,ticks){if(0===tickValue)return"0";const remain=tickValue/Math.pow(10,Math.floor(log10(tickValue)));return 1===remain||2===remain||5===remain?formatters.numeric.call(this,tickValue,index2,ticks):""}};function calculateDelta(tickValue,ticks){let delta=ticks.length>3?ticks[2].value-ticks[1].value:ticks[1].value-ticks[0].value;return Math.abs(delta)>=1&&tickValue!==Math.floor(tickValue)&&(delta=tickValue-Math.floor(tickValue)),delta}__name(calculateDelta,"calculateDelta");var Ticks={formatters};function autoSkip(scale,ticks){const tickOpts=scale.options.ticks,ticksLimit=tickOpts.maxTicksLimit||determineMaxTicks(scale),majorIndices=tickOpts.major.enabled?getMajorIndices(ticks):[],numMajorIndices=majorIndices.length,first=majorIndices[0],last=majorIndices[numMajorIndices-1],newTicks=[];if(numMajorIndices>ticksLimit)return skipMajors(ticks,newTicks,majorIndices,numMajorIndices/ticksLimit),newTicks;const spacing=calculateSpacing(majorIndices,ticks,ticksLimit);if(numMajorIndices>0){let i,ilen;const avgMajorSpacing=numMajorIndices>1?Math.round((last-first)/(numMajorIndices-1)):null;for(skip(ticks,newTicks,spacing,isNullOrUndef(avgMajorSpacing)?0:first-avgMajorSpacing,first),i=0,ilen=numMajorIndices-1;ispacing)return factor}return Math.max(spacing,1)}function getMajorIndices(ticks){const result=[];let i,ilen;for(i=0,ilen=ticks.length;ioptions.lineWidth,tickColor:(_ctx,options)=>options.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:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),defaults.route("scale.ticks","color","","color"),defaults.route("scale.grid","color","","borderColor"),defaults.route("scale.grid","borderColor","","borderColor"),defaults.route("scale.title","color","","color"),defaults.describe("scale",{_fallback:!1,_scriptable:name=>!name.startsWith("before")&&!name.startsWith("after")&&"callback"!==name&&"parser"!==name,_indexable:name=>"borderDash"!==name&&"tickBorderDash"!==name}),defaults.describe("scales",{_fallback:"scale"}),defaults.describe("scale.ticks",{_scriptable:name=>"backdropPadding"!==name&&"callback"!==name,_indexable:name=>"backdropPadding"!==name}),__name(autoSkip,"autoSkip"),__name(determineMaxTicks,"determineMaxTicks"),__name(calculateSpacing,"calculateSpacing"),__name(getMajorIndices,"getMajorIndices"),__name(skipMajors,"skipMajors"),__name(skip,"skip"),__name(getEvenSpacing,"getEvenSpacing");const reverseAlign=__name(align=>"left"===align?"right":"right"===align?"left":align,"reverseAlign"),offsetFromEdge=__name((scale,edge,offset)=>"top"===edge||"left"===edge?scale[edge]+offset:scale[edge]-offset,"offsetFromEdge");function sample(arr,numItems){const result=[],increment=arr.length/numItems,len=arr.length;let i=0;for(;iend+1e-6)))return lineValue}function garbageCollect(caches,length){each(caches,cache=>{const gc=cache.gc,gcLen=gc.length/2;let i;if(gcLen>length){for(i=0;imax?max:min,max=minDefined&&min>max?min:max,{min:finiteOrDefault(min,finiteOrDefault(max,min)),max:finiteOrDefault(max,finiteOrDefault(min,max))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const data=this.chart.data;return this.options.labels||(this.isHorizontal()?data.xLabels:data.yLabels)||data.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(maxWidth,maxHeight,margins){const{beginAtZero,grace,ticks:tickOpts}=this.options,sampleSize=tickOpts.sampleSize;this.beforeUpdate(),this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins=Object.assign({left:0,right:0,top:0,bottom:0},margins),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+margins.left+margins.right:this.height+margins.top+margins.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,grace,beginAtZero),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const samplingEnabled=sampleSize=maxRotation||numTicks<=1||!this.isHorizontal())return void(this.labelRotation=minRotation);const labelSizes=this._getLabelSizes(),maxLabelWidth=labelSizes.widest.width,maxLabelHeight=labelSizes.highest.height,maxWidth=_limitValue(this.chart.width-maxLabelWidth,0,this.maxWidth);tickWidth=options.offset?this.maxWidth/numTicks:maxWidth/(numTicks-1),maxLabelWidth+6>tickWidth&&(tickWidth=maxWidth/(numTicks-(options.offset?.5:1)),maxHeight=this.maxHeight-getTickMarkLength(options.grid)-tickOpts.padding-getTitleHeight(options.title,this.chart.options.font),maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight),labelRotation=toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height+6)/tickWidth,-1,1)),Math.asin(_limitValue(maxHeight/maxLabelDiagonal,-1,1))-Math.asin(_limitValue(maxLabelHeight/maxLabelDiagonal,-1,1)))),labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation))),this.labelRotation=labelRotation}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const minSize={width:0,height:0},{chart,options:{ticks:tickOpts,title:titleOpts,grid:gridOpts}}=this,display=this._isVisible(),isHorizontal=this.isHorizontal();if(display){const titleHeight=getTitleHeight(titleOpts,chart.options.font);if(isHorizontal?(minSize.width=this.maxWidth,minSize.height=getTickMarkLength(gridOpts)+titleHeight):(minSize.height=this.maxHeight,minSize.width=getTickMarkLength(gridOpts)+titleHeight),tickOpts.display&&this.ticks.length){const{first,last,widest,highest}=this._getLabelSizes(),tickPadding=2*tickOpts.padding,angleRadians=toRadians(this.labelRotation),cos=Math.cos(angleRadians),sin=Math.sin(angleRadians);if(isHorizontal){const labelHeight=tickOpts.mirror?0:sin*widest.width+cos*highest.height;minSize.height=Math.min(this.maxHeight,minSize.height+labelHeight+tickPadding)}else{const labelWidth=tickOpts.mirror?0:cos*widest.width+sin*highest.height;minSize.width=Math.min(this.maxWidth,minSize.width+labelWidth+tickPadding)}this._calculatePadding(first,last,sin,cos)}}this._handleMargins(),isHorizontal?(this.width=this._length=chart.width-this._margins.left-this._margins.right,this.height=minSize.height):(this.width=minSize.width,this.height=this._length=chart.height-this._margins.top-this._margins.bottom)}_calculatePadding(first,last,sin,cos){const{ticks:{align,padding},position}=this.options,isRotated=0!==this.labelRotation,labelsBelowTicks="top"!==position&&"x"===this.axis;if(this.isHorizontal()){const offsetLeft=this.getPixelForTick(0)-this.left,offsetRight=this.right-this.getPixelForTick(this.ticks.length-1);let paddingLeft=0,paddingRight=0;isRotated?labelsBelowTicks?(paddingLeft=cos*first.width,paddingRight=sin*last.height):(paddingLeft=sin*first.height,paddingRight=cos*last.width):"start"===align?paddingRight=last.width:"end"===align?paddingLeft=first.width:"inner"!==align&&(paddingLeft=first.width/2,paddingRight=last.width/2),this.paddingLeft=Math.max((paddingLeft-offsetLeft+padding)*this.width/(this.width-offsetLeft),0),this.paddingRight=Math.max((paddingRight-offsetRight+padding)*this.width/(this.width-offsetRight),0)}else{let paddingTop=last.height/2,paddingBottom=first.height/2;"start"===align?(paddingTop=0,paddingBottom=first.height):"end"===align&&(paddingTop=last.height,paddingBottom=0),this.paddingTop=paddingTop+padding,this.paddingBottom=paddingBottom+padding}}_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(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis,position}=this.options;return"top"===position||"bottom"===position||"x"===axis}isFullSize(){return this.options.fullSize}_convertTicksToLabels(ticks){let i,ilen;for(this.beforeTickToLabelConversion(),this.generateTickLabels(ticks),i=0,ilen=ticks.length;i({width:widths[idx]||0,height:heights[idx]||0}),"valueAt");return{first:valueAt(0),last:valueAt(length-1),widest:valueAt(widest),highest:valueAt(highest),widths,heights}}getLabelForValue(value){return value}getPixelForValue(value,index2){return NaN}getValueForPixel(pixel){}getPixelForTick(index2){const ticks=this.ticks;return index2<0||index2>ticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getPixelForDecimal(decimal){this._reversePixels&&(decimal=1-decimal);const pixel=this._startPixel+decimal*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,pixel,0):pixel)}getDecimalForPixel(pixel){const decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min,max}=this;return min<0&&max<0?max:min>0&&max>0?min:0}getContext(index2){const ticks=this.ticks||[];if(index2>=0&&index2w*sin?w/cos:h/sin:h*sin0}_computeGridLineItems(chartArea){const axis=this.axis,chart=this.chart,options=this.options,{grid,position}=options,offset=grid.offset,isHorizontal=this.isHorizontal(),ticksLength=this.ticks.length+(offset?1:0),tl=getTickMarkLength(grid),items=[],borderOpts=grid.setContext(this.getContext()),axisWidth=borderOpts.drawBorder?borderOpts.borderWidth:0,axisHalfWidth=axisWidth/2,alignBorderValue=__name(function(pixel){return _alignPixel(chart,pixel,axisWidth)},"alignBorderValue");let borderValue,i,lineValue,alignedLineValue,tx1,ty1,tx2,ty2,x1,y1,x2,y2;if("top"===position)borderValue=alignBorderValue(this.bottom),ty1=this.bottom-tl,ty2=borderValue-axisHalfWidth,y1=alignBorderValue(chartArea.top)+axisHalfWidth,y2=chartArea.bottom;else if("bottom"===position)borderValue=alignBorderValue(this.top),y1=chartArea.top,y2=alignBorderValue(chartArea.bottom)-axisHalfWidth,ty1=borderValue+axisHalfWidth,ty2=this.top+tl;else if("left"===position)borderValue=alignBorderValue(this.right),tx1=this.right-tl,tx2=borderValue-axisHalfWidth,x1=alignBorderValue(chartArea.left)+axisHalfWidth,x2=chartArea.right;else if("right"===position)borderValue=alignBorderValue(this.left),x1=chartArea.left,x2=alignBorderValue(chartArea.right)-axisHalfWidth,tx1=borderValue+axisHalfWidth,tx2=this.left+tl;else if("x"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.top+chartArea.bottom)/2+.5);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}y1=chartArea.top,y2=chartArea.bottom,ty1=borderValue+axisHalfWidth,ty2=ty1+tl}else if("y"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.left+chartArea.right)/2);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}tx1=borderValue-axisHalfWidth,tx2=tx1-tl,x1=chartArea.left,x2=chartArea.right}const limit=valueOrDefault(options.ticks.maxTicksLimit,ticksLength),step=Math.max(1,Math.ceil(ticksLength/limit));for(i=0;it.value===value);return index2>=0?grid.setContext(this.getContext(index2)).lineWidth:0}drawGrid(chartArea){const grid=this.options.grid,ctx=this.ctx,items=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(chartArea));let i,ilen;const drawLine=__name((p1,p2,style)=>{!style.width||!style.color||(ctx.save(),ctx.lineWidth=style.width,ctx.strokeStyle=style.color,ctx.setLineDash(style.borderDash||[]),ctx.lineDashOffset=style.borderDashOffset,ctx.beginPath(),ctx.moveTo(p1.x,p1.y),ctx.lineTo(p2.x,p2.y),ctx.stroke(),ctx.restore())},"drawLine");if(grid.display)for(i=0,ilen=items.length;i{this.drawBackground(),this.drawGrid(chartArea),this.drawTitle()}},{z:gz+1,draw:()=>{this.drawBorder()}},{z:tz,draw:chartArea=>{this.drawLabels(chartArea)}}]:[{z:tz,draw:chartArea=>{this.draw(chartArea)}}]}getMatchingVisibleMetas(type){const metas=this.chart.getSortedVisibleDatasetMetas(),axisID=this.axis+"AxisID",result=[];let i,ilen;for(i=0,ilen=metas.length;i{const propertyParts=property.split("."),sourceName=propertyParts.pop(),sourceScope=[scope].concat(propertyParts).join("."),parts=routes[property].split("."),targetName=parts.pop(),targetScope=parts.join(".");defaults.route(sourceScope,sourceName,targetScope,targetName)})}function isIChartComponent(proto){return"id"in proto&&"defaults"in proto}__name(TypedRegistry,"TypedRegistry"),__name(registerDefaults,"registerDefaults"),__name(routeDefaults,"routeDefaults"),__name(isIChartComponent,"isIChartComponent");class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...args){this._each("register",args)}remove(...args){this._each("unregister",args)}addControllers(...args){this._each("register",args,this.controllers)}addElements(...args){this._each("register",args,this.elements)}addPlugins(...args){this._each("register",args,this.plugins)}addScales(...args){this._each("register",args,this.scales)}getController(id){return this._get(id,this.controllers,"controller")}getElement(id){return this._get(id,this.elements,"element")}getPlugin(id){return this._get(id,this.plugins,"plugin")}getScale(id){return this._get(id,this.scales,"scale")}removeControllers(...args){this._each("unregister",args,this.controllers)}removeElements(...args){this._each("unregister",args,this.elements)}removePlugins(...args){this._each("unregister",args,this.plugins)}removeScales(...args){this._each("unregister",args,this.scales)}_each(method,args,typedRegistry){[...args].forEach(arg=>{const reg=typedRegistry||this._getRegistryForType(arg);typedRegistry||reg.isForType(arg)||reg===this.plugins&&arg.id?this._exec(method,reg,arg):each(arg,item=>{const itemReg=typedRegistry||this._getRegistryForType(item);this._exec(method,itemReg,item)})})}_exec(method,registry2,component){const camelMethod=_capitalize(method);callback(component["before"+camelMethod],[],component),registry2[method](component),callback(component["after"+camelMethod],[],component)}_getRegistryForType(type){for(let i=0;ia.filter(x=>!b.some(y=>x.plugin.id===y.plugin.id)),"diff");this._notify(diff(previousDescriptors,descriptors2),chart,"stop"),this._notify(diff(descriptors2,previousDescriptors),chart,"start")}}function allPlugins(config){const plugins2=[],keys=Object.keys(registry.plugins.items);for(let i=0;i{const scaleConf=configScales[id];if(!isObject(scaleConf))return console.error(`Invalid scale configuration for scale: ${id}`);if(scaleConf._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${id}`);const axis=determineAxis(id,scaleConf),defaultId=getDefaultScaleIDFromAxis(axis,chartIndexAxis),defaultScaleOptions=chartDefaults.scales||{};firstIDs[axis]=firstIDs[axis]||id,scales2[id]=mergeIf(Object.create(null),[{axis},scaleConf,defaultScaleOptions[axis],defaultScaleOptions[defaultId]])}),config.data.datasets.forEach(dataset=>{const type=dataset.type||config.type,indexAxis=dataset.indexAxis||getIndexAxis(type,options),defaultScaleOptions=(overrides[type]||{}).scales||{};Object.keys(defaultScaleOptions).forEach(defaultID=>{const axis=getAxisFromDefaultScaleID(defaultID,indexAxis),id=dataset[axis+"AxisID"]||firstIDs[axis]||axis;scales2[id]=scales2[id]||Object.create(null),mergeIf(scales2[id],[{axis},configScales[id],defaultScaleOptions[defaultID]])})}),Object.keys(scales2).forEach(key=>{const scale=scales2[key];mergeIf(scale,[defaults.scales[scale.type],defaults.scale])}),scales2}function initOptions(config){const options=config.options||(config.options={});options.plugins=valueOrDefault(options.plugins,{}),options.scales=mergeScaleConfig(config,options)}function initData(data){return(data=data||{}).datasets=data.datasets||[],data.labels=data.labels||[],data}function initConfig(config){return(config=config||{}).data=initData(config.data),initOptions(config),config}__name(PluginService,"PluginService"),__name(allPlugins,"allPlugins"),__name(getOpts,"getOpts"),__name(createDescriptors,"createDescriptors"),__name(pluginOpts,"pluginOpts"),__name(getIndexAxis,"getIndexAxis"),__name(getAxisFromDefaultScaleID,"getAxisFromDefaultScaleID"),__name(getDefaultScaleIDFromAxis,"getDefaultScaleIDFromAxis"),__name(axisFromPosition,"axisFromPosition"),__name(determineAxis,"determineAxis"),__name(mergeScaleConfig,"mergeScaleConfig"),__name(initOptions,"initOptions"),__name(initData,"initData"),__name(initConfig,"initConfig");const keyCache=new Map,keysCached=new Set;function cachedKeys(cacheKey,generate){let keys=keyCache.get(cacheKey);return keys||(keys=generate(),keyCache.set(cacheKey,keys),keysCached.add(keys)),keys}__name(cachedKeys,"cachedKeys");const addIfFound=__name((set2,obj,key)=>{const opts=resolveObjectKey(obj,key);void 0!==opts&&set2.add(opts)},"addIfFound");class Config{constructor(config){this._config=initConfig(config),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(type){this._config.type=type}get data(){return this._config.data}set data(data){this._config.data=initData(data)}get options(){return this._config.options}set options(options){this._config.options=options}get plugins(){return this._config.plugins}update(){const config=this._config;this.clearCache(),initOptions(config)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(datasetType){return cachedKeys(datasetType,()=>[[`datasets.${datasetType}`,""]])}datasetAnimationScopeKeys(datasetType,transition){return cachedKeys(`${datasetType}.transition.${transition}`,()=>[[`datasets.${datasetType}.transitions.${transition}`,`transitions.${transition}`],[`datasets.${datasetType}`,""]])}datasetElementScopeKeys(datasetType,elementType){return cachedKeys(`${datasetType}-${elementType}`,()=>[[`datasets.${datasetType}.elements.${elementType}`,`datasets.${datasetType}`,`elements.${elementType}`,""]])}pluginScopeKeys(plugin){const id=plugin.id;return cachedKeys(`${this.type}-plugin-${id}`,()=>[[`plugins.${id}`,...plugin.additionalOptionScopes||[]]])}_cachedScopes(mainScope,resetCache){const _scopeCache=this._scopeCache;let cache=_scopeCache.get(mainScope);return(!cache||resetCache)&&(cache=new Map,_scopeCache.set(mainScope,cache)),cache}getOptionScopes(mainScope,keyLists,resetCache){const{options,type}=this,cache=this._cachedScopes(mainScope,resetCache),cached=cache.get(keyLists);if(cached)return cached;const scopes=new Set;keyLists.forEach(keys=>{mainScope&&(scopes.add(mainScope),keys.forEach(key=>addIfFound(scopes,mainScope,key))),keys.forEach(key=>addIfFound(scopes,options,key)),keys.forEach(key=>addIfFound(scopes,overrides[type]||{},key)),keys.forEach(key=>addIfFound(scopes,defaults,key)),keys.forEach(key=>addIfFound(scopes,descriptors,key))});const array=Array.from(scopes);return 0===array.length&&array.push(Object.create(null)),keysCached.has(keyLists)&&cache.set(keyLists,array),array}chartOptionScopes(){const{options,type}=this;return[options,overrides[type]||{},defaults.datasets[type]||{},{type},defaults,descriptors]}resolveNamedOptions(scopes,names2,context,prefixes=[""]){const result={$shared:!0},{resolver,subPrefixes}=getResolver(this._resolverCache,scopes,prefixes);let options=resolver;if(needContext(resolver,names2)){result.$shared=!1;options=_attachContext(resolver,context=isFunction(context)?context():context,this.createResolver(scopes,context,subPrefixes))}for(const prop of names2)result[prop]=options[prop];return result}createResolver(scopes,context,prefixes=[""],descriptorDefaults){const{resolver}=getResolver(this._resolverCache,scopes,prefixes);return isObject(context)?_attachContext(resolver,context,void 0,descriptorDefaults):resolver}}function getResolver(resolverCache,scopes,prefixes){let cache=resolverCache.get(scopes);cache||(cache=new Map,resolverCache.set(scopes,cache));const cacheKey=prefixes.join();let cached=cache.get(cacheKey);return cached||(cached={resolver:_createResolver(scopes,prefixes),subPrefixes:prefixes.filter(p=>!p.toLowerCase().includes("hover"))},cache.set(cacheKey,cached)),cached}__name(Config,"Config"),__name(getResolver,"getResolver");const hasFunction=__name(value=>isObject(value)&&Object.getOwnPropertyNames(value).reduce((acc,key)=>acc||isFunction(value[key]),!1),"hasFunction");function needContext(proxy,names2){const{isScriptable,isIndexable}=_descriptors(proxy);for(const prop of names2){const scriptable=isScriptable(prop),indexable=isIndexable(prop),value=(indexable||scriptable)&&proxy[prop];if(scriptable&&(isFunction(value)||hasFunction(value))||indexable&&isArray(value))return!0}return!1}__name(needContext,"needContext");const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(position,axis){return"top"===position||"bottom"===position||-1===KNOWN_POSITIONS.indexOf(position)&&"x"===axis}function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1]}}function onAnimationsComplete(context){const chart=context.chart,animationOptions2=chart.options.animation;chart.notifyPlugins("afterRender"),callback(animationOptions2&&animationOptions2.onComplete,[context],chart)}function onAnimationProgress(context){const chart=context.chart,animationOptions2=chart.options.animation;callback(animationOptions2&&animationOptions2.onProgress,[context],chart)}function getCanvas(item){return _isDomSupported()&&"string"==typeof item?item=document.getElementById(item):item&&item.length&&(item=item[0]),item&&item.canvas&&(item=item.canvas),item}__name(positionIsHorizontal,"positionIsHorizontal"),__name(compare2Level,"compare2Level"),__name(onAnimationsComplete,"onAnimationsComplete"),__name(onAnimationProgress,"onAnimationProgress"),__name(getCanvas,"getCanvas");const instances={},getChart=__name(key=>{const canvas=getCanvas(key);return Object.values(instances).filter(c=>c.canvas===canvas).pop()},"getChart");function moveNumericKeys(obj,start,move){const keys=Object.keys(obj);for(const key of keys){const intKey=+key;if(intKey>=start){const value=obj[key];delete obj[key],(move>0||intKey>start)&&(obj[intKey+move]=value)}}}function determineLastEvent(e,lastEvent,inChartArea,isClick){return inChartArea&&"mouseout"!==e.type?isClick?lastEvent:e:null}__name(moveNumericKeys,"moveNumericKeys"),__name(determineLastEvent,"determineLastEvent");class Chart{constructor(item,userConfig){const config=this.config=new Config(userConfig),initialCanvas=getCanvas(item),existingChart=getChart(initialCanvas);if(existingChart)throw new Error("Canvas is already in use. Chart with ID '"+existingChart.id+"' must be destroyed before the canvas can be reused.");const options=config.createResolver(config.chartOptionScopes(),this.getContext());this.platform=new(config.platform||_detectPlatform(initialCanvas)),this.platform.updateConfig(config);const context=this.platform.acquireContext(initialCanvas,options.aspectRatio),canvas=context&&context.canvas,height=canvas&&canvas.height,width=canvas&&canvas.width;this.id=uid(),this.ctx=context,this.canvas=canvas,this.width=width,this.height=height,this._options=options,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(mode=>this.update(mode),options.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,context&&canvas?(animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio,maintainAspectRatio},width,height,_aspectRatio}=this;return isNullOrUndef(aspectRatio)?maintainAspectRatio&&_aspectRatio?_aspectRatio:height?width/height:null:aspectRatio}get data(){return this.config.data}set data(data){this.config.data=data}get options(){return this._options}set options(options){this.config.options=options}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(width,height){animator.running(this)?this._resizeBeforeDraw={width,height}:this._resize(width,height)}_resize(width,height){const options=this.options,canvas=this.canvas,aspectRatio=options.maintainAspectRatio&&this.aspectRatio,newSize=this.platform.getMaximumSize(canvas,width,height,aspectRatio),newRatio=options.devicePixelRatio||this.platform.getDevicePixelRatio(),mode=this.width?"resize":"attach";this.width=newSize.width,this.height=newSize.height,this._aspectRatio=this.aspectRatio,retinaScale(this,newRatio,!0)&&(this.notifyPlugins("resize",{size:newSize}),callback(options.onResize,[this,newSize],this),this.attached&&this._doResize(mode)&&this.render())}ensureScalesHaveIDs(){each(this.options.scales||{},(axisOptions,axisID)=>{axisOptions.id=axisID})}buildOrUpdateScales(){const options=this.options,scaleOpts=options.scales,scales2=this.scales,updated=Object.keys(scales2).reduce((obj,id)=>(obj[id]=!1,obj),{});let items=[];scaleOpts&&(items=items.concat(Object.keys(scaleOpts).map(id=>{const scaleOptions=scaleOpts[id],axis=determineAxis(id,scaleOptions),isRadial="r"===axis,isHorizontal="x"===axis;return{options:scaleOptions,dposition:isRadial?"chartArea":isHorizontal?"bottom":"left",dtype:isRadial?"radialLinear":isHorizontal?"category":"linear"}}))),each(items,item=>{const scaleOptions=item.options,id=scaleOptions.id,axis=determineAxis(id,scaleOptions),scaleType=valueOrDefault(scaleOptions.type,item.dtype);(void 0===scaleOptions.position||positionIsHorizontal(scaleOptions.position,axis)!==positionIsHorizontal(item.dposition))&&(scaleOptions.position=item.dposition),updated[id]=!0;let scale=null;if(id in scales2&&scales2[id].type===scaleType)scale=scales2[id];else{scale=new(registry.getScale(scaleType))({id,type:scaleType,ctx:this.ctx,chart:this}),scales2[scale.id]=scale}scale.init(scaleOptions,options)}),each(updated,(hasUpdated,id)=>{hasUpdated||delete scales2[id]}),each(scales2,scale=>{layouts.configure(this,scale,scale.options),layouts.addBox(this,scale)})}_updateMetasets(){const metasets=this._metasets,numData=this.data.datasets.length,numMeta=metasets.length;if(metasets.sort((a,b)=>a.index-b.index),numMeta>numData){for(let i=numData;idatasets.length&&delete this._stacks,metasets.forEach((meta,index2)=>{0===datasets.filter(x=>x===meta._dataset).length&&this._destroyDatasetMeta(index2)})}buildOrUpdateControllers(){const newControllers=[],datasets=this.data.datasets;let i,ilen;for(this._removeUnreferencedMetasets(),i=0,ilen=datasets.length;i{this.getDatasetMeta(datasetIndex).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(mode){const config=this.config;config.update();const options=this._options=config.createResolver(config.chartOptionScopes(),this.getContext()),animsDisabled=this._animationsDisabled=!options.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode,cancelable:!0}))return;const newControllers=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let minPadding=0;for(let i=0,ilen=this.data.datasets.length;i{controller.reset()}),this._updateDatasets(mode),this.notifyPlugins("afterUpdate",{mode}),this._layers.sort(compare2Level("z","_idx"));const{_active,_lastEvent}=this;_lastEvent?this._eventHandler(_lastEvent,!0):_active.length&&this._updateHoverStyles(_active,_active,!0),this.render()}_updateScales(){each(this.scales,scale=>{layouts.removeBox(this,scale)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const options=this.options,existingEvents=new Set(Object.keys(this._listeners)),newEvents=new Set(options.events);(!setsEqual(existingEvents,newEvents)||!!this._responsiveListeners!==options.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices}=this,changes=this._getUniformDataChanges()||[];for(const{method,start,count}of changes){moveNumericKeys(_hiddenIndices,start,"_removeElements"===method?-count:count)}}_getUniformDataChanges(){const _dataChanges=this._dataChanges;if(!_dataChanges||!_dataChanges.length)return;this._dataChanges=[];const datasetCount=this.data.datasets.length,makeSet=__name(idx=>new Set(_dataChanges.filter(c=>c[0]===idx).map((c,i)=>i+","+c.splice(1).join(","))),"makeSet"),changeSet=makeSet(0);for(let i=1;ic.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(minPadding){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,minPadding);const area=this.chartArea,noArea=area.width<=0||area.height<=0;this._layers=[],each(this.boxes,box=>{noArea&&"chartArea"===box.position||(box.configure&&box.configure(),this._layers.push(...box._layers()))},this),this._layers.forEach((item,index2)=>{item._idx=index2}),this.notifyPlugins("afterLayout")}_updateDatasets(mode){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode,cancelable:!0})){for(let i=0,ilen=this.data.datasets.length;i=0;--i)this._drawDataset(metasets[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(meta){const ctx=this.ctx,clip=meta._clip,useClip=!clip.disabled,area=this.chartArea,args={meta,index:meta.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",args)&&(useClip&&clipArea(ctx,{left:!1===clip.left?0:area.left-clip.left,right:!1===clip.right?this.width:area.right+clip.right,top:!1===clip.top?0:area.top-clip.top,bottom:!1===clip.bottom?this.height:area.bottom+clip.bottom}),meta.controller.draw(),useClip&&unclipArea(ctx),args.cancelable=!1,this.notifyPlugins("afterDatasetDraw",args))}isPointInArea(point){return _isPointInArea(point,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,mode,options,useFinalPosition){const method=Interaction.modes[mode];return"function"==typeof method?method(this,e,options,useFinalPosition):[]}getDatasetMeta(datasetIndex){const dataset=this.data.datasets[datasetIndex],metasets=this._metasets;let meta=metasets.filter(x=>x&&x._dataset===dataset).pop();return meta||(meta={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset&&dataset.order||0,index:datasetIndex,_dataset:dataset,_parsed:[],_sorted:!1},metasets.push(meta)),meta}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(datasetIndex){const dataset=this.data.datasets[datasetIndex];if(!dataset)return!1;const meta=this.getDatasetMeta(datasetIndex);return"boolean"==typeof meta.hidden?!meta.hidden:!dataset.hidden}setDatasetVisibility(datasetIndex,visible){this.getDatasetMeta(datasetIndex).hidden=!visible}toggleDataVisibility(index2){this._hiddenIndices[index2]=!this._hiddenIndices[index2]}getDataVisibility(index2){return!this._hiddenIndices[index2]}_updateVisibility(datasetIndex,dataIndex,visible){const mode=visible?"show":"hide",meta=this.getDatasetMeta(datasetIndex),anims=meta.controller._resolveAnimations(void 0,mode);defined(dataIndex)?(meta.data[dataIndex].hidden=!visible,this.update()):(this.setDatasetVisibility(datasetIndex,visible),anims.update(meta,{visible}),this.update(ctx=>ctx.datasetIndex===datasetIndex?mode:void 0))}hide(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!1)}show(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!0)}_destroyDatasetMeta(datasetIndex){const meta=this._metasets[datasetIndex];meta&&meta.controller&&meta.controller._destroy(),delete this._metasets[datasetIndex]}_stop(){let i,ilen;for(this.stop(),animator.remove(this),i=0,ilen=this.data.datasets.length;i{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),listener=__name((e,x,y)=>{e.offsetX=x,e.offsetY=y,this._eventHandler(e)},"listener");each(this.options.events,type=>_add(type,listener))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const listeners=this._responsiveListeners,platform=this.platform,_add=__name((type,listener2)=>{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),_remove=__name((type,listener2)=>{listeners[type]&&(platform.removeEventListener(this,type,listener2),delete listeners[type])},"_remove"),listener=__name((width,height)=>{this.canvas&&this.resize(width,height)},"listener");let detached;const attached=__name(()=>{_remove("attach",attached),this.attached=!0,this.resize(),_add("resize",listener),_add("detach",detached)},"attached");detached=__name(()=>{this.attached=!1,_remove("resize",listener),this._stop(),this._resize(0,0),_add("attach",attached)},"detached"),platform.isAttached(this.canvas)?attached():detached()}unbindEvents(){each(this._listeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._listeners={},each(this._responsiveListeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._responsiveListeners=void 0}updateHoverStyle(items,mode,enabled){const prefix=enabled?"set":"remove";let meta,item,i,ilen;for("dataset"===mode&&(meta=this.getDatasetMeta(items[0].datasetIndex),meta.controller["_"+prefix+"DatasetHoverStyle"]()),i=0,ilen=items.length;i{const meta=this.getDatasetMeta(datasetIndex);if(!meta)throw new Error("No dataset found at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}});!_elementsEqual(active,lastActive)&&(this._active=active,this._lastEvent=null,this._updateHoverStyles(active,lastActive))}notifyPlugins(hook,args,filter){return this._plugins.notify(this,hook,args,filter)}_updateHoverStyles(active,lastActive,replay){const hoverOptions=this.options.hover,diff=__name((a,b)=>a.filter(x=>!b.some(y=>x.datasetIndex===y.datasetIndex&&x.index===y.index)),"diff"),deactivated=diff(lastActive,active),activated=replay?active:diff(active,lastActive);deactivated.length&&this.updateHoverStyle(deactivated,hoverOptions.mode,!1),activated.length&&hoverOptions.mode&&this.updateHoverStyle(activated,hoverOptions.mode,!0)}_eventHandler(e,replay){const args={event:e,replay,cancelable:!0,inChartArea:this.isPointInArea(e)},eventFilter=__name(plugin=>(plugin.options.events||this.options.events).includes(e.native.type),"eventFilter");if(!1===this.notifyPlugins("beforeEvent",args,eventFilter))return;const changed=this._handleEvent(e,replay,args.inChartArea);return args.cancelable=!1,this.notifyPlugins("afterEvent",args,eventFilter),(changed||args.changed)&&this.render(),this}_handleEvent(e,replay,inChartArea){const{_active:lastActive=[],options}=this,useFinalPosition=replay,active=this._getActiveElements(e,lastActive,inChartArea,useFinalPosition),isClick=_isClickEvent(e),lastEvent=determineLastEvent(e,this._lastEvent,inChartArea,isClick);inChartArea&&(this._lastEvent=null,callback(options.onHover,[e,active,this],this),isClick&&callback(options.onClick,[e,active,this],this));const changed=!_elementsEqual(active,lastActive);return(changed||replay)&&(this._active=active,this._updateHoverStyles(active,lastActive,replay)),this._lastEvent=lastEvent,changed}_getActiveElements(e,lastActive,inChartArea,useFinalPosition){if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;const hoverOptions=this.options.hover;return this.getElementsAtEventForMode(e,hoverOptions.mode,hoverOptions,useFinalPosition)}}__name(Chart,"Chart");const invalidatePlugins=__name(()=>each(Chart.instances,chart=>chart._plugins.invalidate()),"invalidatePlugins");function clipArc(ctx,element,endAngle){const{startAngle,pixelMargin,x,y,outerRadius,innerRadius}=element;let angleMargin=pixelMargin/outerRadius;ctx.beginPath(),ctx.arc(x,y,outerRadius,startAngle-angleMargin,endAngle+angleMargin),innerRadius>pixelMargin?(angleMargin=pixelMargin/innerRadius,ctx.arc(x,y,innerRadius,endAngle+angleMargin,startAngle-angleMargin,!0)):ctx.arc(x,y,pixelMargin,endAngle+HALF_PI,startAngle-HALF_PI),ctx.closePath(),ctx.clip()}function toRadiusCorners(value){return _readValueToProps(value,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(arc,innerRadius,outerRadius,angleDelta){const o=toRadiusCorners(arc.options.borderRadius),halfThickness=(outerRadius-innerRadius)/2,innerLimit=Math.min(halfThickness,angleDelta*innerRadius/2),computeOuterLimit=__name(val=>{const outerArcLimit=(outerRadius-Math.min(halfThickness,val))*angleDelta/2;return _limitValue(val,0,Math.min(halfThickness,outerArcLimit))},"computeOuterLimit");return{outerStart:computeOuterLimit(o.outerStart),outerEnd:computeOuterLimit(o.outerEnd),innerStart:_limitValue(o.innerStart,0,innerLimit),innerEnd:_limitValue(o.innerEnd,0,innerLimit)}}function rThetaToXY(r,theta,x,y){return{x:x+r*Math.cos(theta),y:y+r*Math.sin(theta)}}function pathArc(ctx,element,offset,spacing,end){const{x,y,startAngle:start,pixelMargin,innerRadius:innerR}=element,outerRadius=Math.max(element.outerRadius+spacing+offset-pixelMargin,0),innerRadius=innerR>0?innerR+spacing+offset+pixelMargin:0;let spacingOffset=0;const alpha2=end-start;if(spacing){const avNogSpacingRadius=((innerR>0?innerR-spacing:0)+(outerRadius>0?outerRadius-spacing:0))/2;spacingOffset=(alpha2-(0!==avNogSpacingRadius?alpha2*avNogSpacingRadius/(avNogSpacingRadius+spacing):alpha2))/2}const angleOffset=(alpha2-Math.max(.001,alpha2*outerRadius-offset/PI)/outerRadius)/2,startAngle=start+angleOffset+spacingOffset,endAngle=end-angleOffset-spacingOffset,{outerStart,outerEnd,innerStart,innerEnd}=parseBorderRadius$1(element,innerRadius,outerRadius,endAngle-startAngle),outerStartAdjustedRadius=outerRadius-outerStart,outerEndAdjustedRadius=outerRadius-outerEnd,outerStartAdjustedAngle=startAngle+outerStart/outerStartAdjustedRadius,outerEndAdjustedAngle=endAngle-outerEnd/outerEndAdjustedRadius,innerStartAdjustedRadius=innerRadius+innerStart,innerEndAdjustedRadius=innerRadius+innerEnd,innerStartAdjustedAngle=startAngle+innerStart/innerStartAdjustedRadius,innerEndAdjustedAngle=endAngle-innerEnd/innerEndAdjustedRadius;if(ctx.beginPath(),ctx.arc(x,y,outerRadius,outerStartAdjustedAngle,outerEndAdjustedAngle),outerEnd>0){const pCenter=rThetaToXY(outerEndAdjustedRadius,outerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerEnd,outerEndAdjustedAngle,endAngle+HALF_PI)}const p4=rThetaToXY(innerEndAdjustedRadius,endAngle,x,y);if(ctx.lineTo(p4.x,p4.y),innerEnd>0){const pCenter=rThetaToXY(innerEndAdjustedRadius,innerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerEnd,endAngle+HALF_PI,innerEndAdjustedAngle+Math.PI)}if(ctx.arc(x,y,innerRadius,endAngle-innerEnd/innerRadius,startAngle+innerStart/innerRadius,!0),innerStart>0){const pCenter=rThetaToXY(innerStartAdjustedRadius,innerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerStart,innerStartAdjustedAngle+Math.PI,startAngle-HALF_PI)}const p8=rThetaToXY(outerStartAdjustedRadius,startAngle,x,y);if(ctx.lineTo(p8.x,p8.y),outerStart>0){const pCenter=rThetaToXY(outerStartAdjustedRadius,outerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerStart,startAngle-HALF_PI,outerStartAdjustedAngle)}ctx.closePath()}function drawArc(ctx,element,offset,spacing){const{fullCircles,startAngle,circumference}=element;let endAngle=element.endAngle;if(fullCircles){pathArc(ctx,element,offset,spacing,startAngle+TAU);for(let i=0;i{registry.add(...items),invalidatePlugins()}},unregister:{enumerable:true,value:(...items)=>{registry.remove(...items),invalidatePlugins()}}}),__name(clipArc,"clipArc"),__name(toRadiusCorners,"toRadiusCorners"),__name(parseBorderRadius$1,"parseBorderRadius$1"),__name(rThetaToXY,"rThetaToXY"),__name(pathArc,"pathArc"),__name(drawArc,"drawArc"),__name(drawFullCircleBorders,"drawFullCircleBorders"),__name(drawBorder,"drawBorder");class ArcElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}inRange(chartX,chartY,useFinalPosition){const point=this.getProps(["x","y"],useFinalPosition),{angle,distance}=getAngleFromPoint(point,{x:chartX,y:chartY}),{startAngle,endAngle,innerRadius,outerRadius,circumference}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),rAdjust=this.options.spacing/2,betweenAngles=valueOrDefault(circumference,endAngle-startAngle)>=TAU||_angleBetween(angle,startAngle,endAngle),withinRadius=_isBetween(distance,innerRadius+rAdjust,outerRadius+rAdjust);return betweenAngles&&withinRadius}getCenterPoint(useFinalPosition){const{x,y,startAngle,endAngle,innerRadius,outerRadius}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),{offset,spacing}=this.options,halfAngle=(startAngle+endAngle)/2,halfRadius=(innerRadius+outerRadius+spacing+offset)/2;return{x:x+Math.cos(halfAngle)*halfRadius,y:y+Math.sin(halfAngle)*halfRadius}}tooltipPosition(useFinalPosition){return this.getCenterPoint(useFinalPosition)}draw(ctx){const{options,circumference}=this,offset=(options.offset||0)/2,spacing=(options.spacing||0)/2;if(this.pixelMargin="inner"===options.borderAlign?.33:0,this.fullCircles=circumference>TAU?Math.floor(circumference/TAU):0,0===circumference||this.innerRadius<0||this.outerRadius<0)return;ctx.save();let radiusOffset=0;if(offset){radiusOffset=offset/2;const halfAngle=(this.startAngle+this.endAngle)/2;ctx.translate(Math.cos(halfAngle)*radiusOffset,Math.sin(halfAngle)*radiusOffset),this.circumference>=PI&&(radiusOffset=offset)}ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor;drawBorder(ctx,this,radiusOffset,spacing,drawArc(ctx,this,radiusOffset,spacing)),ctx.restore()}}function setStyle(ctx,options,style=options){ctx.lineCap=valueOrDefault(style.borderCapStyle,options.borderCapStyle),ctx.setLineDash(valueOrDefault(style.borderDash,options.borderDash)),ctx.lineDashOffset=valueOrDefault(style.borderDashOffset,options.borderDashOffset),ctx.lineJoin=valueOrDefault(style.borderJoinStyle,options.borderJoinStyle),ctx.lineWidth=valueOrDefault(style.borderWidth,options.borderWidth),ctx.strokeStyle=valueOrDefault(style.borderColor,options.borderColor)}function lineTo(ctx,previous,target){ctx.lineTo(target.x,target.y)}function getLineMethod(options){return options.stepped?_steppedLineTo:options.tension||"monotone"===options.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(points,segment,params={}){const count=points.length,{start:paramsStart=0,end:paramsEnd=count-1}=params,{start:segmentStart,end:segmentEnd}=segment,start=Math.max(paramsStart,segmentStart),end=Math.min(paramsEnd,segmentEnd),outside=paramsStartsegmentEnd&¶msEnd>segmentEnd;return{count,start,loop:segment.loop,ilen:end(start+(reverse?ilen-index2:index2))%count,"pointIndex"),drawX=__name(()=>{minY!==maxY&&(ctx.lineTo(avgX,maxY),ctx.lineTo(avgX,minY),ctx.lineTo(avgX,lastY))},"drawX");for(move&&(point=points[pointIndex(0)],ctx.moveTo(point.x,point.y)),i=0;i<=ilen;++i){if(point=points[pointIndex(i)],point.skip)continue;const x=point.x,y=point.y,truncX=0|x;truncX===prevX?(ymaxY&&(maxY=y),avgX=(countX*avgX+x)/++countX):(drawX(),ctx.lineTo(x,y),prevX=truncX,countX=0,minY=maxY=y),lastY=y}drawX()}function _getSegmentMethod(line){const opts=line.options,borderDash=opts.borderDash&&opts.borderDash.length;return line._decimated||line._loop||opts.tension||"monotone"===opts.cubicInterpolationMode||opts.stepped||borderDash?pathSegment:fastPathSegment}function _getInterpolationMethod(options){return options.stepped?_steppedInterpolation:options.tension||"monotone"===options.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(ctx,line,start,count){let path=line._path;path||(path=line._path=new Path2D,line.path(path,start,count)&&path.closePath()),setStyle(ctx,line.options),ctx.stroke(path)}function strokePathDirect(ctx,line,start,count){const{segments,options}=line,segmentMethod=_getSegmentMethod(line);for(const segment of segments)setStyle(ctx,options,segment.style),ctx.beginPath(),segmentMethod(ctx,line,segment,{start,end:start+count-1})&&ctx.closePath(),ctx.stroke()}__name(ArcElement,"ArcElement"),ArcElement.id="arc",ArcElement.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ArcElement.defaultRoutes={backgroundColor:"backgroundColor"},__name(setStyle,"setStyle"),__name(lineTo,"lineTo"),__name(getLineMethod,"getLineMethod"),__name(pathVars,"pathVars"),__name(pathSegment,"pathSegment"),__name(fastPathSegment,"fastPathSegment"),__name(_getSegmentMethod,"_getSegmentMethod"),__name(_getInterpolationMethod,"_getInterpolationMethod"),__name(strokePathWithCache,"strokePathWithCache"),__name(strokePathDirect,"strokePathDirect");const usePath2D="function"==typeof Path2D;function draw(ctx,line,start,count){usePath2D&&!line.options.segment?strokePathWithCache(ctx,line,start,count):strokePathDirect(ctx,line,start,count)}__name(draw,"draw");class LineElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}updateControlPoints(chartArea,indexAxis){const options=this.options;if((options.tension||"monotone"===options.cubicInterpolationMode)&&!options.stepped&&!this._pointsUpdated){const loop=options.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,options,chartArea,loop,indexAxis),this._pointsUpdated=!0}}set points(points){this._points=points,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const segments=this.segments,points=this.points;return segments.length&&points[segments[0].start]}last(){const segments=this.segments,points=this.points,count=segments.length;return count&&points[segments[count-1].end]}interpolate(point,property){const options=this.options,value=point[property],points=this.points,segments=_boundSegments(this,{property,start:value,end:value});if(!segments.length)return;const result=[],_interpolate=_getInterpolationMethod(options);let i,ilen;for(i=0,ilen=segments.length;i"borderDash"!==name&&"fill"!==name},__name(inRange$1,"inRange$1");class PointElement extends Element{constructor(cfg){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,cfg&&Object.assign(this,cfg)}inRange(mouseX,mouseY,useFinalPosition){const options=this.options,{x,y}=this.getProps(["x","y"],useFinalPosition);return Math.pow(mouseX-x,2)+Math.pow(mouseY-y,2)=count)return data.slice(start,start+count);const decimated=[],bucketWidth=(count-2)/(samples-2);let sampledIndex=0;const endIndex=start+count-1;let i,maxAreaPoint,maxArea,area,nextA,a=start;for(decimated[sampledIndex++]=data[a],i=0;imaxArea&&(maxArea=area,maxAreaPoint=data[j],nextA=j);decimated[sampledIndex++]=maxAreaPoint,a=nextA}return decimated[sampledIndex++]=data[endIndex],decimated}function minMaxDecimation(data,start,count,availableWidth){let i,point,x,y,prevX,minIndex,maxIndex,startIndex,minY,maxY,avgX=0,countX=0;const decimated=[],endIndex=start+count-1,xMin=data[start].x,dx=data[endIndex].x-xMin;for(i=start;imaxY&&(maxY=y,maxIndex=i),avgX=(countX*avgX+point.x)/++countX;else{const lastIndex=i-1;if(!isNullOrUndef(minIndex)&&!isNullOrUndef(maxIndex)){const intermediateIndex1=Math.min(minIndex,maxIndex),intermediateIndex2=Math.max(minIndex,maxIndex);intermediateIndex1!==startIndex&&intermediateIndex1!==lastIndex&&decimated.push({...data[intermediateIndex1],x:avgX}),intermediateIndex2!==startIndex&&intermediateIndex2!==lastIndex&&decimated.push({...data[intermediateIndex2],x:avgX})}i>0&&lastIndex!==startIndex&&decimated.push(data[lastIndex]),decimated.push(point),prevX=truncX,countX=0,minY=maxY=y,minIndex=maxIndex=startIndex=i}}return decimated}function cleanDecimatedDataset(dataset){if(dataset._decimated){const data=dataset._data;delete dataset._decimated,delete dataset._data,Object.defineProperty(dataset,"data",{value:data})}}function cleanDecimatedData(chart){chart.data.datasets.forEach(dataset=>{cleanDecimatedDataset(dataset)})}function getStartAndCountOfVisiblePointsSimplified(meta,points){const pointCount=points.length;let count,start=0;const{iScale}=meta,{min,max,minDefined,maxDefined}=iScale.getUserBounds();return minDefined&&(start=_limitValue(_lookupByKey(points,iScale.axis,min).lo,0,pointCount-1)),count=maxDefined?_limitValue(_lookupByKey(points,iScale.axis,max).hi+1,start,pointCount)-start:pointCount-start,{start,count}}__name(lttbDecimation,"lttbDecimation"),__name(minMaxDecimation,"minMaxDecimation"),__name(cleanDecimatedDataset,"cleanDecimatedDataset"),__name(cleanDecimatedData,"cleanDecimatedData"),__name(getStartAndCountOfVisiblePointsSimplified,"getStartAndCountOfVisiblePointsSimplified");function _segments(line,target,property){const segments=line.segments,points=line.points,tpoints=target.points,parts=[];for(const segment of segments){let{start,end}=segment;end=_findSegmentEnd(start,end,points);const bounds=_getBounds(property,points[start],points[end],segment.loop);if(!target.segments){parts.push({source:segment,target:bounds,start:points[start],end:points[end]});continue}const targetSegments=_boundSegments(target,bounds);for(const tgt of targetSegments){const subBounds=_getBounds(property,tpoints[tgt.start],tpoints[tgt.end],tgt.loop),fillSources=_boundSegment(segment,points,subBounds);for(const fillSource of fillSources)parts.push({source:fillSource,target:tgt,start:{[property]:_getEdge(bounds,subBounds,"start",Math.max)},end:{[property]:_getEdge(bounds,subBounds,"end",Math.min)}})}}return parts}function _getBounds(property,first,last,loop){if(loop)return;let start=first[property],end=last[property];return"angle"===property&&(start=_normalizeAngle(start),end=_normalizeAngle(end)),{property,start,end}}function _pointsFromSegments(boundary,line){const{x=null,y=null}=boundary||{},linePoints=line.points,points=[];return line.segments.forEach(({start,end})=>{end=_findSegmentEnd(start,end,linePoints);const first=linePoints[start],last=linePoints[end];null!==y?(points.push({x:first.x,y}),points.push({x:last.x,y})):null!==x&&(points.push({x,y:first.y}),points.push({x,y:last.y}))}),points}function _findSegmentEnd(start,end,points){for(;end>start;end--){const point=points[end];if(!isNaN(point.x)&&!isNaN(point.y))break}return end}function _getEdge(a,b,prop,fn){return a&&b?fn(a[prop],b[prop]):a?a[prop]:b?b[prop]:0}function _createBoundaryLine(boundary,line){let points=[],_loop=!1;return isArray(boundary)?(_loop=!0,points=boundary):points=_pointsFromSegments(boundary,line),points.length?new LineElement({points,options:{tension:0},_loop,_fullLoop:_loop}):null}function _resolveTarget(sources,index2,propagate){let fill2=sources[index2].fill;const visited=[index2];let target;if(!propagate)return fill2;for(;!1!==fill2&&-1===visited.indexOf(fill2);){if(!isNumberFinite(fill2))return fill2;if(target=sources[fill2],!target)return!1;if(target.visible)return fill2;visited.push(fill2),fill2=target.fill}return!1}function _decodeFill(line,index2,count){const fill2=parseFillOption(line);if(isObject(fill2))return!isNaN(fill2.value)&&fill2;let target=parseFloat(fill2);return isNumberFinite(target)&&Math.floor(target)===target?decodeTargetIndex(fill2[0],index2,target,count):["origin","start","end","stack","shape"].indexOf(fill2)>=0&&fill2}function decodeTargetIndex(firstCh,index2,target,count){return("-"===firstCh||"+"===firstCh)&&(target=index2+target),!(target===index2||target<0||target>=count)&&target}function _getTargetPixel(fill2,scale){let pixel=null;return"start"===fill2?pixel=scale.bottom:"end"===fill2?pixel=scale.top:isObject(fill2)?pixel=scale.getPixelForValue(fill2.value):scale.getBasePixel&&(pixel=scale.getBasePixel()),pixel}function _getTargetValue(fill2,scale,startValue){let value;return value="start"===fill2?startValue:"end"===fill2?scale.options.reverse?scale.min:scale.max:isObject(fill2)?fill2.value:scale.getBaseValue(),value}function parseFillOption(line){const options=line.options,fillOption=options.fill;let fill2=valueOrDefault(fillOption&&fillOption.target,fillOption);return void 0===fill2&&(fill2=!!options.backgroundColor),!1!==fill2&&null!==fill2&&(!0===fill2?"origin":fill2)}function _buildStackLine(source){const{scale,index:index2,line}=source,points=[],segments=line.segments,sourcePoints=line.points,linesBelow=getLinesBelow(scale,index2);linesBelow.push(_createBoundaryLine({x:null,y:scale.bottom},line));for(let i=0;i=0;--i){const source=metasets[i].$filler;!source||(source.line.updateControlPoints(area,source.axis),draw2&&_drawfill(chart.ctx,source,area))}},beforeDatasetsDraw(chart,_args,options){if("beforeDatasetsDraw"!==options.drawTime)return;const metasets=chart.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;source&&_drawfill(chart.ctx,source,chart.chartArea)}},beforeDatasetDraw(chart,args,options){const source=args.meta.$filler;!source||!1===source.fill||"beforeDatasetDraw"!==options.drawTime||_drawfill(chart.ctx,source,chart.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=__name((labelOpts,fontSize)=>{let{boxHeight=fontSize,boxWidth=fontSize}=labelOpts;return labelOpts.usePointStyle&&(boxHeight=Math.min(boxHeight,fontSize),boxWidth=Math.min(boxWidth,fontSize)),{boxWidth,boxHeight,itemHeight:Math.max(fontSize,boxHeight)}},"getBoxSize"),itemsEqual=__name((a,b)=>null!==a&&null!==b&&a.datasetIndex===b.datasetIndex&&a.index===b.index,"itemsEqual");class Legend extends Element{constructor(config){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight,margins){this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins,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 labelOpts=this.options.labels||{};let legendItems=callback(labelOpts.generateLabels,[this.chart],this)||[];labelOpts.filter&&(legendItems=legendItems.filter(item=>labelOpts.filter(item,this.chart.data))),labelOpts.sort&&(legendItems=legendItems.sort((a,b)=>labelOpts.sort(a,b,this.chart.data))),this.options.reverse&&legendItems.reverse(),this.legendItems=legendItems}fit(){const{options,ctx}=this;if(!options.display)return void(this.width=this.height=0);const labelOpts=options.labels,labelFont=toFont(labelOpts.font),fontSize=labelFont.size,titleHeight=this._computeTitleHeight(),{boxWidth,itemHeight}=getBoxSize(labelOpts,fontSize);let width,height;ctx.font=labelFont.string,this.isHorizontal()?(width=this.maxWidth,height=this._fitRows(titleHeight,fontSize,boxWidth,itemHeight)+10):(height=this.maxHeight,width=this._fitCols(titleHeight,fontSize,boxWidth,itemHeight)+10),this.width=Math.min(width,options.maxWidth||this.maxWidth),this.height=Math.min(height,options.maxHeight||this.maxHeight)}_fitRows(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxWidth,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],lineWidths=this.lineWidths=[0],lineHeight=itemHeight+padding;let totalHeight=titleHeight;ctx.textAlign="left",ctx.textBaseline="middle";let row=-1,top=-lineHeight;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;(0===i||lineWidths[lineWidths.length-1]+itemWidth+2*padding>maxWidth)&&(totalHeight+=lineHeight,lineWidths[lineWidths.length-(i>0?0:1)]=0,top+=lineHeight,row++),hitboxes[i]={left:0,top,row,width:itemWidth,height:itemHeight},lineWidths[lineWidths.length-1]+=itemWidth+padding}),totalHeight}_fitCols(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxHeight,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],columnSizes=this.columnSizes=[],heightLimit=maxHeight-titleHeight;let totalWidth=padding,currentColWidth=0,currentColHeight=0,left=0,col=0;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;i>0&¤tColHeight+itemHeight+2*padding>heightLimit&&(totalWidth+=currentColWidth+padding,columnSizes.push({width:currentColWidth,height:currentColHeight}),left+=currentColWidth+padding,col++,currentColWidth=currentColHeight=0),hitboxes[i]={left,top:currentColHeight,col,width:itemWidth,height:itemHeight},currentColWidth=Math.max(currentColWidth,itemWidth),currentColHeight+=itemHeight+padding}),totalWidth+=currentColWidth,columnSizes.push({width:currentColWidth,height:currentColHeight}),totalWidth}adjustHitBoxes(){if(!this.options.display)return;const titleHeight=this._computeTitleHeight(),{legendHitBoxes:hitboxes,options:{align,labels:{padding},rtl}}=this,rtlHelper=getRtlAdapter(rtl,this.left,this.width);if(this.isHorizontal()){let row=0,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row]);for(const hitbox of hitboxes)row!==hitbox.row&&(row=hitbox.row,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row])),hitbox.top+=this.top+titleHeight+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(left),hitbox.width),left+=hitbox.width+padding}else{let col=0,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height);for(const hitbox of hitboxes)hitbox.col!==col&&(col=hitbox.col,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height)),hitbox.top=top,hitbox.left+=this.left+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(hitbox.left),hitbox.width),top+=hitbox.height+padding}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const ctx=this.ctx;clipArea(ctx,this),this._draw(),unclipArea(ctx)}}_draw(){const{options:opts,columnSizes,lineWidths,ctx}=this,{align,labels:labelOpts}=opts,defaultColor=defaults.color,rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),labelFont=toFont(labelOpts.font),{color:fontColor,padding}=labelOpts,fontSize=labelFont.size,halfFontSize=fontSize/2;let cursor;this.drawTitle(),ctx.textAlign=rtlHelper.textAlign("left"),ctx.textBaseline="middle",ctx.lineWidth=.5,ctx.font=labelFont.string;const{boxWidth,boxHeight,itemHeight}=getBoxSize(labelOpts,fontSize),drawLegendBox=__name(function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0||isNaN(boxHeight)||boxHeight<0)return;ctx.save();const lineWidth=valueOrDefault(legendItem.lineWidth,1);if(ctx.fillStyle=valueOrDefault(legendItem.fillStyle,defaultColor),ctx.lineCap=valueOrDefault(legendItem.lineCap,"butt"),ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,0),ctx.lineJoin=valueOrDefault(legendItem.lineJoin,"miter"),ctx.lineWidth=lineWidth,ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,defaultColor),ctx.setLineDash(valueOrDefault(legendItem.lineDash,[])),labelOpts.usePointStyle){const drawOptions={radius:boxWidth*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth},centerX=rtlHelper.xPlus(x,boxWidth/2);drawPoint(ctx,drawOptions,centerX,y+halfFontSize)}else{const yBoxTop=y+Math.max((fontSize-boxHeight)/2,0),xBoxLeft=rtlHelper.leftForLtr(x,boxWidth),borderRadius=toTRBLCorners(legendItem.borderRadius);ctx.beginPath(),Object.values(borderRadius).some(v=>0!==v)?addRoundedRectPath(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius}):ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight),ctx.fill(),0!==lineWidth&&ctx.stroke()}ctx.restore()},"drawLegendBox"),fillText=__name(function(x,y,legendItem){renderText(ctx,legendItem.text,x,y+itemHeight/2,labelFont,{strikethrough:legendItem.hidden,textAlign:rtlHelper.textAlign(legendItem.textAlign)})},"fillText"),isHorizontal=this.isHorizontal(),titleHeight=this._computeTitleHeight();cursor=isHorizontal?{x:_alignStartEnd(align,this.left+padding,this.right-lineWidths[0]),y:this.top+padding+titleHeight,line:0}:{x:this.left+padding,y:_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[0].height),line:0},overrideTextDirection(this.ctx,opts.textDirection);const lineHeight=itemHeight+padding;this.legendItems.forEach((legendItem,i)=>{ctx.strokeStyle=legendItem.fontColor||fontColor,ctx.fillStyle=legendItem.fontColor||fontColor;const textWidth=ctx.measureText(legendItem.text).width,textAlign=rtlHelper.textAlign(legendItem.textAlign||(legendItem.textAlign=labelOpts.textAlign)),width=boxWidth+halfFontSize+textWidth;let x=cursor.x,y=cursor.y;rtlHelper.setWidth(this.width),isHorizontal?i>0&&x+width+padding>this.right&&(y=cursor.y+=lineHeight,cursor.line++,x=cursor.x=_alignStartEnd(align,this.left+padding,this.right-lineWidths[cursor.line])):i>0&&y+lineHeight>this.bottom&&(x=cursor.x=x+columnSizes[cursor.line].width+padding,cursor.line++,y=cursor.y=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[cursor.line].height));const realX=rtlHelper.x(x);drawLegendBox(realX,y,legendItem),x=_textX(textAlign,x+boxWidth+halfFontSize,isHorizontal?x+width:this.right,opts.rtl),fillText(rtlHelper.x(x),y,legendItem),isHorizontal?cursor.x+=width+padding:cursor.y+=lineHeight}),restoreTextDirection(this.ctx,opts.textDirection)}drawTitle(){const opts=this.options,titleOpts=opts.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);if(!titleOpts.display)return;const rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),ctx=this.ctx,position=titleOpts.position,halfFontSize=titleFont.size/2,topPaddingPlusHalfFontSize=titlePadding.top+halfFontSize;let y,left=this.left,maxWidth=this.width;if(this.isHorizontal())maxWidth=Math.max(...this.lineWidths),y=this.top+topPaddingPlusHalfFontSize,left=_alignStartEnd(opts.align,left,this.right-maxWidth);else{const maxHeight=this.columnSizes.reduce((acc,size)=>Math.max(acc,size.height),0);y=topPaddingPlusHalfFontSize+_alignStartEnd(opts.align,this.top,this.bottom-maxHeight-opts.labels.padding-this._computeTitleHeight())}const x=_alignStartEnd(position,left,left+maxWidth);ctx.textAlign=rtlHelper.textAlign(_toLeftRightCenter(position)),ctx.textBaseline="middle",ctx.strokeStyle=titleOpts.color,ctx.fillStyle=titleOpts.color,ctx.font=titleFont.string,renderText(ctx,titleOpts.text,x,y,titleFont)}_computeTitleHeight(){const titleOpts=this.options.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);return titleOpts.display?titleFont.lineHeight+titlePadding.height:0}_getLegendItemAt(x,y){let i,hitBox,lh;if(_isBetween(x,this.left,this.right)&&_isBetween(y,this.top,this.bottom))for(lh=this.legendHitBoxes,i=0;ictx.chart.options.color,boxWidth:40,padding:10,generateLabels(chart){const datasets=chart.data.datasets,{labels:{usePointStyle,pointStyle,textAlign,color:color2}}=chart.legend.options;return chart._getSortedDatasetMetas().map(meta=>{const style=meta.controller.getStyle(usePointStyle?0:void 0),borderWidth=toPadding(style.borderWidth);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,fontColor:color2,hidden:!meta.visible,lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:(borderWidth.width+borderWidth.height)/4,strokeStyle:style.borderColor,pointStyle:pointStyle||style.pointStyle,rotation:style.rotation,textAlign:textAlign||style.textAlign,borderRadius:0,datasetIndex:meta.index}},this)}},title:{color:ctx=>ctx.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:name=>!name.startsWith("on"),labels:{_scriptable:name=>!["generateLabels","filter","sort"].includes(name)}}};class Title extends Element{constructor(config){super(),this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight){const opts=this.options;if(this.left=0,this.top=0,!opts.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=maxWidth,this.height=this.bottom=maxHeight;const lineCount=isArray(opts.text)?opts.text.length:1;this._padding=toPadding(opts.padding);const textSize=lineCount*toFont(opts.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=textSize:this.width=textSize}isHorizontal(){const pos=this.options.position;return"top"===pos||"bottom"===pos}_drawArgs(offset){const{top,left,bottom,right,options}=this,align=options.align;let maxWidth,titleX,titleY,rotation=0;return this.isHorizontal()?(titleX=_alignStartEnd(align,left,right),titleY=top+offset,maxWidth=right-left):("left"===options.position?(titleX=left+offset,titleY=_alignStartEnd(align,bottom,top),rotation=-.5*PI):(titleX=right-offset,titleY=_alignStartEnd(align,top,bottom),rotation=.5*PI),maxWidth=bottom-top),{titleX,titleY,maxWidth,rotation}}draw(){const ctx=this.ctx,opts=this.options;if(!opts.display)return;const fontOpts=toFont(opts.font),offset=fontOpts.lineHeight/2+this._padding.top,{titleX,titleY,maxWidth,rotation}=this._drawArgs(offset);renderText(ctx,opts.text,0,0,fontOpts,{color:opts.color,maxWidth,rotation,textAlign:_toLeftRightCenter(opts.align),textBaseline:"middle",translation:[titleX,titleY]})}}function createTitle(chart,titleOpts){const title=new Title({ctx:chart.ctx,options:titleOpts,chart});layouts.configure(chart,title,titleOpts),layouts.addBox(chart,title),chart.titleBlock=title}__name(Title,"Title"),__name(createTitle,"createTitle");var plugin_title={id:"title",_element:Title,start(chart,_args,options){createTitle(chart,options)},stop(chart){const titleBlock=chart.titleBlock;layouts.removeBox(chart,titleBlock),delete chart.titleBlock},beforeUpdate(chart,_args,options){const title=chart.titleBlock;layouts.configure(chart,title,options),title.options=options},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 positioners={average(items){if(!items.length)return!1;let i,len,x=0,y=0,count=0;for(i=0,len=items.length;i-1?str.split("\n"):str}function createTooltipItem(chart,item){const{element,datasetIndex,index:index2}=item,controller=chart.getDatasetMeta(datasetIndex).controller,{label,value}=controller.getLabelAndValue(index2);return{chart,label,parsed:controller.getParsed(index2),raw:chart.data.datasets[datasetIndex].data[index2],formattedValue:value,dataset:controller.getDataset(),dataIndex:index2,datasetIndex,element}}function getTooltipSize(tooltip,options){const ctx=tooltip.chart.ctx,{body,footer,title}=tooltip,{boxWidth,boxHeight}=options,bodyFont=toFont(options.bodyFont),titleFont=toFont(options.titleFont),footerFont=toFont(options.footerFont),titleLineCount=title.length,footerLineCount=footer.length,bodyLineItemCount=body.length,padding=toPadding(options.padding);let height=padding.height,width=0,combinedBodyLength=body.reduce((count,bodyItem)=>count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length,0);if(combinedBodyLength+=tooltip.beforeBody.length+tooltip.afterBody.length,titleLineCount&&(height+=titleLineCount*titleFont.lineHeight+(titleLineCount-1)*options.titleSpacing+options.titleMarginBottom),combinedBodyLength){height+=bodyLineItemCount*(options.displayColors?Math.max(boxHeight,bodyFont.lineHeight):bodyFont.lineHeight)+(combinedBodyLength-bodyLineItemCount)*bodyFont.lineHeight+(combinedBodyLength-1)*options.bodySpacing}footerLineCount&&(height+=options.footerMarginTop+footerLineCount*footerFont.lineHeight+(footerLineCount-1)*options.footerSpacing);let widthPadding=0;const maxLineWidth=__name(function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding)},"maxLineWidth");return ctx.save(),ctx.font=titleFont.string,each(tooltip.title,maxLineWidth),ctx.font=bodyFont.string,each(tooltip.beforeBody.concat(tooltip.afterBody),maxLineWidth),widthPadding=options.displayColors?boxWidth+2+options.boxPadding:0,each(body,bodyItem=>{each(bodyItem.before,maxLineWidth),each(bodyItem.lines,maxLineWidth),each(bodyItem.after,maxLineWidth)}),widthPadding=0,ctx.font=footerFont.string,each(tooltip.footer,maxLineWidth),ctx.restore(),width+=padding.width,{width,height}}function determineYAlign(chart,size){const{y,height}=size;return ychart.height-height/2?"bottom":"center"}function doesNotFitWithAlign(xAlign,chart,options,size){const{x,width}=size,caret=options.caretSize+options.caretPadding;if("left"===xAlign&&x+width+caret>chart.width||"right"===xAlign&&x-width-caret<0)return!0}function determineXAlign(chart,options,size,yAlign){const{x,width}=size,{width:chartWidth,chartArea:{left,right}}=chart;let xAlign="center";return"center"===yAlign?xAlign=x<=(left+right)/2?"left":"right":x<=width/2?xAlign="left":x>=chartWidth-width/2&&(xAlign="right"),doesNotFitWithAlign(xAlign,chart,options,size)&&(xAlign="center"),xAlign}function determineAlignment(chart,options,size){const yAlign=size.yAlign||options.yAlign||determineYAlign(chart,size);return{xAlign:size.xAlign||options.xAlign||determineXAlign(chart,options,size,yAlign),yAlign}}function alignX(size,xAlign){let{x,width}=size;return"right"===xAlign?x-=width:"center"===xAlign&&(x-=width/2),x}function alignY(size,yAlign,paddingAndSize){let{y,height}=size;return"top"===yAlign?y+=paddingAndSize:y-="bottom"===yAlign?height+paddingAndSize:height/2,y}function getBackgroundPoint(options,size,alignment,chart){const{caretSize,caretPadding,cornerRadius}=options,{xAlign,yAlign}=alignment,paddingAndSize=caretSize+caretPadding,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius);let x=alignX(size,xAlign);const y=alignY(size,yAlign,paddingAndSize);return"center"===yAlign?"left"===xAlign?x+=paddingAndSize:"right"===xAlign&&(x-=paddingAndSize):"left"===xAlign?x-=Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign&&(x+=Math.max(topRight,bottomRight)+caretSize),{x:_limitValue(x,0,chart.width-size.width),y:_limitValue(y,0,chart.height-size.height)}}function getAlignedX(tooltip,align,options){const padding=toPadding(options.padding);return"center"===align?tooltip.x+tooltip.width/2:"right"===align?tooltip.x+tooltip.width-padding.right:tooltip.x+padding.left}function getBeforeAfterBodyLines(callback2){return pushOrConcat([],splitNewlines(callback2))}function createTooltipContext(parent,tooltip,tooltipItems){return createContext(parent,{tooltip,tooltipItems,type:"tooltip"})}function overrideCallbacks(callbacks,context){const override=context&&context.dataset&&context.dataset.tooltip&&context.dataset.tooltip.callbacks;return override?callbacks.override(override):callbacks}__name(pushOrConcat,"pushOrConcat"),__name(splitNewlines,"splitNewlines"),__name(createTooltipItem,"createTooltipItem"),__name(getTooltipSize,"getTooltipSize"),__name(determineYAlign,"determineYAlign"),__name(doesNotFitWithAlign,"doesNotFitWithAlign"),__name(determineXAlign,"determineXAlign"),__name(determineAlignment,"determineAlignment"),__name(alignX,"alignX"),__name(alignY,"alignY"),__name(getBackgroundPoint,"getBackgroundPoint"),__name(getAlignedX,"getAlignedX"),__name(getBeforeAfterBodyLines,"getBeforeAfterBodyLines"),__name(createTooltipContext,"createTooltipContext"),__name(overrideCallbacks,"overrideCallbacks");class Tooltip extends Element{constructor(config){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=config.chart||config._chart,this._chart=this.chart,this.options=config.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(options){this.options=options,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const cached=this._cachedAnimations;if(cached)return cached;const chart=this.chart,options=this.options.setContext(this.getContext()),opts=options.enabled&&chart.options.animation&&options.animations,animations=new Animations(this.chart,opts);return opts._cacheable&&(this._cachedAnimations=Object.freeze(animations)),animations}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(context,options){const{callbacks}=options,beforeTitle=callbacks.beforeTitle.apply(this,[context]),title=callbacks.title.apply(this,[context]),afterTitle=callbacks.afterTitle.apply(this,[context]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeTitle)),lines=pushOrConcat(lines,splitNewlines(title)),lines=pushOrConcat(lines,splitNewlines(afterTitle)),lines}getBeforeBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this,[tooltipItems]))}getBody(tooltipItems,options){const{callbacks}=options,bodyItems=[];return each(tooltipItems,context=>{const bodyItem={before:[],lines:[],after:[]},scoped=overrideCallbacks(callbacks,context);pushOrConcat(bodyItem.before,splitNewlines(scoped.beforeLabel.call(this,context))),pushOrConcat(bodyItem.lines,scoped.label.call(this,context)),pushOrConcat(bodyItem.after,splitNewlines(scoped.afterLabel.call(this,context))),bodyItems.push(bodyItem)}),bodyItems}getAfterBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this,[tooltipItems]))}getFooter(tooltipItems,options){const{callbacks}=options,beforeFooter=callbacks.beforeFooter.apply(this,[tooltipItems]),footer=callbacks.footer.apply(this,[tooltipItems]),afterFooter=callbacks.afterFooter.apply(this,[tooltipItems]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeFooter)),lines=pushOrConcat(lines,splitNewlines(footer)),lines=pushOrConcat(lines,splitNewlines(afterFooter)),lines}_createItems(options){const active=this._active,data=this.chart.data,labelColors=[],labelPointStyles=[],labelTextColors=[];let i,len,tooltipItems=[];for(i=0,len=active.length;ioptions.filter(element,index2,array,data))),options.itemSort&&(tooltipItems=tooltipItems.sort((a,b)=>options.itemSort(a,b,data))),each(tooltipItems,context=>{const scoped=overrideCallbacks(options.callbacks,context);labelColors.push(scoped.labelColor.call(this,context)),labelPointStyles.push(scoped.labelPointStyle.call(this,context)),labelTextColors.push(scoped.labelTextColor.call(this,context))}),this.labelColors=labelColors,this.labelPointStyles=labelPointStyles,this.labelTextColors=labelTextColors,this.dataPoints=tooltipItems,tooltipItems}update(changed,replay){const options=this.options.setContext(this.getContext()),active=this._active;let properties,tooltipItems=[];if(active.length){const position=positioners[options.position].call(this,active,this._eventPosition);tooltipItems=this._createItems(options),this.title=this.getTitle(tooltipItems,options),this.beforeBody=this.getBeforeBody(tooltipItems,options),this.body=this.getBody(tooltipItems,options),this.afterBody=this.getAfterBody(tooltipItems,options),this.footer=this.getFooter(tooltipItems,options);const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,size),alignment=determineAlignment(this.chart,options,positionAndSize),backgroundPoint=getBackgroundPoint(options,positionAndSize,alignment,this.chart);this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,properties={opacity:1,x:backgroundPoint.x,y:backgroundPoint.y,width:size.width,height:size.height,caretX:position.x,caretY:position.y}}else 0!==this.opacity&&(properties={opacity:0});this._tooltipItems=tooltipItems,this.$context=void 0,properties&&this._resolveAnimations().update(this,properties),changed&&options.external&&options.external.call(this,{chart:this.chart,tooltip:this,replay})}drawCaret(tooltipPoint,ctx,size,options){const caretPosition=this.getCaretPosition(tooltipPoint,size,options);ctx.lineTo(caretPosition.x1,caretPosition.y1),ctx.lineTo(caretPosition.x2,caretPosition.y2),ctx.lineTo(caretPosition.x3,caretPosition.y3)}getCaretPosition(tooltipPoint,size,options){const{xAlign,yAlign}=this,{caretSize,cornerRadius}=options,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius),{x:ptX,y:ptY}=tooltipPoint,{width,height}=size;let x1,x2,x3,y1,y2,y3;return"center"===yAlign?(y2=ptY+height/2,"left"===xAlign?(x1=ptX,x2=x1-caretSize,y1=y2+caretSize,y3=y2-caretSize):(x1=ptX+width,x2=x1+caretSize,y1=y2-caretSize,y3=y2+caretSize),x3=x1):(x2="left"===xAlign?ptX+Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign?ptX+width-Math.max(topRight,bottomRight)-caretSize:this.caretX,"top"===yAlign?(y1=ptY,y2=y1-caretSize,x1=x2-caretSize,x3=x2+caretSize):(y1=ptY+height,y2=y1+caretSize,x1=x2+caretSize,x3=x2-caretSize),y3=y1),{x1,x2,x3,y1,y2,y3}}drawTitle(pt,ctx,options){const title=this.title,length=title.length;let titleFont,titleSpacing,i;if(length){const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width);for(pt.x=getAlignedX(this,options.titleAlign,options),ctx.textAlign=rtlHelper.textAlign(options.titleAlign),ctx.textBaseline="middle",titleFont=toFont(options.titleFont),titleSpacing=options.titleSpacing,ctx.fillStyle=options.titleColor,ctx.font=titleFont.string,i=0;i0!==v)?(ctx.beginPath(),ctx.fillStyle=options.multiKeyBackground,addRoundedRectPath(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius}),ctx.fill(),ctx.stroke(),ctx.fillStyle=labelColors.backgroundColor,ctx.beginPath(),addRoundedRectPath(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius}),ctx.fill()):(ctx.fillStyle=options.multiKeyBackground,ctx.fillRect(outerX,colorY,boxWidth,boxHeight),ctx.strokeRect(outerX,colorY,boxWidth,boxHeight),ctx.fillStyle=labelColors.backgroundColor,ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2))}ctx.fillStyle=this.labelTextColors[i]}drawBody(pt,ctx,options){const{body}=this,{bodySpacing,bodyAlign,displayColors,boxHeight,boxWidth,boxPadding}=options,bodyFont=toFont(options.bodyFont);let bodyLineHeight=bodyFont.lineHeight,xLinePadding=0;const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width),fillLineOfText=__name(function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyLineHeight/2),pt.y+=bodyLineHeight+bodySpacing},"fillLineOfText"),bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign);let bodyItem,textColor,lines,i,j,ilen,jlen;for(ctx.textAlign=bodyAlign,ctx.textBaseline="middle",ctx.font=bodyFont.string,pt.x=getAlignedX(this,bodyAlignForCalculation,options),ctx.fillStyle=options.bodyColor,each(this.beforeBody,fillLineOfText),xLinePadding=displayColors&&"right"!==bodyAlignForCalculation?"center"===bodyAlign?boxWidth/2+boxPadding:boxWidth+2+boxPadding:0,i=0,ilen=body.length;i0&&ctx.stroke()}_updateAnimationTarget(options){const chart=this.chart,anims=this.$animations,animX=anims&&anims.x,animY=anims&&anims.y;if(animX||animY){const position=positioners[options.position].call(this,this._active,this._eventPosition);if(!position)return;const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,this._size),alignment=determineAlignment(chart,options,positionAndSize),point=getBackgroundPoint(options,positionAndSize,alignment,chart);(animX._to!==point.x||animY._to!==point.y)&&(this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,this.width=size.width,this.height=size.height,this.caretX=position.x,this.caretY=position.y,this._resolveAnimations().update(this,point))}}_willRender(){return!!this.opacity}draw(ctx){const options=this.options.setContext(this.getContext());let opacity=this.opacity;if(!opacity)return;this._updateAnimationTarget(options);const tooltipSize={width:this.width,height:this.height},pt={x:this.x,y:this.y};opacity=Math.abs(opacity)<.001?0:opacity;const padding=toPadding(options.padding),hasTooltipContent=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;options.enabled&&hasTooltipContent&&(ctx.save(),ctx.globalAlpha=opacity,this.drawBackground(pt,ctx,tooltipSize,options),overrideTextDirection(ctx,options.textDirection),pt.y+=padding.top,this.drawTitle(pt,ctx,options),this.drawBody(pt,ctx,options),this.drawFooter(pt,ctx,options),restoreTextDirection(ctx,options.textDirection),ctx.restore())}getActiveElements(){return this._active||[]}setActiveElements(activeElements,eventPosition){const lastActive=this._active,active=activeElements.map(({datasetIndex,index:index2})=>{const meta=this.chart.getDatasetMeta(datasetIndex);if(!meta)throw new Error("Cannot find a dataset at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}}),changed=!_elementsEqual(lastActive,active),positionChanged=this._positionChanged(active,eventPosition);(changed||positionChanged)&&(this._active=active,this._eventPosition=eventPosition,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,replay,inChartArea=!0){if(replay&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const options=this.options,lastActive=this._active||[],active=this._getActiveElements(e,lastActive,replay,inChartArea),positionChanged=this._positionChanged(active,e),changed=replay||!_elementsEqual(active,lastActive)||positionChanged;return changed&&(this._active=active,(options.enabled||options.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,replay))),changed}_getActiveElements(e,lastActive,replay,inChartArea){const options=this.options;if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;const active=this.chart.getElementsAtEventForMode(e,options.mode,options,replay);return options.reverse&&active.reverse(),active}_positionChanged(active,e){const{caretX,caretY,options}=this,position=positioners[options.position].call(this,active,e);return!1!==position&&(caretX!==position.x||caretY!==position.y)}}__name(Tooltip,"Tooltip"),Tooltip.positioners=positioners;var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(chart,_args,options){options&&(chart.tooltip=new Tooltip({chart,options}))},beforeUpdate(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},reset(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},afterDraw(chart){const tooltip=chart.tooltip;if(tooltip&&tooltip._willRender()){const args={tooltip};if(!1===chart.notifyPlugins("beforeTooltipDraw",args))return;tooltip.draw(chart.ctx),chart.notifyPlugins("afterTooltipDraw",args)}},afterEvent(chart,args){if(chart.tooltip){const useFinalPosition=args.replay;chart.tooltip.handleEvent(args.event,useFinalPosition,args.inChartArea)&&(args.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:(ctx,opts)=>opts.bodyFont.size,boxWidth:(ctx,opts)=>opts.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:noop,title(tooltipItems){if(tooltipItems.length>0){const item=tooltipItems[0],labels=item.chart.data.labels,labelCount=labels?labels.length:0;if(this&&this.options&&"dataset"===this.options.mode)return item.dataset.label||"";if(item.label)return item.label;if(labelCount>0&&item.dataIndex"filter"!==name&&"itemSort"!==name&&"external"!==name,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=__name((labels,raw,index2,addedLabels)=>("string"==typeof raw?(index2=labels.push(raw)-1,addedLabels.unshift({index:index2,label:raw})):isNaN(raw)&&(index2=null),index2),"addIfString");function findOrAddLabel(labels,raw,index2,addedLabels){const first=labels.indexOf(raw);if(-1===first)return addIfString(labels,raw,index2,addedLabels);return first!==labels.lastIndexOf(raw)?index2:first}__name(findOrAddLabel,"findOrAddLabel");const validIndex=__name((index2,max)=>null===index2?null:_limitValue(Math.round(index2),0,max),"validIndex");class CategoryScale extends Scale{constructor(cfg){super(cfg),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(scaleOptions){const added=this._addedLabels;if(added.length){const labels=this.getLabels();for(const{index:index2,label}of added)labels[index2]===label&&labels.splice(index2,1);this._addedLabels=[]}super.init(scaleOptions)}parse(raw,index2){if(isNullOrUndef(raw))return null;const labels=this.getLabels();return index2=isFinite(index2)&&labels[index2]===raw?index2:findOrAddLabel(labels,raw,valueOrDefault(index2,raw),this._addedLabels),validIndex(index2,labels.length-1)}determineDataLimits(){const{minDefined,maxDefined}=this.getUserBounds();let{min,max}=this.getMinMax(!0);"ticks"===this.options.bounds&&(minDefined||(min=0),maxDefined||(max=this.getLabels().length-1)),this.min=min,this.max=max}buildTicks(){const min=this.min,max=this.max,offset=this.options.offset,ticks=[];let labels=this.getLabels();labels=0===min&&max===labels.length-1?labels:labels.slice(min,max+1),this._valueRange=Math.max(labels.length-(offset?0:1),1),this._startValue=this.min-(offset?.5:0);for(let value=min;value<=max;value++)ticks.push({value});return ticks}getLabelForValue(value){const labels=this.getLabels();return value>=0&&valueticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getValueForPixel(pixel){return Math.round(this._startValue+this.getDecimalForPixel(pixel)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(generationOptions,dataRange){const ticks=[],{bounds,step,min,max,precision,count,maxTicks,maxDigits,includeBounds}=generationOptions,unit=step||1,maxSpaces=maxTicks-1,{min:rmin,max:rmax}=dataRange,minDefined=!isNullOrUndef(min),maxDefined=!isNullOrUndef(max),countDefined=!isNullOrUndef(count),minSpacing=(rmax-rmin)/(maxDigits+1);let factor,niceMin,niceMax,numSpaces,spacing=niceNum((rmax-rmin)/maxSpaces/unit)*unit;if(spacing<1e-14&&!minDefined&&!maxDefined)return[{value:rmin},{value:rmax}];numSpaces=Math.ceil(rmax/spacing)-Math.floor(rmin/spacing),numSpaces>maxSpaces&&(spacing=niceNum(numSpaces*spacing/maxSpaces/unit)*unit),isNullOrUndef(precision)||(factor=Math.pow(10,precision),spacing=Math.ceil(spacing*factor)/factor),"ticks"===bounds?(niceMin=Math.floor(rmin/spacing)*spacing,niceMax=Math.ceil(rmax/spacing)*spacing):(niceMin=rmin,niceMax=rmax),minDefined&&maxDefined&&step&&almostWhole((max-min)/step,spacing/1e3)?(numSpaces=Math.round(Math.min((max-min)/spacing,maxTicks)),spacing=(max-min)/numSpaces,niceMin=min,niceMax=max):countDefined?(niceMin=minDefined?min:niceMin,niceMax=maxDefined?max:niceMax,numSpaces=count-1,spacing=(niceMax-niceMin)/numSpaces):(numSpaces=(niceMax-niceMin)/spacing,numSpaces=almostEquals(numSpaces,Math.round(numSpaces),spacing/1e3)?Math.round(numSpaces):Math.ceil(numSpaces));const decimalPlaces=Math.max(_decimalPlaces(spacing),_decimalPlaces(niceMin));factor=Math.pow(10,isNullOrUndef(precision)?decimalPlaces:precision),niceMin=Math.round(niceMin*factor)/factor,niceMax=Math.round(niceMax*factor)/factor;let j=0;for(minDefined&&(includeBounds&&niceMin!==min?(ticks.push({value:min}),niceMinmin=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax");if(beginAtZero){const minSign=sign(min),maxSign=sign(max);minSign<0&&maxSign<0?setMax(0):minSign>0&&maxSign>0&&setMin(0)}if(min===max){let offset=1;(max>=Number.MAX_SAFE_INTEGER||min<=Number.MIN_SAFE_INTEGER)&&(offset=Math.abs(.05*max)),setMax(max+offset),beginAtZero||setMin(min-offset)}this.min=min,this.max=max}getTickLimit(){const tickOpts=this.options.ticks;let maxTicks,{maxTicksLimit,stepSize}=tickOpts;return stepSize?(maxTicks=Math.ceil(this.max/stepSize)-Math.floor(this.min/stepSize)+1,maxTicks>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`),maxTicks=1e3)):(maxTicks=this.computeTickLimit(),maxTicksLimit=maxTicksLimit||11),maxTicksLimit&&(maxTicks=Math.min(maxTicksLimit,maxTicks)),maxTicks}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const opts=this.options,tickOpts=opts.ticks;let maxTicks=this.getTickLimit();maxTicks=Math.max(2,maxTicks);const ticks=generateTicks$1({maxTicks,bounds:opts.bounds,min:opts.min,max:opts.max,precision:tickOpts.precision,step:tickOpts.stepSize,count:tickOpts.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:tickOpts.minRotation||0,includeBounds:!1!==tickOpts.includeBounds},this._range||this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}configure(){const ticks=this.ticks;let start=this.min,end=this.max;if(super.configure(),this.options.offset&&ticks.length){const offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset,end+=offset}this._startValue=start,this._endValue=end,this._valueRange=end-start}getLabelForValue(value){return formatNumber(value,this.chart.options.locale,this.options.ticks.format)}}__name(LinearScaleBase,"LinearScaleBase");class LinearScale extends LinearScaleBase{determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?min:0,this.max=isNumberFinite(max)?max:1,this.handleTickRangeOptions()}computeTickLimit(){const horizontal=this.isHorizontal(),length=horizontal?this.width:this.height,minRotation=toRadians(this.options.ticks.minRotation),ratio=(horizontal?Math.sin(minRotation):Math.cos(minRotation))||.001,tickFont=this._resolveTickFontOptions(0);return Math.ceil(length/Math.min(40,tickFont.lineHeight/ratio))}getPixelForValue(value){return null===value?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getValueForPixel(pixel){return this._startValue+this.getDecimalForPixel(pixel)*this._valueRange}}function isMajor(tickVal){return tickVal/Math.pow(10,Math.floor(log10(tickVal)))==1}function generateTicks(generationOptions,dataRange){const endExp=Math.floor(log10(dataRange.max)),endSignificand=Math.ceil(dataRange.max/Math.pow(10,endExp)),ticks=[];let tickVal=finiteOrDefault(generationOptions.min,Math.pow(10,Math.floor(log10(dataRange.min)))),exp=Math.floor(log10(tickVal)),significand=Math.floor(tickVal/Math.pow(10,exp)),precision=exp<0?Math.pow(10,Math.abs(exp)):1;do{ticks.push({value:tickVal,major:isMajor(tickVal)}),++significand,10===significand&&(significand=1,++exp,precision=exp>=0?1:precision),tickVal=Math.round(significand*Math.pow(10,exp)*precision)/precision}while(exp0?value:null;this._zero=!0}determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?Math.max(0,min):null,this.max=isNumberFinite(max)?Math.max(0,max):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined,maxDefined}=this.getUserBounds();let min=this.min,max=this.max;const setMin=__name(v=>min=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax"),exp=__name((v,m)=>Math.pow(10,Math.floor(log10(v))+m),"exp");min===max&&(min<=0?(setMin(1),setMax(10)):(setMin(exp(min,-1)),setMax(exp(max,1)))),min<=0&&setMin(exp(max,-1)),max<=0&&setMax(exp(min,1)),this._zero&&this.min!==this._suggestedMin&&min===exp(this.min,0)&&setMin(exp(min,-1)),this.min=min,this.max=max}buildTicks(){const opts=this.options,ticks=generateTicks({min:this._userMin,max:this._userMax},this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}getLabelForValue(value){return void 0===value?"0":formatNumber(value,this.chart.options.locale,this.options.ticks.format)}configure(){const start=this.min;super.configure(),this._startValue=log10(start),this._valueRange=log10(this.max)-log10(start)}getPixelForValue(value){return(void 0===value||0===value)&&(value=this.min),null===value||isNaN(value)?NaN:this.getPixelForDecimal(value===this.min?0:(log10(value)-this._startValue)/this._valueRange)}getValueForPixel(pixel){const decimal=this.getDecimalForPixel(pixel);return Math.pow(10,this._startValue+decimal*this._valueRange)}}function getTickBackdropHeight(opts){const tickOpts=opts.ticks;if(tickOpts.display&&opts.display){const padding=toPadding(tickOpts.backdropPadding);return valueOrDefault(tickOpts.font&&tickOpts.font.size,defaults.font.size)+padding.height}return 0}function measureLabelSize(ctx,font,label){return label=isArray(label)?label:[label],{w:_longestText(ctx,font.string,label),h:label.length*font.lineHeight}}function determineLimits(angle,pos,size,min,max){return angle===min||angle===max?{start:pos-size/2,end:pos+size/2}:anglemax?{start:pos-size,end:pos}:{start:pos,end:pos+size}}function fitWithPointLabels(scale){const orig={l:scale.left+scale._padding.left,r:scale.right-scale._padding.right,t:scale.top+scale._padding.top,b:scale.bottom-scale._padding.bottom},limits=Object.assign({},orig),labelSizes=[],padding=[],valueCount=scale._pointLabels.length,pointLabelOpts=scale.options.pointLabels,additionalAngle=pointLabelOpts.centerPointLabels?PI/valueCount:0;for(let i=0;iorig.r&&(x=(hLimits.end-orig.r)/sin,limits.r=Math.max(limits.r,orig.r+x)),vLimits.startorig.b&&(y=(vLimits.end-orig.b)/cos,limits.b=Math.max(limits.b,orig.b+y))}function buildPointLabelItems(scale,labelSizes,padding){const items=[],valueCount=scale._pointLabels.length,opts=scale.options,extra=getTickBackdropHeight(opts)/2,outerDistance=scale.drawingArea,additionalAngle=opts.pointLabels.centerPointLabels?PI/valueCount:0;for(let i=0;i270||angle<90)&&(y-=h),y}function drawPointLabels(scale,labelCount){const{ctx,options:{pointLabels}}=scale;for(let i=labelCount-1;i>=0;i--){const optsAtIndex=pointLabels.setContext(scale.getPointLabelContext(i)),plFont=toFont(optsAtIndex.font),{x,y,textAlign,left,top,right,bottom}=scale._pointLabelItems[i],{backdropColor}=optsAtIndex;if(!isNullOrUndef(backdropColor)){const borderRadius=toTRBLCorners(optsAtIndex.borderRadius),padding=toPadding(optsAtIndex.backdropPadding);ctx.fillStyle=backdropColor;const backdropLeft=left-padding.left,backdropTop=top-padding.top,backdropWidth=right-left+padding.width,backdropHeight=bottom-top+padding.height;Object.values(borderRadius).some(v=>0!==v)?(ctx.beginPath(),addRoundedRectPath(ctx,{x:backdropLeft,y:backdropTop,w:backdropWidth,h:backdropHeight,radius:borderRadius}),ctx.fill()):ctx.fillRect(backdropLeft,backdropTop,backdropWidth,backdropHeight)}renderText(ctx,scale._pointLabels[i],x,y+plFont.lineHeight/2,plFont,{color:optsAtIndex.color,textAlign,textBaseline:"middle"})}}function pathRadiusLine(scale,radius,circular,labelCount){const{ctx}=scale;if(circular)ctx.arc(scale.xCenter,scale.yCenter,radius,0,TAU);else{let pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(let i=1;i{const label=callback(this.options.pointLabels.callback,[value,index2],this);return label||0===label?label:""}).filter((v,i)=>this.chart.getDataVisibility(i))}fit(){const opts=this.options;opts.display&&opts.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(leftMovement,rightMovement,topMovement,bottomMovement){this.xCenter+=Math.floor((leftMovement-rightMovement)/2),this.yCenter+=Math.floor((topMovement-bottomMovement)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(leftMovement,rightMovement,topMovement,bottomMovement))}getIndexAngle(index2){return _normalizeAngle(index2*(TAU/(this._pointLabels.length||1))+toRadians(this.options.startAngle||0))}getDistanceFromCenterForValue(value){if(isNullOrUndef(value))return NaN;const scalingFactor=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-value)*scalingFactor:(value-this.min)*scalingFactor}getValueForDistanceFromCenter(distance){if(isNullOrUndef(distance))return NaN;const scaledDistance=distance/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-scaledDistance:this.min+scaledDistance}getPointLabelContext(index2){const pointLabels=this._pointLabels||[];if(index2>=0&&index2{if(0!==index2){offset=this.getDistanceFromCenterForValue(tick.value);drawRadiusLine(this,grid.setContext(this.getContext(index2-1)),offset,labelCount)}}),angleLines.display){for(ctx.save(),i=labelCount-1;i>=0;i--){const optsAtIndex=angleLines.setContext(this.getPointLabelContext(i)),{color:color2,lineWidth}=optsAtIndex;!lineWidth||!color2||(ctx.lineWidth=lineWidth,ctx.strokeStyle=color2,ctx.setLineDash(optsAtIndex.borderDash),ctx.lineDashOffset=optsAtIndex.borderDashOffset,offset=this.getDistanceFromCenterForValue(opts.ticks.reverse?this.min:this.max),position=this.getPointPosition(i,offset),ctx.beginPath(),ctx.moveTo(this.xCenter,this.yCenter),ctx.lineTo(position.x,position.y),ctx.stroke())}ctx.restore()}}drawBorder(){}drawLabels(){const ctx=this.ctx,opts=this.options,tickOpts=opts.ticks;if(!tickOpts.display)return;const startAngle=this.getIndexAngle(0);let offset,width;ctx.save(),ctx.translate(this.xCenter,this.yCenter),ctx.rotate(startAngle),ctx.textAlign="center",ctx.textBaseline="middle",this.ticks.forEach((tick,index2)=>{if(0===index2&&!opts.reverse)return;const optsAtIndex=tickOpts.setContext(this.getContext(index2)),tickFont=toFont(optsAtIndex.font);if(offset=this.getDistanceFromCenterForValue(this.ticks[index2].value),optsAtIndex.showLabelBackdrop){ctx.font=tickFont.string,width=ctx.measureText(tick.label).width,ctx.fillStyle=optsAtIndex.backdropColor;const padding=toPadding(optsAtIndex.backdropPadding);ctx.fillRect(-width/2-padding.left,-offset-tickFont.size/2-padding.top,width+padding.width,tickFont.size+padding.height)}renderText(ctx,tick.label,0,-offset,tickFont,{color:optsAtIndex.color})}),ctx.restore()}drawTitle(){}}__name(RadialLinearScale,"RadialLinearScale"),RadialLinearScale.id="radialLinear",RadialLinearScale.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:label=>label,padding:5,centerPointLabels:!1}},RadialLinearScale.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},RadialLinearScale.descriptors={angleLines:{_fallback:"grid"}};const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(a,b){return a-b}function parse(scale,input){if(isNullOrUndef(input))return null;const adapter=scale._adapter,{parser,round:round2,isoWeekday}=scale._parseOpts;let value=input;return"function"==typeof parser&&(value=parser(value)),isNumberFinite(value)||(value="string"==typeof parser?adapter.parse(value,parser):adapter.parse(value)),null===value?null:(round2&&(value="week"!==round2||!isNumber(isoWeekday)&&!0!==isoWeekday?adapter.startOf(value,round2):adapter.startOf(value,"isoWeek",isoWeekday)),+value)}function determineUnitForAutoTicks(minUnit,min,max,capacity){const ilen=UNITS.length;for(let i=UNITS.indexOf(minUnit);i=UNITS.indexOf(minUnit);i--){const unit=UNITS[i];if(INTERVALS[unit].common&&scale._adapter.diff(max,min,unit)>=numTicks-1)return unit}return UNITS[minUnit?UNITS.indexOf(minUnit):0]}function determineMajorUnit(unit){for(let i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i=time?timestamps[lo]:timestamps[hi]]=!0}}else ticks[time]=!0}function setMajorTicks(scale,ticks,map2,majorUnit){const adapter=scale._adapter,first=+adapter.startOf(ticks[0].value,majorUnit),last=ticks[ticks.length-1].value;let major,index2;for(major=first;major<=last;major=+adapter.add(major,1,majorUnit))index2=map2[major],index2>=0&&(ticks[index2].major=!0);return ticks}function ticksFromTimestamps(scale,values,majorUnit){const ticks=[],map2={},ilen=values.length;let i,value;for(i=0;i+tick.value))}initOffsets(timestamps){let first,last,start=0,end=0;this.options.offset&×tamps.length&&(first=this.getDecimalForValue(timestamps[0]),start=1===timestamps.length?1-first:(this.getDecimalForValue(timestamps[1])-first)/2,last=this.getDecimalForValue(timestamps[timestamps.length-1]),end=1===timestamps.length?last:(last-this.getDecimalForValue(timestamps[timestamps.length-2]))/2);const limit=timestamps.length<3?.5:.25;start=_limitValue(start,0,limit),end=_limitValue(end,0,limit),this._offsets={start,end,factor:1/(start+1+end)}}_generate(){const adapter=this._adapter,min=this.min,max=this.max,options=this.options,timeOpts=options.time,minor=timeOpts.unit||determineUnitForAutoTicks(timeOpts.minUnit,min,max,this._getLabelCapacity(min)),stepSize=valueOrDefault(timeOpts.stepSize,1),weekday="week"===minor&&timeOpts.isoWeekday,hasWeekday=isNumber(weekday)||!0===weekday,ticks={};let time,count,first=min;if(hasWeekday&&(first=+adapter.startOf(first,"isoWeek",weekday)),first=+adapter.startOf(first,hasWeekday?"day":minor),adapter.diff(max,min,minor)>1e5*stepSize)throw new Error(min+" and "+max+" are too far apart with stepSize of "+stepSize+" "+minor);const timestamps="data"===options.ticks.source&&this.getDataTimestamps();for(time=first,count=0;timea-b).map(x=>+x)}getLabelForValue(value){const adapter=this._adapter,timeOpts=this.options.time;return timeOpts.tooltipFormat?adapter.format(value,timeOpts.tooltipFormat):adapter.format(value,timeOpts.displayFormats.datetime)}_tickFormatFunction(time,index2,ticks,format){const options=this.options,formats=options.time.displayFormats,unit=this._unit,majorUnit=this._majorUnit,minorFormat=unit&&formats[unit],majorFormat=majorUnit&&formats[majorUnit],tick=ticks[index2],major=majorUnit&&majorFormat&&tick&&tick.major,label=this._adapter.format(time,format||(major?majorFormat:minorFormat)),formatter=options.ticks.callback;return formatter?callback(formatter,[label,index2,ticks],this):label}generateTickLabels(ticks){let i,ilen,tick;for(i=0,ilen=ticks.length;i0?capacity:1}getDataTimestamps(){let i,ilen,timestamps=this._cache.data||[];if(timestamps.length)return timestamps;const metas=this.getMatchingVisibleMetas();if(this._normalized&&metas.length)return this._cache.data=metas[0].controller.getAllParsedValues(this);for(i=0,ilen=metas.length;i=table[lo].pos&&val<=table[hi].pos&&({lo,hi}=_lookupByKey(table,"pos",val)),({pos:prevSource,time:prevTarget}=table[lo]),({pos:nextSource,time:nextTarget}=table[hi])):(val>=table[lo].time&&val<=table[hi].time&&({lo,hi}=_lookupByKey(table,"time",val)),({time:prevSource,pos:prevTarget}=table[lo]),({time:nextSource,pos:nextTarget}=table[hi]));const span=nextSource-prevSource;return span?prevTarget+(nextTarget-prevTarget)*(val-prevSource)/span:prevTarget}__name(TimeScale,"TimeScale"),TimeScale.id="time",TimeScale.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}},__name(chart_esm_interpolate,"chart_esm_interpolate");class TimeSeriesScale extends TimeScale{constructor(props){super(props),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const timestamps=this._getTimestampsForTable(),table=this._table=this.buildLookupTable(timestamps);this._minPos=chart_esm_interpolate(table,this.min),this._tableRange=chart_esm_interpolate(table,this.max)-this._minPos,super.initOffsets(timestamps)}buildLookupTable(timestamps){const{min,max}=this,items=[],table=[];let i,ilen,prev,curr,next;for(i=0,ilen=timestamps.length;i=min&&curr<=max&&items.push(curr);if(items.length<2)return[{time:min,pos:0},{time:max,pos:1}];for(i=0,ilen=items.length;i__defProp(target,"name",{value,configurable:!0});exports.id=197,exports.ids=[197],exports.modules={90197:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{NotFoundModule:()=>NotFoundModule});var common=__webpack_require__(69808),router=__webpack_require__(74202),core=__webpack_require__(5e3),ngx_translate_core=__webpack_require__(81981);class NotFoundComponent{constructor(){}ngOnInit(){}}__name(NotFoundComponent,"NotFoundComponent"),NotFoundComponent.\u0275fac=__name(function(t){return new(t||NotFoundComponent)},"NotFoundComponent_Factory"),NotFoundComponent.\u0275cmp=core.Xpm({type:NotFoundComponent,selectors:[["app-not-found"]],decls:3,vars:3,template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"p"),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"not-found works!")))},"NotFoundComponent_Template"),dependencies:[ngx_translate_core.X$]});const routes=[{path:"",component:NotFoundComponent}];class NotFoundRoutingModule{}__name(NotFoundRoutingModule,"NotFoundRoutingModule"),NotFoundRoutingModule.\u0275fac=__name(function(t){return new(t||NotFoundRoutingModule)},"NotFoundRoutingModule_Factory"),NotFoundRoutingModule.\u0275mod=core.oAB({type:NotFoundRoutingModule}),NotFoundRoutingModule.\u0275inj=core.cJS({imports:[router.Bz.forChild(routes),router.Bz]});var shared_module=__webpack_require__(83436);class NotFoundModule{}__name(NotFoundModule,"NotFoundModule"),NotFoundModule.\u0275fac=__name(function(t){return new(t||NotFoundModule)},"NotFoundModule_Factory"),NotFoundModule.\u0275mod=core.oAB({type:NotFoundModule}),NotFoundModule.\u0275inj=core.cJS({imports:[common.ez,NotFoundRoutingModule,shared_module.m]})},83436:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>SharedModule});var common=__webpack_require__(69808),angular_datatables=__webpack_require__(65415),fesm2015_forms=__webpack_require__(93075),core=__webpack_require__(5e3),chart_esm=__webpack_require__(34393),operators=__webpack_require__(83292);function listCacheClear(){this.__data__=[],this.size=0}__name(listCacheClear,"listCacheClear");const _listCacheClear=listCacheClear;function eq(value,other){return value===other||value!=value&&other!=other}__name(eq,"eq");const lodash_es_eq=eq;function assocIndexOf(array,key){for(var length=array.length;length--;)if(lodash_es_eq(array[length][0],key))return length;return-1}__name(assocIndexOf,"assocIndexOf");const _assocIndexOf=assocIndexOf;var splice=Array.prototype.splice;function listCacheDelete(key){var data=this.__data__,index=_assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)}__name(listCacheDelete,"listCacheDelete");const _listCacheDelete=listCacheDelete;function listCacheGet(key){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?void 0:data[index][1]}__name(listCacheGet,"listCacheGet");const _listCacheGet=listCacheGet;function listCacheHas(key){return _assocIndexOf(this.__data__,key)>-1}__name(listCacheHas,"listCacheHas");const _listCacheHas=listCacheHas;function listCacheSet(key,value){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}__name(listCacheSet,"listCacheSet");const _listCacheSet=listCacheSet;function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index-1&&value%1==0&&value<=9007199254740991}__name(isLength,"isLength");const lodash_es_isLength=isLength;function isArrayLike(value){return null!=value&&lodash_es_isLength(value.length)&&!lodash_es_isFunction(value)}__name(isArrayLike,"isArrayLike");const lodash_es_isArrayLike=isArrayLike;function isArrayLikeObject(value){return lodash_es_isObjectLike(value)&&lodash_es_isArrayLike(value)}__name(isArrayLikeObject,"isArrayLikeObject");const lodash_es_isArrayLikeObject=isArrayLikeObject;function stubFalse(){return!1}__name(stubFalse,"stubFalse");const lodash_es_stubFalse=stubFalse;var isBuffer_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,isBuffer_freeModule=isBuffer_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,isBuffer_Buffer=isBuffer_freeModule&&isBuffer_freeModule.exports===isBuffer_freeExports?_root.Buffer:void 0;const lodash_es_isBuffer=(isBuffer_Buffer?isBuffer_Buffer.isBuffer:void 0)||lodash_es_stubFalse;var isPlainObject_funcProto=Function.prototype,isPlainObject_objectProto=Object.prototype,isPlainObject_funcToString=isPlainObject_funcProto.toString,isPlainObject_hasOwnProperty=isPlainObject_objectProto.hasOwnProperty,objectCtorString=isPlainObject_funcToString.call(Object);function isPlainObject(value){if(!lodash_es_isObjectLike(value)||"[object Object]"!=_baseGetTag(value))return!1;var proto=_getPrototype(value);if(null===proto)return!0;var Ctor=isPlainObject_hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&isPlainObject_funcToString.call(Ctor)==objectCtorString}__name(isPlainObject,"isPlainObject");const lodash_es_isPlainObject=isPlainObject;var typedArrayTags={};function baseIsTypedArray(value){return lodash_es_isObjectLike(value)&&lodash_es_isLength(value.length)&&!!typedArrayTags[_baseGetTag(value)]}typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1,__name(baseIsTypedArray,"baseIsTypedArray");const _baseIsTypedArray=baseIsTypedArray;function baseUnary(func){return function(value){return func(value)}}__name(baseUnary,"baseUnary");const _baseUnary=baseUnary;var _nodeUtil_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,_nodeUtil_freeModule=_nodeUtil_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=_nodeUtil_freeModule&&_nodeUtil_freeModule.exports===_nodeUtil_freeExports&&_freeGlobal.process,nodeUtil=function(){try{return _nodeUtil_freeModule&&_nodeUtil_freeModule.require&&_nodeUtil_freeModule.require("util").types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}();var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;const lodash_es_isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray;function safeGet(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]}__name(safeGet,"safeGet");const _safeGet=safeGet;var _assignValue_hasOwnProperty=Object.prototype.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];(!_assignValue_hasOwnProperty.call(object,key)||!lodash_es_eq(objValue,value)||void 0===value&&!(key in object))&&_baseAssignValue(object,key,value)}__name(assignValue,"assignValue");const _assignValue=assignValue;function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index-1&&value%1==0&&value0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)}}__name(shortOut,"shortOut");const _setToString=shortOut(_baseSetToString);function baseRest(func,start){return _setToString(_overRest(func,start,lodash_es_identity),func+"")}__name(baseRest,"baseRest");const _baseRest=baseRest;function isIterateeCall(value,index,object){if(!lodash_es_isObject(object))return!1;var type=typeof index;return!!("number"==type?lodash_es_isArrayLike(object)&&_isIndex(index,object.length):"string"==type&&index in object)&&lodash_es_eq(object[index],value)}__name(isIterateeCall,"isIterateeCall");const _isIterateeCall=isIterateeCall;function createAssigner(assigner){return _baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&_isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++indexthis.themeChanged(r)))}ngOnChanges(changes){const requireRender=["type"],propertyNames=Object.getOwnPropertyNames(changes);if(propertyNames.some(key=>requireRender.includes(key))||propertyNames.every(key=>changes[key].isFirstChange()))this.render();else{const config=this.getChartConfiguration();this.chart&&(Object.assign(this.chart.config.data,config.data),Object.assign(this.chart.config.plugins,config.plugins),Object.assign(this.chart.config.options,config.options)),this.update()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(s=>s.unsubscribe())}render(){return this.chart&&this.chart.destroy(),this.zone.runOutsideAngular(()=>this.chart=new chart_esm.kL(this.ctx,this.getChartConfiguration()))}update(duration){this.chart&&this.zone.runOutsideAngular(()=>{var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.update(duration)})}hideDataset(index,hidden){this.chart&&(this.chart.getDatasetMeta(index).hidden=hidden,this.update())}isDatasetHidden(index){var _a,_b;return null===(_b=null===(_a=this.chart)||void 0===_a?void 0:_a.getDatasetMeta(index))||void 0===_b?void 0:_b.hidden}toBase64Image(){var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.toBase64Image()}themeChanged(options){this.themeOverrides=options,this.chart&&(Object.assign(this.chart.config.options,this.getChartOptions()),this.update())}getChartOptions(){return lodash_es_merge({onHover:(event,active)=>{!this.chartHover.observed&&!this.chartHover.observers.length||this.zone.run(()=>this.chartHover.emit({event,active}))},onClick:(event,active)=>{!this.chartClick.observed&&!this.chartClick.observers.length||this.zone.run(()=>this.chartClick.emit({event,active}))}},this.themeOverrides,this.options,{plugins:{legend:{display:this.legend}}})}getChartConfiguration(){return{type:this.type,data:this.getChartData(),plugins:this.plugins,options:this.getChartOptions()}}getChartData(){return this.data?this.data:{labels:this.labels||[],datasets:this.datasets||[]}}}__name(BaseChartDirective,"BaseChartDirective"),BaseChartDirective.\u0275fac=__name(function(t){return new(t||BaseChartDirective)(core.Y36(core.SBq),core.Y36(core.R0b),core.Y36(ThemeService))},"BaseChartDirective_Factory"),BaseChartDirective.\u0275dir=core.lG2({type:BaseChartDirective,selectors:[["canvas","baseChart",""]],inputs:{type:"type",legend:"legend",data:"data",options:"options",plugins:"plugins",labels:"labels",datasets:"datasets"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[core.TTD]});const baseColors=[[255,99,132],[54,162,235],[255,206,86],[231,233,237],[75,192,192],[151,187,205],[220,220,220],[247,70,74],[70,191,189],[253,180,92],[148,159,177],[77,83,96]],builtInDefaults={datasets:{line:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.4),borderColor:context=>rgba(generateColor(context.datasetIndex),1),pointBackgroundColor:context=>rgba(generateColor(context.datasetIndex),1),pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:context=>rgba(generateColor(context.datasetIndex),.8)},bar:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.6),borderColor:context=>rgba(generateColor(context.datasetIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.datasetIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.datasetIndex),1)},get radar(){return this.line},doughnut:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:"#fff",hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),1),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get pie(){return this.doughnut},polarArea:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:context=>rgba(generateColor(context.dataIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get bubble(){return this.doughnut},get scatter(){return this.doughnut},get area(){return this.polarArea}}};function rgba(colour,alpha){return"rgba("+colour.concat(alpha).join(",")+")"}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getRandomColor(){return[getRandomInt(0,255),getRandomInt(0,255),getRandomInt(0,255)]}function generateColor(index=0){return baseColors[index]||getRandomColor()}__name(rgba,"rgba"),__name(getRandomInt,"getRandomInt"),__name(getRandomColor,"getRandomColor"),__name(generateColor,"generateColor"),chart_esm.kL.register(chart_esm.Dx,chart_esm.u,chart_esm.Gu,chart_esm.De,chart_esm.ST,chart_esm.jn,chart_esm.od,chart_esm.f$,chart_esm.uw,chart_esm.vn,chart_esm.ZL,chart_esm.jI,chart_esm.qi,chart_esm.Xi,chart_esm.l7,chart_esm.tt,chart_esm.CV,chart_esm.N0,chart_esm.ho,chart_esm.RM);class NgChartsConfiguration{}__name(NgChartsConfiguration,"NgChartsConfiguration"),NgChartsConfiguration.\u0275fac=__name(function(t){return new(t||NgChartsConfiguration)},"NgChartsConfiguration_Factory"),NgChartsConfiguration.\u0275prov=core.Yz7({token:NgChartsConfiguration,factory:NgChartsConfiguration.\u0275fac,providedIn:"root"});class NgChartsModule{constructor(config){null!=config&&config.plugins&&chart_esm.kL.register(...null==config?void 0:config.plugins);const ngChartsDefaults=lodash_es_merge(builtInDefaults,(null==config?void 0:config.defaults)||{});chart_esm.ce.set(ngChartsDefaults)}static forRoot(config){return{ngModule:NgChartsModule,providers:[{provide:NgChartsConfiguration,useValue:config}]}}}__name(NgChartsModule,"NgChartsModule"),NgChartsModule.\u0275fac=__name(function(t){return new(t||NgChartsModule)(core.LFG(NgChartsConfiguration,8))},"NgChartsModule_Factory"),NgChartsModule.\u0275mod=core.oAB({type:NgChartsModule}),NgChartsModule.\u0275inj=core.cJS({imports:[[]]});var http=__webpack_require__(40520),ngx_translate_core=__webpack_require__(81981),ngx_translate_http_loader=__webpack_require__(80040);function HttpLoaderFactory(http2){return new ngx_translate_http_loader.w(http2)}__name(HttpLoaderFactory,"HttpLoaderFactory");class SharedModule{}__name(SharedModule,"SharedModule"),SharedModule.\u0275fac=__name(function(t){return new(t||SharedModule)},"SharedModule_Factory"),SharedModule.\u0275mod=core.oAB({type:SharedModule}),SharedModule.\u0275inj=core.cJS({imports:[common.ez,angular_datatables.T,fesm2015_forms.UX,fesm2015_forms.u5,NgChartsModule,http.JF,ngx_translate_core.aw.forChild({loader:{provide:ngx_translate_core.Zw,useFactory:HttpLoaderFactory,deps:[http.eN]}}),ngx_translate_core.aw]})},34393:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{qi:()=>ArcElement,vn:()=>BarController,ZL:()=>BarElement,N0:()=>BubbleController,uw:()=>CategoryScale,kL:()=>Chart,jI:()=>DoughnutController,Gu:()=>index,De:()=>plugin_legend,ST:()=>LineController,jn:()=>LineElement,f$:()=>LinearScale,tt:()=>PieController,od:()=>PointElement,CV:()=>PolarAreaController,Xi:()=>RadarController,l7:()=>RadialLinearScale,ho:()=>ScatterController,RM:()=>TimeSeriesScale,Dx:()=>plugin_title,u:()=>plugin_tooltip,ce:()=>defaults}),__name(function fontString(pixelSize,fontStyle,fontFamily){return fontStyle+" "+pixelSize+"px "+fontFamily},"fontString");const requestAnimFrame="undefined"==typeof window?function(callback2){return callback2()}:window.requestAnimationFrame;function throttled(fn,thisArg,updateFn){const updateArgs=updateFn||(args2=>Array.prototype.slice.call(args2));let ticking=!1,args=[];return function(...rest){args=updateArgs(rest),ticking||(ticking=!0,requestAnimFrame.call(window,()=>{ticking=!1,fn.apply(thisArg,args)}))}}function debounce(fn,delay){let timeout;return function(...args){return delay?(clearTimeout(timeout),timeout=setTimeout(fn,delay,args)):fn.apply(this,args),delay}}__name(throttled,"throttled"),__name(debounce,"debounce");const _toLeftRightCenter=__name(align=>"start"===align?"left":"end"===align?"right":"center","_toLeftRightCenter"),_alignStartEnd=__name((align,start,end)=>"start"===align?start:"end"===align?end:(start+end)/2,"_alignStartEnd"),_textX=__name((align,left,right,rtl)=>align===(rtl?"left":"right")?right:"center"===align?(left+right)/2:left,"_textX");function noop(){}__name(noop,"noop");const uid=function(){let id=0;return function(){return id++}}();function isNullOrUndef(value){return null==value}function isArray(value){if(Array.isArray&&Array.isArray(value))return!0;const type=Object.prototype.toString.call(value);return"[object"===type.slice(0,7)&&"Array]"===type.slice(-6)}function isObject(value){return null!==value&&"[object Object]"===Object.prototype.toString.call(value)}__name(isNullOrUndef,"isNullOrUndef"),__name(isArray,"isArray"),__name(isObject,"isObject");const isNumberFinite=__name(value=>("number"==typeof value||value instanceof Number)&&isFinite(+value),"isNumberFinite");function finiteOrDefault(value,defaultValue){return isNumberFinite(value)?value:defaultValue}function valueOrDefault(value,defaultValue){return void 0===value?defaultValue:value}__name(finiteOrDefault,"finiteOrDefault"),__name(valueOrDefault,"valueOrDefault");const toPercentage=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100:value/dimension,"toPercentage"),toDimension=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100*dimension:+value,"toDimension");function callback(fn,args,thisArg){if(fn&&"function"==typeof fn.call)return fn.apply(thisArg,args)}function each(loopable,fn,thisArg,reverse){let i,len,keys;if(isArray(loopable))if(len=loopable.length,reverse)for(i=len-1;i>=0;i--)fn.call(thisArg,loopable[i],i);else for(i=0;ipos;)obj=obj[key.slice(pos,idx)],pos=idx+1,idx=indexOfDotOrLength(key,pos);return obj}function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1)}__name(indexOfDotOrLength,"indexOfDotOrLength"),__name(resolveObjectKey,"resolveObjectKey"),__name(_capitalize,"_capitalize");const defined=__name(value=>void 0!==value,"defined"),isFunction=__name(value=>"function"==typeof value,"isFunction"),setsEqual=__name((a,b)=>{if(a.size!==b.size)return!1;for(const item of a)if(!b.has(item))return!1;return!0},"setsEqual");function _isClickEvent(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}__name(_isClickEvent,"_isClickEvent");const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=2*PI/3,log10=Math.log10,sign=Math.sign;function niceNum(range){const roundedRange=Math.round(range);range=almostEquals(range,roundedRange,range/1e3)?roundedRange:range;const niceRange=Math.pow(10,Math.floor(log10(range))),fraction=range/niceRange;return(fraction<=1?1:fraction<=2?2:fraction<=5?5:10)*niceRange}function _factorize(value){const result=[],sqrt=Math.sqrt(value);let i;for(i=1;ia-b).pop(),result}function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}function almostEquals(x,y,epsilon){return Math.abs(x-y)=x}function _setMinAndMaxByKey(array,target,property){let i,ilen,value;for(i=0,ilen=array.length;iangleToEnd&&startToAngle=Math.min(start,end)-epsilon&&value<=Math.max(start,end)+epsilon}__name(niceNum,"niceNum"),__name(_factorize,"_factorize"),__name(isNumber,"isNumber"),__name(almostEquals,"almostEquals"),__name(almostWhole,"almostWhole"),__name(_setMinAndMaxByKey,"_setMinAndMaxByKey"),__name(toRadians,"toRadians"),__name(toDegrees,"toDegrees"),__name(_decimalPlaces,"_decimalPlaces"),__name(getAngleFromPoint,"getAngleFromPoint"),__name(distanceBetweenPoints,"distanceBetweenPoints"),__name(_angleDiff,"_angleDiff"),__name(_normalizeAngle,"_normalizeAngle"),__name(_angleBetween,"_angleBetween"),__name(_limitValue,"_limitValue"),__name(_int16Range,"_int16Range"),__name(_isBetween,"_isBetween");const atEdge=__name(t=>0===t||1===t,"atEdge"),elasticIn=__name((t,s,p)=>-Math.pow(2,10*(t-=1))*Math.sin((t-s)*TAU/p),"elasticIn"),elasticOut=__name((t,s,p)=>Math.pow(2,-10*t)*Math.sin((t-s)*TAU/p)+1,"elasticOut"),effects={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*HALF_PI),easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>atEdge(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic:t=>atEdge(t)?t:t<.5?.5*elasticIn(2*t,.1125,.45):.5+.5*elasticOut(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let s=1.70158;return(t/=.5)<1?t*t*((1+(s*=1.525))*t-s)*.5:.5*((t-=2)*t*((1+(s*=1.525))*t+s)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,easeInOutBounce:t=>t<.5?.5*effects.easeInBounce(2*t):.5*effects.easeOutBounce(2*t-1)+.5};function round(v){return v+.5|0}__name(round,"round");const lim=__name((v,l,h)=>Math.max(Math.min(v,h),l),"lim");function p2b(v){return lim(round(2.55*v),0,255)}function n2b(v){return lim(round(255*v),0,255)}function b2n(v){return lim(round(v/2.55)/100,0,1)}function n2p(v){return lim(round(100*v),0,100)}__name(p2b,"p2b"),__name(n2b,"n2b"),__name(b2n,"b2n"),__name(n2p,"n2p");const map$1={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},hex=[..."0123456789ABCDEF"],h1=__name(b=>hex[15&b],"h1"),h2=__name(b=>hex[(240&b)>>4]+hex[15&b],"h2"),eq=__name(b=>(240&b)>>4==(15&b),"eq"),isShort=__name(v=>eq(v.r)&&eq(v.g)&&eq(v.b)&&eq(v.a),"isShort");function hexParse(str){var ret,len=str.length;return"#"===str[0]&&(4===len||5===len?ret={r:255&17*map$1[str[1]],g:255&17*map$1[str[2]],b:255&17*map$1[str[3]],a:5===len?17*map$1[str[4]]:255}:(7===len||9===len)&&(ret={r:map$1[str[1]]<<4|map$1[str[2]],g:map$1[str[3]]<<4|map$1[str[4]],b:map$1[str[5]]<<4|map$1[str[6]],a:9===len?map$1[str[7]]<<4|map$1[str[8]]:255})),ret}__name(hexParse,"hexParse");const alpha=__name((a,f)=>a<255?f(a):"","alpha");function hexString(v){var f=isShort(v)?h1:h2;return v?"#"+f(v.r)+f(v.g)+f(v.b)+alpha(v.a,f):void 0}__name(hexString,"hexString");const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(h,s,l){const a=s*Math.min(l,1-l),f=__name((n,k=(n+h/30)%12)=>l-a*Math.max(Math.min(k-3,9-k,1),-1),"f");return[f(0),f(8),f(4)]}function hsv2rgbn(h,s,v){const f=__name((n,k=(n+h/60)%6)=>v-v*s*Math.max(Math.min(k,4-k,1),0),"f");return[f(5),f(3),f(1)]}function hwb2rgbn(h,w,b){const rgb=hsl2rgbn(h,1,.5);let i;for(w+b>1&&(i=1/(w+b),w*=i,b*=i),i=0;i<3;i++)rgb[i]*=1-w-b,rgb[i]+=w;return rgb}function hueValue(r,g,b,d,max){return r===max?(g-b)/d+(g.5?d/(2-max-min):d/(max+min),h=hueValue(r,g,b,d,max),h=60*h+.5),[0|h,s||0,l]}function calln(f,a,b,c){return(Array.isArray(a)?f(a[0],a[1],a[2]):f(a,b,c)).map(n2b)}function hsl2rgb(h,s,l){return calln(hsl2rgbn,h,s,l)}function hwb2rgb(h,w,b){return calln(hwb2rgbn,h,w,b)}function hsv2rgb(h,s,v){return calln(hsv2rgbn,h,s,v)}function hue(h){return(h%360+360)%360}function hueParse(str){const m=HUE_RE.exec(str);let v,a=255;if(!m)return;m[5]!==v&&(a=m[6]?p2b(+m[5]):n2b(+m[5]));const h=hue(+m[2]),p1=+m[3]/100,p2=+m[4]/100;return v="hwb"===m[1]?hwb2rgb(h,p1,p2):"hsv"===m[1]?hsv2rgb(h,p1,p2):hsl2rgb(h,p1,p2),{r:v[0],g:v[1],b:v[2],a}}function rotate(v,deg){var h=rgb2hsl(v);h[0]=hue(h[0]+deg),h=hsl2rgb(h),v.r=h[0],v.g=h[1],v.b=h[2]}function hslString(v){if(!v)return;const a=rgb2hsl(v),h=a[0],s=n2p(a[1]),l=n2p(a[2]);return v.a<255?`hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`:`hsl(${h}, ${s}%, ${l}%)`}__name(hsl2rgbn,"hsl2rgbn"),__name(hsv2rgbn,"hsv2rgbn"),__name(hwb2rgbn,"hwb2rgbn"),__name(hueValue,"hueValue"),__name(rgb2hsl,"rgb2hsl"),__name(calln,"calln"),__name(hsl2rgb,"hsl2rgb"),__name(hwb2rgb,"hwb2rgb"),__name(hsv2rgb,"hsv2rgb"),__name(hue,"hue"),__name(hueParse,"hueParse"),__name(rotate,"rotate"),__name(hslString,"hslString");const map={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"},names$1={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 unpack(){const unpacked={},keys=Object.keys(names$1),tkeys=Object.keys(map);let i,j,k,ok,nk;for(i=0;i>16&255,k>>8&255,255&k]}return unpacked}let names;function nameParse(str){names||(names=unpack(),names.transparent=[0,0,0,0]);const a=names[str.toLowerCase()];return a&&{r:a[0],g:a[1],b:a[2],a:4===a.length?a[3]:255}}__name(unpack,"unpack"),__name(nameParse,"nameParse");const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(str){const m=RGB_RE.exec(str);let r,g,b,a=255;if(m){if(m[7]!==r){const v=+m[7];a=m[8]?p2b(v):lim(255*v,0,255)}return r=+m[1],g=+m[3],b=+m[5],r=255&(m[2]?p2b(r):lim(r,0,255)),g=255&(m[4]?p2b(g):lim(g,0,255)),b=255&(m[6]?p2b(b):lim(b,0,255)),{r,g,b,a}}}function rgbString(v){return v&&(v.a<255?`rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`:`rgb(${v.r}, ${v.g}, ${v.b})`)}__name(rgbParse,"rgbParse"),__name(rgbString,"rgbString");const to=__name(v=>v<=.0031308?12.92*v:1.055*Math.pow(v,1/2.4)-.055,"to"),from=__name(v=>v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4),"from");function interpolate(rgb1,rgb2,t){const r=from(b2n(rgb1.r)),g=from(b2n(rgb1.g)),b=from(b2n(rgb1.b));return{r:n2b(to(r+t*(from(b2n(rgb2.r))-r))),g:n2b(to(g+t*(from(b2n(rgb2.g))-g))),b:n2b(to(b+t*(from(b2n(rgb2.b))-b))),a:rgb1.a+t*(rgb2.a-rgb1.a)}}function modHSL(v,i,ratio){if(v){let tmp=rgb2hsl(v);tmp[i]=Math.max(0,Math.min(tmp[i]+tmp[i]*ratio,0===i?360:1)),tmp=hsl2rgb(tmp),v.r=tmp[0],v.g=tmp[1],v.b=tmp[2]}}function clone(v,proto){return v&&Object.assign(proto||{},v)}function fromObject(input){var v={r:0,g:0,b:0,a:255};return Array.isArray(input)?input.length>=3&&(v={r:input[0],g:input[1],b:input[2],a:255},input.length>3&&(v.a=n2b(input[3]))):(v=clone(input,{r:0,g:0,b:0,a:1})).a=n2b(v.a),v}function functionParse(str){return"r"===str.charAt(0)?rgbParse(str):hueParse(str)}__name(interpolate,"interpolate"),__name(modHSL,"modHSL"),__name(clone,"clone"),__name(fromObject,"fromObject"),__name(functionParse,"functionParse");class Color{constructor(input){if(input instanceof Color)return input;const type=typeof input;let v;"object"===type?v=fromObject(input):"string"===type&&(v=hexParse(input)||nameParse(input)||functionParse(input)),this._rgb=v,this._valid=!!v}get valid(){return this._valid}get rgb(){var v=clone(this._rgb);return v&&(v.a=b2n(v.a)),v}set rgb(obj){this._rgb=fromObject(obj)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(color2,weight){if(color2){const c1=this.rgb,c2=color2.rgb;let w2;const p=weight===w2?.5:weight,w=2*p-1,a=c1.a-c2.a,w1=((w*a==-1?w:(w+a)/(1+w*a))+1)/2;w2=1-w1,c1.r=255&w1*c1.r+w2*c2.r+.5,c1.g=255&w1*c1.g+w2*c2.g+.5,c1.b=255&w1*c1.b+w2*c2.b+.5,c1.a=p*c1.a+(1-p)*c2.a,this.rgb=c1}return this}interpolate(color2,t){return color2&&(this._rgb=interpolate(this._rgb,color2._rgb,t)),this}clone(){return new Color(this.rgb)}alpha(a){return this._rgb.a=n2b(a),this}clearer(ratio){return this._rgb.a*=1-ratio,this}greyscale(){const rgb=this._rgb,val=round(.3*rgb.r+.59*rgb.g+.11*rgb.b);return rgb.r=rgb.g=rgb.b=val,this}opaquer(ratio){return this._rgb.a*=1+ratio,this}negate(){const v=this._rgb;return v.r=255-v.r,v.g=255-v.g,v.b=255-v.b,this}lighten(ratio){return modHSL(this._rgb,2,ratio),this}darken(ratio){return modHSL(this._rgb,2,-ratio),this}saturate(ratio){return modHSL(this._rgb,1,ratio),this}desaturate(ratio){return modHSL(this._rgb,1,-ratio),this}rotate(deg){return rotate(this._rgb,deg),this}}function index_esm(input){return new Color(input)}function isPatternOrGradient(value){if(value&&"object"==typeof value){const type=value.toString();return"[object CanvasPattern]"===type||"[object CanvasGradient]"===type}return!1}function color(value){return isPatternOrGradient(value)?value:index_esm(value)}function getHoverColor(value){return isPatternOrGradient(value)?value:index_esm(value).saturate(.5).darken(.1).hexString()}__name(Color,"Color"),__name(index_esm,"index_esm"),__name(isPatternOrGradient,"isPatternOrGradient"),__name(color,"color"),__name(getHoverColor,"getHoverColor");const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(node,key){if(!key)return node;const keys=key.split(".");for(let i=0,n=keys.length;icontext.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=(ctx,options)=>getHoverColor(options.backgroundColor),this.hoverBorderColor=(ctx,options)=>getHoverColor(options.borderColor),this.hoverColor=(ctx,options)=>getHoverColor(options.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(_descriptors2)}set(scope,values){return set(this,scope,values)}get(scope){return getScope$1(this,scope)}describe(scope,values){return set(descriptors,scope,values)}override(scope,values){return set(overrides,scope,values)}route(scope,name,targetScope,targetName){const scopeObject=getScope$1(this,scope),targetScopeObject=getScope$1(this,targetScope),privateName="_"+name;Object.defineProperties(scopeObject,{[privateName]:{value:scopeObject[name],writable:!0},[name]:{enumerable:!0,get(){const local=this[privateName],target=targetScopeObject[targetName];return isObject(local)?Object.assign({},target,local):valueOrDefault(local,target)},set(value){this[privateName]=value}}})}}__name(Defaults,"Defaults");var defaults=new Defaults({_scriptable:name=>!name.startsWith("on"),_indexable:name=>"events"!==name,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function toFontString(font){return!font||isNullOrUndef(font.size)||isNullOrUndef(font.family)?null:(font.style?font.style+" ":"")+(font.weight?font.weight+" ":"")+font.size+"px "+font.family}function _measureText(ctx,data,gc,longest,string){let textWidth=data[string];return textWidth||(textWidth=data[string]=ctx.measureText(string).width,gc.push(string)),textWidth>longest&&(longest=textWidth),longest}function _longestText(ctx,font,arrayOfThings,cache){let data=(cache=cache||{}).data=cache.data||{},gc=cache.garbageCollect=cache.garbageCollect||[];cache.font!==font&&(data=cache.data={},gc=cache.garbageCollect=[],cache.font=font),ctx.save(),ctx.font=font;let longest=0;const ilen=arrayOfThings.length;let i,j,jlen,thing,nestedThing;for(i=0;iarrayOfThings.length){for(i=0;i0&&ctx.stroke()}}function _isPointInArea(point,area,margin){return margin=margin||.5,!area||point&&point.x>area.left-margin&&point.xarea.top-margin&&point.y0&&""!==opts.strokeColor;let i,line;for(ctx.save(),ctx.font=font.string,setRenderOpts(ctx,opts),i=0;i+v||0,"numberOrZero");function _readValueToProps(value,props){const ret={},objProps=isObject(props),keys=objProps?Object.keys(props):props,read=isObject(value)?objProps?prop=>valueOrDefault(value[prop],value[props[prop]]):prop=>value[prop]:()=>value;for(const prop of keys)ret[prop]=numberOrZero(read(prop));return ret}function toTRBL(value){return _readValueToProps(value,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(value){return _readValueToProps(value,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(value){const obj=toTRBL(value);return obj.width=obj.left+obj.right,obj.height=obj.top+obj.bottom,obj}function toFont(options,fallback){options=options||{},fallback=fallback||defaults.font;let size=valueOrDefault(options.size,fallback.size);"string"==typeof size&&(size=parseInt(size,10));let style=valueOrDefault(options.style,fallback.style);style&&!(""+style).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+style+'"'),style="");const font={family:valueOrDefault(options.family,fallback.family),lineHeight:toLineHeight(valueOrDefault(options.lineHeight,fallback.lineHeight),size),size,style,weight:valueOrDefault(options.weight,fallback.weight),string:""};return font.string=toFontString(font),font}function resolve(inputs,context,index2,info){let i,ilen,value,cacheable=!0;for(i=0,ilen=inputs.length;ibeginAtZero&&0===value?0:value+add,"keepZero");return{min:keepZero(min,-Math.abs(change)),max:keepZero(max,change)}}function createContext(parentContext,context){return Object.assign(Object.create(parentContext),context)}function _lookup(table,value,cmp){cmp=cmp||(index2=>table[index2]1;)mid=lo+hi>>1,cmp(mid)?lo=mid:hi=mid;return{lo,hi}}__name(_readValueToProps,"_readValueToProps"),__name(toTRBL,"toTRBL"),__name(toTRBLCorners,"toTRBLCorners"),__name(toPadding,"toPadding"),__name(toFont,"toFont"),__name(resolve,"resolve"),__name(_addGrace,"_addGrace"),__name(createContext,"createContext"),__name(_lookup,"_lookup");const _lookupByKey=__name((table,key,value)=>_lookup(table,value,index2=>table[index2][key]_lookup(table,value,index2=>table[index2][key]>=value),"_rlookupByKey");function _filterBetween(values,min,max){let start=0,end=values.length;for(;startstart&&values[end-1]>max;)end--;return start>0||end{const method="_onData"+_capitalize(key),base=array[key];Object.defineProperty(array,key,{configurable:!0,enumerable:!1,value(...args){const res=base.apply(this,args);return array._chartjs.listeners.forEach(object=>{"function"==typeof object[method]&&object[method](...args)}),res}})}))}function unlistenArrayEvents(array,listener){const stub=array._chartjs;if(!stub)return;const listeners=stub.listeners,index2=listeners.indexOf(listener);-1!==index2&&listeners.splice(index2,1),!(listeners.length>0)&&(arrayEvents.forEach(key=>{delete array[key]}),delete array._chartjs)}function _arrayUnique(items){const set2=new Set;let i,ilen;for(i=0,ilen=items.length;iscopes[0])){defined(fallback)||(fallback=_resolve("_fallback",scopes));const cache={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:scopes,_rootScopes:rootScopes,_fallback:fallback,_getTarget:getTarget,override:scope=>_createResolver([scope,...scopes],prefixes,rootScopes,fallback)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete target._keys,delete scopes[0][prop],!0),get:(target,prop)=>_cached(target,prop,()=>_resolveWithPrefixes(prop,prefixes,scopes,target)),getOwnPropertyDescriptor:(target,prop)=>Reflect.getOwnPropertyDescriptor(target._scopes[0],prop),getPrototypeOf:()=>Reflect.getPrototypeOf(scopes[0]),has:(target,prop)=>getKeysFromAllScopes(target).includes(prop),ownKeys:target=>getKeysFromAllScopes(target),set(target,prop,value){const storage=target._storage||(target._storage=getTarget());return target[prop]=storage[prop]=value,delete target._keys,!0}})}function _attachContext(proxy,context,subProxy,descriptorDefaults){const cache={_cacheable:!1,_proxy:proxy,_context:context,_subProxy:subProxy,_stack:new Set,_descriptors:_descriptors(proxy,descriptorDefaults),setContext:ctx=>_attachContext(proxy,ctx,subProxy,descriptorDefaults),override:scope=>_attachContext(proxy.override(scope),context,subProxy,descriptorDefaults)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete proxy[prop],!0),get:(target,prop,receiver)=>_cached(target,prop,()=>_resolveWithContext(target,prop,receiver)),getOwnPropertyDescriptor:(target,prop)=>target._descriptors.allKeys?Reflect.has(proxy,prop)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(proxy,prop),getPrototypeOf:()=>Reflect.getPrototypeOf(proxy),has:(target,prop)=>Reflect.has(proxy,prop),ownKeys:()=>Reflect.ownKeys(proxy),set:(target,prop,value)=>(proxy[prop]=value,delete target[prop],!0)})}function _descriptors(proxy,defaults2={scriptable:!0,indexable:!0}){const{_scriptable=defaults2.scriptable,_indexable=defaults2.indexable,_allKeys=defaults2.allKeys}=proxy;return{allKeys:_allKeys,scriptable:_scriptable,indexable:_indexable,isScriptable:isFunction(_scriptable)?_scriptable:()=>_scriptable,isIndexable:isFunction(_indexable)?_indexable:()=>_indexable}}__name(listenArrayEvents,"listenArrayEvents"),__name(unlistenArrayEvents,"unlistenArrayEvents"),__name(_arrayUnique,"_arrayUnique"),__name(_createResolver,"_createResolver"),__name(_attachContext,"_attachContext"),__name(_descriptors,"_descriptors");const readKey=__name((prefix,name)=>prefix?prefix+_capitalize(name):name,"readKey"),needsSubResolver=__name((prop,value)=>isObject(value)&&"adapters"!==prop&&(null===Object.getPrototypeOf(value)||value.constructor===Object),"needsSubResolver");function _cached(target,prop,resolve2){if(Object.prototype.hasOwnProperty.call(target,prop))return target[prop];const value=resolve2();return target[prop]=value,value}function _resolveWithContext(target,prop,receiver){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;let value=_proxy[prop];return isFunction(value)&&descriptors2.isScriptable(prop)&&(value=_resolveScriptable(prop,value,target,receiver)),isArray(value)&&value.length&&(value=_resolveArray(prop,value,target,descriptors2.isIndexable)),needsSubResolver(prop,value)&&(value=_attachContext(value,_context,_subProxy&&_subProxy[prop],descriptors2)),value}function _resolveScriptable(prop,value,target,receiver){const{_proxy,_context,_subProxy,_stack}=target;if(_stack.has(prop))throw new Error("Recursion detected: "+Array.from(_stack).join("->")+"->"+prop);return _stack.add(prop),value=value(_context,_subProxy||receiver),_stack.delete(prop),needsSubResolver(prop,value)&&(value=createSubResolver(_proxy._scopes,_proxy,prop,value)),value}function _resolveArray(prop,value,target,isIndexable){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;if(defined(_context.index)&&isIndexable(prop))value=value[_context.index%value.length];else if(isObject(value[0])){const arr=value,scopes=_proxy._scopes.filter(s=>s!==arr);value=[];for(const item of arr){const resolver=createSubResolver(scopes,_proxy,prop,item);value.push(_attachContext(resolver,_context,_subProxy&&_subProxy[prop],descriptors2))}}return value}function resolveFallback(fallback,prop,value){return isFunction(fallback)?fallback(prop,value):fallback}__name(_cached,"_cached"),__name(_resolveWithContext,"_resolveWithContext"),__name(_resolveScriptable,"_resolveScriptable"),__name(_resolveArray,"_resolveArray"),__name(resolveFallback,"resolveFallback");const getScope=__name((key,parent)=>!0===key?parent:"string"==typeof key?resolveObjectKey(parent,key):void 0,"getScope");function addScopes(set2,parentScopes,key,parentFallback,value){for(const parent of parentScopes){const scope=getScope(key,parent);if(scope){set2.add(scope);const fallback=resolveFallback(scope._fallback,key,value);if(defined(fallback)&&fallback!==key&&fallback!==parentFallback)return fallback}else if(!1===scope&&defined(parentFallback)&&key!==parentFallback)return null}return!1}function createSubResolver(parentScopes,resolver,prop,value){const rootScopes=resolver._rootScopes,fallback=resolveFallback(resolver._fallback,prop,value),allScopes=[...parentScopes,...rootScopes],set2=new Set;set2.add(value);let key=addScopesFromKey(set2,allScopes,prop,fallback||prop,value);return!(null===key||defined(fallback)&&fallback!==prop&&(key=addScopesFromKey(set2,allScopes,fallback,key,value),null===key))&&_createResolver(Array.from(set2),[""],rootScopes,fallback,()=>subGetTarget(resolver,prop,value))}function addScopesFromKey(set2,allScopes,key,fallback,item){for(;key;)key=addScopes(set2,allScopes,key,fallback,item);return key}function subGetTarget(resolver,prop,value){const parent=resolver._getTarget();prop in parent||(parent[prop]={});const target=parent[prop];return isArray(target)&&isObject(value)?value:target}function _resolveWithPrefixes(prop,prefixes,scopes,proxy){let value;for(const prefix of prefixes)if(value=_resolve(readKey(prefix,prop),scopes),defined(value))return needsSubResolver(prop,value)?createSubResolver(scopes,proxy,prop,value):value}function _resolve(key,scopes){for(const scope of scopes){if(!scope)continue;const value=scope[key];if(defined(value))return value}}function getKeysFromAllScopes(target){let keys=target._keys;return keys||(keys=target._keys=resolveKeysFromAllScopes(target._scopes)),keys}function resolveKeysFromAllScopes(scopes){const set2=new Set;for(const scope of scopes)for(const key of Object.keys(scope).filter(k=>!k.startsWith("_")))set2.add(key);return Array.from(set2)}function _parseObjectDataRadialScale(meta,data,start,count){const{iScale}=meta,{key="r"}=this._parsing,parsed=new Array(count);let i,ilen,index2,item;for(i=0,ilen=count;ii"x"===indexAxis?"y":"x","getValueAxis");function splineCurve(firstPoint,middlePoint,afterPoint,t){const previous=firstPoint.skip?middlePoint:firstPoint,current=middlePoint,next=afterPoint.skip?middlePoint:afterPoint,d01=distanceBetweenPoints(current,previous),d12=distanceBetweenPoints(next,current);let s01=d01/(d01+d12),s12=d12/(d01+d12);s01=isNaN(s01)?0:s01,s12=isNaN(s12)?0:s12;const fa=t*s01,fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}}}function monotoneAdjust(points,deltaK,mK){const pointsLen=points.length;let alphaK,betaK,tauK,squaredMagnitude,pointCurrent,pointAfter=getPoint(points,0);for(let i=0;i!pt.skip)),"monotone"===options.cubicInterpolationMode)splineCurveMonotone(points,indexAxis);else{let prev=loop?points[points.length-1]:points[0];for(i=0,ilen=points.length;iwindow.getComputedStyle(element,null),"getComputedStyle");function getStyle(el,property){return getComputedStyle(el).getPropertyValue(property)}__name(getStyle,"getStyle");const positions=["top","right","bottom","left"];function getPositionedStyle(styles,style,suffix){const result={};suffix=suffix?"-"+suffix:"";for(let i=0;i<4;i++){const pos=positions[i];result[pos]=parseFloat(styles[style+"-"+pos+suffix])||0}return result.width=result.left+result.right,result.height=result.top+result.bottom,result}__name(getPositionedStyle,"getPositionedStyle");const useOffsetPos=__name((x,y,target)=>(x>0||y>0)&&(!target||!target.shadowRoot),"useOffsetPos");function getCanvasPosition(e,canvas){const touches=e.touches,source=touches&&touches.length?touches[0]:e,{offsetX,offsetY}=source;let x,y,box=!1;if(useOffsetPos(offsetX,offsetY,e.target))x=offsetX,y=offsetY;else{const rect=canvas.getBoundingClientRect();x=source.clientX-rect.left,y=source.clientY-rect.top,box=!0}return{x,y,box}}function getRelativePosition(evt,chart){if("native"in evt)return evt;const{canvas,currentDevicePixelRatio}=chart,style=getComputedStyle(canvas),borderBox="border-box"===style.boxSizing,paddings=getPositionedStyle(style,"padding"),borders=getPositionedStyle(style,"border","width"),{x,y,box}=getCanvasPosition(evt,canvas),xOffset=paddings.left+(box&&borders.left),yOffset=paddings.top+(box&&borders.top);let{width,height}=chart;return borderBox&&(width-=paddings.width+borders.width,height-=paddings.height+borders.height),{x:Math.round((x-xOffset)/width*canvas.width/currentDevicePixelRatio),y:Math.round((y-yOffset)/height*canvas.height/currentDevicePixelRatio)}}function getContainerSize(canvas,width,height){let maxWidth,maxHeight;if(void 0===width||void 0===height){const container=_getParentNode(canvas);if(container){const rect=container.getBoundingClientRect(),containerStyle=getComputedStyle(container),containerBorder=getPositionedStyle(containerStyle,"border","width"),containerPadding=getPositionedStyle(containerStyle,"padding");width=rect.width-containerPadding.width-containerBorder.width,height=rect.height-containerPadding.height-containerBorder.height,maxWidth=parseMaxStyle(containerStyle.maxWidth,container,"clientWidth"),maxHeight=parseMaxStyle(containerStyle.maxHeight,container,"clientHeight")}else width=canvas.clientWidth,height=canvas.clientHeight}return{width,height,maxWidth:maxWidth||INFINITY,maxHeight:maxHeight||INFINITY}}__name(getCanvasPosition,"getCanvasPosition"),__name(getRelativePosition,"getRelativePosition"),__name(getContainerSize,"getContainerSize");const round1=__name(v=>Math.round(10*v)/10,"round1");function getMaximumSize(canvas,bbWidth,bbHeight,aspectRatio){const style=getComputedStyle(canvas),margins=getPositionedStyle(style,"margin"),maxWidth=parseMaxStyle(style.maxWidth,canvas,"clientWidth")||INFINITY,maxHeight=parseMaxStyle(style.maxHeight,canvas,"clientHeight")||INFINITY,containerSize=getContainerSize(canvas,bbWidth,bbHeight);let{width,height}=containerSize;if("content-box"===style.boxSizing){const borders=getPositionedStyle(style,"border","width"),paddings=getPositionedStyle(style,"padding");width-=paddings.width+borders.width,height-=paddings.height+borders.height}return width=Math.max(0,width-margins.width),height=Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height-margins.height),width=round1(Math.min(width,maxWidth,containerSize.maxWidth)),height=round1(Math.min(height,maxHeight,containerSize.maxHeight)),width&&!height&&(height=round1(width/2)),{width,height}}function retinaScale(chart,forceRatio,forceStyle){const pixelRatio=forceRatio||1,deviceHeight=Math.floor(chart.height*pixelRatio),deviceWidth=Math.floor(chart.width*pixelRatio);chart.height=deviceHeight/pixelRatio,chart.width=deviceWidth/pixelRatio;const canvas=chart.canvas;return canvas.style&&(forceStyle||!canvas.style.height&&!canvas.style.width)&&(canvas.style.height=`${chart.height}px`,canvas.style.width=`${chart.width}px`),(chart.currentDevicePixelRatio!==pixelRatio||canvas.height!==deviceHeight||canvas.width!==deviceWidth)&&(chart.currentDevicePixelRatio=pixelRatio,canvas.height=deviceHeight,canvas.width=deviceWidth,chart.ctx.setTransform(pixelRatio,0,0,pixelRatio,0,0),!0)}__name(getMaximumSize,"getMaximumSize"),__name(retinaScale,"retinaScale");const supportsEventListenerOptions=function(){let passiveSupported=!1;try{const options={get passive(){return passiveSupported=!0,!1}};window.addEventListener("test",null,options),window.removeEventListener("test",null,options)}catch{}return passiveSupported}();function readUsedSize(element,property){const value=getStyle(element,property),matches=value&&value.match(/^(\d+)(\.\d+)?px$/);return matches?+matches[1]:void 0}function _pointInLine(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:p1.y+t*(p2.y-p1.y)}}function _steppedInterpolation(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:"middle"===mode?t<.5?p1.y:p2.y:"after"===mode?t<1?p1.y:p2.y:t>0?p2.y:p1.y}}function _bezierInterpolation(p1,p2,t,mode){const cp1={x:p1.cp2x,y:p1.cp2y},cp2={x:p2.cp1x,y:p2.cp1y},a=_pointInLine(p1,cp1,t),b=_pointInLine(cp1,cp2,t),c=_pointInLine(cp2,p2,t),d=_pointInLine(a,b,t),e=_pointInLine(b,c,t);return _pointInLine(d,e,t)}__name(readUsedSize,"readUsedSize"),__name(_pointInLine,"_pointInLine"),__name(_steppedInterpolation,"_steppedInterpolation"),__name(_bezierInterpolation,"_bezierInterpolation");const intlCache=new Map;function getNumberFormat(locale,options){options=options||{};const cacheKey=locale+JSON.stringify(options);let formatter=intlCache.get(cacheKey);return formatter||(formatter=new Intl.NumberFormat(locale,options),intlCache.set(cacheKey,formatter)),formatter}function formatNumber(num,locale,options){return getNumberFormat(locale,options).format(num)}__name(getNumberFormat,"getNumberFormat"),__name(formatNumber,"formatNumber");const getRightToLeftAdapter=__name(function(rectX,width){return{x:x=>rectX+rectX+width-x,setWidth(w){width=w},textAlign:align=>"center"===align?align:"right"===align?"left":"right",xPlus:(x,value)=>x-value,leftForLtr:(x,itemWidth)=>x-itemWidth}},"getRightToLeftAdapter"),getLeftToRightAdapter=__name(function(){return{x:x=>x,setWidth(w){},textAlign:align=>align,xPlus:(x,value)=>x+value,leftForLtr:(x,_itemWidth)=>x}},"getLeftToRightAdapter");function getRtlAdapter(rtl,rectX,width){return rtl?getRightToLeftAdapter(rectX,width):getLeftToRightAdapter()}function overrideTextDirection(ctx,direction){let style,original;("ltr"===direction||"rtl"===direction)&&(style=ctx.canvas.style,original=[style.getPropertyValue("direction"),style.getPropertyPriority("direction")],style.setProperty("direction",direction,"important"),ctx.prevTextDirection=original)}function restoreTextDirection(ctx,original){void 0!==original&&(delete ctx.prevTextDirection,ctx.canvas.style.setProperty("direction",original[0],original[1]))}function propertyFn(property){return"angle"===property?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(a,b)=>a-b,normalize:x=>x}}function normalizeSegment({start,end,count,loop,style}){return{start:start%count,end:end%count,loop:loop&&(end-start+1)%count==0,style}}function getSegment(segment,points,bounds){const{property,start:startBound,end:endBound}=bounds,{between,normalize}=propertyFn(property),count=points.length;let i,ilen,{start,end,loop}=segment;if(loop){for(start+=count,end+=count,i=0,ilen=count;ibetween(startBound,prevValue,value)&&0!==compare(startBound,prevValue),"startIsBefore"),endIsBefore=__name(()=>0===compare(endBound,value)||between(endBound,prevValue,value),"endIsBefore"),shouldStart=__name(()=>inside||startIsBefore(),"shouldStart"),shouldStop=__name(()=>!inside||endIsBefore(),"shouldStop");for(let i=start,prev=start;i<=end;++i)point=points[i%count],!point.skip&&(value=normalize(point[property]),value!==prevValue&&(inside=between(value,startBound,endBound),null===subStart&&shouldStart()&&(subStart=0===compare(value,startBound)?i:prev),null!==subStart&&shouldStop()&&(result.push(normalizeSegment({start:subStart,end:i,loop,count,style})),subStart=null),prev=i,prevValue=value));return null!==subStart&&result.push(normalizeSegment({start:subStart,end,loop,count,style})),result}function _boundSegments(line,bounds){const result=[],segments=line.segments;for(let i=0;istart&&points[end%count].skip;)end--;return end%=count,{start,end}}function solidSegments(points,start,max,loop){const count=points.length,result=[];let end,last=start,prev=points[start];for(end=start+1;end<=max;++end){const cur=points[end%count];cur.skip||cur.stop?prev.skip||(loop=!1,result.push({start:start%count,end:(end-1)%count,loop}),start=last=cur.stop?end:null):(last=end,prev.skip&&(start=end)),prev=cur}return null!==last&&result.push({start:start%count,end:last%count,loop}),result}function _computeSegments(line,segmentOptions){const points=line.points,spanGaps=line.options.spanGaps,count=points.length;if(!count)return[];const loop=!!line._loop,{start,end}=findStartAndEnd(points,count,loop,spanGaps);if(!0===spanGaps)return splitByStyles(line,[{start,end,loop}],points,segmentOptions);return splitByStyles(line,solidSegments(points,start,endfn({chart,initial:anims.initial,numSteps,currentStep:Math.min(date-anims.start,numSteps)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(date=Date.now()){let remaining=0;this._charts.forEach((anims,chart)=>{if(!anims.running||!anims.items.length)return;const items=anims.items;let item,i=items.length-1,draw2=!1;for(;i>=0;--i)item=items[i],item._active?(item._total>anims.duration&&(anims.duration=item._total),item.tick(date),draw2=!0):(items[i]=items[items.length-1],items.pop());draw2&&(chart.draw(),this._notify(chart,anims,date,"progress")),items.length||(anims.running=!1,this._notify(chart,anims,date,"complete"),anims.initial=!1),remaining+=items.length}),this._lastDate=date,0===remaining&&(this._running=!1)}_getAnims(chart){const charts=this._charts;let anims=charts.get(chart);return anims||(anims={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},charts.set(chart,anims)),anims}listen(chart,event,cb){this._getAnims(chart).listeners[event].push(cb)}add(chart,items){!items||!items.length||this._getAnims(chart).items.push(...items)}has(chart){return this._getAnims(chart).items.length>0}start(chart){const anims=this._charts.get(chart);!anims||(anims.running=!0,anims.start=Date.now(),anims.duration=anims.items.reduce((acc,cur)=>Math.max(acc,cur._duration),0),this._refresh())}running(chart){if(!this._running)return!1;const anims=this._charts.get(chart);return!(!anims||!anims.running||!anims.items.length)}stop(chart){const anims=this._charts.get(chart);if(!anims||!anims.items.length)return;const items=anims.items;let i=items.length-1;for(;i>=0;--i)items[i].cancel();anims.items=[],this._notify(chart,anims,Date.now(),"complete")}remove(chart){return this._charts.delete(chart)}}__name(Animator,"Animator");var animator=new Animator;const interpolators={boolean:(from2,to2,factor)=>factor>.5?to2:from2,color(from2,to2,factor){const c0=color(from2||"transparent"),c1=c0.valid&&color(to2||"transparent");return c1&&c1.valid?c1.mix(c0,factor).hexString():to2},number:(from2,to2,factor)=>from2+(to2-from2)*factor};class Animation{constructor(cfg,target,prop,to2){const currentValue=target[prop];to2=resolve([cfg.to,to2,currentValue,cfg.from]);const from2=resolve([cfg.from,currentValue,to2]);this._active=!0,this._fn=cfg.fn||interpolators[cfg.type||typeof from2],this._easing=effects[cfg.easing]||effects.linear,this._start=Math.floor(Date.now()+(cfg.delay||0)),this._duration=this._total=Math.floor(cfg.duration),this._loop=!!cfg.loop,this._target=target,this._prop=prop,this._from=from2,this._to=to2,this._promises=void 0}active(){return this._active}update(cfg,to2,date){if(this._active){this._notify(!1);const currentValue=this._target[this._prop],elapsed=date-this._start,remain=this._duration-elapsed;this._start=date,this._duration=Math.floor(Math.max(remain,cfg.duration)),this._total+=elapsed,this._loop=!!cfg.loop,this._to=resolve([cfg.to,to2,currentValue,cfg.from]),this._from=resolve([cfg.from,currentValue,to2])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(date){const elapsed=date-this._start,duration=this._duration,prop=this._prop,from2=this._from,loop=this._loop,to2=this._to;let factor;if(this._active=from2!==to2&&(loop||elapsed1?2-factor:factor,factor=this._easing(Math.min(1,Math.max(0,factor))),this._target[prop]=this._fn(from2,to2,factor))}wait(){const promises=this._promises||(this._promises=[]);return new Promise((res,rej)=>{promises.push({res,rej})})}_notify(resolved){const method=resolved?"res":"rej",promises=this._promises||[];for(let i=0;i"onProgress"!==name&&"onComplete"!==name&&"fn"!==name}),defaults.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),defaults.describe("animations",{_fallback:"animation"}),defaults.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:v=>0|v}}}});class Animations{constructor(chart,config){this._chart=chart,this._properties=new Map,this.configure(config)}configure(config){if(!isObject(config))return;const animatedProps=this._properties;Object.getOwnPropertyNames(config).forEach(key=>{const cfg=config[key];if(!isObject(cfg))return;const resolved={};for(const option of animationOptions)resolved[option]=cfg[option];(isArray(cfg.properties)&&cfg.properties||[key]).forEach(prop=>{(prop===key||!animatedProps.has(prop))&&animatedProps.set(prop,resolved)})})}_animateOptions(target,values){const newOptions=values.options,options=resolveTargetOptions(target,newOptions);if(!options)return[];const animations=this._createAnimations(options,newOptions);return newOptions.$shared&&awaitAll(target.options.$animations,newOptions).then(()=>{target.options=newOptions},()=>{}),animations}_createAnimations(target,values){const animatedProps=this._properties,animations=[],running=target.$animations||(target.$animations={}),props=Object.keys(values),date=Date.now();let i;for(i=props.length-1;i>=0;--i){const prop=props[i];if("$"===prop.charAt(0))continue;if("options"===prop){animations.push(...this._animateOptions(target,values));continue}const value=values[prop];let animation=running[prop];const cfg=animatedProps.get(prop);if(animation){if(cfg&&animation.active()){animation.update(cfg,value,date);continue}animation.cancel()}cfg&&cfg.duration?(running[prop]=animation=new Animation(cfg,target,prop,value),animations.push(animation)):target[prop]=value}return animations}update(target,values){if(0===this._properties.size)return void Object.assign(target,values);const animations=this._createAnimations(target,values);return animations.length?(animator.add(this._chart,animations),!0):void 0}}function awaitAll(animations,properties){const running=[],keys=Object.keys(properties);for(let i=0;i0||!positive&&value<0)return meta.index}return null}function updateStacks(controller,parsed){const{chart,_cachedMeta:meta}=controller,stacks=chart._stacks||(chart._stacks={}),{iScale,vScale,index:datasetIndex}=meta,iAxis=iScale.axis,vAxis=vScale.axis,key=getStackKey(iScale,vScale,meta),ilen=parsed.length;let stack;for(let i=0;iscales2[key].axis===axis).shift()}function createDatasetContext(parent,index2){return createContext(parent,{active:!1,dataset:void 0,datasetIndex:index2,index:index2,mode:"default",type:"dataset"})}function createDataContext(parent,index2,element){return createContext(parent,{active:!1,dataIndex:index2,parsed:void 0,raw:void 0,element,index:index2,mode:"default",type:"data"})}function clearStacks(meta,items){const datasetIndex=meta.controller.index,axis=meta.vScale&&meta.vScale.axis;if(axis){items=items||meta._parsed;for(const parsed of items){const stacks=parsed._stacks;if(!stacks||void 0===stacks[axis]||void 0===stacks[axis][datasetIndex])return;delete stacks[axis][datasetIndex]}}}__name(Animations,"Animations"),__name(awaitAll,"awaitAll"),__name(resolveTargetOptions,"resolveTargetOptions"),__name(scaleClip,"scaleClip"),__name(defaultClip,"defaultClip"),__name(toClip,"toClip"),__name(getSortedDatasetIndices,"getSortedDatasetIndices"),__name(applyStack,"applyStack"),__name(convertObjectDataToArray,"convertObjectDataToArray"),__name(isStacked,"isStacked"),__name(getStackKey,"getStackKey"),__name(getUserBounds,"getUserBounds"),__name(getOrCreateStack,"getOrCreateStack"),__name(getLastIndexInStack,"getLastIndexInStack"),__name(updateStacks,"updateStacks"),__name(getFirstScaleId,"getFirstScaleId"),__name(createDatasetContext,"createDatasetContext"),__name(createDataContext,"createDataContext"),__name(clearStacks,"clearStacks");const isDirectUpdateMode=__name(mode=>"reset"===mode||"none"===mode,"isDirectUpdateMode"),cloneIfNotShared=__name((cached,shared)=>shared?cached:Object.assign({},cached),"cloneIfNotShared"),createStack=__name((canStack,meta,chart)=>canStack&&!meta.hidden&&meta._stacked&&{keys:getSortedDatasetIndices(chart,!0),values:null},"createStack");class DatasetController{constructor(chart,datasetIndex){this.chart=chart,this._ctx=chart.ctx,this.index=datasetIndex,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 meta=this._cachedMeta;this.configure(),this.linkScales(),meta._stacked=isStacked(meta.vScale,meta),this.addElements()}updateIndex(datasetIndex){this.index!==datasetIndex&&clearStacks(this._cachedMeta),this.index=datasetIndex}linkScales(){const chart=this.chart,meta=this._cachedMeta,dataset=this.getDataset(),chooseId=__name((axis,x,y,r)=>"x"===axis?x:"r"===axis?r:y,"chooseId"),xid=meta.xAxisID=valueOrDefault(dataset.xAxisID,getFirstScaleId(chart,"x")),yid=meta.yAxisID=valueOrDefault(dataset.yAxisID,getFirstScaleId(chart,"y")),rid=meta.rAxisID=valueOrDefault(dataset.rAxisID,getFirstScaleId(chart,"r")),indexAxis=meta.indexAxis,iid=meta.iAxisID=chooseId(indexAxis,xid,yid,rid),vid=meta.vAxisID=chooseId(indexAxis,yid,xid,rid);meta.xScale=this.getScaleForId(xid),meta.yScale=this.getScaleForId(yid),meta.rScale=this.getScaleForId(rid),meta.iScale=this.getScaleForId(iid),meta.vScale=this.getScaleForId(vid)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(scaleID){return this.chart.scales[scaleID]}_getOtherScale(scale){const meta=this._cachedMeta;return scale===meta.iScale?meta.vScale:meta.iScale}reset(){this._update("reset")}_destroy(){const meta=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),meta._stacked&&clearStacks(meta)}_dataCheck(){const dataset=this.getDataset(),data=dataset.data||(dataset.data=[]),_data=this._data;if(isObject(data))this._data=convertObjectDataToArray(data);else if(_data!==data){if(_data){unlistenArrayEvents(_data,this);const meta=this._cachedMeta;clearStacks(meta),meta._parsed=[]}data&&Object.isExtensible(data)&&listenArrayEvents(data,this),this._syncList=[],this._data=data}}addElements(){const meta=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(meta.dataset=new this.datasetElementType)}buildOrUpdateElements(resetNewElements){const meta=this._cachedMeta,dataset=this.getDataset();let stackChanged=!1;this._dataCheck();const oldStacked=meta._stacked;meta._stacked=isStacked(meta.vScale,meta),meta.stack!==dataset.stack&&(stackChanged=!0,clearStacks(meta),meta.stack=dataset.stack),this._resyncElements(resetNewElements),(stackChanged||oldStacked!==meta._stacked)&&updateStacks(this,meta._parsed)}configure(){const config=this.chart.config,scopeKeys=config.datasetScopeKeys(this._type),scopes=config.getOptionScopes(this.getDataset(),scopeKeys,!0);this.options=config.createResolver(scopes,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(start,count){const{_cachedMeta:meta,_data:data}=this,{iScale,_stacked}=meta,iAxis=iScale.axis;let i,cur,parsed,sorted=0===start&&count===data.length||meta._sorted,prev=start>0&&meta._parsed[start-1];if(!1===this._parsing)meta._parsed=data,meta._sorted=!0,parsed=data;else{parsed=isArray(data[start])?this.parseArrayData(meta,data,start,count):isObject(data[start])?this.parseObjectData(meta,data,start,count):this.parsePrimitiveData(meta,data,start,count);const isNotInOrderComparedToPrev=__name(()=>null===cur[iAxis]||prev&&cur[iAxis]otherValue||otherMax=0;--i)if(!_skip()){this.updateRangeFromParsed(range,scale,parsed,stack);break}return range}getAllParsedValues(scale){const parsed=this._cachedMeta._parsed,values=[];let i,ilen,value;for(i=0,ilen=parsed.length;i=0&&index2this.getContext(index2,active),"context"),values=config.resolveNamedOptions(scopes,names2,context,prefixes);return values.$shared&&(values.$shared=sharing,cache[cacheKey]=Object.freeze(cloneIfNotShared(values,sharing))),values}_resolveAnimations(index2,transition,active){const chart=this.chart,cache=this._cachedDataOpts,cacheKey=`animation-${transition}`,cached=cache[cacheKey];if(cached)return cached;let options;if(!1!==chart.options.animation){const config=this.chart.config,scopeKeys=config.datasetAnimationScopeKeys(this._type,transition),scopes=config.getOptionScopes(this.getDataset(),scopeKeys);options=config.createResolver(scopes,this.getContext(index2,active,transition))}const animations=new Animations(chart,options&&options.animations);return options&&options._cacheable&&(cache[cacheKey]=Object.freeze(animations)),animations}getSharedOptions(options){if(options.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},options))}includeOptions(mode,sharedOptions){return!sharedOptions||isDirectUpdateMode(mode)||this.chart._animationsDisabled}updateElement(element,index2,properties,mode){isDirectUpdateMode(mode)?Object.assign(element,properties):this._resolveAnimations(index2,mode).update(element,properties)}updateSharedOptions(sharedOptions,mode,newOptions){sharedOptions&&!isDirectUpdateMode(mode)&&this._resolveAnimations(void 0,mode).update(sharedOptions,newOptions)}_setStyle(element,index2,mode,active){element.active=active;const options=this.getStyle(index2,active);this._resolveAnimations(index2,mode,active).update(element,{options:!active&&this.getSharedOptions(options)||options})}removeHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!1)}setHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!0)}_removeDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!1)}_setDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!0)}_resyncElements(resetNewElements){const data=this._data,elements=this._cachedMeta.data;for(const[method,arg1,arg2]of this._syncList)this[method](arg1,arg2);this._syncList=[];const numMeta=elements.length,numData=data.length,count=Math.min(numData,numMeta);count&&this.parse(0,count),numData>numMeta?this._insertElements(numMeta,numData-numMeta,resetNewElements):numData{for(arr.length+=count,i=arr.length-1;i>=end;i--)arr[i]=arr[i-count]},"move");for(move(data),i=start;ia-b))}return scale._cache.$bar}function computeMinSampleSize(meta){const scale=meta.iScale,values=getAllScaleValues(scale,meta.type);let i,ilen,curr,prev,min=scale._length;const updateMinAndPrev=__name(()=>{32767===curr||-32768===curr||(defined(prev)&&(min=Math.min(min,Math.abs(curr-prev)||min)),prev=curr)},"updateMinAndPrev");for(i=0,ilen=values.length;i0?pixels[index2-1]:null,next=index2Math.abs(max)&&(barStart=max,barEnd=min),item[vScale.axis]=barEnd,item._custom={barStart,barEnd,start:startValue,end:endValue,min,max}}function parseValue(entry,item,vScale,i){return isArray(entry)?parseFloatBar(entry,item,vScale,i):item[vScale.axis]=vScale.parse(entry,i),item}function parseArrayOrPrimitive(meta,data,start,count){const iScale=meta.iScale,vScale=meta.vScale,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=[];let i,ilen,item,entry;for(i=start,ilen=start+count;i=actualBase?1:-1)}function borderProps(properties){let reverse,start,end,top,bottom;return properties.horizontal?(reverse=properties.base>properties.x,start="left",end="right"):(reverse=properties.base=0;--i)max=Math.max(max,data[i].size(this.resolveDataElementOptions(i))/2);return max>0&&max}getLabelAndValue(index2){const meta=this._cachedMeta,{xScale,yScale}=meta,parsed=this.getParsed(index2),x=xScale.getLabelForValue(parsed.x),y=yScale.getLabelForValue(parsed.y),r=parsed._custom;return{label:meta.label,value:"("+x+", "+y+(r?", "+r:"")+")"}}update(mode){const points=this._cachedMeta.data;this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis;for(let i=start;i_angleBetween(angle,startAngle,endAngle,!0)?1:Math.max(a,a*cutout,b,b*cutout),"calcMax"),calcMin=__name((angle,a,b)=>_angleBetween(angle,startAngle,endAngle,!0)?-1:Math.min(a,a*cutout,b,b*cutout),"calcMin"),maxX=calcMax(0,startX,endX),maxY=calcMax(HALF_PI,startY,endY),minX=calcMin(PI,startX,endX),minY=calcMin(PI+HALF_PI,startY,endY);ratioX=(maxX-minX)/2,ratioY=(maxY-minY)/2,offsetX=-(maxX+minX)/2,offsetY=-(maxY+minY)/2}return{ratioX,ratioY,offsetX,offsetY}}__name(BubbleController,"BubbleController"),BubbleController.id="bubble",BubbleController.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},BubbleController.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}},__name(getRatioAndOffset,"getRatioAndOffset");class DoughnutController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(start,count){const data=this.getDataset().data,meta=this._cachedMeta;if(!1===this._parsing)meta._parsed=data;else{let i,ilen,getter=__name(i2=>+data[i2],"getter");if(isObject(data[start])){const{key="value"}=this._parsing;getter=__name(i2=>+resolveObjectKey(data[i2],key),"getter")}for(i=start,ilen=start+count;i0&&!isNaN(value)?TAU*(Math.abs(value)/total):0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2],chart.options.locale);return{label:labels[index2]||"",value}}getMaxBorderWidth(arcs){let max=0;const chart=this.chart;let i,ilen,meta,controller,options;if(!arcs)for(i=0,ilen=chart.data.datasets.length;i"spacing"!==name,_indexable:name=>"spacing"!==name},DoughnutController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label(tooltipItem){let dataLabel=tooltipItem.label;const value=": "+tooltipItem.formattedValue;return isArray(dataLabel)?(dataLabel=dataLabel.slice(),dataLabel[0]+=value):dataLabel+=value,dataLabel}}}}};class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(mode){const meta=this._cachedMeta,{dataset:line,data:points=[],_dataset}=meta,animationsDisabled=this.chart._animationsDisabled;let{start,count}=getStartAndCountOfVisiblePoints(meta,points,animationsDisabled);this._drawStart=start,this._drawCount=count,scaleRangesChanged(meta)&&(start=0,count=points.length),line._chart=this.chart,line._datasetIndex=this.index,line._decimated=!!_dataset._decimated,line.points=points;const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0),options.segment=this.options.segment,this.updateElement(line,void 0,{animated:!animationsDisabled,options},mode),this.updateElements(points,start,count,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale,_stacked,_dataset}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis,{spanGaps,segment}=this.options,maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY,directUpdate=this.chart._animationsDisabled||reset||"none"===mode;let prevParsed=start>0&&this.getParsed(start-1);for(let i=start;i0&&Math.abs(parsed[iAxis]-prevParsed[iAxis])>maxGapLength,segment&&(properties.parsed=parsed,properties.raw=_dataset.data[i]),includeOptions&&(properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?"active":mode)),directUpdate||this.updateElement(point,i,properties,mode),prevParsed=parsed}this.updateSharedOptions(sharedOptions,mode,firstOpts)}getMaxOverflow(){const meta=this._cachedMeta,dataset=meta.dataset,border=dataset.options&&dataset.options.borderWidth||0,data=meta.data||[];if(!data.length)return border;const firstPoint=data[0].size(this.resolveDataElementOptions(0)),lastPoint=data[data.length-1].size(this.resolveDataElementOptions(data.length-1));return Math.max(border,firstPoint,lastPoint)/2}draw(){const meta=this._cachedMeta;meta.dataset.updateControlPoints(this.chart.chartArea,meta.iScale.axis),super.draw()}}function getStartAndCountOfVisiblePoints(meta,points,animationsDisabled){const pointCount=points.length;let start=0,count=pointCount;if(meta._sorted){const{iScale,_parsed}=meta,axis=iScale.axis,{min,max,minDefined,maxDefined}=iScale.getUserBounds();minDefined&&(start=_limitValue(Math.min(_lookupByKey(_parsed,iScale.axis,min).lo,animationsDisabled?pointCount:_lookupByKey(points,axis,iScale.getPixelForValue(min)).lo),0,pointCount-1)),count=maxDefined?_limitValue(Math.max(_lookupByKey(_parsed,iScale.axis,max).hi+1,animationsDisabled?0:_lookupByKey(points,axis,iScale.getPixelForValue(max)).hi+1),start,pointCount)-start:pointCount-start}return{start,count}}function scaleRangesChanged(meta){const{xScale,yScale,_scaleRanges}=meta,newRanges={xmin:xScale.min,xmax:xScale.max,ymin:yScale.min,ymax:yScale.max};if(!_scaleRanges)return meta._scaleRanges=newRanges,!0;const changed=_scaleRanges.xmin!==xScale.min||_scaleRanges.xmax!==xScale.max||_scaleRanges.ymin!==yScale.min||_scaleRanges.ymax!==yScale.max;return Object.assign(_scaleRanges,newRanges),changed}__name(LineController,"LineController"),LineController.id="line",LineController.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},LineController.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}},__name(getStartAndCountOfVisiblePoints,"getStartAndCountOfVisiblePoints"),__name(scaleRangesChanged,"scaleRangesChanged");class PolarAreaController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2].r,chart.options.locale);return{label:labels[index2]||"",value}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const arcs=this._cachedMeta.data;this._updateRadius(),this.updateElements(arcs,0,arcs.length,mode)}getMinMax(){const meta=this._cachedMeta,range={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return meta.data.forEach((element,index2)=>{const parsed=this.getParsed(index2).r;!isNaN(parsed)&&this.chart.getDataVisibility(index2)&&(parsedrange.max&&(range.max=parsed))}),range}_updateRadius(){const chart=this.chart,chartArea=chart.chartArea,opts=chart.options,minSize=Math.min(chartArea.right-chartArea.left,chartArea.bottom-chartArea.top),outerRadius=Math.max(minSize/2,0),radiusLength=(outerRadius-Math.max(opts.cutoutPercentage?outerRadius/100*opts.cutoutPercentage:1,0))/chart.getVisibleDatasetCount();this.outerRadius=outerRadius-radiusLength*this.index,this.innerRadius=this.outerRadius-radiusLength}updateElements(arcs,start,count,mode){const reset="reset"===mode,chart=this.chart,animationOpts=chart.options.animation,scale=this._cachedMeta.rScale,centerX=scale.xCenter,centerY=scale.yCenter,datasetStartAngle=scale.getIndexAngle(0)-.5*PI;let i,angle=datasetStartAngle;const defaultAngle=360/this.countVisibleElements();for(i=0;i{!isNaN(this.getParsed(index2).r)&&this.chart.getDataVisibility(index2)&&count++}),count}_computeAngle(index2,mode,defaultAngle){return this.chart.getDataVisibility(index2)?toRadians(this.resolveDataElementOptions(index2,mode).angle||defaultAngle):0}}__name(PolarAreaController,"PolarAreaController"),PolarAreaController.id="polarArea",PolarAreaController.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},PolarAreaController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label:context=>context.chart.data.labels[context.dataIndex]+": "+context.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class PieController extends DoughnutController{}__name(PieController,"PieController"),PieController.id="pie",PieController.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class RadarController extends DatasetController{getLabelAndValue(index2){const vScale=this._cachedMeta.vScale,parsed=this.getParsed(index2);return{label:vScale.getLabels()[index2],value:""+vScale.getLabelForValue(parsed[vScale.axis])}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const meta=this._cachedMeta,line=meta.dataset,points=meta.data||[],labels=meta.iScale.getLabels();if(line.points=points,"resize"!==mode){const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0);const properties={_loop:!0,_fullLoop:labels.length===points.length,options};this.updateElement(line,void 0,properties,mode)}this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const scale=this._cachedMeta.rScale,reset="reset"===mode;for(let i=start;i"",label:item=>"("+item.label+", "+item.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function chart_esm_abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}__name(chart_esm_abstract,"chart_esm_abstract");class DateAdapter{constructor(options){this.options=options||{}}formats(){return chart_esm_abstract()}parse(value,format){return chart_esm_abstract()}format(timestamp,format){return chart_esm_abstract()}add(timestamp,amount,unit){return chart_esm_abstract()}diff(a,b,unit){return chart_esm_abstract()}startOf(timestamp,unit,weekday){return chart_esm_abstract()}endOf(timestamp,unit){return chart_esm_abstract()}}__name(DateAdapter,"DateAdapter"),DateAdapter.override=function(members){Object.assign(DateAdapter.prototype,members)};var adapters={_date:DateAdapter};function binarySearch(metaset,axis,value,intersect){const{controller,data,_sorted}=metaset,iScale=controller._cachedMeta.iScale;if(iScale&&axis===iScale.axis&&"r"!==axis&&_sorted&&data.length){const lookupMethod=iScale._reversePixels?_rlookupByKey:_lookupByKey;if(!intersect)return lookupMethod(data,axis,value);if(controller._sharedOptions){const el=data[0],range="function"==typeof el.getRange&&el.getRange(axis);if(range){const start=lookupMethod(data,axis,value-range),end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi}}}}return{lo:0,hi:data.length-1}}function evaluateInteractionItems(chart,axis,position,handler,intersect){const metasets=chart.getSortedVisibleDatasetMetas(),value=position[axis];for(let i=0,ilen=metasets.length;i{element[rangeMethod](position[axis],useFinalPosition)&&(items.push({element,datasetIndex,index:index2}),intersectsItem=intersectsItem||element.inRange(position.x,position.y,useFinalPosition))}),intersect&&!intersectsItem?[]:items}__name(binarySearch,"binarySearch"),__name(evaluateInteractionItems,"evaluateInteractionItems"),__name(getDistanceMetricForAxis,"getDistanceMetricForAxis"),__name(getIntersectItems,"getIntersectItems"),__name(getNearestRadialItems,"getNearestRadialItems"),__name(getNearestCartesianItems,"getNearestCartesianItems"),__name(getNearestItems,"getNearestItems"),__name(getAxisItems,"getAxisItems");var Interaction={evaluateInteractionItems,modes:{index(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"x",includeInvisible=options.includeInvisible||!1,items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible),elements=[];return items.length?(chart.getSortedVisibleDatasetMetas().forEach(meta=>{const index2=items[0].index,element=meta.data[index2];element&&!element.skip&&elements.push({element,datasetIndex:meta.index,index:index2})}),elements):[]},dataset(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;let items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible);if(items.length>0){const datasetIndex=items[0].datasetIndex,data=chart.getDatasetMeta(datasetIndex).data;items=[];for(let i=0;igetIntersectItems(chart,getRelativePosition(e,chart),options.axis||"xy",useFinalPosition,options.includeInvisible||!1),nearest(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;return getNearestItems(chart,position,axis,options.intersect,useFinalPosition,includeInvisible)},x:(chart,e,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e,chart),"x",options.intersect,useFinalPosition),y:(chart,e,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e,chart),"y",options.intersect,useFinalPosition)}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(array,position){return array.filter(v=>v.pos===position)}function filterDynamicPositionByAxis(array,axis){return array.filter(v=>-1===STATIC_POSITIONS.indexOf(v.pos)&&v.box.axis===axis)}function sortByWeight(array,reverse){return array.sort((a,b)=>{const v0=reverse?b:a,v1=reverse?a:b;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight})}function wrapBoxes(boxes){const layoutBoxes=[];let i,ilen,box,pos,stack,stackWeight;for(i=0,ilen=(boxes||[]).length;iwrap.box.fullSize),!0),left=sortByWeight(filterByPosition(layoutBoxes,"left"),!0),right=sortByWeight(filterByPosition(layoutBoxes,"right")),top=sortByWeight(filterByPosition(layoutBoxes,"top"),!0),bottom=sortByWeight(filterByPosition(layoutBoxes,"bottom")),centerHorizontal=filterDynamicPositionByAxis(layoutBoxes,"x"),centerVertical=filterDynamicPositionByAxis(layoutBoxes,"y");return{fullSize,leftAndTop:left.concat(top),rightAndBottom:right.concat(centerVertical).concat(bottom).concat(centerHorizontal),chartArea:filterByPosition(layoutBoxes,"chartArea"),vertical:left.concat(right).concat(centerVertical),horizontal:top.concat(bottom).concat(centerHorizontal)}}function getCombinedMax(maxPadding,chartArea,a,b){return Math.max(maxPadding[a],chartArea[a])+Math.max(maxPadding[b],chartArea[b])}function updateMaxPadding(maxPadding,boxPadding){maxPadding.top=Math.max(maxPadding.top,boxPadding.top),maxPadding.left=Math.max(maxPadding.left,boxPadding.left),maxPadding.bottom=Math.max(maxPadding.bottom,boxPadding.bottom),maxPadding.right=Math.max(maxPadding.right,boxPadding.right)}function updateDims(chartArea,params,layout,stacks){const{pos,box}=layout,maxPadding=chartArea.maxPadding;if(!isObject(pos)){layout.size&&(chartArea[pos]-=layout.size);const stack=stacks[layout.stack]||{size:0,count:1};stack.size=Math.max(stack.size,layout.horizontal?box.height:box.width),layout.size=stack.size/stack.count,chartArea[pos]+=layout.size}box.getPadding&&updateMaxPadding(maxPadding,box.getPadding());const newWidth=Math.max(0,params.outerWidth-getCombinedMax(maxPadding,chartArea,"left","right")),newHeight=Math.max(0,params.outerHeight-getCombinedMax(maxPadding,chartArea,"top","bottom")),widthChanged=newWidth!==chartArea.w,heightChanged=newHeight!==chartArea.h;return chartArea.w=newWidth,chartArea.h=newHeight,layout.horizontal?{same:widthChanged,other:heightChanged}:{same:heightChanged,other:widthChanged}}function handleMaxPadding(chartArea){const maxPadding=chartArea.maxPadding;function updatePos(pos){const change=Math.max(maxPadding[pos]-chartArea[pos],0);return chartArea[pos]+=change,change}__name(updatePos,"updatePos"),chartArea.y+=updatePos("top"),chartArea.x+=updatePos("left"),updatePos("right"),updatePos("bottom")}function getMargins(horizontal,chartArea){const maxPadding=chartArea.maxPadding;function marginForPositions(positions2){const margin={left:0,top:0,right:0,bottom:0};return positions2.forEach(pos=>{margin[pos]=Math.max(chartArea[pos],maxPadding[pos])}),margin}return __name(marginForPositions,"marginForPositions"),marginForPositions(horizontal?["left","right"]:["top","bottom"])}function fitBoxes(boxes,chartArea,params,stacks){const refitBoxes=[];let i,ilen,layout,box,refit,changed;for(i=0,ilen=boxes.length,refit=0;i{"function"==typeof box.beforeLayout&&box.beforeLayout()});const visibleVerticalBoxCount=verticalBoxes.reduce((total,wrap)=>wrap.box.options&&!1===wrap.box.options.display?total:total+1,0)||1,params=Object.freeze({outerWidth:width,outerHeight:height,padding,availableWidth,availableHeight,vBoxMaxWidth:availableWidth/2/visibleVerticalBoxCount,hBoxMaxHeight:availableHeight/2}),maxPadding=Object.assign({},padding);updateMaxPadding(maxPadding,toPadding(minPadding));const chartArea=Object.assign({maxPadding,w:availableWidth,h:availableHeight,x:padding.left,y:padding.top},padding),stacks=setLayoutDims(verticalBoxes.concat(horizontalBoxes),params);fitBoxes(boxes.fullSize,chartArea,params,stacks),fitBoxes(verticalBoxes,chartArea,params,stacks),fitBoxes(horizontalBoxes,chartArea,params,stacks)&&fitBoxes(verticalBoxes,chartArea,params,stacks),handleMaxPadding(chartArea),placeBoxes(boxes.leftAndTop,chartArea,params,stacks),chartArea.x+=chartArea.w,chartArea.y+=chartArea.h,placeBoxes(boxes.rightAndBottom,chartArea,params,stacks),chart.chartArea={left:chartArea.left,top:chartArea.top,right:chartArea.left+chartArea.w,bottom:chartArea.top+chartArea.h,height:chartArea.h,width:chartArea.w},each(boxes.chartArea,layout=>{const box=layout.box;Object.assign(box,chart.chartArea),box.update(chartArea.w,chartArea.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(canvas,aspectRatio){}releaseContext(context){return!1}addEventListener(chart,type,listener){}removeEventListener(chart,type,listener){}getDevicePixelRatio(){return 1}getMaximumSize(element,width,height,aspectRatio){return width=Math.max(0,width||element.width),height=height||element.height,{width,height:Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height)}}isAttached(canvas){return!0}updateConfig(config){}}__name(BasePlatform,"BasePlatform");class BasicPlatform extends BasePlatform{acquireContext(item){return item&&item.getContext&&item.getContext("2d")||null}updateConfig(config){config.options.animation=!1}}__name(BasicPlatform,"BasicPlatform");const EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=__name(value=>null===value||""===value,"isNullOrEmpty");function initCanvas(canvas,aspectRatio){const style=canvas.style,renderHeight=canvas.getAttribute("height"),renderWidth=canvas.getAttribute("width");if(canvas.$chartjs={initial:{height:renderHeight,width:renderWidth,style:{display:style.display,height:style.height,width:style.width}}},style.display=style.display||"block",style.boxSizing=style.boxSizing||"border-box",isNullOrEmpty(renderWidth)){const displayWidth=readUsedSize(canvas,"width");void 0!==displayWidth&&(canvas.width=displayWidth)}if(isNullOrEmpty(renderHeight))if(""===canvas.style.height)canvas.height=canvas.width/(aspectRatio||2);else{const displayHeight=readUsedSize(canvas,"height");void 0!==displayHeight&&(canvas.height=displayHeight)}return canvas}__name(initCanvas,"initCanvas");const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(node,type,listener){node.addEventListener(type,listener,eventListenerOptions)}function removeListener(chart,type,listener){chart.canvas.removeEventListener(type,listener,eventListenerOptions)}function fromNativeEvent(event,chart){const type=EVENT_TYPES[event.type]||event.type,{x,y}=getRelativePosition(event,chart);return{type,chart,native:event,x:void 0!==x?x:null,y:void 0!==y?y:null}}function nodeListContains(nodeList,canvas){for(const node of nodeList)if(node===canvas||node.contains(canvas))return!0}function createAttachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.addedNodes,canvas),trigger=trigger&&!nodeListContains(entry.removedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}function createDetachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.removedNodes,canvas),trigger=trigger&&!nodeListContains(entry.addedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}__name(addListener,"addListener"),__name(removeListener,"removeListener"),__name(fromNativeEvent,"fromNativeEvent"),__name(nodeListContains,"nodeListContains"),__name(createAttachObserver,"createAttachObserver"),__name(createDetachObserver,"createDetachObserver");const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const dpr=window.devicePixelRatio;dpr!==oldDevicePixelRatio&&(oldDevicePixelRatio=dpr,drpListeningCharts.forEach((resize,chart)=>{chart.currentDevicePixelRatio!==dpr&&resize()}))}function listenDevicePixelRatioChanges(chart,resize){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(chart,resize)}function unlistenDevicePixelRatioChanges(chart){drpListeningCharts.delete(chart),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(chart,type,listener){const canvas=chart.canvas,container=canvas&&_getParentNode(canvas);if(!container)return;const resize=throttled((width,height)=>{const w=container.clientWidth;listener(width,height),w{const entry=entries[0],width=entry.contentRect.width,height=entry.contentRect.height;0===width&&0===height||resize(width,height)});return observer.observe(container),listenDevicePixelRatioChanges(chart,resize),observer}function releaseObserver(chart,type,observer){observer&&observer.disconnect(),"resize"===type&&unlistenDevicePixelRatioChanges(chart)}function createProxyAndListen(chart,type,listener){const canvas=chart.canvas,proxy=throttled(event=>{null!==chart.ctx&&listener(fromNativeEvent(event,chart))},chart,args=>{const event=args[0];return[event,event.offsetX,event.offsetY]});return addListener(canvas,type,proxy),proxy}__name(onWindowResize,"onWindowResize"),__name(listenDevicePixelRatioChanges,"listenDevicePixelRatioChanges"),__name(unlistenDevicePixelRatioChanges,"unlistenDevicePixelRatioChanges"),__name(createResizeObserver,"createResizeObserver"),__name(releaseObserver,"releaseObserver"),__name(createProxyAndListen,"createProxyAndListen");class DomPlatform extends BasePlatform{acquireContext(canvas,aspectRatio){const context=canvas&&canvas.getContext&&canvas.getContext("2d");return context&&context.canvas===canvas?(initCanvas(canvas,aspectRatio),context):null}releaseContext(context){const canvas=context.canvas;if(!canvas.$chartjs)return!1;const initial=canvas.$chartjs.initial;["height","width"].forEach(prop=>{const value=initial[prop];isNullOrUndef(value)?canvas.removeAttribute(prop):canvas.setAttribute(prop,value)});const style=initial.style||{};return Object.keys(style).forEach(key=>{canvas.style[key]=style[key]}),canvas.width=canvas.width,delete canvas.$chartjs,!0}addEventListener(chart,type,listener){this.removeEventListener(chart,type);const proxies=chart.$proxies||(chart.$proxies={}),handler={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[type]||createProxyAndListen;proxies[type]=handler(chart,type,listener)}removeEventListener(chart,type){const proxies=chart.$proxies||(chart.$proxies={}),proxy=proxies[type];proxy&&(({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[type]||removeListener)(chart,type,proxy),proxies[type]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(canvas,width,height,aspectRatio){return getMaximumSize(canvas,width,height,aspectRatio)}isAttached(canvas){const container=_getParentNode(canvas);return!(!container||!container.isConnected)}}function _detectPlatform(canvas){return!_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&canvas instanceof OffscreenCanvas?BasicPlatform:DomPlatform}__name(DomPlatform,"DomPlatform"),__name(_detectPlatform,"_detectPlatform");class Element{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(useFinalPosition){const{x,y}=this.getProps(["x","y"],useFinalPosition);return{x,y}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(props,final){const anims=this.$animations;if(!final||!anims)return this;const ret={};return props.forEach(prop=>{ret[prop]=anims[prop]&&anims[prop].active()?anims[prop]._to:this[prop]}),ret}}__name(Element,"Element"),Element.defaults={},Element.defaultRoutes=void 0;const formatters={values:value=>isArray(value)?value:""+value,numeric(tickValue,index2,ticks){if(0===tickValue)return"0";const locale=this.chart.options.locale;let notation,delta=tickValue;if(ticks.length>1){const maxTick=Math.max(Math.abs(ticks[0].value),Math.abs(ticks[ticks.length-1].value));(maxTick<1e-4||maxTick>1e15)&&(notation="scientific"),delta=calculateDelta(tickValue,ticks)}const logDelta=log10(Math.abs(delta)),numDecimal=Math.max(Math.min(-1*Math.floor(logDelta),20),0),options={notation,minimumFractionDigits:numDecimal,maximumFractionDigits:numDecimal};return Object.assign(options,this.options.ticks.format),formatNumber(tickValue,locale,options)},logarithmic(tickValue,index2,ticks){if(0===tickValue)return"0";const remain=tickValue/Math.pow(10,Math.floor(log10(tickValue)));return 1===remain||2===remain||5===remain?formatters.numeric.call(this,tickValue,index2,ticks):""}};function calculateDelta(tickValue,ticks){let delta=ticks.length>3?ticks[2].value-ticks[1].value:ticks[1].value-ticks[0].value;return Math.abs(delta)>=1&&tickValue!==Math.floor(tickValue)&&(delta=tickValue-Math.floor(tickValue)),delta}__name(calculateDelta,"calculateDelta");var Ticks={formatters};function autoSkip(scale,ticks){const tickOpts=scale.options.ticks,ticksLimit=tickOpts.maxTicksLimit||determineMaxTicks(scale),majorIndices=tickOpts.major.enabled?getMajorIndices(ticks):[],numMajorIndices=majorIndices.length,first=majorIndices[0],last=majorIndices[numMajorIndices-1],newTicks=[];if(numMajorIndices>ticksLimit)return skipMajors(ticks,newTicks,majorIndices,numMajorIndices/ticksLimit),newTicks;const spacing=calculateSpacing(majorIndices,ticks,ticksLimit);if(numMajorIndices>0){let i,ilen;const avgMajorSpacing=numMajorIndices>1?Math.round((last-first)/(numMajorIndices-1)):null;for(skip(ticks,newTicks,spacing,isNullOrUndef(avgMajorSpacing)?0:first-avgMajorSpacing,first),i=0,ilen=numMajorIndices-1;ispacing)return factor}return Math.max(spacing,1)}function getMajorIndices(ticks){const result=[];let i,ilen;for(i=0,ilen=ticks.length;ioptions.lineWidth,tickColor:(_ctx,options)=>options.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:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),defaults.route("scale.ticks","color","","color"),defaults.route("scale.grid","color","","borderColor"),defaults.route("scale.grid","borderColor","","borderColor"),defaults.route("scale.title","color","","color"),defaults.describe("scale",{_fallback:!1,_scriptable:name=>!name.startsWith("before")&&!name.startsWith("after")&&"callback"!==name&&"parser"!==name,_indexable:name=>"borderDash"!==name&&"tickBorderDash"!==name}),defaults.describe("scales",{_fallback:"scale"}),defaults.describe("scale.ticks",{_scriptable:name=>"backdropPadding"!==name&&"callback"!==name,_indexable:name=>"backdropPadding"!==name}),__name(autoSkip,"autoSkip"),__name(determineMaxTicks,"determineMaxTicks"),__name(calculateSpacing,"calculateSpacing"),__name(getMajorIndices,"getMajorIndices"),__name(skipMajors,"skipMajors"),__name(skip,"skip"),__name(getEvenSpacing,"getEvenSpacing");const reverseAlign=__name(align=>"left"===align?"right":"right"===align?"left":align,"reverseAlign"),offsetFromEdge=__name((scale,edge,offset)=>"top"===edge||"left"===edge?scale[edge]+offset:scale[edge]-offset,"offsetFromEdge");function sample(arr,numItems){const result=[],increment=arr.length/numItems,len=arr.length;let i=0;for(;iend+1e-6)))return lineValue}function garbageCollect(caches,length){each(caches,cache=>{const gc=cache.gc,gcLen=gc.length/2;let i;if(gcLen>length){for(i=0;imax?max:min,max=minDefined&&min>max?min:max,{min:finiteOrDefault(min,finiteOrDefault(max,min)),max:finiteOrDefault(max,finiteOrDefault(min,max))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const data=this.chart.data;return this.options.labels||(this.isHorizontal()?data.xLabels:data.yLabels)||data.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(maxWidth,maxHeight,margins){const{beginAtZero,grace,ticks:tickOpts}=this.options,sampleSize=tickOpts.sampleSize;this.beforeUpdate(),this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins=Object.assign({left:0,right:0,top:0,bottom:0},margins),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+margins.left+margins.right:this.height+margins.top+margins.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,grace,beginAtZero),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const samplingEnabled=sampleSize=maxRotation||numTicks<=1||!this.isHorizontal())return void(this.labelRotation=minRotation);const labelSizes=this._getLabelSizes(),maxLabelWidth=labelSizes.widest.width,maxLabelHeight=labelSizes.highest.height,maxWidth=_limitValue(this.chart.width-maxLabelWidth,0,this.maxWidth);tickWidth=options.offset?this.maxWidth/numTicks:maxWidth/(numTicks-1),maxLabelWidth+6>tickWidth&&(tickWidth=maxWidth/(numTicks-(options.offset?.5:1)),maxHeight=this.maxHeight-getTickMarkLength(options.grid)-tickOpts.padding-getTitleHeight(options.title,this.chart.options.font),maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight),labelRotation=toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height+6)/tickWidth,-1,1)),Math.asin(_limitValue(maxHeight/maxLabelDiagonal,-1,1))-Math.asin(_limitValue(maxLabelHeight/maxLabelDiagonal,-1,1)))),labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation))),this.labelRotation=labelRotation}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const minSize={width:0,height:0},{chart,options:{ticks:tickOpts,title:titleOpts,grid:gridOpts}}=this,display=this._isVisible(),isHorizontal=this.isHorizontal();if(display){const titleHeight=getTitleHeight(titleOpts,chart.options.font);if(isHorizontal?(minSize.width=this.maxWidth,minSize.height=getTickMarkLength(gridOpts)+titleHeight):(minSize.height=this.maxHeight,minSize.width=getTickMarkLength(gridOpts)+titleHeight),tickOpts.display&&this.ticks.length){const{first,last,widest,highest}=this._getLabelSizes(),tickPadding=2*tickOpts.padding,angleRadians=toRadians(this.labelRotation),cos=Math.cos(angleRadians),sin=Math.sin(angleRadians);if(isHorizontal){const labelHeight=tickOpts.mirror?0:sin*widest.width+cos*highest.height;minSize.height=Math.min(this.maxHeight,minSize.height+labelHeight+tickPadding)}else{const labelWidth=tickOpts.mirror?0:cos*widest.width+sin*highest.height;minSize.width=Math.min(this.maxWidth,minSize.width+labelWidth+tickPadding)}this._calculatePadding(first,last,sin,cos)}}this._handleMargins(),isHorizontal?(this.width=this._length=chart.width-this._margins.left-this._margins.right,this.height=minSize.height):(this.width=minSize.width,this.height=this._length=chart.height-this._margins.top-this._margins.bottom)}_calculatePadding(first,last,sin,cos){const{ticks:{align,padding},position}=this.options,isRotated=0!==this.labelRotation,labelsBelowTicks="top"!==position&&"x"===this.axis;if(this.isHorizontal()){const offsetLeft=this.getPixelForTick(0)-this.left,offsetRight=this.right-this.getPixelForTick(this.ticks.length-1);let paddingLeft=0,paddingRight=0;isRotated?labelsBelowTicks?(paddingLeft=cos*first.width,paddingRight=sin*last.height):(paddingLeft=sin*first.height,paddingRight=cos*last.width):"start"===align?paddingRight=last.width:"end"===align?paddingLeft=first.width:"inner"!==align&&(paddingLeft=first.width/2,paddingRight=last.width/2),this.paddingLeft=Math.max((paddingLeft-offsetLeft+padding)*this.width/(this.width-offsetLeft),0),this.paddingRight=Math.max((paddingRight-offsetRight+padding)*this.width/(this.width-offsetRight),0)}else{let paddingTop=last.height/2,paddingBottom=first.height/2;"start"===align?(paddingTop=0,paddingBottom=first.height):"end"===align&&(paddingTop=last.height,paddingBottom=0),this.paddingTop=paddingTop+padding,this.paddingBottom=paddingBottom+padding}}_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(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis,position}=this.options;return"top"===position||"bottom"===position||"x"===axis}isFullSize(){return this.options.fullSize}_convertTicksToLabels(ticks){let i,ilen;for(this.beforeTickToLabelConversion(),this.generateTickLabels(ticks),i=0,ilen=ticks.length;i({width:widths[idx]||0,height:heights[idx]||0}),"valueAt");return{first:valueAt(0),last:valueAt(length-1),widest:valueAt(widest),highest:valueAt(highest),widths,heights}}getLabelForValue(value){return value}getPixelForValue(value,index2){return NaN}getValueForPixel(pixel){}getPixelForTick(index2){const ticks=this.ticks;return index2<0||index2>ticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getPixelForDecimal(decimal){this._reversePixels&&(decimal=1-decimal);const pixel=this._startPixel+decimal*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,pixel,0):pixel)}getDecimalForPixel(pixel){const decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min,max}=this;return min<0&&max<0?max:min>0&&max>0?min:0}getContext(index2){const ticks=this.ticks||[];if(index2>=0&&index2w*sin?w/cos:h/sin:h*sin0}_computeGridLineItems(chartArea){const axis=this.axis,chart=this.chart,options=this.options,{grid,position}=options,offset=grid.offset,isHorizontal=this.isHorizontal(),ticksLength=this.ticks.length+(offset?1:0),tl=getTickMarkLength(grid),items=[],borderOpts=grid.setContext(this.getContext()),axisWidth=borderOpts.drawBorder?borderOpts.borderWidth:0,axisHalfWidth=axisWidth/2,alignBorderValue=__name(function(pixel){return _alignPixel(chart,pixel,axisWidth)},"alignBorderValue");let borderValue,i,lineValue,alignedLineValue,tx1,ty1,tx2,ty2,x1,y1,x2,y2;if("top"===position)borderValue=alignBorderValue(this.bottom),ty1=this.bottom-tl,ty2=borderValue-axisHalfWidth,y1=alignBorderValue(chartArea.top)+axisHalfWidth,y2=chartArea.bottom;else if("bottom"===position)borderValue=alignBorderValue(this.top),y1=chartArea.top,y2=alignBorderValue(chartArea.bottom)-axisHalfWidth,ty1=borderValue+axisHalfWidth,ty2=this.top+tl;else if("left"===position)borderValue=alignBorderValue(this.right),tx1=this.right-tl,tx2=borderValue-axisHalfWidth,x1=alignBorderValue(chartArea.left)+axisHalfWidth,x2=chartArea.right;else if("right"===position)borderValue=alignBorderValue(this.left),x1=chartArea.left,x2=alignBorderValue(chartArea.right)-axisHalfWidth,tx1=borderValue+axisHalfWidth,tx2=this.left+tl;else if("x"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.top+chartArea.bottom)/2+.5);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}y1=chartArea.top,y2=chartArea.bottom,ty1=borderValue+axisHalfWidth,ty2=ty1+tl}else if("y"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.left+chartArea.right)/2);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}tx1=borderValue-axisHalfWidth,tx2=tx1-tl,x1=chartArea.left,x2=chartArea.right}const limit=valueOrDefault(options.ticks.maxTicksLimit,ticksLength),step=Math.max(1,Math.ceil(ticksLength/limit));for(i=0;it.value===value);return index2>=0?grid.setContext(this.getContext(index2)).lineWidth:0}drawGrid(chartArea){const grid=this.options.grid,ctx=this.ctx,items=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(chartArea));let i,ilen;const drawLine=__name((p1,p2,style)=>{!style.width||!style.color||(ctx.save(),ctx.lineWidth=style.width,ctx.strokeStyle=style.color,ctx.setLineDash(style.borderDash||[]),ctx.lineDashOffset=style.borderDashOffset,ctx.beginPath(),ctx.moveTo(p1.x,p1.y),ctx.lineTo(p2.x,p2.y),ctx.stroke(),ctx.restore())},"drawLine");if(grid.display)for(i=0,ilen=items.length;i{this.drawBackground(),this.drawGrid(chartArea),this.drawTitle()}},{z:gz+1,draw:()=>{this.drawBorder()}},{z:tz,draw:chartArea=>{this.drawLabels(chartArea)}}]:[{z:tz,draw:chartArea=>{this.draw(chartArea)}}]}getMatchingVisibleMetas(type){const metas=this.chart.getSortedVisibleDatasetMetas(),axisID=this.axis+"AxisID",result=[];let i,ilen;for(i=0,ilen=metas.length;i{const propertyParts=property.split("."),sourceName=propertyParts.pop(),sourceScope=[scope].concat(propertyParts).join("."),parts=routes[property].split("."),targetName=parts.pop(),targetScope=parts.join(".");defaults.route(sourceScope,sourceName,targetScope,targetName)})}function isIChartComponent(proto){return"id"in proto&&"defaults"in proto}__name(TypedRegistry,"TypedRegistry"),__name(registerDefaults,"registerDefaults"),__name(routeDefaults,"routeDefaults"),__name(isIChartComponent,"isIChartComponent");class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...args){this._each("register",args)}remove(...args){this._each("unregister",args)}addControllers(...args){this._each("register",args,this.controllers)}addElements(...args){this._each("register",args,this.elements)}addPlugins(...args){this._each("register",args,this.plugins)}addScales(...args){this._each("register",args,this.scales)}getController(id){return this._get(id,this.controllers,"controller")}getElement(id){return this._get(id,this.elements,"element")}getPlugin(id){return this._get(id,this.plugins,"plugin")}getScale(id){return this._get(id,this.scales,"scale")}removeControllers(...args){this._each("unregister",args,this.controllers)}removeElements(...args){this._each("unregister",args,this.elements)}removePlugins(...args){this._each("unregister",args,this.plugins)}removeScales(...args){this._each("unregister",args,this.scales)}_each(method,args,typedRegistry){[...args].forEach(arg=>{const reg=typedRegistry||this._getRegistryForType(arg);typedRegistry||reg.isForType(arg)||reg===this.plugins&&arg.id?this._exec(method,reg,arg):each(arg,item=>{const itemReg=typedRegistry||this._getRegistryForType(item);this._exec(method,itemReg,item)})})}_exec(method,registry2,component){const camelMethod=_capitalize(method);callback(component["before"+camelMethod],[],component),registry2[method](component),callback(component["after"+camelMethod],[],component)}_getRegistryForType(type){for(let i=0;ia.filter(x=>!b.some(y=>x.plugin.id===y.plugin.id)),"diff");this._notify(diff(previousDescriptors,descriptors2),chart,"stop"),this._notify(diff(descriptors2,previousDescriptors),chart,"start")}}function allPlugins(config){const plugins2=[],keys=Object.keys(registry.plugins.items);for(let i=0;i{const scaleConf=configScales[id];if(!isObject(scaleConf))return console.error(`Invalid scale configuration for scale: ${id}`);if(scaleConf._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${id}`);const axis=determineAxis(id,scaleConf),defaultId=getDefaultScaleIDFromAxis(axis,chartIndexAxis),defaultScaleOptions=chartDefaults.scales||{};firstIDs[axis]=firstIDs[axis]||id,scales2[id]=mergeIf(Object.create(null),[{axis},scaleConf,defaultScaleOptions[axis],defaultScaleOptions[defaultId]])}),config.data.datasets.forEach(dataset=>{const type=dataset.type||config.type,indexAxis=dataset.indexAxis||getIndexAxis(type,options),defaultScaleOptions=(overrides[type]||{}).scales||{};Object.keys(defaultScaleOptions).forEach(defaultID=>{const axis=getAxisFromDefaultScaleID(defaultID,indexAxis),id=dataset[axis+"AxisID"]||firstIDs[axis]||axis;scales2[id]=scales2[id]||Object.create(null),mergeIf(scales2[id],[{axis},configScales[id],defaultScaleOptions[defaultID]])})}),Object.keys(scales2).forEach(key=>{const scale=scales2[key];mergeIf(scale,[defaults.scales[scale.type],defaults.scale])}),scales2}function initOptions(config){const options=config.options||(config.options={});options.plugins=valueOrDefault(options.plugins,{}),options.scales=mergeScaleConfig(config,options)}function initData(data){return(data=data||{}).datasets=data.datasets||[],data.labels=data.labels||[],data}function initConfig(config){return(config=config||{}).data=initData(config.data),initOptions(config),config}__name(PluginService,"PluginService"),__name(allPlugins,"allPlugins"),__name(getOpts,"getOpts"),__name(createDescriptors,"createDescriptors"),__name(pluginOpts,"pluginOpts"),__name(getIndexAxis,"getIndexAxis"),__name(getAxisFromDefaultScaleID,"getAxisFromDefaultScaleID"),__name(getDefaultScaleIDFromAxis,"getDefaultScaleIDFromAxis"),__name(axisFromPosition,"axisFromPosition"),__name(determineAxis,"determineAxis"),__name(mergeScaleConfig,"mergeScaleConfig"),__name(initOptions,"initOptions"),__name(initData,"initData"),__name(initConfig,"initConfig");const keyCache=new Map,keysCached=new Set;function cachedKeys(cacheKey,generate){let keys=keyCache.get(cacheKey);return keys||(keys=generate(),keyCache.set(cacheKey,keys),keysCached.add(keys)),keys}__name(cachedKeys,"cachedKeys");const addIfFound=__name((set2,obj,key)=>{const opts=resolveObjectKey(obj,key);void 0!==opts&&set2.add(opts)},"addIfFound");class Config{constructor(config){this._config=initConfig(config),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(type){this._config.type=type}get data(){return this._config.data}set data(data){this._config.data=initData(data)}get options(){return this._config.options}set options(options){this._config.options=options}get plugins(){return this._config.plugins}update(){const config=this._config;this.clearCache(),initOptions(config)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(datasetType){return cachedKeys(datasetType,()=>[[`datasets.${datasetType}`,""]])}datasetAnimationScopeKeys(datasetType,transition){return cachedKeys(`${datasetType}.transition.${transition}`,()=>[[`datasets.${datasetType}.transitions.${transition}`,`transitions.${transition}`],[`datasets.${datasetType}`,""]])}datasetElementScopeKeys(datasetType,elementType){return cachedKeys(`${datasetType}-${elementType}`,()=>[[`datasets.${datasetType}.elements.${elementType}`,`datasets.${datasetType}`,`elements.${elementType}`,""]])}pluginScopeKeys(plugin){const id=plugin.id;return cachedKeys(`${this.type}-plugin-${id}`,()=>[[`plugins.${id}`,...plugin.additionalOptionScopes||[]]])}_cachedScopes(mainScope,resetCache){const _scopeCache=this._scopeCache;let cache=_scopeCache.get(mainScope);return(!cache||resetCache)&&(cache=new Map,_scopeCache.set(mainScope,cache)),cache}getOptionScopes(mainScope,keyLists,resetCache){const{options,type}=this,cache=this._cachedScopes(mainScope,resetCache),cached=cache.get(keyLists);if(cached)return cached;const scopes=new Set;keyLists.forEach(keys=>{mainScope&&(scopes.add(mainScope),keys.forEach(key=>addIfFound(scopes,mainScope,key))),keys.forEach(key=>addIfFound(scopes,options,key)),keys.forEach(key=>addIfFound(scopes,overrides[type]||{},key)),keys.forEach(key=>addIfFound(scopes,defaults,key)),keys.forEach(key=>addIfFound(scopes,descriptors,key))});const array=Array.from(scopes);return 0===array.length&&array.push(Object.create(null)),keysCached.has(keyLists)&&cache.set(keyLists,array),array}chartOptionScopes(){const{options,type}=this;return[options,overrides[type]||{},defaults.datasets[type]||{},{type},defaults,descriptors]}resolveNamedOptions(scopes,names2,context,prefixes=[""]){const result={$shared:!0},{resolver,subPrefixes}=getResolver(this._resolverCache,scopes,prefixes);let options=resolver;if(needContext(resolver,names2)){result.$shared=!1;options=_attachContext(resolver,context=isFunction(context)?context():context,this.createResolver(scopes,context,subPrefixes))}for(const prop of names2)result[prop]=options[prop];return result}createResolver(scopes,context,prefixes=[""],descriptorDefaults){const{resolver}=getResolver(this._resolverCache,scopes,prefixes);return isObject(context)?_attachContext(resolver,context,void 0,descriptorDefaults):resolver}}function getResolver(resolverCache,scopes,prefixes){let cache=resolverCache.get(scopes);cache||(cache=new Map,resolverCache.set(scopes,cache));const cacheKey=prefixes.join();let cached=cache.get(cacheKey);return cached||(cached={resolver:_createResolver(scopes,prefixes),subPrefixes:prefixes.filter(p=>!p.toLowerCase().includes("hover"))},cache.set(cacheKey,cached)),cached}__name(Config,"Config"),__name(getResolver,"getResolver");const hasFunction=__name(value=>isObject(value)&&Object.getOwnPropertyNames(value).reduce((acc,key)=>acc||isFunction(value[key]),!1),"hasFunction");function needContext(proxy,names2){const{isScriptable,isIndexable}=_descriptors(proxy);for(const prop of names2){const scriptable=isScriptable(prop),indexable=isIndexable(prop),value=(indexable||scriptable)&&proxy[prop];if(scriptable&&(isFunction(value)||hasFunction(value))||indexable&&isArray(value))return!0}return!1}__name(needContext,"needContext");const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(position,axis){return"top"===position||"bottom"===position||-1===KNOWN_POSITIONS.indexOf(position)&&"x"===axis}function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1]}}function onAnimationsComplete(context){const chart=context.chart,animationOptions2=chart.options.animation;chart.notifyPlugins("afterRender"),callback(animationOptions2&&animationOptions2.onComplete,[context],chart)}function onAnimationProgress(context){const chart=context.chart,animationOptions2=chart.options.animation;callback(animationOptions2&&animationOptions2.onProgress,[context],chart)}function getCanvas(item){return _isDomSupported()&&"string"==typeof item?item=document.getElementById(item):item&&item.length&&(item=item[0]),item&&item.canvas&&(item=item.canvas),item}__name(positionIsHorizontal,"positionIsHorizontal"),__name(compare2Level,"compare2Level"),__name(onAnimationsComplete,"onAnimationsComplete"),__name(onAnimationProgress,"onAnimationProgress"),__name(getCanvas,"getCanvas");const instances={},getChart=__name(key=>{const canvas=getCanvas(key);return Object.values(instances).filter(c=>c.canvas===canvas).pop()},"getChart");function moveNumericKeys(obj,start,move){const keys=Object.keys(obj);for(const key of keys){const intKey=+key;if(intKey>=start){const value=obj[key];delete obj[key],(move>0||intKey>start)&&(obj[intKey+move]=value)}}}function determineLastEvent(e,lastEvent,inChartArea,isClick){return inChartArea&&"mouseout"!==e.type?isClick?lastEvent:e:null}__name(moveNumericKeys,"moveNumericKeys"),__name(determineLastEvent,"determineLastEvent");class Chart{constructor(item,userConfig){const config=this.config=new Config(userConfig),initialCanvas=getCanvas(item),existingChart=getChart(initialCanvas);if(existingChart)throw new Error("Canvas is already in use. Chart with ID '"+existingChart.id+"' must be destroyed before the canvas can be reused.");const options=config.createResolver(config.chartOptionScopes(),this.getContext());this.platform=new(config.platform||_detectPlatform(initialCanvas)),this.platform.updateConfig(config);const context=this.platform.acquireContext(initialCanvas,options.aspectRatio),canvas=context&&context.canvas,height=canvas&&canvas.height,width=canvas&&canvas.width;this.id=uid(),this.ctx=context,this.canvas=canvas,this.width=width,this.height=height,this._options=options,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(mode=>this.update(mode),options.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,context&&canvas?(animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio,maintainAspectRatio},width,height,_aspectRatio}=this;return isNullOrUndef(aspectRatio)?maintainAspectRatio&&_aspectRatio?_aspectRatio:height?width/height:null:aspectRatio}get data(){return this.config.data}set data(data){this.config.data=data}get options(){return this._options}set options(options){this.config.options=options}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(width,height){animator.running(this)?this._resizeBeforeDraw={width,height}:this._resize(width,height)}_resize(width,height){const options=this.options,canvas=this.canvas,aspectRatio=options.maintainAspectRatio&&this.aspectRatio,newSize=this.platform.getMaximumSize(canvas,width,height,aspectRatio),newRatio=options.devicePixelRatio||this.platform.getDevicePixelRatio(),mode=this.width?"resize":"attach";this.width=newSize.width,this.height=newSize.height,this._aspectRatio=this.aspectRatio,retinaScale(this,newRatio,!0)&&(this.notifyPlugins("resize",{size:newSize}),callback(options.onResize,[this,newSize],this),this.attached&&this._doResize(mode)&&this.render())}ensureScalesHaveIDs(){each(this.options.scales||{},(axisOptions,axisID)=>{axisOptions.id=axisID})}buildOrUpdateScales(){const options=this.options,scaleOpts=options.scales,scales2=this.scales,updated=Object.keys(scales2).reduce((obj,id)=>(obj[id]=!1,obj),{});let items=[];scaleOpts&&(items=items.concat(Object.keys(scaleOpts).map(id=>{const scaleOptions=scaleOpts[id],axis=determineAxis(id,scaleOptions),isRadial="r"===axis,isHorizontal="x"===axis;return{options:scaleOptions,dposition:isRadial?"chartArea":isHorizontal?"bottom":"left",dtype:isRadial?"radialLinear":isHorizontal?"category":"linear"}}))),each(items,item=>{const scaleOptions=item.options,id=scaleOptions.id,axis=determineAxis(id,scaleOptions),scaleType=valueOrDefault(scaleOptions.type,item.dtype);(void 0===scaleOptions.position||positionIsHorizontal(scaleOptions.position,axis)!==positionIsHorizontal(item.dposition))&&(scaleOptions.position=item.dposition),updated[id]=!0;let scale=null;if(id in scales2&&scales2[id].type===scaleType)scale=scales2[id];else{scale=new(registry.getScale(scaleType))({id,type:scaleType,ctx:this.ctx,chart:this}),scales2[scale.id]=scale}scale.init(scaleOptions,options)}),each(updated,(hasUpdated,id)=>{hasUpdated||delete scales2[id]}),each(scales2,scale=>{layouts.configure(this,scale,scale.options),layouts.addBox(this,scale)})}_updateMetasets(){const metasets=this._metasets,numData=this.data.datasets.length,numMeta=metasets.length;if(metasets.sort((a,b)=>a.index-b.index),numMeta>numData){for(let i=numData;idatasets.length&&delete this._stacks,metasets.forEach((meta,index2)=>{0===datasets.filter(x=>x===meta._dataset).length&&this._destroyDatasetMeta(index2)})}buildOrUpdateControllers(){const newControllers=[],datasets=this.data.datasets;let i,ilen;for(this._removeUnreferencedMetasets(),i=0,ilen=datasets.length;i{this.getDatasetMeta(datasetIndex).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(mode){const config=this.config;config.update();const options=this._options=config.createResolver(config.chartOptionScopes(),this.getContext()),animsDisabled=this._animationsDisabled=!options.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode,cancelable:!0}))return;const newControllers=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let minPadding=0;for(let i=0,ilen=this.data.datasets.length;i{controller.reset()}),this._updateDatasets(mode),this.notifyPlugins("afterUpdate",{mode}),this._layers.sort(compare2Level("z","_idx"));const{_active,_lastEvent}=this;_lastEvent?this._eventHandler(_lastEvent,!0):_active.length&&this._updateHoverStyles(_active,_active,!0),this.render()}_updateScales(){each(this.scales,scale=>{layouts.removeBox(this,scale)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const options=this.options,existingEvents=new Set(Object.keys(this._listeners)),newEvents=new Set(options.events);(!setsEqual(existingEvents,newEvents)||!!this._responsiveListeners!==options.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices}=this,changes=this._getUniformDataChanges()||[];for(const{method,start,count}of changes){moveNumericKeys(_hiddenIndices,start,"_removeElements"===method?-count:count)}}_getUniformDataChanges(){const _dataChanges=this._dataChanges;if(!_dataChanges||!_dataChanges.length)return;this._dataChanges=[];const datasetCount=this.data.datasets.length,makeSet=__name(idx=>new Set(_dataChanges.filter(c=>c[0]===idx).map((c,i)=>i+","+c.splice(1).join(","))),"makeSet"),changeSet=makeSet(0);for(let i=1;ic.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(minPadding){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,minPadding);const area=this.chartArea,noArea=area.width<=0||area.height<=0;this._layers=[],each(this.boxes,box=>{noArea&&"chartArea"===box.position||(box.configure&&box.configure(),this._layers.push(...box._layers()))},this),this._layers.forEach((item,index2)=>{item._idx=index2}),this.notifyPlugins("afterLayout")}_updateDatasets(mode){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode,cancelable:!0})){for(let i=0,ilen=this.data.datasets.length;i=0;--i)this._drawDataset(metasets[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(meta){const ctx=this.ctx,clip=meta._clip,useClip=!clip.disabled,area=this.chartArea,args={meta,index:meta.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",args)&&(useClip&&clipArea(ctx,{left:!1===clip.left?0:area.left-clip.left,right:!1===clip.right?this.width:area.right+clip.right,top:!1===clip.top?0:area.top-clip.top,bottom:!1===clip.bottom?this.height:area.bottom+clip.bottom}),meta.controller.draw(),useClip&&unclipArea(ctx),args.cancelable=!1,this.notifyPlugins("afterDatasetDraw",args))}isPointInArea(point){return _isPointInArea(point,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,mode,options,useFinalPosition){const method=Interaction.modes[mode];return"function"==typeof method?method(this,e,options,useFinalPosition):[]}getDatasetMeta(datasetIndex){const dataset=this.data.datasets[datasetIndex],metasets=this._metasets;let meta=metasets.filter(x=>x&&x._dataset===dataset).pop();return meta||(meta={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset&&dataset.order||0,index:datasetIndex,_dataset:dataset,_parsed:[],_sorted:!1},metasets.push(meta)),meta}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(datasetIndex){const dataset=this.data.datasets[datasetIndex];if(!dataset)return!1;const meta=this.getDatasetMeta(datasetIndex);return"boolean"==typeof meta.hidden?!meta.hidden:!dataset.hidden}setDatasetVisibility(datasetIndex,visible){this.getDatasetMeta(datasetIndex).hidden=!visible}toggleDataVisibility(index2){this._hiddenIndices[index2]=!this._hiddenIndices[index2]}getDataVisibility(index2){return!this._hiddenIndices[index2]}_updateVisibility(datasetIndex,dataIndex,visible){const mode=visible?"show":"hide",meta=this.getDatasetMeta(datasetIndex),anims=meta.controller._resolveAnimations(void 0,mode);defined(dataIndex)?(meta.data[dataIndex].hidden=!visible,this.update()):(this.setDatasetVisibility(datasetIndex,visible),anims.update(meta,{visible}),this.update(ctx=>ctx.datasetIndex===datasetIndex?mode:void 0))}hide(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!1)}show(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!0)}_destroyDatasetMeta(datasetIndex){const meta=this._metasets[datasetIndex];meta&&meta.controller&&meta.controller._destroy(),delete this._metasets[datasetIndex]}_stop(){let i,ilen;for(this.stop(),animator.remove(this),i=0,ilen=this.data.datasets.length;i{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),listener=__name((e,x,y)=>{e.offsetX=x,e.offsetY=y,this._eventHandler(e)},"listener");each(this.options.events,type=>_add(type,listener))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const listeners=this._responsiveListeners,platform=this.platform,_add=__name((type,listener2)=>{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),_remove=__name((type,listener2)=>{listeners[type]&&(platform.removeEventListener(this,type,listener2),delete listeners[type])},"_remove"),listener=__name((width,height)=>{this.canvas&&this.resize(width,height)},"listener");let detached;const attached=__name(()=>{_remove("attach",attached),this.attached=!0,this.resize(),_add("resize",listener),_add("detach",detached)},"attached");detached=__name(()=>{this.attached=!1,_remove("resize",listener),this._stop(),this._resize(0,0),_add("attach",attached)},"detached"),platform.isAttached(this.canvas)?attached():detached()}unbindEvents(){each(this._listeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._listeners={},each(this._responsiveListeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._responsiveListeners=void 0}updateHoverStyle(items,mode,enabled){const prefix=enabled?"set":"remove";let meta,item,i,ilen;for("dataset"===mode&&(meta=this.getDatasetMeta(items[0].datasetIndex),meta.controller["_"+prefix+"DatasetHoverStyle"]()),i=0,ilen=items.length;i{const meta=this.getDatasetMeta(datasetIndex);if(!meta)throw new Error("No dataset found at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}});!_elementsEqual(active,lastActive)&&(this._active=active,this._lastEvent=null,this._updateHoverStyles(active,lastActive))}notifyPlugins(hook,args,filter){return this._plugins.notify(this,hook,args,filter)}_updateHoverStyles(active,lastActive,replay){const hoverOptions=this.options.hover,diff=__name((a,b)=>a.filter(x=>!b.some(y=>x.datasetIndex===y.datasetIndex&&x.index===y.index)),"diff"),deactivated=diff(lastActive,active),activated=replay?active:diff(active,lastActive);deactivated.length&&this.updateHoverStyle(deactivated,hoverOptions.mode,!1),activated.length&&hoverOptions.mode&&this.updateHoverStyle(activated,hoverOptions.mode,!0)}_eventHandler(e,replay){const args={event:e,replay,cancelable:!0,inChartArea:this.isPointInArea(e)},eventFilter=__name(plugin=>(plugin.options.events||this.options.events).includes(e.native.type),"eventFilter");if(!1===this.notifyPlugins("beforeEvent",args,eventFilter))return;const changed=this._handleEvent(e,replay,args.inChartArea);return args.cancelable=!1,this.notifyPlugins("afterEvent",args,eventFilter),(changed||args.changed)&&this.render(),this}_handleEvent(e,replay,inChartArea){const{_active:lastActive=[],options}=this,useFinalPosition=replay,active=this._getActiveElements(e,lastActive,inChartArea,useFinalPosition),isClick=_isClickEvent(e),lastEvent=determineLastEvent(e,this._lastEvent,inChartArea,isClick);inChartArea&&(this._lastEvent=null,callback(options.onHover,[e,active,this],this),isClick&&callback(options.onClick,[e,active,this],this));const changed=!_elementsEqual(active,lastActive);return(changed||replay)&&(this._active=active,this._updateHoverStyles(active,lastActive,replay)),this._lastEvent=lastEvent,changed}_getActiveElements(e,lastActive,inChartArea,useFinalPosition){if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;const hoverOptions=this.options.hover;return this.getElementsAtEventForMode(e,hoverOptions.mode,hoverOptions,useFinalPosition)}}__name(Chart,"Chart");const invalidatePlugins=__name(()=>each(Chart.instances,chart=>chart._plugins.invalidate()),"invalidatePlugins");function clipArc(ctx,element,endAngle){const{startAngle,pixelMargin,x,y,outerRadius,innerRadius}=element;let angleMargin=pixelMargin/outerRadius;ctx.beginPath(),ctx.arc(x,y,outerRadius,startAngle-angleMargin,endAngle+angleMargin),innerRadius>pixelMargin?(angleMargin=pixelMargin/innerRadius,ctx.arc(x,y,innerRadius,endAngle+angleMargin,startAngle-angleMargin,!0)):ctx.arc(x,y,pixelMargin,endAngle+HALF_PI,startAngle-HALF_PI),ctx.closePath(),ctx.clip()}function toRadiusCorners(value){return _readValueToProps(value,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(arc,innerRadius,outerRadius,angleDelta){const o=toRadiusCorners(arc.options.borderRadius),halfThickness=(outerRadius-innerRadius)/2,innerLimit=Math.min(halfThickness,angleDelta*innerRadius/2),computeOuterLimit=__name(val=>{const outerArcLimit=(outerRadius-Math.min(halfThickness,val))*angleDelta/2;return _limitValue(val,0,Math.min(halfThickness,outerArcLimit))},"computeOuterLimit");return{outerStart:computeOuterLimit(o.outerStart),outerEnd:computeOuterLimit(o.outerEnd),innerStart:_limitValue(o.innerStart,0,innerLimit),innerEnd:_limitValue(o.innerEnd,0,innerLimit)}}function rThetaToXY(r,theta,x,y){return{x:x+r*Math.cos(theta),y:y+r*Math.sin(theta)}}function pathArc(ctx,element,offset,spacing,end){const{x,y,startAngle:start,pixelMargin,innerRadius:innerR}=element,outerRadius=Math.max(element.outerRadius+spacing+offset-pixelMargin,0),innerRadius=innerR>0?innerR+spacing+offset+pixelMargin:0;let spacingOffset=0;const alpha2=end-start;if(spacing){const avNogSpacingRadius=((innerR>0?innerR-spacing:0)+(outerRadius>0?outerRadius-spacing:0))/2;spacingOffset=(alpha2-(0!==avNogSpacingRadius?alpha2*avNogSpacingRadius/(avNogSpacingRadius+spacing):alpha2))/2}const angleOffset=(alpha2-Math.max(.001,alpha2*outerRadius-offset/PI)/outerRadius)/2,startAngle=start+angleOffset+spacingOffset,endAngle=end-angleOffset-spacingOffset,{outerStart,outerEnd,innerStart,innerEnd}=parseBorderRadius$1(element,innerRadius,outerRadius,endAngle-startAngle),outerStartAdjustedRadius=outerRadius-outerStart,outerEndAdjustedRadius=outerRadius-outerEnd,outerStartAdjustedAngle=startAngle+outerStart/outerStartAdjustedRadius,outerEndAdjustedAngle=endAngle-outerEnd/outerEndAdjustedRadius,innerStartAdjustedRadius=innerRadius+innerStart,innerEndAdjustedRadius=innerRadius+innerEnd,innerStartAdjustedAngle=startAngle+innerStart/innerStartAdjustedRadius,innerEndAdjustedAngle=endAngle-innerEnd/innerEndAdjustedRadius;if(ctx.beginPath(),ctx.arc(x,y,outerRadius,outerStartAdjustedAngle,outerEndAdjustedAngle),outerEnd>0){const pCenter=rThetaToXY(outerEndAdjustedRadius,outerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerEnd,outerEndAdjustedAngle,endAngle+HALF_PI)}const p4=rThetaToXY(innerEndAdjustedRadius,endAngle,x,y);if(ctx.lineTo(p4.x,p4.y),innerEnd>0){const pCenter=rThetaToXY(innerEndAdjustedRadius,innerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerEnd,endAngle+HALF_PI,innerEndAdjustedAngle+Math.PI)}if(ctx.arc(x,y,innerRadius,endAngle-innerEnd/innerRadius,startAngle+innerStart/innerRadius,!0),innerStart>0){const pCenter=rThetaToXY(innerStartAdjustedRadius,innerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerStart,innerStartAdjustedAngle+Math.PI,startAngle-HALF_PI)}const p8=rThetaToXY(outerStartAdjustedRadius,startAngle,x,y);if(ctx.lineTo(p8.x,p8.y),outerStart>0){const pCenter=rThetaToXY(outerStartAdjustedRadius,outerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerStart,startAngle-HALF_PI,outerStartAdjustedAngle)}ctx.closePath()}function drawArc(ctx,element,offset,spacing){const{fullCircles,startAngle,circumference}=element;let endAngle=element.endAngle;if(fullCircles){pathArc(ctx,element,offset,spacing,startAngle+TAU);for(let i=0;i{registry.add(...items),invalidatePlugins()}},unregister:{enumerable:true,value:(...items)=>{registry.remove(...items),invalidatePlugins()}}}),__name(clipArc,"clipArc"),__name(toRadiusCorners,"toRadiusCorners"),__name(parseBorderRadius$1,"parseBorderRadius$1"),__name(rThetaToXY,"rThetaToXY"),__name(pathArc,"pathArc"),__name(drawArc,"drawArc"),__name(drawFullCircleBorders,"drawFullCircleBorders"),__name(drawBorder,"drawBorder");class ArcElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}inRange(chartX,chartY,useFinalPosition){const point=this.getProps(["x","y"],useFinalPosition),{angle,distance}=getAngleFromPoint(point,{x:chartX,y:chartY}),{startAngle,endAngle,innerRadius,outerRadius,circumference}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),rAdjust=this.options.spacing/2,betweenAngles=valueOrDefault(circumference,endAngle-startAngle)>=TAU||_angleBetween(angle,startAngle,endAngle),withinRadius=_isBetween(distance,innerRadius+rAdjust,outerRadius+rAdjust);return betweenAngles&&withinRadius}getCenterPoint(useFinalPosition){const{x,y,startAngle,endAngle,innerRadius,outerRadius}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),{offset,spacing}=this.options,halfAngle=(startAngle+endAngle)/2,halfRadius=(innerRadius+outerRadius+spacing+offset)/2;return{x:x+Math.cos(halfAngle)*halfRadius,y:y+Math.sin(halfAngle)*halfRadius}}tooltipPosition(useFinalPosition){return this.getCenterPoint(useFinalPosition)}draw(ctx){const{options,circumference}=this,offset=(options.offset||0)/2,spacing=(options.spacing||0)/2;if(this.pixelMargin="inner"===options.borderAlign?.33:0,this.fullCircles=circumference>TAU?Math.floor(circumference/TAU):0,0===circumference||this.innerRadius<0||this.outerRadius<0)return;ctx.save();let radiusOffset=0;if(offset){radiusOffset=offset/2;const halfAngle=(this.startAngle+this.endAngle)/2;ctx.translate(Math.cos(halfAngle)*radiusOffset,Math.sin(halfAngle)*radiusOffset),this.circumference>=PI&&(radiusOffset=offset)}ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor;drawBorder(ctx,this,radiusOffset,spacing,drawArc(ctx,this,radiusOffset,spacing)),ctx.restore()}}function setStyle(ctx,options,style=options){ctx.lineCap=valueOrDefault(style.borderCapStyle,options.borderCapStyle),ctx.setLineDash(valueOrDefault(style.borderDash,options.borderDash)),ctx.lineDashOffset=valueOrDefault(style.borderDashOffset,options.borderDashOffset),ctx.lineJoin=valueOrDefault(style.borderJoinStyle,options.borderJoinStyle),ctx.lineWidth=valueOrDefault(style.borderWidth,options.borderWidth),ctx.strokeStyle=valueOrDefault(style.borderColor,options.borderColor)}function lineTo(ctx,previous,target){ctx.lineTo(target.x,target.y)}function getLineMethod(options){return options.stepped?_steppedLineTo:options.tension||"monotone"===options.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(points,segment,params={}){const count=points.length,{start:paramsStart=0,end:paramsEnd=count-1}=params,{start:segmentStart,end:segmentEnd}=segment,start=Math.max(paramsStart,segmentStart),end=Math.min(paramsEnd,segmentEnd),outside=paramsStartsegmentEnd&¶msEnd>segmentEnd;return{count,start,loop:segment.loop,ilen:end(start+(reverse?ilen-index2:index2))%count,"pointIndex"),drawX=__name(()=>{minY!==maxY&&(ctx.lineTo(avgX,maxY),ctx.lineTo(avgX,minY),ctx.lineTo(avgX,lastY))},"drawX");for(move&&(point=points[pointIndex(0)],ctx.moveTo(point.x,point.y)),i=0;i<=ilen;++i){if(point=points[pointIndex(i)],point.skip)continue;const x=point.x,y=point.y,truncX=0|x;truncX===prevX?(ymaxY&&(maxY=y),avgX=(countX*avgX+x)/++countX):(drawX(),ctx.lineTo(x,y),prevX=truncX,countX=0,minY=maxY=y),lastY=y}drawX()}function _getSegmentMethod(line){const opts=line.options,borderDash=opts.borderDash&&opts.borderDash.length;return line._decimated||line._loop||opts.tension||"monotone"===opts.cubicInterpolationMode||opts.stepped||borderDash?pathSegment:fastPathSegment}function _getInterpolationMethod(options){return options.stepped?_steppedInterpolation:options.tension||"monotone"===options.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(ctx,line,start,count){let path=line._path;path||(path=line._path=new Path2D,line.path(path,start,count)&&path.closePath()),setStyle(ctx,line.options),ctx.stroke(path)}function strokePathDirect(ctx,line,start,count){const{segments,options}=line,segmentMethod=_getSegmentMethod(line);for(const segment of segments)setStyle(ctx,options,segment.style),ctx.beginPath(),segmentMethod(ctx,line,segment,{start,end:start+count-1})&&ctx.closePath(),ctx.stroke()}__name(ArcElement,"ArcElement"),ArcElement.id="arc",ArcElement.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ArcElement.defaultRoutes={backgroundColor:"backgroundColor"},__name(setStyle,"setStyle"),__name(lineTo,"lineTo"),__name(getLineMethod,"getLineMethod"),__name(pathVars,"pathVars"),__name(pathSegment,"pathSegment"),__name(fastPathSegment,"fastPathSegment"),__name(_getSegmentMethod,"_getSegmentMethod"),__name(_getInterpolationMethod,"_getInterpolationMethod"),__name(strokePathWithCache,"strokePathWithCache"),__name(strokePathDirect,"strokePathDirect");const usePath2D="function"==typeof Path2D;function draw(ctx,line,start,count){usePath2D&&!line.options.segment?strokePathWithCache(ctx,line,start,count):strokePathDirect(ctx,line,start,count)}__name(draw,"draw");class LineElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}updateControlPoints(chartArea,indexAxis){const options=this.options;if((options.tension||"monotone"===options.cubicInterpolationMode)&&!options.stepped&&!this._pointsUpdated){const loop=options.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,options,chartArea,loop,indexAxis),this._pointsUpdated=!0}}set points(points){this._points=points,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const segments=this.segments,points=this.points;return segments.length&&points[segments[0].start]}last(){const segments=this.segments,points=this.points,count=segments.length;return count&&points[segments[count-1].end]}interpolate(point,property){const options=this.options,value=point[property],points=this.points,segments=_boundSegments(this,{property,start:value,end:value});if(!segments.length)return;const result=[],_interpolate=_getInterpolationMethod(options);let i,ilen;for(i=0,ilen=segments.length;i"borderDash"!==name&&"fill"!==name},__name(inRange$1,"inRange$1");class PointElement extends Element{constructor(cfg){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,cfg&&Object.assign(this,cfg)}inRange(mouseX,mouseY,useFinalPosition){const options=this.options,{x,y}=this.getProps(["x","y"],useFinalPosition);return Math.pow(mouseX-x,2)+Math.pow(mouseY-y,2)=count)return data.slice(start,start+count);const decimated=[],bucketWidth=(count-2)/(samples-2);let sampledIndex=0;const endIndex=start+count-1;let i,maxAreaPoint,maxArea,area,nextA,a=start;for(decimated[sampledIndex++]=data[a],i=0;imaxArea&&(maxArea=area,maxAreaPoint=data[j],nextA=j);decimated[sampledIndex++]=maxAreaPoint,a=nextA}return decimated[sampledIndex++]=data[endIndex],decimated}function minMaxDecimation(data,start,count,availableWidth){let i,point,x,y,prevX,minIndex,maxIndex,startIndex,minY,maxY,avgX=0,countX=0;const decimated=[],endIndex=start+count-1,xMin=data[start].x,dx=data[endIndex].x-xMin;for(i=start;imaxY&&(maxY=y,maxIndex=i),avgX=(countX*avgX+point.x)/++countX;else{const lastIndex=i-1;if(!isNullOrUndef(minIndex)&&!isNullOrUndef(maxIndex)){const intermediateIndex1=Math.min(minIndex,maxIndex),intermediateIndex2=Math.max(minIndex,maxIndex);intermediateIndex1!==startIndex&&intermediateIndex1!==lastIndex&&decimated.push({...data[intermediateIndex1],x:avgX}),intermediateIndex2!==startIndex&&intermediateIndex2!==lastIndex&&decimated.push({...data[intermediateIndex2],x:avgX})}i>0&&lastIndex!==startIndex&&decimated.push(data[lastIndex]),decimated.push(point),prevX=truncX,countX=0,minY=maxY=y,minIndex=maxIndex=startIndex=i}}return decimated}function cleanDecimatedDataset(dataset){if(dataset._decimated){const data=dataset._data;delete dataset._decimated,delete dataset._data,Object.defineProperty(dataset,"data",{value:data})}}function cleanDecimatedData(chart){chart.data.datasets.forEach(dataset=>{cleanDecimatedDataset(dataset)})}function getStartAndCountOfVisiblePointsSimplified(meta,points){const pointCount=points.length;let count,start=0;const{iScale}=meta,{min,max,minDefined,maxDefined}=iScale.getUserBounds();return minDefined&&(start=_limitValue(_lookupByKey(points,iScale.axis,min).lo,0,pointCount-1)),count=maxDefined?_limitValue(_lookupByKey(points,iScale.axis,max).hi+1,start,pointCount)-start:pointCount-start,{start,count}}__name(lttbDecimation,"lttbDecimation"),__name(minMaxDecimation,"minMaxDecimation"),__name(cleanDecimatedDataset,"cleanDecimatedDataset"),__name(cleanDecimatedData,"cleanDecimatedData"),__name(getStartAndCountOfVisiblePointsSimplified,"getStartAndCountOfVisiblePointsSimplified");function _segments(line,target,property){const segments=line.segments,points=line.points,tpoints=target.points,parts=[];for(const segment of segments){let{start,end}=segment;end=_findSegmentEnd(start,end,points);const bounds=_getBounds(property,points[start],points[end],segment.loop);if(!target.segments){parts.push({source:segment,target:bounds,start:points[start],end:points[end]});continue}const targetSegments=_boundSegments(target,bounds);for(const tgt of targetSegments){const subBounds=_getBounds(property,tpoints[tgt.start],tpoints[tgt.end],tgt.loop),fillSources=_boundSegment(segment,points,subBounds);for(const fillSource of fillSources)parts.push({source:fillSource,target:tgt,start:{[property]:_getEdge(bounds,subBounds,"start",Math.max)},end:{[property]:_getEdge(bounds,subBounds,"end",Math.min)}})}}return parts}function _getBounds(property,first,last,loop){if(loop)return;let start=first[property],end=last[property];return"angle"===property&&(start=_normalizeAngle(start),end=_normalizeAngle(end)),{property,start,end}}function _pointsFromSegments(boundary,line){const{x=null,y=null}=boundary||{},linePoints=line.points,points=[];return line.segments.forEach(({start,end})=>{end=_findSegmentEnd(start,end,linePoints);const first=linePoints[start],last=linePoints[end];null!==y?(points.push({x:first.x,y}),points.push({x:last.x,y})):null!==x&&(points.push({x,y:first.y}),points.push({x,y:last.y}))}),points}function _findSegmentEnd(start,end,points){for(;end>start;end--){const point=points[end];if(!isNaN(point.x)&&!isNaN(point.y))break}return end}function _getEdge(a,b,prop,fn){return a&&b?fn(a[prop],b[prop]):a?a[prop]:b?b[prop]:0}function _createBoundaryLine(boundary,line){let points=[],_loop=!1;return isArray(boundary)?(_loop=!0,points=boundary):points=_pointsFromSegments(boundary,line),points.length?new LineElement({points,options:{tension:0},_loop,_fullLoop:_loop}):null}function _resolveTarget(sources,index2,propagate){let fill2=sources[index2].fill;const visited=[index2];let target;if(!propagate)return fill2;for(;!1!==fill2&&-1===visited.indexOf(fill2);){if(!isNumberFinite(fill2))return fill2;if(target=sources[fill2],!target)return!1;if(target.visible)return fill2;visited.push(fill2),fill2=target.fill}return!1}function _decodeFill(line,index2,count){const fill2=parseFillOption(line);if(isObject(fill2))return!isNaN(fill2.value)&&fill2;let target=parseFloat(fill2);return isNumberFinite(target)&&Math.floor(target)===target?decodeTargetIndex(fill2[0],index2,target,count):["origin","start","end","stack","shape"].indexOf(fill2)>=0&&fill2}function decodeTargetIndex(firstCh,index2,target,count){return("-"===firstCh||"+"===firstCh)&&(target=index2+target),!(target===index2||target<0||target>=count)&&target}function _getTargetPixel(fill2,scale){let pixel=null;return"start"===fill2?pixel=scale.bottom:"end"===fill2?pixel=scale.top:isObject(fill2)?pixel=scale.getPixelForValue(fill2.value):scale.getBasePixel&&(pixel=scale.getBasePixel()),pixel}function _getTargetValue(fill2,scale,startValue){let value;return value="start"===fill2?startValue:"end"===fill2?scale.options.reverse?scale.min:scale.max:isObject(fill2)?fill2.value:scale.getBaseValue(),value}function parseFillOption(line){const options=line.options,fillOption=options.fill;let fill2=valueOrDefault(fillOption&&fillOption.target,fillOption);return void 0===fill2&&(fill2=!!options.backgroundColor),!1!==fill2&&null!==fill2&&(!0===fill2?"origin":fill2)}function _buildStackLine(source){const{scale,index:index2,line}=source,points=[],segments=line.segments,sourcePoints=line.points,linesBelow=getLinesBelow(scale,index2);linesBelow.push(_createBoundaryLine({x:null,y:scale.bottom},line));for(let i=0;i=0;--i){const source=metasets[i].$filler;!source||(source.line.updateControlPoints(area,source.axis),draw2&&_drawfill(chart.ctx,source,area))}},beforeDatasetsDraw(chart,_args,options){if("beforeDatasetsDraw"!==options.drawTime)return;const metasets=chart.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;source&&_drawfill(chart.ctx,source,chart.chartArea)}},beforeDatasetDraw(chart,args,options){const source=args.meta.$filler;!source||!1===source.fill||"beforeDatasetDraw"!==options.drawTime||_drawfill(chart.ctx,source,chart.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=__name((labelOpts,fontSize)=>{let{boxHeight=fontSize,boxWidth=fontSize}=labelOpts;return labelOpts.usePointStyle&&(boxHeight=Math.min(boxHeight,fontSize),boxWidth=Math.min(boxWidth,fontSize)),{boxWidth,boxHeight,itemHeight:Math.max(fontSize,boxHeight)}},"getBoxSize"),itemsEqual=__name((a,b)=>null!==a&&null!==b&&a.datasetIndex===b.datasetIndex&&a.index===b.index,"itemsEqual");class Legend extends Element{constructor(config){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight,margins){this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins,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 labelOpts=this.options.labels||{};let legendItems=callback(labelOpts.generateLabels,[this.chart],this)||[];labelOpts.filter&&(legendItems=legendItems.filter(item=>labelOpts.filter(item,this.chart.data))),labelOpts.sort&&(legendItems=legendItems.sort((a,b)=>labelOpts.sort(a,b,this.chart.data))),this.options.reverse&&legendItems.reverse(),this.legendItems=legendItems}fit(){const{options,ctx}=this;if(!options.display)return void(this.width=this.height=0);const labelOpts=options.labels,labelFont=toFont(labelOpts.font),fontSize=labelFont.size,titleHeight=this._computeTitleHeight(),{boxWidth,itemHeight}=getBoxSize(labelOpts,fontSize);let width,height;ctx.font=labelFont.string,this.isHorizontal()?(width=this.maxWidth,height=this._fitRows(titleHeight,fontSize,boxWidth,itemHeight)+10):(height=this.maxHeight,width=this._fitCols(titleHeight,fontSize,boxWidth,itemHeight)+10),this.width=Math.min(width,options.maxWidth||this.maxWidth),this.height=Math.min(height,options.maxHeight||this.maxHeight)}_fitRows(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxWidth,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],lineWidths=this.lineWidths=[0],lineHeight=itemHeight+padding;let totalHeight=titleHeight;ctx.textAlign="left",ctx.textBaseline="middle";let row=-1,top=-lineHeight;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;(0===i||lineWidths[lineWidths.length-1]+itemWidth+2*padding>maxWidth)&&(totalHeight+=lineHeight,lineWidths[lineWidths.length-(i>0?0:1)]=0,top+=lineHeight,row++),hitboxes[i]={left:0,top,row,width:itemWidth,height:itemHeight},lineWidths[lineWidths.length-1]+=itemWidth+padding}),totalHeight}_fitCols(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxHeight,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],columnSizes=this.columnSizes=[],heightLimit=maxHeight-titleHeight;let totalWidth=padding,currentColWidth=0,currentColHeight=0,left=0,col=0;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;i>0&¤tColHeight+itemHeight+2*padding>heightLimit&&(totalWidth+=currentColWidth+padding,columnSizes.push({width:currentColWidth,height:currentColHeight}),left+=currentColWidth+padding,col++,currentColWidth=currentColHeight=0),hitboxes[i]={left,top:currentColHeight,col,width:itemWidth,height:itemHeight},currentColWidth=Math.max(currentColWidth,itemWidth),currentColHeight+=itemHeight+padding}),totalWidth+=currentColWidth,columnSizes.push({width:currentColWidth,height:currentColHeight}),totalWidth}adjustHitBoxes(){if(!this.options.display)return;const titleHeight=this._computeTitleHeight(),{legendHitBoxes:hitboxes,options:{align,labels:{padding},rtl}}=this,rtlHelper=getRtlAdapter(rtl,this.left,this.width);if(this.isHorizontal()){let row=0,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row]);for(const hitbox of hitboxes)row!==hitbox.row&&(row=hitbox.row,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row])),hitbox.top+=this.top+titleHeight+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(left),hitbox.width),left+=hitbox.width+padding}else{let col=0,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height);for(const hitbox of hitboxes)hitbox.col!==col&&(col=hitbox.col,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height)),hitbox.top=top,hitbox.left+=this.left+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(hitbox.left),hitbox.width),top+=hitbox.height+padding}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const ctx=this.ctx;clipArea(ctx,this),this._draw(),unclipArea(ctx)}}_draw(){const{options:opts,columnSizes,lineWidths,ctx}=this,{align,labels:labelOpts}=opts,defaultColor=defaults.color,rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),labelFont=toFont(labelOpts.font),{color:fontColor,padding}=labelOpts,fontSize=labelFont.size,halfFontSize=fontSize/2;let cursor;this.drawTitle(),ctx.textAlign=rtlHelper.textAlign("left"),ctx.textBaseline="middle",ctx.lineWidth=.5,ctx.font=labelFont.string;const{boxWidth,boxHeight,itemHeight}=getBoxSize(labelOpts,fontSize),drawLegendBox=__name(function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0||isNaN(boxHeight)||boxHeight<0)return;ctx.save();const lineWidth=valueOrDefault(legendItem.lineWidth,1);if(ctx.fillStyle=valueOrDefault(legendItem.fillStyle,defaultColor),ctx.lineCap=valueOrDefault(legendItem.lineCap,"butt"),ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,0),ctx.lineJoin=valueOrDefault(legendItem.lineJoin,"miter"),ctx.lineWidth=lineWidth,ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,defaultColor),ctx.setLineDash(valueOrDefault(legendItem.lineDash,[])),labelOpts.usePointStyle){const drawOptions={radius:boxWidth*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth},centerX=rtlHelper.xPlus(x,boxWidth/2);drawPoint(ctx,drawOptions,centerX,y+halfFontSize)}else{const yBoxTop=y+Math.max((fontSize-boxHeight)/2,0),xBoxLeft=rtlHelper.leftForLtr(x,boxWidth),borderRadius=toTRBLCorners(legendItem.borderRadius);ctx.beginPath(),Object.values(borderRadius).some(v=>0!==v)?addRoundedRectPath(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius}):ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight),ctx.fill(),0!==lineWidth&&ctx.stroke()}ctx.restore()},"drawLegendBox"),fillText=__name(function(x,y,legendItem){renderText(ctx,legendItem.text,x,y+itemHeight/2,labelFont,{strikethrough:legendItem.hidden,textAlign:rtlHelper.textAlign(legendItem.textAlign)})},"fillText"),isHorizontal=this.isHorizontal(),titleHeight=this._computeTitleHeight();cursor=isHorizontal?{x:_alignStartEnd(align,this.left+padding,this.right-lineWidths[0]),y:this.top+padding+titleHeight,line:0}:{x:this.left+padding,y:_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[0].height),line:0},overrideTextDirection(this.ctx,opts.textDirection);const lineHeight=itemHeight+padding;this.legendItems.forEach((legendItem,i)=>{ctx.strokeStyle=legendItem.fontColor||fontColor,ctx.fillStyle=legendItem.fontColor||fontColor;const textWidth=ctx.measureText(legendItem.text).width,textAlign=rtlHelper.textAlign(legendItem.textAlign||(legendItem.textAlign=labelOpts.textAlign)),width=boxWidth+halfFontSize+textWidth;let x=cursor.x,y=cursor.y;rtlHelper.setWidth(this.width),isHorizontal?i>0&&x+width+padding>this.right&&(y=cursor.y+=lineHeight,cursor.line++,x=cursor.x=_alignStartEnd(align,this.left+padding,this.right-lineWidths[cursor.line])):i>0&&y+lineHeight>this.bottom&&(x=cursor.x=x+columnSizes[cursor.line].width+padding,cursor.line++,y=cursor.y=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[cursor.line].height));const realX=rtlHelper.x(x);drawLegendBox(realX,y,legendItem),x=_textX(textAlign,x+boxWidth+halfFontSize,isHorizontal?x+width:this.right,opts.rtl),fillText(rtlHelper.x(x),y,legendItem),isHorizontal?cursor.x+=width+padding:cursor.y+=lineHeight}),restoreTextDirection(this.ctx,opts.textDirection)}drawTitle(){const opts=this.options,titleOpts=opts.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);if(!titleOpts.display)return;const rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),ctx=this.ctx,position=titleOpts.position,halfFontSize=titleFont.size/2,topPaddingPlusHalfFontSize=titlePadding.top+halfFontSize;let y,left=this.left,maxWidth=this.width;if(this.isHorizontal())maxWidth=Math.max(...this.lineWidths),y=this.top+topPaddingPlusHalfFontSize,left=_alignStartEnd(opts.align,left,this.right-maxWidth);else{const maxHeight=this.columnSizes.reduce((acc,size)=>Math.max(acc,size.height),0);y=topPaddingPlusHalfFontSize+_alignStartEnd(opts.align,this.top,this.bottom-maxHeight-opts.labels.padding-this._computeTitleHeight())}const x=_alignStartEnd(position,left,left+maxWidth);ctx.textAlign=rtlHelper.textAlign(_toLeftRightCenter(position)),ctx.textBaseline="middle",ctx.strokeStyle=titleOpts.color,ctx.fillStyle=titleOpts.color,ctx.font=titleFont.string,renderText(ctx,titleOpts.text,x,y,titleFont)}_computeTitleHeight(){const titleOpts=this.options.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);return titleOpts.display?titleFont.lineHeight+titlePadding.height:0}_getLegendItemAt(x,y){let i,hitBox,lh;if(_isBetween(x,this.left,this.right)&&_isBetween(y,this.top,this.bottom))for(lh=this.legendHitBoxes,i=0;ictx.chart.options.color,boxWidth:40,padding:10,generateLabels(chart){const datasets=chart.data.datasets,{labels:{usePointStyle,pointStyle,textAlign,color:color2}}=chart.legend.options;return chart._getSortedDatasetMetas().map(meta=>{const style=meta.controller.getStyle(usePointStyle?0:void 0),borderWidth=toPadding(style.borderWidth);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,fontColor:color2,hidden:!meta.visible,lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:(borderWidth.width+borderWidth.height)/4,strokeStyle:style.borderColor,pointStyle:pointStyle||style.pointStyle,rotation:style.rotation,textAlign:textAlign||style.textAlign,borderRadius:0,datasetIndex:meta.index}},this)}},title:{color:ctx=>ctx.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:name=>!name.startsWith("on"),labels:{_scriptable:name=>!["generateLabels","filter","sort"].includes(name)}}};class Title extends Element{constructor(config){super(),this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight){const opts=this.options;if(this.left=0,this.top=0,!opts.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=maxWidth,this.height=this.bottom=maxHeight;const lineCount=isArray(opts.text)?opts.text.length:1;this._padding=toPadding(opts.padding);const textSize=lineCount*toFont(opts.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=textSize:this.width=textSize}isHorizontal(){const pos=this.options.position;return"top"===pos||"bottom"===pos}_drawArgs(offset){const{top,left,bottom,right,options}=this,align=options.align;let maxWidth,titleX,titleY,rotation=0;return this.isHorizontal()?(titleX=_alignStartEnd(align,left,right),titleY=top+offset,maxWidth=right-left):("left"===options.position?(titleX=left+offset,titleY=_alignStartEnd(align,bottom,top),rotation=-.5*PI):(titleX=right-offset,titleY=_alignStartEnd(align,top,bottom),rotation=.5*PI),maxWidth=bottom-top),{titleX,titleY,maxWidth,rotation}}draw(){const ctx=this.ctx,opts=this.options;if(!opts.display)return;const fontOpts=toFont(opts.font),offset=fontOpts.lineHeight/2+this._padding.top,{titleX,titleY,maxWidth,rotation}=this._drawArgs(offset);renderText(ctx,opts.text,0,0,fontOpts,{color:opts.color,maxWidth,rotation,textAlign:_toLeftRightCenter(opts.align),textBaseline:"middle",translation:[titleX,titleY]})}}function createTitle(chart,titleOpts){const title=new Title({ctx:chart.ctx,options:titleOpts,chart});layouts.configure(chart,title,titleOpts),layouts.addBox(chart,title),chart.titleBlock=title}__name(Title,"Title"),__name(createTitle,"createTitle");var plugin_title={id:"title",_element:Title,start(chart,_args,options){createTitle(chart,options)},stop(chart){const titleBlock=chart.titleBlock;layouts.removeBox(chart,titleBlock),delete chart.titleBlock},beforeUpdate(chart,_args,options){const title=chart.titleBlock;layouts.configure(chart,title,options),title.options=options},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 positioners={average(items){if(!items.length)return!1;let i,len,x=0,y=0,count=0;for(i=0,len=items.length;i-1?str.split("\n"):str}function createTooltipItem(chart,item){const{element,datasetIndex,index:index2}=item,controller=chart.getDatasetMeta(datasetIndex).controller,{label,value}=controller.getLabelAndValue(index2);return{chart,label,parsed:controller.getParsed(index2),raw:chart.data.datasets[datasetIndex].data[index2],formattedValue:value,dataset:controller.getDataset(),dataIndex:index2,datasetIndex,element}}function getTooltipSize(tooltip,options){const ctx=tooltip.chart.ctx,{body,footer,title}=tooltip,{boxWidth,boxHeight}=options,bodyFont=toFont(options.bodyFont),titleFont=toFont(options.titleFont),footerFont=toFont(options.footerFont),titleLineCount=title.length,footerLineCount=footer.length,bodyLineItemCount=body.length,padding=toPadding(options.padding);let height=padding.height,width=0,combinedBodyLength=body.reduce((count,bodyItem)=>count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length,0);if(combinedBodyLength+=tooltip.beforeBody.length+tooltip.afterBody.length,titleLineCount&&(height+=titleLineCount*titleFont.lineHeight+(titleLineCount-1)*options.titleSpacing+options.titleMarginBottom),combinedBodyLength){height+=bodyLineItemCount*(options.displayColors?Math.max(boxHeight,bodyFont.lineHeight):bodyFont.lineHeight)+(combinedBodyLength-bodyLineItemCount)*bodyFont.lineHeight+(combinedBodyLength-1)*options.bodySpacing}footerLineCount&&(height+=options.footerMarginTop+footerLineCount*footerFont.lineHeight+(footerLineCount-1)*options.footerSpacing);let widthPadding=0;const maxLineWidth=__name(function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding)},"maxLineWidth");return ctx.save(),ctx.font=titleFont.string,each(tooltip.title,maxLineWidth),ctx.font=bodyFont.string,each(tooltip.beforeBody.concat(tooltip.afterBody),maxLineWidth),widthPadding=options.displayColors?boxWidth+2+options.boxPadding:0,each(body,bodyItem=>{each(bodyItem.before,maxLineWidth),each(bodyItem.lines,maxLineWidth),each(bodyItem.after,maxLineWidth)}),widthPadding=0,ctx.font=footerFont.string,each(tooltip.footer,maxLineWidth),ctx.restore(),width+=padding.width,{width,height}}function determineYAlign(chart,size){const{y,height}=size;return ychart.height-height/2?"bottom":"center"}function doesNotFitWithAlign(xAlign,chart,options,size){const{x,width}=size,caret=options.caretSize+options.caretPadding;if("left"===xAlign&&x+width+caret>chart.width||"right"===xAlign&&x-width-caret<0)return!0}function determineXAlign(chart,options,size,yAlign){const{x,width}=size,{width:chartWidth,chartArea:{left,right}}=chart;let xAlign="center";return"center"===yAlign?xAlign=x<=(left+right)/2?"left":"right":x<=width/2?xAlign="left":x>=chartWidth-width/2&&(xAlign="right"),doesNotFitWithAlign(xAlign,chart,options,size)&&(xAlign="center"),xAlign}function determineAlignment(chart,options,size){const yAlign=size.yAlign||options.yAlign||determineYAlign(chart,size);return{xAlign:size.xAlign||options.xAlign||determineXAlign(chart,options,size,yAlign),yAlign}}function alignX(size,xAlign){let{x,width}=size;return"right"===xAlign?x-=width:"center"===xAlign&&(x-=width/2),x}function alignY(size,yAlign,paddingAndSize){let{y,height}=size;return"top"===yAlign?y+=paddingAndSize:y-="bottom"===yAlign?height+paddingAndSize:height/2,y}function getBackgroundPoint(options,size,alignment,chart){const{caretSize,caretPadding,cornerRadius}=options,{xAlign,yAlign}=alignment,paddingAndSize=caretSize+caretPadding,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius);let x=alignX(size,xAlign);const y=alignY(size,yAlign,paddingAndSize);return"center"===yAlign?"left"===xAlign?x+=paddingAndSize:"right"===xAlign&&(x-=paddingAndSize):"left"===xAlign?x-=Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign&&(x+=Math.max(topRight,bottomRight)+caretSize),{x:_limitValue(x,0,chart.width-size.width),y:_limitValue(y,0,chart.height-size.height)}}function getAlignedX(tooltip,align,options){const padding=toPadding(options.padding);return"center"===align?tooltip.x+tooltip.width/2:"right"===align?tooltip.x+tooltip.width-padding.right:tooltip.x+padding.left}function getBeforeAfterBodyLines(callback2){return pushOrConcat([],splitNewlines(callback2))}function createTooltipContext(parent,tooltip,tooltipItems){return createContext(parent,{tooltip,tooltipItems,type:"tooltip"})}function overrideCallbacks(callbacks,context){const override=context&&context.dataset&&context.dataset.tooltip&&context.dataset.tooltip.callbacks;return override?callbacks.override(override):callbacks}__name(pushOrConcat,"pushOrConcat"),__name(splitNewlines,"splitNewlines"),__name(createTooltipItem,"createTooltipItem"),__name(getTooltipSize,"getTooltipSize"),__name(determineYAlign,"determineYAlign"),__name(doesNotFitWithAlign,"doesNotFitWithAlign"),__name(determineXAlign,"determineXAlign"),__name(determineAlignment,"determineAlignment"),__name(alignX,"alignX"),__name(alignY,"alignY"),__name(getBackgroundPoint,"getBackgroundPoint"),__name(getAlignedX,"getAlignedX"),__name(getBeforeAfterBodyLines,"getBeforeAfterBodyLines"),__name(createTooltipContext,"createTooltipContext"),__name(overrideCallbacks,"overrideCallbacks");class Tooltip extends Element{constructor(config){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=config.chart||config._chart,this._chart=this.chart,this.options=config.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(options){this.options=options,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const cached=this._cachedAnimations;if(cached)return cached;const chart=this.chart,options=this.options.setContext(this.getContext()),opts=options.enabled&&chart.options.animation&&options.animations,animations=new Animations(this.chart,opts);return opts._cacheable&&(this._cachedAnimations=Object.freeze(animations)),animations}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(context,options){const{callbacks}=options,beforeTitle=callbacks.beforeTitle.apply(this,[context]),title=callbacks.title.apply(this,[context]),afterTitle=callbacks.afterTitle.apply(this,[context]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeTitle)),lines=pushOrConcat(lines,splitNewlines(title)),lines=pushOrConcat(lines,splitNewlines(afterTitle)),lines}getBeforeBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this,[tooltipItems]))}getBody(tooltipItems,options){const{callbacks}=options,bodyItems=[];return each(tooltipItems,context=>{const bodyItem={before:[],lines:[],after:[]},scoped=overrideCallbacks(callbacks,context);pushOrConcat(bodyItem.before,splitNewlines(scoped.beforeLabel.call(this,context))),pushOrConcat(bodyItem.lines,scoped.label.call(this,context)),pushOrConcat(bodyItem.after,splitNewlines(scoped.afterLabel.call(this,context))),bodyItems.push(bodyItem)}),bodyItems}getAfterBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this,[tooltipItems]))}getFooter(tooltipItems,options){const{callbacks}=options,beforeFooter=callbacks.beforeFooter.apply(this,[tooltipItems]),footer=callbacks.footer.apply(this,[tooltipItems]),afterFooter=callbacks.afterFooter.apply(this,[tooltipItems]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeFooter)),lines=pushOrConcat(lines,splitNewlines(footer)),lines=pushOrConcat(lines,splitNewlines(afterFooter)),lines}_createItems(options){const active=this._active,data=this.chart.data,labelColors=[],labelPointStyles=[],labelTextColors=[];let i,len,tooltipItems=[];for(i=0,len=active.length;ioptions.filter(element,index2,array,data))),options.itemSort&&(tooltipItems=tooltipItems.sort((a,b)=>options.itemSort(a,b,data))),each(tooltipItems,context=>{const scoped=overrideCallbacks(options.callbacks,context);labelColors.push(scoped.labelColor.call(this,context)),labelPointStyles.push(scoped.labelPointStyle.call(this,context)),labelTextColors.push(scoped.labelTextColor.call(this,context))}),this.labelColors=labelColors,this.labelPointStyles=labelPointStyles,this.labelTextColors=labelTextColors,this.dataPoints=tooltipItems,tooltipItems}update(changed,replay){const options=this.options.setContext(this.getContext()),active=this._active;let properties,tooltipItems=[];if(active.length){const position=positioners[options.position].call(this,active,this._eventPosition);tooltipItems=this._createItems(options),this.title=this.getTitle(tooltipItems,options),this.beforeBody=this.getBeforeBody(tooltipItems,options),this.body=this.getBody(tooltipItems,options),this.afterBody=this.getAfterBody(tooltipItems,options),this.footer=this.getFooter(tooltipItems,options);const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,size),alignment=determineAlignment(this.chart,options,positionAndSize),backgroundPoint=getBackgroundPoint(options,positionAndSize,alignment,this.chart);this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,properties={opacity:1,x:backgroundPoint.x,y:backgroundPoint.y,width:size.width,height:size.height,caretX:position.x,caretY:position.y}}else 0!==this.opacity&&(properties={opacity:0});this._tooltipItems=tooltipItems,this.$context=void 0,properties&&this._resolveAnimations().update(this,properties),changed&&options.external&&options.external.call(this,{chart:this.chart,tooltip:this,replay})}drawCaret(tooltipPoint,ctx,size,options){const caretPosition=this.getCaretPosition(tooltipPoint,size,options);ctx.lineTo(caretPosition.x1,caretPosition.y1),ctx.lineTo(caretPosition.x2,caretPosition.y2),ctx.lineTo(caretPosition.x3,caretPosition.y3)}getCaretPosition(tooltipPoint,size,options){const{xAlign,yAlign}=this,{caretSize,cornerRadius}=options,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius),{x:ptX,y:ptY}=tooltipPoint,{width,height}=size;let x1,x2,x3,y1,y2,y3;return"center"===yAlign?(y2=ptY+height/2,"left"===xAlign?(x1=ptX,x2=x1-caretSize,y1=y2+caretSize,y3=y2-caretSize):(x1=ptX+width,x2=x1+caretSize,y1=y2-caretSize,y3=y2+caretSize),x3=x1):(x2="left"===xAlign?ptX+Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign?ptX+width-Math.max(topRight,bottomRight)-caretSize:this.caretX,"top"===yAlign?(y1=ptY,y2=y1-caretSize,x1=x2-caretSize,x3=x2+caretSize):(y1=ptY+height,y2=y1+caretSize,x1=x2+caretSize,x3=x2-caretSize),y3=y1),{x1,x2,x3,y1,y2,y3}}drawTitle(pt,ctx,options){const title=this.title,length=title.length;let titleFont,titleSpacing,i;if(length){const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width);for(pt.x=getAlignedX(this,options.titleAlign,options),ctx.textAlign=rtlHelper.textAlign(options.titleAlign),ctx.textBaseline="middle",titleFont=toFont(options.titleFont),titleSpacing=options.titleSpacing,ctx.fillStyle=options.titleColor,ctx.font=titleFont.string,i=0;i0!==v)?(ctx.beginPath(),ctx.fillStyle=options.multiKeyBackground,addRoundedRectPath(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius}),ctx.fill(),ctx.stroke(),ctx.fillStyle=labelColors.backgroundColor,ctx.beginPath(),addRoundedRectPath(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius}),ctx.fill()):(ctx.fillStyle=options.multiKeyBackground,ctx.fillRect(outerX,colorY,boxWidth,boxHeight),ctx.strokeRect(outerX,colorY,boxWidth,boxHeight),ctx.fillStyle=labelColors.backgroundColor,ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2))}ctx.fillStyle=this.labelTextColors[i]}drawBody(pt,ctx,options){const{body}=this,{bodySpacing,bodyAlign,displayColors,boxHeight,boxWidth,boxPadding}=options,bodyFont=toFont(options.bodyFont);let bodyLineHeight=bodyFont.lineHeight,xLinePadding=0;const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width),fillLineOfText=__name(function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyLineHeight/2),pt.y+=bodyLineHeight+bodySpacing},"fillLineOfText"),bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign);let bodyItem,textColor,lines,i,j,ilen,jlen;for(ctx.textAlign=bodyAlign,ctx.textBaseline="middle",ctx.font=bodyFont.string,pt.x=getAlignedX(this,bodyAlignForCalculation,options),ctx.fillStyle=options.bodyColor,each(this.beforeBody,fillLineOfText),xLinePadding=displayColors&&"right"!==bodyAlignForCalculation?"center"===bodyAlign?boxWidth/2+boxPadding:boxWidth+2+boxPadding:0,i=0,ilen=body.length;i0&&ctx.stroke()}_updateAnimationTarget(options){const chart=this.chart,anims=this.$animations,animX=anims&&anims.x,animY=anims&&anims.y;if(animX||animY){const position=positioners[options.position].call(this,this._active,this._eventPosition);if(!position)return;const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,this._size),alignment=determineAlignment(chart,options,positionAndSize),point=getBackgroundPoint(options,positionAndSize,alignment,chart);(animX._to!==point.x||animY._to!==point.y)&&(this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,this.width=size.width,this.height=size.height,this.caretX=position.x,this.caretY=position.y,this._resolveAnimations().update(this,point))}}_willRender(){return!!this.opacity}draw(ctx){const options=this.options.setContext(this.getContext());let opacity=this.opacity;if(!opacity)return;this._updateAnimationTarget(options);const tooltipSize={width:this.width,height:this.height},pt={x:this.x,y:this.y};opacity=Math.abs(opacity)<.001?0:opacity;const padding=toPadding(options.padding),hasTooltipContent=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;options.enabled&&hasTooltipContent&&(ctx.save(),ctx.globalAlpha=opacity,this.drawBackground(pt,ctx,tooltipSize,options),overrideTextDirection(ctx,options.textDirection),pt.y+=padding.top,this.drawTitle(pt,ctx,options),this.drawBody(pt,ctx,options),this.drawFooter(pt,ctx,options),restoreTextDirection(ctx,options.textDirection),ctx.restore())}getActiveElements(){return this._active||[]}setActiveElements(activeElements,eventPosition){const lastActive=this._active,active=activeElements.map(({datasetIndex,index:index2})=>{const meta=this.chart.getDatasetMeta(datasetIndex);if(!meta)throw new Error("Cannot find a dataset at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}}),changed=!_elementsEqual(lastActive,active),positionChanged=this._positionChanged(active,eventPosition);(changed||positionChanged)&&(this._active=active,this._eventPosition=eventPosition,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,replay,inChartArea=!0){if(replay&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const options=this.options,lastActive=this._active||[],active=this._getActiveElements(e,lastActive,replay,inChartArea),positionChanged=this._positionChanged(active,e),changed=replay||!_elementsEqual(active,lastActive)||positionChanged;return changed&&(this._active=active,(options.enabled||options.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,replay))),changed}_getActiveElements(e,lastActive,replay,inChartArea){const options=this.options;if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;const active=this.chart.getElementsAtEventForMode(e,options.mode,options,replay);return options.reverse&&active.reverse(),active}_positionChanged(active,e){const{caretX,caretY,options}=this,position=positioners[options.position].call(this,active,e);return!1!==position&&(caretX!==position.x||caretY!==position.y)}}__name(Tooltip,"Tooltip"),Tooltip.positioners=positioners;var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(chart,_args,options){options&&(chart.tooltip=new Tooltip({chart,options}))},beforeUpdate(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},reset(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},afterDraw(chart){const tooltip=chart.tooltip;if(tooltip&&tooltip._willRender()){const args={tooltip};if(!1===chart.notifyPlugins("beforeTooltipDraw",args))return;tooltip.draw(chart.ctx),chart.notifyPlugins("afterTooltipDraw",args)}},afterEvent(chart,args){if(chart.tooltip){const useFinalPosition=args.replay;chart.tooltip.handleEvent(args.event,useFinalPosition,args.inChartArea)&&(args.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:(ctx,opts)=>opts.bodyFont.size,boxWidth:(ctx,opts)=>opts.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:noop,title(tooltipItems){if(tooltipItems.length>0){const item=tooltipItems[0],labels=item.chart.data.labels,labelCount=labels?labels.length:0;if(this&&this.options&&"dataset"===this.options.mode)return item.dataset.label||"";if(item.label)return item.label;if(labelCount>0&&item.dataIndex"filter"!==name&&"itemSort"!==name&&"external"!==name,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=__name((labels,raw,index2,addedLabels)=>("string"==typeof raw?(index2=labels.push(raw)-1,addedLabels.unshift({index:index2,label:raw})):isNaN(raw)&&(index2=null),index2),"addIfString");function findOrAddLabel(labels,raw,index2,addedLabels){const first=labels.indexOf(raw);if(-1===first)return addIfString(labels,raw,index2,addedLabels);return first!==labels.lastIndexOf(raw)?index2:first}__name(findOrAddLabel,"findOrAddLabel");const validIndex=__name((index2,max)=>null===index2?null:_limitValue(Math.round(index2),0,max),"validIndex");class CategoryScale extends Scale{constructor(cfg){super(cfg),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(scaleOptions){const added=this._addedLabels;if(added.length){const labels=this.getLabels();for(const{index:index2,label}of added)labels[index2]===label&&labels.splice(index2,1);this._addedLabels=[]}super.init(scaleOptions)}parse(raw,index2){if(isNullOrUndef(raw))return null;const labels=this.getLabels();return index2=isFinite(index2)&&labels[index2]===raw?index2:findOrAddLabel(labels,raw,valueOrDefault(index2,raw),this._addedLabels),validIndex(index2,labels.length-1)}determineDataLimits(){const{minDefined,maxDefined}=this.getUserBounds();let{min,max}=this.getMinMax(!0);"ticks"===this.options.bounds&&(minDefined||(min=0),maxDefined||(max=this.getLabels().length-1)),this.min=min,this.max=max}buildTicks(){const min=this.min,max=this.max,offset=this.options.offset,ticks=[];let labels=this.getLabels();labels=0===min&&max===labels.length-1?labels:labels.slice(min,max+1),this._valueRange=Math.max(labels.length-(offset?0:1),1),this._startValue=this.min-(offset?.5:0);for(let value=min;value<=max;value++)ticks.push({value});return ticks}getLabelForValue(value){const labels=this.getLabels();return value>=0&&valueticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getValueForPixel(pixel){return Math.round(this._startValue+this.getDecimalForPixel(pixel)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(generationOptions,dataRange){const ticks=[],{bounds,step,min,max,precision,count,maxTicks,maxDigits,includeBounds}=generationOptions,unit=step||1,maxSpaces=maxTicks-1,{min:rmin,max:rmax}=dataRange,minDefined=!isNullOrUndef(min),maxDefined=!isNullOrUndef(max),countDefined=!isNullOrUndef(count),minSpacing=(rmax-rmin)/(maxDigits+1);let factor,niceMin,niceMax,numSpaces,spacing=niceNum((rmax-rmin)/maxSpaces/unit)*unit;if(spacing<1e-14&&!minDefined&&!maxDefined)return[{value:rmin},{value:rmax}];numSpaces=Math.ceil(rmax/spacing)-Math.floor(rmin/spacing),numSpaces>maxSpaces&&(spacing=niceNum(numSpaces*spacing/maxSpaces/unit)*unit),isNullOrUndef(precision)||(factor=Math.pow(10,precision),spacing=Math.ceil(spacing*factor)/factor),"ticks"===bounds?(niceMin=Math.floor(rmin/spacing)*spacing,niceMax=Math.ceil(rmax/spacing)*spacing):(niceMin=rmin,niceMax=rmax),minDefined&&maxDefined&&step&&almostWhole((max-min)/step,spacing/1e3)?(numSpaces=Math.round(Math.min((max-min)/spacing,maxTicks)),spacing=(max-min)/numSpaces,niceMin=min,niceMax=max):countDefined?(niceMin=minDefined?min:niceMin,niceMax=maxDefined?max:niceMax,numSpaces=count-1,spacing=(niceMax-niceMin)/numSpaces):(numSpaces=(niceMax-niceMin)/spacing,numSpaces=almostEquals(numSpaces,Math.round(numSpaces),spacing/1e3)?Math.round(numSpaces):Math.ceil(numSpaces));const decimalPlaces=Math.max(_decimalPlaces(spacing),_decimalPlaces(niceMin));factor=Math.pow(10,isNullOrUndef(precision)?decimalPlaces:precision),niceMin=Math.round(niceMin*factor)/factor,niceMax=Math.round(niceMax*factor)/factor;let j=0;for(minDefined&&(includeBounds&&niceMin!==min?(ticks.push({value:min}),niceMinmin=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax");if(beginAtZero){const minSign=sign(min),maxSign=sign(max);minSign<0&&maxSign<0?setMax(0):minSign>0&&maxSign>0&&setMin(0)}if(min===max){let offset=1;(max>=Number.MAX_SAFE_INTEGER||min<=Number.MIN_SAFE_INTEGER)&&(offset=Math.abs(.05*max)),setMax(max+offset),beginAtZero||setMin(min-offset)}this.min=min,this.max=max}getTickLimit(){const tickOpts=this.options.ticks;let maxTicks,{maxTicksLimit,stepSize}=tickOpts;return stepSize?(maxTicks=Math.ceil(this.max/stepSize)-Math.floor(this.min/stepSize)+1,maxTicks>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`),maxTicks=1e3)):(maxTicks=this.computeTickLimit(),maxTicksLimit=maxTicksLimit||11),maxTicksLimit&&(maxTicks=Math.min(maxTicksLimit,maxTicks)),maxTicks}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const opts=this.options,tickOpts=opts.ticks;let maxTicks=this.getTickLimit();maxTicks=Math.max(2,maxTicks);const ticks=generateTicks$1({maxTicks,bounds:opts.bounds,min:opts.min,max:opts.max,precision:tickOpts.precision,step:tickOpts.stepSize,count:tickOpts.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:tickOpts.minRotation||0,includeBounds:!1!==tickOpts.includeBounds},this._range||this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}configure(){const ticks=this.ticks;let start=this.min,end=this.max;if(super.configure(),this.options.offset&&ticks.length){const offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset,end+=offset}this._startValue=start,this._endValue=end,this._valueRange=end-start}getLabelForValue(value){return formatNumber(value,this.chart.options.locale,this.options.ticks.format)}}__name(LinearScaleBase,"LinearScaleBase");class LinearScale extends LinearScaleBase{determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?min:0,this.max=isNumberFinite(max)?max:1,this.handleTickRangeOptions()}computeTickLimit(){const horizontal=this.isHorizontal(),length=horizontal?this.width:this.height,minRotation=toRadians(this.options.ticks.minRotation),ratio=(horizontal?Math.sin(minRotation):Math.cos(minRotation))||.001,tickFont=this._resolveTickFontOptions(0);return Math.ceil(length/Math.min(40,tickFont.lineHeight/ratio))}getPixelForValue(value){return null===value?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getValueForPixel(pixel){return this._startValue+this.getDecimalForPixel(pixel)*this._valueRange}}function isMajor(tickVal){return tickVal/Math.pow(10,Math.floor(log10(tickVal)))==1}function generateTicks(generationOptions,dataRange){const endExp=Math.floor(log10(dataRange.max)),endSignificand=Math.ceil(dataRange.max/Math.pow(10,endExp)),ticks=[];let tickVal=finiteOrDefault(generationOptions.min,Math.pow(10,Math.floor(log10(dataRange.min)))),exp=Math.floor(log10(tickVal)),significand=Math.floor(tickVal/Math.pow(10,exp)),precision=exp<0?Math.pow(10,Math.abs(exp)):1;do{ticks.push({value:tickVal,major:isMajor(tickVal)}),++significand,10===significand&&(significand=1,++exp,precision=exp>=0?1:precision),tickVal=Math.round(significand*Math.pow(10,exp)*precision)/precision}while(exp0?value:null;this._zero=!0}determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?Math.max(0,min):null,this.max=isNumberFinite(max)?Math.max(0,max):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined,maxDefined}=this.getUserBounds();let min=this.min,max=this.max;const setMin=__name(v=>min=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax"),exp=__name((v,m)=>Math.pow(10,Math.floor(log10(v))+m),"exp");min===max&&(min<=0?(setMin(1),setMax(10)):(setMin(exp(min,-1)),setMax(exp(max,1)))),min<=0&&setMin(exp(max,-1)),max<=0&&setMax(exp(min,1)),this._zero&&this.min!==this._suggestedMin&&min===exp(this.min,0)&&setMin(exp(min,-1)),this.min=min,this.max=max}buildTicks(){const opts=this.options,ticks=generateTicks({min:this._userMin,max:this._userMax},this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}getLabelForValue(value){return void 0===value?"0":formatNumber(value,this.chart.options.locale,this.options.ticks.format)}configure(){const start=this.min;super.configure(),this._startValue=log10(start),this._valueRange=log10(this.max)-log10(start)}getPixelForValue(value){return(void 0===value||0===value)&&(value=this.min),null===value||isNaN(value)?NaN:this.getPixelForDecimal(value===this.min?0:(log10(value)-this._startValue)/this._valueRange)}getValueForPixel(pixel){const decimal=this.getDecimalForPixel(pixel);return Math.pow(10,this._startValue+decimal*this._valueRange)}}function getTickBackdropHeight(opts){const tickOpts=opts.ticks;if(tickOpts.display&&opts.display){const padding=toPadding(tickOpts.backdropPadding);return valueOrDefault(tickOpts.font&&tickOpts.font.size,defaults.font.size)+padding.height}return 0}function measureLabelSize(ctx,font,label){return label=isArray(label)?label:[label],{w:_longestText(ctx,font.string,label),h:label.length*font.lineHeight}}function determineLimits(angle,pos,size,min,max){return angle===min||angle===max?{start:pos-size/2,end:pos+size/2}:anglemax?{start:pos-size,end:pos}:{start:pos,end:pos+size}}function fitWithPointLabels(scale){const orig={l:scale.left+scale._padding.left,r:scale.right-scale._padding.right,t:scale.top+scale._padding.top,b:scale.bottom-scale._padding.bottom},limits=Object.assign({},orig),labelSizes=[],padding=[],valueCount=scale._pointLabels.length,pointLabelOpts=scale.options.pointLabels,additionalAngle=pointLabelOpts.centerPointLabels?PI/valueCount:0;for(let i=0;iorig.r&&(x=(hLimits.end-orig.r)/sin,limits.r=Math.max(limits.r,orig.r+x)),vLimits.startorig.b&&(y=(vLimits.end-orig.b)/cos,limits.b=Math.max(limits.b,orig.b+y))}function buildPointLabelItems(scale,labelSizes,padding){const items=[],valueCount=scale._pointLabels.length,opts=scale.options,extra=getTickBackdropHeight(opts)/2,outerDistance=scale.drawingArea,additionalAngle=opts.pointLabels.centerPointLabels?PI/valueCount:0;for(let i=0;i270||angle<90)&&(y-=h),y}function drawPointLabels(scale,labelCount){const{ctx,options:{pointLabels}}=scale;for(let i=labelCount-1;i>=0;i--){const optsAtIndex=pointLabels.setContext(scale.getPointLabelContext(i)),plFont=toFont(optsAtIndex.font),{x,y,textAlign,left,top,right,bottom}=scale._pointLabelItems[i],{backdropColor}=optsAtIndex;if(!isNullOrUndef(backdropColor)){const borderRadius=toTRBLCorners(optsAtIndex.borderRadius),padding=toPadding(optsAtIndex.backdropPadding);ctx.fillStyle=backdropColor;const backdropLeft=left-padding.left,backdropTop=top-padding.top,backdropWidth=right-left+padding.width,backdropHeight=bottom-top+padding.height;Object.values(borderRadius).some(v=>0!==v)?(ctx.beginPath(),addRoundedRectPath(ctx,{x:backdropLeft,y:backdropTop,w:backdropWidth,h:backdropHeight,radius:borderRadius}),ctx.fill()):ctx.fillRect(backdropLeft,backdropTop,backdropWidth,backdropHeight)}renderText(ctx,scale._pointLabels[i],x,y+plFont.lineHeight/2,plFont,{color:optsAtIndex.color,textAlign,textBaseline:"middle"})}}function pathRadiusLine(scale,radius,circular,labelCount){const{ctx}=scale;if(circular)ctx.arc(scale.xCenter,scale.yCenter,radius,0,TAU);else{let pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(let i=1;i{const label=callback(this.options.pointLabels.callback,[value,index2],this);return label||0===label?label:""}).filter((v,i)=>this.chart.getDataVisibility(i))}fit(){const opts=this.options;opts.display&&opts.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(leftMovement,rightMovement,topMovement,bottomMovement){this.xCenter+=Math.floor((leftMovement-rightMovement)/2),this.yCenter+=Math.floor((topMovement-bottomMovement)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(leftMovement,rightMovement,topMovement,bottomMovement))}getIndexAngle(index2){return _normalizeAngle(index2*(TAU/(this._pointLabels.length||1))+toRadians(this.options.startAngle||0))}getDistanceFromCenterForValue(value){if(isNullOrUndef(value))return NaN;const scalingFactor=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-value)*scalingFactor:(value-this.min)*scalingFactor}getValueForDistanceFromCenter(distance){if(isNullOrUndef(distance))return NaN;const scaledDistance=distance/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-scaledDistance:this.min+scaledDistance}getPointLabelContext(index2){const pointLabels=this._pointLabels||[];if(index2>=0&&index2{if(0!==index2){offset=this.getDistanceFromCenterForValue(tick.value);drawRadiusLine(this,grid.setContext(this.getContext(index2-1)),offset,labelCount)}}),angleLines.display){for(ctx.save(),i=labelCount-1;i>=0;i--){const optsAtIndex=angleLines.setContext(this.getPointLabelContext(i)),{color:color2,lineWidth}=optsAtIndex;!lineWidth||!color2||(ctx.lineWidth=lineWidth,ctx.strokeStyle=color2,ctx.setLineDash(optsAtIndex.borderDash),ctx.lineDashOffset=optsAtIndex.borderDashOffset,offset=this.getDistanceFromCenterForValue(opts.ticks.reverse?this.min:this.max),position=this.getPointPosition(i,offset),ctx.beginPath(),ctx.moveTo(this.xCenter,this.yCenter),ctx.lineTo(position.x,position.y),ctx.stroke())}ctx.restore()}}drawBorder(){}drawLabels(){const ctx=this.ctx,opts=this.options,tickOpts=opts.ticks;if(!tickOpts.display)return;const startAngle=this.getIndexAngle(0);let offset,width;ctx.save(),ctx.translate(this.xCenter,this.yCenter),ctx.rotate(startAngle),ctx.textAlign="center",ctx.textBaseline="middle",this.ticks.forEach((tick,index2)=>{if(0===index2&&!opts.reverse)return;const optsAtIndex=tickOpts.setContext(this.getContext(index2)),tickFont=toFont(optsAtIndex.font);if(offset=this.getDistanceFromCenterForValue(this.ticks[index2].value),optsAtIndex.showLabelBackdrop){ctx.font=tickFont.string,width=ctx.measureText(tick.label).width,ctx.fillStyle=optsAtIndex.backdropColor;const padding=toPadding(optsAtIndex.backdropPadding);ctx.fillRect(-width/2-padding.left,-offset-tickFont.size/2-padding.top,width+padding.width,tickFont.size+padding.height)}renderText(ctx,tick.label,0,-offset,tickFont,{color:optsAtIndex.color})}),ctx.restore()}drawTitle(){}}__name(RadialLinearScale,"RadialLinearScale"),RadialLinearScale.id="radialLinear",RadialLinearScale.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:label=>label,padding:5,centerPointLabels:!1}},RadialLinearScale.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},RadialLinearScale.descriptors={angleLines:{_fallback:"grid"}};const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(a,b){return a-b}function parse(scale,input){if(isNullOrUndef(input))return null;const adapter=scale._adapter,{parser,round:round2,isoWeekday}=scale._parseOpts;let value=input;return"function"==typeof parser&&(value=parser(value)),isNumberFinite(value)||(value="string"==typeof parser?adapter.parse(value,parser):adapter.parse(value)),null===value?null:(round2&&(value="week"!==round2||!isNumber(isoWeekday)&&!0!==isoWeekday?adapter.startOf(value,round2):adapter.startOf(value,"isoWeek",isoWeekday)),+value)}function determineUnitForAutoTicks(minUnit,min,max,capacity){const ilen=UNITS.length;for(let i=UNITS.indexOf(minUnit);i=UNITS.indexOf(minUnit);i--){const unit=UNITS[i];if(INTERVALS[unit].common&&scale._adapter.diff(max,min,unit)>=numTicks-1)return unit}return UNITS[minUnit?UNITS.indexOf(minUnit):0]}function determineMajorUnit(unit){for(let i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i=time?timestamps[lo]:timestamps[hi]]=!0}}else ticks[time]=!0}function setMajorTicks(scale,ticks,map2,majorUnit){const adapter=scale._adapter,first=+adapter.startOf(ticks[0].value,majorUnit),last=ticks[ticks.length-1].value;let major,index2;for(major=first;major<=last;major=+adapter.add(major,1,majorUnit))index2=map2[major],index2>=0&&(ticks[index2].major=!0);return ticks}function ticksFromTimestamps(scale,values,majorUnit){const ticks=[],map2={},ilen=values.length;let i,value;for(i=0;i+tick.value))}initOffsets(timestamps){let first,last,start=0,end=0;this.options.offset&×tamps.length&&(first=this.getDecimalForValue(timestamps[0]),start=1===timestamps.length?1-first:(this.getDecimalForValue(timestamps[1])-first)/2,last=this.getDecimalForValue(timestamps[timestamps.length-1]),end=1===timestamps.length?last:(last-this.getDecimalForValue(timestamps[timestamps.length-2]))/2);const limit=timestamps.length<3?.5:.25;start=_limitValue(start,0,limit),end=_limitValue(end,0,limit),this._offsets={start,end,factor:1/(start+1+end)}}_generate(){const adapter=this._adapter,min=this.min,max=this.max,options=this.options,timeOpts=options.time,minor=timeOpts.unit||determineUnitForAutoTicks(timeOpts.minUnit,min,max,this._getLabelCapacity(min)),stepSize=valueOrDefault(timeOpts.stepSize,1),weekday="week"===minor&&timeOpts.isoWeekday,hasWeekday=isNumber(weekday)||!0===weekday,ticks={};let time,count,first=min;if(hasWeekday&&(first=+adapter.startOf(first,"isoWeek",weekday)),first=+adapter.startOf(first,hasWeekday?"day":minor),adapter.diff(max,min,minor)>1e5*stepSize)throw new Error(min+" and "+max+" are too far apart with stepSize of "+stepSize+" "+minor);const timestamps="data"===options.ticks.source&&this.getDataTimestamps();for(time=first,count=0;timea-b).map(x=>+x)}getLabelForValue(value){const adapter=this._adapter,timeOpts=this.options.time;return timeOpts.tooltipFormat?adapter.format(value,timeOpts.tooltipFormat):adapter.format(value,timeOpts.displayFormats.datetime)}_tickFormatFunction(time,index2,ticks,format){const options=this.options,formats=options.time.displayFormats,unit=this._unit,majorUnit=this._majorUnit,minorFormat=unit&&formats[unit],majorFormat=majorUnit&&formats[majorUnit],tick=ticks[index2],major=majorUnit&&majorFormat&&tick&&tick.major,label=this._adapter.format(time,format||(major?majorFormat:minorFormat)),formatter=options.ticks.callback;return formatter?callback(formatter,[label,index2,ticks],this):label}generateTickLabels(ticks){let i,ilen,tick;for(i=0,ilen=ticks.length;i0?capacity:1}getDataTimestamps(){let i,ilen,timestamps=this._cache.data||[];if(timestamps.length)return timestamps;const metas=this.getMatchingVisibleMetas();if(this._normalized&&metas.length)return this._cache.data=metas[0].controller.getAllParsedValues(this);for(i=0,ilen=metas.length;i=table[lo].pos&&val<=table[hi].pos&&({lo,hi}=_lookupByKey(table,"pos",val)),({pos:prevSource,time:prevTarget}=table[lo]),({pos:nextSource,time:nextTarget}=table[hi])):(val>=table[lo].time&&val<=table[hi].time&&({lo,hi}=_lookupByKey(table,"time",val)),({time:prevSource,pos:prevTarget}=table[lo]),({time:nextSource,pos:nextTarget}=table[hi]));const span=nextSource-prevSource;return span?prevTarget+(nextTarget-prevTarget)*(val-prevSource)/span:prevTarget}__name(TimeScale,"TimeScale"),TimeScale.id="time",TimeScale.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}},__name(chart_esm_interpolate,"chart_esm_interpolate");class TimeSeriesScale extends TimeScale{constructor(props){super(props),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const timestamps=this._getTimestampsForTable(),table=this._table=this.buildLookupTable(timestamps);this._minPos=chart_esm_interpolate(table,this.min),this._tableRange=chart_esm_interpolate(table,this.max)-this._minPos,super.initOffsets(timestamps)}buildLookupTable(timestamps){const{min,max}=this,items=[],table=[];let i,ilen,prev,curr,next;for(i=0,ilen=timestamps.length;i=min&&curr<=max&&items.push(curr);if(items.length<2)return[{time:min,pos:0},{time:max,pos:1}];for(i=0,ilen=items.length;i +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +angular-datatables +MIT +The MIT License + +Copyright (c) Louis Lin (l-lin.github.io) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +ansi-styles +MIT +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +array-flatten +MIT +The MIT License (MIT) + +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +body-parser +MIT +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +boolbase +ISC + +bytes +MIT +(The MIT License) + +Copyright (c) 2012-2014 TJ Holowaychuk +Copyright (c) 2015 Jed Watson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +call-bind +MIT +MIT License + +Copyright (c) 2020 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +chalk +MIT +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +chart.js +MIT +The MIT License (MIT) + +Copyright (c) 2014-2022 Chart.js Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +color-convert +MIT +Copyright (c) 2011-2016 Heather Arthur + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +color-name +MIT +The MIT License (MIT) +Copyright (c) 2015 Dmitry Ivanov + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +content-disposition +MIT +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +content-type +MIT +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +cookie +MIT +(The MIT License) + +Copyright (c) 2012-2014 Roman Shtylman +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +cookie-signature +MIT + +critters +Apache-2.0 + +css-select +BSD-2-Clause +Copyright (c) Felix Böhm +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +css-what +BSD-2-Clause +Copyright (c) Felix Böhm +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +debug +MIT +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +depd +MIT +(The MIT License) + +Copyright (c) 2014-2018 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +destroy +MIT + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright (c) 2015-2022 Douglas Christopher Wilson doug@somethingdoug.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +dom-serializer +MIT +License + +(The MIT License) + +Copyright (c) 2014 The cheeriojs contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +domelementtype +BSD-2-Clause +Copyright (c) Felix Böhm +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +domhandler +BSD-2-Clause +Copyright (c) Felix Böhm +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +domino +BSD-2-Clause +Copyright (c) 2011 The Mozilla Foundation. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +domutils +BSD-2-Clause +Copyright (c) Felix Böhm +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ee-first +MIT + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +encodeurl +MIT +(The MIT License) + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +entities +BSD-2-Clause +Copyright (c) Felix Böhm +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +escape-html +MIT +(The MIT License) + +Copyright (c) 2012-2013 TJ Holowaychuk +Copyright (c) 2015 Andreas Lubbe +Copyright (c) 2015 Tiancheng "Timothy" Gu + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +etag +MIT +(The MIT License) + +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +express +MIT +(The MIT License) + +Copyright (c) 2009-2014 TJ Holowaychuk +Copyright (c) 2013-2014 Roman Shtylman +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +finalhandler +MIT +(The MIT License) + +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +firebase/analytics + +firebase/app + +firebase/app-check + +firebase/compat/app + +firebase/compat/auth + +firebase/compat/firestore + +firebase/compat/storage + +firebase/messaging + +firebase/remote-config + +forwarded +MIT +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +fresh +MIT +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2016-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +function-bind +MIT +Copyright (c) 2013 Raynos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + + +get-intrinsic +MIT +MIT License + +Copyright (c) 2020 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +google-libphonenumber +(MIT AND Apache-2.0) +This package is licensed under MIT: + +The MIT License (MIT) + +Copyright (c) 2015 Rui Marinho + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------- + +The bundled Google Closure Library is licensed under Apache 2.0: + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + +has +MIT +Copyright (c) 2013 Thiago de Arruda + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + +has-flag +MIT +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +has-symbols +MIT +MIT License + +Copyright (c) 2016 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +http-errors +MIT + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +iconv-lite +MIT +Copyright (c) 2011 Alexander Shtuchkin + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +idb +ISC +ISC License (ISC) +Copyright (c) 2016, Jake Archibald + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +inherits +ISC +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + + +ipaddr.js +MIT +Copyright (C) 2011-2017 whitequark + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +lodash-es +MIT +Copyright OpenJS Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. + + +lodash.camelcase +MIT +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. + + +long +Apache-2.0 + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +media-typer +MIT +(The MIT License) + +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +merge-descriptors +MIT +(The MIT License) + +Copyright (c) 2013 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +methods +MIT +(The MIT License) + +Copyright (c) 2013-2014 TJ Holowaychuk +Copyright (c) 2015-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +mime +MIT +The MIT License (MIT) + +Copyright (c) 2010 Benjamin Thomas, Robert Kieffer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +mime-db +MIT +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +mime-types +MIT +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +ms +MIT +The MIT License (MIT) + +Copyright (c) 2016 Zeit, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +nanoid +MIT +The MIT License (MIT) + +Copyright 2017 Andrey Sitnik + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +negotiator +MIT +(The MIT License) + +Copyright (c) 2012-2014 Federico Romero +Copyright (c) 2012-2014 Isaac Z. Schlueter +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +ng2-charts +ISC + +ngx-bootstrap +MIT +The MIT License (MIT) + +Copyright (c) 2015-2017 Valor Software +Copyright (c) 2015-2017 Dmitriy Shekhovtsov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + +ngx-image-cropper +MIT +MIT License + +Copyright (c) 2019 Martijn Willekens + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +ngx-intl-tel-input +MIT +MIT License + +Copyright (c) 2018 webcat12345 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +node-fetch +MIT +The MIT License (MIT) + +Copyright (c) 2016 David Frank + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + +nth-check +BSD-2-Clause +Copyright (c) Felix Böhm +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +object-inspect +MIT +MIT License + +Copyright (c) 2013 James Halliday + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +on-finished +MIT +(The MIT License) + +Copyright (c) 2013 Jonathan Ong +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +parse5 +MIT +Copyright (c) 2013-2019 Ivan Nikulin (ifaaan@gmail.com, https://github.com/inikulin) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +parse5-htmlparser2-tree-adapter +MIT +Copyright (c) 2013-2019 Ivan Nikulin (ifaaan@gmail.com, https://github.com/inikulin) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +parseurl +MIT + +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +path-to-regexp +MIT +The MIT License (MIT) + +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +picocolors +ISC +ISC License + +Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +postcss +MIT +The MIT License (MIT) + +Copyright 2013 Andrey Sitnik + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +pretty-bytes +MIT +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +protobufjs +BSD-3-Clause +This license applies to all parts of protobuf.js except those files +either explicitly including or referencing a different license or +located in a directory containing a different LICENSE file. + +--- + +Copyright (c) 2016, Daniel Wirtz All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of its author, nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +Code generated by the command line utilities is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. + + +proxy-addr +MIT +(The MIT License) + +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +qs +BSD-3-Clause +BSD 3-Clause License + +Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +range-parser +MIT +(The MIT License) + +Copyright (c) 2012-2014 TJ Holowaychuk +Copyright (c) 2015-2016 Douglas Christopher Wilson +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +rxjs +Apache-2.0 + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + +safe-buffer +MIT +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +safer-buffer +MIT +MIT License + +Copyright (c) 2018 Nikita Skovoroda + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +send +MIT +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +serve-static +MIT +(The MIT License) + +Copyright (c) 2010 Sencha Inc. +Copyright (c) 2011 LearnBoost +Copyright (c) 2011 TJ Holowaychuk +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +setprototypeof +ISC +Copyright (c) 2015, Wes Todd + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +side-channel +MIT +MIT License + +Copyright (c) 2019 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +source-map-js +BSD-3-Clause + +Copyright (c) 2009-2011, Mozilla Foundation and contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the names of the Mozilla Foundation nor the names of project + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +statuses +MIT + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +supports-color +MIT +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +toidentifier +MIT +MIT License + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +tr46 +MIT + +tslib +0BSD +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +type-is +MIT +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +unpipe +MIT +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +utils-merge +MIT +The MIT License (MIT) + +Copyright (c) 2013-2017 Jared Hanson + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +vary +MIT +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +webidl-conversions +BSD-2-Clause +# The BSD 2-Clause License + +Copyright (c) 2014, Domenic Denicola +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +whatwg-url +MIT +The MIT License (MIT) + +Copyright (c) 2015–2016 Sebastian Mayr + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +xhr2 +MIT +Copyright (c) 2013 Victor Costan + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +zone.js +MIT +The MIT License + +Copyright (c) 2010-2022 Google LLC. https://angular.io/license + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/dist/new-rdv-app/server/642.js b/dist/new-rdv-app/server/642.js new file mode 100644 index 0000000..fc23c71 --- /dev/null +++ b/dist/new-rdv-app/server/642.js @@ -0,0 +1 @@ +"use strict";var __defProp=Object.defineProperty,__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});exports.id=642,exports.ids=[642],exports.modules={90050:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{var RendezvousStates,RendezvousStates2;__webpack_require__.d(__webpack_exports__,{R:()=>RendezvousStates}),(RendezvousStates2=RendezvousStates||(RendezvousStates={})).PENDING="PENDING",RendezvousStates2.APPROVED="APPROVED",RendezvousStates2.FINISHED="FINISHED",RendezvousStates2.CANCELED="CANCELED",RendezvousStates2.DELETED="DELETED"},93642:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{DashboardModule:()=>DashboardModule});var common=__webpack_require__(69808),fesm2015_forms=__webpack_require__(93075),auth_guard=__webpack_require__(36471),router=__webpack_require__(74202),core=__webpack_require__(5e3),icon=__webpack_require__(25245),asyncToGenerator=__webpack_require__(15861),auth_service=__webpack_require__(16518),users_service=__webpack_require__(94961),translating_service=__webpack_require__(57694),table_component=__webpack_require__(6912),edit_profile_component=__webpack_require__(42824),chart_esm=__webpack_require__(34393),ngx_translate_core=__webpack_require__(81981);class ChartComponent{constructor(){this.bgColor="#ffffff"}ngOnChanges(changes){changes.chartY&&this.updateChart(this.chartY)}ngOnInit(){}ngAfterViewInit(){this.chart=this.loadChart()}loadChart(){return this.chartConfig(this.chartID,this.chartX,this.chartY,this.chartTitle,this.chartType)}chartConfig(id,x,y,title,tp){const ctx=document.getElementById(id).getContext("2d");return new chart_esm.kL(ctx,{type:tp,data:{labels:x,datasets:[{label:"",data:y,backgroundColor:["rgba(153, 102, 255, 0.2)","rgba(54, 162, 235, 0.2)","rgba(255, 206, 86, 0.2)","rgba(75, 192, 192, 0.2)","rgba(153, 102, 255, 0.2)","rgba(255, 159, 64, 0.2)","rgba(255, 99, 132, 0.2)","rgba(54, 162, 235, 0.2)","rgba(255, 206, 86, 0.2)","rgba(75, 192, 192, 0.2)","rgba(153, 102, 255, 0.2)","rgba(255, 159, 64, 0.2)"],borderColor:["rgba(153, 102, 255, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)","rgba(153, 102, 255, 1)","rgba(255, 159, 64, 1)","rgba(255, 99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)","rgba(153, 102, 255, 1)","rgba(255, 159, 64, 1)"],borderWidth:1,borderRadius:5}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!0,text:title,font:{size:25}}}}})}updateChart(value){this.chart&&(this.chart.data.datasets.map(val=>val.data=value),this.chart.update())}exportChart(){var _a,_b;const canvas=document.getElementById(this.chartID),destinationCanvas=document.createElement("canvas");destinationCanvas.width=canvas.width,destinationCanvas.height=canvas.height;const destCtx=destinationCanvas.getContext("2d");destCtx.fillStyle=this.bgColor,null==destCtx||destCtx.fillRect(0,0,canvas.width,canvas.height),null==destCtx||destCtx.drawImage(canvas,0,0);const a=document.createElement("a");a.href=destinationCanvas.toDataURL(),a.download=null===(_b=null===(_a=this.chart.options.plugins)||void 0===_a?void 0:_a.title)||void 0===_b?void 0:_b.text,a.click()}}function UsersPartComponent_div_1_Template(rf,ctx){if(1&rf){const _r5=core.EpF();core.TgZ(0,"div",5)(1,"app-table",6),core.NdJ("updateInfosEvent",__name(function($event){core.CHM(_r5);const ctx_r4=core.oxw();return core.KtG(ctx_r4.proceedToUpdate($event))},"UsersPartComponent_div_1_Template_app_table_updateInfosEvent_1_listener")),core.qZA()()}if(2&rf){const ctx_r0=core.oxw();core.xp6(1),core.Q6J("tableCols",ctx_r0.usrsCols)("infos",ctx_r0.users)("showBtns",!0)("currentUser",ctx_r0.user)}}function UsersPartComponent_div_2_p_10_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"p",14),core._uU(1),core.qZA()),2&rf){const ctx_r6=core.oxw(2);core.xp6(1),core.Oqu(ctx_r6.updateErrMsg)}}function UsersPartComponent_div_2_Template(rf,ctx){if(1&rf){const _r8=core.EpF();core.TgZ(0,"div",7)(1,"div",8)(2,"div",9),core._uU(3),core.ALo(4,"translate"),core.qZA(),core.TgZ(5,"div",10),core.NdJ("click",__name(function(){core.CHM(_r8);const ctx_r7=core.oxw();return core.KtG(ctx_r7.hideEditProfilePopUp())},"UsersPartComponent_div_2_Template_div_click_5_listener")),core.ALo(6,"translate"),core._uU(7," \xd7 "),core.qZA()(),core.TgZ(8,"div",11)(9,"app-edit-profile",12),core.NdJ("updatedValues",__name(function($event){core.CHM(_r8);const ctx_r9=core.oxw();return core.KtG(ctx_r9.updateProfile($event))},"UsersPartComponent_div_2_Template_app_edit_profile_updatedValues_9_listener")),core.qZA(),core.YNc(10,UsersPartComponent_div_2_p_10_Template,2,1,"p",13),core.qZA()()}if(2&rf){const ctx_r1=core.oxw();core.xp6(3),core.hij(" ",core.lcZ(4,5,"Edit Profile")," "),core.xp6(2),core.s9C("title",core.lcZ(6,7,"Cancel")),core.xp6(4),core.Q6J("profileInfos",ctx_r1.updateUser)("currentUser",ctx_r1.user),core.xp6(1),core.Q6J("ngIf",ctx_r1.updateErrMsg)}}function UsersPartComponent_div_3_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"div",15),core._UZ(1,"app-chart",16),core.ALo(2,"translate"),core.qZA()),2&rf){const ctx_r2=core.oxw();core.xp6(1),core.s9C("chartTitle",core.lcZ(2,5,"New Users Per Month")),core.Q6J("chartX",ctx_r2.months)("chartY",ctx_r2.usrsPerMonth)("chartType","bar")("chartID","usrsChart")}}function UsersPartComponent_div_4_Template(rf,ctx){if(1&rf){const _r11=core.EpF();core.TgZ(0,"div",17),core.NdJ("click",__name(function(){core.CHM(_r11);const ctx_r10=core.oxw();return core.KtG(ctx_r10.hideEditProfilePopUp())},"UsersPartComponent_div_4_Template_div_click_0_listener")),core.qZA()}}__name(ChartComponent,"ChartComponent"),ChartComponent.\u0275fac=__name(function(t){return new(t||ChartComponent)},"ChartComponent_Factory"),ChartComponent.\u0275cmp=core.Xpm({type:ChartComponent,selectors:[["app-chart"]],inputs:{chartID:"chartID",chartX:"chartX",chartY:"chartY",chartTitle:"chartTitle",chartType:"chartType"},features:[core.TTD],decls:12,vars:10,consts:[[1,"chart-container"],[1,"hdr-container"],[2,"display","flex","align-items","center"],[2,"margin-right","7px","white-space","nowrap"],["type","color",1,"bg-color","form-control",3,"ngModel","ngModelChange"],[1,"export-btns",3,"click"],[1,"canva-container"],[1,"chart",3,"id"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),core._uU(4),core.ALo(5,"translate"),core.qZA(),core.TgZ(6,"input",4),core.NdJ("ngModelChange",__name(function($event){return ctx.bgColor=$event},"ChartComponent_Template_input_ngModelChange_6_listener")),core.qZA()(),core.TgZ(7,"button",5),core.NdJ("click",__name(function(){return ctx.exportChart()},"ChartComponent_Template_button_click_7_listener")),core._uU(8),core.ALo(9,"translate"),core.qZA()(),core.TgZ(10,"div",6),core._UZ(11,"canvas",7),core.qZA()()),2&rf&&(core.xp6(4),core.Oqu(core.lcZ(5,6,"Change Background Color ")),core.xp6(2),core.Q6J("ngModel",ctx.bgColor),core.xp6(2),core.hij(" ",core.lcZ(9,8,"Export To Image")," "),core.xp6(3),core.Udp("background-color",ctx.bgColor),core.Q6J("id",ctx.chartID))},"ChartComponent_Template"),dependencies:[fesm2015_forms.Fj,fesm2015_forms.JJ,fesm2015_forms.On,ngx_translate_core.X$],styles:[".chart-container[_ngcontent-%COMP%]{overflow:scroll;overflow-y:hidden;padding:5px}.hdr-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:11px;border-bottom:1px dotted #000;min-width:500px}.bg-color[_ngcontent-%COMP%]{width:75px;padding:0;cursor:pointer;border:1px solid #191970}.btn-outline-success[_ngcontent-%COMP%]{height:40px;min-width:max-content}.canva-container[_ngcontent-%COMP%]{position:relative;height:70vh;min-width:500px}.chart[_ngcontent-%COMP%]{padding:15px;border-radius:7px}@media screen and (max-width: 650px){.hdr-container[_ngcontent-%COMP%]{display:flex;flex-direction:column-reverse}.btn-outline-success[_ngcontent-%COMP%]{margin-bottom:15px}}"]}),__name(UsersPartComponent_div_1_Template,"UsersPartComponent_div_1_Template"),__name(UsersPartComponent_div_2_p_10_Template,"UsersPartComponent_div_2_p_10_Template"),__name(UsersPartComponent_div_2_Template,"UsersPartComponent_div_2_Template"),__name(UsersPartComponent_div_3_Template,"UsersPartComponent_div_3_Template"),__name(UsersPartComponent_div_4_Template,"UsersPartComponent_div_4_Template");class UsersPartComponent{constructor(authService,usersService,translatingService){this.authService=authService,this.usersService=usersService,this.translatingService=translatingService,this.usrsCols=this.translatingService.getUsersCols(),this.editProfilePopup=!1,this.updateErrMsg="",this.months=this.translatingService.getMonths(),this.showEditProfilePopUp=()=>this.editProfilePopup=!0}ngOnInit(){this.authService.getUser().subscribe(usr=>this.user=usr),this.usersService.getAllUsers().subscribe(values=>{const usrsInEveryMonth=values.map(usr=>new Date(usr.created_at).toLocaleString("en",{month:"short"}));this.usrsPerMonth=this.translatingService.getEngMonths().map(month=>usrsInEveryMonth.filter(val=>val==month).length),this.users=values})}get adminAccess(){return this.authService.canCRUDusers(this.user)}proceedToUpdate(data){this.updateUser=data,this.showEditProfilePopUp()}updateProfile(data){var _this=this;return(0,asyncToGenerator.Z)(function*(){var _a;try{yield _this.usersService.updateProfile(null===(_a=_this.updateUser)||void 0===_a?void 0:_a.uid,data),_this.hideEditProfilePopUp()}catch(error){_this.updateErrMsg=error}})()}hideEditProfilePopUp(){this.editProfilePopup=!1,this.updateErrMsg=""}}__name(UsersPartComponent,"UsersPartComponent"),UsersPartComponent.\u0275fac=__name(function(t){return new(t||UsersPartComponent)(core.Y36(auth_service.e),core.Y36(users_service.f),core.Y36(translating_service.o))},"UsersPartComponent_Factory"),UsersPartComponent.\u0275cmp=core.Xpm({type:UsersPartComponent,selectors:[["app-users-part"]],decls:5,vars:4,consts:[[1,"usrs-part-container"],["class","table-container facebook-style",4,"ngIf"],["class","popup-modal facebook-style",4,"ngIf"],["class","chart-container facebook-style",4,"ngIf"],["class","overlay",3,"click",4,"ngIf"],[1,"table-container","facebook-style"],[3,"tableCols","infos","showBtns","currentUser","updateInfosEvent"],[1,"popup-modal","facebook-style"],[1,"popup-modal-header"],[1,"title"],[1,"close-btn",3,"title","click"],[1,"popup-modal-body"],[3,"profileInfos","currentUser","updatedValues"],["class","text-danger",4,"ngIf"],[1,"text-danger"],[1,"chart-container","facebook-style"],[3,"chartX","chartY","chartType","chartTitle","chartID"],[1,"overlay",3,"click"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0),core.YNc(1,UsersPartComponent_div_1_Template,2,4,"div",1),core.YNc(2,UsersPartComponent_div_2_Template,11,9,"div",2),core.YNc(3,UsersPartComponent_div_3_Template,3,7,"div",3),core.qZA(),core.YNc(4,UsersPartComponent_div_4_Template,1,0,"div",4)),2&rf&&(core.xp6(1),core.Q6J("ngIf",ctx.adminAccess&&ctx.users),core.xp6(1),core.Q6J("ngIf",ctx.editProfilePopup),core.xp6(1),core.Q6J("ngIf",ctx.users&&ctx.usrsPerMonth),core.xp6(1),core.Q6J("ngIf",ctx.editProfilePopup))},"UsersPartComponent_Template"),dependencies:[common.O5,table_component.a,edit_profile_component.z,ChartComponent,ngx_translate_core.X$],styles:[".chart-container[_ngcontent-%COMP%]{padding:15px;max-width:90%;margin-inline:auto}@media screen and (max-width: 950px){.chart-container[_ngcontent-%COMP%]{max-width:100%}}"]});var rendezvous=__webpack_require__(90050),rendezvous_service=__webpack_require__(64286),rdv_form_component=__webpack_require__(70362);function RendezvousComponent_div_1_Template(rf,ctx){if(1&rf){const _r8=core.EpF();core.TgZ(0,"div",5)(1,"div",6)(2,"span",7),core._uU(3),core.ALo(4,"translate"),core.qZA()(),core.TgZ(5,"app-table",8),core.NdJ("updateInfosEvent",__name(function($event){core.CHM(_r8);const ctx_r7=core.oxw();return core.KtG(ctx_r7.showHalfwayPopup($event))},"RendezvousComponent_div_1_Template_app_table_updateInfosEvent_5_listener")),core.ALo(6,"async"),core.qZA()()}if(2&rf){const ctx_r0=core.oxw();core.xp6(3),core.Oqu(core.lcZ(4,5,"Pending Rendezvous")),core.xp6(2),core.Q6J("tableCols",ctx_r0.pendingRDVsCols)("infos",core.lcZ(6,7,ctx_r0.pendingRendezvous))("showBtns",!0)("currentUser",ctx_r0.user)}}function RendezvousComponent_div_3_Template(rf,ctx){if(1&rf){const _r10=core.EpF();core.TgZ(0,"div",5)(1,"div",6)(2,"span",7),core._uU(3),core.ALo(4,"translate"),core.qZA()(),core.TgZ(5,"app-table",8),core.NdJ("updateInfosEvent",__name(function($event){core.CHM(_r10);const ctx_r9=core.oxw();return core.KtG(ctx_r9.showHalfwayPopup($event))},"RendezvousComponent_div_3_Template_app_table_updateInfosEvent_5_listener")),core.ALo(6,"async"),core.qZA()()}if(2&rf){const ctx_r1=core.oxw();core.xp6(3),core.Oqu(core.lcZ(4,5,"Approved Rendezvous")),core.xp6(2),core.Q6J("tableCols",ctx_r1.approvedRDVsCols)("infos",core.lcZ(6,7,ctx_r1.approvedRendezvous))("showBtns",!0)("currentUser",ctx_r1.user)}}function RendezvousComponent_div_5_span_3_Template(rf,ctx){1&rf&&(core.TgZ(0,"span"),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Approve, Update or Delete this Rendezvous")))}function RendezvousComponent_div_5_span_4_Template(rf,ctx){1&rf&&(core.TgZ(0,"span"),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Update, Finish or Cancel this Rendezvous")))}function RendezvousComponent_div_5_p_20_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"p",21),core._uU(1),core.qZA()),2&rf){const ctx_r13=core.oxw(2);core.xp6(1),core.Oqu(ctx_r13.errorMsg)}}function RendezvousComponent_div_5_button_22_Template(rf,ctx){if(1&rf){const _r18=core.EpF();core.TgZ(0,"button",22),core.NdJ("click",__name(function(){core.CHM(_r18);const ctx_r17=core.oxw(2);return core.KtG(ctx_r17.proceedToApproveRDV())},"RendezvousComponent_div_5_button_22_Template_button_click_0_listener")),core._uU(1),core.ALo(2,"translate"),core.qZA()}2&rf&&(core.xp6(1),core.hij(" ",core.lcZ(2,1,"Approve")," "))}function RendezvousComponent_div_5_button_26_Template(rf,ctx){if(1&rf){const _r20=core.EpF();core.TgZ(0,"button",23),core.NdJ("click",__name(function(){core.CHM(_r20);const ctx_r19=core.oxw(2);return core.KtG(ctx_r19.deleteRendezvous())},"RendezvousComponent_div_5_button_26_Template_button_click_0_listener")),core._uU(1),core.ALo(2,"translate"),core.qZA()}2&rf&&(core.xp6(1),core.hij(" ",core.lcZ(2,1,"Delete")," "))}function RendezvousComponent_div_5_button_27_Template(rf,ctx){if(1&rf){const _r22=core.EpF();core.TgZ(0,"button",23),core.NdJ("click",__name(function(){core.CHM(_r22);const ctx_r21=core.oxw(2);return core.KtG(ctx_r21.cancelRendezvous())},"RendezvousComponent_div_5_button_27_Template_button_click_0_listener")),core._uU(1),core.ALo(2,"translate"),core.qZA()}2&rf&&(core.xp6(1),core.hij(" ",core.lcZ(2,1,"Cancel")," "))}__name(RendezvousComponent_div_1_Template,"RendezvousComponent_div_1_Template"),__name(RendezvousComponent_div_3_Template,"RendezvousComponent_div_3_Template"),__name(RendezvousComponent_div_5_span_3_Template,"RendezvousComponent_div_5_span_3_Template"),__name(RendezvousComponent_div_5_span_4_Template,"RendezvousComponent_div_5_span_4_Template"),__name(RendezvousComponent_div_5_p_20_Template,"RendezvousComponent_div_5_p_20_Template"),__name(RendezvousComponent_div_5_button_22_Template,"RendezvousComponent_div_5_button_22_Template"),__name(RendezvousComponent_div_5_button_26_Template,"RendezvousComponent_div_5_button_26_Template"),__name(RendezvousComponent_div_5_button_27_Template,"RendezvousComponent_div_5_button_27_Template");const _c0=__name(function(a0,a1){return{"cols-3":a0,"cols-2":a1}},"_c0");function RendezvousComponent_div_5_Template(rf,ctx){if(1&rf){const _r24=core.EpF();core.TgZ(0,"div",9)(1,"div",10)(2,"div",11),core.YNc(3,RendezvousComponent_div_5_span_3_Template,3,3,"span",12),core.YNc(4,RendezvousComponent_div_5_span_4_Template,3,3,"span",12),core.qZA(),core.TgZ(5,"div",13),core.NdJ("click",__name(function(){core.CHM(_r24);const ctx_r23=core.oxw();return core.KtG(ctx_r23.hidePopup())},"RendezvousComponent_div_5_Template_div_click_5_listener")),core.ALo(6,"translate"),core._uU(7," \xd7 "),core.qZA()(),core.TgZ(8,"div",14)(9,"p",15),core._uU(10),core.ALo(11,"translate"),core.TgZ(12,"strong"),core._uU(13),core.qZA(),core._UZ(14,"br"),core._uU(15),core.ALo(16,"translate"),core.TgZ(17,"strong"),core._uU(18),core.qZA(),core._uU(19,". "),core.qZA(),core.YNc(20,RendezvousComponent_div_5_p_20_Template,2,1,"p",16),core.TgZ(21,"div",17),core.YNc(22,RendezvousComponent_div_5_button_22_Template,3,3,"button",18),core.TgZ(23,"button",19),core.NdJ("click",__name(function(){core.CHM(_r24);const ctx_r25=core.oxw();return core.KtG(ctx_r25.proceedToUpdateRDV())},"RendezvousComponent_div_5_Template_button_click_23_listener")),core._uU(24),core.ALo(25,"translate"),core.qZA(),core.YNc(26,RendezvousComponent_div_5_button_26_Template,3,3,"button",20),core.YNc(27,RendezvousComponent_div_5_button_27_Template,3,3,"button",20),core.qZA()()()}if(2&rf){const ctx_r2=core.oxw();core.xp6(3),core.Q6J("ngIf",ctx_r2.isPending),core.xp6(1),core.Q6J("ngIf",ctx_r2.isApproved),core.xp6(1),core.s9C("title",core.lcZ(6,13,"Cancel")),core.xp6(5),core.hij(" - ",core.lcZ(11,15,"Name:")," "),core.xp6(3),core.Oqu(null==ctx_r2.rdv?null:ctx_r2.rdv.displayName),core.xp6(2),core.hij(" - ",core.lcZ(16,17,"Created in:")," "),core.xp6(3),core.Oqu(null==ctx_r2.rdv?null:ctx_r2.rdv.createdAt),core.xp6(2),core.Q6J("ngIf",ctx_r2.errorMsg),core.xp6(1),core.Q6J("ngClass",core.WLB(21,_c0,ctx_r2.isPending,ctx_r2.isApproved)),core.xp6(1),core.Q6J("ngIf",ctx_r2.isPending),core.xp6(2),core.hij(" ",core.lcZ(25,19,"Update")," "),core.xp6(2),core.Q6J("ngIf",ctx_r2.isPending),core.xp6(1),core.Q6J("ngIf",ctx_r2.isApproved)}}function RendezvousComponent_div_6_p_9_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"p",15),core._uU(1),core.ALo(2,"translate"),core._UZ(3,"br"),core._uU(4),core.ALo(5,"translate"),core.TgZ(6,"strong"),core._uU(7),core.qZA(),core._UZ(8,"br"),core._uU(9),core.ALo(10,"translate"),core.TgZ(11,"strong"),core._uU(12),core.qZA(),core._uU(13,". "),core.qZA()),2&rf){const ctx_r26=core.oxw(2);core.xp6(1),core.hij(" ",core.lcZ(2,5,"Do you want to approve this Rendezvous?"),""),core.xp6(3),core.hij(" - ",core.lcZ(5,7,"Name:")," "),core.xp6(3),core.Oqu(null==ctx_r26.rdv?null:ctx_r26.rdv.displayName),core.xp6(2),core.hij(" - ",core.lcZ(10,9,"Created in:")," "),core.xp6(3),core.Oqu(null==ctx_r26.rdv?null:ctx_r26.rdv.createdAt)}}function RendezvousComponent_div_6_p_16_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"p",21),core._uU(1),core.qZA()),2&rf){const ctx_r28=core.oxw(2);core.xp6(1),core.Oqu(ctx_r28.errorMsg)}}__name(RendezvousComponent_div_5_Template,"RendezvousComponent_div_5_Template"),__name(RendezvousComponent_div_6_p_9_Template,"RendezvousComponent_div_6_p_9_Template"),__name(RendezvousComponent_div_6_p_16_Template,"RendezvousComponent_div_6_p_16_Template");const _c1=__name(function(a0){return{"input-alert":a0}},"_c1");function RendezvousComponent_div_6_Template(rf,ctx){if(1&rf){const _r30=core.EpF();core.TgZ(0,"div",9)(1,"div",10)(2,"div",11),core._uU(3),core.ALo(4,"translate"),core.qZA(),core.TgZ(5,"div",13),core.NdJ("click",__name(function(){core.CHM(_r30);const ctx_r29=core.oxw();return core.KtG(ctx_r29.hidePopup())},"RendezvousComponent_div_6_Template_div_click_5_listener")),core.ALo(6,"translate"),core._uU(7," \xd7 "),core.qZA()(),core.TgZ(8,"div",14),core.YNc(9,RendezvousComponent_div_6_p_9_Template,14,11,"p",24),core.TgZ(10,"label",25),core._uU(11),core.ALo(12,"translate"),core.qZA(),core._UZ(13,"br")(14,"input",26,27),core.YNc(16,RendezvousComponent_div_6_p_16_Template,2,1,"p",16),core.TgZ(17,"div",28)(18,"button",22),core.NdJ("click",__name(function(){core.CHM(_r30);const _r27=core.MAs(15),ctx_r31=core.oxw();return core.KtG(ctx_r31.approveRDV(ctx_r31.rdv,_r27.value))},"RendezvousComponent_div_6_Template_button_click_18_listener")),core._uU(19),core.ALo(20,"translate"),core.qZA()()()()}if(2&rf){const ctx_r3=core.oxw();core.xp6(3),core.hij(" ",core.lcZ(4,7,"Approve Rendezvous")," "),core.xp6(2),core.s9C("title",core.lcZ(6,9,"Cancel")),core.xp6(4),core.Q6J("ngIf",ctx_r3.rdv),core.xp6(2),core.Oqu(core.lcZ(12,11,"Please add a Date:")),core.xp6(3),core.Q6J("ngClass",core.VKq(15,_c1,ctx_r3.errorMsg)),core.xp6(2),core.Q6J("ngIf",ctx_r3.errorMsg),core.xp6(3),core.hij(" ",core.lcZ(20,13,"Approve")," ")}}function RendezvousComponent_div_7_p_10_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"p",21),core._uU(1),core.qZA()),2&rf){const ctx_r32=core.oxw(2);core.xp6(1),core.Oqu(ctx_r32.errorMsg)}}function RendezvousComponent_div_7_Template(rf,ctx){if(1&rf){const _r34=core.EpF();core.TgZ(0,"div",9)(1,"div",10)(2,"div",11),core._uU(3),core.ALo(4,"translate"),core.qZA(),core.TgZ(5,"div",13),core.NdJ("click",__name(function(){core.CHM(_r34);const ctx_r33=core.oxw();return core.KtG(ctx_r33.hidePopup())},"RendezvousComponent_div_7_Template_div_click_5_listener")),core.ALo(6,"translate"),core._uU(7," \xd7 "),core.qZA()(),core.TgZ(8,"div",14)(9,"app-rdv-form",29),core.NdJ("rdvFormValue",__name(function($event){core.CHM(_r34);const ctx_r35=core.oxw();return core.KtG(ctx_r35.updateRendezvous($event))},"RendezvousComponent_div_7_Template_app_rdv_form_rdvFormValue_9_listener")),core.qZA(),core.YNc(10,RendezvousComponent_div_7_p_10_Template,2,1,"p",16),core.qZA()()}if(2&rf){const ctx_r4=core.oxw();core.xp6(3),core.hij(" ",core.lcZ(4,5,"Update Rendezvous")," "),core.xp6(2),core.s9C("title",core.lcZ(6,7,"Cancel")),core.xp6(4),core.Q6J("rdv",ctx_r4.rdv)("showDeleteBtn",!1),core.xp6(1),core.Q6J("ngIf",ctx_r4.errorMsg)}}function RendezvousComponent_div_8_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"div",30),core._UZ(1,"app-chart",31),core.ALo(2,"translate"),core.qZA()),2&rf){const ctx_r5=core.oxw();core.xp6(1),core.s9C("chartTitle",core.lcZ(2,5,"New Rendezvous Per Month")),core.Q6J("chartX",ctx_r5.months)("chartY",ctx_r5.rdvsPerMonth)("chartType","bar")("chartID","rdvsChart")}}function RendezvousComponent_div_9_Template(rf,ctx){if(1&rf){const _r37=core.EpF();core.TgZ(0,"div",32),core.NdJ("click",__name(function(){core.CHM(_r37);const ctx_r36=core.oxw();return core.KtG(ctx_r36.hidePopup())},"RendezvousComponent_div_9_Template_div_click_0_listener")),core.qZA()}}__name(RendezvousComponent_div_6_Template,"RendezvousComponent_div_6_Template"),__name(RendezvousComponent_div_7_p_10_Template,"RendezvousComponent_div_7_p_10_Template"),__name(RendezvousComponent_div_7_Template,"RendezvousComponent_div_7_Template"),__name(RendezvousComponent_div_8_Template,"RendezvousComponent_div_8_Template"),__name(RendezvousComponent_div_9_Template,"RendezvousComponent_div_9_Template");class RendezvousComponent{constructor(authService,rdvService,translate,translatingService){this.authService=authService,this.rdvService=rdvService,this.translate=translate,this.translatingService=translatingService,this.pendingRDVsCols=this.translatingService.getPendingRDVsCols(),this.approvedRDVsCols=this.translatingService.getApprovedRDVsCols(),this.halfwayPopup=!1,this.updateRDVpopup=!1,this.approveRDVpopup=!1,this.rdv=null,this.errorMsg="",this.months=this.translatingService.getMonths()}ngOnInit(){this.authService.getUser().subscribe(value=>this.user=value),this.approvedRendezvous=this.rdvService.getRDVsByState(rendezvous.R.APPROVED,"rdvDate","BEGINNING"),this.pendingRendezvous=this.rdvService.getRDVsByState(rendezvous.R.PENDING,"createdAt","BEGINNING"),this.rdvService.getAllRendezvous().subscribe(values=>{const rdvsInEveryMonth=values.map(rdv=>new Date(rdv.createdAt).toLocaleString("en",{month:"short"}));this.rdvsPerMonth=this.translatingService.getEngMonths().map(month=>rdvsInEveryMonth.filter(val=>val==month).length)})}get isPending(){var _a;return(null===(_a=this.rdv)||void 0===_a?void 0:_a.rdvState)===rendezvous.R.PENDING}get isApproved(){var _a;return(null===(_a=this.rdv)||void 0===_a?void 0:_a.rdvState)===rendezvous.R.APPROVED}showHalfwayPopup(data){this.rdv=data,this.halfwayPopup=!0}proceedToApproveRDV(){this.halfwayPopup=!1,this.updateRDVpopup=!1,this.approveRDVpopup=!0}proceedToUpdateRDV(){this.halfwayPopup=!1,this.approveRDVpopup=!1,this.updateRDVpopup=!0}hidePopup(){this.approveRDVpopup=!1,this.updateRDVpopup=!1,this.halfwayPopup=!1,this.errorMsg="",this.rdv=null}approveRDV(data,rdvDate){var _this=this;return(0,asyncToGenerator.Z)(function*(){if(!rdvDate)return _this.errorMsg="Please enter a date";if(!data)return _this.errorMsg="Rendezvous not found";data.rdvDate=new Date(rdvDate);try{return yield _this.rdvService.approveRendezvous(data.rdvID,data,_this.user),_this.hidePopup()}catch(error){_this.errorMsg=error}})()}updateRendezvous(data){var _this2=this;return(0,asyncToGenerator.Z)(function*(){var _a;if(null===(_a=_this2.rdv)||void 0===_a||!_a.rdvID)return _this2.errorMsg="Rendezvous not found";if(data.displayName===_this2.rdv.displayName&&data.phoneNumber===_this2.rdv.phoneNumber)return _this2.hidePopup();try{return yield _this2.rdvService.updateRendezvous(_this2.rdv.rdvID,data),_this2.hidePopup()}catch(error){_this2.errorMsg=error}})()}deleteRendezvous(){var _this3=this;return(0,asyncToGenerator.Z)(function*(){var _a;if(null===(_a=_this3.rdv)||void 0===_a||!_a.rdvID)return _this3.errorMsg="Rendezvous ID not found";if(confirm(_this3.translatingService.getDeleteConfirmMsg(_this3.rdv)))try{return yield _this3.rdvService.deleteRendezvous(_this3.rdv.rdvID,_this3.rdv,_this3.user),_this3.hidePopup()}catch(error){_this3.errorMsg=error}})()}cancelRendezvous(){var _this4=this;return(0,asyncToGenerator.Z)(function*(){var _a;if(null===(_a=_this4.rdv)||void 0===_a||!_a.rdvID)return _this4.errorMsg="Rendezvous ID not found";if(confirm(_this4.translatingService.getCancelConfirmMsg(_this4.rdv)))try{return yield _this4.rdvService.cancelRendezvous(_this4.rdv.rdvID,_this4.rdv,_this4.user),_this4.hidePopup()}catch(error){_this4.errorMsg=error}})()}}function DashboardComponent_mat_icon_6_Template(rf,ctx){1&rf&&(core.TgZ(0,"mat-icon",13),core.ALo(1,"translate"),core._uU(2,"menu"),core.qZA()),2&rf&&core.s9C("title",core.lcZ(1,1,"Show Sidebar"))}function DashboardComponent_div_13_span_2_Template(rf,ctx){if(1&rf){const _r7=core.EpF();core.TgZ(0,"span",17),core.NdJ("click",__name(function(){core.CHM(_r7);const ctx_r6=core.oxw(2);return core.KtG(ctx_r6.toggleSidebar())},"DashboardComponent_div_13_span_2_Template_span_click_0_listener")),core.ALo(1,"translate"),core._uU(2,"\xd7"),core.qZA()}2&rf&&core.s9C("title",core.lcZ(1,1,"Cancel"))}__name(RendezvousComponent,"RendezvousComponent"),RendezvousComponent.\u0275fac=__name(function(t){return new(t||RendezvousComponent)(core.Y36(auth_service.e),core.Y36(rendezvous_service.b),core.Y36(ngx_translate_core.sK),core.Y36(translating_service.o))},"RendezvousComponent_Factory"),RendezvousComponent.\u0275cmp=core.Xpm({type:RendezvousComponent,selectors:[["app-rendezvous"]],decls:10,vars:11,consts:[[1,"rdvs-container"],["class","table-container facebook-style",4,"ngIf"],["class","popup-modal facebook-style",4,"ngIf"],["class","chart-container facebook-style",4,"ngIf"],["class","overlay",3,"click",4,"ngIf"],[1,"table-container","facebook-style"],[1,"t-title-container"],[1,"t-title"],[3,"tableCols","infos","showBtns","currentUser","updateInfosEvent"],[1,"popup-modal","facebook-style"],[1,"popup-modal-header"],[1,"title"],[4,"ngIf"],[1,"close-btn",3,"title","click"],[1,"popup-modal-body"],[2,"margin","15px 0 30px 0"],["class","alert alert-danger",4,"ngIf"],[1,"halfway-btns-container",3,"ngClass"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-info",3,"click"],["class","btn btn-danger",3,"click",4,"ngIf"],[1,"alert","alert-danger"],[1,"btn","btn-success",3,"click"],[1,"btn","btn-danger",3,"click"],["style","margin: 15px 0 30px 0;",4,"ngIf"],["for","rdv-date",2,"font-size","small"],["type","datetime-local","name","rdv-date",1,"form-control",3,"ngClass"],["rdvDateInput",""],[1,"btns-container"],[3,"rdv","showDeleteBtn","rdvFormValue"],[1,"chart-container","facebook-style"],[3,"chartX","chartY","chartType","chartTitle","chartID"],[1,"overlay",3,"click"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0),core.YNc(1,RendezvousComponent_div_1_Template,7,9,"div",1),core.ALo(2,"async"),core.YNc(3,RendezvousComponent_div_3_Template,7,9,"div",1),core.ALo(4,"async"),core.YNc(5,RendezvousComponent_div_5_Template,28,24,"div",2),core.YNc(6,RendezvousComponent_div_6_Template,21,17,"div",2),core.YNc(7,RendezvousComponent_div_7_Template,11,9,"div",2),core.YNc(8,RendezvousComponent_div_8_Template,3,7,"div",3),core.qZA(),core.YNc(9,RendezvousComponent_div_9_Template,1,0,"div",4)),2&rf&&(core.xp6(1),core.Q6J("ngIf",core.lcZ(2,7,ctx.pendingRendezvous)),core.xp6(2),core.Q6J("ngIf",core.lcZ(4,9,ctx.approvedRendezvous)),core.xp6(2),core.Q6J("ngIf",ctx.halfwayPopup),core.xp6(1),core.Q6J("ngIf",ctx.approveRDVpopup),core.xp6(1),core.Q6J("ngIf",ctx.updateRDVpopup),core.xp6(1),core.Q6J("ngIf",ctx.rdvsPerMonth),core.xp6(1),core.Q6J("ngIf",ctx.halfwayPopup||ctx.approveRDVpopup||ctx.updateRDVpopup))},"RendezvousComponent_Template"),dependencies:[common.mk,common.O5,table_component.a,rdv_form_component.X,ChartComponent,common.Ov,ngx_translate_core.X$],styles:[".rdvs-container[_ngcontent-%COMP%]{position:relative;min-height:100vh}.cols-3[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 1fr;gap:15px;margin-top:15px}.cols-2[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:15px;margin-top:15px}.btns-container[_ngcontent-%COMP%]{margin-top:15px}.btn-success[_ngcontent-%COMP%]{width:100%}.chart-container[_ngcontent-%COMP%]{padding:15px;max-width:90%;margin-inline:auto}@media screen and (max-width: 950px){.chart-container[_ngcontent-%COMP%]{max-width:100%}}"]}),__name(DashboardComponent_mat_icon_6_Template,"DashboardComponent_mat_icon_6_Template"),__name(DashboardComponent_div_13_span_2_Template,"DashboardComponent_div_13_span_2_Template");const dashboard_component_c0=__name(function(a0,a1){return{"show-sidemenu":a0,"hide-sidemenu":a1}},"dashboard_component_c0"),dashboard_component_c1=__name(function(a0){return{active:a0}},"dashboard_component_c1");function DashboardComponent_div_13_Template(rf,ctx){if(1&rf){const _r9=core.EpF();core.TgZ(0,"div",14)(1,"div",4),core.YNc(2,DashboardComponent_div_13_span_2_Template,3,3,"span",15),core.qZA(),core.TgZ(3,"div",16),core.NdJ("click",__name(function(){core.CHM(_r9);const ctx_r8=core.oxw();return core.KtG(ctx_r8.showUsers())},"DashboardComponent_div_13_Template_div_click_3_listener")),core._uU(4),core.ALo(5,"translate"),core.qZA(),core.TgZ(6,"div",16),core.NdJ("click",__name(function(){core.CHM(_r9);const ctx_r10=core.oxw();return core.KtG(ctx_r10.showRDVs())},"DashboardComponent_div_13_Template_div_click_6_listener")),core._uU(7),core.ALo(8,"translate"),core.qZA()()}if(2&rf){const ctx_r1=core.oxw();core.Q6J("ngClass",core.WLB(10,dashboard_component_c0,ctx_r1.showSidebar,!ctx_r1.showSidebar)),core.xp6(2),core.Q6J("ngIf",ctx_r1.showSidebar),core.xp6(1),core.Q6J("ngClass",core.VKq(13,dashboard_component_c1,ctx_r1.usersON)),core.xp6(1),core.hij(" ",core.lcZ(5,6,"Users")," "),core.xp6(2),core.Q6J("ngClass",core.VKq(15,dashboard_component_c1,ctx_r1.RDVsON)),core.xp6(1),core.hij(" ",core.lcZ(8,8,"Rendezvous")," ")}}function DashboardComponent_div_14_Template(rf,ctx){if(1&rf){const _r12=core.EpF();core.TgZ(0,"div",18),core.NdJ("click",__name(function(){core.CHM(_r12);const ctx_r11=core.oxw();return core.KtG(ctx_r11.toggleSidebar())},"DashboardComponent_div_14_Template_div_click_0_listener")),core.qZA()}}function DashboardComponent_div_16_Template(rf,ctx){1&rf&&(core.TgZ(0,"div",19),core._UZ(1,"app-users-part"),core.qZA())}function DashboardComponent_div_17_Template(rf,ctx){1&rf&&(core.TgZ(0,"div",20),core._UZ(1,"app-rendezvous"),core.qZA())}__name(DashboardComponent_div_13_Template,"DashboardComponent_div_13_Template"),__name(DashboardComponent_div_14_Template,"DashboardComponent_div_14_Template"),__name(DashboardComponent_div_16_Template,"DashboardComponent_div_16_Template"),__name(DashboardComponent_div_17_Template,"DashboardComponent_div_17_Template");class DashboardComponent{constructor(){this.showSidebar=!1,this.usersON=!0,this.RDVsON=!1}ngOnInit(){}toggleSidebar(){this.showSidebar?this.showSidebar=!1:this.showSidebar=!0}showUsers(){this.RDVsON=!1,this.usersON=!0,this.showSidebar=!1}showRDVs(){this.usersON=!1,this.RDVsON=!0,this.showSidebar=!1}}__name(DashboardComponent,"DashboardComponent"),DashboardComponent.\u0275fac=__name(function(t){return new(t||DashboardComponent)},"DashboardComponent_Factory"),DashboardComponent.\u0275cmp=core.Xpm({type:DashboardComponent,selectors:[["app-dashboard"]],decls:18,vars:17,consts:[[1,"dashboard-container"],[1,"sidebar"],[1,"fixed"],[1,"web-sidemenu-container"],[1,"toggle-sidebar"],[3,"click"],[3,"title",4,"ngIf"],[1,"web-side-links",3,"ngClass","click"],["class","mobile-sidemenu-container",3,"ngClass",4,"ngIf"],["class","overlay",3,"click",4,"ngIf"],[1,"main-content"],["class","users-container",4,"ngIf"],["class","rdvs-container",4,"ngIf"],[3,"title"],[1,"mobile-sidemenu-container",3,"ngClass"],["class","close-btn",3,"title","click",4,"ngIf"],[1,"mobile-side-link",3,"ngClass","click"],[1,"close-btn",3,"title","click"],[1,"overlay",3,"click"],[1,"users-container"],[1,"rdvs-container"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"span",5),core.NdJ("click",__name(function(){return ctx.toggleSidebar()},"DashboardComponent_Template_span_click_5_listener")),core.YNc(6,DashboardComponent_mat_icon_6_Template,3,3,"mat-icon",6),core.qZA()(),core.TgZ(7,"div",7),core.NdJ("click",__name(function(){return ctx.showUsers()},"DashboardComponent_Template_div_click_7_listener")),core._uU(8),core.ALo(9,"translate"),core.qZA(),core.TgZ(10,"div",7),core.NdJ("click",__name(function(){return ctx.showRDVs()},"DashboardComponent_Template_div_click_10_listener")),core._uU(11),core.ALo(12,"translate"),core.qZA()()(),core.YNc(13,DashboardComponent_div_13_Template,9,17,"div",8),core.YNc(14,DashboardComponent_div_14_Template,1,0,"div",9),core.qZA(),core.TgZ(15,"div",10),core.YNc(16,DashboardComponent_div_16_Template,2,0,"div",11),core.YNc(17,DashboardComponent_div_17_Template,2,0,"div",12),core.qZA()()),2&rf&&(core.xp6(6),core.Q6J("ngIf",!ctx.showSidebar),core.xp6(1),core.Q6J("ngClass",core.VKq(13,dashboard_component_c1,ctx.usersON)),core.xp6(1),core.hij(" ",core.lcZ(9,9,"Users")," "),core.xp6(2),core.Q6J("ngClass",core.VKq(15,dashboard_component_c1,ctx.RDVsON)),core.xp6(1),core.hij(" ",core.lcZ(12,11,"Rendezvous")," "),core.xp6(2),core.Q6J("ngIf",ctx.showSidebar),core.xp6(1),core.Q6J("ngIf",ctx.showSidebar),core.xp6(2),core.Q6J("ngIf",ctx.usersON),core.xp6(1),core.Q6J("ngIf",ctx.RDVsON))},"DashboardComponent_Template"),dependencies:[common.mk,common.O5,icon.Hw,UsersPartComponent,RendezvousComponent,ngx_translate_core.X$],styles:[".dashboard-container[_ngcontent-%COMP%]{min-height:100vh;display:grid;grid-template-columns:max-content auto}.sidebar[_ngcontent-%COMP%]{position:relative;width:max-content;color:#fff;background-color:#121212}.fixed[_ngcontent-%COMP%]{position:sticky;top:55px;height:max-content}.toggle-sidebar[_ngcontent-%COMP%]{display:none}.web-side-links[_ngcontent-%COMP%]{padding:15px;cursor:pointer}.web-side-links[_ngcontent-%COMP%]:hover{filter:brightness(75%)}.active[_ngcontent-%COMP%]{color:var(--main-color);background-color:var(--side-color)}.main-content[_ngcontent-%COMP%]{overflow:hidden;padding:15px}@media screen and (max-width: 950px){.mobile-side-links[_ngcontent-%COMP%], .web-side-links[_ngcontent-%COMP%], .hide-sidemenu[_ngcontent-%COMP%]{display:none}.show-sidemenu[_ngcontent-%COMP%]{position:fixed;top:55px;left:0;width:max-content;height:100%;background-color:#000;z-index:11}.toggle-sidebar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.toggle-sidebar[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{width:30px;height:30px;display:flex;justify-content:center;align-items:center;cursor:pointer}.close-btn[_ngcontent-%COMP%]{font-size:2rem;font-weight:700}.mobile-side-link[_ngcontent-%COMP%]{padding:15px;cursor:pointer}}"]});var dashboard_guard=__webpack_require__(17767);const routes=[{path:"",component:DashboardComponent,canActivate:[auth_guard.a,dashboard_guard.u]}];class DashboardRoutingModule{}__name(DashboardRoutingModule,"DashboardRoutingModule"),DashboardRoutingModule.\u0275fac=__name(function(t){return new(t||DashboardRoutingModule)},"DashboardRoutingModule_Factory"),DashboardRoutingModule.\u0275mod=core.oAB({type:DashboardRoutingModule}),DashboardRoutingModule.\u0275inj=core.cJS({imports:[router.Bz.forChild(routes),router.Bz]});var shared_module=__webpack_require__(83436);class DashboardModule{}__name(DashboardModule,"DashboardModule"),DashboardModule.\u0275fac=__name(function(t){return new(t||DashboardModule)},"DashboardModule_Factory"),DashboardModule.\u0275mod=core.oAB({type:DashboardModule}),DashboardModule.\u0275inj=core.cJS({imports:[common.ez,DashboardRoutingModule,shared_module.m,fesm2015_forms.u5,icon.Ps]})},64286:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>RendezvousService});var _home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(15861),_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(90050),rxjs__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(76477),_angular_core__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(5e3),_angular_fire_compat_firestore__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(54223),_translating_service__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(57694);class RendezvousService{constructor(fireStore,translatingService){this.fireStore=fireStore,this.translatingService=translatingService}createRendezvous(rdv,currentUser){var _this=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){if(!currentUser.email)throw"You need Email to create new Rendezvous!";return rdv.createdAt=new Date,rdv.createdBy=currentUser.email,rdv.rdvState=_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__.R.PENDING,yield _this.fireStore.collection("Rendezvous").add(rdv)})()}deleteRendezvous(id,rdv,user){var _this2=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){return rdv.createdAt=new Date(rdv.createdAt),rdv.lastUpdate&&"Not Updated"!==rdv.lastUpdate&&(rdv.lastUpdate=new Date(rdv.lastUpdate)),rdv.rdvState=_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__.R.DELETED,rdv.deletedAt=new Date,rdv.deletedBy=user.email,yield _this2.fireStore.collection("Rendezvous").doc(id).update(rdv)})()}updateRendezvous(id,rdv){var _this3=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){return rdv.lastUpdate=new Date,yield _this3.fireStore.collection("Rendezvous").doc(id).update(rdv)})()}approveRendezvous(id,rdv,user){var _this4=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){return rdv.createdAt=new Date(rdv.createdAt),rdv.lastUpdate&&"Not Updated"!==rdv.lastUpdate&&(rdv.lastUpdate=new Date(rdv.lastUpdate)),rdv.rdvState=_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__.R.APPROVED,rdv.approvedAt=new Date,rdv.approvedBy=user.email,yield _this4.fireStore.collection("Rendezvous").doc(id).update(rdv)})()}finishRendezvous(id,rdv){var _this5=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){return rdv.createdAt=new Date(rdv.createdAt),rdv.lastUpdate&&"Not Updated"!==rdv.lastUpdate&&(rdv.lastUpdate=new Date(rdv.lastUpdate)),rdv.approvedAt&&(rdv.approvedAt=new Date(rdv.approvedAt)),rdv.rdvDate&&(rdv.rdvDate=new Date(rdv.rdvDate)),rdv.rdvState=_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__.R.FINISHED,rdv.finishedAt=new Date,yield _this5.fireStore.collection("Rendezvous").doc(id).update(rdv)})()}cancelRendezvous(id,rdv,user){var _this6=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){return rdv.createdAt=new Date(rdv.createdAt),rdv.lastUpdate&&"Not Updated"!==rdv.lastUpdate&&(rdv.lastUpdate=new Date(rdv.lastUpdate)),rdv.approvedAt&&(rdv.approvedAt=new Date(rdv.approvedAt)),rdv.rdvDate&&(rdv.rdvDate=new Date(rdv.rdvDate)),rdv.rdvState=_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__.R.CANCELED,rdv.canceledAt=new Date,rdv.canceledBy=user.email,yield _this6.fireStore.collection("Rendezvous").doc(id).update(rdv)})()}getRDVsByState(stateOfRDV,orderBy,type,paginationDoc){return this.fireStore.collection("Rendezvous",ref=>{const queries=ref.where("rdvState","==",stateOfRDV).orderBy(orderBy).limit(5);return"NEXT"===type?queries.startAfter(paginationDoc):"PREVIOUS"===type?queries.endBefore(paginationDoc):queries}).snapshotChanges().pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_3__.map)(values=>{let i=1;return values.map(rdv=>{const load=rdv.payload.doc.data();return{...load,rdvID:rdv.payload.doc.id,createdAt:this.translatingService.convertToDateString(load.createdAt),lastUpdate:this.getLastUpdate(load.lastUpdate),rdvDate:load.rdvDate?this.translatingService.convertToDateString(load.rdvDate):void 0,approvedAt:load.approvedAt?this.translatingService.convertToDateString(load.approvedAt):void 0,finishedAt:load.finishedAt?this.translatingService.convertToDateString(load.finishedAt):void 0,canceledAt:load.canceledAt?this.translatingService.convertToDateString(load.canceledAt):void 0,deletedAt:load.deletedAt?this.translatingService.convertToDateString(load.deletedAt):void 0,order:i++}})}))}getRDVsByEmailAndState(usrMail,stateOfRDV,orderBy){return this.fireStore.collection("Rendezvous",ref=>ref.where("createdBy","==",usrMail).where("rdvState","==",stateOfRDV).orderBy(orderBy)).snapshotChanges().pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_3__.map)(values=>{let i=1;return values.map(rdv=>{const load=rdv.payload.doc.data();return{...load,rdvID:rdv.payload.doc.id,createdAt:this.translatingService.convertToDateString(load.createdAt),lastUpdate:this.getLastUpdate(load.lastUpdate),rdvDate:load.rdvDate?this.translatingService.convertToDateString(load.rdvDate):void 0,approvedAt:load.approvedAt?this.translatingService.convertToDateString(load.approvedAt):void 0,finishedAt:load.finishedAt?this.translatingService.convertToDateString(load.finishedAt):void 0,canceledAt:load.canceledAt?this.translatingService.convertToDateString(load.canceledAt):void 0,deletedAt:load.deletedAt?this.translatingService.convertToDateString(load.deletedAt):void 0,order:i++}})}))}getAllRendezvous(){return this.fireStore.collection("Rendezvous",ref=>ref.orderBy("createdAt")).snapshotChanges().pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_3__.map)(values=>{let i=1;return values.map(rdv=>{const load=rdv.payload.doc.data();return{...load,rdvID:rdv.payload.doc.id,createdAt:this.translatingService.convertToDateString(load.createdAt),lastUpdate:this.getLastUpdate(load.lastUpdate),rdvDate:load.rdvDate?this.translatingService.convertToDateString(load.rdvDate):void 0,approvedAt:load.approvedAt?this.translatingService.convertToDateString(load.approvedAt):void 0,finishedAt:load.finishedAt?this.translatingService.convertToDateString(load.finishedAt):void 0,canceledAt:load.canceledAt?this.translatingService.convertToDateString(load.canceledAt):void 0,deletedAt:load.deletedAt?this.translatingService.convertToDateString(load.deletedAt):void 0,order:i++}})}))}getDocByID(docID){return this.fireStore.collection("Rendezvous").doc(docID)}getLastUpdate(param){return param&&"Not Updated"!==param?this.translatingService.convertToDateString(param):"Not Updated"}}__name(RendezvousService,"RendezvousService"),RendezvousService.\u0275fac=__name(function(t){return new(t||RendezvousService)(_angular_core__WEBPACK_IMPORTED_MODULE_4__.LFG(_angular_fire_compat_firestore__WEBPACK_IMPORTED_MODULE_5__.ST),_angular_core__WEBPACK_IMPORTED_MODULE_4__.LFG(_translating_service__WEBPACK_IMPORTED_MODULE_1__.o))},"RendezvousService_Factory"),RendezvousService.\u0275prov=_angular_core__WEBPACK_IMPORTED_MODULE_4__.Yz7({token:RendezvousService,factory:RendezvousService.\u0275fac,providedIn:"root"})},42824:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{z:()=>EditProfileComponent});var _angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5e3),_angular_forms__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(93075),src_app_models_user__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(65783),src_app_auth_services_auth_service__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(16518),_angular_common__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(69808),_ngx_translate_core__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(81981);function EditProfileComponent_p_7_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"p",14),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(2,1,"First Name is invalid")))}function EditProfileComponent_p_13_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"p",14),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(2,1,"Last Name is invalid")))}function EditProfileComponent_p_19_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"p",14),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(2,1,"Phone Number must contain 10 digit numbers")))}function EditProfileComponent_div_20_option_5_Template(rf,ctx){if(1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"option",19),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()),2&rf){const role_r5=ctx.$implicit;_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("value",role_r5),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(role_r5)}}function EditProfileComponent_div_20_Template(rf,ctx){if(1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"div",15)(1,"label",16),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(3,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(4,"select",17),_angular_core__WEBPACK_IMPORTED_MODULE_2__.YNc(5,EditProfileComponent_div_20_option_5_Template,2,2,"option",18),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()()),2&rf){const ctx_r3=_angular_core__WEBPACK_IMPORTED_MODULE_2__.oxw();_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(3,2,"Role")),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngForOf",ctx_r3.roles)}}__name(EditProfileComponent_p_7_Template,"EditProfileComponent_p_7_Template"),__name(EditProfileComponent_p_13_Template,"EditProfileComponent_p_13_Template"),__name(EditProfileComponent_p_19_Template,"EditProfileComponent_p_19_Template"),__name(EditProfileComponent_div_20_option_5_Template,"EditProfileComponent_div_20_option_5_Template"),__name(EditProfileComponent_div_20_Template,"EditProfileComponent_div_20_Template");const _c0=__name(function(a0){return{"danger-input":a0}},"_c0");class EditProfileComponent{constructor(formBuilder,authService){this.formBuilder=formBuilder,this.authService=authService,this.roles=[],this.updatedValues=new _angular_core__WEBPACK_IMPORTED_MODULE_2__.vpe,Object.entries(src_app_models_user__WEBPACK_IMPORTED_MODULE_0__.K).forEach(([key,value])=>this.roles.push(value))}ngOnInit(){var _a,_b,_c,_d;this.editProfileForm=this.formBuilder.group({firstName:[null===(_a=this.profileInfos)||void 0===_a?void 0:_a.firstName,[_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.required,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.pattern(/.*\S.*/)]],lastName:[null===(_b=this.profileInfos)||void 0===_b?void 0:_b.lastName,[_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.required,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.pattern(/.*\S.*/)]],phoneNumber:[null===(_c=this.profileInfos)||void 0===_c?void 0:_c.phoneNumber,[_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.required,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.pattern(/^(\+213|0)?[0-9]{9}$/)]],role:[null===(_d=this.profileInfos)||void 0===_d?void 0:_d.role,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.kI.required]})}submitForm(){this.updatedValues.emit(this.editProfileForm.value)}get isAdmin(){return this.authService.canCRUDusers(this.currentUser)}}__name(EditProfileComponent,"EditProfileComponent"),EditProfileComponent.\u0275fac=__name(function(t){return new(t||EditProfileComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y36(_angular_forms__WEBPACK_IMPORTED_MODULE_3__.QS),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y36(src_app_auth_services_auth_service__WEBPACK_IMPORTED_MODULE_1__.e))},"EditProfileComponent_Factory"),EditProfileComponent.\u0275cmp=_angular_core__WEBPACK_IMPORTED_MODULE_2__.Xpm({type:EditProfileComponent,selectors:[["app-edit-profile"]],inputs:{profileInfos:"profileInfos",currentUser:"currentUser"},outputs:{updatedValues:"updatedValues"},decls:24,vars:27,consts:[[1,"edit-profile-container"],[1,"signup-form",3,"formGroup"],[1,"form-section","first-name"],["for","firstName"],["type","text","formControlName","firstName",1,"input-form",3,"ngClass"],["class","danger-msg",4,"ngIf"],[1,"form-section","last-name"],["for","lastName"],["type","text","formControlName","lastName",1,"input-form",3,"ngClass"],[1,"form-section","phone-number"],["for","phoneNumber"],["type","tel","formControlName","phoneNumber",1,"input-form",3,"ngClass"],["class","form-section role",4,"ngIf"],[1,"btn","btn-success",3,"disabled","click"],[1,"danger-msg"],[1,"form-section","role"],["for","role"],["formControlName","role",1,"form-select"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:__name(function(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"div",0)(1,"form",1)(2,"div",2)(3,"label",3),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(4),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(5,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__._UZ(6,"input",4),_angular_core__WEBPACK_IMPORTED_MODULE_2__.YNc(7,EditProfileComponent_p_7_Template,3,3,"p",5),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(8,"div",6)(9,"label",7),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(10),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(11,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__._UZ(12,"input",8),_angular_core__WEBPACK_IMPORTED_MODULE_2__.YNc(13,EditProfileComponent_p_13_Template,3,3,"p",5),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(14,"div",9)(15,"label",10),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(16),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(17,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__._UZ(18,"input",11),_angular_core__WEBPACK_IMPORTED_MODULE_2__.YNc(19,EditProfileComponent_p_19_Template,3,3,"p",5),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_2__.YNc(20,EditProfileComponent_div_20_Template,6,4,"div",12),_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(21,"button",13),_angular_core__WEBPACK_IMPORTED_MODULE_2__.NdJ("click",__name(function(){return ctx.submitForm()},"EditProfileComponent_Template_button_click_21_listener")),_angular_core__WEBPACK_IMPORTED_MODULE_2__._uU(22),_angular_core__WEBPACK_IMPORTED_MODULE_2__.ALo(23,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()()()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("formGroup",ctx.editProfileForm),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(5,13,"First Name")),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_2__.VKq(21,_c0,ctx.editProfileForm.controls.firstName.invalid&&ctx.editProfileForm.controls.firstName.touched)),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngIf",ctx.editProfileForm.controls.firstName.invalid&&ctx.editProfileForm.controls.firstName.touched),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(11,15,"Last Name")),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_2__.VKq(23,_c0,ctx.editProfileForm.controls.lastName.invalid&&ctx.editProfileForm.controls.lastName.touched)),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngIf",ctx.editProfileForm.controls.lastName.invalid&&ctx.editProfileForm.controls.lastName.touched),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(3),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(17,17,"Phone Number")),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_2__.VKq(25,_c0,ctx.editProfileForm.controls.phoneNumber.invalid&&ctx.editProfileForm.controls.phoneNumber.touched)),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngIf",ctx.editProfileForm.controls.phoneNumber.invalid&&ctx.editProfileForm.controls.phoneNumber.touched),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("ngIf",ctx.isAdmin),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("disabled",ctx.editProfileForm.invalid),_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.hij(" ",_angular_core__WEBPACK_IMPORTED_MODULE_2__.lcZ(23,19,"Save")," "))},"EditProfileComponent_Template"),dependencies:[_angular_common__WEBPACK_IMPORTED_MODULE_4__.mk,_angular_common__WEBPACK_IMPORTED_MODULE_4__.sg,_angular_common__WEBPACK_IMPORTED_MODULE_4__.O5,_angular_forms__WEBPACK_IMPORTED_MODULE_3__._Y,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.YN,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.Kr,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.Fj,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.EJ,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.JJ,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.JL,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.sg,_angular_forms__WEBPACK_IMPORTED_MODULE_3__.u,_ngx_translate_core__WEBPACK_IMPORTED_MODULE_5__.X$],styles:[".form-section[_ngcontent-%COMP%]{margin-bottom:15px;text-align:left}.btn-success[_ngcontent-%COMP%]{width:100%}"]})},70362:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{X:()=>RdvFormComponent});var _angular_core__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5e3),_angular_forms__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(93075),_angular_common__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(69808),_ngx_translate_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(81981);function RdvFormComponent_p_4_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"p",10),_angular_core__WEBPACK_IMPORTED_MODULE_0__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(2,1,"invalid name")))}function RdvFormComponent_p_8_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"p",10),_angular_core__WEBPACK_IMPORTED_MODULE_0__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(2,1,"Phone Number must contain 10 digit numbers")))}function RdvFormComponent_span_11_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"span"),_angular_core__WEBPACK_IMPORTED_MODULE_0__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(2,1,"Add Rendezvous")))}function RdvFormComponent_span_12_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"span"),_angular_core__WEBPACK_IMPORTED_MODULE_0__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(2,1,"Update Rendezvous")))}function RdvFormComponent_button_13_Template(rf,ctx){if(1&rf){const _r6=_angular_core__WEBPACK_IMPORTED_MODULE_0__.EpF();_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"button",11),_angular_core__WEBPACK_IMPORTED_MODULE_0__.NdJ("click",__name(function(){_angular_core__WEBPACK_IMPORTED_MODULE_0__.CHM(_r6);const ctx_r5=_angular_core__WEBPACK_IMPORTED_MODULE_0__.oxw();return _angular_core__WEBPACK_IMPORTED_MODULE_0__.KtG(ctx_r5.deleteRDV())},"RdvFormComponent_button_13_Template_button_click_0_listener")),_angular_core__WEBPACK_IMPORTED_MODULE_0__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()}2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(2,1,"Delete Rendezvous")))}__name(RdvFormComponent_p_4_Template,"RdvFormComponent_p_4_Template"),__name(RdvFormComponent_p_8_Template,"RdvFormComponent_p_8_Template"),__name(RdvFormComponent_span_11_Template,"RdvFormComponent_span_11_Template"),__name(RdvFormComponent_span_12_Template,"RdvFormComponent_span_12_Template"),__name(RdvFormComponent_button_13_Template,"RdvFormComponent_button_13_Template");const _c0=__name(function(a0){return{"full-width-btn":a0}},"_c0");class RdvFormComponent{constructor(formBuilder){this.formBuilder=formBuilder,this.rdvFormValue=new _angular_core__WEBPACK_IMPORTED_MODULE_0__.vpe,this.deleteRDVid=new _angular_core__WEBPACK_IMPORTED_MODULE_0__.vpe}ngOnInit(){var _a;this.rdvID=null===(_a=this.rdv)||void 0===_a?void 0:_a.rdvID,this.initForm()}initForm(){var _a,_b;const nameInput=null===(_a=this.rdv)||void 0===_a?void 0:_a.displayName,mobileInput=null===(_b=this.rdv)||void 0===_b?void 0:_b.phoneNumber;this.rdvform=this.formBuilder.group({displayName:[nameInput,[_angular_forms__WEBPACK_IMPORTED_MODULE_1__.kI.required,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.kI.pattern(/.*\S.*/)]],phoneNumber:[mobileInput,[_angular_forms__WEBPACK_IMPORTED_MODULE_1__.kI.required,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.kI.pattern(/^(\+213|0)?[0-9]{9}$/)]]})}submitForm(){this.rdvform.invalid||this.rdvFormValue.emit(this.rdvform.value)}deleteRDV(){this.deleteRDVid.emit(this.rdvID)}}__name(RdvFormComponent,"RdvFormComponent"),RdvFormComponent.\u0275fac=__name(function(t){return new(t||RdvFormComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Y36(_angular_forms__WEBPACK_IMPORTED_MODULE_1__.QS))},"RdvFormComponent_Factory"),RdvFormComponent.\u0275cmp=_angular_core__WEBPACK_IMPORTED_MODULE_0__.Xpm({type:RdvFormComponent,selectors:[["app-rdv-form"]],inputs:{rdv:"rdv",showDeleteBtn:"showDeleteBtn"},outputs:{rdvFormValue:"rdvFormValue",deleteRDVid:"deleteRDVid"},decls:14,vars:16,consts:[[1,"form",3,"formGroup"],[1,"name-div"],["type","text","formControlName","displayName",1,"input-form",3,"placeholder"],["class","danger-msg",4,"ngIf"],[1,"mobile-div"],["type","tel","formControlName","phoneNumber",1,"input-form",3,"placeholder"],[1,"btns-container"],[1,"btn","btn-success",3,"disabled","ngClass","click"],[4,"ngIf"],["class","btn btn-danger",3,"click",4,"ngIf"],[1,"danger-msg"],[1,"btn","btn-danger",3,"click"]],template:__name(function(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"form",0)(1,"div",1),_angular_core__WEBPACK_IMPORTED_MODULE_0__._UZ(2,"input",2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(3,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.YNc(4,RdvFormComponent_p_4_Template,3,3,"p",3),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(5,"div",4),_angular_core__WEBPACK_IMPORTED_MODULE_0__._UZ(6,"input",5),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(7,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.YNc(8,RdvFormComponent_p_8_Template,3,3,"p",3),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(9,"div",6)(10,"button",7),_angular_core__WEBPACK_IMPORTED_MODULE_0__.NdJ("click",__name(function(){return ctx.submitForm()},"RdvFormComponent_Template_button_click_10_listener")),_angular_core__WEBPACK_IMPORTED_MODULE_0__.YNc(11,RdvFormComponent_span_11_Template,3,3,"span",8),_angular_core__WEBPACK_IMPORTED_MODULE_0__.YNc(12,RdvFormComponent_span_12_Template,3,3,"span",8),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_0__.YNc(13,RdvFormComponent_button_13_Template,3,3,"button",9),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("formGroup",ctx.rdvform),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.s9C("placeholder",_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(3,10,"Enter a name")),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("ngIf",ctx.rdvform.controls.displayName.touched&&ctx.rdvform.controls.displayName.invalid),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.s9C("placeholder",_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(7,12,"Phone Number")),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("ngIf",ctx.rdvform.controls.phoneNumber.touched&&ctx.rdvform.controls.phoneNumber.invalid),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("disabled",ctx.rdvform.invalid)("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_0__.VKq(14,_c0,!ctx.rdvID||!ctx.showDeleteBtn)),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("ngIf",!ctx.rdvID),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("ngIf",ctx.rdvID),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("ngIf",ctx.rdvID&&ctx.showDeleteBtn))},"RdvFormComponent_Template"),dependencies:[_angular_common__WEBPACK_IMPORTED_MODULE_2__.mk,_angular_common__WEBPACK_IMPORTED_MODULE_2__.O5,_angular_forms__WEBPACK_IMPORTED_MODULE_1__._Y,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.Fj,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.JJ,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.JL,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.sg,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.u,_ngx_translate_core__WEBPACK_IMPORTED_MODULE_3__.X$],styles:[".name-div[_ngcontent-%COMP%], .mobile-div[_ngcontent-%COMP%], .error-msg-div[_ngcontent-%COMP%]{margin:15px 0}.btns-container[_ngcontent-%COMP%]{display:flex;margin-top:25px}.btn[_ngcontent-%COMP%]{width:50%}.full-width-btn[_ngcontent-%COMP%]{width:100%}.btn-success[_ngcontent-%COMP%]{margin-right:7px}.btn-danger[_ngcontent-%COMP%]{margin-left:7px}"]})},83436:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>SharedModule});var common=__webpack_require__(69808),angular_datatables=__webpack_require__(65415),fesm2015_forms=__webpack_require__(93075),core=__webpack_require__(5e3),chart_esm=__webpack_require__(34393),operators=__webpack_require__(83292);function listCacheClear(){this.__data__=[],this.size=0}__name(listCacheClear,"listCacheClear");const _listCacheClear=listCacheClear;function eq(value,other){return value===other||value!=value&&other!=other}__name(eq,"eq");const lodash_es_eq=eq;function assocIndexOf(array,key){for(var length=array.length;length--;)if(lodash_es_eq(array[length][0],key))return length;return-1}__name(assocIndexOf,"assocIndexOf");const _assocIndexOf=assocIndexOf;var splice=Array.prototype.splice;function listCacheDelete(key){var data=this.__data__,index=_assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)}__name(listCacheDelete,"listCacheDelete");const _listCacheDelete=listCacheDelete;function listCacheGet(key){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?void 0:data[index][1]}__name(listCacheGet,"listCacheGet");const _listCacheGet=listCacheGet;function listCacheHas(key){return _assocIndexOf(this.__data__,key)>-1}__name(listCacheHas,"listCacheHas");const _listCacheHas=listCacheHas;function listCacheSet(key,value){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}__name(listCacheSet,"listCacheSet");const _listCacheSet=listCacheSet;function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index-1&&value%1==0&&value<=9007199254740991}__name(isLength,"isLength");const lodash_es_isLength=isLength;function isArrayLike(value){return null!=value&&lodash_es_isLength(value.length)&&!lodash_es_isFunction(value)}__name(isArrayLike,"isArrayLike");const lodash_es_isArrayLike=isArrayLike;function isArrayLikeObject(value){return lodash_es_isObjectLike(value)&&lodash_es_isArrayLike(value)}__name(isArrayLikeObject,"isArrayLikeObject");const lodash_es_isArrayLikeObject=isArrayLikeObject;function stubFalse(){return!1}__name(stubFalse,"stubFalse");const lodash_es_stubFalse=stubFalse;var isBuffer_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,isBuffer_freeModule=isBuffer_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,isBuffer_Buffer=isBuffer_freeModule&&isBuffer_freeModule.exports===isBuffer_freeExports?_root.Buffer:void 0;const lodash_es_isBuffer=(isBuffer_Buffer?isBuffer_Buffer.isBuffer:void 0)||lodash_es_stubFalse;var isPlainObject_funcProto=Function.prototype,isPlainObject_objectProto=Object.prototype,isPlainObject_funcToString=isPlainObject_funcProto.toString,isPlainObject_hasOwnProperty=isPlainObject_objectProto.hasOwnProperty,objectCtorString=isPlainObject_funcToString.call(Object);function isPlainObject(value){if(!lodash_es_isObjectLike(value)||"[object Object]"!=_baseGetTag(value))return!1;var proto=_getPrototype(value);if(null===proto)return!0;var Ctor=isPlainObject_hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&isPlainObject_funcToString.call(Ctor)==objectCtorString}__name(isPlainObject,"isPlainObject");const lodash_es_isPlainObject=isPlainObject;var typedArrayTags={};function baseIsTypedArray(value){return lodash_es_isObjectLike(value)&&lodash_es_isLength(value.length)&&!!typedArrayTags[_baseGetTag(value)]}typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1,__name(baseIsTypedArray,"baseIsTypedArray");const _baseIsTypedArray=baseIsTypedArray;function baseUnary(func){return function(value){return func(value)}}__name(baseUnary,"baseUnary");const _baseUnary=baseUnary;var _nodeUtil_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,_nodeUtil_freeModule=_nodeUtil_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=_nodeUtil_freeModule&&_nodeUtil_freeModule.exports===_nodeUtil_freeExports&&_freeGlobal.process,nodeUtil=function(){try{return _nodeUtil_freeModule&&_nodeUtil_freeModule.require&&_nodeUtil_freeModule.require("util").types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}();var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;const lodash_es_isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray;function safeGet(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]}__name(safeGet,"safeGet");const _safeGet=safeGet;var _assignValue_hasOwnProperty=Object.prototype.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];(!_assignValue_hasOwnProperty.call(object,key)||!lodash_es_eq(objValue,value)||void 0===value&&!(key in object))&&_baseAssignValue(object,key,value)}__name(assignValue,"assignValue");const _assignValue=assignValue;function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index-1&&value%1==0&&value0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)}}__name(shortOut,"shortOut");const _setToString=shortOut(_baseSetToString);function baseRest(func,start){return _setToString(_overRest(func,start,lodash_es_identity),func+"")}__name(baseRest,"baseRest");const _baseRest=baseRest;function isIterateeCall(value,index,object){if(!lodash_es_isObject(object))return!1;var type=typeof index;return!!("number"==type?lodash_es_isArrayLike(object)&&_isIndex(index,object.length):"string"==type&&index in object)&&lodash_es_eq(object[index],value)}__name(isIterateeCall,"isIterateeCall");const _isIterateeCall=isIterateeCall;function createAssigner(assigner){return _baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&_isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++indexthis.themeChanged(r)))}ngOnChanges(changes){const requireRender=["type"],propertyNames=Object.getOwnPropertyNames(changes);if(propertyNames.some(key=>requireRender.includes(key))||propertyNames.every(key=>changes[key].isFirstChange()))this.render();else{const config=this.getChartConfiguration();this.chart&&(Object.assign(this.chart.config.data,config.data),Object.assign(this.chart.config.plugins,config.plugins),Object.assign(this.chart.config.options,config.options)),this.update()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(s=>s.unsubscribe())}render(){return this.chart&&this.chart.destroy(),this.zone.runOutsideAngular(()=>this.chart=new chart_esm.kL(this.ctx,this.getChartConfiguration()))}update(duration){this.chart&&this.zone.runOutsideAngular(()=>{var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.update(duration)})}hideDataset(index,hidden){this.chart&&(this.chart.getDatasetMeta(index).hidden=hidden,this.update())}isDatasetHidden(index){var _a,_b;return null===(_b=null===(_a=this.chart)||void 0===_a?void 0:_a.getDatasetMeta(index))||void 0===_b?void 0:_b.hidden}toBase64Image(){var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.toBase64Image()}themeChanged(options){this.themeOverrides=options,this.chart&&(Object.assign(this.chart.config.options,this.getChartOptions()),this.update())}getChartOptions(){return lodash_es_merge({onHover:(event,active)=>{!this.chartHover.observed&&!this.chartHover.observers.length||this.zone.run(()=>this.chartHover.emit({event,active}))},onClick:(event,active)=>{!this.chartClick.observed&&!this.chartClick.observers.length||this.zone.run(()=>this.chartClick.emit({event,active}))}},this.themeOverrides,this.options,{plugins:{legend:{display:this.legend}}})}getChartConfiguration(){return{type:this.type,data:this.getChartData(),plugins:this.plugins,options:this.getChartOptions()}}getChartData(){return this.data?this.data:{labels:this.labels||[],datasets:this.datasets||[]}}}__name(BaseChartDirective,"BaseChartDirective"),BaseChartDirective.\u0275fac=__name(function(t){return new(t||BaseChartDirective)(core.Y36(core.SBq),core.Y36(core.R0b),core.Y36(ThemeService))},"BaseChartDirective_Factory"),BaseChartDirective.\u0275dir=core.lG2({type:BaseChartDirective,selectors:[["canvas","baseChart",""]],inputs:{type:"type",legend:"legend",data:"data",options:"options",plugins:"plugins",labels:"labels",datasets:"datasets"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[core.TTD]});const baseColors=[[255,99,132],[54,162,235],[255,206,86],[231,233,237],[75,192,192],[151,187,205],[220,220,220],[247,70,74],[70,191,189],[253,180,92],[148,159,177],[77,83,96]],builtInDefaults={datasets:{line:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.4),borderColor:context=>rgba(generateColor(context.datasetIndex),1),pointBackgroundColor:context=>rgba(generateColor(context.datasetIndex),1),pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:context=>rgba(generateColor(context.datasetIndex),.8)},bar:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.6),borderColor:context=>rgba(generateColor(context.datasetIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.datasetIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.datasetIndex),1)},get radar(){return this.line},doughnut:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:"#fff",hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),1),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get pie(){return this.doughnut},polarArea:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:context=>rgba(generateColor(context.dataIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get bubble(){return this.doughnut},get scatter(){return this.doughnut},get area(){return this.polarArea}}};function rgba(colour,alpha){return"rgba("+colour.concat(alpha).join(",")+")"}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getRandomColor(){return[getRandomInt(0,255),getRandomInt(0,255),getRandomInt(0,255)]}function generateColor(index=0){return baseColors[index]||getRandomColor()}__name(rgba,"rgba"),__name(getRandomInt,"getRandomInt"),__name(getRandomColor,"getRandomColor"),__name(generateColor,"generateColor"),chart_esm.kL.register(chart_esm.Dx,chart_esm.u,chart_esm.Gu,chart_esm.De,chart_esm.ST,chart_esm.jn,chart_esm.od,chart_esm.f$,chart_esm.uw,chart_esm.vn,chart_esm.ZL,chart_esm.jI,chart_esm.qi,chart_esm.Xi,chart_esm.l7,chart_esm.tt,chart_esm.CV,chart_esm.N0,chart_esm.ho,chart_esm.RM);class NgChartsConfiguration{}__name(NgChartsConfiguration,"NgChartsConfiguration"),NgChartsConfiguration.\u0275fac=__name(function(t){return new(t||NgChartsConfiguration)},"NgChartsConfiguration_Factory"),NgChartsConfiguration.\u0275prov=core.Yz7({token:NgChartsConfiguration,factory:NgChartsConfiguration.\u0275fac,providedIn:"root"});class NgChartsModule{constructor(config){null!=config&&config.plugins&&chart_esm.kL.register(...null==config?void 0:config.plugins);const ngChartsDefaults=lodash_es_merge(builtInDefaults,(null==config?void 0:config.defaults)||{});chart_esm.ce.set(ngChartsDefaults)}static forRoot(config){return{ngModule:NgChartsModule,providers:[{provide:NgChartsConfiguration,useValue:config}]}}}__name(NgChartsModule,"NgChartsModule"),NgChartsModule.\u0275fac=__name(function(t){return new(t||NgChartsModule)(core.LFG(NgChartsConfiguration,8))},"NgChartsModule_Factory"),NgChartsModule.\u0275mod=core.oAB({type:NgChartsModule}),NgChartsModule.\u0275inj=core.cJS({imports:[[]]});var http=__webpack_require__(40520),ngx_translate_core=__webpack_require__(81981),ngx_translate_http_loader=__webpack_require__(80040);function HttpLoaderFactory(http2){return new ngx_translate_http_loader.w(http2)}__name(HttpLoaderFactory,"HttpLoaderFactory");class SharedModule{}__name(SharedModule,"SharedModule"),SharedModule.\u0275fac=__name(function(t){return new(t||SharedModule)},"SharedModule_Factory"),SharedModule.\u0275mod=core.oAB({type:SharedModule}),SharedModule.\u0275inj=core.cJS({imports:[common.ez,angular_datatables.T,fesm2015_forms.UX,fesm2015_forms.u5,NgChartsModule,http.JF,ngx_translate_core.aw.forChild({loader:{provide:ngx_translate_core.Zw,useFactory:HttpLoaderFactory,deps:[http.eN]}}),ngx_translate_core.aw]})},6912:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{a:()=>TableComponent});var _angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5e3),angular_datatables__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(65415),rxjs__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(76477),src_app_auth_services_auth_service__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(16518),_ngx_translate_core__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(81981);class TableComponent{constructor(authService,translate){this.authService=authService,this.translate=translate,this.updateInfosEvent=new _angular_core__WEBPACK_IMPORTED_MODULE_2__.vpe,this.loadMoreData=new _angular_core__WEBPACK_IMPORTED_MODULE_2__.vpe,this.dtOptions={},this.dtTrigger=new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject,this.tableBTNs=showBTNs=>showBTNs?[{extend:"colvis",className:"export-btns"},{extend:"csv",className:"export-btns"},{extend:"excel",className:"export-btns"}]:[]}ngOnChanges(changes){changes.infos&&this.rerenderTable()}ngOnInit(){var _a;this.dtOptions=this.tableOptions(this.infos,this.tableCols,null===(_a=this.currentUser)||void 0===_a?void 0:_a.email,this.showBtns),window.onresize=()=>this.rerenderTable()}ngAfterViewInit(){this.dtTrigger.next(this.dtOptions)}ngOnDestroy(){this.dtTrigger.unsubscribe()}tableOptions(tableData,cols,usrMail,showBTNs){return{data:tableData,columns:cols,responsive:!0,pagingType:"full_numbers",pageLength:5,lengthMenu:[3,5,10,25,50,100],dom:"Bfrtip",initComplete:(settings,json)=>{$("button").removeClass("dt-button"),$("button").removeClass("buttons-excel"),$("button").removeClass("buttons-html5 "),$("#DataTables_Table_0_next").on("click",()=>this.loadMoreData.emit())},buttons:this.tableBTNs(showBTNs),rowCallback:(row,data,index)=>{const self2=this;$(row).addClass("t-row"),$(row).css({"white-space":"nowrap"});let dt=data;if(dt.createdBy===usrMail||this.canCRUD){const btn=document.createElement("button");btn.textContent=this.translate.instant("Edit"),btn.setAttribute("id","tableBtn"),btn.classList.add("btn","btn-dark"),btn.onclick=()=>self2.updateInfosEvent.emit(dt);const last=$(row.lastChild);last.addClass("row-btn-container"),last.children("button").remove(),last.append(btn)}return row},language:{processing:this.translate.instant("Processing..."),search:this.translate.instant("Search:"),lengthMenu:this.translate.instant("Show _MENU_ entries"),info:this.translate.instant("Showing _START_ to _END_ of _TOTAL_ entries"),infoEmpty:this.translate.instant("Showing 0 to 0 of 0 entries"),infoFiltered:this.translate.instant("(filtered from _MAX_ total entries)"),infoPostFix:"",loadingRecords:this.translate.instant("Loading..."),zeroRecords:this.translate.instant("No matching records found"),emptyTable:this.translate.instant("No data available in table"),paginate:{first:this.translate.instant("First"),previous:this.translate.instant("Previous"),next:this.translate.instant("Next"),last:this.translate.instant("Last")},aria:{sortAscending:this.translate.instant(": activate to sort column ascending"),sortDescending:this.translate.instant(": activate to sort column descending")}}}}rerenderTable(){this.dtOptions&&this.dtElement&&this.dtElement.dtInstance.then(dtInstance=>{dtInstance.destroy(),this.dtOptions.data=this.infos,this.dtTrigger.next(this.dtOptions)})}get canCRUD(){return this.authService.canCRUDrendezvous(this.currentUser)}}__name(TableComponent,"TableComponent"),TableComponent.\u0275fac=__name(function(t){return new(t||TableComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y36(src_app_auth_services_auth_service__WEBPACK_IMPORTED_MODULE_1__.e),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y36(_ngx_translate_core__WEBPACK_IMPORTED_MODULE_4__.sK))},"TableComponent_Factory"),TableComponent.\u0275cmp=_angular_core__WEBPACK_IMPORTED_MODULE_2__.Xpm({type:TableComponent,selectors:[["app-table"]],viewQuery:__name(function(rf,ctx){if(1&rf&&_angular_core__WEBPACK_IMPORTED_MODULE_2__.Gf(angular_datatables__WEBPACK_IMPORTED_MODULE_0__.G,5),2&rf){let _t;_angular_core__WEBPACK_IMPORTED_MODULE_2__.iGM(_t=_angular_core__WEBPACK_IMPORTED_MODULE_2__.CRH())&&(ctx.dtElement=_t.first)}},"TableComponent_Query"),inputs:{infos:"infos",tableCols:"tableCols",currentUser:"currentUser",showBtns:"showBtns"},outputs:{updateInfosEvent:"updateInfosEvent",loadMoreData:"loadMoreData"},features:[_angular_core__WEBPACK_IMPORTED_MODULE_2__.TTD],decls:2,vars:2,consts:[[2,"overflow","scroll","overflow-y","hidden","padding","5px"],["datatable","",1,"table","table-responsive","row-border",2,"color","var(--template-color)",3,"dtOptions","dtTrigger"]],template:__name(function(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"div",0),_angular_core__WEBPACK_IMPORTED_MODULE_2__._UZ(1,"table",1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("dtOptions",ctx.dtOptions)("dtTrigger",ctx.dtTrigger))},"TableComponent_Template"),dependencies:[angular_datatables__WEBPACK_IMPORTED_MODULE_0__.G]})},34393:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{qi:()=>ArcElement,vn:()=>BarController,ZL:()=>BarElement,N0:()=>BubbleController,uw:()=>CategoryScale,kL:()=>Chart,jI:()=>DoughnutController,Gu:()=>index,De:()=>plugin_legend,ST:()=>LineController,jn:()=>LineElement,f$:()=>LinearScale,tt:()=>PieController,od:()=>PointElement,CV:()=>PolarAreaController,Xi:()=>RadarController,l7:()=>RadialLinearScale,ho:()=>ScatterController,RM:()=>TimeSeriesScale,Dx:()=>plugin_title,u:()=>plugin_tooltip,ce:()=>defaults}),__name(function fontString(pixelSize,fontStyle,fontFamily){return fontStyle+" "+pixelSize+"px "+fontFamily},"fontString");const requestAnimFrame="undefined"==typeof window?function(callback2){return callback2()}:window.requestAnimationFrame;function throttled(fn,thisArg,updateFn){const updateArgs=updateFn||(args2=>Array.prototype.slice.call(args2));let ticking=!1,args=[];return function(...rest){args=updateArgs(rest),ticking||(ticking=!0,requestAnimFrame.call(window,()=>{ticking=!1,fn.apply(thisArg,args)}))}}function debounce(fn,delay){let timeout;return function(...args){return delay?(clearTimeout(timeout),timeout=setTimeout(fn,delay,args)):fn.apply(this,args),delay}}__name(throttled,"throttled"),__name(debounce,"debounce");const _toLeftRightCenter=__name(align=>"start"===align?"left":"end"===align?"right":"center","_toLeftRightCenter"),_alignStartEnd=__name((align,start,end)=>"start"===align?start:"end"===align?end:(start+end)/2,"_alignStartEnd"),_textX=__name((align,left,right,rtl)=>align===(rtl?"left":"right")?right:"center"===align?(left+right)/2:left,"_textX");function noop(){}__name(noop,"noop");const uid=function(){let id=0;return function(){return id++}}();function isNullOrUndef(value){return null==value}function isArray(value){if(Array.isArray&&Array.isArray(value))return!0;const type=Object.prototype.toString.call(value);return"[object"===type.slice(0,7)&&"Array]"===type.slice(-6)}function isObject(value){return null!==value&&"[object Object]"===Object.prototype.toString.call(value)}__name(isNullOrUndef,"isNullOrUndef"),__name(isArray,"isArray"),__name(isObject,"isObject");const isNumberFinite=__name(value=>("number"==typeof value||value instanceof Number)&&isFinite(+value),"isNumberFinite");function finiteOrDefault(value,defaultValue){return isNumberFinite(value)?value:defaultValue}function valueOrDefault(value,defaultValue){return void 0===value?defaultValue:value}__name(finiteOrDefault,"finiteOrDefault"),__name(valueOrDefault,"valueOrDefault");const toPercentage=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100:value/dimension,"toPercentage"),toDimension=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100*dimension:+value,"toDimension");function callback(fn,args,thisArg){if(fn&&"function"==typeof fn.call)return fn.apply(thisArg,args)}function each(loopable,fn,thisArg,reverse){let i,len,keys;if(isArray(loopable))if(len=loopable.length,reverse)for(i=len-1;i>=0;i--)fn.call(thisArg,loopable[i],i);else for(i=0;ipos;)obj=obj[key.slice(pos,idx)],pos=idx+1,idx=indexOfDotOrLength(key,pos);return obj}function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1)}__name(indexOfDotOrLength,"indexOfDotOrLength"),__name(resolveObjectKey,"resolveObjectKey"),__name(_capitalize,"_capitalize");const defined=__name(value=>void 0!==value,"defined"),isFunction=__name(value=>"function"==typeof value,"isFunction"),setsEqual=__name((a,b)=>{if(a.size!==b.size)return!1;for(const item of a)if(!b.has(item))return!1;return!0},"setsEqual");function _isClickEvent(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}__name(_isClickEvent,"_isClickEvent");const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=2*PI/3,log10=Math.log10,sign=Math.sign;function niceNum(range){const roundedRange=Math.round(range);range=almostEquals(range,roundedRange,range/1e3)?roundedRange:range;const niceRange=Math.pow(10,Math.floor(log10(range))),fraction=range/niceRange;return(fraction<=1?1:fraction<=2?2:fraction<=5?5:10)*niceRange}function _factorize(value){const result=[],sqrt=Math.sqrt(value);let i;for(i=1;ia-b).pop(),result}function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}function almostEquals(x,y,epsilon){return Math.abs(x-y)=x}function _setMinAndMaxByKey(array,target,property){let i,ilen,value;for(i=0,ilen=array.length;iangleToEnd&&startToAngle=Math.min(start,end)-epsilon&&value<=Math.max(start,end)+epsilon}__name(niceNum,"niceNum"),__name(_factorize,"_factorize"),__name(isNumber,"isNumber"),__name(almostEquals,"almostEquals"),__name(almostWhole,"almostWhole"),__name(_setMinAndMaxByKey,"_setMinAndMaxByKey"),__name(toRadians,"toRadians"),__name(toDegrees,"toDegrees"),__name(_decimalPlaces,"_decimalPlaces"),__name(getAngleFromPoint,"getAngleFromPoint"),__name(distanceBetweenPoints,"distanceBetweenPoints"),__name(_angleDiff,"_angleDiff"),__name(_normalizeAngle,"_normalizeAngle"),__name(_angleBetween,"_angleBetween"),__name(_limitValue,"_limitValue"),__name(_int16Range,"_int16Range"),__name(_isBetween,"_isBetween");const atEdge=__name(t=>0===t||1===t,"atEdge"),elasticIn=__name((t,s,p)=>-Math.pow(2,10*(t-=1))*Math.sin((t-s)*TAU/p),"elasticIn"),elasticOut=__name((t,s,p)=>Math.pow(2,-10*t)*Math.sin((t-s)*TAU/p)+1,"elasticOut"),effects={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*HALF_PI),easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>atEdge(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic:t=>atEdge(t)?t:t<.5?.5*elasticIn(2*t,.1125,.45):.5+.5*elasticOut(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let s=1.70158;return(t/=.5)<1?t*t*((1+(s*=1.525))*t-s)*.5:.5*((t-=2)*t*((1+(s*=1.525))*t+s)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,easeInOutBounce:t=>t<.5?.5*effects.easeInBounce(2*t):.5*effects.easeOutBounce(2*t-1)+.5};function round(v){return v+.5|0}__name(round,"round");const lim=__name((v,l,h)=>Math.max(Math.min(v,h),l),"lim");function p2b(v){return lim(round(2.55*v),0,255)}function n2b(v){return lim(round(255*v),0,255)}function b2n(v){return lim(round(v/2.55)/100,0,1)}function n2p(v){return lim(round(100*v),0,100)}__name(p2b,"p2b"),__name(n2b,"n2b"),__name(b2n,"b2n"),__name(n2p,"n2p");const map$1={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},hex=[..."0123456789ABCDEF"],h1=__name(b=>hex[15&b],"h1"),h2=__name(b=>hex[(240&b)>>4]+hex[15&b],"h2"),eq=__name(b=>(240&b)>>4==(15&b),"eq"),isShort=__name(v=>eq(v.r)&&eq(v.g)&&eq(v.b)&&eq(v.a),"isShort");function hexParse(str){var ret,len=str.length;return"#"===str[0]&&(4===len||5===len?ret={r:255&17*map$1[str[1]],g:255&17*map$1[str[2]],b:255&17*map$1[str[3]],a:5===len?17*map$1[str[4]]:255}:(7===len||9===len)&&(ret={r:map$1[str[1]]<<4|map$1[str[2]],g:map$1[str[3]]<<4|map$1[str[4]],b:map$1[str[5]]<<4|map$1[str[6]],a:9===len?map$1[str[7]]<<4|map$1[str[8]]:255})),ret}__name(hexParse,"hexParse");const alpha=__name((a,f)=>a<255?f(a):"","alpha");function hexString(v){var f=isShort(v)?h1:h2;return v?"#"+f(v.r)+f(v.g)+f(v.b)+alpha(v.a,f):void 0}__name(hexString,"hexString");const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(h,s,l){const a=s*Math.min(l,1-l),f=__name((n,k=(n+h/30)%12)=>l-a*Math.max(Math.min(k-3,9-k,1),-1),"f");return[f(0),f(8),f(4)]}function hsv2rgbn(h,s,v){const f=__name((n,k=(n+h/60)%6)=>v-v*s*Math.max(Math.min(k,4-k,1),0),"f");return[f(5),f(3),f(1)]}function hwb2rgbn(h,w,b){const rgb=hsl2rgbn(h,1,.5);let i;for(w+b>1&&(i=1/(w+b),w*=i,b*=i),i=0;i<3;i++)rgb[i]*=1-w-b,rgb[i]+=w;return rgb}function hueValue(r,g,b,d,max){return r===max?(g-b)/d+(g.5?d/(2-max-min):d/(max+min),h=hueValue(r,g,b,d,max),h=60*h+.5),[0|h,s||0,l]}function calln(f,a,b,c){return(Array.isArray(a)?f(a[0],a[1],a[2]):f(a,b,c)).map(n2b)}function hsl2rgb(h,s,l){return calln(hsl2rgbn,h,s,l)}function hwb2rgb(h,w,b){return calln(hwb2rgbn,h,w,b)}function hsv2rgb(h,s,v){return calln(hsv2rgbn,h,s,v)}function hue(h){return(h%360+360)%360}function hueParse(str){const m=HUE_RE.exec(str);let v,a=255;if(!m)return;m[5]!==v&&(a=m[6]?p2b(+m[5]):n2b(+m[5]));const h=hue(+m[2]),p1=+m[3]/100,p2=+m[4]/100;return v="hwb"===m[1]?hwb2rgb(h,p1,p2):"hsv"===m[1]?hsv2rgb(h,p1,p2):hsl2rgb(h,p1,p2),{r:v[0],g:v[1],b:v[2],a}}function rotate(v,deg){var h=rgb2hsl(v);h[0]=hue(h[0]+deg),h=hsl2rgb(h),v.r=h[0],v.g=h[1],v.b=h[2]}function hslString(v){if(!v)return;const a=rgb2hsl(v),h=a[0],s=n2p(a[1]),l=n2p(a[2]);return v.a<255?`hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`:`hsl(${h}, ${s}%, ${l}%)`}__name(hsl2rgbn,"hsl2rgbn"),__name(hsv2rgbn,"hsv2rgbn"),__name(hwb2rgbn,"hwb2rgbn"),__name(hueValue,"hueValue"),__name(rgb2hsl,"rgb2hsl"),__name(calln,"calln"),__name(hsl2rgb,"hsl2rgb"),__name(hwb2rgb,"hwb2rgb"),__name(hsv2rgb,"hsv2rgb"),__name(hue,"hue"),__name(hueParse,"hueParse"),__name(rotate,"rotate"),__name(hslString,"hslString");const map={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"},names$1={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 unpack(){const unpacked={},keys=Object.keys(names$1),tkeys=Object.keys(map);let i,j,k,ok,nk;for(i=0;i>16&255,k>>8&255,255&k]}return unpacked}let names;function nameParse(str){names||(names=unpack(),names.transparent=[0,0,0,0]);const a=names[str.toLowerCase()];return a&&{r:a[0],g:a[1],b:a[2],a:4===a.length?a[3]:255}}__name(unpack,"unpack"),__name(nameParse,"nameParse");const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(str){const m=RGB_RE.exec(str);let r,g,b,a=255;if(m){if(m[7]!==r){const v=+m[7];a=m[8]?p2b(v):lim(255*v,0,255)}return r=+m[1],g=+m[3],b=+m[5],r=255&(m[2]?p2b(r):lim(r,0,255)),g=255&(m[4]?p2b(g):lim(g,0,255)),b=255&(m[6]?p2b(b):lim(b,0,255)),{r,g,b,a}}}function rgbString(v){return v&&(v.a<255?`rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`:`rgb(${v.r}, ${v.g}, ${v.b})`)}__name(rgbParse,"rgbParse"),__name(rgbString,"rgbString");const to=__name(v=>v<=.0031308?12.92*v:1.055*Math.pow(v,1/2.4)-.055,"to"),from=__name(v=>v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4),"from");function interpolate(rgb1,rgb2,t){const r=from(b2n(rgb1.r)),g=from(b2n(rgb1.g)),b=from(b2n(rgb1.b));return{r:n2b(to(r+t*(from(b2n(rgb2.r))-r))),g:n2b(to(g+t*(from(b2n(rgb2.g))-g))),b:n2b(to(b+t*(from(b2n(rgb2.b))-b))),a:rgb1.a+t*(rgb2.a-rgb1.a)}}function modHSL(v,i,ratio){if(v){let tmp=rgb2hsl(v);tmp[i]=Math.max(0,Math.min(tmp[i]+tmp[i]*ratio,0===i?360:1)),tmp=hsl2rgb(tmp),v.r=tmp[0],v.g=tmp[1],v.b=tmp[2]}}function clone(v,proto){return v&&Object.assign(proto||{},v)}function fromObject(input){var v={r:0,g:0,b:0,a:255};return Array.isArray(input)?input.length>=3&&(v={r:input[0],g:input[1],b:input[2],a:255},input.length>3&&(v.a=n2b(input[3]))):(v=clone(input,{r:0,g:0,b:0,a:1})).a=n2b(v.a),v}function functionParse(str){return"r"===str.charAt(0)?rgbParse(str):hueParse(str)}__name(interpolate,"interpolate"),__name(modHSL,"modHSL"),__name(clone,"clone"),__name(fromObject,"fromObject"),__name(functionParse,"functionParse");class Color{constructor(input){if(input instanceof Color)return input;const type=typeof input;let v;"object"===type?v=fromObject(input):"string"===type&&(v=hexParse(input)||nameParse(input)||functionParse(input)),this._rgb=v,this._valid=!!v}get valid(){return this._valid}get rgb(){var v=clone(this._rgb);return v&&(v.a=b2n(v.a)),v}set rgb(obj){this._rgb=fromObject(obj)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(color2,weight){if(color2){const c1=this.rgb,c2=color2.rgb;let w2;const p=weight===w2?.5:weight,w=2*p-1,a=c1.a-c2.a,w1=((w*a==-1?w:(w+a)/(1+w*a))+1)/2;w2=1-w1,c1.r=255&w1*c1.r+w2*c2.r+.5,c1.g=255&w1*c1.g+w2*c2.g+.5,c1.b=255&w1*c1.b+w2*c2.b+.5,c1.a=p*c1.a+(1-p)*c2.a,this.rgb=c1}return this}interpolate(color2,t){return color2&&(this._rgb=interpolate(this._rgb,color2._rgb,t)),this}clone(){return new Color(this.rgb)}alpha(a){return this._rgb.a=n2b(a),this}clearer(ratio){return this._rgb.a*=1-ratio,this}greyscale(){const rgb=this._rgb,val=round(.3*rgb.r+.59*rgb.g+.11*rgb.b);return rgb.r=rgb.g=rgb.b=val,this}opaquer(ratio){return this._rgb.a*=1+ratio,this}negate(){const v=this._rgb;return v.r=255-v.r,v.g=255-v.g,v.b=255-v.b,this}lighten(ratio){return modHSL(this._rgb,2,ratio),this}darken(ratio){return modHSL(this._rgb,2,-ratio),this}saturate(ratio){return modHSL(this._rgb,1,ratio),this}desaturate(ratio){return modHSL(this._rgb,1,-ratio),this}rotate(deg){return rotate(this._rgb,deg),this}}function index_esm(input){return new Color(input)}function isPatternOrGradient(value){if(value&&"object"==typeof value){const type=value.toString();return"[object CanvasPattern]"===type||"[object CanvasGradient]"===type}return!1}function color(value){return isPatternOrGradient(value)?value:index_esm(value)}function getHoverColor(value){return isPatternOrGradient(value)?value:index_esm(value).saturate(.5).darken(.1).hexString()}__name(Color,"Color"),__name(index_esm,"index_esm"),__name(isPatternOrGradient,"isPatternOrGradient"),__name(color,"color"),__name(getHoverColor,"getHoverColor");const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(node,key){if(!key)return node;const keys=key.split(".");for(let i=0,n=keys.length;icontext.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=(ctx,options)=>getHoverColor(options.backgroundColor),this.hoverBorderColor=(ctx,options)=>getHoverColor(options.borderColor),this.hoverColor=(ctx,options)=>getHoverColor(options.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(_descriptors2)}set(scope,values){return set(this,scope,values)}get(scope){return getScope$1(this,scope)}describe(scope,values){return set(descriptors,scope,values)}override(scope,values){return set(overrides,scope,values)}route(scope,name,targetScope,targetName){const scopeObject=getScope$1(this,scope),targetScopeObject=getScope$1(this,targetScope),privateName="_"+name;Object.defineProperties(scopeObject,{[privateName]:{value:scopeObject[name],writable:!0},[name]:{enumerable:!0,get(){const local=this[privateName],target=targetScopeObject[targetName];return isObject(local)?Object.assign({},target,local):valueOrDefault(local,target)},set(value){this[privateName]=value}}})}}__name(Defaults,"Defaults");var defaults=new Defaults({_scriptable:name=>!name.startsWith("on"),_indexable:name=>"events"!==name,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function toFontString(font){return!font||isNullOrUndef(font.size)||isNullOrUndef(font.family)?null:(font.style?font.style+" ":"")+(font.weight?font.weight+" ":"")+font.size+"px "+font.family}function _measureText(ctx,data,gc,longest,string){let textWidth=data[string];return textWidth||(textWidth=data[string]=ctx.measureText(string).width,gc.push(string)),textWidth>longest&&(longest=textWidth),longest}function _longestText(ctx,font,arrayOfThings,cache){let data=(cache=cache||{}).data=cache.data||{},gc=cache.garbageCollect=cache.garbageCollect||[];cache.font!==font&&(data=cache.data={},gc=cache.garbageCollect=[],cache.font=font),ctx.save(),ctx.font=font;let longest=0;const ilen=arrayOfThings.length;let i,j,jlen,thing,nestedThing;for(i=0;iarrayOfThings.length){for(i=0;i0&&ctx.stroke()}}function _isPointInArea(point,area,margin){return margin=margin||.5,!area||point&&point.x>area.left-margin&&point.xarea.top-margin&&point.y0&&""!==opts.strokeColor;let i,line;for(ctx.save(),ctx.font=font.string,setRenderOpts(ctx,opts),i=0;i+v||0,"numberOrZero");function _readValueToProps(value,props){const ret={},objProps=isObject(props),keys=objProps?Object.keys(props):props,read=isObject(value)?objProps?prop=>valueOrDefault(value[prop],value[props[prop]]):prop=>value[prop]:()=>value;for(const prop of keys)ret[prop]=numberOrZero(read(prop));return ret}function toTRBL(value){return _readValueToProps(value,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(value){return _readValueToProps(value,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(value){const obj=toTRBL(value);return obj.width=obj.left+obj.right,obj.height=obj.top+obj.bottom,obj}function toFont(options,fallback){options=options||{},fallback=fallback||defaults.font;let size=valueOrDefault(options.size,fallback.size);"string"==typeof size&&(size=parseInt(size,10));let style=valueOrDefault(options.style,fallback.style);style&&!(""+style).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+style+'"'),style="");const font={family:valueOrDefault(options.family,fallback.family),lineHeight:toLineHeight(valueOrDefault(options.lineHeight,fallback.lineHeight),size),size,style,weight:valueOrDefault(options.weight,fallback.weight),string:""};return font.string=toFontString(font),font}function resolve(inputs,context,index2,info){let i,ilen,value,cacheable=!0;for(i=0,ilen=inputs.length;ibeginAtZero&&0===value?0:value+add,"keepZero");return{min:keepZero(min,-Math.abs(change)),max:keepZero(max,change)}}function createContext(parentContext,context){return Object.assign(Object.create(parentContext),context)}function _lookup(table,value,cmp){cmp=cmp||(index2=>table[index2]1;)mid=lo+hi>>1,cmp(mid)?lo=mid:hi=mid;return{lo,hi}}__name(_readValueToProps,"_readValueToProps"),__name(toTRBL,"toTRBL"),__name(toTRBLCorners,"toTRBLCorners"),__name(toPadding,"toPadding"),__name(toFont,"toFont"),__name(resolve,"resolve"),__name(_addGrace,"_addGrace"),__name(createContext,"createContext"),__name(_lookup,"_lookup");const _lookupByKey=__name((table,key,value)=>_lookup(table,value,index2=>table[index2][key]_lookup(table,value,index2=>table[index2][key]>=value),"_rlookupByKey");function _filterBetween(values,min,max){let start=0,end=values.length;for(;startstart&&values[end-1]>max;)end--;return start>0||end{const method="_onData"+_capitalize(key),base=array[key];Object.defineProperty(array,key,{configurable:!0,enumerable:!1,value(...args){const res=base.apply(this,args);return array._chartjs.listeners.forEach(object=>{"function"==typeof object[method]&&object[method](...args)}),res}})}))}function unlistenArrayEvents(array,listener){const stub=array._chartjs;if(!stub)return;const listeners=stub.listeners,index2=listeners.indexOf(listener);-1!==index2&&listeners.splice(index2,1),!(listeners.length>0)&&(arrayEvents.forEach(key=>{delete array[key]}),delete array._chartjs)}function _arrayUnique(items){const set2=new Set;let i,ilen;for(i=0,ilen=items.length;iscopes[0])){defined(fallback)||(fallback=_resolve("_fallback",scopes));const cache={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:scopes,_rootScopes:rootScopes,_fallback:fallback,_getTarget:getTarget,override:scope=>_createResolver([scope,...scopes],prefixes,rootScopes,fallback)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete target._keys,delete scopes[0][prop],!0),get:(target,prop)=>_cached(target,prop,()=>_resolveWithPrefixes(prop,prefixes,scopes,target)),getOwnPropertyDescriptor:(target,prop)=>Reflect.getOwnPropertyDescriptor(target._scopes[0],prop),getPrototypeOf:()=>Reflect.getPrototypeOf(scopes[0]),has:(target,prop)=>getKeysFromAllScopes(target).includes(prop),ownKeys:target=>getKeysFromAllScopes(target),set(target,prop,value){const storage=target._storage||(target._storage=getTarget());return target[prop]=storage[prop]=value,delete target._keys,!0}})}function _attachContext(proxy,context,subProxy,descriptorDefaults){const cache={_cacheable:!1,_proxy:proxy,_context:context,_subProxy:subProxy,_stack:new Set,_descriptors:_descriptors(proxy,descriptorDefaults),setContext:ctx=>_attachContext(proxy,ctx,subProxy,descriptorDefaults),override:scope=>_attachContext(proxy.override(scope),context,subProxy,descriptorDefaults)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete proxy[prop],!0),get:(target,prop,receiver)=>_cached(target,prop,()=>_resolveWithContext(target,prop,receiver)),getOwnPropertyDescriptor:(target,prop)=>target._descriptors.allKeys?Reflect.has(proxy,prop)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(proxy,prop),getPrototypeOf:()=>Reflect.getPrototypeOf(proxy),has:(target,prop)=>Reflect.has(proxy,prop),ownKeys:()=>Reflect.ownKeys(proxy),set:(target,prop,value)=>(proxy[prop]=value,delete target[prop],!0)})}function _descriptors(proxy,defaults2={scriptable:!0,indexable:!0}){const{_scriptable=defaults2.scriptable,_indexable=defaults2.indexable,_allKeys=defaults2.allKeys}=proxy;return{allKeys:_allKeys,scriptable:_scriptable,indexable:_indexable,isScriptable:isFunction(_scriptable)?_scriptable:()=>_scriptable,isIndexable:isFunction(_indexable)?_indexable:()=>_indexable}}__name(listenArrayEvents,"listenArrayEvents"),__name(unlistenArrayEvents,"unlistenArrayEvents"),__name(_arrayUnique,"_arrayUnique"),__name(_createResolver,"_createResolver"),__name(_attachContext,"_attachContext"),__name(_descriptors,"_descriptors");const readKey=__name((prefix,name)=>prefix?prefix+_capitalize(name):name,"readKey"),needsSubResolver=__name((prop,value)=>isObject(value)&&"adapters"!==prop&&(null===Object.getPrototypeOf(value)||value.constructor===Object),"needsSubResolver");function _cached(target,prop,resolve2){if(Object.prototype.hasOwnProperty.call(target,prop))return target[prop];const value=resolve2();return target[prop]=value,value}function _resolveWithContext(target,prop,receiver){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;let value=_proxy[prop];return isFunction(value)&&descriptors2.isScriptable(prop)&&(value=_resolveScriptable(prop,value,target,receiver)),isArray(value)&&value.length&&(value=_resolveArray(prop,value,target,descriptors2.isIndexable)),needsSubResolver(prop,value)&&(value=_attachContext(value,_context,_subProxy&&_subProxy[prop],descriptors2)),value}function _resolveScriptable(prop,value,target,receiver){const{_proxy,_context,_subProxy,_stack}=target;if(_stack.has(prop))throw new Error("Recursion detected: "+Array.from(_stack).join("->")+"->"+prop);return _stack.add(prop),value=value(_context,_subProxy||receiver),_stack.delete(prop),needsSubResolver(prop,value)&&(value=createSubResolver(_proxy._scopes,_proxy,prop,value)),value}function _resolveArray(prop,value,target,isIndexable){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;if(defined(_context.index)&&isIndexable(prop))value=value[_context.index%value.length];else if(isObject(value[0])){const arr=value,scopes=_proxy._scopes.filter(s=>s!==arr);value=[];for(const item of arr){const resolver=createSubResolver(scopes,_proxy,prop,item);value.push(_attachContext(resolver,_context,_subProxy&&_subProxy[prop],descriptors2))}}return value}function resolveFallback(fallback,prop,value){return isFunction(fallback)?fallback(prop,value):fallback}__name(_cached,"_cached"),__name(_resolveWithContext,"_resolveWithContext"),__name(_resolveScriptable,"_resolveScriptable"),__name(_resolveArray,"_resolveArray"),__name(resolveFallback,"resolveFallback");const getScope=__name((key,parent)=>!0===key?parent:"string"==typeof key?resolveObjectKey(parent,key):void 0,"getScope");function addScopes(set2,parentScopes,key,parentFallback,value){for(const parent of parentScopes){const scope=getScope(key,parent);if(scope){set2.add(scope);const fallback=resolveFallback(scope._fallback,key,value);if(defined(fallback)&&fallback!==key&&fallback!==parentFallback)return fallback}else if(!1===scope&&defined(parentFallback)&&key!==parentFallback)return null}return!1}function createSubResolver(parentScopes,resolver,prop,value){const rootScopes=resolver._rootScopes,fallback=resolveFallback(resolver._fallback,prop,value),allScopes=[...parentScopes,...rootScopes],set2=new Set;set2.add(value);let key=addScopesFromKey(set2,allScopes,prop,fallback||prop,value);return!(null===key||defined(fallback)&&fallback!==prop&&(key=addScopesFromKey(set2,allScopes,fallback,key,value),null===key))&&_createResolver(Array.from(set2),[""],rootScopes,fallback,()=>subGetTarget(resolver,prop,value))}function addScopesFromKey(set2,allScopes,key,fallback,item){for(;key;)key=addScopes(set2,allScopes,key,fallback,item);return key}function subGetTarget(resolver,prop,value){const parent=resolver._getTarget();prop in parent||(parent[prop]={});const target=parent[prop];return isArray(target)&&isObject(value)?value:target}function _resolveWithPrefixes(prop,prefixes,scopes,proxy){let value;for(const prefix of prefixes)if(value=_resolve(readKey(prefix,prop),scopes),defined(value))return needsSubResolver(prop,value)?createSubResolver(scopes,proxy,prop,value):value}function _resolve(key,scopes){for(const scope of scopes){if(!scope)continue;const value=scope[key];if(defined(value))return value}}function getKeysFromAllScopes(target){let keys=target._keys;return keys||(keys=target._keys=resolveKeysFromAllScopes(target._scopes)),keys}function resolveKeysFromAllScopes(scopes){const set2=new Set;for(const scope of scopes)for(const key of Object.keys(scope).filter(k=>!k.startsWith("_")))set2.add(key);return Array.from(set2)}function _parseObjectDataRadialScale(meta,data,start,count){const{iScale}=meta,{key="r"}=this._parsing,parsed=new Array(count);let i,ilen,index2,item;for(i=0,ilen=count;ii"x"===indexAxis?"y":"x","getValueAxis");function splineCurve(firstPoint,middlePoint,afterPoint,t){const previous=firstPoint.skip?middlePoint:firstPoint,current=middlePoint,next=afterPoint.skip?middlePoint:afterPoint,d01=distanceBetweenPoints(current,previous),d12=distanceBetweenPoints(next,current);let s01=d01/(d01+d12),s12=d12/(d01+d12);s01=isNaN(s01)?0:s01,s12=isNaN(s12)?0:s12;const fa=t*s01,fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}}}function monotoneAdjust(points,deltaK,mK){const pointsLen=points.length;let alphaK,betaK,tauK,squaredMagnitude,pointCurrent,pointAfter=getPoint(points,0);for(let i=0;i!pt.skip)),"monotone"===options.cubicInterpolationMode)splineCurveMonotone(points,indexAxis);else{let prev=loop?points[points.length-1]:points[0];for(i=0,ilen=points.length;iwindow.getComputedStyle(element,null),"getComputedStyle");function getStyle(el,property){return getComputedStyle(el).getPropertyValue(property)}__name(getStyle,"getStyle");const positions=["top","right","bottom","left"];function getPositionedStyle(styles,style,suffix){const result={};suffix=suffix?"-"+suffix:"";for(let i=0;i<4;i++){const pos=positions[i];result[pos]=parseFloat(styles[style+"-"+pos+suffix])||0}return result.width=result.left+result.right,result.height=result.top+result.bottom,result}__name(getPositionedStyle,"getPositionedStyle");const useOffsetPos=__name((x,y,target)=>(x>0||y>0)&&(!target||!target.shadowRoot),"useOffsetPos");function getCanvasPosition(e,canvas){const touches=e.touches,source=touches&&touches.length?touches[0]:e,{offsetX,offsetY}=source;let x,y,box=!1;if(useOffsetPos(offsetX,offsetY,e.target))x=offsetX,y=offsetY;else{const rect=canvas.getBoundingClientRect();x=source.clientX-rect.left,y=source.clientY-rect.top,box=!0}return{x,y,box}}function getRelativePosition(evt,chart){if("native"in evt)return evt;const{canvas,currentDevicePixelRatio}=chart,style=getComputedStyle(canvas),borderBox="border-box"===style.boxSizing,paddings=getPositionedStyle(style,"padding"),borders=getPositionedStyle(style,"border","width"),{x,y,box}=getCanvasPosition(evt,canvas),xOffset=paddings.left+(box&&borders.left),yOffset=paddings.top+(box&&borders.top);let{width,height}=chart;return borderBox&&(width-=paddings.width+borders.width,height-=paddings.height+borders.height),{x:Math.round((x-xOffset)/width*canvas.width/currentDevicePixelRatio),y:Math.round((y-yOffset)/height*canvas.height/currentDevicePixelRatio)}}function getContainerSize(canvas,width,height){let maxWidth,maxHeight;if(void 0===width||void 0===height){const container=_getParentNode(canvas);if(container){const rect=container.getBoundingClientRect(),containerStyle=getComputedStyle(container),containerBorder=getPositionedStyle(containerStyle,"border","width"),containerPadding=getPositionedStyle(containerStyle,"padding");width=rect.width-containerPadding.width-containerBorder.width,height=rect.height-containerPadding.height-containerBorder.height,maxWidth=parseMaxStyle(containerStyle.maxWidth,container,"clientWidth"),maxHeight=parseMaxStyle(containerStyle.maxHeight,container,"clientHeight")}else width=canvas.clientWidth,height=canvas.clientHeight}return{width,height,maxWidth:maxWidth||INFINITY,maxHeight:maxHeight||INFINITY}}__name(getCanvasPosition,"getCanvasPosition"),__name(getRelativePosition,"getRelativePosition"),__name(getContainerSize,"getContainerSize");const round1=__name(v=>Math.round(10*v)/10,"round1");function getMaximumSize(canvas,bbWidth,bbHeight,aspectRatio){const style=getComputedStyle(canvas),margins=getPositionedStyle(style,"margin"),maxWidth=parseMaxStyle(style.maxWidth,canvas,"clientWidth")||INFINITY,maxHeight=parseMaxStyle(style.maxHeight,canvas,"clientHeight")||INFINITY,containerSize=getContainerSize(canvas,bbWidth,bbHeight);let{width,height}=containerSize;if("content-box"===style.boxSizing){const borders=getPositionedStyle(style,"border","width"),paddings=getPositionedStyle(style,"padding");width-=paddings.width+borders.width,height-=paddings.height+borders.height}return width=Math.max(0,width-margins.width),height=Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height-margins.height),width=round1(Math.min(width,maxWidth,containerSize.maxWidth)),height=round1(Math.min(height,maxHeight,containerSize.maxHeight)),width&&!height&&(height=round1(width/2)),{width,height}}function retinaScale(chart,forceRatio,forceStyle){const pixelRatio=forceRatio||1,deviceHeight=Math.floor(chart.height*pixelRatio),deviceWidth=Math.floor(chart.width*pixelRatio);chart.height=deviceHeight/pixelRatio,chart.width=deviceWidth/pixelRatio;const canvas=chart.canvas;return canvas.style&&(forceStyle||!canvas.style.height&&!canvas.style.width)&&(canvas.style.height=`${chart.height}px`,canvas.style.width=`${chart.width}px`),(chart.currentDevicePixelRatio!==pixelRatio||canvas.height!==deviceHeight||canvas.width!==deviceWidth)&&(chart.currentDevicePixelRatio=pixelRatio,canvas.height=deviceHeight,canvas.width=deviceWidth,chart.ctx.setTransform(pixelRatio,0,0,pixelRatio,0,0),!0)}__name(getMaximumSize,"getMaximumSize"),__name(retinaScale,"retinaScale");const supportsEventListenerOptions=function(){let passiveSupported=!1;try{const options={get passive(){return passiveSupported=!0,!1}};window.addEventListener("test",null,options),window.removeEventListener("test",null,options)}catch{}return passiveSupported}();function readUsedSize(element,property){const value=getStyle(element,property),matches=value&&value.match(/^(\d+)(\.\d+)?px$/);return matches?+matches[1]:void 0}function _pointInLine(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:p1.y+t*(p2.y-p1.y)}}function _steppedInterpolation(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:"middle"===mode?t<.5?p1.y:p2.y:"after"===mode?t<1?p1.y:p2.y:t>0?p2.y:p1.y}}function _bezierInterpolation(p1,p2,t,mode){const cp1={x:p1.cp2x,y:p1.cp2y},cp2={x:p2.cp1x,y:p2.cp1y},a=_pointInLine(p1,cp1,t),b=_pointInLine(cp1,cp2,t),c=_pointInLine(cp2,p2,t),d=_pointInLine(a,b,t),e=_pointInLine(b,c,t);return _pointInLine(d,e,t)}__name(readUsedSize,"readUsedSize"),__name(_pointInLine,"_pointInLine"),__name(_steppedInterpolation,"_steppedInterpolation"),__name(_bezierInterpolation,"_bezierInterpolation");const intlCache=new Map;function getNumberFormat(locale,options){options=options||{};const cacheKey=locale+JSON.stringify(options);let formatter=intlCache.get(cacheKey);return formatter||(formatter=new Intl.NumberFormat(locale,options),intlCache.set(cacheKey,formatter)),formatter}function formatNumber(num,locale,options){return getNumberFormat(locale,options).format(num)}__name(getNumberFormat,"getNumberFormat"),__name(formatNumber,"formatNumber");const getRightToLeftAdapter=__name(function(rectX,width){return{x:x=>rectX+rectX+width-x,setWidth(w){width=w},textAlign:align=>"center"===align?align:"right"===align?"left":"right",xPlus:(x,value)=>x-value,leftForLtr:(x,itemWidth)=>x-itemWidth}},"getRightToLeftAdapter"),getLeftToRightAdapter=__name(function(){return{x:x=>x,setWidth(w){},textAlign:align=>align,xPlus:(x,value)=>x+value,leftForLtr:(x,_itemWidth)=>x}},"getLeftToRightAdapter");function getRtlAdapter(rtl,rectX,width){return rtl?getRightToLeftAdapter(rectX,width):getLeftToRightAdapter()}function overrideTextDirection(ctx,direction){let style,original;("ltr"===direction||"rtl"===direction)&&(style=ctx.canvas.style,original=[style.getPropertyValue("direction"),style.getPropertyPriority("direction")],style.setProperty("direction",direction,"important"),ctx.prevTextDirection=original)}function restoreTextDirection(ctx,original){void 0!==original&&(delete ctx.prevTextDirection,ctx.canvas.style.setProperty("direction",original[0],original[1]))}function propertyFn(property){return"angle"===property?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(a,b)=>a-b,normalize:x=>x}}function normalizeSegment({start,end,count,loop,style}){return{start:start%count,end:end%count,loop:loop&&(end-start+1)%count==0,style}}function getSegment(segment,points,bounds){const{property,start:startBound,end:endBound}=bounds,{between,normalize}=propertyFn(property),count=points.length;let i,ilen,{start,end,loop}=segment;if(loop){for(start+=count,end+=count,i=0,ilen=count;ibetween(startBound,prevValue,value)&&0!==compare(startBound,prevValue),"startIsBefore"),endIsBefore=__name(()=>0===compare(endBound,value)||between(endBound,prevValue,value),"endIsBefore"),shouldStart=__name(()=>inside||startIsBefore(),"shouldStart"),shouldStop=__name(()=>!inside||endIsBefore(),"shouldStop");for(let i=start,prev=start;i<=end;++i)point=points[i%count],!point.skip&&(value=normalize(point[property]),value!==prevValue&&(inside=between(value,startBound,endBound),null===subStart&&shouldStart()&&(subStart=0===compare(value,startBound)?i:prev),null!==subStart&&shouldStop()&&(result.push(normalizeSegment({start:subStart,end:i,loop,count,style})),subStart=null),prev=i,prevValue=value));return null!==subStart&&result.push(normalizeSegment({start:subStart,end,loop,count,style})),result}function _boundSegments(line,bounds){const result=[],segments=line.segments;for(let i=0;istart&&points[end%count].skip;)end--;return end%=count,{start,end}}function solidSegments(points,start,max,loop){const count=points.length,result=[];let end,last=start,prev=points[start];for(end=start+1;end<=max;++end){const cur=points[end%count];cur.skip||cur.stop?prev.skip||(loop=!1,result.push({start:start%count,end:(end-1)%count,loop}),start=last=cur.stop?end:null):(last=end,prev.skip&&(start=end)),prev=cur}return null!==last&&result.push({start:start%count,end:last%count,loop}),result}function _computeSegments(line,segmentOptions){const points=line.points,spanGaps=line.options.spanGaps,count=points.length;if(!count)return[];const loop=!!line._loop,{start,end}=findStartAndEnd(points,count,loop,spanGaps);if(!0===spanGaps)return splitByStyles(line,[{start,end,loop}],points,segmentOptions);return splitByStyles(line,solidSegments(points,start,endfn({chart,initial:anims.initial,numSteps,currentStep:Math.min(date-anims.start,numSteps)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(date=Date.now()){let remaining=0;this._charts.forEach((anims,chart)=>{if(!anims.running||!anims.items.length)return;const items=anims.items;let item,i=items.length-1,draw2=!1;for(;i>=0;--i)item=items[i],item._active?(item._total>anims.duration&&(anims.duration=item._total),item.tick(date),draw2=!0):(items[i]=items[items.length-1],items.pop());draw2&&(chart.draw(),this._notify(chart,anims,date,"progress")),items.length||(anims.running=!1,this._notify(chart,anims,date,"complete"),anims.initial=!1),remaining+=items.length}),this._lastDate=date,0===remaining&&(this._running=!1)}_getAnims(chart){const charts=this._charts;let anims=charts.get(chart);return anims||(anims={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},charts.set(chart,anims)),anims}listen(chart,event,cb){this._getAnims(chart).listeners[event].push(cb)}add(chart,items){!items||!items.length||this._getAnims(chart).items.push(...items)}has(chart){return this._getAnims(chart).items.length>0}start(chart){const anims=this._charts.get(chart);!anims||(anims.running=!0,anims.start=Date.now(),anims.duration=anims.items.reduce((acc,cur)=>Math.max(acc,cur._duration),0),this._refresh())}running(chart){if(!this._running)return!1;const anims=this._charts.get(chart);return!(!anims||!anims.running||!anims.items.length)}stop(chart){const anims=this._charts.get(chart);if(!anims||!anims.items.length)return;const items=anims.items;let i=items.length-1;for(;i>=0;--i)items[i].cancel();anims.items=[],this._notify(chart,anims,Date.now(),"complete")}remove(chart){return this._charts.delete(chart)}}__name(Animator,"Animator");var animator=new Animator;const interpolators={boolean:(from2,to2,factor)=>factor>.5?to2:from2,color(from2,to2,factor){const c0=color(from2||"transparent"),c1=c0.valid&&color(to2||"transparent");return c1&&c1.valid?c1.mix(c0,factor).hexString():to2},number:(from2,to2,factor)=>from2+(to2-from2)*factor};class Animation{constructor(cfg,target,prop,to2){const currentValue=target[prop];to2=resolve([cfg.to,to2,currentValue,cfg.from]);const from2=resolve([cfg.from,currentValue,to2]);this._active=!0,this._fn=cfg.fn||interpolators[cfg.type||typeof from2],this._easing=effects[cfg.easing]||effects.linear,this._start=Math.floor(Date.now()+(cfg.delay||0)),this._duration=this._total=Math.floor(cfg.duration),this._loop=!!cfg.loop,this._target=target,this._prop=prop,this._from=from2,this._to=to2,this._promises=void 0}active(){return this._active}update(cfg,to2,date){if(this._active){this._notify(!1);const currentValue=this._target[this._prop],elapsed=date-this._start,remain=this._duration-elapsed;this._start=date,this._duration=Math.floor(Math.max(remain,cfg.duration)),this._total+=elapsed,this._loop=!!cfg.loop,this._to=resolve([cfg.to,to2,currentValue,cfg.from]),this._from=resolve([cfg.from,currentValue,to2])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(date){const elapsed=date-this._start,duration=this._duration,prop=this._prop,from2=this._from,loop=this._loop,to2=this._to;let factor;if(this._active=from2!==to2&&(loop||elapsed1?2-factor:factor,factor=this._easing(Math.min(1,Math.max(0,factor))),this._target[prop]=this._fn(from2,to2,factor))}wait(){const promises=this._promises||(this._promises=[]);return new Promise((res,rej)=>{promises.push({res,rej})})}_notify(resolved){const method=resolved?"res":"rej",promises=this._promises||[];for(let i=0;i"onProgress"!==name&&"onComplete"!==name&&"fn"!==name}),defaults.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),defaults.describe("animations",{_fallback:"animation"}),defaults.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:v=>0|v}}}});class Animations{constructor(chart,config){this._chart=chart,this._properties=new Map,this.configure(config)}configure(config){if(!isObject(config))return;const animatedProps=this._properties;Object.getOwnPropertyNames(config).forEach(key=>{const cfg=config[key];if(!isObject(cfg))return;const resolved={};for(const option of animationOptions)resolved[option]=cfg[option];(isArray(cfg.properties)&&cfg.properties||[key]).forEach(prop=>{(prop===key||!animatedProps.has(prop))&&animatedProps.set(prop,resolved)})})}_animateOptions(target,values){const newOptions=values.options,options=resolveTargetOptions(target,newOptions);if(!options)return[];const animations=this._createAnimations(options,newOptions);return newOptions.$shared&&awaitAll(target.options.$animations,newOptions).then(()=>{target.options=newOptions},()=>{}),animations}_createAnimations(target,values){const animatedProps=this._properties,animations=[],running=target.$animations||(target.$animations={}),props=Object.keys(values),date=Date.now();let i;for(i=props.length-1;i>=0;--i){const prop=props[i];if("$"===prop.charAt(0))continue;if("options"===prop){animations.push(...this._animateOptions(target,values));continue}const value=values[prop];let animation=running[prop];const cfg=animatedProps.get(prop);if(animation){if(cfg&&animation.active()){animation.update(cfg,value,date);continue}animation.cancel()}cfg&&cfg.duration?(running[prop]=animation=new Animation(cfg,target,prop,value),animations.push(animation)):target[prop]=value}return animations}update(target,values){if(0===this._properties.size)return void Object.assign(target,values);const animations=this._createAnimations(target,values);return animations.length?(animator.add(this._chart,animations),!0):void 0}}function awaitAll(animations,properties){const running=[],keys=Object.keys(properties);for(let i=0;i0||!positive&&value<0)return meta.index}return null}function updateStacks(controller,parsed){const{chart,_cachedMeta:meta}=controller,stacks=chart._stacks||(chart._stacks={}),{iScale,vScale,index:datasetIndex}=meta,iAxis=iScale.axis,vAxis=vScale.axis,key=getStackKey(iScale,vScale,meta),ilen=parsed.length;let stack;for(let i=0;iscales2[key].axis===axis).shift()}function createDatasetContext(parent,index2){return createContext(parent,{active:!1,dataset:void 0,datasetIndex:index2,index:index2,mode:"default",type:"dataset"})}function createDataContext(parent,index2,element){return createContext(parent,{active:!1,dataIndex:index2,parsed:void 0,raw:void 0,element,index:index2,mode:"default",type:"data"})}function clearStacks(meta,items){const datasetIndex=meta.controller.index,axis=meta.vScale&&meta.vScale.axis;if(axis){items=items||meta._parsed;for(const parsed of items){const stacks=parsed._stacks;if(!stacks||void 0===stacks[axis]||void 0===stacks[axis][datasetIndex])return;delete stacks[axis][datasetIndex]}}}__name(Animations,"Animations"),__name(awaitAll,"awaitAll"),__name(resolveTargetOptions,"resolveTargetOptions"),__name(scaleClip,"scaleClip"),__name(defaultClip,"defaultClip"),__name(toClip,"toClip"),__name(getSortedDatasetIndices,"getSortedDatasetIndices"),__name(applyStack,"applyStack"),__name(convertObjectDataToArray,"convertObjectDataToArray"),__name(isStacked,"isStacked"),__name(getStackKey,"getStackKey"),__name(getUserBounds,"getUserBounds"),__name(getOrCreateStack,"getOrCreateStack"),__name(getLastIndexInStack,"getLastIndexInStack"),__name(updateStacks,"updateStacks"),__name(getFirstScaleId,"getFirstScaleId"),__name(createDatasetContext,"createDatasetContext"),__name(createDataContext,"createDataContext"),__name(clearStacks,"clearStacks");const isDirectUpdateMode=__name(mode=>"reset"===mode||"none"===mode,"isDirectUpdateMode"),cloneIfNotShared=__name((cached,shared)=>shared?cached:Object.assign({},cached),"cloneIfNotShared"),createStack=__name((canStack,meta,chart)=>canStack&&!meta.hidden&&meta._stacked&&{keys:getSortedDatasetIndices(chart,!0),values:null},"createStack");class DatasetController{constructor(chart,datasetIndex){this.chart=chart,this._ctx=chart.ctx,this.index=datasetIndex,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 meta=this._cachedMeta;this.configure(),this.linkScales(),meta._stacked=isStacked(meta.vScale,meta),this.addElements()}updateIndex(datasetIndex){this.index!==datasetIndex&&clearStacks(this._cachedMeta),this.index=datasetIndex}linkScales(){const chart=this.chart,meta=this._cachedMeta,dataset=this.getDataset(),chooseId=__name((axis,x,y,r)=>"x"===axis?x:"r"===axis?r:y,"chooseId"),xid=meta.xAxisID=valueOrDefault(dataset.xAxisID,getFirstScaleId(chart,"x")),yid=meta.yAxisID=valueOrDefault(dataset.yAxisID,getFirstScaleId(chart,"y")),rid=meta.rAxisID=valueOrDefault(dataset.rAxisID,getFirstScaleId(chart,"r")),indexAxis=meta.indexAxis,iid=meta.iAxisID=chooseId(indexAxis,xid,yid,rid),vid=meta.vAxisID=chooseId(indexAxis,yid,xid,rid);meta.xScale=this.getScaleForId(xid),meta.yScale=this.getScaleForId(yid),meta.rScale=this.getScaleForId(rid),meta.iScale=this.getScaleForId(iid),meta.vScale=this.getScaleForId(vid)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(scaleID){return this.chart.scales[scaleID]}_getOtherScale(scale){const meta=this._cachedMeta;return scale===meta.iScale?meta.vScale:meta.iScale}reset(){this._update("reset")}_destroy(){const meta=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),meta._stacked&&clearStacks(meta)}_dataCheck(){const dataset=this.getDataset(),data=dataset.data||(dataset.data=[]),_data=this._data;if(isObject(data))this._data=convertObjectDataToArray(data);else if(_data!==data){if(_data){unlistenArrayEvents(_data,this);const meta=this._cachedMeta;clearStacks(meta),meta._parsed=[]}data&&Object.isExtensible(data)&&listenArrayEvents(data,this),this._syncList=[],this._data=data}}addElements(){const meta=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(meta.dataset=new this.datasetElementType)}buildOrUpdateElements(resetNewElements){const meta=this._cachedMeta,dataset=this.getDataset();let stackChanged=!1;this._dataCheck();const oldStacked=meta._stacked;meta._stacked=isStacked(meta.vScale,meta),meta.stack!==dataset.stack&&(stackChanged=!0,clearStacks(meta),meta.stack=dataset.stack),this._resyncElements(resetNewElements),(stackChanged||oldStacked!==meta._stacked)&&updateStacks(this,meta._parsed)}configure(){const config=this.chart.config,scopeKeys=config.datasetScopeKeys(this._type),scopes=config.getOptionScopes(this.getDataset(),scopeKeys,!0);this.options=config.createResolver(scopes,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(start,count){const{_cachedMeta:meta,_data:data}=this,{iScale,_stacked}=meta,iAxis=iScale.axis;let i,cur,parsed,sorted=0===start&&count===data.length||meta._sorted,prev=start>0&&meta._parsed[start-1];if(!1===this._parsing)meta._parsed=data,meta._sorted=!0,parsed=data;else{parsed=isArray(data[start])?this.parseArrayData(meta,data,start,count):isObject(data[start])?this.parseObjectData(meta,data,start,count):this.parsePrimitiveData(meta,data,start,count);const isNotInOrderComparedToPrev=__name(()=>null===cur[iAxis]||prev&&cur[iAxis]otherValue||otherMax=0;--i)if(!_skip()){this.updateRangeFromParsed(range,scale,parsed,stack);break}return range}getAllParsedValues(scale){const parsed=this._cachedMeta._parsed,values=[];let i,ilen,value;for(i=0,ilen=parsed.length;i=0&&index2this.getContext(index2,active),"context"),values=config.resolveNamedOptions(scopes,names2,context,prefixes);return values.$shared&&(values.$shared=sharing,cache[cacheKey]=Object.freeze(cloneIfNotShared(values,sharing))),values}_resolveAnimations(index2,transition,active){const chart=this.chart,cache=this._cachedDataOpts,cacheKey=`animation-${transition}`,cached=cache[cacheKey];if(cached)return cached;let options;if(!1!==chart.options.animation){const config=this.chart.config,scopeKeys=config.datasetAnimationScopeKeys(this._type,transition),scopes=config.getOptionScopes(this.getDataset(),scopeKeys);options=config.createResolver(scopes,this.getContext(index2,active,transition))}const animations=new Animations(chart,options&&options.animations);return options&&options._cacheable&&(cache[cacheKey]=Object.freeze(animations)),animations}getSharedOptions(options){if(options.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},options))}includeOptions(mode,sharedOptions){return!sharedOptions||isDirectUpdateMode(mode)||this.chart._animationsDisabled}updateElement(element,index2,properties,mode){isDirectUpdateMode(mode)?Object.assign(element,properties):this._resolveAnimations(index2,mode).update(element,properties)}updateSharedOptions(sharedOptions,mode,newOptions){sharedOptions&&!isDirectUpdateMode(mode)&&this._resolveAnimations(void 0,mode).update(sharedOptions,newOptions)}_setStyle(element,index2,mode,active){element.active=active;const options=this.getStyle(index2,active);this._resolveAnimations(index2,mode,active).update(element,{options:!active&&this.getSharedOptions(options)||options})}removeHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!1)}setHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!0)}_removeDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!1)}_setDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!0)}_resyncElements(resetNewElements){const data=this._data,elements=this._cachedMeta.data;for(const[method,arg1,arg2]of this._syncList)this[method](arg1,arg2);this._syncList=[];const numMeta=elements.length,numData=data.length,count=Math.min(numData,numMeta);count&&this.parse(0,count),numData>numMeta?this._insertElements(numMeta,numData-numMeta,resetNewElements):numData{for(arr.length+=count,i=arr.length-1;i>=end;i--)arr[i]=arr[i-count]},"move");for(move(data),i=start;ia-b))}return scale._cache.$bar}function computeMinSampleSize(meta){const scale=meta.iScale,values=getAllScaleValues(scale,meta.type);let i,ilen,curr,prev,min=scale._length;const updateMinAndPrev=__name(()=>{32767===curr||-32768===curr||(defined(prev)&&(min=Math.min(min,Math.abs(curr-prev)||min)),prev=curr)},"updateMinAndPrev");for(i=0,ilen=values.length;i0?pixels[index2-1]:null,next=index2Math.abs(max)&&(barStart=max,barEnd=min),item[vScale.axis]=barEnd,item._custom={barStart,barEnd,start:startValue,end:endValue,min,max}}function parseValue(entry,item,vScale,i){return isArray(entry)?parseFloatBar(entry,item,vScale,i):item[vScale.axis]=vScale.parse(entry,i),item}function parseArrayOrPrimitive(meta,data,start,count){const iScale=meta.iScale,vScale=meta.vScale,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=[];let i,ilen,item,entry;for(i=start,ilen=start+count;i=actualBase?1:-1)}function borderProps(properties){let reverse,start,end,top,bottom;return properties.horizontal?(reverse=properties.base>properties.x,start="left",end="right"):(reverse=properties.base=0;--i)max=Math.max(max,data[i].size(this.resolveDataElementOptions(i))/2);return max>0&&max}getLabelAndValue(index2){const meta=this._cachedMeta,{xScale,yScale}=meta,parsed=this.getParsed(index2),x=xScale.getLabelForValue(parsed.x),y=yScale.getLabelForValue(parsed.y),r=parsed._custom;return{label:meta.label,value:"("+x+", "+y+(r?", "+r:"")+")"}}update(mode){const points=this._cachedMeta.data;this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis;for(let i=start;i_angleBetween(angle,startAngle,endAngle,!0)?1:Math.max(a,a*cutout,b,b*cutout),"calcMax"),calcMin=__name((angle,a,b)=>_angleBetween(angle,startAngle,endAngle,!0)?-1:Math.min(a,a*cutout,b,b*cutout),"calcMin"),maxX=calcMax(0,startX,endX),maxY=calcMax(HALF_PI,startY,endY),minX=calcMin(PI,startX,endX),minY=calcMin(PI+HALF_PI,startY,endY);ratioX=(maxX-minX)/2,ratioY=(maxY-minY)/2,offsetX=-(maxX+minX)/2,offsetY=-(maxY+minY)/2}return{ratioX,ratioY,offsetX,offsetY}}__name(BubbleController,"BubbleController"),BubbleController.id="bubble",BubbleController.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},BubbleController.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}},__name(getRatioAndOffset,"getRatioAndOffset");class DoughnutController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(start,count){const data=this.getDataset().data,meta=this._cachedMeta;if(!1===this._parsing)meta._parsed=data;else{let i,ilen,getter=__name(i2=>+data[i2],"getter");if(isObject(data[start])){const{key="value"}=this._parsing;getter=__name(i2=>+resolveObjectKey(data[i2],key),"getter")}for(i=start,ilen=start+count;i0&&!isNaN(value)?TAU*(Math.abs(value)/total):0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2],chart.options.locale);return{label:labels[index2]||"",value}}getMaxBorderWidth(arcs){let max=0;const chart=this.chart;let i,ilen,meta,controller,options;if(!arcs)for(i=0,ilen=chart.data.datasets.length;i"spacing"!==name,_indexable:name=>"spacing"!==name},DoughnutController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label(tooltipItem){let dataLabel=tooltipItem.label;const value=": "+tooltipItem.formattedValue;return isArray(dataLabel)?(dataLabel=dataLabel.slice(),dataLabel[0]+=value):dataLabel+=value,dataLabel}}}}};class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(mode){const meta=this._cachedMeta,{dataset:line,data:points=[],_dataset}=meta,animationsDisabled=this.chart._animationsDisabled;let{start,count}=getStartAndCountOfVisiblePoints(meta,points,animationsDisabled);this._drawStart=start,this._drawCount=count,scaleRangesChanged(meta)&&(start=0,count=points.length),line._chart=this.chart,line._datasetIndex=this.index,line._decimated=!!_dataset._decimated,line.points=points;const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0),options.segment=this.options.segment,this.updateElement(line,void 0,{animated:!animationsDisabled,options},mode),this.updateElements(points,start,count,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale,_stacked,_dataset}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis,{spanGaps,segment}=this.options,maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY,directUpdate=this.chart._animationsDisabled||reset||"none"===mode;let prevParsed=start>0&&this.getParsed(start-1);for(let i=start;i0&&Math.abs(parsed[iAxis]-prevParsed[iAxis])>maxGapLength,segment&&(properties.parsed=parsed,properties.raw=_dataset.data[i]),includeOptions&&(properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?"active":mode)),directUpdate||this.updateElement(point,i,properties,mode),prevParsed=parsed}this.updateSharedOptions(sharedOptions,mode,firstOpts)}getMaxOverflow(){const meta=this._cachedMeta,dataset=meta.dataset,border=dataset.options&&dataset.options.borderWidth||0,data=meta.data||[];if(!data.length)return border;const firstPoint=data[0].size(this.resolveDataElementOptions(0)),lastPoint=data[data.length-1].size(this.resolveDataElementOptions(data.length-1));return Math.max(border,firstPoint,lastPoint)/2}draw(){const meta=this._cachedMeta;meta.dataset.updateControlPoints(this.chart.chartArea,meta.iScale.axis),super.draw()}}function getStartAndCountOfVisiblePoints(meta,points,animationsDisabled){const pointCount=points.length;let start=0,count=pointCount;if(meta._sorted){const{iScale,_parsed}=meta,axis=iScale.axis,{min,max,minDefined,maxDefined}=iScale.getUserBounds();minDefined&&(start=_limitValue(Math.min(_lookupByKey(_parsed,iScale.axis,min).lo,animationsDisabled?pointCount:_lookupByKey(points,axis,iScale.getPixelForValue(min)).lo),0,pointCount-1)),count=maxDefined?_limitValue(Math.max(_lookupByKey(_parsed,iScale.axis,max).hi+1,animationsDisabled?0:_lookupByKey(points,axis,iScale.getPixelForValue(max)).hi+1),start,pointCount)-start:pointCount-start}return{start,count}}function scaleRangesChanged(meta){const{xScale,yScale,_scaleRanges}=meta,newRanges={xmin:xScale.min,xmax:xScale.max,ymin:yScale.min,ymax:yScale.max};if(!_scaleRanges)return meta._scaleRanges=newRanges,!0;const changed=_scaleRanges.xmin!==xScale.min||_scaleRanges.xmax!==xScale.max||_scaleRanges.ymin!==yScale.min||_scaleRanges.ymax!==yScale.max;return Object.assign(_scaleRanges,newRanges),changed}__name(LineController,"LineController"),LineController.id="line",LineController.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},LineController.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}},__name(getStartAndCountOfVisiblePoints,"getStartAndCountOfVisiblePoints"),__name(scaleRangesChanged,"scaleRangesChanged");class PolarAreaController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2].r,chart.options.locale);return{label:labels[index2]||"",value}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const arcs=this._cachedMeta.data;this._updateRadius(),this.updateElements(arcs,0,arcs.length,mode)}getMinMax(){const meta=this._cachedMeta,range={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return meta.data.forEach((element,index2)=>{const parsed=this.getParsed(index2).r;!isNaN(parsed)&&this.chart.getDataVisibility(index2)&&(parsedrange.max&&(range.max=parsed))}),range}_updateRadius(){const chart=this.chart,chartArea=chart.chartArea,opts=chart.options,minSize=Math.min(chartArea.right-chartArea.left,chartArea.bottom-chartArea.top),outerRadius=Math.max(minSize/2,0),radiusLength=(outerRadius-Math.max(opts.cutoutPercentage?outerRadius/100*opts.cutoutPercentage:1,0))/chart.getVisibleDatasetCount();this.outerRadius=outerRadius-radiusLength*this.index,this.innerRadius=this.outerRadius-radiusLength}updateElements(arcs,start,count,mode){const reset="reset"===mode,chart=this.chart,animationOpts=chart.options.animation,scale=this._cachedMeta.rScale,centerX=scale.xCenter,centerY=scale.yCenter,datasetStartAngle=scale.getIndexAngle(0)-.5*PI;let i,angle=datasetStartAngle;const defaultAngle=360/this.countVisibleElements();for(i=0;i{!isNaN(this.getParsed(index2).r)&&this.chart.getDataVisibility(index2)&&count++}),count}_computeAngle(index2,mode,defaultAngle){return this.chart.getDataVisibility(index2)?toRadians(this.resolveDataElementOptions(index2,mode).angle||defaultAngle):0}}__name(PolarAreaController,"PolarAreaController"),PolarAreaController.id="polarArea",PolarAreaController.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},PolarAreaController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label:context=>context.chart.data.labels[context.dataIndex]+": "+context.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class PieController extends DoughnutController{}__name(PieController,"PieController"),PieController.id="pie",PieController.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class RadarController extends DatasetController{getLabelAndValue(index2){const vScale=this._cachedMeta.vScale,parsed=this.getParsed(index2);return{label:vScale.getLabels()[index2],value:""+vScale.getLabelForValue(parsed[vScale.axis])}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const meta=this._cachedMeta,line=meta.dataset,points=meta.data||[],labels=meta.iScale.getLabels();if(line.points=points,"resize"!==mode){const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0);const properties={_loop:!0,_fullLoop:labels.length===points.length,options};this.updateElement(line,void 0,properties,mode)}this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const scale=this._cachedMeta.rScale,reset="reset"===mode;for(let i=start;i"",label:item=>"("+item.label+", "+item.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function chart_esm_abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}__name(chart_esm_abstract,"chart_esm_abstract");class DateAdapter{constructor(options){this.options=options||{}}formats(){return chart_esm_abstract()}parse(value,format){return chart_esm_abstract()}format(timestamp,format){return chart_esm_abstract()}add(timestamp,amount,unit){return chart_esm_abstract()}diff(a,b,unit){return chart_esm_abstract()}startOf(timestamp,unit,weekday){return chart_esm_abstract()}endOf(timestamp,unit){return chart_esm_abstract()}}__name(DateAdapter,"DateAdapter"),DateAdapter.override=function(members){Object.assign(DateAdapter.prototype,members)};var adapters={_date:DateAdapter};function binarySearch(metaset,axis,value,intersect){const{controller,data,_sorted}=metaset,iScale=controller._cachedMeta.iScale;if(iScale&&axis===iScale.axis&&"r"!==axis&&_sorted&&data.length){const lookupMethod=iScale._reversePixels?_rlookupByKey:_lookupByKey;if(!intersect)return lookupMethod(data,axis,value);if(controller._sharedOptions){const el=data[0],range="function"==typeof el.getRange&&el.getRange(axis);if(range){const start=lookupMethod(data,axis,value-range),end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi}}}}return{lo:0,hi:data.length-1}}function evaluateInteractionItems(chart,axis,position,handler,intersect){const metasets=chart.getSortedVisibleDatasetMetas(),value=position[axis];for(let i=0,ilen=metasets.length;i{element[rangeMethod](position[axis],useFinalPosition)&&(items.push({element,datasetIndex,index:index2}),intersectsItem=intersectsItem||element.inRange(position.x,position.y,useFinalPosition))}),intersect&&!intersectsItem?[]:items}__name(binarySearch,"binarySearch"),__name(evaluateInteractionItems,"evaluateInteractionItems"),__name(getDistanceMetricForAxis,"getDistanceMetricForAxis"),__name(getIntersectItems,"getIntersectItems"),__name(getNearestRadialItems,"getNearestRadialItems"),__name(getNearestCartesianItems,"getNearestCartesianItems"),__name(getNearestItems,"getNearestItems"),__name(getAxisItems,"getAxisItems");var Interaction={evaluateInteractionItems,modes:{index(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"x",includeInvisible=options.includeInvisible||!1,items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible),elements=[];return items.length?(chart.getSortedVisibleDatasetMetas().forEach(meta=>{const index2=items[0].index,element=meta.data[index2];element&&!element.skip&&elements.push({element,datasetIndex:meta.index,index:index2})}),elements):[]},dataset(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;let items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible);if(items.length>0){const datasetIndex=items[0].datasetIndex,data=chart.getDatasetMeta(datasetIndex).data;items=[];for(let i=0;igetIntersectItems(chart,getRelativePosition(e,chart),options.axis||"xy",useFinalPosition,options.includeInvisible||!1),nearest(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;return getNearestItems(chart,position,axis,options.intersect,useFinalPosition,includeInvisible)},x:(chart,e,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e,chart),"x",options.intersect,useFinalPosition),y:(chart,e,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e,chart),"y",options.intersect,useFinalPosition)}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(array,position){return array.filter(v=>v.pos===position)}function filterDynamicPositionByAxis(array,axis){return array.filter(v=>-1===STATIC_POSITIONS.indexOf(v.pos)&&v.box.axis===axis)}function sortByWeight(array,reverse){return array.sort((a,b)=>{const v0=reverse?b:a,v1=reverse?a:b;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight})}function wrapBoxes(boxes){const layoutBoxes=[];let i,ilen,box,pos,stack,stackWeight;for(i=0,ilen=(boxes||[]).length;iwrap.box.fullSize),!0),left=sortByWeight(filterByPosition(layoutBoxes,"left"),!0),right=sortByWeight(filterByPosition(layoutBoxes,"right")),top=sortByWeight(filterByPosition(layoutBoxes,"top"),!0),bottom=sortByWeight(filterByPosition(layoutBoxes,"bottom")),centerHorizontal=filterDynamicPositionByAxis(layoutBoxes,"x"),centerVertical=filterDynamicPositionByAxis(layoutBoxes,"y");return{fullSize,leftAndTop:left.concat(top),rightAndBottom:right.concat(centerVertical).concat(bottom).concat(centerHorizontal),chartArea:filterByPosition(layoutBoxes,"chartArea"),vertical:left.concat(right).concat(centerVertical),horizontal:top.concat(bottom).concat(centerHorizontal)}}function getCombinedMax(maxPadding,chartArea,a,b){return Math.max(maxPadding[a],chartArea[a])+Math.max(maxPadding[b],chartArea[b])}function updateMaxPadding(maxPadding,boxPadding){maxPadding.top=Math.max(maxPadding.top,boxPadding.top),maxPadding.left=Math.max(maxPadding.left,boxPadding.left),maxPadding.bottom=Math.max(maxPadding.bottom,boxPadding.bottom),maxPadding.right=Math.max(maxPadding.right,boxPadding.right)}function updateDims(chartArea,params,layout,stacks){const{pos,box}=layout,maxPadding=chartArea.maxPadding;if(!isObject(pos)){layout.size&&(chartArea[pos]-=layout.size);const stack=stacks[layout.stack]||{size:0,count:1};stack.size=Math.max(stack.size,layout.horizontal?box.height:box.width),layout.size=stack.size/stack.count,chartArea[pos]+=layout.size}box.getPadding&&updateMaxPadding(maxPadding,box.getPadding());const newWidth=Math.max(0,params.outerWidth-getCombinedMax(maxPadding,chartArea,"left","right")),newHeight=Math.max(0,params.outerHeight-getCombinedMax(maxPadding,chartArea,"top","bottom")),widthChanged=newWidth!==chartArea.w,heightChanged=newHeight!==chartArea.h;return chartArea.w=newWidth,chartArea.h=newHeight,layout.horizontal?{same:widthChanged,other:heightChanged}:{same:heightChanged,other:widthChanged}}function handleMaxPadding(chartArea){const maxPadding=chartArea.maxPadding;function updatePos(pos){const change=Math.max(maxPadding[pos]-chartArea[pos],0);return chartArea[pos]+=change,change}__name(updatePos,"updatePos"),chartArea.y+=updatePos("top"),chartArea.x+=updatePos("left"),updatePos("right"),updatePos("bottom")}function getMargins(horizontal,chartArea){const maxPadding=chartArea.maxPadding;function marginForPositions(positions2){const margin={left:0,top:0,right:0,bottom:0};return positions2.forEach(pos=>{margin[pos]=Math.max(chartArea[pos],maxPadding[pos])}),margin}return __name(marginForPositions,"marginForPositions"),marginForPositions(horizontal?["left","right"]:["top","bottom"])}function fitBoxes(boxes,chartArea,params,stacks){const refitBoxes=[];let i,ilen,layout,box,refit,changed;for(i=0,ilen=boxes.length,refit=0;i{"function"==typeof box.beforeLayout&&box.beforeLayout()});const visibleVerticalBoxCount=verticalBoxes.reduce((total,wrap)=>wrap.box.options&&!1===wrap.box.options.display?total:total+1,0)||1,params=Object.freeze({outerWidth:width,outerHeight:height,padding,availableWidth,availableHeight,vBoxMaxWidth:availableWidth/2/visibleVerticalBoxCount,hBoxMaxHeight:availableHeight/2}),maxPadding=Object.assign({},padding);updateMaxPadding(maxPadding,toPadding(minPadding));const chartArea=Object.assign({maxPadding,w:availableWidth,h:availableHeight,x:padding.left,y:padding.top},padding),stacks=setLayoutDims(verticalBoxes.concat(horizontalBoxes),params);fitBoxes(boxes.fullSize,chartArea,params,stacks),fitBoxes(verticalBoxes,chartArea,params,stacks),fitBoxes(horizontalBoxes,chartArea,params,stacks)&&fitBoxes(verticalBoxes,chartArea,params,stacks),handleMaxPadding(chartArea),placeBoxes(boxes.leftAndTop,chartArea,params,stacks),chartArea.x+=chartArea.w,chartArea.y+=chartArea.h,placeBoxes(boxes.rightAndBottom,chartArea,params,stacks),chart.chartArea={left:chartArea.left,top:chartArea.top,right:chartArea.left+chartArea.w,bottom:chartArea.top+chartArea.h,height:chartArea.h,width:chartArea.w},each(boxes.chartArea,layout=>{const box=layout.box;Object.assign(box,chart.chartArea),box.update(chartArea.w,chartArea.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(canvas,aspectRatio){}releaseContext(context){return!1}addEventListener(chart,type,listener){}removeEventListener(chart,type,listener){}getDevicePixelRatio(){return 1}getMaximumSize(element,width,height,aspectRatio){return width=Math.max(0,width||element.width),height=height||element.height,{width,height:Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height)}}isAttached(canvas){return!0}updateConfig(config){}}__name(BasePlatform,"BasePlatform");class BasicPlatform extends BasePlatform{acquireContext(item){return item&&item.getContext&&item.getContext("2d")||null}updateConfig(config){config.options.animation=!1}}__name(BasicPlatform,"BasicPlatform");const EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=__name(value=>null===value||""===value,"isNullOrEmpty");function initCanvas(canvas,aspectRatio){const style=canvas.style,renderHeight=canvas.getAttribute("height"),renderWidth=canvas.getAttribute("width");if(canvas.$chartjs={initial:{height:renderHeight,width:renderWidth,style:{display:style.display,height:style.height,width:style.width}}},style.display=style.display||"block",style.boxSizing=style.boxSizing||"border-box",isNullOrEmpty(renderWidth)){const displayWidth=readUsedSize(canvas,"width");void 0!==displayWidth&&(canvas.width=displayWidth)}if(isNullOrEmpty(renderHeight))if(""===canvas.style.height)canvas.height=canvas.width/(aspectRatio||2);else{const displayHeight=readUsedSize(canvas,"height");void 0!==displayHeight&&(canvas.height=displayHeight)}return canvas}__name(initCanvas,"initCanvas");const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(node,type,listener){node.addEventListener(type,listener,eventListenerOptions)}function removeListener(chart,type,listener){chart.canvas.removeEventListener(type,listener,eventListenerOptions)}function fromNativeEvent(event,chart){const type=EVENT_TYPES[event.type]||event.type,{x,y}=getRelativePosition(event,chart);return{type,chart,native:event,x:void 0!==x?x:null,y:void 0!==y?y:null}}function nodeListContains(nodeList,canvas){for(const node of nodeList)if(node===canvas||node.contains(canvas))return!0}function createAttachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.addedNodes,canvas),trigger=trigger&&!nodeListContains(entry.removedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}function createDetachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.removedNodes,canvas),trigger=trigger&&!nodeListContains(entry.addedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}__name(addListener,"addListener"),__name(removeListener,"removeListener"),__name(fromNativeEvent,"fromNativeEvent"),__name(nodeListContains,"nodeListContains"),__name(createAttachObserver,"createAttachObserver"),__name(createDetachObserver,"createDetachObserver");const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const dpr=window.devicePixelRatio;dpr!==oldDevicePixelRatio&&(oldDevicePixelRatio=dpr,drpListeningCharts.forEach((resize,chart)=>{chart.currentDevicePixelRatio!==dpr&&resize()}))}function listenDevicePixelRatioChanges(chart,resize){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(chart,resize)}function unlistenDevicePixelRatioChanges(chart){drpListeningCharts.delete(chart),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(chart,type,listener){const canvas=chart.canvas,container=canvas&&_getParentNode(canvas);if(!container)return;const resize=throttled((width,height)=>{const w=container.clientWidth;listener(width,height),w{const entry=entries[0],width=entry.contentRect.width,height=entry.contentRect.height;0===width&&0===height||resize(width,height)});return observer.observe(container),listenDevicePixelRatioChanges(chart,resize),observer}function releaseObserver(chart,type,observer){observer&&observer.disconnect(),"resize"===type&&unlistenDevicePixelRatioChanges(chart)}function createProxyAndListen(chart,type,listener){const canvas=chart.canvas,proxy=throttled(event=>{null!==chart.ctx&&listener(fromNativeEvent(event,chart))},chart,args=>{const event=args[0];return[event,event.offsetX,event.offsetY]});return addListener(canvas,type,proxy),proxy}__name(onWindowResize,"onWindowResize"),__name(listenDevicePixelRatioChanges,"listenDevicePixelRatioChanges"),__name(unlistenDevicePixelRatioChanges,"unlistenDevicePixelRatioChanges"),__name(createResizeObserver,"createResizeObserver"),__name(releaseObserver,"releaseObserver"),__name(createProxyAndListen,"createProxyAndListen");class DomPlatform extends BasePlatform{acquireContext(canvas,aspectRatio){const context=canvas&&canvas.getContext&&canvas.getContext("2d");return context&&context.canvas===canvas?(initCanvas(canvas,aspectRatio),context):null}releaseContext(context){const canvas=context.canvas;if(!canvas.$chartjs)return!1;const initial=canvas.$chartjs.initial;["height","width"].forEach(prop=>{const value=initial[prop];isNullOrUndef(value)?canvas.removeAttribute(prop):canvas.setAttribute(prop,value)});const style=initial.style||{};return Object.keys(style).forEach(key=>{canvas.style[key]=style[key]}),canvas.width=canvas.width,delete canvas.$chartjs,!0}addEventListener(chart,type,listener){this.removeEventListener(chart,type);const proxies=chart.$proxies||(chart.$proxies={}),handler={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[type]||createProxyAndListen;proxies[type]=handler(chart,type,listener)}removeEventListener(chart,type){const proxies=chart.$proxies||(chart.$proxies={}),proxy=proxies[type];proxy&&(({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[type]||removeListener)(chart,type,proxy),proxies[type]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(canvas,width,height,aspectRatio){return getMaximumSize(canvas,width,height,aspectRatio)}isAttached(canvas){const container=_getParentNode(canvas);return!(!container||!container.isConnected)}}function _detectPlatform(canvas){return!_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&canvas instanceof OffscreenCanvas?BasicPlatform:DomPlatform}__name(DomPlatform,"DomPlatform"),__name(_detectPlatform,"_detectPlatform");class Element{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(useFinalPosition){const{x,y}=this.getProps(["x","y"],useFinalPosition);return{x,y}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(props,final){const anims=this.$animations;if(!final||!anims)return this;const ret={};return props.forEach(prop=>{ret[prop]=anims[prop]&&anims[prop].active()?anims[prop]._to:this[prop]}),ret}}__name(Element,"Element"),Element.defaults={},Element.defaultRoutes=void 0;const formatters={values:value=>isArray(value)?value:""+value,numeric(tickValue,index2,ticks){if(0===tickValue)return"0";const locale=this.chart.options.locale;let notation,delta=tickValue;if(ticks.length>1){const maxTick=Math.max(Math.abs(ticks[0].value),Math.abs(ticks[ticks.length-1].value));(maxTick<1e-4||maxTick>1e15)&&(notation="scientific"),delta=calculateDelta(tickValue,ticks)}const logDelta=log10(Math.abs(delta)),numDecimal=Math.max(Math.min(-1*Math.floor(logDelta),20),0),options={notation,minimumFractionDigits:numDecimal,maximumFractionDigits:numDecimal};return Object.assign(options,this.options.ticks.format),formatNumber(tickValue,locale,options)},logarithmic(tickValue,index2,ticks){if(0===tickValue)return"0";const remain=tickValue/Math.pow(10,Math.floor(log10(tickValue)));return 1===remain||2===remain||5===remain?formatters.numeric.call(this,tickValue,index2,ticks):""}};function calculateDelta(tickValue,ticks){let delta=ticks.length>3?ticks[2].value-ticks[1].value:ticks[1].value-ticks[0].value;return Math.abs(delta)>=1&&tickValue!==Math.floor(tickValue)&&(delta=tickValue-Math.floor(tickValue)),delta}__name(calculateDelta,"calculateDelta");var Ticks={formatters};function autoSkip(scale,ticks){const tickOpts=scale.options.ticks,ticksLimit=tickOpts.maxTicksLimit||determineMaxTicks(scale),majorIndices=tickOpts.major.enabled?getMajorIndices(ticks):[],numMajorIndices=majorIndices.length,first=majorIndices[0],last=majorIndices[numMajorIndices-1],newTicks=[];if(numMajorIndices>ticksLimit)return skipMajors(ticks,newTicks,majorIndices,numMajorIndices/ticksLimit),newTicks;const spacing=calculateSpacing(majorIndices,ticks,ticksLimit);if(numMajorIndices>0){let i,ilen;const avgMajorSpacing=numMajorIndices>1?Math.round((last-first)/(numMajorIndices-1)):null;for(skip(ticks,newTicks,spacing,isNullOrUndef(avgMajorSpacing)?0:first-avgMajorSpacing,first),i=0,ilen=numMajorIndices-1;ispacing)return factor}return Math.max(spacing,1)}function getMajorIndices(ticks){const result=[];let i,ilen;for(i=0,ilen=ticks.length;ioptions.lineWidth,tickColor:(_ctx,options)=>options.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:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),defaults.route("scale.ticks","color","","color"),defaults.route("scale.grid","color","","borderColor"),defaults.route("scale.grid","borderColor","","borderColor"),defaults.route("scale.title","color","","color"),defaults.describe("scale",{_fallback:!1,_scriptable:name=>!name.startsWith("before")&&!name.startsWith("after")&&"callback"!==name&&"parser"!==name,_indexable:name=>"borderDash"!==name&&"tickBorderDash"!==name}),defaults.describe("scales",{_fallback:"scale"}),defaults.describe("scale.ticks",{_scriptable:name=>"backdropPadding"!==name&&"callback"!==name,_indexable:name=>"backdropPadding"!==name}),__name(autoSkip,"autoSkip"),__name(determineMaxTicks,"determineMaxTicks"),__name(calculateSpacing,"calculateSpacing"),__name(getMajorIndices,"getMajorIndices"),__name(skipMajors,"skipMajors"),__name(skip,"skip"),__name(getEvenSpacing,"getEvenSpacing");const reverseAlign=__name(align=>"left"===align?"right":"right"===align?"left":align,"reverseAlign"),offsetFromEdge=__name((scale,edge,offset)=>"top"===edge||"left"===edge?scale[edge]+offset:scale[edge]-offset,"offsetFromEdge");function sample(arr,numItems){const result=[],increment=arr.length/numItems,len=arr.length;let i=0;for(;iend+1e-6)))return lineValue}function garbageCollect(caches,length){each(caches,cache=>{const gc=cache.gc,gcLen=gc.length/2;let i;if(gcLen>length){for(i=0;imax?max:min,max=minDefined&&min>max?min:max,{min:finiteOrDefault(min,finiteOrDefault(max,min)),max:finiteOrDefault(max,finiteOrDefault(min,max))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const data=this.chart.data;return this.options.labels||(this.isHorizontal()?data.xLabels:data.yLabels)||data.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(maxWidth,maxHeight,margins){const{beginAtZero,grace,ticks:tickOpts}=this.options,sampleSize=tickOpts.sampleSize;this.beforeUpdate(),this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins=Object.assign({left:0,right:0,top:0,bottom:0},margins),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+margins.left+margins.right:this.height+margins.top+margins.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,grace,beginAtZero),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const samplingEnabled=sampleSize=maxRotation||numTicks<=1||!this.isHorizontal())return void(this.labelRotation=minRotation);const labelSizes=this._getLabelSizes(),maxLabelWidth=labelSizes.widest.width,maxLabelHeight=labelSizes.highest.height,maxWidth=_limitValue(this.chart.width-maxLabelWidth,0,this.maxWidth);tickWidth=options.offset?this.maxWidth/numTicks:maxWidth/(numTicks-1),maxLabelWidth+6>tickWidth&&(tickWidth=maxWidth/(numTicks-(options.offset?.5:1)),maxHeight=this.maxHeight-getTickMarkLength(options.grid)-tickOpts.padding-getTitleHeight(options.title,this.chart.options.font),maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight),labelRotation=toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height+6)/tickWidth,-1,1)),Math.asin(_limitValue(maxHeight/maxLabelDiagonal,-1,1))-Math.asin(_limitValue(maxLabelHeight/maxLabelDiagonal,-1,1)))),labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation))),this.labelRotation=labelRotation}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const minSize={width:0,height:0},{chart,options:{ticks:tickOpts,title:titleOpts,grid:gridOpts}}=this,display=this._isVisible(),isHorizontal=this.isHorizontal();if(display){const titleHeight=getTitleHeight(titleOpts,chart.options.font);if(isHorizontal?(minSize.width=this.maxWidth,minSize.height=getTickMarkLength(gridOpts)+titleHeight):(minSize.height=this.maxHeight,minSize.width=getTickMarkLength(gridOpts)+titleHeight),tickOpts.display&&this.ticks.length){const{first,last,widest,highest}=this._getLabelSizes(),tickPadding=2*tickOpts.padding,angleRadians=toRadians(this.labelRotation),cos=Math.cos(angleRadians),sin=Math.sin(angleRadians);if(isHorizontal){const labelHeight=tickOpts.mirror?0:sin*widest.width+cos*highest.height;minSize.height=Math.min(this.maxHeight,minSize.height+labelHeight+tickPadding)}else{const labelWidth=tickOpts.mirror?0:cos*widest.width+sin*highest.height;minSize.width=Math.min(this.maxWidth,minSize.width+labelWidth+tickPadding)}this._calculatePadding(first,last,sin,cos)}}this._handleMargins(),isHorizontal?(this.width=this._length=chart.width-this._margins.left-this._margins.right,this.height=minSize.height):(this.width=minSize.width,this.height=this._length=chart.height-this._margins.top-this._margins.bottom)}_calculatePadding(first,last,sin,cos){const{ticks:{align,padding},position}=this.options,isRotated=0!==this.labelRotation,labelsBelowTicks="top"!==position&&"x"===this.axis;if(this.isHorizontal()){const offsetLeft=this.getPixelForTick(0)-this.left,offsetRight=this.right-this.getPixelForTick(this.ticks.length-1);let paddingLeft=0,paddingRight=0;isRotated?labelsBelowTicks?(paddingLeft=cos*first.width,paddingRight=sin*last.height):(paddingLeft=sin*first.height,paddingRight=cos*last.width):"start"===align?paddingRight=last.width:"end"===align?paddingLeft=first.width:"inner"!==align&&(paddingLeft=first.width/2,paddingRight=last.width/2),this.paddingLeft=Math.max((paddingLeft-offsetLeft+padding)*this.width/(this.width-offsetLeft),0),this.paddingRight=Math.max((paddingRight-offsetRight+padding)*this.width/(this.width-offsetRight),0)}else{let paddingTop=last.height/2,paddingBottom=first.height/2;"start"===align?(paddingTop=0,paddingBottom=first.height):"end"===align&&(paddingTop=last.height,paddingBottom=0),this.paddingTop=paddingTop+padding,this.paddingBottom=paddingBottom+padding}}_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(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis,position}=this.options;return"top"===position||"bottom"===position||"x"===axis}isFullSize(){return this.options.fullSize}_convertTicksToLabels(ticks){let i,ilen;for(this.beforeTickToLabelConversion(),this.generateTickLabels(ticks),i=0,ilen=ticks.length;i({width:widths[idx]||0,height:heights[idx]||0}),"valueAt");return{first:valueAt(0),last:valueAt(length-1),widest:valueAt(widest),highest:valueAt(highest),widths,heights}}getLabelForValue(value){return value}getPixelForValue(value,index2){return NaN}getValueForPixel(pixel){}getPixelForTick(index2){const ticks=this.ticks;return index2<0||index2>ticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getPixelForDecimal(decimal){this._reversePixels&&(decimal=1-decimal);const pixel=this._startPixel+decimal*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,pixel,0):pixel)}getDecimalForPixel(pixel){const decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min,max}=this;return min<0&&max<0?max:min>0&&max>0?min:0}getContext(index2){const ticks=this.ticks||[];if(index2>=0&&index2w*sin?w/cos:h/sin:h*sin0}_computeGridLineItems(chartArea){const axis=this.axis,chart=this.chart,options=this.options,{grid,position}=options,offset=grid.offset,isHorizontal=this.isHorizontal(),ticksLength=this.ticks.length+(offset?1:0),tl=getTickMarkLength(grid),items=[],borderOpts=grid.setContext(this.getContext()),axisWidth=borderOpts.drawBorder?borderOpts.borderWidth:0,axisHalfWidth=axisWidth/2,alignBorderValue=__name(function(pixel){return _alignPixel(chart,pixel,axisWidth)},"alignBorderValue");let borderValue,i,lineValue,alignedLineValue,tx1,ty1,tx2,ty2,x1,y1,x2,y2;if("top"===position)borderValue=alignBorderValue(this.bottom),ty1=this.bottom-tl,ty2=borderValue-axisHalfWidth,y1=alignBorderValue(chartArea.top)+axisHalfWidth,y2=chartArea.bottom;else if("bottom"===position)borderValue=alignBorderValue(this.top),y1=chartArea.top,y2=alignBorderValue(chartArea.bottom)-axisHalfWidth,ty1=borderValue+axisHalfWidth,ty2=this.top+tl;else if("left"===position)borderValue=alignBorderValue(this.right),tx1=this.right-tl,tx2=borderValue-axisHalfWidth,x1=alignBorderValue(chartArea.left)+axisHalfWidth,x2=chartArea.right;else if("right"===position)borderValue=alignBorderValue(this.left),x1=chartArea.left,x2=alignBorderValue(chartArea.right)-axisHalfWidth,tx1=borderValue+axisHalfWidth,tx2=this.left+tl;else if("x"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.top+chartArea.bottom)/2+.5);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}y1=chartArea.top,y2=chartArea.bottom,ty1=borderValue+axisHalfWidth,ty2=ty1+tl}else if("y"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.left+chartArea.right)/2);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}tx1=borderValue-axisHalfWidth,tx2=tx1-tl,x1=chartArea.left,x2=chartArea.right}const limit=valueOrDefault(options.ticks.maxTicksLimit,ticksLength),step=Math.max(1,Math.ceil(ticksLength/limit));for(i=0;it.value===value);return index2>=0?grid.setContext(this.getContext(index2)).lineWidth:0}drawGrid(chartArea){const grid=this.options.grid,ctx=this.ctx,items=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(chartArea));let i,ilen;const drawLine=__name((p1,p2,style)=>{!style.width||!style.color||(ctx.save(),ctx.lineWidth=style.width,ctx.strokeStyle=style.color,ctx.setLineDash(style.borderDash||[]),ctx.lineDashOffset=style.borderDashOffset,ctx.beginPath(),ctx.moveTo(p1.x,p1.y),ctx.lineTo(p2.x,p2.y),ctx.stroke(),ctx.restore())},"drawLine");if(grid.display)for(i=0,ilen=items.length;i{this.drawBackground(),this.drawGrid(chartArea),this.drawTitle()}},{z:gz+1,draw:()=>{this.drawBorder()}},{z:tz,draw:chartArea=>{this.drawLabels(chartArea)}}]:[{z:tz,draw:chartArea=>{this.draw(chartArea)}}]}getMatchingVisibleMetas(type){const metas=this.chart.getSortedVisibleDatasetMetas(),axisID=this.axis+"AxisID",result=[];let i,ilen;for(i=0,ilen=metas.length;i{const propertyParts=property.split("."),sourceName=propertyParts.pop(),sourceScope=[scope].concat(propertyParts).join("."),parts=routes[property].split("."),targetName=parts.pop(),targetScope=parts.join(".");defaults.route(sourceScope,sourceName,targetScope,targetName)})}function isIChartComponent(proto){return"id"in proto&&"defaults"in proto}__name(TypedRegistry,"TypedRegistry"),__name(registerDefaults,"registerDefaults"),__name(routeDefaults,"routeDefaults"),__name(isIChartComponent,"isIChartComponent");class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...args){this._each("register",args)}remove(...args){this._each("unregister",args)}addControllers(...args){this._each("register",args,this.controllers)}addElements(...args){this._each("register",args,this.elements)}addPlugins(...args){this._each("register",args,this.plugins)}addScales(...args){this._each("register",args,this.scales)}getController(id){return this._get(id,this.controllers,"controller")}getElement(id){return this._get(id,this.elements,"element")}getPlugin(id){return this._get(id,this.plugins,"plugin")}getScale(id){return this._get(id,this.scales,"scale")}removeControllers(...args){this._each("unregister",args,this.controllers)}removeElements(...args){this._each("unregister",args,this.elements)}removePlugins(...args){this._each("unregister",args,this.plugins)}removeScales(...args){this._each("unregister",args,this.scales)}_each(method,args,typedRegistry){[...args].forEach(arg=>{const reg=typedRegistry||this._getRegistryForType(arg);typedRegistry||reg.isForType(arg)||reg===this.plugins&&arg.id?this._exec(method,reg,arg):each(arg,item=>{const itemReg=typedRegistry||this._getRegistryForType(item);this._exec(method,itemReg,item)})})}_exec(method,registry2,component){const camelMethod=_capitalize(method);callback(component["before"+camelMethod],[],component),registry2[method](component),callback(component["after"+camelMethod],[],component)}_getRegistryForType(type){for(let i=0;ia.filter(x=>!b.some(y=>x.plugin.id===y.plugin.id)),"diff");this._notify(diff(previousDescriptors,descriptors2),chart,"stop"),this._notify(diff(descriptors2,previousDescriptors),chart,"start")}}function allPlugins(config){const plugins2=[],keys=Object.keys(registry.plugins.items);for(let i=0;i{const scaleConf=configScales[id];if(!isObject(scaleConf))return console.error(`Invalid scale configuration for scale: ${id}`);if(scaleConf._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${id}`);const axis=determineAxis(id,scaleConf),defaultId=getDefaultScaleIDFromAxis(axis,chartIndexAxis),defaultScaleOptions=chartDefaults.scales||{};firstIDs[axis]=firstIDs[axis]||id,scales2[id]=mergeIf(Object.create(null),[{axis},scaleConf,defaultScaleOptions[axis],defaultScaleOptions[defaultId]])}),config.data.datasets.forEach(dataset=>{const type=dataset.type||config.type,indexAxis=dataset.indexAxis||getIndexAxis(type,options),defaultScaleOptions=(overrides[type]||{}).scales||{};Object.keys(defaultScaleOptions).forEach(defaultID=>{const axis=getAxisFromDefaultScaleID(defaultID,indexAxis),id=dataset[axis+"AxisID"]||firstIDs[axis]||axis;scales2[id]=scales2[id]||Object.create(null),mergeIf(scales2[id],[{axis},configScales[id],defaultScaleOptions[defaultID]])})}),Object.keys(scales2).forEach(key=>{const scale=scales2[key];mergeIf(scale,[defaults.scales[scale.type],defaults.scale])}),scales2}function initOptions(config){const options=config.options||(config.options={});options.plugins=valueOrDefault(options.plugins,{}),options.scales=mergeScaleConfig(config,options)}function initData(data){return(data=data||{}).datasets=data.datasets||[],data.labels=data.labels||[],data}function initConfig(config){return(config=config||{}).data=initData(config.data),initOptions(config),config}__name(PluginService,"PluginService"),__name(allPlugins,"allPlugins"),__name(getOpts,"getOpts"),__name(createDescriptors,"createDescriptors"),__name(pluginOpts,"pluginOpts"),__name(getIndexAxis,"getIndexAxis"),__name(getAxisFromDefaultScaleID,"getAxisFromDefaultScaleID"),__name(getDefaultScaleIDFromAxis,"getDefaultScaleIDFromAxis"),__name(axisFromPosition,"axisFromPosition"),__name(determineAxis,"determineAxis"),__name(mergeScaleConfig,"mergeScaleConfig"),__name(initOptions,"initOptions"),__name(initData,"initData"),__name(initConfig,"initConfig");const keyCache=new Map,keysCached=new Set;function cachedKeys(cacheKey,generate){let keys=keyCache.get(cacheKey);return keys||(keys=generate(),keyCache.set(cacheKey,keys),keysCached.add(keys)),keys}__name(cachedKeys,"cachedKeys");const addIfFound=__name((set2,obj,key)=>{const opts=resolveObjectKey(obj,key);void 0!==opts&&set2.add(opts)},"addIfFound");class Config{constructor(config){this._config=initConfig(config),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(type){this._config.type=type}get data(){return this._config.data}set data(data){this._config.data=initData(data)}get options(){return this._config.options}set options(options){this._config.options=options}get plugins(){return this._config.plugins}update(){const config=this._config;this.clearCache(),initOptions(config)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(datasetType){return cachedKeys(datasetType,()=>[[`datasets.${datasetType}`,""]])}datasetAnimationScopeKeys(datasetType,transition){return cachedKeys(`${datasetType}.transition.${transition}`,()=>[[`datasets.${datasetType}.transitions.${transition}`,`transitions.${transition}`],[`datasets.${datasetType}`,""]])}datasetElementScopeKeys(datasetType,elementType){return cachedKeys(`${datasetType}-${elementType}`,()=>[[`datasets.${datasetType}.elements.${elementType}`,`datasets.${datasetType}`,`elements.${elementType}`,""]])}pluginScopeKeys(plugin){const id=plugin.id;return cachedKeys(`${this.type}-plugin-${id}`,()=>[[`plugins.${id}`,...plugin.additionalOptionScopes||[]]])}_cachedScopes(mainScope,resetCache){const _scopeCache=this._scopeCache;let cache=_scopeCache.get(mainScope);return(!cache||resetCache)&&(cache=new Map,_scopeCache.set(mainScope,cache)),cache}getOptionScopes(mainScope,keyLists,resetCache){const{options,type}=this,cache=this._cachedScopes(mainScope,resetCache),cached=cache.get(keyLists);if(cached)return cached;const scopes=new Set;keyLists.forEach(keys=>{mainScope&&(scopes.add(mainScope),keys.forEach(key=>addIfFound(scopes,mainScope,key))),keys.forEach(key=>addIfFound(scopes,options,key)),keys.forEach(key=>addIfFound(scopes,overrides[type]||{},key)),keys.forEach(key=>addIfFound(scopes,defaults,key)),keys.forEach(key=>addIfFound(scopes,descriptors,key))});const array=Array.from(scopes);return 0===array.length&&array.push(Object.create(null)),keysCached.has(keyLists)&&cache.set(keyLists,array),array}chartOptionScopes(){const{options,type}=this;return[options,overrides[type]||{},defaults.datasets[type]||{},{type},defaults,descriptors]}resolveNamedOptions(scopes,names2,context,prefixes=[""]){const result={$shared:!0},{resolver,subPrefixes}=getResolver(this._resolverCache,scopes,prefixes);let options=resolver;if(needContext(resolver,names2)){result.$shared=!1;options=_attachContext(resolver,context=isFunction(context)?context():context,this.createResolver(scopes,context,subPrefixes))}for(const prop of names2)result[prop]=options[prop];return result}createResolver(scopes,context,prefixes=[""],descriptorDefaults){const{resolver}=getResolver(this._resolverCache,scopes,prefixes);return isObject(context)?_attachContext(resolver,context,void 0,descriptorDefaults):resolver}}function getResolver(resolverCache,scopes,prefixes){let cache=resolverCache.get(scopes);cache||(cache=new Map,resolverCache.set(scopes,cache));const cacheKey=prefixes.join();let cached=cache.get(cacheKey);return cached||(cached={resolver:_createResolver(scopes,prefixes),subPrefixes:prefixes.filter(p=>!p.toLowerCase().includes("hover"))},cache.set(cacheKey,cached)),cached}__name(Config,"Config"),__name(getResolver,"getResolver");const hasFunction=__name(value=>isObject(value)&&Object.getOwnPropertyNames(value).reduce((acc,key)=>acc||isFunction(value[key]),!1),"hasFunction");function needContext(proxy,names2){const{isScriptable,isIndexable}=_descriptors(proxy);for(const prop of names2){const scriptable=isScriptable(prop),indexable=isIndexable(prop),value=(indexable||scriptable)&&proxy[prop];if(scriptable&&(isFunction(value)||hasFunction(value))||indexable&&isArray(value))return!0}return!1}__name(needContext,"needContext");const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(position,axis){return"top"===position||"bottom"===position||-1===KNOWN_POSITIONS.indexOf(position)&&"x"===axis}function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1]}}function onAnimationsComplete(context){const chart=context.chart,animationOptions2=chart.options.animation;chart.notifyPlugins("afterRender"),callback(animationOptions2&&animationOptions2.onComplete,[context],chart)}function onAnimationProgress(context){const chart=context.chart,animationOptions2=chart.options.animation;callback(animationOptions2&&animationOptions2.onProgress,[context],chart)}function getCanvas(item){return _isDomSupported()&&"string"==typeof item?item=document.getElementById(item):item&&item.length&&(item=item[0]),item&&item.canvas&&(item=item.canvas),item}__name(positionIsHorizontal,"positionIsHorizontal"),__name(compare2Level,"compare2Level"),__name(onAnimationsComplete,"onAnimationsComplete"),__name(onAnimationProgress,"onAnimationProgress"),__name(getCanvas,"getCanvas");const instances={},getChart=__name(key=>{const canvas=getCanvas(key);return Object.values(instances).filter(c=>c.canvas===canvas).pop()},"getChart");function moveNumericKeys(obj,start,move){const keys=Object.keys(obj);for(const key of keys){const intKey=+key;if(intKey>=start){const value=obj[key];delete obj[key],(move>0||intKey>start)&&(obj[intKey+move]=value)}}}function determineLastEvent(e,lastEvent,inChartArea,isClick){return inChartArea&&"mouseout"!==e.type?isClick?lastEvent:e:null}__name(moveNumericKeys,"moveNumericKeys"),__name(determineLastEvent,"determineLastEvent");class Chart{constructor(item,userConfig){const config=this.config=new Config(userConfig),initialCanvas=getCanvas(item),existingChart=getChart(initialCanvas);if(existingChart)throw new Error("Canvas is already in use. Chart with ID '"+existingChart.id+"' must be destroyed before the canvas can be reused.");const options=config.createResolver(config.chartOptionScopes(),this.getContext());this.platform=new(config.platform||_detectPlatform(initialCanvas)),this.platform.updateConfig(config);const context=this.platform.acquireContext(initialCanvas,options.aspectRatio),canvas=context&&context.canvas,height=canvas&&canvas.height,width=canvas&&canvas.width;this.id=uid(),this.ctx=context,this.canvas=canvas,this.width=width,this.height=height,this._options=options,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(mode=>this.update(mode),options.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,context&&canvas?(animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio,maintainAspectRatio},width,height,_aspectRatio}=this;return isNullOrUndef(aspectRatio)?maintainAspectRatio&&_aspectRatio?_aspectRatio:height?width/height:null:aspectRatio}get data(){return this.config.data}set data(data){this.config.data=data}get options(){return this._options}set options(options){this.config.options=options}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(width,height){animator.running(this)?this._resizeBeforeDraw={width,height}:this._resize(width,height)}_resize(width,height){const options=this.options,canvas=this.canvas,aspectRatio=options.maintainAspectRatio&&this.aspectRatio,newSize=this.platform.getMaximumSize(canvas,width,height,aspectRatio),newRatio=options.devicePixelRatio||this.platform.getDevicePixelRatio(),mode=this.width?"resize":"attach";this.width=newSize.width,this.height=newSize.height,this._aspectRatio=this.aspectRatio,retinaScale(this,newRatio,!0)&&(this.notifyPlugins("resize",{size:newSize}),callback(options.onResize,[this,newSize],this),this.attached&&this._doResize(mode)&&this.render())}ensureScalesHaveIDs(){each(this.options.scales||{},(axisOptions,axisID)=>{axisOptions.id=axisID})}buildOrUpdateScales(){const options=this.options,scaleOpts=options.scales,scales2=this.scales,updated=Object.keys(scales2).reduce((obj,id)=>(obj[id]=!1,obj),{});let items=[];scaleOpts&&(items=items.concat(Object.keys(scaleOpts).map(id=>{const scaleOptions=scaleOpts[id],axis=determineAxis(id,scaleOptions),isRadial="r"===axis,isHorizontal="x"===axis;return{options:scaleOptions,dposition:isRadial?"chartArea":isHorizontal?"bottom":"left",dtype:isRadial?"radialLinear":isHorizontal?"category":"linear"}}))),each(items,item=>{const scaleOptions=item.options,id=scaleOptions.id,axis=determineAxis(id,scaleOptions),scaleType=valueOrDefault(scaleOptions.type,item.dtype);(void 0===scaleOptions.position||positionIsHorizontal(scaleOptions.position,axis)!==positionIsHorizontal(item.dposition))&&(scaleOptions.position=item.dposition),updated[id]=!0;let scale=null;if(id in scales2&&scales2[id].type===scaleType)scale=scales2[id];else{scale=new(registry.getScale(scaleType))({id,type:scaleType,ctx:this.ctx,chart:this}),scales2[scale.id]=scale}scale.init(scaleOptions,options)}),each(updated,(hasUpdated,id)=>{hasUpdated||delete scales2[id]}),each(scales2,scale=>{layouts.configure(this,scale,scale.options),layouts.addBox(this,scale)})}_updateMetasets(){const metasets=this._metasets,numData=this.data.datasets.length,numMeta=metasets.length;if(metasets.sort((a,b)=>a.index-b.index),numMeta>numData){for(let i=numData;idatasets.length&&delete this._stacks,metasets.forEach((meta,index2)=>{0===datasets.filter(x=>x===meta._dataset).length&&this._destroyDatasetMeta(index2)})}buildOrUpdateControllers(){const newControllers=[],datasets=this.data.datasets;let i,ilen;for(this._removeUnreferencedMetasets(),i=0,ilen=datasets.length;i{this.getDatasetMeta(datasetIndex).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(mode){const config=this.config;config.update();const options=this._options=config.createResolver(config.chartOptionScopes(),this.getContext()),animsDisabled=this._animationsDisabled=!options.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode,cancelable:!0}))return;const newControllers=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let minPadding=0;for(let i=0,ilen=this.data.datasets.length;i{controller.reset()}),this._updateDatasets(mode),this.notifyPlugins("afterUpdate",{mode}),this._layers.sort(compare2Level("z","_idx"));const{_active,_lastEvent}=this;_lastEvent?this._eventHandler(_lastEvent,!0):_active.length&&this._updateHoverStyles(_active,_active,!0),this.render()}_updateScales(){each(this.scales,scale=>{layouts.removeBox(this,scale)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const options=this.options,existingEvents=new Set(Object.keys(this._listeners)),newEvents=new Set(options.events);(!setsEqual(existingEvents,newEvents)||!!this._responsiveListeners!==options.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices}=this,changes=this._getUniformDataChanges()||[];for(const{method,start,count}of changes){moveNumericKeys(_hiddenIndices,start,"_removeElements"===method?-count:count)}}_getUniformDataChanges(){const _dataChanges=this._dataChanges;if(!_dataChanges||!_dataChanges.length)return;this._dataChanges=[];const datasetCount=this.data.datasets.length,makeSet=__name(idx=>new Set(_dataChanges.filter(c=>c[0]===idx).map((c,i)=>i+","+c.splice(1).join(","))),"makeSet"),changeSet=makeSet(0);for(let i=1;ic.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(minPadding){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,minPadding);const area=this.chartArea,noArea=area.width<=0||area.height<=0;this._layers=[],each(this.boxes,box=>{noArea&&"chartArea"===box.position||(box.configure&&box.configure(),this._layers.push(...box._layers()))},this),this._layers.forEach((item,index2)=>{item._idx=index2}),this.notifyPlugins("afterLayout")}_updateDatasets(mode){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode,cancelable:!0})){for(let i=0,ilen=this.data.datasets.length;i=0;--i)this._drawDataset(metasets[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(meta){const ctx=this.ctx,clip=meta._clip,useClip=!clip.disabled,area=this.chartArea,args={meta,index:meta.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",args)&&(useClip&&clipArea(ctx,{left:!1===clip.left?0:area.left-clip.left,right:!1===clip.right?this.width:area.right+clip.right,top:!1===clip.top?0:area.top-clip.top,bottom:!1===clip.bottom?this.height:area.bottom+clip.bottom}),meta.controller.draw(),useClip&&unclipArea(ctx),args.cancelable=!1,this.notifyPlugins("afterDatasetDraw",args))}isPointInArea(point){return _isPointInArea(point,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,mode,options,useFinalPosition){const method=Interaction.modes[mode];return"function"==typeof method?method(this,e,options,useFinalPosition):[]}getDatasetMeta(datasetIndex){const dataset=this.data.datasets[datasetIndex],metasets=this._metasets;let meta=metasets.filter(x=>x&&x._dataset===dataset).pop();return meta||(meta={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset&&dataset.order||0,index:datasetIndex,_dataset:dataset,_parsed:[],_sorted:!1},metasets.push(meta)),meta}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(datasetIndex){const dataset=this.data.datasets[datasetIndex];if(!dataset)return!1;const meta=this.getDatasetMeta(datasetIndex);return"boolean"==typeof meta.hidden?!meta.hidden:!dataset.hidden}setDatasetVisibility(datasetIndex,visible){this.getDatasetMeta(datasetIndex).hidden=!visible}toggleDataVisibility(index2){this._hiddenIndices[index2]=!this._hiddenIndices[index2]}getDataVisibility(index2){return!this._hiddenIndices[index2]}_updateVisibility(datasetIndex,dataIndex,visible){const mode=visible?"show":"hide",meta=this.getDatasetMeta(datasetIndex),anims=meta.controller._resolveAnimations(void 0,mode);defined(dataIndex)?(meta.data[dataIndex].hidden=!visible,this.update()):(this.setDatasetVisibility(datasetIndex,visible),anims.update(meta,{visible}),this.update(ctx=>ctx.datasetIndex===datasetIndex?mode:void 0))}hide(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!1)}show(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!0)}_destroyDatasetMeta(datasetIndex){const meta=this._metasets[datasetIndex];meta&&meta.controller&&meta.controller._destroy(),delete this._metasets[datasetIndex]}_stop(){let i,ilen;for(this.stop(),animator.remove(this),i=0,ilen=this.data.datasets.length;i{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),listener=__name((e,x,y)=>{e.offsetX=x,e.offsetY=y,this._eventHandler(e)},"listener");each(this.options.events,type=>_add(type,listener))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const listeners=this._responsiveListeners,platform=this.platform,_add=__name((type,listener2)=>{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),_remove=__name((type,listener2)=>{listeners[type]&&(platform.removeEventListener(this,type,listener2),delete listeners[type])},"_remove"),listener=__name((width,height)=>{this.canvas&&this.resize(width,height)},"listener");let detached;const attached=__name(()=>{_remove("attach",attached),this.attached=!0,this.resize(),_add("resize",listener),_add("detach",detached)},"attached");detached=__name(()=>{this.attached=!1,_remove("resize",listener),this._stop(),this._resize(0,0),_add("attach",attached)},"detached"),platform.isAttached(this.canvas)?attached():detached()}unbindEvents(){each(this._listeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._listeners={},each(this._responsiveListeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._responsiveListeners=void 0}updateHoverStyle(items,mode,enabled){const prefix=enabled?"set":"remove";let meta,item,i,ilen;for("dataset"===mode&&(meta=this.getDatasetMeta(items[0].datasetIndex),meta.controller["_"+prefix+"DatasetHoverStyle"]()),i=0,ilen=items.length;i{const meta=this.getDatasetMeta(datasetIndex);if(!meta)throw new Error("No dataset found at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}});!_elementsEqual(active,lastActive)&&(this._active=active,this._lastEvent=null,this._updateHoverStyles(active,lastActive))}notifyPlugins(hook,args,filter){return this._plugins.notify(this,hook,args,filter)}_updateHoverStyles(active,lastActive,replay){const hoverOptions=this.options.hover,diff=__name((a,b)=>a.filter(x=>!b.some(y=>x.datasetIndex===y.datasetIndex&&x.index===y.index)),"diff"),deactivated=diff(lastActive,active),activated=replay?active:diff(active,lastActive);deactivated.length&&this.updateHoverStyle(deactivated,hoverOptions.mode,!1),activated.length&&hoverOptions.mode&&this.updateHoverStyle(activated,hoverOptions.mode,!0)}_eventHandler(e,replay){const args={event:e,replay,cancelable:!0,inChartArea:this.isPointInArea(e)},eventFilter=__name(plugin=>(plugin.options.events||this.options.events).includes(e.native.type),"eventFilter");if(!1===this.notifyPlugins("beforeEvent",args,eventFilter))return;const changed=this._handleEvent(e,replay,args.inChartArea);return args.cancelable=!1,this.notifyPlugins("afterEvent",args,eventFilter),(changed||args.changed)&&this.render(),this}_handleEvent(e,replay,inChartArea){const{_active:lastActive=[],options}=this,useFinalPosition=replay,active=this._getActiveElements(e,lastActive,inChartArea,useFinalPosition),isClick=_isClickEvent(e),lastEvent=determineLastEvent(e,this._lastEvent,inChartArea,isClick);inChartArea&&(this._lastEvent=null,callback(options.onHover,[e,active,this],this),isClick&&callback(options.onClick,[e,active,this],this));const changed=!_elementsEqual(active,lastActive);return(changed||replay)&&(this._active=active,this._updateHoverStyles(active,lastActive,replay)),this._lastEvent=lastEvent,changed}_getActiveElements(e,lastActive,inChartArea,useFinalPosition){if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;const hoverOptions=this.options.hover;return this.getElementsAtEventForMode(e,hoverOptions.mode,hoverOptions,useFinalPosition)}}__name(Chart,"Chart");const invalidatePlugins=__name(()=>each(Chart.instances,chart=>chart._plugins.invalidate()),"invalidatePlugins");function clipArc(ctx,element,endAngle){const{startAngle,pixelMargin,x,y,outerRadius,innerRadius}=element;let angleMargin=pixelMargin/outerRadius;ctx.beginPath(),ctx.arc(x,y,outerRadius,startAngle-angleMargin,endAngle+angleMargin),innerRadius>pixelMargin?(angleMargin=pixelMargin/innerRadius,ctx.arc(x,y,innerRadius,endAngle+angleMargin,startAngle-angleMargin,!0)):ctx.arc(x,y,pixelMargin,endAngle+HALF_PI,startAngle-HALF_PI),ctx.closePath(),ctx.clip()}function toRadiusCorners(value){return _readValueToProps(value,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(arc,innerRadius,outerRadius,angleDelta){const o=toRadiusCorners(arc.options.borderRadius),halfThickness=(outerRadius-innerRadius)/2,innerLimit=Math.min(halfThickness,angleDelta*innerRadius/2),computeOuterLimit=__name(val=>{const outerArcLimit=(outerRadius-Math.min(halfThickness,val))*angleDelta/2;return _limitValue(val,0,Math.min(halfThickness,outerArcLimit))},"computeOuterLimit");return{outerStart:computeOuterLimit(o.outerStart),outerEnd:computeOuterLimit(o.outerEnd),innerStart:_limitValue(o.innerStart,0,innerLimit),innerEnd:_limitValue(o.innerEnd,0,innerLimit)}}function rThetaToXY(r,theta,x,y){return{x:x+r*Math.cos(theta),y:y+r*Math.sin(theta)}}function pathArc(ctx,element,offset,spacing,end){const{x,y,startAngle:start,pixelMargin,innerRadius:innerR}=element,outerRadius=Math.max(element.outerRadius+spacing+offset-pixelMargin,0),innerRadius=innerR>0?innerR+spacing+offset+pixelMargin:0;let spacingOffset=0;const alpha2=end-start;if(spacing){const avNogSpacingRadius=((innerR>0?innerR-spacing:0)+(outerRadius>0?outerRadius-spacing:0))/2;spacingOffset=(alpha2-(0!==avNogSpacingRadius?alpha2*avNogSpacingRadius/(avNogSpacingRadius+spacing):alpha2))/2}const angleOffset=(alpha2-Math.max(.001,alpha2*outerRadius-offset/PI)/outerRadius)/2,startAngle=start+angleOffset+spacingOffset,endAngle=end-angleOffset-spacingOffset,{outerStart,outerEnd,innerStart,innerEnd}=parseBorderRadius$1(element,innerRadius,outerRadius,endAngle-startAngle),outerStartAdjustedRadius=outerRadius-outerStart,outerEndAdjustedRadius=outerRadius-outerEnd,outerStartAdjustedAngle=startAngle+outerStart/outerStartAdjustedRadius,outerEndAdjustedAngle=endAngle-outerEnd/outerEndAdjustedRadius,innerStartAdjustedRadius=innerRadius+innerStart,innerEndAdjustedRadius=innerRadius+innerEnd,innerStartAdjustedAngle=startAngle+innerStart/innerStartAdjustedRadius,innerEndAdjustedAngle=endAngle-innerEnd/innerEndAdjustedRadius;if(ctx.beginPath(),ctx.arc(x,y,outerRadius,outerStartAdjustedAngle,outerEndAdjustedAngle),outerEnd>0){const pCenter=rThetaToXY(outerEndAdjustedRadius,outerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerEnd,outerEndAdjustedAngle,endAngle+HALF_PI)}const p4=rThetaToXY(innerEndAdjustedRadius,endAngle,x,y);if(ctx.lineTo(p4.x,p4.y),innerEnd>0){const pCenter=rThetaToXY(innerEndAdjustedRadius,innerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerEnd,endAngle+HALF_PI,innerEndAdjustedAngle+Math.PI)}if(ctx.arc(x,y,innerRadius,endAngle-innerEnd/innerRadius,startAngle+innerStart/innerRadius,!0),innerStart>0){const pCenter=rThetaToXY(innerStartAdjustedRadius,innerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerStart,innerStartAdjustedAngle+Math.PI,startAngle-HALF_PI)}const p8=rThetaToXY(outerStartAdjustedRadius,startAngle,x,y);if(ctx.lineTo(p8.x,p8.y),outerStart>0){const pCenter=rThetaToXY(outerStartAdjustedRadius,outerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerStart,startAngle-HALF_PI,outerStartAdjustedAngle)}ctx.closePath()}function drawArc(ctx,element,offset,spacing){const{fullCircles,startAngle,circumference}=element;let endAngle=element.endAngle;if(fullCircles){pathArc(ctx,element,offset,spacing,startAngle+TAU);for(let i=0;i{registry.add(...items),invalidatePlugins()}},unregister:{enumerable:true,value:(...items)=>{registry.remove(...items),invalidatePlugins()}}}),__name(clipArc,"clipArc"),__name(toRadiusCorners,"toRadiusCorners"),__name(parseBorderRadius$1,"parseBorderRadius$1"),__name(rThetaToXY,"rThetaToXY"),__name(pathArc,"pathArc"),__name(drawArc,"drawArc"),__name(drawFullCircleBorders,"drawFullCircleBorders"),__name(drawBorder,"drawBorder");class ArcElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}inRange(chartX,chartY,useFinalPosition){const point=this.getProps(["x","y"],useFinalPosition),{angle,distance}=getAngleFromPoint(point,{x:chartX,y:chartY}),{startAngle,endAngle,innerRadius,outerRadius,circumference}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),rAdjust=this.options.spacing/2,betweenAngles=valueOrDefault(circumference,endAngle-startAngle)>=TAU||_angleBetween(angle,startAngle,endAngle),withinRadius=_isBetween(distance,innerRadius+rAdjust,outerRadius+rAdjust);return betweenAngles&&withinRadius}getCenterPoint(useFinalPosition){const{x,y,startAngle,endAngle,innerRadius,outerRadius}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),{offset,spacing}=this.options,halfAngle=(startAngle+endAngle)/2,halfRadius=(innerRadius+outerRadius+spacing+offset)/2;return{x:x+Math.cos(halfAngle)*halfRadius,y:y+Math.sin(halfAngle)*halfRadius}}tooltipPosition(useFinalPosition){return this.getCenterPoint(useFinalPosition)}draw(ctx){const{options,circumference}=this,offset=(options.offset||0)/2,spacing=(options.spacing||0)/2;if(this.pixelMargin="inner"===options.borderAlign?.33:0,this.fullCircles=circumference>TAU?Math.floor(circumference/TAU):0,0===circumference||this.innerRadius<0||this.outerRadius<0)return;ctx.save();let radiusOffset=0;if(offset){radiusOffset=offset/2;const halfAngle=(this.startAngle+this.endAngle)/2;ctx.translate(Math.cos(halfAngle)*radiusOffset,Math.sin(halfAngle)*radiusOffset),this.circumference>=PI&&(radiusOffset=offset)}ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor;drawBorder(ctx,this,radiusOffset,spacing,drawArc(ctx,this,radiusOffset,spacing)),ctx.restore()}}function setStyle(ctx,options,style=options){ctx.lineCap=valueOrDefault(style.borderCapStyle,options.borderCapStyle),ctx.setLineDash(valueOrDefault(style.borderDash,options.borderDash)),ctx.lineDashOffset=valueOrDefault(style.borderDashOffset,options.borderDashOffset),ctx.lineJoin=valueOrDefault(style.borderJoinStyle,options.borderJoinStyle),ctx.lineWidth=valueOrDefault(style.borderWidth,options.borderWidth),ctx.strokeStyle=valueOrDefault(style.borderColor,options.borderColor)}function lineTo(ctx,previous,target){ctx.lineTo(target.x,target.y)}function getLineMethod(options){return options.stepped?_steppedLineTo:options.tension||"monotone"===options.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(points,segment,params={}){const count=points.length,{start:paramsStart=0,end:paramsEnd=count-1}=params,{start:segmentStart,end:segmentEnd}=segment,start=Math.max(paramsStart,segmentStart),end=Math.min(paramsEnd,segmentEnd),outside=paramsStartsegmentEnd&¶msEnd>segmentEnd;return{count,start,loop:segment.loop,ilen:end(start+(reverse?ilen-index2:index2))%count,"pointIndex"),drawX=__name(()=>{minY!==maxY&&(ctx.lineTo(avgX,maxY),ctx.lineTo(avgX,minY),ctx.lineTo(avgX,lastY))},"drawX");for(move&&(point=points[pointIndex(0)],ctx.moveTo(point.x,point.y)),i=0;i<=ilen;++i){if(point=points[pointIndex(i)],point.skip)continue;const x=point.x,y=point.y,truncX=0|x;truncX===prevX?(ymaxY&&(maxY=y),avgX=(countX*avgX+x)/++countX):(drawX(),ctx.lineTo(x,y),prevX=truncX,countX=0,minY=maxY=y),lastY=y}drawX()}function _getSegmentMethod(line){const opts=line.options,borderDash=opts.borderDash&&opts.borderDash.length;return line._decimated||line._loop||opts.tension||"monotone"===opts.cubicInterpolationMode||opts.stepped||borderDash?pathSegment:fastPathSegment}function _getInterpolationMethod(options){return options.stepped?_steppedInterpolation:options.tension||"monotone"===options.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(ctx,line,start,count){let path=line._path;path||(path=line._path=new Path2D,line.path(path,start,count)&&path.closePath()),setStyle(ctx,line.options),ctx.stroke(path)}function strokePathDirect(ctx,line,start,count){const{segments,options}=line,segmentMethod=_getSegmentMethod(line);for(const segment of segments)setStyle(ctx,options,segment.style),ctx.beginPath(),segmentMethod(ctx,line,segment,{start,end:start+count-1})&&ctx.closePath(),ctx.stroke()}__name(ArcElement,"ArcElement"),ArcElement.id="arc",ArcElement.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ArcElement.defaultRoutes={backgroundColor:"backgroundColor"},__name(setStyle,"setStyle"),__name(lineTo,"lineTo"),__name(getLineMethod,"getLineMethod"),__name(pathVars,"pathVars"),__name(pathSegment,"pathSegment"),__name(fastPathSegment,"fastPathSegment"),__name(_getSegmentMethod,"_getSegmentMethod"),__name(_getInterpolationMethod,"_getInterpolationMethod"),__name(strokePathWithCache,"strokePathWithCache"),__name(strokePathDirect,"strokePathDirect");const usePath2D="function"==typeof Path2D;function draw(ctx,line,start,count){usePath2D&&!line.options.segment?strokePathWithCache(ctx,line,start,count):strokePathDirect(ctx,line,start,count)}__name(draw,"draw");class LineElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}updateControlPoints(chartArea,indexAxis){const options=this.options;if((options.tension||"monotone"===options.cubicInterpolationMode)&&!options.stepped&&!this._pointsUpdated){const loop=options.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,options,chartArea,loop,indexAxis),this._pointsUpdated=!0}}set points(points){this._points=points,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const segments=this.segments,points=this.points;return segments.length&&points[segments[0].start]}last(){const segments=this.segments,points=this.points,count=segments.length;return count&&points[segments[count-1].end]}interpolate(point,property){const options=this.options,value=point[property],points=this.points,segments=_boundSegments(this,{property,start:value,end:value});if(!segments.length)return;const result=[],_interpolate=_getInterpolationMethod(options);let i,ilen;for(i=0,ilen=segments.length;i"borderDash"!==name&&"fill"!==name},__name(inRange$1,"inRange$1");class PointElement extends Element{constructor(cfg){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,cfg&&Object.assign(this,cfg)}inRange(mouseX,mouseY,useFinalPosition){const options=this.options,{x,y}=this.getProps(["x","y"],useFinalPosition);return Math.pow(mouseX-x,2)+Math.pow(mouseY-y,2)=count)return data.slice(start,start+count);const decimated=[],bucketWidth=(count-2)/(samples-2);let sampledIndex=0;const endIndex=start+count-1;let i,maxAreaPoint,maxArea,area,nextA,a=start;for(decimated[sampledIndex++]=data[a],i=0;imaxArea&&(maxArea=area,maxAreaPoint=data[j],nextA=j);decimated[sampledIndex++]=maxAreaPoint,a=nextA}return decimated[sampledIndex++]=data[endIndex],decimated}function minMaxDecimation(data,start,count,availableWidth){let i,point,x,y,prevX,minIndex,maxIndex,startIndex,minY,maxY,avgX=0,countX=0;const decimated=[],endIndex=start+count-1,xMin=data[start].x,dx=data[endIndex].x-xMin;for(i=start;imaxY&&(maxY=y,maxIndex=i),avgX=(countX*avgX+point.x)/++countX;else{const lastIndex=i-1;if(!isNullOrUndef(minIndex)&&!isNullOrUndef(maxIndex)){const intermediateIndex1=Math.min(minIndex,maxIndex),intermediateIndex2=Math.max(minIndex,maxIndex);intermediateIndex1!==startIndex&&intermediateIndex1!==lastIndex&&decimated.push({...data[intermediateIndex1],x:avgX}),intermediateIndex2!==startIndex&&intermediateIndex2!==lastIndex&&decimated.push({...data[intermediateIndex2],x:avgX})}i>0&&lastIndex!==startIndex&&decimated.push(data[lastIndex]),decimated.push(point),prevX=truncX,countX=0,minY=maxY=y,minIndex=maxIndex=startIndex=i}}return decimated}function cleanDecimatedDataset(dataset){if(dataset._decimated){const data=dataset._data;delete dataset._decimated,delete dataset._data,Object.defineProperty(dataset,"data",{value:data})}}function cleanDecimatedData(chart){chart.data.datasets.forEach(dataset=>{cleanDecimatedDataset(dataset)})}function getStartAndCountOfVisiblePointsSimplified(meta,points){const pointCount=points.length;let count,start=0;const{iScale}=meta,{min,max,minDefined,maxDefined}=iScale.getUserBounds();return minDefined&&(start=_limitValue(_lookupByKey(points,iScale.axis,min).lo,0,pointCount-1)),count=maxDefined?_limitValue(_lookupByKey(points,iScale.axis,max).hi+1,start,pointCount)-start:pointCount-start,{start,count}}__name(lttbDecimation,"lttbDecimation"),__name(minMaxDecimation,"minMaxDecimation"),__name(cleanDecimatedDataset,"cleanDecimatedDataset"),__name(cleanDecimatedData,"cleanDecimatedData"),__name(getStartAndCountOfVisiblePointsSimplified,"getStartAndCountOfVisiblePointsSimplified");function _segments(line,target,property){const segments=line.segments,points=line.points,tpoints=target.points,parts=[];for(const segment of segments){let{start,end}=segment;end=_findSegmentEnd(start,end,points);const bounds=_getBounds(property,points[start],points[end],segment.loop);if(!target.segments){parts.push({source:segment,target:bounds,start:points[start],end:points[end]});continue}const targetSegments=_boundSegments(target,bounds);for(const tgt of targetSegments){const subBounds=_getBounds(property,tpoints[tgt.start],tpoints[tgt.end],tgt.loop),fillSources=_boundSegment(segment,points,subBounds);for(const fillSource of fillSources)parts.push({source:fillSource,target:tgt,start:{[property]:_getEdge(bounds,subBounds,"start",Math.max)},end:{[property]:_getEdge(bounds,subBounds,"end",Math.min)}})}}return parts}function _getBounds(property,first,last,loop){if(loop)return;let start=first[property],end=last[property];return"angle"===property&&(start=_normalizeAngle(start),end=_normalizeAngle(end)),{property,start,end}}function _pointsFromSegments(boundary,line){const{x=null,y=null}=boundary||{},linePoints=line.points,points=[];return line.segments.forEach(({start,end})=>{end=_findSegmentEnd(start,end,linePoints);const first=linePoints[start],last=linePoints[end];null!==y?(points.push({x:first.x,y}),points.push({x:last.x,y})):null!==x&&(points.push({x,y:first.y}),points.push({x,y:last.y}))}),points}function _findSegmentEnd(start,end,points){for(;end>start;end--){const point=points[end];if(!isNaN(point.x)&&!isNaN(point.y))break}return end}function _getEdge(a,b,prop,fn){return a&&b?fn(a[prop],b[prop]):a?a[prop]:b?b[prop]:0}function _createBoundaryLine(boundary,line){let points=[],_loop=!1;return isArray(boundary)?(_loop=!0,points=boundary):points=_pointsFromSegments(boundary,line),points.length?new LineElement({points,options:{tension:0},_loop,_fullLoop:_loop}):null}function _resolveTarget(sources,index2,propagate){let fill2=sources[index2].fill;const visited=[index2];let target;if(!propagate)return fill2;for(;!1!==fill2&&-1===visited.indexOf(fill2);){if(!isNumberFinite(fill2))return fill2;if(target=sources[fill2],!target)return!1;if(target.visible)return fill2;visited.push(fill2),fill2=target.fill}return!1}function _decodeFill(line,index2,count){const fill2=parseFillOption(line);if(isObject(fill2))return!isNaN(fill2.value)&&fill2;let target=parseFloat(fill2);return isNumberFinite(target)&&Math.floor(target)===target?decodeTargetIndex(fill2[0],index2,target,count):["origin","start","end","stack","shape"].indexOf(fill2)>=0&&fill2}function decodeTargetIndex(firstCh,index2,target,count){return("-"===firstCh||"+"===firstCh)&&(target=index2+target),!(target===index2||target<0||target>=count)&&target}function _getTargetPixel(fill2,scale){let pixel=null;return"start"===fill2?pixel=scale.bottom:"end"===fill2?pixel=scale.top:isObject(fill2)?pixel=scale.getPixelForValue(fill2.value):scale.getBasePixel&&(pixel=scale.getBasePixel()),pixel}function _getTargetValue(fill2,scale,startValue){let value;return value="start"===fill2?startValue:"end"===fill2?scale.options.reverse?scale.min:scale.max:isObject(fill2)?fill2.value:scale.getBaseValue(),value}function parseFillOption(line){const options=line.options,fillOption=options.fill;let fill2=valueOrDefault(fillOption&&fillOption.target,fillOption);return void 0===fill2&&(fill2=!!options.backgroundColor),!1!==fill2&&null!==fill2&&(!0===fill2?"origin":fill2)}function _buildStackLine(source){const{scale,index:index2,line}=source,points=[],segments=line.segments,sourcePoints=line.points,linesBelow=getLinesBelow(scale,index2);linesBelow.push(_createBoundaryLine({x:null,y:scale.bottom},line));for(let i=0;i=0;--i){const source=metasets[i].$filler;!source||(source.line.updateControlPoints(area,source.axis),draw2&&_drawfill(chart.ctx,source,area))}},beforeDatasetsDraw(chart,_args,options){if("beforeDatasetsDraw"!==options.drawTime)return;const metasets=chart.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;source&&_drawfill(chart.ctx,source,chart.chartArea)}},beforeDatasetDraw(chart,args,options){const source=args.meta.$filler;!source||!1===source.fill||"beforeDatasetDraw"!==options.drawTime||_drawfill(chart.ctx,source,chart.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=__name((labelOpts,fontSize)=>{let{boxHeight=fontSize,boxWidth=fontSize}=labelOpts;return labelOpts.usePointStyle&&(boxHeight=Math.min(boxHeight,fontSize),boxWidth=Math.min(boxWidth,fontSize)),{boxWidth,boxHeight,itemHeight:Math.max(fontSize,boxHeight)}},"getBoxSize"),itemsEqual=__name((a,b)=>null!==a&&null!==b&&a.datasetIndex===b.datasetIndex&&a.index===b.index,"itemsEqual");class Legend extends Element{constructor(config){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight,margins){this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins,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 labelOpts=this.options.labels||{};let legendItems=callback(labelOpts.generateLabels,[this.chart],this)||[];labelOpts.filter&&(legendItems=legendItems.filter(item=>labelOpts.filter(item,this.chart.data))),labelOpts.sort&&(legendItems=legendItems.sort((a,b)=>labelOpts.sort(a,b,this.chart.data))),this.options.reverse&&legendItems.reverse(),this.legendItems=legendItems}fit(){const{options,ctx}=this;if(!options.display)return void(this.width=this.height=0);const labelOpts=options.labels,labelFont=toFont(labelOpts.font),fontSize=labelFont.size,titleHeight=this._computeTitleHeight(),{boxWidth,itemHeight}=getBoxSize(labelOpts,fontSize);let width,height;ctx.font=labelFont.string,this.isHorizontal()?(width=this.maxWidth,height=this._fitRows(titleHeight,fontSize,boxWidth,itemHeight)+10):(height=this.maxHeight,width=this._fitCols(titleHeight,fontSize,boxWidth,itemHeight)+10),this.width=Math.min(width,options.maxWidth||this.maxWidth),this.height=Math.min(height,options.maxHeight||this.maxHeight)}_fitRows(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxWidth,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],lineWidths=this.lineWidths=[0],lineHeight=itemHeight+padding;let totalHeight=titleHeight;ctx.textAlign="left",ctx.textBaseline="middle";let row=-1,top=-lineHeight;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;(0===i||lineWidths[lineWidths.length-1]+itemWidth+2*padding>maxWidth)&&(totalHeight+=lineHeight,lineWidths[lineWidths.length-(i>0?0:1)]=0,top+=lineHeight,row++),hitboxes[i]={left:0,top,row,width:itemWidth,height:itemHeight},lineWidths[lineWidths.length-1]+=itemWidth+padding}),totalHeight}_fitCols(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxHeight,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],columnSizes=this.columnSizes=[],heightLimit=maxHeight-titleHeight;let totalWidth=padding,currentColWidth=0,currentColHeight=0,left=0,col=0;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;i>0&¤tColHeight+itemHeight+2*padding>heightLimit&&(totalWidth+=currentColWidth+padding,columnSizes.push({width:currentColWidth,height:currentColHeight}),left+=currentColWidth+padding,col++,currentColWidth=currentColHeight=0),hitboxes[i]={left,top:currentColHeight,col,width:itemWidth,height:itemHeight},currentColWidth=Math.max(currentColWidth,itemWidth),currentColHeight+=itemHeight+padding}),totalWidth+=currentColWidth,columnSizes.push({width:currentColWidth,height:currentColHeight}),totalWidth}adjustHitBoxes(){if(!this.options.display)return;const titleHeight=this._computeTitleHeight(),{legendHitBoxes:hitboxes,options:{align,labels:{padding},rtl}}=this,rtlHelper=getRtlAdapter(rtl,this.left,this.width);if(this.isHorizontal()){let row=0,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row]);for(const hitbox of hitboxes)row!==hitbox.row&&(row=hitbox.row,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row])),hitbox.top+=this.top+titleHeight+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(left),hitbox.width),left+=hitbox.width+padding}else{let col=0,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height);for(const hitbox of hitboxes)hitbox.col!==col&&(col=hitbox.col,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height)),hitbox.top=top,hitbox.left+=this.left+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(hitbox.left),hitbox.width),top+=hitbox.height+padding}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const ctx=this.ctx;clipArea(ctx,this),this._draw(),unclipArea(ctx)}}_draw(){const{options:opts,columnSizes,lineWidths,ctx}=this,{align,labels:labelOpts}=opts,defaultColor=defaults.color,rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),labelFont=toFont(labelOpts.font),{color:fontColor,padding}=labelOpts,fontSize=labelFont.size,halfFontSize=fontSize/2;let cursor;this.drawTitle(),ctx.textAlign=rtlHelper.textAlign("left"),ctx.textBaseline="middle",ctx.lineWidth=.5,ctx.font=labelFont.string;const{boxWidth,boxHeight,itemHeight}=getBoxSize(labelOpts,fontSize),drawLegendBox=__name(function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0||isNaN(boxHeight)||boxHeight<0)return;ctx.save();const lineWidth=valueOrDefault(legendItem.lineWidth,1);if(ctx.fillStyle=valueOrDefault(legendItem.fillStyle,defaultColor),ctx.lineCap=valueOrDefault(legendItem.lineCap,"butt"),ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,0),ctx.lineJoin=valueOrDefault(legendItem.lineJoin,"miter"),ctx.lineWidth=lineWidth,ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,defaultColor),ctx.setLineDash(valueOrDefault(legendItem.lineDash,[])),labelOpts.usePointStyle){const drawOptions={radius:boxWidth*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth},centerX=rtlHelper.xPlus(x,boxWidth/2);drawPoint(ctx,drawOptions,centerX,y+halfFontSize)}else{const yBoxTop=y+Math.max((fontSize-boxHeight)/2,0),xBoxLeft=rtlHelper.leftForLtr(x,boxWidth),borderRadius=toTRBLCorners(legendItem.borderRadius);ctx.beginPath(),Object.values(borderRadius).some(v=>0!==v)?addRoundedRectPath(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius}):ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight),ctx.fill(),0!==lineWidth&&ctx.stroke()}ctx.restore()},"drawLegendBox"),fillText=__name(function(x,y,legendItem){renderText(ctx,legendItem.text,x,y+itemHeight/2,labelFont,{strikethrough:legendItem.hidden,textAlign:rtlHelper.textAlign(legendItem.textAlign)})},"fillText"),isHorizontal=this.isHorizontal(),titleHeight=this._computeTitleHeight();cursor=isHorizontal?{x:_alignStartEnd(align,this.left+padding,this.right-lineWidths[0]),y:this.top+padding+titleHeight,line:0}:{x:this.left+padding,y:_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[0].height),line:0},overrideTextDirection(this.ctx,opts.textDirection);const lineHeight=itemHeight+padding;this.legendItems.forEach((legendItem,i)=>{ctx.strokeStyle=legendItem.fontColor||fontColor,ctx.fillStyle=legendItem.fontColor||fontColor;const textWidth=ctx.measureText(legendItem.text).width,textAlign=rtlHelper.textAlign(legendItem.textAlign||(legendItem.textAlign=labelOpts.textAlign)),width=boxWidth+halfFontSize+textWidth;let x=cursor.x,y=cursor.y;rtlHelper.setWidth(this.width),isHorizontal?i>0&&x+width+padding>this.right&&(y=cursor.y+=lineHeight,cursor.line++,x=cursor.x=_alignStartEnd(align,this.left+padding,this.right-lineWidths[cursor.line])):i>0&&y+lineHeight>this.bottom&&(x=cursor.x=x+columnSizes[cursor.line].width+padding,cursor.line++,y=cursor.y=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[cursor.line].height));const realX=rtlHelper.x(x);drawLegendBox(realX,y,legendItem),x=_textX(textAlign,x+boxWidth+halfFontSize,isHorizontal?x+width:this.right,opts.rtl),fillText(rtlHelper.x(x),y,legendItem),isHorizontal?cursor.x+=width+padding:cursor.y+=lineHeight}),restoreTextDirection(this.ctx,opts.textDirection)}drawTitle(){const opts=this.options,titleOpts=opts.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);if(!titleOpts.display)return;const rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),ctx=this.ctx,position=titleOpts.position,halfFontSize=titleFont.size/2,topPaddingPlusHalfFontSize=titlePadding.top+halfFontSize;let y,left=this.left,maxWidth=this.width;if(this.isHorizontal())maxWidth=Math.max(...this.lineWidths),y=this.top+topPaddingPlusHalfFontSize,left=_alignStartEnd(opts.align,left,this.right-maxWidth);else{const maxHeight=this.columnSizes.reduce((acc,size)=>Math.max(acc,size.height),0);y=topPaddingPlusHalfFontSize+_alignStartEnd(opts.align,this.top,this.bottom-maxHeight-opts.labels.padding-this._computeTitleHeight())}const x=_alignStartEnd(position,left,left+maxWidth);ctx.textAlign=rtlHelper.textAlign(_toLeftRightCenter(position)),ctx.textBaseline="middle",ctx.strokeStyle=titleOpts.color,ctx.fillStyle=titleOpts.color,ctx.font=titleFont.string,renderText(ctx,titleOpts.text,x,y,titleFont)}_computeTitleHeight(){const titleOpts=this.options.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);return titleOpts.display?titleFont.lineHeight+titlePadding.height:0}_getLegendItemAt(x,y){let i,hitBox,lh;if(_isBetween(x,this.left,this.right)&&_isBetween(y,this.top,this.bottom))for(lh=this.legendHitBoxes,i=0;ictx.chart.options.color,boxWidth:40,padding:10,generateLabels(chart){const datasets=chart.data.datasets,{labels:{usePointStyle,pointStyle,textAlign,color:color2}}=chart.legend.options;return chart._getSortedDatasetMetas().map(meta=>{const style=meta.controller.getStyle(usePointStyle?0:void 0),borderWidth=toPadding(style.borderWidth);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,fontColor:color2,hidden:!meta.visible,lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:(borderWidth.width+borderWidth.height)/4,strokeStyle:style.borderColor,pointStyle:pointStyle||style.pointStyle,rotation:style.rotation,textAlign:textAlign||style.textAlign,borderRadius:0,datasetIndex:meta.index}},this)}},title:{color:ctx=>ctx.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:name=>!name.startsWith("on"),labels:{_scriptable:name=>!["generateLabels","filter","sort"].includes(name)}}};class Title extends Element{constructor(config){super(),this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight){const opts=this.options;if(this.left=0,this.top=0,!opts.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=maxWidth,this.height=this.bottom=maxHeight;const lineCount=isArray(opts.text)?opts.text.length:1;this._padding=toPadding(opts.padding);const textSize=lineCount*toFont(opts.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=textSize:this.width=textSize}isHorizontal(){const pos=this.options.position;return"top"===pos||"bottom"===pos}_drawArgs(offset){const{top,left,bottom,right,options}=this,align=options.align;let maxWidth,titleX,titleY,rotation=0;return this.isHorizontal()?(titleX=_alignStartEnd(align,left,right),titleY=top+offset,maxWidth=right-left):("left"===options.position?(titleX=left+offset,titleY=_alignStartEnd(align,bottom,top),rotation=-.5*PI):(titleX=right-offset,titleY=_alignStartEnd(align,top,bottom),rotation=.5*PI),maxWidth=bottom-top),{titleX,titleY,maxWidth,rotation}}draw(){const ctx=this.ctx,opts=this.options;if(!opts.display)return;const fontOpts=toFont(opts.font),offset=fontOpts.lineHeight/2+this._padding.top,{titleX,titleY,maxWidth,rotation}=this._drawArgs(offset);renderText(ctx,opts.text,0,0,fontOpts,{color:opts.color,maxWidth,rotation,textAlign:_toLeftRightCenter(opts.align),textBaseline:"middle",translation:[titleX,titleY]})}}function createTitle(chart,titleOpts){const title=new Title({ctx:chart.ctx,options:titleOpts,chart});layouts.configure(chart,title,titleOpts),layouts.addBox(chart,title),chart.titleBlock=title}__name(Title,"Title"),__name(createTitle,"createTitle");var plugin_title={id:"title",_element:Title,start(chart,_args,options){createTitle(chart,options)},stop(chart){const titleBlock=chart.titleBlock;layouts.removeBox(chart,titleBlock),delete chart.titleBlock},beforeUpdate(chart,_args,options){const title=chart.titleBlock;layouts.configure(chart,title,options),title.options=options},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 positioners={average(items){if(!items.length)return!1;let i,len,x=0,y=0,count=0;for(i=0,len=items.length;i-1?str.split("\n"):str}function createTooltipItem(chart,item){const{element,datasetIndex,index:index2}=item,controller=chart.getDatasetMeta(datasetIndex).controller,{label,value}=controller.getLabelAndValue(index2);return{chart,label,parsed:controller.getParsed(index2),raw:chart.data.datasets[datasetIndex].data[index2],formattedValue:value,dataset:controller.getDataset(),dataIndex:index2,datasetIndex,element}}function getTooltipSize(tooltip,options){const ctx=tooltip.chart.ctx,{body,footer,title}=tooltip,{boxWidth,boxHeight}=options,bodyFont=toFont(options.bodyFont),titleFont=toFont(options.titleFont),footerFont=toFont(options.footerFont),titleLineCount=title.length,footerLineCount=footer.length,bodyLineItemCount=body.length,padding=toPadding(options.padding);let height=padding.height,width=0,combinedBodyLength=body.reduce((count,bodyItem)=>count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length,0);if(combinedBodyLength+=tooltip.beforeBody.length+tooltip.afterBody.length,titleLineCount&&(height+=titleLineCount*titleFont.lineHeight+(titleLineCount-1)*options.titleSpacing+options.titleMarginBottom),combinedBodyLength){height+=bodyLineItemCount*(options.displayColors?Math.max(boxHeight,bodyFont.lineHeight):bodyFont.lineHeight)+(combinedBodyLength-bodyLineItemCount)*bodyFont.lineHeight+(combinedBodyLength-1)*options.bodySpacing}footerLineCount&&(height+=options.footerMarginTop+footerLineCount*footerFont.lineHeight+(footerLineCount-1)*options.footerSpacing);let widthPadding=0;const maxLineWidth=__name(function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding)},"maxLineWidth");return ctx.save(),ctx.font=titleFont.string,each(tooltip.title,maxLineWidth),ctx.font=bodyFont.string,each(tooltip.beforeBody.concat(tooltip.afterBody),maxLineWidth),widthPadding=options.displayColors?boxWidth+2+options.boxPadding:0,each(body,bodyItem=>{each(bodyItem.before,maxLineWidth),each(bodyItem.lines,maxLineWidth),each(bodyItem.after,maxLineWidth)}),widthPadding=0,ctx.font=footerFont.string,each(tooltip.footer,maxLineWidth),ctx.restore(),width+=padding.width,{width,height}}function determineYAlign(chart,size){const{y,height}=size;return ychart.height-height/2?"bottom":"center"}function doesNotFitWithAlign(xAlign,chart,options,size){const{x,width}=size,caret=options.caretSize+options.caretPadding;if("left"===xAlign&&x+width+caret>chart.width||"right"===xAlign&&x-width-caret<0)return!0}function determineXAlign(chart,options,size,yAlign){const{x,width}=size,{width:chartWidth,chartArea:{left,right}}=chart;let xAlign="center";return"center"===yAlign?xAlign=x<=(left+right)/2?"left":"right":x<=width/2?xAlign="left":x>=chartWidth-width/2&&(xAlign="right"),doesNotFitWithAlign(xAlign,chart,options,size)&&(xAlign="center"),xAlign}function determineAlignment(chart,options,size){const yAlign=size.yAlign||options.yAlign||determineYAlign(chart,size);return{xAlign:size.xAlign||options.xAlign||determineXAlign(chart,options,size,yAlign),yAlign}}function alignX(size,xAlign){let{x,width}=size;return"right"===xAlign?x-=width:"center"===xAlign&&(x-=width/2),x}function alignY(size,yAlign,paddingAndSize){let{y,height}=size;return"top"===yAlign?y+=paddingAndSize:y-="bottom"===yAlign?height+paddingAndSize:height/2,y}function getBackgroundPoint(options,size,alignment,chart){const{caretSize,caretPadding,cornerRadius}=options,{xAlign,yAlign}=alignment,paddingAndSize=caretSize+caretPadding,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius);let x=alignX(size,xAlign);const y=alignY(size,yAlign,paddingAndSize);return"center"===yAlign?"left"===xAlign?x+=paddingAndSize:"right"===xAlign&&(x-=paddingAndSize):"left"===xAlign?x-=Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign&&(x+=Math.max(topRight,bottomRight)+caretSize),{x:_limitValue(x,0,chart.width-size.width),y:_limitValue(y,0,chart.height-size.height)}}function getAlignedX(tooltip,align,options){const padding=toPadding(options.padding);return"center"===align?tooltip.x+tooltip.width/2:"right"===align?tooltip.x+tooltip.width-padding.right:tooltip.x+padding.left}function getBeforeAfterBodyLines(callback2){return pushOrConcat([],splitNewlines(callback2))}function createTooltipContext(parent,tooltip,tooltipItems){return createContext(parent,{tooltip,tooltipItems,type:"tooltip"})}function overrideCallbacks(callbacks,context){const override=context&&context.dataset&&context.dataset.tooltip&&context.dataset.tooltip.callbacks;return override?callbacks.override(override):callbacks}__name(pushOrConcat,"pushOrConcat"),__name(splitNewlines,"splitNewlines"),__name(createTooltipItem,"createTooltipItem"),__name(getTooltipSize,"getTooltipSize"),__name(determineYAlign,"determineYAlign"),__name(doesNotFitWithAlign,"doesNotFitWithAlign"),__name(determineXAlign,"determineXAlign"),__name(determineAlignment,"determineAlignment"),__name(alignX,"alignX"),__name(alignY,"alignY"),__name(getBackgroundPoint,"getBackgroundPoint"),__name(getAlignedX,"getAlignedX"),__name(getBeforeAfterBodyLines,"getBeforeAfterBodyLines"),__name(createTooltipContext,"createTooltipContext"),__name(overrideCallbacks,"overrideCallbacks");class Tooltip extends Element{constructor(config){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=config.chart||config._chart,this._chart=this.chart,this.options=config.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(options){this.options=options,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const cached=this._cachedAnimations;if(cached)return cached;const chart=this.chart,options=this.options.setContext(this.getContext()),opts=options.enabled&&chart.options.animation&&options.animations,animations=new Animations(this.chart,opts);return opts._cacheable&&(this._cachedAnimations=Object.freeze(animations)),animations}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(context,options){const{callbacks}=options,beforeTitle=callbacks.beforeTitle.apply(this,[context]),title=callbacks.title.apply(this,[context]),afterTitle=callbacks.afterTitle.apply(this,[context]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeTitle)),lines=pushOrConcat(lines,splitNewlines(title)),lines=pushOrConcat(lines,splitNewlines(afterTitle)),lines}getBeforeBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this,[tooltipItems]))}getBody(tooltipItems,options){const{callbacks}=options,bodyItems=[];return each(tooltipItems,context=>{const bodyItem={before:[],lines:[],after:[]},scoped=overrideCallbacks(callbacks,context);pushOrConcat(bodyItem.before,splitNewlines(scoped.beforeLabel.call(this,context))),pushOrConcat(bodyItem.lines,scoped.label.call(this,context)),pushOrConcat(bodyItem.after,splitNewlines(scoped.afterLabel.call(this,context))),bodyItems.push(bodyItem)}),bodyItems}getAfterBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this,[tooltipItems]))}getFooter(tooltipItems,options){const{callbacks}=options,beforeFooter=callbacks.beforeFooter.apply(this,[tooltipItems]),footer=callbacks.footer.apply(this,[tooltipItems]),afterFooter=callbacks.afterFooter.apply(this,[tooltipItems]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeFooter)),lines=pushOrConcat(lines,splitNewlines(footer)),lines=pushOrConcat(lines,splitNewlines(afterFooter)),lines}_createItems(options){const active=this._active,data=this.chart.data,labelColors=[],labelPointStyles=[],labelTextColors=[];let i,len,tooltipItems=[];for(i=0,len=active.length;ioptions.filter(element,index2,array,data))),options.itemSort&&(tooltipItems=tooltipItems.sort((a,b)=>options.itemSort(a,b,data))),each(tooltipItems,context=>{const scoped=overrideCallbacks(options.callbacks,context);labelColors.push(scoped.labelColor.call(this,context)),labelPointStyles.push(scoped.labelPointStyle.call(this,context)),labelTextColors.push(scoped.labelTextColor.call(this,context))}),this.labelColors=labelColors,this.labelPointStyles=labelPointStyles,this.labelTextColors=labelTextColors,this.dataPoints=tooltipItems,tooltipItems}update(changed,replay){const options=this.options.setContext(this.getContext()),active=this._active;let properties,tooltipItems=[];if(active.length){const position=positioners[options.position].call(this,active,this._eventPosition);tooltipItems=this._createItems(options),this.title=this.getTitle(tooltipItems,options),this.beforeBody=this.getBeforeBody(tooltipItems,options),this.body=this.getBody(tooltipItems,options),this.afterBody=this.getAfterBody(tooltipItems,options),this.footer=this.getFooter(tooltipItems,options);const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,size),alignment=determineAlignment(this.chart,options,positionAndSize),backgroundPoint=getBackgroundPoint(options,positionAndSize,alignment,this.chart);this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,properties={opacity:1,x:backgroundPoint.x,y:backgroundPoint.y,width:size.width,height:size.height,caretX:position.x,caretY:position.y}}else 0!==this.opacity&&(properties={opacity:0});this._tooltipItems=tooltipItems,this.$context=void 0,properties&&this._resolveAnimations().update(this,properties),changed&&options.external&&options.external.call(this,{chart:this.chart,tooltip:this,replay})}drawCaret(tooltipPoint,ctx,size,options){const caretPosition=this.getCaretPosition(tooltipPoint,size,options);ctx.lineTo(caretPosition.x1,caretPosition.y1),ctx.lineTo(caretPosition.x2,caretPosition.y2),ctx.lineTo(caretPosition.x3,caretPosition.y3)}getCaretPosition(tooltipPoint,size,options){const{xAlign,yAlign}=this,{caretSize,cornerRadius}=options,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius),{x:ptX,y:ptY}=tooltipPoint,{width,height}=size;let x1,x2,x3,y1,y2,y3;return"center"===yAlign?(y2=ptY+height/2,"left"===xAlign?(x1=ptX,x2=x1-caretSize,y1=y2+caretSize,y3=y2-caretSize):(x1=ptX+width,x2=x1+caretSize,y1=y2-caretSize,y3=y2+caretSize),x3=x1):(x2="left"===xAlign?ptX+Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign?ptX+width-Math.max(topRight,bottomRight)-caretSize:this.caretX,"top"===yAlign?(y1=ptY,y2=y1-caretSize,x1=x2-caretSize,x3=x2+caretSize):(y1=ptY+height,y2=y1+caretSize,x1=x2+caretSize,x3=x2-caretSize),y3=y1),{x1,x2,x3,y1,y2,y3}}drawTitle(pt,ctx,options){const title=this.title,length=title.length;let titleFont,titleSpacing,i;if(length){const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width);for(pt.x=getAlignedX(this,options.titleAlign,options),ctx.textAlign=rtlHelper.textAlign(options.titleAlign),ctx.textBaseline="middle",titleFont=toFont(options.titleFont),titleSpacing=options.titleSpacing,ctx.fillStyle=options.titleColor,ctx.font=titleFont.string,i=0;i0!==v)?(ctx.beginPath(),ctx.fillStyle=options.multiKeyBackground,addRoundedRectPath(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius}),ctx.fill(),ctx.stroke(),ctx.fillStyle=labelColors.backgroundColor,ctx.beginPath(),addRoundedRectPath(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius}),ctx.fill()):(ctx.fillStyle=options.multiKeyBackground,ctx.fillRect(outerX,colorY,boxWidth,boxHeight),ctx.strokeRect(outerX,colorY,boxWidth,boxHeight),ctx.fillStyle=labelColors.backgroundColor,ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2))}ctx.fillStyle=this.labelTextColors[i]}drawBody(pt,ctx,options){const{body}=this,{bodySpacing,bodyAlign,displayColors,boxHeight,boxWidth,boxPadding}=options,bodyFont=toFont(options.bodyFont);let bodyLineHeight=bodyFont.lineHeight,xLinePadding=0;const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width),fillLineOfText=__name(function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyLineHeight/2),pt.y+=bodyLineHeight+bodySpacing},"fillLineOfText"),bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign);let bodyItem,textColor,lines,i,j,ilen,jlen;for(ctx.textAlign=bodyAlign,ctx.textBaseline="middle",ctx.font=bodyFont.string,pt.x=getAlignedX(this,bodyAlignForCalculation,options),ctx.fillStyle=options.bodyColor,each(this.beforeBody,fillLineOfText),xLinePadding=displayColors&&"right"!==bodyAlignForCalculation?"center"===bodyAlign?boxWidth/2+boxPadding:boxWidth+2+boxPadding:0,i=0,ilen=body.length;i0&&ctx.stroke()}_updateAnimationTarget(options){const chart=this.chart,anims=this.$animations,animX=anims&&anims.x,animY=anims&&anims.y;if(animX||animY){const position=positioners[options.position].call(this,this._active,this._eventPosition);if(!position)return;const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,this._size),alignment=determineAlignment(chart,options,positionAndSize),point=getBackgroundPoint(options,positionAndSize,alignment,chart);(animX._to!==point.x||animY._to!==point.y)&&(this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,this.width=size.width,this.height=size.height,this.caretX=position.x,this.caretY=position.y,this._resolveAnimations().update(this,point))}}_willRender(){return!!this.opacity}draw(ctx){const options=this.options.setContext(this.getContext());let opacity=this.opacity;if(!opacity)return;this._updateAnimationTarget(options);const tooltipSize={width:this.width,height:this.height},pt={x:this.x,y:this.y};opacity=Math.abs(opacity)<.001?0:opacity;const padding=toPadding(options.padding),hasTooltipContent=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;options.enabled&&hasTooltipContent&&(ctx.save(),ctx.globalAlpha=opacity,this.drawBackground(pt,ctx,tooltipSize,options),overrideTextDirection(ctx,options.textDirection),pt.y+=padding.top,this.drawTitle(pt,ctx,options),this.drawBody(pt,ctx,options),this.drawFooter(pt,ctx,options),restoreTextDirection(ctx,options.textDirection),ctx.restore())}getActiveElements(){return this._active||[]}setActiveElements(activeElements,eventPosition){const lastActive=this._active,active=activeElements.map(({datasetIndex,index:index2})=>{const meta=this.chart.getDatasetMeta(datasetIndex);if(!meta)throw new Error("Cannot find a dataset at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}}),changed=!_elementsEqual(lastActive,active),positionChanged=this._positionChanged(active,eventPosition);(changed||positionChanged)&&(this._active=active,this._eventPosition=eventPosition,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,replay,inChartArea=!0){if(replay&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const options=this.options,lastActive=this._active||[],active=this._getActiveElements(e,lastActive,replay,inChartArea),positionChanged=this._positionChanged(active,e),changed=replay||!_elementsEqual(active,lastActive)||positionChanged;return changed&&(this._active=active,(options.enabled||options.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,replay))),changed}_getActiveElements(e,lastActive,replay,inChartArea){const options=this.options;if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;const active=this.chart.getElementsAtEventForMode(e,options.mode,options,replay);return options.reverse&&active.reverse(),active}_positionChanged(active,e){const{caretX,caretY,options}=this,position=positioners[options.position].call(this,active,e);return!1!==position&&(caretX!==position.x||caretY!==position.y)}}__name(Tooltip,"Tooltip"),Tooltip.positioners=positioners;var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(chart,_args,options){options&&(chart.tooltip=new Tooltip({chart,options}))},beforeUpdate(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},reset(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},afterDraw(chart){const tooltip=chart.tooltip;if(tooltip&&tooltip._willRender()){const args={tooltip};if(!1===chart.notifyPlugins("beforeTooltipDraw",args))return;tooltip.draw(chart.ctx),chart.notifyPlugins("afterTooltipDraw",args)}},afterEvent(chart,args){if(chart.tooltip){const useFinalPosition=args.replay;chart.tooltip.handleEvent(args.event,useFinalPosition,args.inChartArea)&&(args.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:(ctx,opts)=>opts.bodyFont.size,boxWidth:(ctx,opts)=>opts.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:noop,title(tooltipItems){if(tooltipItems.length>0){const item=tooltipItems[0],labels=item.chart.data.labels,labelCount=labels?labels.length:0;if(this&&this.options&&"dataset"===this.options.mode)return item.dataset.label||"";if(item.label)return item.label;if(labelCount>0&&item.dataIndex"filter"!==name&&"itemSort"!==name&&"external"!==name,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=__name((labels,raw,index2,addedLabels)=>("string"==typeof raw?(index2=labels.push(raw)-1,addedLabels.unshift({index:index2,label:raw})):isNaN(raw)&&(index2=null),index2),"addIfString");function findOrAddLabel(labels,raw,index2,addedLabels){const first=labels.indexOf(raw);if(-1===first)return addIfString(labels,raw,index2,addedLabels);return first!==labels.lastIndexOf(raw)?index2:first}__name(findOrAddLabel,"findOrAddLabel");const validIndex=__name((index2,max)=>null===index2?null:_limitValue(Math.round(index2),0,max),"validIndex");class CategoryScale extends Scale{constructor(cfg){super(cfg),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(scaleOptions){const added=this._addedLabels;if(added.length){const labels=this.getLabels();for(const{index:index2,label}of added)labels[index2]===label&&labels.splice(index2,1);this._addedLabels=[]}super.init(scaleOptions)}parse(raw,index2){if(isNullOrUndef(raw))return null;const labels=this.getLabels();return index2=isFinite(index2)&&labels[index2]===raw?index2:findOrAddLabel(labels,raw,valueOrDefault(index2,raw),this._addedLabels),validIndex(index2,labels.length-1)}determineDataLimits(){const{minDefined,maxDefined}=this.getUserBounds();let{min,max}=this.getMinMax(!0);"ticks"===this.options.bounds&&(minDefined||(min=0),maxDefined||(max=this.getLabels().length-1)),this.min=min,this.max=max}buildTicks(){const min=this.min,max=this.max,offset=this.options.offset,ticks=[];let labels=this.getLabels();labels=0===min&&max===labels.length-1?labels:labels.slice(min,max+1),this._valueRange=Math.max(labels.length-(offset?0:1),1),this._startValue=this.min-(offset?.5:0);for(let value=min;value<=max;value++)ticks.push({value});return ticks}getLabelForValue(value){const labels=this.getLabels();return value>=0&&valueticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getValueForPixel(pixel){return Math.round(this._startValue+this.getDecimalForPixel(pixel)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(generationOptions,dataRange){const ticks=[],{bounds,step,min,max,precision,count,maxTicks,maxDigits,includeBounds}=generationOptions,unit=step||1,maxSpaces=maxTicks-1,{min:rmin,max:rmax}=dataRange,minDefined=!isNullOrUndef(min),maxDefined=!isNullOrUndef(max),countDefined=!isNullOrUndef(count),minSpacing=(rmax-rmin)/(maxDigits+1);let factor,niceMin,niceMax,numSpaces,spacing=niceNum((rmax-rmin)/maxSpaces/unit)*unit;if(spacing<1e-14&&!minDefined&&!maxDefined)return[{value:rmin},{value:rmax}];numSpaces=Math.ceil(rmax/spacing)-Math.floor(rmin/spacing),numSpaces>maxSpaces&&(spacing=niceNum(numSpaces*spacing/maxSpaces/unit)*unit),isNullOrUndef(precision)||(factor=Math.pow(10,precision),spacing=Math.ceil(spacing*factor)/factor),"ticks"===bounds?(niceMin=Math.floor(rmin/spacing)*spacing,niceMax=Math.ceil(rmax/spacing)*spacing):(niceMin=rmin,niceMax=rmax),minDefined&&maxDefined&&step&&almostWhole((max-min)/step,spacing/1e3)?(numSpaces=Math.round(Math.min((max-min)/spacing,maxTicks)),spacing=(max-min)/numSpaces,niceMin=min,niceMax=max):countDefined?(niceMin=minDefined?min:niceMin,niceMax=maxDefined?max:niceMax,numSpaces=count-1,spacing=(niceMax-niceMin)/numSpaces):(numSpaces=(niceMax-niceMin)/spacing,numSpaces=almostEquals(numSpaces,Math.round(numSpaces),spacing/1e3)?Math.round(numSpaces):Math.ceil(numSpaces));const decimalPlaces=Math.max(_decimalPlaces(spacing),_decimalPlaces(niceMin));factor=Math.pow(10,isNullOrUndef(precision)?decimalPlaces:precision),niceMin=Math.round(niceMin*factor)/factor,niceMax=Math.round(niceMax*factor)/factor;let j=0;for(minDefined&&(includeBounds&&niceMin!==min?(ticks.push({value:min}),niceMinmin=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax");if(beginAtZero){const minSign=sign(min),maxSign=sign(max);minSign<0&&maxSign<0?setMax(0):minSign>0&&maxSign>0&&setMin(0)}if(min===max){let offset=1;(max>=Number.MAX_SAFE_INTEGER||min<=Number.MIN_SAFE_INTEGER)&&(offset=Math.abs(.05*max)),setMax(max+offset),beginAtZero||setMin(min-offset)}this.min=min,this.max=max}getTickLimit(){const tickOpts=this.options.ticks;let maxTicks,{maxTicksLimit,stepSize}=tickOpts;return stepSize?(maxTicks=Math.ceil(this.max/stepSize)-Math.floor(this.min/stepSize)+1,maxTicks>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`),maxTicks=1e3)):(maxTicks=this.computeTickLimit(),maxTicksLimit=maxTicksLimit||11),maxTicksLimit&&(maxTicks=Math.min(maxTicksLimit,maxTicks)),maxTicks}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const opts=this.options,tickOpts=opts.ticks;let maxTicks=this.getTickLimit();maxTicks=Math.max(2,maxTicks);const ticks=generateTicks$1({maxTicks,bounds:opts.bounds,min:opts.min,max:opts.max,precision:tickOpts.precision,step:tickOpts.stepSize,count:tickOpts.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:tickOpts.minRotation||0,includeBounds:!1!==tickOpts.includeBounds},this._range||this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}configure(){const ticks=this.ticks;let start=this.min,end=this.max;if(super.configure(),this.options.offset&&ticks.length){const offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset,end+=offset}this._startValue=start,this._endValue=end,this._valueRange=end-start}getLabelForValue(value){return formatNumber(value,this.chart.options.locale,this.options.ticks.format)}}__name(LinearScaleBase,"LinearScaleBase");class LinearScale extends LinearScaleBase{determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?min:0,this.max=isNumberFinite(max)?max:1,this.handleTickRangeOptions()}computeTickLimit(){const horizontal=this.isHorizontal(),length=horizontal?this.width:this.height,minRotation=toRadians(this.options.ticks.minRotation),ratio=(horizontal?Math.sin(minRotation):Math.cos(minRotation))||.001,tickFont=this._resolveTickFontOptions(0);return Math.ceil(length/Math.min(40,tickFont.lineHeight/ratio))}getPixelForValue(value){return null===value?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getValueForPixel(pixel){return this._startValue+this.getDecimalForPixel(pixel)*this._valueRange}}function isMajor(tickVal){return tickVal/Math.pow(10,Math.floor(log10(tickVal)))==1}function generateTicks(generationOptions,dataRange){const endExp=Math.floor(log10(dataRange.max)),endSignificand=Math.ceil(dataRange.max/Math.pow(10,endExp)),ticks=[];let tickVal=finiteOrDefault(generationOptions.min,Math.pow(10,Math.floor(log10(dataRange.min)))),exp=Math.floor(log10(tickVal)),significand=Math.floor(tickVal/Math.pow(10,exp)),precision=exp<0?Math.pow(10,Math.abs(exp)):1;do{ticks.push({value:tickVal,major:isMajor(tickVal)}),++significand,10===significand&&(significand=1,++exp,precision=exp>=0?1:precision),tickVal=Math.round(significand*Math.pow(10,exp)*precision)/precision}while(exp0?value:null;this._zero=!0}determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?Math.max(0,min):null,this.max=isNumberFinite(max)?Math.max(0,max):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined,maxDefined}=this.getUserBounds();let min=this.min,max=this.max;const setMin=__name(v=>min=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax"),exp=__name((v,m)=>Math.pow(10,Math.floor(log10(v))+m),"exp");min===max&&(min<=0?(setMin(1),setMax(10)):(setMin(exp(min,-1)),setMax(exp(max,1)))),min<=0&&setMin(exp(max,-1)),max<=0&&setMax(exp(min,1)),this._zero&&this.min!==this._suggestedMin&&min===exp(this.min,0)&&setMin(exp(min,-1)),this.min=min,this.max=max}buildTicks(){const opts=this.options,ticks=generateTicks({min:this._userMin,max:this._userMax},this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}getLabelForValue(value){return void 0===value?"0":formatNumber(value,this.chart.options.locale,this.options.ticks.format)}configure(){const start=this.min;super.configure(),this._startValue=log10(start),this._valueRange=log10(this.max)-log10(start)}getPixelForValue(value){return(void 0===value||0===value)&&(value=this.min),null===value||isNaN(value)?NaN:this.getPixelForDecimal(value===this.min?0:(log10(value)-this._startValue)/this._valueRange)}getValueForPixel(pixel){const decimal=this.getDecimalForPixel(pixel);return Math.pow(10,this._startValue+decimal*this._valueRange)}}function getTickBackdropHeight(opts){const tickOpts=opts.ticks;if(tickOpts.display&&opts.display){const padding=toPadding(tickOpts.backdropPadding);return valueOrDefault(tickOpts.font&&tickOpts.font.size,defaults.font.size)+padding.height}return 0}function measureLabelSize(ctx,font,label){return label=isArray(label)?label:[label],{w:_longestText(ctx,font.string,label),h:label.length*font.lineHeight}}function determineLimits(angle,pos,size,min,max){return angle===min||angle===max?{start:pos-size/2,end:pos+size/2}:anglemax?{start:pos-size,end:pos}:{start:pos,end:pos+size}}function fitWithPointLabels(scale){const orig={l:scale.left+scale._padding.left,r:scale.right-scale._padding.right,t:scale.top+scale._padding.top,b:scale.bottom-scale._padding.bottom},limits=Object.assign({},orig),labelSizes=[],padding=[],valueCount=scale._pointLabels.length,pointLabelOpts=scale.options.pointLabels,additionalAngle=pointLabelOpts.centerPointLabels?PI/valueCount:0;for(let i=0;iorig.r&&(x=(hLimits.end-orig.r)/sin,limits.r=Math.max(limits.r,orig.r+x)),vLimits.startorig.b&&(y=(vLimits.end-orig.b)/cos,limits.b=Math.max(limits.b,orig.b+y))}function buildPointLabelItems(scale,labelSizes,padding){const items=[],valueCount=scale._pointLabels.length,opts=scale.options,extra=getTickBackdropHeight(opts)/2,outerDistance=scale.drawingArea,additionalAngle=opts.pointLabels.centerPointLabels?PI/valueCount:0;for(let i=0;i270||angle<90)&&(y-=h),y}function drawPointLabels(scale,labelCount){const{ctx,options:{pointLabels}}=scale;for(let i=labelCount-1;i>=0;i--){const optsAtIndex=pointLabels.setContext(scale.getPointLabelContext(i)),plFont=toFont(optsAtIndex.font),{x,y,textAlign,left,top,right,bottom}=scale._pointLabelItems[i],{backdropColor}=optsAtIndex;if(!isNullOrUndef(backdropColor)){const borderRadius=toTRBLCorners(optsAtIndex.borderRadius),padding=toPadding(optsAtIndex.backdropPadding);ctx.fillStyle=backdropColor;const backdropLeft=left-padding.left,backdropTop=top-padding.top,backdropWidth=right-left+padding.width,backdropHeight=bottom-top+padding.height;Object.values(borderRadius).some(v=>0!==v)?(ctx.beginPath(),addRoundedRectPath(ctx,{x:backdropLeft,y:backdropTop,w:backdropWidth,h:backdropHeight,radius:borderRadius}),ctx.fill()):ctx.fillRect(backdropLeft,backdropTop,backdropWidth,backdropHeight)}renderText(ctx,scale._pointLabels[i],x,y+plFont.lineHeight/2,plFont,{color:optsAtIndex.color,textAlign,textBaseline:"middle"})}}function pathRadiusLine(scale,radius,circular,labelCount){const{ctx}=scale;if(circular)ctx.arc(scale.xCenter,scale.yCenter,radius,0,TAU);else{let pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(let i=1;i{const label=callback(this.options.pointLabels.callback,[value,index2],this);return label||0===label?label:""}).filter((v,i)=>this.chart.getDataVisibility(i))}fit(){const opts=this.options;opts.display&&opts.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(leftMovement,rightMovement,topMovement,bottomMovement){this.xCenter+=Math.floor((leftMovement-rightMovement)/2),this.yCenter+=Math.floor((topMovement-bottomMovement)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(leftMovement,rightMovement,topMovement,bottomMovement))}getIndexAngle(index2){return _normalizeAngle(index2*(TAU/(this._pointLabels.length||1))+toRadians(this.options.startAngle||0))}getDistanceFromCenterForValue(value){if(isNullOrUndef(value))return NaN;const scalingFactor=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-value)*scalingFactor:(value-this.min)*scalingFactor}getValueForDistanceFromCenter(distance){if(isNullOrUndef(distance))return NaN;const scaledDistance=distance/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-scaledDistance:this.min+scaledDistance}getPointLabelContext(index2){const pointLabels=this._pointLabels||[];if(index2>=0&&index2{if(0!==index2){offset=this.getDistanceFromCenterForValue(tick.value);drawRadiusLine(this,grid.setContext(this.getContext(index2-1)),offset,labelCount)}}),angleLines.display){for(ctx.save(),i=labelCount-1;i>=0;i--){const optsAtIndex=angleLines.setContext(this.getPointLabelContext(i)),{color:color2,lineWidth}=optsAtIndex;!lineWidth||!color2||(ctx.lineWidth=lineWidth,ctx.strokeStyle=color2,ctx.setLineDash(optsAtIndex.borderDash),ctx.lineDashOffset=optsAtIndex.borderDashOffset,offset=this.getDistanceFromCenterForValue(opts.ticks.reverse?this.min:this.max),position=this.getPointPosition(i,offset),ctx.beginPath(),ctx.moveTo(this.xCenter,this.yCenter),ctx.lineTo(position.x,position.y),ctx.stroke())}ctx.restore()}}drawBorder(){}drawLabels(){const ctx=this.ctx,opts=this.options,tickOpts=opts.ticks;if(!tickOpts.display)return;const startAngle=this.getIndexAngle(0);let offset,width;ctx.save(),ctx.translate(this.xCenter,this.yCenter),ctx.rotate(startAngle),ctx.textAlign="center",ctx.textBaseline="middle",this.ticks.forEach((tick,index2)=>{if(0===index2&&!opts.reverse)return;const optsAtIndex=tickOpts.setContext(this.getContext(index2)),tickFont=toFont(optsAtIndex.font);if(offset=this.getDistanceFromCenterForValue(this.ticks[index2].value),optsAtIndex.showLabelBackdrop){ctx.font=tickFont.string,width=ctx.measureText(tick.label).width,ctx.fillStyle=optsAtIndex.backdropColor;const padding=toPadding(optsAtIndex.backdropPadding);ctx.fillRect(-width/2-padding.left,-offset-tickFont.size/2-padding.top,width+padding.width,tickFont.size+padding.height)}renderText(ctx,tick.label,0,-offset,tickFont,{color:optsAtIndex.color})}),ctx.restore()}drawTitle(){}}__name(RadialLinearScale,"RadialLinearScale"),RadialLinearScale.id="radialLinear",RadialLinearScale.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:label=>label,padding:5,centerPointLabels:!1}},RadialLinearScale.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},RadialLinearScale.descriptors={angleLines:{_fallback:"grid"}};const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(a,b){return a-b}function parse(scale,input){if(isNullOrUndef(input))return null;const adapter=scale._adapter,{parser,round:round2,isoWeekday}=scale._parseOpts;let value=input;return"function"==typeof parser&&(value=parser(value)),isNumberFinite(value)||(value="string"==typeof parser?adapter.parse(value,parser):adapter.parse(value)),null===value?null:(round2&&(value="week"!==round2||!isNumber(isoWeekday)&&!0!==isoWeekday?adapter.startOf(value,round2):adapter.startOf(value,"isoWeek",isoWeekday)),+value)}function determineUnitForAutoTicks(minUnit,min,max,capacity){const ilen=UNITS.length;for(let i=UNITS.indexOf(minUnit);i=UNITS.indexOf(minUnit);i--){const unit=UNITS[i];if(INTERVALS[unit].common&&scale._adapter.diff(max,min,unit)>=numTicks-1)return unit}return UNITS[minUnit?UNITS.indexOf(minUnit):0]}function determineMajorUnit(unit){for(let i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i=time?timestamps[lo]:timestamps[hi]]=!0}}else ticks[time]=!0}function setMajorTicks(scale,ticks,map2,majorUnit){const adapter=scale._adapter,first=+adapter.startOf(ticks[0].value,majorUnit),last=ticks[ticks.length-1].value;let major,index2;for(major=first;major<=last;major=+adapter.add(major,1,majorUnit))index2=map2[major],index2>=0&&(ticks[index2].major=!0);return ticks}function ticksFromTimestamps(scale,values,majorUnit){const ticks=[],map2={},ilen=values.length;let i,value;for(i=0;i+tick.value))}initOffsets(timestamps){let first,last,start=0,end=0;this.options.offset&×tamps.length&&(first=this.getDecimalForValue(timestamps[0]),start=1===timestamps.length?1-first:(this.getDecimalForValue(timestamps[1])-first)/2,last=this.getDecimalForValue(timestamps[timestamps.length-1]),end=1===timestamps.length?last:(last-this.getDecimalForValue(timestamps[timestamps.length-2]))/2);const limit=timestamps.length<3?.5:.25;start=_limitValue(start,0,limit),end=_limitValue(end,0,limit),this._offsets={start,end,factor:1/(start+1+end)}}_generate(){const adapter=this._adapter,min=this.min,max=this.max,options=this.options,timeOpts=options.time,minor=timeOpts.unit||determineUnitForAutoTicks(timeOpts.minUnit,min,max,this._getLabelCapacity(min)),stepSize=valueOrDefault(timeOpts.stepSize,1),weekday="week"===minor&&timeOpts.isoWeekday,hasWeekday=isNumber(weekday)||!0===weekday,ticks={};let time,count,first=min;if(hasWeekday&&(first=+adapter.startOf(first,"isoWeek",weekday)),first=+adapter.startOf(first,hasWeekday?"day":minor),adapter.diff(max,min,minor)>1e5*stepSize)throw new Error(min+" and "+max+" are too far apart with stepSize of "+stepSize+" "+minor);const timestamps="data"===options.ticks.source&&this.getDataTimestamps();for(time=first,count=0;timea-b).map(x=>+x)}getLabelForValue(value){const adapter=this._adapter,timeOpts=this.options.time;return timeOpts.tooltipFormat?adapter.format(value,timeOpts.tooltipFormat):adapter.format(value,timeOpts.displayFormats.datetime)}_tickFormatFunction(time,index2,ticks,format){const options=this.options,formats=options.time.displayFormats,unit=this._unit,majorUnit=this._majorUnit,minorFormat=unit&&formats[unit],majorFormat=majorUnit&&formats[majorUnit],tick=ticks[index2],major=majorUnit&&majorFormat&&tick&&tick.major,label=this._adapter.format(time,format||(major?majorFormat:minorFormat)),formatter=options.ticks.callback;return formatter?callback(formatter,[label,index2,ticks],this):label}generateTickLabels(ticks){let i,ilen,tick;for(i=0,ilen=ticks.length;i0?capacity:1}getDataTimestamps(){let i,ilen,timestamps=this._cache.data||[];if(timestamps.length)return timestamps;const metas=this.getMatchingVisibleMetas();if(this._normalized&&metas.length)return this._cache.data=metas[0].controller.getAllParsedValues(this);for(i=0,ilen=metas.length;i=table[lo].pos&&val<=table[hi].pos&&({lo,hi}=_lookupByKey(table,"pos",val)),({pos:prevSource,time:prevTarget}=table[lo]),({pos:nextSource,time:nextTarget}=table[hi])):(val>=table[lo].time&&val<=table[hi].time&&({lo,hi}=_lookupByKey(table,"time",val)),({time:prevSource,pos:prevTarget}=table[lo]),({time:nextSource,pos:nextTarget}=table[hi]));const span=nextSource-prevSource;return span?prevTarget+(nextTarget-prevTarget)*(val-prevSource)/span:prevTarget}__name(TimeScale,"TimeScale"),TimeScale.id="time",TimeScale.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}},__name(chart_esm_interpolate,"chart_esm_interpolate");class TimeSeriesScale extends TimeScale{constructor(props){super(props),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const timestamps=this._getTimestampsForTable(),table=this._table=this.buildLookupTable(timestamps);this._minPos=chart_esm_interpolate(table,this.min),this._tableRange=chart_esm_interpolate(table,this.max)-this._minPos,super.initOffsets(timestamps)}buildLookupTable(timestamps){const{min,max}=this,items=[],table=[];let i,ilen,prev,curr,next;for(i=0,ilen=timestamps.length;i=min&&curr<=max&&items.push(curr);if(items.length<2)return[{time:min,pos:0},{time:max,pos:1}];for(i=0,ilen=items.length;i__defProp(target,"name",{value,configurable:!0});exports.id=698,exports.ids=[698],exports.modules={53698:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{HomeModule:()=>HomeModule});var common=__webpack_require__(69808),router=__webpack_require__(74202),core=__webpack_require__(5e3),auth_service=__webpack_require__(16518),ngx_translate_core=__webpack_require__(81981);function HomeComponent_p_1_Template(rf,ctx){1&rf&&(core.TgZ(0,"p",2),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.hij(" ",core.lcZ(2,1,"Please verify your email address. (Check your inbox)")," "))}__name(HomeComponent_p_1_Template,"HomeComponent_p_1_Template");class HomeComponent{constructor(authService){this.authService=authService,this.emailVerified=this.authService.isEmailVerified}ngOnInit(){}}__name(HomeComponent,"HomeComponent"),HomeComponent.\u0275fac=__name(function(t){return new(t||HomeComponent)(core.Y36(auth_service.e))},"HomeComponent_Factory"),HomeComponent.\u0275cmp=core.Xpm({type:HomeComponent,selectors:[["app-home"]],decls:6,vars:6,consts:[[1,"home-container"],["class","alert alert-warning","style","text-align: center;",4,"ngIf"],[1,"alert","alert-warning",2,"text-align","center"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0),core.YNc(1,HomeComponent_p_1_Template,3,3,"p",1),core.ALo(2,"async"),core.TgZ(3,"h3"),core._uU(4),core.ALo(5,"translate"),core.qZA()()),2&rf&&(core.xp6(1),core.Q6J("ngIf",!core.lcZ(2,2,ctx.emailVerified)),core.xp6(3),core.Oqu(core.lcZ(5,4,"Welcome Home!")))},"HomeComponent_Template"),dependencies:[common.O5,common.Ov,ngx_translate_core.X$],styles:[".home-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;color:var(--font-color);font-size:1rem;min-height:50vh}.home-container[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{text-align:center;padding:25px;margin-block:100px}"]});var auth_guard=__webpack_require__(36471);const routes=[{path:"",component:HomeComponent,canActivate:[auth_guard.a]}];class HomeRoutingModule{}__name(HomeRoutingModule,"HomeRoutingModule"),HomeRoutingModule.\u0275fac=__name(function(t){return new(t||HomeRoutingModule)},"HomeRoutingModule_Factory"),HomeRoutingModule.\u0275mod=core.oAB({type:HomeRoutingModule}),HomeRoutingModule.\u0275inj=core.cJS({imports:[router.Bz.forChild(routes),router.Bz]});var shared_module=__webpack_require__(83436);class HomeModule{}__name(HomeModule,"HomeModule"),HomeModule.\u0275fac=__name(function(t){return new(t||HomeModule)},"HomeModule_Factory"),HomeModule.\u0275mod=core.oAB({type:HomeModule}),HomeModule.\u0275inj=core.cJS({imports:[common.ez,HomeRoutingModule,shared_module.m]})},83436:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>SharedModule});var common=__webpack_require__(69808),angular_datatables=__webpack_require__(65415),fesm2015_forms=__webpack_require__(93075),core=__webpack_require__(5e3),chart_esm=__webpack_require__(34393),operators=__webpack_require__(83292);function listCacheClear(){this.__data__=[],this.size=0}__name(listCacheClear,"listCacheClear");const _listCacheClear=listCacheClear;function eq(value,other){return value===other||value!=value&&other!=other}__name(eq,"eq");const lodash_es_eq=eq;function assocIndexOf(array,key){for(var length=array.length;length--;)if(lodash_es_eq(array[length][0],key))return length;return-1}__name(assocIndexOf,"assocIndexOf");const _assocIndexOf=assocIndexOf;var splice=Array.prototype.splice;function listCacheDelete(key){var data=this.__data__,index=_assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)}__name(listCacheDelete,"listCacheDelete");const _listCacheDelete=listCacheDelete;function listCacheGet(key){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?void 0:data[index][1]}__name(listCacheGet,"listCacheGet");const _listCacheGet=listCacheGet;function listCacheHas(key){return _assocIndexOf(this.__data__,key)>-1}__name(listCacheHas,"listCacheHas");const _listCacheHas=listCacheHas;function listCacheSet(key,value){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}__name(listCacheSet,"listCacheSet");const _listCacheSet=listCacheSet;function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index-1&&value%1==0&&value<=9007199254740991}__name(isLength,"isLength");const lodash_es_isLength=isLength;function isArrayLike(value){return null!=value&&lodash_es_isLength(value.length)&&!lodash_es_isFunction(value)}__name(isArrayLike,"isArrayLike");const lodash_es_isArrayLike=isArrayLike;function isArrayLikeObject(value){return lodash_es_isObjectLike(value)&&lodash_es_isArrayLike(value)}__name(isArrayLikeObject,"isArrayLikeObject");const lodash_es_isArrayLikeObject=isArrayLikeObject;function stubFalse(){return!1}__name(stubFalse,"stubFalse");const lodash_es_stubFalse=stubFalse;var isBuffer_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,isBuffer_freeModule=isBuffer_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,isBuffer_Buffer=isBuffer_freeModule&&isBuffer_freeModule.exports===isBuffer_freeExports?_root.Buffer:void 0;const lodash_es_isBuffer=(isBuffer_Buffer?isBuffer_Buffer.isBuffer:void 0)||lodash_es_stubFalse;var isPlainObject_funcProto=Function.prototype,isPlainObject_objectProto=Object.prototype,isPlainObject_funcToString=isPlainObject_funcProto.toString,isPlainObject_hasOwnProperty=isPlainObject_objectProto.hasOwnProperty,objectCtorString=isPlainObject_funcToString.call(Object);function isPlainObject(value){if(!lodash_es_isObjectLike(value)||"[object Object]"!=_baseGetTag(value))return!1;var proto=_getPrototype(value);if(null===proto)return!0;var Ctor=isPlainObject_hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&isPlainObject_funcToString.call(Ctor)==objectCtorString}__name(isPlainObject,"isPlainObject");const lodash_es_isPlainObject=isPlainObject;var typedArrayTags={};function baseIsTypedArray(value){return lodash_es_isObjectLike(value)&&lodash_es_isLength(value.length)&&!!typedArrayTags[_baseGetTag(value)]}typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1,__name(baseIsTypedArray,"baseIsTypedArray");const _baseIsTypedArray=baseIsTypedArray;function baseUnary(func){return function(value){return func(value)}}__name(baseUnary,"baseUnary");const _baseUnary=baseUnary;var _nodeUtil_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,_nodeUtil_freeModule=_nodeUtil_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=_nodeUtil_freeModule&&_nodeUtil_freeModule.exports===_nodeUtil_freeExports&&_freeGlobal.process,nodeUtil=function(){try{return _nodeUtil_freeModule&&_nodeUtil_freeModule.require&&_nodeUtil_freeModule.require("util").types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}();var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;const lodash_es_isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray;function safeGet(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]}__name(safeGet,"safeGet");const _safeGet=safeGet;var _assignValue_hasOwnProperty=Object.prototype.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];(!_assignValue_hasOwnProperty.call(object,key)||!lodash_es_eq(objValue,value)||void 0===value&&!(key in object))&&_baseAssignValue(object,key,value)}__name(assignValue,"assignValue");const _assignValue=assignValue;function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index-1&&value%1==0&&value0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)}}__name(shortOut,"shortOut");const _setToString=shortOut(_baseSetToString);function baseRest(func,start){return _setToString(_overRest(func,start,lodash_es_identity),func+"")}__name(baseRest,"baseRest");const _baseRest=baseRest;function isIterateeCall(value,index,object){if(!lodash_es_isObject(object))return!1;var type=typeof index;return!!("number"==type?lodash_es_isArrayLike(object)&&_isIndex(index,object.length):"string"==type&&index in object)&&lodash_es_eq(object[index],value)}__name(isIterateeCall,"isIterateeCall");const _isIterateeCall=isIterateeCall;function createAssigner(assigner){return _baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&_isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++indexthis.themeChanged(r)))}ngOnChanges(changes){const requireRender=["type"],propertyNames=Object.getOwnPropertyNames(changes);if(propertyNames.some(key=>requireRender.includes(key))||propertyNames.every(key=>changes[key].isFirstChange()))this.render();else{const config=this.getChartConfiguration();this.chart&&(Object.assign(this.chart.config.data,config.data),Object.assign(this.chart.config.plugins,config.plugins),Object.assign(this.chart.config.options,config.options)),this.update()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(s=>s.unsubscribe())}render(){return this.chart&&this.chart.destroy(),this.zone.runOutsideAngular(()=>this.chart=new chart_esm.kL(this.ctx,this.getChartConfiguration()))}update(duration){this.chart&&this.zone.runOutsideAngular(()=>{var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.update(duration)})}hideDataset(index,hidden){this.chart&&(this.chart.getDatasetMeta(index).hidden=hidden,this.update())}isDatasetHidden(index){var _a,_b;return null===(_b=null===(_a=this.chart)||void 0===_a?void 0:_a.getDatasetMeta(index))||void 0===_b?void 0:_b.hidden}toBase64Image(){var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.toBase64Image()}themeChanged(options){this.themeOverrides=options,this.chart&&(Object.assign(this.chart.config.options,this.getChartOptions()),this.update())}getChartOptions(){return lodash_es_merge({onHover:(event,active)=>{!this.chartHover.observed&&!this.chartHover.observers.length||this.zone.run(()=>this.chartHover.emit({event,active}))},onClick:(event,active)=>{!this.chartClick.observed&&!this.chartClick.observers.length||this.zone.run(()=>this.chartClick.emit({event,active}))}},this.themeOverrides,this.options,{plugins:{legend:{display:this.legend}}})}getChartConfiguration(){return{type:this.type,data:this.getChartData(),plugins:this.plugins,options:this.getChartOptions()}}getChartData(){return this.data?this.data:{labels:this.labels||[],datasets:this.datasets||[]}}}__name(BaseChartDirective,"BaseChartDirective"),BaseChartDirective.\u0275fac=__name(function(t){return new(t||BaseChartDirective)(core.Y36(core.SBq),core.Y36(core.R0b),core.Y36(ThemeService))},"BaseChartDirective_Factory"),BaseChartDirective.\u0275dir=core.lG2({type:BaseChartDirective,selectors:[["canvas","baseChart",""]],inputs:{type:"type",legend:"legend",data:"data",options:"options",plugins:"plugins",labels:"labels",datasets:"datasets"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[core.TTD]});const baseColors=[[255,99,132],[54,162,235],[255,206,86],[231,233,237],[75,192,192],[151,187,205],[220,220,220],[247,70,74],[70,191,189],[253,180,92],[148,159,177],[77,83,96]],builtInDefaults={datasets:{line:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.4),borderColor:context=>rgba(generateColor(context.datasetIndex),1),pointBackgroundColor:context=>rgba(generateColor(context.datasetIndex),1),pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:context=>rgba(generateColor(context.datasetIndex),.8)},bar:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.6),borderColor:context=>rgba(generateColor(context.datasetIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.datasetIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.datasetIndex),1)},get radar(){return this.line},doughnut:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:"#fff",hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),1),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get pie(){return this.doughnut},polarArea:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:context=>rgba(generateColor(context.dataIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get bubble(){return this.doughnut},get scatter(){return this.doughnut},get area(){return this.polarArea}}};function rgba(colour,alpha){return"rgba("+colour.concat(alpha).join(",")+")"}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getRandomColor(){return[getRandomInt(0,255),getRandomInt(0,255),getRandomInt(0,255)]}function generateColor(index=0){return baseColors[index]||getRandomColor()}__name(rgba,"rgba"),__name(getRandomInt,"getRandomInt"),__name(getRandomColor,"getRandomColor"),__name(generateColor,"generateColor"),chart_esm.kL.register(chart_esm.Dx,chart_esm.u,chart_esm.Gu,chart_esm.De,chart_esm.ST,chart_esm.jn,chart_esm.od,chart_esm.f$,chart_esm.uw,chart_esm.vn,chart_esm.ZL,chart_esm.jI,chart_esm.qi,chart_esm.Xi,chart_esm.l7,chart_esm.tt,chart_esm.CV,chart_esm.N0,chart_esm.ho,chart_esm.RM);class NgChartsConfiguration{}__name(NgChartsConfiguration,"NgChartsConfiguration"),NgChartsConfiguration.\u0275fac=__name(function(t){return new(t||NgChartsConfiguration)},"NgChartsConfiguration_Factory"),NgChartsConfiguration.\u0275prov=core.Yz7({token:NgChartsConfiguration,factory:NgChartsConfiguration.\u0275fac,providedIn:"root"});class NgChartsModule{constructor(config){null!=config&&config.plugins&&chart_esm.kL.register(...null==config?void 0:config.plugins);const ngChartsDefaults=lodash_es_merge(builtInDefaults,(null==config?void 0:config.defaults)||{});chart_esm.ce.set(ngChartsDefaults)}static forRoot(config){return{ngModule:NgChartsModule,providers:[{provide:NgChartsConfiguration,useValue:config}]}}}__name(NgChartsModule,"NgChartsModule"),NgChartsModule.\u0275fac=__name(function(t){return new(t||NgChartsModule)(core.LFG(NgChartsConfiguration,8))},"NgChartsModule_Factory"),NgChartsModule.\u0275mod=core.oAB({type:NgChartsModule}),NgChartsModule.\u0275inj=core.cJS({imports:[[]]});var http=__webpack_require__(40520),ngx_translate_core=__webpack_require__(81981),ngx_translate_http_loader=__webpack_require__(80040);function HttpLoaderFactory(http2){return new ngx_translate_http_loader.w(http2)}__name(HttpLoaderFactory,"HttpLoaderFactory");class SharedModule{}__name(SharedModule,"SharedModule"),SharedModule.\u0275fac=__name(function(t){return new(t||SharedModule)},"SharedModule_Factory"),SharedModule.\u0275mod=core.oAB({type:SharedModule}),SharedModule.\u0275inj=core.cJS({imports:[common.ez,angular_datatables.T,fesm2015_forms.UX,fesm2015_forms.u5,NgChartsModule,http.JF,ngx_translate_core.aw.forChild({loader:{provide:ngx_translate_core.Zw,useFactory:HttpLoaderFactory,deps:[http.eN]}}),ngx_translate_core.aw]})},34393:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{qi:()=>ArcElement,vn:()=>BarController,ZL:()=>BarElement,N0:()=>BubbleController,uw:()=>CategoryScale,kL:()=>Chart,jI:()=>DoughnutController,Gu:()=>index,De:()=>plugin_legend,ST:()=>LineController,jn:()=>LineElement,f$:()=>LinearScale,tt:()=>PieController,od:()=>PointElement,CV:()=>PolarAreaController,Xi:()=>RadarController,l7:()=>RadialLinearScale,ho:()=>ScatterController,RM:()=>TimeSeriesScale,Dx:()=>plugin_title,u:()=>plugin_tooltip,ce:()=>defaults}),__name(function fontString(pixelSize,fontStyle,fontFamily){return fontStyle+" "+pixelSize+"px "+fontFamily},"fontString");const requestAnimFrame="undefined"==typeof window?function(callback2){return callback2()}:window.requestAnimationFrame;function throttled(fn,thisArg,updateFn){const updateArgs=updateFn||(args2=>Array.prototype.slice.call(args2));let ticking=!1,args=[];return function(...rest){args=updateArgs(rest),ticking||(ticking=!0,requestAnimFrame.call(window,()=>{ticking=!1,fn.apply(thisArg,args)}))}}function debounce(fn,delay){let timeout;return function(...args){return delay?(clearTimeout(timeout),timeout=setTimeout(fn,delay,args)):fn.apply(this,args),delay}}__name(throttled,"throttled"),__name(debounce,"debounce");const _toLeftRightCenter=__name(align=>"start"===align?"left":"end"===align?"right":"center","_toLeftRightCenter"),_alignStartEnd=__name((align,start,end)=>"start"===align?start:"end"===align?end:(start+end)/2,"_alignStartEnd"),_textX=__name((align,left,right,rtl)=>align===(rtl?"left":"right")?right:"center"===align?(left+right)/2:left,"_textX");function noop(){}__name(noop,"noop");const uid=function(){let id=0;return function(){return id++}}();function isNullOrUndef(value){return null==value}function isArray(value){if(Array.isArray&&Array.isArray(value))return!0;const type=Object.prototype.toString.call(value);return"[object"===type.slice(0,7)&&"Array]"===type.slice(-6)}function isObject(value){return null!==value&&"[object Object]"===Object.prototype.toString.call(value)}__name(isNullOrUndef,"isNullOrUndef"),__name(isArray,"isArray"),__name(isObject,"isObject");const isNumberFinite=__name(value=>("number"==typeof value||value instanceof Number)&&isFinite(+value),"isNumberFinite");function finiteOrDefault(value,defaultValue){return isNumberFinite(value)?value:defaultValue}function valueOrDefault(value,defaultValue){return void 0===value?defaultValue:value}__name(finiteOrDefault,"finiteOrDefault"),__name(valueOrDefault,"valueOrDefault");const toPercentage=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100:value/dimension,"toPercentage"),toDimension=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100*dimension:+value,"toDimension");function callback(fn,args,thisArg){if(fn&&"function"==typeof fn.call)return fn.apply(thisArg,args)}function each(loopable,fn,thisArg,reverse){let i,len,keys;if(isArray(loopable))if(len=loopable.length,reverse)for(i=len-1;i>=0;i--)fn.call(thisArg,loopable[i],i);else for(i=0;ipos;)obj=obj[key.slice(pos,idx)],pos=idx+1,idx=indexOfDotOrLength(key,pos);return obj}function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1)}__name(indexOfDotOrLength,"indexOfDotOrLength"),__name(resolveObjectKey,"resolveObjectKey"),__name(_capitalize,"_capitalize");const defined=__name(value=>void 0!==value,"defined"),isFunction=__name(value=>"function"==typeof value,"isFunction"),setsEqual=__name((a,b)=>{if(a.size!==b.size)return!1;for(const item of a)if(!b.has(item))return!1;return!0},"setsEqual");function _isClickEvent(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}__name(_isClickEvent,"_isClickEvent");const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=2*PI/3,log10=Math.log10,sign=Math.sign;function niceNum(range){const roundedRange=Math.round(range);range=almostEquals(range,roundedRange,range/1e3)?roundedRange:range;const niceRange=Math.pow(10,Math.floor(log10(range))),fraction=range/niceRange;return(fraction<=1?1:fraction<=2?2:fraction<=5?5:10)*niceRange}function _factorize(value){const result=[],sqrt=Math.sqrt(value);let i;for(i=1;ia-b).pop(),result}function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}function almostEquals(x,y,epsilon){return Math.abs(x-y)=x}function _setMinAndMaxByKey(array,target,property){let i,ilen,value;for(i=0,ilen=array.length;iangleToEnd&&startToAngle=Math.min(start,end)-epsilon&&value<=Math.max(start,end)+epsilon}__name(niceNum,"niceNum"),__name(_factorize,"_factorize"),__name(isNumber,"isNumber"),__name(almostEquals,"almostEquals"),__name(almostWhole,"almostWhole"),__name(_setMinAndMaxByKey,"_setMinAndMaxByKey"),__name(toRadians,"toRadians"),__name(toDegrees,"toDegrees"),__name(_decimalPlaces,"_decimalPlaces"),__name(getAngleFromPoint,"getAngleFromPoint"),__name(distanceBetweenPoints,"distanceBetweenPoints"),__name(_angleDiff,"_angleDiff"),__name(_normalizeAngle,"_normalizeAngle"),__name(_angleBetween,"_angleBetween"),__name(_limitValue,"_limitValue"),__name(_int16Range,"_int16Range"),__name(_isBetween,"_isBetween");const atEdge=__name(t=>0===t||1===t,"atEdge"),elasticIn=__name((t,s,p)=>-Math.pow(2,10*(t-=1))*Math.sin((t-s)*TAU/p),"elasticIn"),elasticOut=__name((t,s,p)=>Math.pow(2,-10*t)*Math.sin((t-s)*TAU/p)+1,"elasticOut"),effects={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*HALF_PI),easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>atEdge(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic:t=>atEdge(t)?t:t<.5?.5*elasticIn(2*t,.1125,.45):.5+.5*elasticOut(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let s=1.70158;return(t/=.5)<1?t*t*((1+(s*=1.525))*t-s)*.5:.5*((t-=2)*t*((1+(s*=1.525))*t+s)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,easeInOutBounce:t=>t<.5?.5*effects.easeInBounce(2*t):.5*effects.easeOutBounce(2*t-1)+.5};function round(v){return v+.5|0}__name(round,"round");const lim=__name((v,l,h)=>Math.max(Math.min(v,h),l),"lim");function p2b(v){return lim(round(2.55*v),0,255)}function n2b(v){return lim(round(255*v),0,255)}function b2n(v){return lim(round(v/2.55)/100,0,1)}function n2p(v){return lim(round(100*v),0,100)}__name(p2b,"p2b"),__name(n2b,"n2b"),__name(b2n,"b2n"),__name(n2p,"n2p");const map$1={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},hex=[..."0123456789ABCDEF"],h1=__name(b=>hex[15&b],"h1"),h2=__name(b=>hex[(240&b)>>4]+hex[15&b],"h2"),eq=__name(b=>(240&b)>>4==(15&b),"eq"),isShort=__name(v=>eq(v.r)&&eq(v.g)&&eq(v.b)&&eq(v.a),"isShort");function hexParse(str){var ret,len=str.length;return"#"===str[0]&&(4===len||5===len?ret={r:255&17*map$1[str[1]],g:255&17*map$1[str[2]],b:255&17*map$1[str[3]],a:5===len?17*map$1[str[4]]:255}:(7===len||9===len)&&(ret={r:map$1[str[1]]<<4|map$1[str[2]],g:map$1[str[3]]<<4|map$1[str[4]],b:map$1[str[5]]<<4|map$1[str[6]],a:9===len?map$1[str[7]]<<4|map$1[str[8]]:255})),ret}__name(hexParse,"hexParse");const alpha=__name((a,f)=>a<255?f(a):"","alpha");function hexString(v){var f=isShort(v)?h1:h2;return v?"#"+f(v.r)+f(v.g)+f(v.b)+alpha(v.a,f):void 0}__name(hexString,"hexString");const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(h,s,l){const a=s*Math.min(l,1-l),f=__name((n,k=(n+h/30)%12)=>l-a*Math.max(Math.min(k-3,9-k,1),-1),"f");return[f(0),f(8),f(4)]}function hsv2rgbn(h,s,v){const f=__name((n,k=(n+h/60)%6)=>v-v*s*Math.max(Math.min(k,4-k,1),0),"f");return[f(5),f(3),f(1)]}function hwb2rgbn(h,w,b){const rgb=hsl2rgbn(h,1,.5);let i;for(w+b>1&&(i=1/(w+b),w*=i,b*=i),i=0;i<3;i++)rgb[i]*=1-w-b,rgb[i]+=w;return rgb}function hueValue(r,g,b,d,max){return r===max?(g-b)/d+(g.5?d/(2-max-min):d/(max+min),h=hueValue(r,g,b,d,max),h=60*h+.5),[0|h,s||0,l]}function calln(f,a,b,c){return(Array.isArray(a)?f(a[0],a[1],a[2]):f(a,b,c)).map(n2b)}function hsl2rgb(h,s,l){return calln(hsl2rgbn,h,s,l)}function hwb2rgb(h,w,b){return calln(hwb2rgbn,h,w,b)}function hsv2rgb(h,s,v){return calln(hsv2rgbn,h,s,v)}function hue(h){return(h%360+360)%360}function hueParse(str){const m=HUE_RE.exec(str);let v,a=255;if(!m)return;m[5]!==v&&(a=m[6]?p2b(+m[5]):n2b(+m[5]));const h=hue(+m[2]),p1=+m[3]/100,p2=+m[4]/100;return v="hwb"===m[1]?hwb2rgb(h,p1,p2):"hsv"===m[1]?hsv2rgb(h,p1,p2):hsl2rgb(h,p1,p2),{r:v[0],g:v[1],b:v[2],a}}function rotate(v,deg){var h=rgb2hsl(v);h[0]=hue(h[0]+deg),h=hsl2rgb(h),v.r=h[0],v.g=h[1],v.b=h[2]}function hslString(v){if(!v)return;const a=rgb2hsl(v),h=a[0],s=n2p(a[1]),l=n2p(a[2]);return v.a<255?`hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`:`hsl(${h}, ${s}%, ${l}%)`}__name(hsl2rgbn,"hsl2rgbn"),__name(hsv2rgbn,"hsv2rgbn"),__name(hwb2rgbn,"hwb2rgbn"),__name(hueValue,"hueValue"),__name(rgb2hsl,"rgb2hsl"),__name(calln,"calln"),__name(hsl2rgb,"hsl2rgb"),__name(hwb2rgb,"hwb2rgb"),__name(hsv2rgb,"hsv2rgb"),__name(hue,"hue"),__name(hueParse,"hueParse"),__name(rotate,"rotate"),__name(hslString,"hslString");const map={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"},names$1={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 unpack(){const unpacked={},keys=Object.keys(names$1),tkeys=Object.keys(map);let i,j,k,ok,nk;for(i=0;i>16&255,k>>8&255,255&k]}return unpacked}let names;function nameParse(str){names||(names=unpack(),names.transparent=[0,0,0,0]);const a=names[str.toLowerCase()];return a&&{r:a[0],g:a[1],b:a[2],a:4===a.length?a[3]:255}}__name(unpack,"unpack"),__name(nameParse,"nameParse");const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(str){const m=RGB_RE.exec(str);let r,g,b,a=255;if(m){if(m[7]!==r){const v=+m[7];a=m[8]?p2b(v):lim(255*v,0,255)}return r=+m[1],g=+m[3],b=+m[5],r=255&(m[2]?p2b(r):lim(r,0,255)),g=255&(m[4]?p2b(g):lim(g,0,255)),b=255&(m[6]?p2b(b):lim(b,0,255)),{r,g,b,a}}}function rgbString(v){return v&&(v.a<255?`rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`:`rgb(${v.r}, ${v.g}, ${v.b})`)}__name(rgbParse,"rgbParse"),__name(rgbString,"rgbString");const to=__name(v=>v<=.0031308?12.92*v:1.055*Math.pow(v,1/2.4)-.055,"to"),from=__name(v=>v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4),"from");function interpolate(rgb1,rgb2,t){const r=from(b2n(rgb1.r)),g=from(b2n(rgb1.g)),b=from(b2n(rgb1.b));return{r:n2b(to(r+t*(from(b2n(rgb2.r))-r))),g:n2b(to(g+t*(from(b2n(rgb2.g))-g))),b:n2b(to(b+t*(from(b2n(rgb2.b))-b))),a:rgb1.a+t*(rgb2.a-rgb1.a)}}function modHSL(v,i,ratio){if(v){let tmp=rgb2hsl(v);tmp[i]=Math.max(0,Math.min(tmp[i]+tmp[i]*ratio,0===i?360:1)),tmp=hsl2rgb(tmp),v.r=tmp[0],v.g=tmp[1],v.b=tmp[2]}}function clone(v,proto){return v&&Object.assign(proto||{},v)}function fromObject(input){var v={r:0,g:0,b:0,a:255};return Array.isArray(input)?input.length>=3&&(v={r:input[0],g:input[1],b:input[2],a:255},input.length>3&&(v.a=n2b(input[3]))):(v=clone(input,{r:0,g:0,b:0,a:1})).a=n2b(v.a),v}function functionParse(str){return"r"===str.charAt(0)?rgbParse(str):hueParse(str)}__name(interpolate,"interpolate"),__name(modHSL,"modHSL"),__name(clone,"clone"),__name(fromObject,"fromObject"),__name(functionParse,"functionParse");class Color{constructor(input){if(input instanceof Color)return input;const type=typeof input;let v;"object"===type?v=fromObject(input):"string"===type&&(v=hexParse(input)||nameParse(input)||functionParse(input)),this._rgb=v,this._valid=!!v}get valid(){return this._valid}get rgb(){var v=clone(this._rgb);return v&&(v.a=b2n(v.a)),v}set rgb(obj){this._rgb=fromObject(obj)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(color2,weight){if(color2){const c1=this.rgb,c2=color2.rgb;let w2;const p=weight===w2?.5:weight,w=2*p-1,a=c1.a-c2.a,w1=((w*a==-1?w:(w+a)/(1+w*a))+1)/2;w2=1-w1,c1.r=255&w1*c1.r+w2*c2.r+.5,c1.g=255&w1*c1.g+w2*c2.g+.5,c1.b=255&w1*c1.b+w2*c2.b+.5,c1.a=p*c1.a+(1-p)*c2.a,this.rgb=c1}return this}interpolate(color2,t){return color2&&(this._rgb=interpolate(this._rgb,color2._rgb,t)),this}clone(){return new Color(this.rgb)}alpha(a){return this._rgb.a=n2b(a),this}clearer(ratio){return this._rgb.a*=1-ratio,this}greyscale(){const rgb=this._rgb,val=round(.3*rgb.r+.59*rgb.g+.11*rgb.b);return rgb.r=rgb.g=rgb.b=val,this}opaquer(ratio){return this._rgb.a*=1+ratio,this}negate(){const v=this._rgb;return v.r=255-v.r,v.g=255-v.g,v.b=255-v.b,this}lighten(ratio){return modHSL(this._rgb,2,ratio),this}darken(ratio){return modHSL(this._rgb,2,-ratio),this}saturate(ratio){return modHSL(this._rgb,1,ratio),this}desaturate(ratio){return modHSL(this._rgb,1,-ratio),this}rotate(deg){return rotate(this._rgb,deg),this}}function index_esm(input){return new Color(input)}function isPatternOrGradient(value){if(value&&"object"==typeof value){const type=value.toString();return"[object CanvasPattern]"===type||"[object CanvasGradient]"===type}return!1}function color(value){return isPatternOrGradient(value)?value:index_esm(value)}function getHoverColor(value){return isPatternOrGradient(value)?value:index_esm(value).saturate(.5).darken(.1).hexString()}__name(Color,"Color"),__name(index_esm,"index_esm"),__name(isPatternOrGradient,"isPatternOrGradient"),__name(color,"color"),__name(getHoverColor,"getHoverColor");const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(node,key){if(!key)return node;const keys=key.split(".");for(let i=0,n=keys.length;icontext.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=(ctx,options)=>getHoverColor(options.backgroundColor),this.hoverBorderColor=(ctx,options)=>getHoverColor(options.borderColor),this.hoverColor=(ctx,options)=>getHoverColor(options.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(_descriptors2)}set(scope,values){return set(this,scope,values)}get(scope){return getScope$1(this,scope)}describe(scope,values){return set(descriptors,scope,values)}override(scope,values){return set(overrides,scope,values)}route(scope,name,targetScope,targetName){const scopeObject=getScope$1(this,scope),targetScopeObject=getScope$1(this,targetScope),privateName="_"+name;Object.defineProperties(scopeObject,{[privateName]:{value:scopeObject[name],writable:!0},[name]:{enumerable:!0,get(){const local=this[privateName],target=targetScopeObject[targetName];return isObject(local)?Object.assign({},target,local):valueOrDefault(local,target)},set(value){this[privateName]=value}}})}}__name(Defaults,"Defaults");var defaults=new Defaults({_scriptable:name=>!name.startsWith("on"),_indexable:name=>"events"!==name,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function toFontString(font){return!font||isNullOrUndef(font.size)||isNullOrUndef(font.family)?null:(font.style?font.style+" ":"")+(font.weight?font.weight+" ":"")+font.size+"px "+font.family}function _measureText(ctx,data,gc,longest,string){let textWidth=data[string];return textWidth||(textWidth=data[string]=ctx.measureText(string).width,gc.push(string)),textWidth>longest&&(longest=textWidth),longest}function _longestText(ctx,font,arrayOfThings,cache){let data=(cache=cache||{}).data=cache.data||{},gc=cache.garbageCollect=cache.garbageCollect||[];cache.font!==font&&(data=cache.data={},gc=cache.garbageCollect=[],cache.font=font),ctx.save(),ctx.font=font;let longest=0;const ilen=arrayOfThings.length;let i,j,jlen,thing,nestedThing;for(i=0;iarrayOfThings.length){for(i=0;i0&&ctx.stroke()}}function _isPointInArea(point,area,margin){return margin=margin||.5,!area||point&&point.x>area.left-margin&&point.xarea.top-margin&&point.y0&&""!==opts.strokeColor;let i,line;for(ctx.save(),ctx.font=font.string,setRenderOpts(ctx,opts),i=0;i+v||0,"numberOrZero");function _readValueToProps(value,props){const ret={},objProps=isObject(props),keys=objProps?Object.keys(props):props,read=isObject(value)?objProps?prop=>valueOrDefault(value[prop],value[props[prop]]):prop=>value[prop]:()=>value;for(const prop of keys)ret[prop]=numberOrZero(read(prop));return ret}function toTRBL(value){return _readValueToProps(value,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(value){return _readValueToProps(value,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(value){const obj=toTRBL(value);return obj.width=obj.left+obj.right,obj.height=obj.top+obj.bottom,obj}function toFont(options,fallback){options=options||{},fallback=fallback||defaults.font;let size=valueOrDefault(options.size,fallback.size);"string"==typeof size&&(size=parseInt(size,10));let style=valueOrDefault(options.style,fallback.style);style&&!(""+style).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+style+'"'),style="");const font={family:valueOrDefault(options.family,fallback.family),lineHeight:toLineHeight(valueOrDefault(options.lineHeight,fallback.lineHeight),size),size,style,weight:valueOrDefault(options.weight,fallback.weight),string:""};return font.string=toFontString(font),font}function resolve(inputs,context,index2,info){let i,ilen,value,cacheable=!0;for(i=0,ilen=inputs.length;ibeginAtZero&&0===value?0:value+add,"keepZero");return{min:keepZero(min,-Math.abs(change)),max:keepZero(max,change)}}function createContext(parentContext,context){return Object.assign(Object.create(parentContext),context)}function _lookup(table,value,cmp){cmp=cmp||(index2=>table[index2]1;)mid=lo+hi>>1,cmp(mid)?lo=mid:hi=mid;return{lo,hi}}__name(_readValueToProps,"_readValueToProps"),__name(toTRBL,"toTRBL"),__name(toTRBLCorners,"toTRBLCorners"),__name(toPadding,"toPadding"),__name(toFont,"toFont"),__name(resolve,"resolve"),__name(_addGrace,"_addGrace"),__name(createContext,"createContext"),__name(_lookup,"_lookup");const _lookupByKey=__name((table,key,value)=>_lookup(table,value,index2=>table[index2][key]_lookup(table,value,index2=>table[index2][key]>=value),"_rlookupByKey");function _filterBetween(values,min,max){let start=0,end=values.length;for(;startstart&&values[end-1]>max;)end--;return start>0||end{const method="_onData"+_capitalize(key),base=array[key];Object.defineProperty(array,key,{configurable:!0,enumerable:!1,value(...args){const res=base.apply(this,args);return array._chartjs.listeners.forEach(object=>{"function"==typeof object[method]&&object[method](...args)}),res}})}))}function unlistenArrayEvents(array,listener){const stub=array._chartjs;if(!stub)return;const listeners=stub.listeners,index2=listeners.indexOf(listener);-1!==index2&&listeners.splice(index2,1),!(listeners.length>0)&&(arrayEvents.forEach(key=>{delete array[key]}),delete array._chartjs)}function _arrayUnique(items){const set2=new Set;let i,ilen;for(i=0,ilen=items.length;iscopes[0])){defined(fallback)||(fallback=_resolve("_fallback",scopes));const cache={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:scopes,_rootScopes:rootScopes,_fallback:fallback,_getTarget:getTarget,override:scope=>_createResolver([scope,...scopes],prefixes,rootScopes,fallback)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete target._keys,delete scopes[0][prop],!0),get:(target,prop)=>_cached(target,prop,()=>_resolveWithPrefixes(prop,prefixes,scopes,target)),getOwnPropertyDescriptor:(target,prop)=>Reflect.getOwnPropertyDescriptor(target._scopes[0],prop),getPrototypeOf:()=>Reflect.getPrototypeOf(scopes[0]),has:(target,prop)=>getKeysFromAllScopes(target).includes(prop),ownKeys:target=>getKeysFromAllScopes(target),set(target,prop,value){const storage=target._storage||(target._storage=getTarget());return target[prop]=storage[prop]=value,delete target._keys,!0}})}function _attachContext(proxy,context,subProxy,descriptorDefaults){const cache={_cacheable:!1,_proxy:proxy,_context:context,_subProxy:subProxy,_stack:new Set,_descriptors:_descriptors(proxy,descriptorDefaults),setContext:ctx=>_attachContext(proxy,ctx,subProxy,descriptorDefaults),override:scope=>_attachContext(proxy.override(scope),context,subProxy,descriptorDefaults)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete proxy[prop],!0),get:(target,prop,receiver)=>_cached(target,prop,()=>_resolveWithContext(target,prop,receiver)),getOwnPropertyDescriptor:(target,prop)=>target._descriptors.allKeys?Reflect.has(proxy,prop)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(proxy,prop),getPrototypeOf:()=>Reflect.getPrototypeOf(proxy),has:(target,prop)=>Reflect.has(proxy,prop),ownKeys:()=>Reflect.ownKeys(proxy),set:(target,prop,value)=>(proxy[prop]=value,delete target[prop],!0)})}function _descriptors(proxy,defaults2={scriptable:!0,indexable:!0}){const{_scriptable=defaults2.scriptable,_indexable=defaults2.indexable,_allKeys=defaults2.allKeys}=proxy;return{allKeys:_allKeys,scriptable:_scriptable,indexable:_indexable,isScriptable:isFunction(_scriptable)?_scriptable:()=>_scriptable,isIndexable:isFunction(_indexable)?_indexable:()=>_indexable}}__name(listenArrayEvents,"listenArrayEvents"),__name(unlistenArrayEvents,"unlistenArrayEvents"),__name(_arrayUnique,"_arrayUnique"),__name(_createResolver,"_createResolver"),__name(_attachContext,"_attachContext"),__name(_descriptors,"_descriptors");const readKey=__name((prefix,name)=>prefix?prefix+_capitalize(name):name,"readKey"),needsSubResolver=__name((prop,value)=>isObject(value)&&"adapters"!==prop&&(null===Object.getPrototypeOf(value)||value.constructor===Object),"needsSubResolver");function _cached(target,prop,resolve2){if(Object.prototype.hasOwnProperty.call(target,prop))return target[prop];const value=resolve2();return target[prop]=value,value}function _resolveWithContext(target,prop,receiver){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;let value=_proxy[prop];return isFunction(value)&&descriptors2.isScriptable(prop)&&(value=_resolveScriptable(prop,value,target,receiver)),isArray(value)&&value.length&&(value=_resolveArray(prop,value,target,descriptors2.isIndexable)),needsSubResolver(prop,value)&&(value=_attachContext(value,_context,_subProxy&&_subProxy[prop],descriptors2)),value}function _resolveScriptable(prop,value,target,receiver){const{_proxy,_context,_subProxy,_stack}=target;if(_stack.has(prop))throw new Error("Recursion detected: "+Array.from(_stack).join("->")+"->"+prop);return _stack.add(prop),value=value(_context,_subProxy||receiver),_stack.delete(prop),needsSubResolver(prop,value)&&(value=createSubResolver(_proxy._scopes,_proxy,prop,value)),value}function _resolveArray(prop,value,target,isIndexable){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;if(defined(_context.index)&&isIndexable(prop))value=value[_context.index%value.length];else if(isObject(value[0])){const arr=value,scopes=_proxy._scopes.filter(s=>s!==arr);value=[];for(const item of arr){const resolver=createSubResolver(scopes,_proxy,prop,item);value.push(_attachContext(resolver,_context,_subProxy&&_subProxy[prop],descriptors2))}}return value}function resolveFallback(fallback,prop,value){return isFunction(fallback)?fallback(prop,value):fallback}__name(_cached,"_cached"),__name(_resolveWithContext,"_resolveWithContext"),__name(_resolveScriptable,"_resolveScriptable"),__name(_resolveArray,"_resolveArray"),__name(resolveFallback,"resolveFallback");const getScope=__name((key,parent)=>!0===key?parent:"string"==typeof key?resolveObjectKey(parent,key):void 0,"getScope");function addScopes(set2,parentScopes,key,parentFallback,value){for(const parent of parentScopes){const scope=getScope(key,parent);if(scope){set2.add(scope);const fallback=resolveFallback(scope._fallback,key,value);if(defined(fallback)&&fallback!==key&&fallback!==parentFallback)return fallback}else if(!1===scope&&defined(parentFallback)&&key!==parentFallback)return null}return!1}function createSubResolver(parentScopes,resolver,prop,value){const rootScopes=resolver._rootScopes,fallback=resolveFallback(resolver._fallback,prop,value),allScopes=[...parentScopes,...rootScopes],set2=new Set;set2.add(value);let key=addScopesFromKey(set2,allScopes,prop,fallback||prop,value);return!(null===key||defined(fallback)&&fallback!==prop&&(key=addScopesFromKey(set2,allScopes,fallback,key,value),null===key))&&_createResolver(Array.from(set2),[""],rootScopes,fallback,()=>subGetTarget(resolver,prop,value))}function addScopesFromKey(set2,allScopes,key,fallback,item){for(;key;)key=addScopes(set2,allScopes,key,fallback,item);return key}function subGetTarget(resolver,prop,value){const parent=resolver._getTarget();prop in parent||(parent[prop]={});const target=parent[prop];return isArray(target)&&isObject(value)?value:target}function _resolveWithPrefixes(prop,prefixes,scopes,proxy){let value;for(const prefix of prefixes)if(value=_resolve(readKey(prefix,prop),scopes),defined(value))return needsSubResolver(prop,value)?createSubResolver(scopes,proxy,prop,value):value}function _resolve(key,scopes){for(const scope of scopes){if(!scope)continue;const value=scope[key];if(defined(value))return value}}function getKeysFromAllScopes(target){let keys=target._keys;return keys||(keys=target._keys=resolveKeysFromAllScopes(target._scopes)),keys}function resolveKeysFromAllScopes(scopes){const set2=new Set;for(const scope of scopes)for(const key of Object.keys(scope).filter(k=>!k.startsWith("_")))set2.add(key);return Array.from(set2)}function _parseObjectDataRadialScale(meta,data,start,count){const{iScale}=meta,{key="r"}=this._parsing,parsed=new Array(count);let i,ilen,index2,item;for(i=0,ilen=count;ii"x"===indexAxis?"y":"x","getValueAxis");function splineCurve(firstPoint,middlePoint,afterPoint,t){const previous=firstPoint.skip?middlePoint:firstPoint,current=middlePoint,next=afterPoint.skip?middlePoint:afterPoint,d01=distanceBetweenPoints(current,previous),d12=distanceBetweenPoints(next,current);let s01=d01/(d01+d12),s12=d12/(d01+d12);s01=isNaN(s01)?0:s01,s12=isNaN(s12)?0:s12;const fa=t*s01,fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}}}function monotoneAdjust(points,deltaK,mK){const pointsLen=points.length;let alphaK,betaK,tauK,squaredMagnitude,pointCurrent,pointAfter=getPoint(points,0);for(let i=0;i!pt.skip)),"monotone"===options.cubicInterpolationMode)splineCurveMonotone(points,indexAxis);else{let prev=loop?points[points.length-1]:points[0];for(i=0,ilen=points.length;iwindow.getComputedStyle(element,null),"getComputedStyle");function getStyle(el,property){return getComputedStyle(el).getPropertyValue(property)}__name(getStyle,"getStyle");const positions=["top","right","bottom","left"];function getPositionedStyle(styles,style,suffix){const result={};suffix=suffix?"-"+suffix:"";for(let i=0;i<4;i++){const pos=positions[i];result[pos]=parseFloat(styles[style+"-"+pos+suffix])||0}return result.width=result.left+result.right,result.height=result.top+result.bottom,result}__name(getPositionedStyle,"getPositionedStyle");const useOffsetPos=__name((x,y,target)=>(x>0||y>0)&&(!target||!target.shadowRoot),"useOffsetPos");function getCanvasPosition(e,canvas){const touches=e.touches,source=touches&&touches.length?touches[0]:e,{offsetX,offsetY}=source;let x,y,box=!1;if(useOffsetPos(offsetX,offsetY,e.target))x=offsetX,y=offsetY;else{const rect=canvas.getBoundingClientRect();x=source.clientX-rect.left,y=source.clientY-rect.top,box=!0}return{x,y,box}}function getRelativePosition(evt,chart){if("native"in evt)return evt;const{canvas,currentDevicePixelRatio}=chart,style=getComputedStyle(canvas),borderBox="border-box"===style.boxSizing,paddings=getPositionedStyle(style,"padding"),borders=getPositionedStyle(style,"border","width"),{x,y,box}=getCanvasPosition(evt,canvas),xOffset=paddings.left+(box&&borders.left),yOffset=paddings.top+(box&&borders.top);let{width,height}=chart;return borderBox&&(width-=paddings.width+borders.width,height-=paddings.height+borders.height),{x:Math.round((x-xOffset)/width*canvas.width/currentDevicePixelRatio),y:Math.round((y-yOffset)/height*canvas.height/currentDevicePixelRatio)}}function getContainerSize(canvas,width,height){let maxWidth,maxHeight;if(void 0===width||void 0===height){const container=_getParentNode(canvas);if(container){const rect=container.getBoundingClientRect(),containerStyle=getComputedStyle(container),containerBorder=getPositionedStyle(containerStyle,"border","width"),containerPadding=getPositionedStyle(containerStyle,"padding");width=rect.width-containerPadding.width-containerBorder.width,height=rect.height-containerPadding.height-containerBorder.height,maxWidth=parseMaxStyle(containerStyle.maxWidth,container,"clientWidth"),maxHeight=parseMaxStyle(containerStyle.maxHeight,container,"clientHeight")}else width=canvas.clientWidth,height=canvas.clientHeight}return{width,height,maxWidth:maxWidth||INFINITY,maxHeight:maxHeight||INFINITY}}__name(getCanvasPosition,"getCanvasPosition"),__name(getRelativePosition,"getRelativePosition"),__name(getContainerSize,"getContainerSize");const round1=__name(v=>Math.round(10*v)/10,"round1");function getMaximumSize(canvas,bbWidth,bbHeight,aspectRatio){const style=getComputedStyle(canvas),margins=getPositionedStyle(style,"margin"),maxWidth=parseMaxStyle(style.maxWidth,canvas,"clientWidth")||INFINITY,maxHeight=parseMaxStyle(style.maxHeight,canvas,"clientHeight")||INFINITY,containerSize=getContainerSize(canvas,bbWidth,bbHeight);let{width,height}=containerSize;if("content-box"===style.boxSizing){const borders=getPositionedStyle(style,"border","width"),paddings=getPositionedStyle(style,"padding");width-=paddings.width+borders.width,height-=paddings.height+borders.height}return width=Math.max(0,width-margins.width),height=Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height-margins.height),width=round1(Math.min(width,maxWidth,containerSize.maxWidth)),height=round1(Math.min(height,maxHeight,containerSize.maxHeight)),width&&!height&&(height=round1(width/2)),{width,height}}function retinaScale(chart,forceRatio,forceStyle){const pixelRatio=forceRatio||1,deviceHeight=Math.floor(chart.height*pixelRatio),deviceWidth=Math.floor(chart.width*pixelRatio);chart.height=deviceHeight/pixelRatio,chart.width=deviceWidth/pixelRatio;const canvas=chart.canvas;return canvas.style&&(forceStyle||!canvas.style.height&&!canvas.style.width)&&(canvas.style.height=`${chart.height}px`,canvas.style.width=`${chart.width}px`),(chart.currentDevicePixelRatio!==pixelRatio||canvas.height!==deviceHeight||canvas.width!==deviceWidth)&&(chart.currentDevicePixelRatio=pixelRatio,canvas.height=deviceHeight,canvas.width=deviceWidth,chart.ctx.setTransform(pixelRatio,0,0,pixelRatio,0,0),!0)}__name(getMaximumSize,"getMaximumSize"),__name(retinaScale,"retinaScale");const supportsEventListenerOptions=function(){let passiveSupported=!1;try{const options={get passive(){return passiveSupported=!0,!1}};window.addEventListener("test",null,options),window.removeEventListener("test",null,options)}catch{}return passiveSupported}();function readUsedSize(element,property){const value=getStyle(element,property),matches=value&&value.match(/^(\d+)(\.\d+)?px$/);return matches?+matches[1]:void 0}function _pointInLine(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:p1.y+t*(p2.y-p1.y)}}function _steppedInterpolation(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:"middle"===mode?t<.5?p1.y:p2.y:"after"===mode?t<1?p1.y:p2.y:t>0?p2.y:p1.y}}function _bezierInterpolation(p1,p2,t,mode){const cp1={x:p1.cp2x,y:p1.cp2y},cp2={x:p2.cp1x,y:p2.cp1y},a=_pointInLine(p1,cp1,t),b=_pointInLine(cp1,cp2,t),c=_pointInLine(cp2,p2,t),d=_pointInLine(a,b,t),e=_pointInLine(b,c,t);return _pointInLine(d,e,t)}__name(readUsedSize,"readUsedSize"),__name(_pointInLine,"_pointInLine"),__name(_steppedInterpolation,"_steppedInterpolation"),__name(_bezierInterpolation,"_bezierInterpolation");const intlCache=new Map;function getNumberFormat(locale,options){options=options||{};const cacheKey=locale+JSON.stringify(options);let formatter=intlCache.get(cacheKey);return formatter||(formatter=new Intl.NumberFormat(locale,options),intlCache.set(cacheKey,formatter)),formatter}function formatNumber(num,locale,options){return getNumberFormat(locale,options).format(num)}__name(getNumberFormat,"getNumberFormat"),__name(formatNumber,"formatNumber");const getRightToLeftAdapter=__name(function(rectX,width){return{x:x=>rectX+rectX+width-x,setWidth(w){width=w},textAlign:align=>"center"===align?align:"right"===align?"left":"right",xPlus:(x,value)=>x-value,leftForLtr:(x,itemWidth)=>x-itemWidth}},"getRightToLeftAdapter"),getLeftToRightAdapter=__name(function(){return{x:x=>x,setWidth(w){},textAlign:align=>align,xPlus:(x,value)=>x+value,leftForLtr:(x,_itemWidth)=>x}},"getLeftToRightAdapter");function getRtlAdapter(rtl,rectX,width){return rtl?getRightToLeftAdapter(rectX,width):getLeftToRightAdapter()}function overrideTextDirection(ctx,direction){let style,original;("ltr"===direction||"rtl"===direction)&&(style=ctx.canvas.style,original=[style.getPropertyValue("direction"),style.getPropertyPriority("direction")],style.setProperty("direction",direction,"important"),ctx.prevTextDirection=original)}function restoreTextDirection(ctx,original){void 0!==original&&(delete ctx.prevTextDirection,ctx.canvas.style.setProperty("direction",original[0],original[1]))}function propertyFn(property){return"angle"===property?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(a,b)=>a-b,normalize:x=>x}}function normalizeSegment({start,end,count,loop,style}){return{start:start%count,end:end%count,loop:loop&&(end-start+1)%count==0,style}}function getSegment(segment,points,bounds){const{property,start:startBound,end:endBound}=bounds,{between,normalize}=propertyFn(property),count=points.length;let i,ilen,{start,end,loop}=segment;if(loop){for(start+=count,end+=count,i=0,ilen=count;ibetween(startBound,prevValue,value)&&0!==compare(startBound,prevValue),"startIsBefore"),endIsBefore=__name(()=>0===compare(endBound,value)||between(endBound,prevValue,value),"endIsBefore"),shouldStart=__name(()=>inside||startIsBefore(),"shouldStart"),shouldStop=__name(()=>!inside||endIsBefore(),"shouldStop");for(let i=start,prev=start;i<=end;++i)point=points[i%count],!point.skip&&(value=normalize(point[property]),value!==prevValue&&(inside=between(value,startBound,endBound),null===subStart&&shouldStart()&&(subStart=0===compare(value,startBound)?i:prev),null!==subStart&&shouldStop()&&(result.push(normalizeSegment({start:subStart,end:i,loop,count,style})),subStart=null),prev=i,prevValue=value));return null!==subStart&&result.push(normalizeSegment({start:subStart,end,loop,count,style})),result}function _boundSegments(line,bounds){const result=[],segments=line.segments;for(let i=0;istart&&points[end%count].skip;)end--;return end%=count,{start,end}}function solidSegments(points,start,max,loop){const count=points.length,result=[];let end,last=start,prev=points[start];for(end=start+1;end<=max;++end){const cur=points[end%count];cur.skip||cur.stop?prev.skip||(loop=!1,result.push({start:start%count,end:(end-1)%count,loop}),start=last=cur.stop?end:null):(last=end,prev.skip&&(start=end)),prev=cur}return null!==last&&result.push({start:start%count,end:last%count,loop}),result}function _computeSegments(line,segmentOptions){const points=line.points,spanGaps=line.options.spanGaps,count=points.length;if(!count)return[];const loop=!!line._loop,{start,end}=findStartAndEnd(points,count,loop,spanGaps);if(!0===spanGaps)return splitByStyles(line,[{start,end,loop}],points,segmentOptions);return splitByStyles(line,solidSegments(points,start,endfn({chart,initial:anims.initial,numSteps,currentStep:Math.min(date-anims.start,numSteps)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(date=Date.now()){let remaining=0;this._charts.forEach((anims,chart)=>{if(!anims.running||!anims.items.length)return;const items=anims.items;let item,i=items.length-1,draw2=!1;for(;i>=0;--i)item=items[i],item._active?(item._total>anims.duration&&(anims.duration=item._total),item.tick(date),draw2=!0):(items[i]=items[items.length-1],items.pop());draw2&&(chart.draw(),this._notify(chart,anims,date,"progress")),items.length||(anims.running=!1,this._notify(chart,anims,date,"complete"),anims.initial=!1),remaining+=items.length}),this._lastDate=date,0===remaining&&(this._running=!1)}_getAnims(chart){const charts=this._charts;let anims=charts.get(chart);return anims||(anims={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},charts.set(chart,anims)),anims}listen(chart,event,cb){this._getAnims(chart).listeners[event].push(cb)}add(chart,items){!items||!items.length||this._getAnims(chart).items.push(...items)}has(chart){return this._getAnims(chart).items.length>0}start(chart){const anims=this._charts.get(chart);!anims||(anims.running=!0,anims.start=Date.now(),anims.duration=anims.items.reduce((acc,cur)=>Math.max(acc,cur._duration),0),this._refresh())}running(chart){if(!this._running)return!1;const anims=this._charts.get(chart);return!(!anims||!anims.running||!anims.items.length)}stop(chart){const anims=this._charts.get(chart);if(!anims||!anims.items.length)return;const items=anims.items;let i=items.length-1;for(;i>=0;--i)items[i].cancel();anims.items=[],this._notify(chart,anims,Date.now(),"complete")}remove(chart){return this._charts.delete(chart)}}__name(Animator,"Animator");var animator=new Animator;const interpolators={boolean:(from2,to2,factor)=>factor>.5?to2:from2,color(from2,to2,factor){const c0=color(from2||"transparent"),c1=c0.valid&&color(to2||"transparent");return c1&&c1.valid?c1.mix(c0,factor).hexString():to2},number:(from2,to2,factor)=>from2+(to2-from2)*factor};class Animation{constructor(cfg,target,prop,to2){const currentValue=target[prop];to2=resolve([cfg.to,to2,currentValue,cfg.from]);const from2=resolve([cfg.from,currentValue,to2]);this._active=!0,this._fn=cfg.fn||interpolators[cfg.type||typeof from2],this._easing=effects[cfg.easing]||effects.linear,this._start=Math.floor(Date.now()+(cfg.delay||0)),this._duration=this._total=Math.floor(cfg.duration),this._loop=!!cfg.loop,this._target=target,this._prop=prop,this._from=from2,this._to=to2,this._promises=void 0}active(){return this._active}update(cfg,to2,date){if(this._active){this._notify(!1);const currentValue=this._target[this._prop],elapsed=date-this._start,remain=this._duration-elapsed;this._start=date,this._duration=Math.floor(Math.max(remain,cfg.duration)),this._total+=elapsed,this._loop=!!cfg.loop,this._to=resolve([cfg.to,to2,currentValue,cfg.from]),this._from=resolve([cfg.from,currentValue,to2])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(date){const elapsed=date-this._start,duration=this._duration,prop=this._prop,from2=this._from,loop=this._loop,to2=this._to;let factor;if(this._active=from2!==to2&&(loop||elapsed1?2-factor:factor,factor=this._easing(Math.min(1,Math.max(0,factor))),this._target[prop]=this._fn(from2,to2,factor))}wait(){const promises=this._promises||(this._promises=[]);return new Promise((res,rej)=>{promises.push({res,rej})})}_notify(resolved){const method=resolved?"res":"rej",promises=this._promises||[];for(let i=0;i"onProgress"!==name&&"onComplete"!==name&&"fn"!==name}),defaults.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),defaults.describe("animations",{_fallback:"animation"}),defaults.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:v=>0|v}}}});class Animations{constructor(chart,config){this._chart=chart,this._properties=new Map,this.configure(config)}configure(config){if(!isObject(config))return;const animatedProps=this._properties;Object.getOwnPropertyNames(config).forEach(key=>{const cfg=config[key];if(!isObject(cfg))return;const resolved={};for(const option of animationOptions)resolved[option]=cfg[option];(isArray(cfg.properties)&&cfg.properties||[key]).forEach(prop=>{(prop===key||!animatedProps.has(prop))&&animatedProps.set(prop,resolved)})})}_animateOptions(target,values){const newOptions=values.options,options=resolveTargetOptions(target,newOptions);if(!options)return[];const animations=this._createAnimations(options,newOptions);return newOptions.$shared&&awaitAll(target.options.$animations,newOptions).then(()=>{target.options=newOptions},()=>{}),animations}_createAnimations(target,values){const animatedProps=this._properties,animations=[],running=target.$animations||(target.$animations={}),props=Object.keys(values),date=Date.now();let i;for(i=props.length-1;i>=0;--i){const prop=props[i];if("$"===prop.charAt(0))continue;if("options"===prop){animations.push(...this._animateOptions(target,values));continue}const value=values[prop];let animation=running[prop];const cfg=animatedProps.get(prop);if(animation){if(cfg&&animation.active()){animation.update(cfg,value,date);continue}animation.cancel()}cfg&&cfg.duration?(running[prop]=animation=new Animation(cfg,target,prop,value),animations.push(animation)):target[prop]=value}return animations}update(target,values){if(0===this._properties.size)return void Object.assign(target,values);const animations=this._createAnimations(target,values);return animations.length?(animator.add(this._chart,animations),!0):void 0}}function awaitAll(animations,properties){const running=[],keys=Object.keys(properties);for(let i=0;i0||!positive&&value<0)return meta.index}return null}function updateStacks(controller,parsed){const{chart,_cachedMeta:meta}=controller,stacks=chart._stacks||(chart._stacks={}),{iScale,vScale,index:datasetIndex}=meta,iAxis=iScale.axis,vAxis=vScale.axis,key=getStackKey(iScale,vScale,meta),ilen=parsed.length;let stack;for(let i=0;iscales2[key].axis===axis).shift()}function createDatasetContext(parent,index2){return createContext(parent,{active:!1,dataset:void 0,datasetIndex:index2,index:index2,mode:"default",type:"dataset"})}function createDataContext(parent,index2,element){return createContext(parent,{active:!1,dataIndex:index2,parsed:void 0,raw:void 0,element,index:index2,mode:"default",type:"data"})}function clearStacks(meta,items){const datasetIndex=meta.controller.index,axis=meta.vScale&&meta.vScale.axis;if(axis){items=items||meta._parsed;for(const parsed of items){const stacks=parsed._stacks;if(!stacks||void 0===stacks[axis]||void 0===stacks[axis][datasetIndex])return;delete stacks[axis][datasetIndex]}}}__name(Animations,"Animations"),__name(awaitAll,"awaitAll"),__name(resolveTargetOptions,"resolveTargetOptions"),__name(scaleClip,"scaleClip"),__name(defaultClip,"defaultClip"),__name(toClip,"toClip"),__name(getSortedDatasetIndices,"getSortedDatasetIndices"),__name(applyStack,"applyStack"),__name(convertObjectDataToArray,"convertObjectDataToArray"),__name(isStacked,"isStacked"),__name(getStackKey,"getStackKey"),__name(getUserBounds,"getUserBounds"),__name(getOrCreateStack,"getOrCreateStack"),__name(getLastIndexInStack,"getLastIndexInStack"),__name(updateStacks,"updateStacks"),__name(getFirstScaleId,"getFirstScaleId"),__name(createDatasetContext,"createDatasetContext"),__name(createDataContext,"createDataContext"),__name(clearStacks,"clearStacks");const isDirectUpdateMode=__name(mode=>"reset"===mode||"none"===mode,"isDirectUpdateMode"),cloneIfNotShared=__name((cached,shared)=>shared?cached:Object.assign({},cached),"cloneIfNotShared"),createStack=__name((canStack,meta,chart)=>canStack&&!meta.hidden&&meta._stacked&&{keys:getSortedDatasetIndices(chart,!0),values:null},"createStack");class DatasetController{constructor(chart,datasetIndex){this.chart=chart,this._ctx=chart.ctx,this.index=datasetIndex,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 meta=this._cachedMeta;this.configure(),this.linkScales(),meta._stacked=isStacked(meta.vScale,meta),this.addElements()}updateIndex(datasetIndex){this.index!==datasetIndex&&clearStacks(this._cachedMeta),this.index=datasetIndex}linkScales(){const chart=this.chart,meta=this._cachedMeta,dataset=this.getDataset(),chooseId=__name((axis,x,y,r)=>"x"===axis?x:"r"===axis?r:y,"chooseId"),xid=meta.xAxisID=valueOrDefault(dataset.xAxisID,getFirstScaleId(chart,"x")),yid=meta.yAxisID=valueOrDefault(dataset.yAxisID,getFirstScaleId(chart,"y")),rid=meta.rAxisID=valueOrDefault(dataset.rAxisID,getFirstScaleId(chart,"r")),indexAxis=meta.indexAxis,iid=meta.iAxisID=chooseId(indexAxis,xid,yid,rid),vid=meta.vAxisID=chooseId(indexAxis,yid,xid,rid);meta.xScale=this.getScaleForId(xid),meta.yScale=this.getScaleForId(yid),meta.rScale=this.getScaleForId(rid),meta.iScale=this.getScaleForId(iid),meta.vScale=this.getScaleForId(vid)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(scaleID){return this.chart.scales[scaleID]}_getOtherScale(scale){const meta=this._cachedMeta;return scale===meta.iScale?meta.vScale:meta.iScale}reset(){this._update("reset")}_destroy(){const meta=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),meta._stacked&&clearStacks(meta)}_dataCheck(){const dataset=this.getDataset(),data=dataset.data||(dataset.data=[]),_data=this._data;if(isObject(data))this._data=convertObjectDataToArray(data);else if(_data!==data){if(_data){unlistenArrayEvents(_data,this);const meta=this._cachedMeta;clearStacks(meta),meta._parsed=[]}data&&Object.isExtensible(data)&&listenArrayEvents(data,this),this._syncList=[],this._data=data}}addElements(){const meta=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(meta.dataset=new this.datasetElementType)}buildOrUpdateElements(resetNewElements){const meta=this._cachedMeta,dataset=this.getDataset();let stackChanged=!1;this._dataCheck();const oldStacked=meta._stacked;meta._stacked=isStacked(meta.vScale,meta),meta.stack!==dataset.stack&&(stackChanged=!0,clearStacks(meta),meta.stack=dataset.stack),this._resyncElements(resetNewElements),(stackChanged||oldStacked!==meta._stacked)&&updateStacks(this,meta._parsed)}configure(){const config=this.chart.config,scopeKeys=config.datasetScopeKeys(this._type),scopes=config.getOptionScopes(this.getDataset(),scopeKeys,!0);this.options=config.createResolver(scopes,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(start,count){const{_cachedMeta:meta,_data:data}=this,{iScale,_stacked}=meta,iAxis=iScale.axis;let i,cur,parsed,sorted=0===start&&count===data.length||meta._sorted,prev=start>0&&meta._parsed[start-1];if(!1===this._parsing)meta._parsed=data,meta._sorted=!0,parsed=data;else{parsed=isArray(data[start])?this.parseArrayData(meta,data,start,count):isObject(data[start])?this.parseObjectData(meta,data,start,count):this.parsePrimitiveData(meta,data,start,count);const isNotInOrderComparedToPrev=__name(()=>null===cur[iAxis]||prev&&cur[iAxis]otherValue||otherMax=0;--i)if(!_skip()){this.updateRangeFromParsed(range,scale,parsed,stack);break}return range}getAllParsedValues(scale){const parsed=this._cachedMeta._parsed,values=[];let i,ilen,value;for(i=0,ilen=parsed.length;i=0&&index2this.getContext(index2,active),"context"),values=config.resolveNamedOptions(scopes,names2,context,prefixes);return values.$shared&&(values.$shared=sharing,cache[cacheKey]=Object.freeze(cloneIfNotShared(values,sharing))),values}_resolveAnimations(index2,transition,active){const chart=this.chart,cache=this._cachedDataOpts,cacheKey=`animation-${transition}`,cached=cache[cacheKey];if(cached)return cached;let options;if(!1!==chart.options.animation){const config=this.chart.config,scopeKeys=config.datasetAnimationScopeKeys(this._type,transition),scopes=config.getOptionScopes(this.getDataset(),scopeKeys);options=config.createResolver(scopes,this.getContext(index2,active,transition))}const animations=new Animations(chart,options&&options.animations);return options&&options._cacheable&&(cache[cacheKey]=Object.freeze(animations)),animations}getSharedOptions(options){if(options.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},options))}includeOptions(mode,sharedOptions){return!sharedOptions||isDirectUpdateMode(mode)||this.chart._animationsDisabled}updateElement(element,index2,properties,mode){isDirectUpdateMode(mode)?Object.assign(element,properties):this._resolveAnimations(index2,mode).update(element,properties)}updateSharedOptions(sharedOptions,mode,newOptions){sharedOptions&&!isDirectUpdateMode(mode)&&this._resolveAnimations(void 0,mode).update(sharedOptions,newOptions)}_setStyle(element,index2,mode,active){element.active=active;const options=this.getStyle(index2,active);this._resolveAnimations(index2,mode,active).update(element,{options:!active&&this.getSharedOptions(options)||options})}removeHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!1)}setHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!0)}_removeDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!1)}_setDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!0)}_resyncElements(resetNewElements){const data=this._data,elements=this._cachedMeta.data;for(const[method,arg1,arg2]of this._syncList)this[method](arg1,arg2);this._syncList=[];const numMeta=elements.length,numData=data.length,count=Math.min(numData,numMeta);count&&this.parse(0,count),numData>numMeta?this._insertElements(numMeta,numData-numMeta,resetNewElements):numData{for(arr.length+=count,i=arr.length-1;i>=end;i--)arr[i]=arr[i-count]},"move");for(move(data),i=start;ia-b))}return scale._cache.$bar}function computeMinSampleSize(meta){const scale=meta.iScale,values=getAllScaleValues(scale,meta.type);let i,ilen,curr,prev,min=scale._length;const updateMinAndPrev=__name(()=>{32767===curr||-32768===curr||(defined(prev)&&(min=Math.min(min,Math.abs(curr-prev)||min)),prev=curr)},"updateMinAndPrev");for(i=0,ilen=values.length;i0?pixels[index2-1]:null,next=index2Math.abs(max)&&(barStart=max,barEnd=min),item[vScale.axis]=barEnd,item._custom={barStart,barEnd,start:startValue,end:endValue,min,max}}function parseValue(entry,item,vScale,i){return isArray(entry)?parseFloatBar(entry,item,vScale,i):item[vScale.axis]=vScale.parse(entry,i),item}function parseArrayOrPrimitive(meta,data,start,count){const iScale=meta.iScale,vScale=meta.vScale,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=[];let i,ilen,item,entry;for(i=start,ilen=start+count;i=actualBase?1:-1)}function borderProps(properties){let reverse,start,end,top,bottom;return properties.horizontal?(reverse=properties.base>properties.x,start="left",end="right"):(reverse=properties.base=0;--i)max=Math.max(max,data[i].size(this.resolveDataElementOptions(i))/2);return max>0&&max}getLabelAndValue(index2){const meta=this._cachedMeta,{xScale,yScale}=meta,parsed=this.getParsed(index2),x=xScale.getLabelForValue(parsed.x),y=yScale.getLabelForValue(parsed.y),r=parsed._custom;return{label:meta.label,value:"("+x+", "+y+(r?", "+r:"")+")"}}update(mode){const points=this._cachedMeta.data;this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis;for(let i=start;i_angleBetween(angle,startAngle,endAngle,!0)?1:Math.max(a,a*cutout,b,b*cutout),"calcMax"),calcMin=__name((angle,a,b)=>_angleBetween(angle,startAngle,endAngle,!0)?-1:Math.min(a,a*cutout,b,b*cutout),"calcMin"),maxX=calcMax(0,startX,endX),maxY=calcMax(HALF_PI,startY,endY),minX=calcMin(PI,startX,endX),minY=calcMin(PI+HALF_PI,startY,endY);ratioX=(maxX-minX)/2,ratioY=(maxY-minY)/2,offsetX=-(maxX+minX)/2,offsetY=-(maxY+minY)/2}return{ratioX,ratioY,offsetX,offsetY}}__name(BubbleController,"BubbleController"),BubbleController.id="bubble",BubbleController.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},BubbleController.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}},__name(getRatioAndOffset,"getRatioAndOffset");class DoughnutController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(start,count){const data=this.getDataset().data,meta=this._cachedMeta;if(!1===this._parsing)meta._parsed=data;else{let i,ilen,getter=__name(i2=>+data[i2],"getter");if(isObject(data[start])){const{key="value"}=this._parsing;getter=__name(i2=>+resolveObjectKey(data[i2],key),"getter")}for(i=start,ilen=start+count;i0&&!isNaN(value)?TAU*(Math.abs(value)/total):0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2],chart.options.locale);return{label:labels[index2]||"",value}}getMaxBorderWidth(arcs){let max=0;const chart=this.chart;let i,ilen,meta,controller,options;if(!arcs)for(i=0,ilen=chart.data.datasets.length;i"spacing"!==name,_indexable:name=>"spacing"!==name},DoughnutController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label(tooltipItem){let dataLabel=tooltipItem.label;const value=": "+tooltipItem.formattedValue;return isArray(dataLabel)?(dataLabel=dataLabel.slice(),dataLabel[0]+=value):dataLabel+=value,dataLabel}}}}};class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(mode){const meta=this._cachedMeta,{dataset:line,data:points=[],_dataset}=meta,animationsDisabled=this.chart._animationsDisabled;let{start,count}=getStartAndCountOfVisiblePoints(meta,points,animationsDisabled);this._drawStart=start,this._drawCount=count,scaleRangesChanged(meta)&&(start=0,count=points.length),line._chart=this.chart,line._datasetIndex=this.index,line._decimated=!!_dataset._decimated,line.points=points;const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0),options.segment=this.options.segment,this.updateElement(line,void 0,{animated:!animationsDisabled,options},mode),this.updateElements(points,start,count,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale,_stacked,_dataset}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis,{spanGaps,segment}=this.options,maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY,directUpdate=this.chart._animationsDisabled||reset||"none"===mode;let prevParsed=start>0&&this.getParsed(start-1);for(let i=start;i0&&Math.abs(parsed[iAxis]-prevParsed[iAxis])>maxGapLength,segment&&(properties.parsed=parsed,properties.raw=_dataset.data[i]),includeOptions&&(properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?"active":mode)),directUpdate||this.updateElement(point,i,properties,mode),prevParsed=parsed}this.updateSharedOptions(sharedOptions,mode,firstOpts)}getMaxOverflow(){const meta=this._cachedMeta,dataset=meta.dataset,border=dataset.options&&dataset.options.borderWidth||0,data=meta.data||[];if(!data.length)return border;const firstPoint=data[0].size(this.resolveDataElementOptions(0)),lastPoint=data[data.length-1].size(this.resolveDataElementOptions(data.length-1));return Math.max(border,firstPoint,lastPoint)/2}draw(){const meta=this._cachedMeta;meta.dataset.updateControlPoints(this.chart.chartArea,meta.iScale.axis),super.draw()}}function getStartAndCountOfVisiblePoints(meta,points,animationsDisabled){const pointCount=points.length;let start=0,count=pointCount;if(meta._sorted){const{iScale,_parsed}=meta,axis=iScale.axis,{min,max,minDefined,maxDefined}=iScale.getUserBounds();minDefined&&(start=_limitValue(Math.min(_lookupByKey(_parsed,iScale.axis,min).lo,animationsDisabled?pointCount:_lookupByKey(points,axis,iScale.getPixelForValue(min)).lo),0,pointCount-1)),count=maxDefined?_limitValue(Math.max(_lookupByKey(_parsed,iScale.axis,max).hi+1,animationsDisabled?0:_lookupByKey(points,axis,iScale.getPixelForValue(max)).hi+1),start,pointCount)-start:pointCount-start}return{start,count}}function scaleRangesChanged(meta){const{xScale,yScale,_scaleRanges}=meta,newRanges={xmin:xScale.min,xmax:xScale.max,ymin:yScale.min,ymax:yScale.max};if(!_scaleRanges)return meta._scaleRanges=newRanges,!0;const changed=_scaleRanges.xmin!==xScale.min||_scaleRanges.xmax!==xScale.max||_scaleRanges.ymin!==yScale.min||_scaleRanges.ymax!==yScale.max;return Object.assign(_scaleRanges,newRanges),changed}__name(LineController,"LineController"),LineController.id="line",LineController.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},LineController.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}},__name(getStartAndCountOfVisiblePoints,"getStartAndCountOfVisiblePoints"),__name(scaleRangesChanged,"scaleRangesChanged");class PolarAreaController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2].r,chart.options.locale);return{label:labels[index2]||"",value}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const arcs=this._cachedMeta.data;this._updateRadius(),this.updateElements(arcs,0,arcs.length,mode)}getMinMax(){const meta=this._cachedMeta,range={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return meta.data.forEach((element,index2)=>{const parsed=this.getParsed(index2).r;!isNaN(parsed)&&this.chart.getDataVisibility(index2)&&(parsedrange.max&&(range.max=parsed))}),range}_updateRadius(){const chart=this.chart,chartArea=chart.chartArea,opts=chart.options,minSize=Math.min(chartArea.right-chartArea.left,chartArea.bottom-chartArea.top),outerRadius=Math.max(minSize/2,0),radiusLength=(outerRadius-Math.max(opts.cutoutPercentage?outerRadius/100*opts.cutoutPercentage:1,0))/chart.getVisibleDatasetCount();this.outerRadius=outerRadius-radiusLength*this.index,this.innerRadius=this.outerRadius-radiusLength}updateElements(arcs,start,count,mode){const reset="reset"===mode,chart=this.chart,animationOpts=chart.options.animation,scale=this._cachedMeta.rScale,centerX=scale.xCenter,centerY=scale.yCenter,datasetStartAngle=scale.getIndexAngle(0)-.5*PI;let i,angle=datasetStartAngle;const defaultAngle=360/this.countVisibleElements();for(i=0;i{!isNaN(this.getParsed(index2).r)&&this.chart.getDataVisibility(index2)&&count++}),count}_computeAngle(index2,mode,defaultAngle){return this.chart.getDataVisibility(index2)?toRadians(this.resolveDataElementOptions(index2,mode).angle||defaultAngle):0}}__name(PolarAreaController,"PolarAreaController"),PolarAreaController.id="polarArea",PolarAreaController.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},PolarAreaController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label:context=>context.chart.data.labels[context.dataIndex]+": "+context.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class PieController extends DoughnutController{}__name(PieController,"PieController"),PieController.id="pie",PieController.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class RadarController extends DatasetController{getLabelAndValue(index2){const vScale=this._cachedMeta.vScale,parsed=this.getParsed(index2);return{label:vScale.getLabels()[index2],value:""+vScale.getLabelForValue(parsed[vScale.axis])}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const meta=this._cachedMeta,line=meta.dataset,points=meta.data||[],labels=meta.iScale.getLabels();if(line.points=points,"resize"!==mode){const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0);const properties={_loop:!0,_fullLoop:labels.length===points.length,options};this.updateElement(line,void 0,properties,mode)}this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const scale=this._cachedMeta.rScale,reset="reset"===mode;for(let i=start;i"",label:item=>"("+item.label+", "+item.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function chart_esm_abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}__name(chart_esm_abstract,"chart_esm_abstract");class DateAdapter{constructor(options){this.options=options||{}}formats(){return chart_esm_abstract()}parse(value,format){return chart_esm_abstract()}format(timestamp,format){return chart_esm_abstract()}add(timestamp,amount,unit){return chart_esm_abstract()}diff(a,b,unit){return chart_esm_abstract()}startOf(timestamp,unit,weekday){return chart_esm_abstract()}endOf(timestamp,unit){return chart_esm_abstract()}}__name(DateAdapter,"DateAdapter"),DateAdapter.override=function(members){Object.assign(DateAdapter.prototype,members)};var adapters={_date:DateAdapter};function binarySearch(metaset,axis,value,intersect){const{controller,data,_sorted}=metaset,iScale=controller._cachedMeta.iScale;if(iScale&&axis===iScale.axis&&"r"!==axis&&_sorted&&data.length){const lookupMethod=iScale._reversePixels?_rlookupByKey:_lookupByKey;if(!intersect)return lookupMethod(data,axis,value);if(controller._sharedOptions){const el=data[0],range="function"==typeof el.getRange&&el.getRange(axis);if(range){const start=lookupMethod(data,axis,value-range),end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi}}}}return{lo:0,hi:data.length-1}}function evaluateInteractionItems(chart,axis,position,handler,intersect){const metasets=chart.getSortedVisibleDatasetMetas(),value=position[axis];for(let i=0,ilen=metasets.length;i{element[rangeMethod](position[axis],useFinalPosition)&&(items.push({element,datasetIndex,index:index2}),intersectsItem=intersectsItem||element.inRange(position.x,position.y,useFinalPosition))}),intersect&&!intersectsItem?[]:items}__name(binarySearch,"binarySearch"),__name(evaluateInteractionItems,"evaluateInteractionItems"),__name(getDistanceMetricForAxis,"getDistanceMetricForAxis"),__name(getIntersectItems,"getIntersectItems"),__name(getNearestRadialItems,"getNearestRadialItems"),__name(getNearestCartesianItems,"getNearestCartesianItems"),__name(getNearestItems,"getNearestItems"),__name(getAxisItems,"getAxisItems");var Interaction={evaluateInteractionItems,modes:{index(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"x",includeInvisible=options.includeInvisible||!1,items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible),elements=[];return items.length?(chart.getSortedVisibleDatasetMetas().forEach(meta=>{const index2=items[0].index,element=meta.data[index2];element&&!element.skip&&elements.push({element,datasetIndex:meta.index,index:index2})}),elements):[]},dataset(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;let items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible);if(items.length>0){const datasetIndex=items[0].datasetIndex,data=chart.getDatasetMeta(datasetIndex).data;items=[];for(let i=0;igetIntersectItems(chart,getRelativePosition(e,chart),options.axis||"xy",useFinalPosition,options.includeInvisible||!1),nearest(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;return getNearestItems(chart,position,axis,options.intersect,useFinalPosition,includeInvisible)},x:(chart,e,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e,chart),"x",options.intersect,useFinalPosition),y:(chart,e,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e,chart),"y",options.intersect,useFinalPosition)}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(array,position){return array.filter(v=>v.pos===position)}function filterDynamicPositionByAxis(array,axis){return array.filter(v=>-1===STATIC_POSITIONS.indexOf(v.pos)&&v.box.axis===axis)}function sortByWeight(array,reverse){return array.sort((a,b)=>{const v0=reverse?b:a,v1=reverse?a:b;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight})}function wrapBoxes(boxes){const layoutBoxes=[];let i,ilen,box,pos,stack,stackWeight;for(i=0,ilen=(boxes||[]).length;iwrap.box.fullSize),!0),left=sortByWeight(filterByPosition(layoutBoxes,"left"),!0),right=sortByWeight(filterByPosition(layoutBoxes,"right")),top=sortByWeight(filterByPosition(layoutBoxes,"top"),!0),bottom=sortByWeight(filterByPosition(layoutBoxes,"bottom")),centerHorizontal=filterDynamicPositionByAxis(layoutBoxes,"x"),centerVertical=filterDynamicPositionByAxis(layoutBoxes,"y");return{fullSize,leftAndTop:left.concat(top),rightAndBottom:right.concat(centerVertical).concat(bottom).concat(centerHorizontal),chartArea:filterByPosition(layoutBoxes,"chartArea"),vertical:left.concat(right).concat(centerVertical),horizontal:top.concat(bottom).concat(centerHorizontal)}}function getCombinedMax(maxPadding,chartArea,a,b){return Math.max(maxPadding[a],chartArea[a])+Math.max(maxPadding[b],chartArea[b])}function updateMaxPadding(maxPadding,boxPadding){maxPadding.top=Math.max(maxPadding.top,boxPadding.top),maxPadding.left=Math.max(maxPadding.left,boxPadding.left),maxPadding.bottom=Math.max(maxPadding.bottom,boxPadding.bottom),maxPadding.right=Math.max(maxPadding.right,boxPadding.right)}function updateDims(chartArea,params,layout,stacks){const{pos,box}=layout,maxPadding=chartArea.maxPadding;if(!isObject(pos)){layout.size&&(chartArea[pos]-=layout.size);const stack=stacks[layout.stack]||{size:0,count:1};stack.size=Math.max(stack.size,layout.horizontal?box.height:box.width),layout.size=stack.size/stack.count,chartArea[pos]+=layout.size}box.getPadding&&updateMaxPadding(maxPadding,box.getPadding());const newWidth=Math.max(0,params.outerWidth-getCombinedMax(maxPadding,chartArea,"left","right")),newHeight=Math.max(0,params.outerHeight-getCombinedMax(maxPadding,chartArea,"top","bottom")),widthChanged=newWidth!==chartArea.w,heightChanged=newHeight!==chartArea.h;return chartArea.w=newWidth,chartArea.h=newHeight,layout.horizontal?{same:widthChanged,other:heightChanged}:{same:heightChanged,other:widthChanged}}function handleMaxPadding(chartArea){const maxPadding=chartArea.maxPadding;function updatePos(pos){const change=Math.max(maxPadding[pos]-chartArea[pos],0);return chartArea[pos]+=change,change}__name(updatePos,"updatePos"),chartArea.y+=updatePos("top"),chartArea.x+=updatePos("left"),updatePos("right"),updatePos("bottom")}function getMargins(horizontal,chartArea){const maxPadding=chartArea.maxPadding;function marginForPositions(positions2){const margin={left:0,top:0,right:0,bottom:0};return positions2.forEach(pos=>{margin[pos]=Math.max(chartArea[pos],maxPadding[pos])}),margin}return __name(marginForPositions,"marginForPositions"),marginForPositions(horizontal?["left","right"]:["top","bottom"])}function fitBoxes(boxes,chartArea,params,stacks){const refitBoxes=[];let i,ilen,layout,box,refit,changed;for(i=0,ilen=boxes.length,refit=0;i{"function"==typeof box.beforeLayout&&box.beforeLayout()});const visibleVerticalBoxCount=verticalBoxes.reduce((total,wrap)=>wrap.box.options&&!1===wrap.box.options.display?total:total+1,0)||1,params=Object.freeze({outerWidth:width,outerHeight:height,padding,availableWidth,availableHeight,vBoxMaxWidth:availableWidth/2/visibleVerticalBoxCount,hBoxMaxHeight:availableHeight/2}),maxPadding=Object.assign({},padding);updateMaxPadding(maxPadding,toPadding(minPadding));const chartArea=Object.assign({maxPadding,w:availableWidth,h:availableHeight,x:padding.left,y:padding.top},padding),stacks=setLayoutDims(verticalBoxes.concat(horizontalBoxes),params);fitBoxes(boxes.fullSize,chartArea,params,stacks),fitBoxes(verticalBoxes,chartArea,params,stacks),fitBoxes(horizontalBoxes,chartArea,params,stacks)&&fitBoxes(verticalBoxes,chartArea,params,stacks),handleMaxPadding(chartArea),placeBoxes(boxes.leftAndTop,chartArea,params,stacks),chartArea.x+=chartArea.w,chartArea.y+=chartArea.h,placeBoxes(boxes.rightAndBottom,chartArea,params,stacks),chart.chartArea={left:chartArea.left,top:chartArea.top,right:chartArea.left+chartArea.w,bottom:chartArea.top+chartArea.h,height:chartArea.h,width:chartArea.w},each(boxes.chartArea,layout=>{const box=layout.box;Object.assign(box,chart.chartArea),box.update(chartArea.w,chartArea.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(canvas,aspectRatio){}releaseContext(context){return!1}addEventListener(chart,type,listener){}removeEventListener(chart,type,listener){}getDevicePixelRatio(){return 1}getMaximumSize(element,width,height,aspectRatio){return width=Math.max(0,width||element.width),height=height||element.height,{width,height:Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height)}}isAttached(canvas){return!0}updateConfig(config){}}__name(BasePlatform,"BasePlatform");class BasicPlatform extends BasePlatform{acquireContext(item){return item&&item.getContext&&item.getContext("2d")||null}updateConfig(config){config.options.animation=!1}}__name(BasicPlatform,"BasicPlatform");const EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=__name(value=>null===value||""===value,"isNullOrEmpty");function initCanvas(canvas,aspectRatio){const style=canvas.style,renderHeight=canvas.getAttribute("height"),renderWidth=canvas.getAttribute("width");if(canvas.$chartjs={initial:{height:renderHeight,width:renderWidth,style:{display:style.display,height:style.height,width:style.width}}},style.display=style.display||"block",style.boxSizing=style.boxSizing||"border-box",isNullOrEmpty(renderWidth)){const displayWidth=readUsedSize(canvas,"width");void 0!==displayWidth&&(canvas.width=displayWidth)}if(isNullOrEmpty(renderHeight))if(""===canvas.style.height)canvas.height=canvas.width/(aspectRatio||2);else{const displayHeight=readUsedSize(canvas,"height");void 0!==displayHeight&&(canvas.height=displayHeight)}return canvas}__name(initCanvas,"initCanvas");const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(node,type,listener){node.addEventListener(type,listener,eventListenerOptions)}function removeListener(chart,type,listener){chart.canvas.removeEventListener(type,listener,eventListenerOptions)}function fromNativeEvent(event,chart){const type=EVENT_TYPES[event.type]||event.type,{x,y}=getRelativePosition(event,chart);return{type,chart,native:event,x:void 0!==x?x:null,y:void 0!==y?y:null}}function nodeListContains(nodeList,canvas){for(const node of nodeList)if(node===canvas||node.contains(canvas))return!0}function createAttachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.addedNodes,canvas),trigger=trigger&&!nodeListContains(entry.removedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}function createDetachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.removedNodes,canvas),trigger=trigger&&!nodeListContains(entry.addedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}__name(addListener,"addListener"),__name(removeListener,"removeListener"),__name(fromNativeEvent,"fromNativeEvent"),__name(nodeListContains,"nodeListContains"),__name(createAttachObserver,"createAttachObserver"),__name(createDetachObserver,"createDetachObserver");const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const dpr=window.devicePixelRatio;dpr!==oldDevicePixelRatio&&(oldDevicePixelRatio=dpr,drpListeningCharts.forEach((resize,chart)=>{chart.currentDevicePixelRatio!==dpr&&resize()}))}function listenDevicePixelRatioChanges(chart,resize){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(chart,resize)}function unlistenDevicePixelRatioChanges(chart){drpListeningCharts.delete(chart),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(chart,type,listener){const canvas=chart.canvas,container=canvas&&_getParentNode(canvas);if(!container)return;const resize=throttled((width,height)=>{const w=container.clientWidth;listener(width,height),w{const entry=entries[0],width=entry.contentRect.width,height=entry.contentRect.height;0===width&&0===height||resize(width,height)});return observer.observe(container),listenDevicePixelRatioChanges(chart,resize),observer}function releaseObserver(chart,type,observer){observer&&observer.disconnect(),"resize"===type&&unlistenDevicePixelRatioChanges(chart)}function createProxyAndListen(chart,type,listener){const canvas=chart.canvas,proxy=throttled(event=>{null!==chart.ctx&&listener(fromNativeEvent(event,chart))},chart,args=>{const event=args[0];return[event,event.offsetX,event.offsetY]});return addListener(canvas,type,proxy),proxy}__name(onWindowResize,"onWindowResize"),__name(listenDevicePixelRatioChanges,"listenDevicePixelRatioChanges"),__name(unlistenDevicePixelRatioChanges,"unlistenDevicePixelRatioChanges"),__name(createResizeObserver,"createResizeObserver"),__name(releaseObserver,"releaseObserver"),__name(createProxyAndListen,"createProxyAndListen");class DomPlatform extends BasePlatform{acquireContext(canvas,aspectRatio){const context=canvas&&canvas.getContext&&canvas.getContext("2d");return context&&context.canvas===canvas?(initCanvas(canvas,aspectRatio),context):null}releaseContext(context){const canvas=context.canvas;if(!canvas.$chartjs)return!1;const initial=canvas.$chartjs.initial;["height","width"].forEach(prop=>{const value=initial[prop];isNullOrUndef(value)?canvas.removeAttribute(prop):canvas.setAttribute(prop,value)});const style=initial.style||{};return Object.keys(style).forEach(key=>{canvas.style[key]=style[key]}),canvas.width=canvas.width,delete canvas.$chartjs,!0}addEventListener(chart,type,listener){this.removeEventListener(chart,type);const proxies=chart.$proxies||(chart.$proxies={}),handler={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[type]||createProxyAndListen;proxies[type]=handler(chart,type,listener)}removeEventListener(chart,type){const proxies=chart.$proxies||(chart.$proxies={}),proxy=proxies[type];proxy&&(({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[type]||removeListener)(chart,type,proxy),proxies[type]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(canvas,width,height,aspectRatio){return getMaximumSize(canvas,width,height,aspectRatio)}isAttached(canvas){const container=_getParentNode(canvas);return!(!container||!container.isConnected)}}function _detectPlatform(canvas){return!_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&canvas instanceof OffscreenCanvas?BasicPlatform:DomPlatform}__name(DomPlatform,"DomPlatform"),__name(_detectPlatform,"_detectPlatform");class Element{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(useFinalPosition){const{x,y}=this.getProps(["x","y"],useFinalPosition);return{x,y}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(props,final){const anims=this.$animations;if(!final||!anims)return this;const ret={};return props.forEach(prop=>{ret[prop]=anims[prop]&&anims[prop].active()?anims[prop]._to:this[prop]}),ret}}__name(Element,"Element"),Element.defaults={},Element.defaultRoutes=void 0;const formatters={values:value=>isArray(value)?value:""+value,numeric(tickValue,index2,ticks){if(0===tickValue)return"0";const locale=this.chart.options.locale;let notation,delta=tickValue;if(ticks.length>1){const maxTick=Math.max(Math.abs(ticks[0].value),Math.abs(ticks[ticks.length-1].value));(maxTick<1e-4||maxTick>1e15)&&(notation="scientific"),delta=calculateDelta(tickValue,ticks)}const logDelta=log10(Math.abs(delta)),numDecimal=Math.max(Math.min(-1*Math.floor(logDelta),20),0),options={notation,minimumFractionDigits:numDecimal,maximumFractionDigits:numDecimal};return Object.assign(options,this.options.ticks.format),formatNumber(tickValue,locale,options)},logarithmic(tickValue,index2,ticks){if(0===tickValue)return"0";const remain=tickValue/Math.pow(10,Math.floor(log10(tickValue)));return 1===remain||2===remain||5===remain?formatters.numeric.call(this,tickValue,index2,ticks):""}};function calculateDelta(tickValue,ticks){let delta=ticks.length>3?ticks[2].value-ticks[1].value:ticks[1].value-ticks[0].value;return Math.abs(delta)>=1&&tickValue!==Math.floor(tickValue)&&(delta=tickValue-Math.floor(tickValue)),delta}__name(calculateDelta,"calculateDelta");var Ticks={formatters};function autoSkip(scale,ticks){const tickOpts=scale.options.ticks,ticksLimit=tickOpts.maxTicksLimit||determineMaxTicks(scale),majorIndices=tickOpts.major.enabled?getMajorIndices(ticks):[],numMajorIndices=majorIndices.length,first=majorIndices[0],last=majorIndices[numMajorIndices-1],newTicks=[];if(numMajorIndices>ticksLimit)return skipMajors(ticks,newTicks,majorIndices,numMajorIndices/ticksLimit),newTicks;const spacing=calculateSpacing(majorIndices,ticks,ticksLimit);if(numMajorIndices>0){let i,ilen;const avgMajorSpacing=numMajorIndices>1?Math.round((last-first)/(numMajorIndices-1)):null;for(skip(ticks,newTicks,spacing,isNullOrUndef(avgMajorSpacing)?0:first-avgMajorSpacing,first),i=0,ilen=numMajorIndices-1;ispacing)return factor}return Math.max(spacing,1)}function getMajorIndices(ticks){const result=[];let i,ilen;for(i=0,ilen=ticks.length;ioptions.lineWidth,tickColor:(_ctx,options)=>options.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:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),defaults.route("scale.ticks","color","","color"),defaults.route("scale.grid","color","","borderColor"),defaults.route("scale.grid","borderColor","","borderColor"),defaults.route("scale.title","color","","color"),defaults.describe("scale",{_fallback:!1,_scriptable:name=>!name.startsWith("before")&&!name.startsWith("after")&&"callback"!==name&&"parser"!==name,_indexable:name=>"borderDash"!==name&&"tickBorderDash"!==name}),defaults.describe("scales",{_fallback:"scale"}),defaults.describe("scale.ticks",{_scriptable:name=>"backdropPadding"!==name&&"callback"!==name,_indexable:name=>"backdropPadding"!==name}),__name(autoSkip,"autoSkip"),__name(determineMaxTicks,"determineMaxTicks"),__name(calculateSpacing,"calculateSpacing"),__name(getMajorIndices,"getMajorIndices"),__name(skipMajors,"skipMajors"),__name(skip,"skip"),__name(getEvenSpacing,"getEvenSpacing");const reverseAlign=__name(align=>"left"===align?"right":"right"===align?"left":align,"reverseAlign"),offsetFromEdge=__name((scale,edge,offset)=>"top"===edge||"left"===edge?scale[edge]+offset:scale[edge]-offset,"offsetFromEdge");function sample(arr,numItems){const result=[],increment=arr.length/numItems,len=arr.length;let i=0;for(;iend+1e-6)))return lineValue}function garbageCollect(caches,length){each(caches,cache=>{const gc=cache.gc,gcLen=gc.length/2;let i;if(gcLen>length){for(i=0;imax?max:min,max=minDefined&&min>max?min:max,{min:finiteOrDefault(min,finiteOrDefault(max,min)),max:finiteOrDefault(max,finiteOrDefault(min,max))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const data=this.chart.data;return this.options.labels||(this.isHorizontal()?data.xLabels:data.yLabels)||data.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(maxWidth,maxHeight,margins){const{beginAtZero,grace,ticks:tickOpts}=this.options,sampleSize=tickOpts.sampleSize;this.beforeUpdate(),this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins=Object.assign({left:0,right:0,top:0,bottom:0},margins),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+margins.left+margins.right:this.height+margins.top+margins.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,grace,beginAtZero),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const samplingEnabled=sampleSize=maxRotation||numTicks<=1||!this.isHorizontal())return void(this.labelRotation=minRotation);const labelSizes=this._getLabelSizes(),maxLabelWidth=labelSizes.widest.width,maxLabelHeight=labelSizes.highest.height,maxWidth=_limitValue(this.chart.width-maxLabelWidth,0,this.maxWidth);tickWidth=options.offset?this.maxWidth/numTicks:maxWidth/(numTicks-1),maxLabelWidth+6>tickWidth&&(tickWidth=maxWidth/(numTicks-(options.offset?.5:1)),maxHeight=this.maxHeight-getTickMarkLength(options.grid)-tickOpts.padding-getTitleHeight(options.title,this.chart.options.font),maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight),labelRotation=toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height+6)/tickWidth,-1,1)),Math.asin(_limitValue(maxHeight/maxLabelDiagonal,-1,1))-Math.asin(_limitValue(maxLabelHeight/maxLabelDiagonal,-1,1)))),labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation))),this.labelRotation=labelRotation}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const minSize={width:0,height:0},{chart,options:{ticks:tickOpts,title:titleOpts,grid:gridOpts}}=this,display=this._isVisible(),isHorizontal=this.isHorizontal();if(display){const titleHeight=getTitleHeight(titleOpts,chart.options.font);if(isHorizontal?(minSize.width=this.maxWidth,minSize.height=getTickMarkLength(gridOpts)+titleHeight):(minSize.height=this.maxHeight,minSize.width=getTickMarkLength(gridOpts)+titleHeight),tickOpts.display&&this.ticks.length){const{first,last,widest,highest}=this._getLabelSizes(),tickPadding=2*tickOpts.padding,angleRadians=toRadians(this.labelRotation),cos=Math.cos(angleRadians),sin=Math.sin(angleRadians);if(isHorizontal){const labelHeight=tickOpts.mirror?0:sin*widest.width+cos*highest.height;minSize.height=Math.min(this.maxHeight,minSize.height+labelHeight+tickPadding)}else{const labelWidth=tickOpts.mirror?0:cos*widest.width+sin*highest.height;minSize.width=Math.min(this.maxWidth,minSize.width+labelWidth+tickPadding)}this._calculatePadding(first,last,sin,cos)}}this._handleMargins(),isHorizontal?(this.width=this._length=chart.width-this._margins.left-this._margins.right,this.height=minSize.height):(this.width=minSize.width,this.height=this._length=chart.height-this._margins.top-this._margins.bottom)}_calculatePadding(first,last,sin,cos){const{ticks:{align,padding},position}=this.options,isRotated=0!==this.labelRotation,labelsBelowTicks="top"!==position&&"x"===this.axis;if(this.isHorizontal()){const offsetLeft=this.getPixelForTick(0)-this.left,offsetRight=this.right-this.getPixelForTick(this.ticks.length-1);let paddingLeft=0,paddingRight=0;isRotated?labelsBelowTicks?(paddingLeft=cos*first.width,paddingRight=sin*last.height):(paddingLeft=sin*first.height,paddingRight=cos*last.width):"start"===align?paddingRight=last.width:"end"===align?paddingLeft=first.width:"inner"!==align&&(paddingLeft=first.width/2,paddingRight=last.width/2),this.paddingLeft=Math.max((paddingLeft-offsetLeft+padding)*this.width/(this.width-offsetLeft),0),this.paddingRight=Math.max((paddingRight-offsetRight+padding)*this.width/(this.width-offsetRight),0)}else{let paddingTop=last.height/2,paddingBottom=first.height/2;"start"===align?(paddingTop=0,paddingBottom=first.height):"end"===align&&(paddingTop=last.height,paddingBottom=0),this.paddingTop=paddingTop+padding,this.paddingBottom=paddingBottom+padding}}_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(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis,position}=this.options;return"top"===position||"bottom"===position||"x"===axis}isFullSize(){return this.options.fullSize}_convertTicksToLabels(ticks){let i,ilen;for(this.beforeTickToLabelConversion(),this.generateTickLabels(ticks),i=0,ilen=ticks.length;i({width:widths[idx]||0,height:heights[idx]||0}),"valueAt");return{first:valueAt(0),last:valueAt(length-1),widest:valueAt(widest),highest:valueAt(highest),widths,heights}}getLabelForValue(value){return value}getPixelForValue(value,index2){return NaN}getValueForPixel(pixel){}getPixelForTick(index2){const ticks=this.ticks;return index2<0||index2>ticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getPixelForDecimal(decimal){this._reversePixels&&(decimal=1-decimal);const pixel=this._startPixel+decimal*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,pixel,0):pixel)}getDecimalForPixel(pixel){const decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min,max}=this;return min<0&&max<0?max:min>0&&max>0?min:0}getContext(index2){const ticks=this.ticks||[];if(index2>=0&&index2w*sin?w/cos:h/sin:h*sin0}_computeGridLineItems(chartArea){const axis=this.axis,chart=this.chart,options=this.options,{grid,position}=options,offset=grid.offset,isHorizontal=this.isHorizontal(),ticksLength=this.ticks.length+(offset?1:0),tl=getTickMarkLength(grid),items=[],borderOpts=grid.setContext(this.getContext()),axisWidth=borderOpts.drawBorder?borderOpts.borderWidth:0,axisHalfWidth=axisWidth/2,alignBorderValue=__name(function(pixel){return _alignPixel(chart,pixel,axisWidth)},"alignBorderValue");let borderValue,i,lineValue,alignedLineValue,tx1,ty1,tx2,ty2,x1,y1,x2,y2;if("top"===position)borderValue=alignBorderValue(this.bottom),ty1=this.bottom-tl,ty2=borderValue-axisHalfWidth,y1=alignBorderValue(chartArea.top)+axisHalfWidth,y2=chartArea.bottom;else if("bottom"===position)borderValue=alignBorderValue(this.top),y1=chartArea.top,y2=alignBorderValue(chartArea.bottom)-axisHalfWidth,ty1=borderValue+axisHalfWidth,ty2=this.top+tl;else if("left"===position)borderValue=alignBorderValue(this.right),tx1=this.right-tl,tx2=borderValue-axisHalfWidth,x1=alignBorderValue(chartArea.left)+axisHalfWidth,x2=chartArea.right;else if("right"===position)borderValue=alignBorderValue(this.left),x1=chartArea.left,x2=alignBorderValue(chartArea.right)-axisHalfWidth,tx1=borderValue+axisHalfWidth,tx2=this.left+tl;else if("x"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.top+chartArea.bottom)/2+.5);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}y1=chartArea.top,y2=chartArea.bottom,ty1=borderValue+axisHalfWidth,ty2=ty1+tl}else if("y"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.left+chartArea.right)/2);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}tx1=borderValue-axisHalfWidth,tx2=tx1-tl,x1=chartArea.left,x2=chartArea.right}const limit=valueOrDefault(options.ticks.maxTicksLimit,ticksLength),step=Math.max(1,Math.ceil(ticksLength/limit));for(i=0;it.value===value);return index2>=0?grid.setContext(this.getContext(index2)).lineWidth:0}drawGrid(chartArea){const grid=this.options.grid,ctx=this.ctx,items=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(chartArea));let i,ilen;const drawLine=__name((p1,p2,style)=>{!style.width||!style.color||(ctx.save(),ctx.lineWidth=style.width,ctx.strokeStyle=style.color,ctx.setLineDash(style.borderDash||[]),ctx.lineDashOffset=style.borderDashOffset,ctx.beginPath(),ctx.moveTo(p1.x,p1.y),ctx.lineTo(p2.x,p2.y),ctx.stroke(),ctx.restore())},"drawLine");if(grid.display)for(i=0,ilen=items.length;i{this.drawBackground(),this.drawGrid(chartArea),this.drawTitle()}},{z:gz+1,draw:()=>{this.drawBorder()}},{z:tz,draw:chartArea=>{this.drawLabels(chartArea)}}]:[{z:tz,draw:chartArea=>{this.draw(chartArea)}}]}getMatchingVisibleMetas(type){const metas=this.chart.getSortedVisibleDatasetMetas(),axisID=this.axis+"AxisID",result=[];let i,ilen;for(i=0,ilen=metas.length;i{const propertyParts=property.split("."),sourceName=propertyParts.pop(),sourceScope=[scope].concat(propertyParts).join("."),parts=routes[property].split("."),targetName=parts.pop(),targetScope=parts.join(".");defaults.route(sourceScope,sourceName,targetScope,targetName)})}function isIChartComponent(proto){return"id"in proto&&"defaults"in proto}__name(TypedRegistry,"TypedRegistry"),__name(registerDefaults,"registerDefaults"),__name(routeDefaults,"routeDefaults"),__name(isIChartComponent,"isIChartComponent");class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...args){this._each("register",args)}remove(...args){this._each("unregister",args)}addControllers(...args){this._each("register",args,this.controllers)}addElements(...args){this._each("register",args,this.elements)}addPlugins(...args){this._each("register",args,this.plugins)}addScales(...args){this._each("register",args,this.scales)}getController(id){return this._get(id,this.controllers,"controller")}getElement(id){return this._get(id,this.elements,"element")}getPlugin(id){return this._get(id,this.plugins,"plugin")}getScale(id){return this._get(id,this.scales,"scale")}removeControllers(...args){this._each("unregister",args,this.controllers)}removeElements(...args){this._each("unregister",args,this.elements)}removePlugins(...args){this._each("unregister",args,this.plugins)}removeScales(...args){this._each("unregister",args,this.scales)}_each(method,args,typedRegistry){[...args].forEach(arg=>{const reg=typedRegistry||this._getRegistryForType(arg);typedRegistry||reg.isForType(arg)||reg===this.plugins&&arg.id?this._exec(method,reg,arg):each(arg,item=>{const itemReg=typedRegistry||this._getRegistryForType(item);this._exec(method,itemReg,item)})})}_exec(method,registry2,component){const camelMethod=_capitalize(method);callback(component["before"+camelMethod],[],component),registry2[method](component),callback(component["after"+camelMethod],[],component)}_getRegistryForType(type){for(let i=0;ia.filter(x=>!b.some(y=>x.plugin.id===y.plugin.id)),"diff");this._notify(diff(previousDescriptors,descriptors2),chart,"stop"),this._notify(diff(descriptors2,previousDescriptors),chart,"start")}}function allPlugins(config){const plugins2=[],keys=Object.keys(registry.plugins.items);for(let i=0;i{const scaleConf=configScales[id];if(!isObject(scaleConf))return console.error(`Invalid scale configuration for scale: ${id}`);if(scaleConf._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${id}`);const axis=determineAxis(id,scaleConf),defaultId=getDefaultScaleIDFromAxis(axis,chartIndexAxis),defaultScaleOptions=chartDefaults.scales||{};firstIDs[axis]=firstIDs[axis]||id,scales2[id]=mergeIf(Object.create(null),[{axis},scaleConf,defaultScaleOptions[axis],defaultScaleOptions[defaultId]])}),config.data.datasets.forEach(dataset=>{const type=dataset.type||config.type,indexAxis=dataset.indexAxis||getIndexAxis(type,options),defaultScaleOptions=(overrides[type]||{}).scales||{};Object.keys(defaultScaleOptions).forEach(defaultID=>{const axis=getAxisFromDefaultScaleID(defaultID,indexAxis),id=dataset[axis+"AxisID"]||firstIDs[axis]||axis;scales2[id]=scales2[id]||Object.create(null),mergeIf(scales2[id],[{axis},configScales[id],defaultScaleOptions[defaultID]])})}),Object.keys(scales2).forEach(key=>{const scale=scales2[key];mergeIf(scale,[defaults.scales[scale.type],defaults.scale])}),scales2}function initOptions(config){const options=config.options||(config.options={});options.plugins=valueOrDefault(options.plugins,{}),options.scales=mergeScaleConfig(config,options)}function initData(data){return(data=data||{}).datasets=data.datasets||[],data.labels=data.labels||[],data}function initConfig(config){return(config=config||{}).data=initData(config.data),initOptions(config),config}__name(PluginService,"PluginService"),__name(allPlugins,"allPlugins"),__name(getOpts,"getOpts"),__name(createDescriptors,"createDescriptors"),__name(pluginOpts,"pluginOpts"),__name(getIndexAxis,"getIndexAxis"),__name(getAxisFromDefaultScaleID,"getAxisFromDefaultScaleID"),__name(getDefaultScaleIDFromAxis,"getDefaultScaleIDFromAxis"),__name(axisFromPosition,"axisFromPosition"),__name(determineAxis,"determineAxis"),__name(mergeScaleConfig,"mergeScaleConfig"),__name(initOptions,"initOptions"),__name(initData,"initData"),__name(initConfig,"initConfig");const keyCache=new Map,keysCached=new Set;function cachedKeys(cacheKey,generate){let keys=keyCache.get(cacheKey);return keys||(keys=generate(),keyCache.set(cacheKey,keys),keysCached.add(keys)),keys}__name(cachedKeys,"cachedKeys");const addIfFound=__name((set2,obj,key)=>{const opts=resolveObjectKey(obj,key);void 0!==opts&&set2.add(opts)},"addIfFound");class Config{constructor(config){this._config=initConfig(config),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(type){this._config.type=type}get data(){return this._config.data}set data(data){this._config.data=initData(data)}get options(){return this._config.options}set options(options){this._config.options=options}get plugins(){return this._config.plugins}update(){const config=this._config;this.clearCache(),initOptions(config)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(datasetType){return cachedKeys(datasetType,()=>[[`datasets.${datasetType}`,""]])}datasetAnimationScopeKeys(datasetType,transition){return cachedKeys(`${datasetType}.transition.${transition}`,()=>[[`datasets.${datasetType}.transitions.${transition}`,`transitions.${transition}`],[`datasets.${datasetType}`,""]])}datasetElementScopeKeys(datasetType,elementType){return cachedKeys(`${datasetType}-${elementType}`,()=>[[`datasets.${datasetType}.elements.${elementType}`,`datasets.${datasetType}`,`elements.${elementType}`,""]])}pluginScopeKeys(plugin){const id=plugin.id;return cachedKeys(`${this.type}-plugin-${id}`,()=>[[`plugins.${id}`,...plugin.additionalOptionScopes||[]]])}_cachedScopes(mainScope,resetCache){const _scopeCache=this._scopeCache;let cache=_scopeCache.get(mainScope);return(!cache||resetCache)&&(cache=new Map,_scopeCache.set(mainScope,cache)),cache}getOptionScopes(mainScope,keyLists,resetCache){const{options,type}=this,cache=this._cachedScopes(mainScope,resetCache),cached=cache.get(keyLists);if(cached)return cached;const scopes=new Set;keyLists.forEach(keys=>{mainScope&&(scopes.add(mainScope),keys.forEach(key=>addIfFound(scopes,mainScope,key))),keys.forEach(key=>addIfFound(scopes,options,key)),keys.forEach(key=>addIfFound(scopes,overrides[type]||{},key)),keys.forEach(key=>addIfFound(scopes,defaults,key)),keys.forEach(key=>addIfFound(scopes,descriptors,key))});const array=Array.from(scopes);return 0===array.length&&array.push(Object.create(null)),keysCached.has(keyLists)&&cache.set(keyLists,array),array}chartOptionScopes(){const{options,type}=this;return[options,overrides[type]||{},defaults.datasets[type]||{},{type},defaults,descriptors]}resolveNamedOptions(scopes,names2,context,prefixes=[""]){const result={$shared:!0},{resolver,subPrefixes}=getResolver(this._resolverCache,scopes,prefixes);let options=resolver;if(needContext(resolver,names2)){result.$shared=!1;options=_attachContext(resolver,context=isFunction(context)?context():context,this.createResolver(scopes,context,subPrefixes))}for(const prop of names2)result[prop]=options[prop];return result}createResolver(scopes,context,prefixes=[""],descriptorDefaults){const{resolver}=getResolver(this._resolverCache,scopes,prefixes);return isObject(context)?_attachContext(resolver,context,void 0,descriptorDefaults):resolver}}function getResolver(resolverCache,scopes,prefixes){let cache=resolverCache.get(scopes);cache||(cache=new Map,resolverCache.set(scopes,cache));const cacheKey=prefixes.join();let cached=cache.get(cacheKey);return cached||(cached={resolver:_createResolver(scopes,prefixes),subPrefixes:prefixes.filter(p=>!p.toLowerCase().includes("hover"))},cache.set(cacheKey,cached)),cached}__name(Config,"Config"),__name(getResolver,"getResolver");const hasFunction=__name(value=>isObject(value)&&Object.getOwnPropertyNames(value).reduce((acc,key)=>acc||isFunction(value[key]),!1),"hasFunction");function needContext(proxy,names2){const{isScriptable,isIndexable}=_descriptors(proxy);for(const prop of names2){const scriptable=isScriptable(prop),indexable=isIndexable(prop),value=(indexable||scriptable)&&proxy[prop];if(scriptable&&(isFunction(value)||hasFunction(value))||indexable&&isArray(value))return!0}return!1}__name(needContext,"needContext");const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(position,axis){return"top"===position||"bottom"===position||-1===KNOWN_POSITIONS.indexOf(position)&&"x"===axis}function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1]}}function onAnimationsComplete(context){const chart=context.chart,animationOptions2=chart.options.animation;chart.notifyPlugins("afterRender"),callback(animationOptions2&&animationOptions2.onComplete,[context],chart)}function onAnimationProgress(context){const chart=context.chart,animationOptions2=chart.options.animation;callback(animationOptions2&&animationOptions2.onProgress,[context],chart)}function getCanvas(item){return _isDomSupported()&&"string"==typeof item?item=document.getElementById(item):item&&item.length&&(item=item[0]),item&&item.canvas&&(item=item.canvas),item}__name(positionIsHorizontal,"positionIsHorizontal"),__name(compare2Level,"compare2Level"),__name(onAnimationsComplete,"onAnimationsComplete"),__name(onAnimationProgress,"onAnimationProgress"),__name(getCanvas,"getCanvas");const instances={},getChart=__name(key=>{const canvas=getCanvas(key);return Object.values(instances).filter(c=>c.canvas===canvas).pop()},"getChart");function moveNumericKeys(obj,start,move){const keys=Object.keys(obj);for(const key of keys){const intKey=+key;if(intKey>=start){const value=obj[key];delete obj[key],(move>0||intKey>start)&&(obj[intKey+move]=value)}}}function determineLastEvent(e,lastEvent,inChartArea,isClick){return inChartArea&&"mouseout"!==e.type?isClick?lastEvent:e:null}__name(moveNumericKeys,"moveNumericKeys"),__name(determineLastEvent,"determineLastEvent");class Chart{constructor(item,userConfig){const config=this.config=new Config(userConfig),initialCanvas=getCanvas(item),existingChart=getChart(initialCanvas);if(existingChart)throw new Error("Canvas is already in use. Chart with ID '"+existingChart.id+"' must be destroyed before the canvas can be reused.");const options=config.createResolver(config.chartOptionScopes(),this.getContext());this.platform=new(config.platform||_detectPlatform(initialCanvas)),this.platform.updateConfig(config);const context=this.platform.acquireContext(initialCanvas,options.aspectRatio),canvas=context&&context.canvas,height=canvas&&canvas.height,width=canvas&&canvas.width;this.id=uid(),this.ctx=context,this.canvas=canvas,this.width=width,this.height=height,this._options=options,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(mode=>this.update(mode),options.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,context&&canvas?(animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio,maintainAspectRatio},width,height,_aspectRatio}=this;return isNullOrUndef(aspectRatio)?maintainAspectRatio&&_aspectRatio?_aspectRatio:height?width/height:null:aspectRatio}get data(){return this.config.data}set data(data){this.config.data=data}get options(){return this._options}set options(options){this.config.options=options}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(width,height){animator.running(this)?this._resizeBeforeDraw={width,height}:this._resize(width,height)}_resize(width,height){const options=this.options,canvas=this.canvas,aspectRatio=options.maintainAspectRatio&&this.aspectRatio,newSize=this.platform.getMaximumSize(canvas,width,height,aspectRatio),newRatio=options.devicePixelRatio||this.platform.getDevicePixelRatio(),mode=this.width?"resize":"attach";this.width=newSize.width,this.height=newSize.height,this._aspectRatio=this.aspectRatio,retinaScale(this,newRatio,!0)&&(this.notifyPlugins("resize",{size:newSize}),callback(options.onResize,[this,newSize],this),this.attached&&this._doResize(mode)&&this.render())}ensureScalesHaveIDs(){each(this.options.scales||{},(axisOptions,axisID)=>{axisOptions.id=axisID})}buildOrUpdateScales(){const options=this.options,scaleOpts=options.scales,scales2=this.scales,updated=Object.keys(scales2).reduce((obj,id)=>(obj[id]=!1,obj),{});let items=[];scaleOpts&&(items=items.concat(Object.keys(scaleOpts).map(id=>{const scaleOptions=scaleOpts[id],axis=determineAxis(id,scaleOptions),isRadial="r"===axis,isHorizontal="x"===axis;return{options:scaleOptions,dposition:isRadial?"chartArea":isHorizontal?"bottom":"left",dtype:isRadial?"radialLinear":isHorizontal?"category":"linear"}}))),each(items,item=>{const scaleOptions=item.options,id=scaleOptions.id,axis=determineAxis(id,scaleOptions),scaleType=valueOrDefault(scaleOptions.type,item.dtype);(void 0===scaleOptions.position||positionIsHorizontal(scaleOptions.position,axis)!==positionIsHorizontal(item.dposition))&&(scaleOptions.position=item.dposition),updated[id]=!0;let scale=null;if(id in scales2&&scales2[id].type===scaleType)scale=scales2[id];else{scale=new(registry.getScale(scaleType))({id,type:scaleType,ctx:this.ctx,chart:this}),scales2[scale.id]=scale}scale.init(scaleOptions,options)}),each(updated,(hasUpdated,id)=>{hasUpdated||delete scales2[id]}),each(scales2,scale=>{layouts.configure(this,scale,scale.options),layouts.addBox(this,scale)})}_updateMetasets(){const metasets=this._metasets,numData=this.data.datasets.length,numMeta=metasets.length;if(metasets.sort((a,b)=>a.index-b.index),numMeta>numData){for(let i=numData;idatasets.length&&delete this._stacks,metasets.forEach((meta,index2)=>{0===datasets.filter(x=>x===meta._dataset).length&&this._destroyDatasetMeta(index2)})}buildOrUpdateControllers(){const newControllers=[],datasets=this.data.datasets;let i,ilen;for(this._removeUnreferencedMetasets(),i=0,ilen=datasets.length;i{this.getDatasetMeta(datasetIndex).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(mode){const config=this.config;config.update();const options=this._options=config.createResolver(config.chartOptionScopes(),this.getContext()),animsDisabled=this._animationsDisabled=!options.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode,cancelable:!0}))return;const newControllers=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let minPadding=0;for(let i=0,ilen=this.data.datasets.length;i{controller.reset()}),this._updateDatasets(mode),this.notifyPlugins("afterUpdate",{mode}),this._layers.sort(compare2Level("z","_idx"));const{_active,_lastEvent}=this;_lastEvent?this._eventHandler(_lastEvent,!0):_active.length&&this._updateHoverStyles(_active,_active,!0),this.render()}_updateScales(){each(this.scales,scale=>{layouts.removeBox(this,scale)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const options=this.options,existingEvents=new Set(Object.keys(this._listeners)),newEvents=new Set(options.events);(!setsEqual(existingEvents,newEvents)||!!this._responsiveListeners!==options.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices}=this,changes=this._getUniformDataChanges()||[];for(const{method,start,count}of changes){moveNumericKeys(_hiddenIndices,start,"_removeElements"===method?-count:count)}}_getUniformDataChanges(){const _dataChanges=this._dataChanges;if(!_dataChanges||!_dataChanges.length)return;this._dataChanges=[];const datasetCount=this.data.datasets.length,makeSet=__name(idx=>new Set(_dataChanges.filter(c=>c[0]===idx).map((c,i)=>i+","+c.splice(1).join(","))),"makeSet"),changeSet=makeSet(0);for(let i=1;ic.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(minPadding){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,minPadding);const area=this.chartArea,noArea=area.width<=0||area.height<=0;this._layers=[],each(this.boxes,box=>{noArea&&"chartArea"===box.position||(box.configure&&box.configure(),this._layers.push(...box._layers()))},this),this._layers.forEach((item,index2)=>{item._idx=index2}),this.notifyPlugins("afterLayout")}_updateDatasets(mode){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode,cancelable:!0})){for(let i=0,ilen=this.data.datasets.length;i=0;--i)this._drawDataset(metasets[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(meta){const ctx=this.ctx,clip=meta._clip,useClip=!clip.disabled,area=this.chartArea,args={meta,index:meta.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",args)&&(useClip&&clipArea(ctx,{left:!1===clip.left?0:area.left-clip.left,right:!1===clip.right?this.width:area.right+clip.right,top:!1===clip.top?0:area.top-clip.top,bottom:!1===clip.bottom?this.height:area.bottom+clip.bottom}),meta.controller.draw(),useClip&&unclipArea(ctx),args.cancelable=!1,this.notifyPlugins("afterDatasetDraw",args))}isPointInArea(point){return _isPointInArea(point,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,mode,options,useFinalPosition){const method=Interaction.modes[mode];return"function"==typeof method?method(this,e,options,useFinalPosition):[]}getDatasetMeta(datasetIndex){const dataset=this.data.datasets[datasetIndex],metasets=this._metasets;let meta=metasets.filter(x=>x&&x._dataset===dataset).pop();return meta||(meta={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset&&dataset.order||0,index:datasetIndex,_dataset:dataset,_parsed:[],_sorted:!1},metasets.push(meta)),meta}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(datasetIndex){const dataset=this.data.datasets[datasetIndex];if(!dataset)return!1;const meta=this.getDatasetMeta(datasetIndex);return"boolean"==typeof meta.hidden?!meta.hidden:!dataset.hidden}setDatasetVisibility(datasetIndex,visible){this.getDatasetMeta(datasetIndex).hidden=!visible}toggleDataVisibility(index2){this._hiddenIndices[index2]=!this._hiddenIndices[index2]}getDataVisibility(index2){return!this._hiddenIndices[index2]}_updateVisibility(datasetIndex,dataIndex,visible){const mode=visible?"show":"hide",meta=this.getDatasetMeta(datasetIndex),anims=meta.controller._resolveAnimations(void 0,mode);defined(dataIndex)?(meta.data[dataIndex].hidden=!visible,this.update()):(this.setDatasetVisibility(datasetIndex,visible),anims.update(meta,{visible}),this.update(ctx=>ctx.datasetIndex===datasetIndex?mode:void 0))}hide(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!1)}show(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!0)}_destroyDatasetMeta(datasetIndex){const meta=this._metasets[datasetIndex];meta&&meta.controller&&meta.controller._destroy(),delete this._metasets[datasetIndex]}_stop(){let i,ilen;for(this.stop(),animator.remove(this),i=0,ilen=this.data.datasets.length;i{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),listener=__name((e,x,y)=>{e.offsetX=x,e.offsetY=y,this._eventHandler(e)},"listener");each(this.options.events,type=>_add(type,listener))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const listeners=this._responsiveListeners,platform=this.platform,_add=__name((type,listener2)=>{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),_remove=__name((type,listener2)=>{listeners[type]&&(platform.removeEventListener(this,type,listener2),delete listeners[type])},"_remove"),listener=__name((width,height)=>{this.canvas&&this.resize(width,height)},"listener");let detached;const attached=__name(()=>{_remove("attach",attached),this.attached=!0,this.resize(),_add("resize",listener),_add("detach",detached)},"attached");detached=__name(()=>{this.attached=!1,_remove("resize",listener),this._stop(),this._resize(0,0),_add("attach",attached)},"detached"),platform.isAttached(this.canvas)?attached():detached()}unbindEvents(){each(this._listeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._listeners={},each(this._responsiveListeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._responsiveListeners=void 0}updateHoverStyle(items,mode,enabled){const prefix=enabled?"set":"remove";let meta,item,i,ilen;for("dataset"===mode&&(meta=this.getDatasetMeta(items[0].datasetIndex),meta.controller["_"+prefix+"DatasetHoverStyle"]()),i=0,ilen=items.length;i{const meta=this.getDatasetMeta(datasetIndex);if(!meta)throw new Error("No dataset found at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}});!_elementsEqual(active,lastActive)&&(this._active=active,this._lastEvent=null,this._updateHoverStyles(active,lastActive))}notifyPlugins(hook,args,filter){return this._plugins.notify(this,hook,args,filter)}_updateHoverStyles(active,lastActive,replay){const hoverOptions=this.options.hover,diff=__name((a,b)=>a.filter(x=>!b.some(y=>x.datasetIndex===y.datasetIndex&&x.index===y.index)),"diff"),deactivated=diff(lastActive,active),activated=replay?active:diff(active,lastActive);deactivated.length&&this.updateHoverStyle(deactivated,hoverOptions.mode,!1),activated.length&&hoverOptions.mode&&this.updateHoverStyle(activated,hoverOptions.mode,!0)}_eventHandler(e,replay){const args={event:e,replay,cancelable:!0,inChartArea:this.isPointInArea(e)},eventFilter=__name(plugin=>(plugin.options.events||this.options.events).includes(e.native.type),"eventFilter");if(!1===this.notifyPlugins("beforeEvent",args,eventFilter))return;const changed=this._handleEvent(e,replay,args.inChartArea);return args.cancelable=!1,this.notifyPlugins("afterEvent",args,eventFilter),(changed||args.changed)&&this.render(),this}_handleEvent(e,replay,inChartArea){const{_active:lastActive=[],options}=this,useFinalPosition=replay,active=this._getActiveElements(e,lastActive,inChartArea,useFinalPosition),isClick=_isClickEvent(e),lastEvent=determineLastEvent(e,this._lastEvent,inChartArea,isClick);inChartArea&&(this._lastEvent=null,callback(options.onHover,[e,active,this],this),isClick&&callback(options.onClick,[e,active,this],this));const changed=!_elementsEqual(active,lastActive);return(changed||replay)&&(this._active=active,this._updateHoverStyles(active,lastActive,replay)),this._lastEvent=lastEvent,changed}_getActiveElements(e,lastActive,inChartArea,useFinalPosition){if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;const hoverOptions=this.options.hover;return this.getElementsAtEventForMode(e,hoverOptions.mode,hoverOptions,useFinalPosition)}}__name(Chart,"Chart");const invalidatePlugins=__name(()=>each(Chart.instances,chart=>chart._plugins.invalidate()),"invalidatePlugins");function clipArc(ctx,element,endAngle){const{startAngle,pixelMargin,x,y,outerRadius,innerRadius}=element;let angleMargin=pixelMargin/outerRadius;ctx.beginPath(),ctx.arc(x,y,outerRadius,startAngle-angleMargin,endAngle+angleMargin),innerRadius>pixelMargin?(angleMargin=pixelMargin/innerRadius,ctx.arc(x,y,innerRadius,endAngle+angleMargin,startAngle-angleMargin,!0)):ctx.arc(x,y,pixelMargin,endAngle+HALF_PI,startAngle-HALF_PI),ctx.closePath(),ctx.clip()}function toRadiusCorners(value){return _readValueToProps(value,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(arc,innerRadius,outerRadius,angleDelta){const o=toRadiusCorners(arc.options.borderRadius),halfThickness=(outerRadius-innerRadius)/2,innerLimit=Math.min(halfThickness,angleDelta*innerRadius/2),computeOuterLimit=__name(val=>{const outerArcLimit=(outerRadius-Math.min(halfThickness,val))*angleDelta/2;return _limitValue(val,0,Math.min(halfThickness,outerArcLimit))},"computeOuterLimit");return{outerStart:computeOuterLimit(o.outerStart),outerEnd:computeOuterLimit(o.outerEnd),innerStart:_limitValue(o.innerStart,0,innerLimit),innerEnd:_limitValue(o.innerEnd,0,innerLimit)}}function rThetaToXY(r,theta,x,y){return{x:x+r*Math.cos(theta),y:y+r*Math.sin(theta)}}function pathArc(ctx,element,offset,spacing,end){const{x,y,startAngle:start,pixelMargin,innerRadius:innerR}=element,outerRadius=Math.max(element.outerRadius+spacing+offset-pixelMargin,0),innerRadius=innerR>0?innerR+spacing+offset+pixelMargin:0;let spacingOffset=0;const alpha2=end-start;if(spacing){const avNogSpacingRadius=((innerR>0?innerR-spacing:0)+(outerRadius>0?outerRadius-spacing:0))/2;spacingOffset=(alpha2-(0!==avNogSpacingRadius?alpha2*avNogSpacingRadius/(avNogSpacingRadius+spacing):alpha2))/2}const angleOffset=(alpha2-Math.max(.001,alpha2*outerRadius-offset/PI)/outerRadius)/2,startAngle=start+angleOffset+spacingOffset,endAngle=end-angleOffset-spacingOffset,{outerStart,outerEnd,innerStart,innerEnd}=parseBorderRadius$1(element,innerRadius,outerRadius,endAngle-startAngle),outerStartAdjustedRadius=outerRadius-outerStart,outerEndAdjustedRadius=outerRadius-outerEnd,outerStartAdjustedAngle=startAngle+outerStart/outerStartAdjustedRadius,outerEndAdjustedAngle=endAngle-outerEnd/outerEndAdjustedRadius,innerStartAdjustedRadius=innerRadius+innerStart,innerEndAdjustedRadius=innerRadius+innerEnd,innerStartAdjustedAngle=startAngle+innerStart/innerStartAdjustedRadius,innerEndAdjustedAngle=endAngle-innerEnd/innerEndAdjustedRadius;if(ctx.beginPath(),ctx.arc(x,y,outerRadius,outerStartAdjustedAngle,outerEndAdjustedAngle),outerEnd>0){const pCenter=rThetaToXY(outerEndAdjustedRadius,outerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerEnd,outerEndAdjustedAngle,endAngle+HALF_PI)}const p4=rThetaToXY(innerEndAdjustedRadius,endAngle,x,y);if(ctx.lineTo(p4.x,p4.y),innerEnd>0){const pCenter=rThetaToXY(innerEndAdjustedRadius,innerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerEnd,endAngle+HALF_PI,innerEndAdjustedAngle+Math.PI)}if(ctx.arc(x,y,innerRadius,endAngle-innerEnd/innerRadius,startAngle+innerStart/innerRadius,!0),innerStart>0){const pCenter=rThetaToXY(innerStartAdjustedRadius,innerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerStart,innerStartAdjustedAngle+Math.PI,startAngle-HALF_PI)}const p8=rThetaToXY(outerStartAdjustedRadius,startAngle,x,y);if(ctx.lineTo(p8.x,p8.y),outerStart>0){const pCenter=rThetaToXY(outerStartAdjustedRadius,outerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerStart,startAngle-HALF_PI,outerStartAdjustedAngle)}ctx.closePath()}function drawArc(ctx,element,offset,spacing){const{fullCircles,startAngle,circumference}=element;let endAngle=element.endAngle;if(fullCircles){pathArc(ctx,element,offset,spacing,startAngle+TAU);for(let i=0;i{registry.add(...items),invalidatePlugins()}},unregister:{enumerable:true,value:(...items)=>{registry.remove(...items),invalidatePlugins()}}}),__name(clipArc,"clipArc"),__name(toRadiusCorners,"toRadiusCorners"),__name(parseBorderRadius$1,"parseBorderRadius$1"),__name(rThetaToXY,"rThetaToXY"),__name(pathArc,"pathArc"),__name(drawArc,"drawArc"),__name(drawFullCircleBorders,"drawFullCircleBorders"),__name(drawBorder,"drawBorder");class ArcElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}inRange(chartX,chartY,useFinalPosition){const point=this.getProps(["x","y"],useFinalPosition),{angle,distance}=getAngleFromPoint(point,{x:chartX,y:chartY}),{startAngle,endAngle,innerRadius,outerRadius,circumference}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),rAdjust=this.options.spacing/2,betweenAngles=valueOrDefault(circumference,endAngle-startAngle)>=TAU||_angleBetween(angle,startAngle,endAngle),withinRadius=_isBetween(distance,innerRadius+rAdjust,outerRadius+rAdjust);return betweenAngles&&withinRadius}getCenterPoint(useFinalPosition){const{x,y,startAngle,endAngle,innerRadius,outerRadius}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),{offset,spacing}=this.options,halfAngle=(startAngle+endAngle)/2,halfRadius=(innerRadius+outerRadius+spacing+offset)/2;return{x:x+Math.cos(halfAngle)*halfRadius,y:y+Math.sin(halfAngle)*halfRadius}}tooltipPosition(useFinalPosition){return this.getCenterPoint(useFinalPosition)}draw(ctx){const{options,circumference}=this,offset=(options.offset||0)/2,spacing=(options.spacing||0)/2;if(this.pixelMargin="inner"===options.borderAlign?.33:0,this.fullCircles=circumference>TAU?Math.floor(circumference/TAU):0,0===circumference||this.innerRadius<0||this.outerRadius<0)return;ctx.save();let radiusOffset=0;if(offset){radiusOffset=offset/2;const halfAngle=(this.startAngle+this.endAngle)/2;ctx.translate(Math.cos(halfAngle)*radiusOffset,Math.sin(halfAngle)*radiusOffset),this.circumference>=PI&&(radiusOffset=offset)}ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor;drawBorder(ctx,this,radiusOffset,spacing,drawArc(ctx,this,radiusOffset,spacing)),ctx.restore()}}function setStyle(ctx,options,style=options){ctx.lineCap=valueOrDefault(style.borderCapStyle,options.borderCapStyle),ctx.setLineDash(valueOrDefault(style.borderDash,options.borderDash)),ctx.lineDashOffset=valueOrDefault(style.borderDashOffset,options.borderDashOffset),ctx.lineJoin=valueOrDefault(style.borderJoinStyle,options.borderJoinStyle),ctx.lineWidth=valueOrDefault(style.borderWidth,options.borderWidth),ctx.strokeStyle=valueOrDefault(style.borderColor,options.borderColor)}function lineTo(ctx,previous,target){ctx.lineTo(target.x,target.y)}function getLineMethod(options){return options.stepped?_steppedLineTo:options.tension||"monotone"===options.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(points,segment,params={}){const count=points.length,{start:paramsStart=0,end:paramsEnd=count-1}=params,{start:segmentStart,end:segmentEnd}=segment,start=Math.max(paramsStart,segmentStart),end=Math.min(paramsEnd,segmentEnd),outside=paramsStartsegmentEnd&¶msEnd>segmentEnd;return{count,start,loop:segment.loop,ilen:end(start+(reverse?ilen-index2:index2))%count,"pointIndex"),drawX=__name(()=>{minY!==maxY&&(ctx.lineTo(avgX,maxY),ctx.lineTo(avgX,minY),ctx.lineTo(avgX,lastY))},"drawX");for(move&&(point=points[pointIndex(0)],ctx.moveTo(point.x,point.y)),i=0;i<=ilen;++i){if(point=points[pointIndex(i)],point.skip)continue;const x=point.x,y=point.y,truncX=0|x;truncX===prevX?(ymaxY&&(maxY=y),avgX=(countX*avgX+x)/++countX):(drawX(),ctx.lineTo(x,y),prevX=truncX,countX=0,minY=maxY=y),lastY=y}drawX()}function _getSegmentMethod(line){const opts=line.options,borderDash=opts.borderDash&&opts.borderDash.length;return line._decimated||line._loop||opts.tension||"monotone"===opts.cubicInterpolationMode||opts.stepped||borderDash?pathSegment:fastPathSegment}function _getInterpolationMethod(options){return options.stepped?_steppedInterpolation:options.tension||"monotone"===options.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(ctx,line,start,count){let path=line._path;path||(path=line._path=new Path2D,line.path(path,start,count)&&path.closePath()),setStyle(ctx,line.options),ctx.stroke(path)}function strokePathDirect(ctx,line,start,count){const{segments,options}=line,segmentMethod=_getSegmentMethod(line);for(const segment of segments)setStyle(ctx,options,segment.style),ctx.beginPath(),segmentMethod(ctx,line,segment,{start,end:start+count-1})&&ctx.closePath(),ctx.stroke()}__name(ArcElement,"ArcElement"),ArcElement.id="arc",ArcElement.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ArcElement.defaultRoutes={backgroundColor:"backgroundColor"},__name(setStyle,"setStyle"),__name(lineTo,"lineTo"),__name(getLineMethod,"getLineMethod"),__name(pathVars,"pathVars"),__name(pathSegment,"pathSegment"),__name(fastPathSegment,"fastPathSegment"),__name(_getSegmentMethod,"_getSegmentMethod"),__name(_getInterpolationMethod,"_getInterpolationMethod"),__name(strokePathWithCache,"strokePathWithCache"),__name(strokePathDirect,"strokePathDirect");const usePath2D="function"==typeof Path2D;function draw(ctx,line,start,count){usePath2D&&!line.options.segment?strokePathWithCache(ctx,line,start,count):strokePathDirect(ctx,line,start,count)}__name(draw,"draw");class LineElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}updateControlPoints(chartArea,indexAxis){const options=this.options;if((options.tension||"monotone"===options.cubicInterpolationMode)&&!options.stepped&&!this._pointsUpdated){const loop=options.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,options,chartArea,loop,indexAxis),this._pointsUpdated=!0}}set points(points){this._points=points,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const segments=this.segments,points=this.points;return segments.length&&points[segments[0].start]}last(){const segments=this.segments,points=this.points,count=segments.length;return count&&points[segments[count-1].end]}interpolate(point,property){const options=this.options,value=point[property],points=this.points,segments=_boundSegments(this,{property,start:value,end:value});if(!segments.length)return;const result=[],_interpolate=_getInterpolationMethod(options);let i,ilen;for(i=0,ilen=segments.length;i"borderDash"!==name&&"fill"!==name},__name(inRange$1,"inRange$1");class PointElement extends Element{constructor(cfg){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,cfg&&Object.assign(this,cfg)}inRange(mouseX,mouseY,useFinalPosition){const options=this.options,{x,y}=this.getProps(["x","y"],useFinalPosition);return Math.pow(mouseX-x,2)+Math.pow(mouseY-y,2)=count)return data.slice(start,start+count);const decimated=[],bucketWidth=(count-2)/(samples-2);let sampledIndex=0;const endIndex=start+count-1;let i,maxAreaPoint,maxArea,area,nextA,a=start;for(decimated[sampledIndex++]=data[a],i=0;imaxArea&&(maxArea=area,maxAreaPoint=data[j],nextA=j);decimated[sampledIndex++]=maxAreaPoint,a=nextA}return decimated[sampledIndex++]=data[endIndex],decimated}function minMaxDecimation(data,start,count,availableWidth){let i,point,x,y,prevX,minIndex,maxIndex,startIndex,minY,maxY,avgX=0,countX=0;const decimated=[],endIndex=start+count-1,xMin=data[start].x,dx=data[endIndex].x-xMin;for(i=start;imaxY&&(maxY=y,maxIndex=i),avgX=(countX*avgX+point.x)/++countX;else{const lastIndex=i-1;if(!isNullOrUndef(minIndex)&&!isNullOrUndef(maxIndex)){const intermediateIndex1=Math.min(minIndex,maxIndex),intermediateIndex2=Math.max(minIndex,maxIndex);intermediateIndex1!==startIndex&&intermediateIndex1!==lastIndex&&decimated.push({...data[intermediateIndex1],x:avgX}),intermediateIndex2!==startIndex&&intermediateIndex2!==lastIndex&&decimated.push({...data[intermediateIndex2],x:avgX})}i>0&&lastIndex!==startIndex&&decimated.push(data[lastIndex]),decimated.push(point),prevX=truncX,countX=0,minY=maxY=y,minIndex=maxIndex=startIndex=i}}return decimated}function cleanDecimatedDataset(dataset){if(dataset._decimated){const data=dataset._data;delete dataset._decimated,delete dataset._data,Object.defineProperty(dataset,"data",{value:data})}}function cleanDecimatedData(chart){chart.data.datasets.forEach(dataset=>{cleanDecimatedDataset(dataset)})}function getStartAndCountOfVisiblePointsSimplified(meta,points){const pointCount=points.length;let count,start=0;const{iScale}=meta,{min,max,minDefined,maxDefined}=iScale.getUserBounds();return minDefined&&(start=_limitValue(_lookupByKey(points,iScale.axis,min).lo,0,pointCount-1)),count=maxDefined?_limitValue(_lookupByKey(points,iScale.axis,max).hi+1,start,pointCount)-start:pointCount-start,{start,count}}__name(lttbDecimation,"lttbDecimation"),__name(minMaxDecimation,"minMaxDecimation"),__name(cleanDecimatedDataset,"cleanDecimatedDataset"),__name(cleanDecimatedData,"cleanDecimatedData"),__name(getStartAndCountOfVisiblePointsSimplified,"getStartAndCountOfVisiblePointsSimplified");function _segments(line,target,property){const segments=line.segments,points=line.points,tpoints=target.points,parts=[];for(const segment of segments){let{start,end}=segment;end=_findSegmentEnd(start,end,points);const bounds=_getBounds(property,points[start],points[end],segment.loop);if(!target.segments){parts.push({source:segment,target:bounds,start:points[start],end:points[end]});continue}const targetSegments=_boundSegments(target,bounds);for(const tgt of targetSegments){const subBounds=_getBounds(property,tpoints[tgt.start],tpoints[tgt.end],tgt.loop),fillSources=_boundSegment(segment,points,subBounds);for(const fillSource of fillSources)parts.push({source:fillSource,target:tgt,start:{[property]:_getEdge(bounds,subBounds,"start",Math.max)},end:{[property]:_getEdge(bounds,subBounds,"end",Math.min)}})}}return parts}function _getBounds(property,first,last,loop){if(loop)return;let start=first[property],end=last[property];return"angle"===property&&(start=_normalizeAngle(start),end=_normalizeAngle(end)),{property,start,end}}function _pointsFromSegments(boundary,line){const{x=null,y=null}=boundary||{},linePoints=line.points,points=[];return line.segments.forEach(({start,end})=>{end=_findSegmentEnd(start,end,linePoints);const first=linePoints[start],last=linePoints[end];null!==y?(points.push({x:first.x,y}),points.push({x:last.x,y})):null!==x&&(points.push({x,y:first.y}),points.push({x,y:last.y}))}),points}function _findSegmentEnd(start,end,points){for(;end>start;end--){const point=points[end];if(!isNaN(point.x)&&!isNaN(point.y))break}return end}function _getEdge(a,b,prop,fn){return a&&b?fn(a[prop],b[prop]):a?a[prop]:b?b[prop]:0}function _createBoundaryLine(boundary,line){let points=[],_loop=!1;return isArray(boundary)?(_loop=!0,points=boundary):points=_pointsFromSegments(boundary,line),points.length?new LineElement({points,options:{tension:0},_loop,_fullLoop:_loop}):null}function _resolveTarget(sources,index2,propagate){let fill2=sources[index2].fill;const visited=[index2];let target;if(!propagate)return fill2;for(;!1!==fill2&&-1===visited.indexOf(fill2);){if(!isNumberFinite(fill2))return fill2;if(target=sources[fill2],!target)return!1;if(target.visible)return fill2;visited.push(fill2),fill2=target.fill}return!1}function _decodeFill(line,index2,count){const fill2=parseFillOption(line);if(isObject(fill2))return!isNaN(fill2.value)&&fill2;let target=parseFloat(fill2);return isNumberFinite(target)&&Math.floor(target)===target?decodeTargetIndex(fill2[0],index2,target,count):["origin","start","end","stack","shape"].indexOf(fill2)>=0&&fill2}function decodeTargetIndex(firstCh,index2,target,count){return("-"===firstCh||"+"===firstCh)&&(target=index2+target),!(target===index2||target<0||target>=count)&&target}function _getTargetPixel(fill2,scale){let pixel=null;return"start"===fill2?pixel=scale.bottom:"end"===fill2?pixel=scale.top:isObject(fill2)?pixel=scale.getPixelForValue(fill2.value):scale.getBasePixel&&(pixel=scale.getBasePixel()),pixel}function _getTargetValue(fill2,scale,startValue){let value;return value="start"===fill2?startValue:"end"===fill2?scale.options.reverse?scale.min:scale.max:isObject(fill2)?fill2.value:scale.getBaseValue(),value}function parseFillOption(line){const options=line.options,fillOption=options.fill;let fill2=valueOrDefault(fillOption&&fillOption.target,fillOption);return void 0===fill2&&(fill2=!!options.backgroundColor),!1!==fill2&&null!==fill2&&(!0===fill2?"origin":fill2)}function _buildStackLine(source){const{scale,index:index2,line}=source,points=[],segments=line.segments,sourcePoints=line.points,linesBelow=getLinesBelow(scale,index2);linesBelow.push(_createBoundaryLine({x:null,y:scale.bottom},line));for(let i=0;i=0;--i){const source=metasets[i].$filler;!source||(source.line.updateControlPoints(area,source.axis),draw2&&_drawfill(chart.ctx,source,area))}},beforeDatasetsDraw(chart,_args,options){if("beforeDatasetsDraw"!==options.drawTime)return;const metasets=chart.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;source&&_drawfill(chart.ctx,source,chart.chartArea)}},beforeDatasetDraw(chart,args,options){const source=args.meta.$filler;!source||!1===source.fill||"beforeDatasetDraw"!==options.drawTime||_drawfill(chart.ctx,source,chart.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=__name((labelOpts,fontSize)=>{let{boxHeight=fontSize,boxWidth=fontSize}=labelOpts;return labelOpts.usePointStyle&&(boxHeight=Math.min(boxHeight,fontSize),boxWidth=Math.min(boxWidth,fontSize)),{boxWidth,boxHeight,itemHeight:Math.max(fontSize,boxHeight)}},"getBoxSize"),itemsEqual=__name((a,b)=>null!==a&&null!==b&&a.datasetIndex===b.datasetIndex&&a.index===b.index,"itemsEqual");class Legend extends Element{constructor(config){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight,margins){this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins,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 labelOpts=this.options.labels||{};let legendItems=callback(labelOpts.generateLabels,[this.chart],this)||[];labelOpts.filter&&(legendItems=legendItems.filter(item=>labelOpts.filter(item,this.chart.data))),labelOpts.sort&&(legendItems=legendItems.sort((a,b)=>labelOpts.sort(a,b,this.chart.data))),this.options.reverse&&legendItems.reverse(),this.legendItems=legendItems}fit(){const{options,ctx}=this;if(!options.display)return void(this.width=this.height=0);const labelOpts=options.labels,labelFont=toFont(labelOpts.font),fontSize=labelFont.size,titleHeight=this._computeTitleHeight(),{boxWidth,itemHeight}=getBoxSize(labelOpts,fontSize);let width,height;ctx.font=labelFont.string,this.isHorizontal()?(width=this.maxWidth,height=this._fitRows(titleHeight,fontSize,boxWidth,itemHeight)+10):(height=this.maxHeight,width=this._fitCols(titleHeight,fontSize,boxWidth,itemHeight)+10),this.width=Math.min(width,options.maxWidth||this.maxWidth),this.height=Math.min(height,options.maxHeight||this.maxHeight)}_fitRows(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxWidth,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],lineWidths=this.lineWidths=[0],lineHeight=itemHeight+padding;let totalHeight=titleHeight;ctx.textAlign="left",ctx.textBaseline="middle";let row=-1,top=-lineHeight;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;(0===i||lineWidths[lineWidths.length-1]+itemWidth+2*padding>maxWidth)&&(totalHeight+=lineHeight,lineWidths[lineWidths.length-(i>0?0:1)]=0,top+=lineHeight,row++),hitboxes[i]={left:0,top,row,width:itemWidth,height:itemHeight},lineWidths[lineWidths.length-1]+=itemWidth+padding}),totalHeight}_fitCols(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxHeight,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],columnSizes=this.columnSizes=[],heightLimit=maxHeight-titleHeight;let totalWidth=padding,currentColWidth=0,currentColHeight=0,left=0,col=0;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;i>0&¤tColHeight+itemHeight+2*padding>heightLimit&&(totalWidth+=currentColWidth+padding,columnSizes.push({width:currentColWidth,height:currentColHeight}),left+=currentColWidth+padding,col++,currentColWidth=currentColHeight=0),hitboxes[i]={left,top:currentColHeight,col,width:itemWidth,height:itemHeight},currentColWidth=Math.max(currentColWidth,itemWidth),currentColHeight+=itemHeight+padding}),totalWidth+=currentColWidth,columnSizes.push({width:currentColWidth,height:currentColHeight}),totalWidth}adjustHitBoxes(){if(!this.options.display)return;const titleHeight=this._computeTitleHeight(),{legendHitBoxes:hitboxes,options:{align,labels:{padding},rtl}}=this,rtlHelper=getRtlAdapter(rtl,this.left,this.width);if(this.isHorizontal()){let row=0,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row]);for(const hitbox of hitboxes)row!==hitbox.row&&(row=hitbox.row,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row])),hitbox.top+=this.top+titleHeight+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(left),hitbox.width),left+=hitbox.width+padding}else{let col=0,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height);for(const hitbox of hitboxes)hitbox.col!==col&&(col=hitbox.col,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height)),hitbox.top=top,hitbox.left+=this.left+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(hitbox.left),hitbox.width),top+=hitbox.height+padding}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const ctx=this.ctx;clipArea(ctx,this),this._draw(),unclipArea(ctx)}}_draw(){const{options:opts,columnSizes,lineWidths,ctx}=this,{align,labels:labelOpts}=opts,defaultColor=defaults.color,rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),labelFont=toFont(labelOpts.font),{color:fontColor,padding}=labelOpts,fontSize=labelFont.size,halfFontSize=fontSize/2;let cursor;this.drawTitle(),ctx.textAlign=rtlHelper.textAlign("left"),ctx.textBaseline="middle",ctx.lineWidth=.5,ctx.font=labelFont.string;const{boxWidth,boxHeight,itemHeight}=getBoxSize(labelOpts,fontSize),drawLegendBox=__name(function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0||isNaN(boxHeight)||boxHeight<0)return;ctx.save();const lineWidth=valueOrDefault(legendItem.lineWidth,1);if(ctx.fillStyle=valueOrDefault(legendItem.fillStyle,defaultColor),ctx.lineCap=valueOrDefault(legendItem.lineCap,"butt"),ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,0),ctx.lineJoin=valueOrDefault(legendItem.lineJoin,"miter"),ctx.lineWidth=lineWidth,ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,defaultColor),ctx.setLineDash(valueOrDefault(legendItem.lineDash,[])),labelOpts.usePointStyle){const drawOptions={radius:boxWidth*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth},centerX=rtlHelper.xPlus(x,boxWidth/2);drawPoint(ctx,drawOptions,centerX,y+halfFontSize)}else{const yBoxTop=y+Math.max((fontSize-boxHeight)/2,0),xBoxLeft=rtlHelper.leftForLtr(x,boxWidth),borderRadius=toTRBLCorners(legendItem.borderRadius);ctx.beginPath(),Object.values(borderRadius).some(v=>0!==v)?addRoundedRectPath(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius}):ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight),ctx.fill(),0!==lineWidth&&ctx.stroke()}ctx.restore()},"drawLegendBox"),fillText=__name(function(x,y,legendItem){renderText(ctx,legendItem.text,x,y+itemHeight/2,labelFont,{strikethrough:legendItem.hidden,textAlign:rtlHelper.textAlign(legendItem.textAlign)})},"fillText"),isHorizontal=this.isHorizontal(),titleHeight=this._computeTitleHeight();cursor=isHorizontal?{x:_alignStartEnd(align,this.left+padding,this.right-lineWidths[0]),y:this.top+padding+titleHeight,line:0}:{x:this.left+padding,y:_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[0].height),line:0},overrideTextDirection(this.ctx,opts.textDirection);const lineHeight=itemHeight+padding;this.legendItems.forEach((legendItem,i)=>{ctx.strokeStyle=legendItem.fontColor||fontColor,ctx.fillStyle=legendItem.fontColor||fontColor;const textWidth=ctx.measureText(legendItem.text).width,textAlign=rtlHelper.textAlign(legendItem.textAlign||(legendItem.textAlign=labelOpts.textAlign)),width=boxWidth+halfFontSize+textWidth;let x=cursor.x,y=cursor.y;rtlHelper.setWidth(this.width),isHorizontal?i>0&&x+width+padding>this.right&&(y=cursor.y+=lineHeight,cursor.line++,x=cursor.x=_alignStartEnd(align,this.left+padding,this.right-lineWidths[cursor.line])):i>0&&y+lineHeight>this.bottom&&(x=cursor.x=x+columnSizes[cursor.line].width+padding,cursor.line++,y=cursor.y=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[cursor.line].height));const realX=rtlHelper.x(x);drawLegendBox(realX,y,legendItem),x=_textX(textAlign,x+boxWidth+halfFontSize,isHorizontal?x+width:this.right,opts.rtl),fillText(rtlHelper.x(x),y,legendItem),isHorizontal?cursor.x+=width+padding:cursor.y+=lineHeight}),restoreTextDirection(this.ctx,opts.textDirection)}drawTitle(){const opts=this.options,titleOpts=opts.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);if(!titleOpts.display)return;const rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),ctx=this.ctx,position=titleOpts.position,halfFontSize=titleFont.size/2,topPaddingPlusHalfFontSize=titlePadding.top+halfFontSize;let y,left=this.left,maxWidth=this.width;if(this.isHorizontal())maxWidth=Math.max(...this.lineWidths),y=this.top+topPaddingPlusHalfFontSize,left=_alignStartEnd(opts.align,left,this.right-maxWidth);else{const maxHeight=this.columnSizes.reduce((acc,size)=>Math.max(acc,size.height),0);y=topPaddingPlusHalfFontSize+_alignStartEnd(opts.align,this.top,this.bottom-maxHeight-opts.labels.padding-this._computeTitleHeight())}const x=_alignStartEnd(position,left,left+maxWidth);ctx.textAlign=rtlHelper.textAlign(_toLeftRightCenter(position)),ctx.textBaseline="middle",ctx.strokeStyle=titleOpts.color,ctx.fillStyle=titleOpts.color,ctx.font=titleFont.string,renderText(ctx,titleOpts.text,x,y,titleFont)}_computeTitleHeight(){const titleOpts=this.options.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);return titleOpts.display?titleFont.lineHeight+titlePadding.height:0}_getLegendItemAt(x,y){let i,hitBox,lh;if(_isBetween(x,this.left,this.right)&&_isBetween(y,this.top,this.bottom))for(lh=this.legendHitBoxes,i=0;ictx.chart.options.color,boxWidth:40,padding:10,generateLabels(chart){const datasets=chart.data.datasets,{labels:{usePointStyle,pointStyle,textAlign,color:color2}}=chart.legend.options;return chart._getSortedDatasetMetas().map(meta=>{const style=meta.controller.getStyle(usePointStyle?0:void 0),borderWidth=toPadding(style.borderWidth);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,fontColor:color2,hidden:!meta.visible,lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:(borderWidth.width+borderWidth.height)/4,strokeStyle:style.borderColor,pointStyle:pointStyle||style.pointStyle,rotation:style.rotation,textAlign:textAlign||style.textAlign,borderRadius:0,datasetIndex:meta.index}},this)}},title:{color:ctx=>ctx.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:name=>!name.startsWith("on"),labels:{_scriptable:name=>!["generateLabels","filter","sort"].includes(name)}}};class Title extends Element{constructor(config){super(),this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight){const opts=this.options;if(this.left=0,this.top=0,!opts.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=maxWidth,this.height=this.bottom=maxHeight;const lineCount=isArray(opts.text)?opts.text.length:1;this._padding=toPadding(opts.padding);const textSize=lineCount*toFont(opts.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=textSize:this.width=textSize}isHorizontal(){const pos=this.options.position;return"top"===pos||"bottom"===pos}_drawArgs(offset){const{top,left,bottom,right,options}=this,align=options.align;let maxWidth,titleX,titleY,rotation=0;return this.isHorizontal()?(titleX=_alignStartEnd(align,left,right),titleY=top+offset,maxWidth=right-left):("left"===options.position?(titleX=left+offset,titleY=_alignStartEnd(align,bottom,top),rotation=-.5*PI):(titleX=right-offset,titleY=_alignStartEnd(align,top,bottom),rotation=.5*PI),maxWidth=bottom-top),{titleX,titleY,maxWidth,rotation}}draw(){const ctx=this.ctx,opts=this.options;if(!opts.display)return;const fontOpts=toFont(opts.font),offset=fontOpts.lineHeight/2+this._padding.top,{titleX,titleY,maxWidth,rotation}=this._drawArgs(offset);renderText(ctx,opts.text,0,0,fontOpts,{color:opts.color,maxWidth,rotation,textAlign:_toLeftRightCenter(opts.align),textBaseline:"middle",translation:[titleX,titleY]})}}function createTitle(chart,titleOpts){const title=new Title({ctx:chart.ctx,options:titleOpts,chart});layouts.configure(chart,title,titleOpts),layouts.addBox(chart,title),chart.titleBlock=title}__name(Title,"Title"),__name(createTitle,"createTitle");var plugin_title={id:"title",_element:Title,start(chart,_args,options){createTitle(chart,options)},stop(chart){const titleBlock=chart.titleBlock;layouts.removeBox(chart,titleBlock),delete chart.titleBlock},beforeUpdate(chart,_args,options){const title=chart.titleBlock;layouts.configure(chart,title,options),title.options=options},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 positioners={average(items){if(!items.length)return!1;let i,len,x=0,y=0,count=0;for(i=0,len=items.length;i-1?str.split("\n"):str}function createTooltipItem(chart,item){const{element,datasetIndex,index:index2}=item,controller=chart.getDatasetMeta(datasetIndex).controller,{label,value}=controller.getLabelAndValue(index2);return{chart,label,parsed:controller.getParsed(index2),raw:chart.data.datasets[datasetIndex].data[index2],formattedValue:value,dataset:controller.getDataset(),dataIndex:index2,datasetIndex,element}}function getTooltipSize(tooltip,options){const ctx=tooltip.chart.ctx,{body,footer,title}=tooltip,{boxWidth,boxHeight}=options,bodyFont=toFont(options.bodyFont),titleFont=toFont(options.titleFont),footerFont=toFont(options.footerFont),titleLineCount=title.length,footerLineCount=footer.length,bodyLineItemCount=body.length,padding=toPadding(options.padding);let height=padding.height,width=0,combinedBodyLength=body.reduce((count,bodyItem)=>count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length,0);if(combinedBodyLength+=tooltip.beforeBody.length+tooltip.afterBody.length,titleLineCount&&(height+=titleLineCount*titleFont.lineHeight+(titleLineCount-1)*options.titleSpacing+options.titleMarginBottom),combinedBodyLength){height+=bodyLineItemCount*(options.displayColors?Math.max(boxHeight,bodyFont.lineHeight):bodyFont.lineHeight)+(combinedBodyLength-bodyLineItemCount)*bodyFont.lineHeight+(combinedBodyLength-1)*options.bodySpacing}footerLineCount&&(height+=options.footerMarginTop+footerLineCount*footerFont.lineHeight+(footerLineCount-1)*options.footerSpacing);let widthPadding=0;const maxLineWidth=__name(function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding)},"maxLineWidth");return ctx.save(),ctx.font=titleFont.string,each(tooltip.title,maxLineWidth),ctx.font=bodyFont.string,each(tooltip.beforeBody.concat(tooltip.afterBody),maxLineWidth),widthPadding=options.displayColors?boxWidth+2+options.boxPadding:0,each(body,bodyItem=>{each(bodyItem.before,maxLineWidth),each(bodyItem.lines,maxLineWidth),each(bodyItem.after,maxLineWidth)}),widthPadding=0,ctx.font=footerFont.string,each(tooltip.footer,maxLineWidth),ctx.restore(),width+=padding.width,{width,height}}function determineYAlign(chart,size){const{y,height}=size;return ychart.height-height/2?"bottom":"center"}function doesNotFitWithAlign(xAlign,chart,options,size){const{x,width}=size,caret=options.caretSize+options.caretPadding;if("left"===xAlign&&x+width+caret>chart.width||"right"===xAlign&&x-width-caret<0)return!0}function determineXAlign(chart,options,size,yAlign){const{x,width}=size,{width:chartWidth,chartArea:{left,right}}=chart;let xAlign="center";return"center"===yAlign?xAlign=x<=(left+right)/2?"left":"right":x<=width/2?xAlign="left":x>=chartWidth-width/2&&(xAlign="right"),doesNotFitWithAlign(xAlign,chart,options,size)&&(xAlign="center"),xAlign}function determineAlignment(chart,options,size){const yAlign=size.yAlign||options.yAlign||determineYAlign(chart,size);return{xAlign:size.xAlign||options.xAlign||determineXAlign(chart,options,size,yAlign),yAlign}}function alignX(size,xAlign){let{x,width}=size;return"right"===xAlign?x-=width:"center"===xAlign&&(x-=width/2),x}function alignY(size,yAlign,paddingAndSize){let{y,height}=size;return"top"===yAlign?y+=paddingAndSize:y-="bottom"===yAlign?height+paddingAndSize:height/2,y}function getBackgroundPoint(options,size,alignment,chart){const{caretSize,caretPadding,cornerRadius}=options,{xAlign,yAlign}=alignment,paddingAndSize=caretSize+caretPadding,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius);let x=alignX(size,xAlign);const y=alignY(size,yAlign,paddingAndSize);return"center"===yAlign?"left"===xAlign?x+=paddingAndSize:"right"===xAlign&&(x-=paddingAndSize):"left"===xAlign?x-=Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign&&(x+=Math.max(topRight,bottomRight)+caretSize),{x:_limitValue(x,0,chart.width-size.width),y:_limitValue(y,0,chart.height-size.height)}}function getAlignedX(tooltip,align,options){const padding=toPadding(options.padding);return"center"===align?tooltip.x+tooltip.width/2:"right"===align?tooltip.x+tooltip.width-padding.right:tooltip.x+padding.left}function getBeforeAfterBodyLines(callback2){return pushOrConcat([],splitNewlines(callback2))}function createTooltipContext(parent,tooltip,tooltipItems){return createContext(parent,{tooltip,tooltipItems,type:"tooltip"})}function overrideCallbacks(callbacks,context){const override=context&&context.dataset&&context.dataset.tooltip&&context.dataset.tooltip.callbacks;return override?callbacks.override(override):callbacks}__name(pushOrConcat,"pushOrConcat"),__name(splitNewlines,"splitNewlines"),__name(createTooltipItem,"createTooltipItem"),__name(getTooltipSize,"getTooltipSize"),__name(determineYAlign,"determineYAlign"),__name(doesNotFitWithAlign,"doesNotFitWithAlign"),__name(determineXAlign,"determineXAlign"),__name(determineAlignment,"determineAlignment"),__name(alignX,"alignX"),__name(alignY,"alignY"),__name(getBackgroundPoint,"getBackgroundPoint"),__name(getAlignedX,"getAlignedX"),__name(getBeforeAfterBodyLines,"getBeforeAfterBodyLines"),__name(createTooltipContext,"createTooltipContext"),__name(overrideCallbacks,"overrideCallbacks");class Tooltip extends Element{constructor(config){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=config.chart||config._chart,this._chart=this.chart,this.options=config.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(options){this.options=options,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const cached=this._cachedAnimations;if(cached)return cached;const chart=this.chart,options=this.options.setContext(this.getContext()),opts=options.enabled&&chart.options.animation&&options.animations,animations=new Animations(this.chart,opts);return opts._cacheable&&(this._cachedAnimations=Object.freeze(animations)),animations}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(context,options){const{callbacks}=options,beforeTitle=callbacks.beforeTitle.apply(this,[context]),title=callbacks.title.apply(this,[context]),afterTitle=callbacks.afterTitle.apply(this,[context]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeTitle)),lines=pushOrConcat(lines,splitNewlines(title)),lines=pushOrConcat(lines,splitNewlines(afterTitle)),lines}getBeforeBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this,[tooltipItems]))}getBody(tooltipItems,options){const{callbacks}=options,bodyItems=[];return each(tooltipItems,context=>{const bodyItem={before:[],lines:[],after:[]},scoped=overrideCallbacks(callbacks,context);pushOrConcat(bodyItem.before,splitNewlines(scoped.beforeLabel.call(this,context))),pushOrConcat(bodyItem.lines,scoped.label.call(this,context)),pushOrConcat(bodyItem.after,splitNewlines(scoped.afterLabel.call(this,context))),bodyItems.push(bodyItem)}),bodyItems}getAfterBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this,[tooltipItems]))}getFooter(tooltipItems,options){const{callbacks}=options,beforeFooter=callbacks.beforeFooter.apply(this,[tooltipItems]),footer=callbacks.footer.apply(this,[tooltipItems]),afterFooter=callbacks.afterFooter.apply(this,[tooltipItems]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeFooter)),lines=pushOrConcat(lines,splitNewlines(footer)),lines=pushOrConcat(lines,splitNewlines(afterFooter)),lines}_createItems(options){const active=this._active,data=this.chart.data,labelColors=[],labelPointStyles=[],labelTextColors=[];let i,len,tooltipItems=[];for(i=0,len=active.length;ioptions.filter(element,index2,array,data))),options.itemSort&&(tooltipItems=tooltipItems.sort((a,b)=>options.itemSort(a,b,data))),each(tooltipItems,context=>{const scoped=overrideCallbacks(options.callbacks,context);labelColors.push(scoped.labelColor.call(this,context)),labelPointStyles.push(scoped.labelPointStyle.call(this,context)),labelTextColors.push(scoped.labelTextColor.call(this,context))}),this.labelColors=labelColors,this.labelPointStyles=labelPointStyles,this.labelTextColors=labelTextColors,this.dataPoints=tooltipItems,tooltipItems}update(changed,replay){const options=this.options.setContext(this.getContext()),active=this._active;let properties,tooltipItems=[];if(active.length){const position=positioners[options.position].call(this,active,this._eventPosition);tooltipItems=this._createItems(options),this.title=this.getTitle(tooltipItems,options),this.beforeBody=this.getBeforeBody(tooltipItems,options),this.body=this.getBody(tooltipItems,options),this.afterBody=this.getAfterBody(tooltipItems,options),this.footer=this.getFooter(tooltipItems,options);const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,size),alignment=determineAlignment(this.chart,options,positionAndSize),backgroundPoint=getBackgroundPoint(options,positionAndSize,alignment,this.chart);this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,properties={opacity:1,x:backgroundPoint.x,y:backgroundPoint.y,width:size.width,height:size.height,caretX:position.x,caretY:position.y}}else 0!==this.opacity&&(properties={opacity:0});this._tooltipItems=tooltipItems,this.$context=void 0,properties&&this._resolveAnimations().update(this,properties),changed&&options.external&&options.external.call(this,{chart:this.chart,tooltip:this,replay})}drawCaret(tooltipPoint,ctx,size,options){const caretPosition=this.getCaretPosition(tooltipPoint,size,options);ctx.lineTo(caretPosition.x1,caretPosition.y1),ctx.lineTo(caretPosition.x2,caretPosition.y2),ctx.lineTo(caretPosition.x3,caretPosition.y3)}getCaretPosition(tooltipPoint,size,options){const{xAlign,yAlign}=this,{caretSize,cornerRadius}=options,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius),{x:ptX,y:ptY}=tooltipPoint,{width,height}=size;let x1,x2,x3,y1,y2,y3;return"center"===yAlign?(y2=ptY+height/2,"left"===xAlign?(x1=ptX,x2=x1-caretSize,y1=y2+caretSize,y3=y2-caretSize):(x1=ptX+width,x2=x1+caretSize,y1=y2-caretSize,y3=y2+caretSize),x3=x1):(x2="left"===xAlign?ptX+Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign?ptX+width-Math.max(topRight,bottomRight)-caretSize:this.caretX,"top"===yAlign?(y1=ptY,y2=y1-caretSize,x1=x2-caretSize,x3=x2+caretSize):(y1=ptY+height,y2=y1+caretSize,x1=x2+caretSize,x3=x2-caretSize),y3=y1),{x1,x2,x3,y1,y2,y3}}drawTitle(pt,ctx,options){const title=this.title,length=title.length;let titleFont,titleSpacing,i;if(length){const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width);for(pt.x=getAlignedX(this,options.titleAlign,options),ctx.textAlign=rtlHelper.textAlign(options.titleAlign),ctx.textBaseline="middle",titleFont=toFont(options.titleFont),titleSpacing=options.titleSpacing,ctx.fillStyle=options.titleColor,ctx.font=titleFont.string,i=0;i0!==v)?(ctx.beginPath(),ctx.fillStyle=options.multiKeyBackground,addRoundedRectPath(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius}),ctx.fill(),ctx.stroke(),ctx.fillStyle=labelColors.backgroundColor,ctx.beginPath(),addRoundedRectPath(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius}),ctx.fill()):(ctx.fillStyle=options.multiKeyBackground,ctx.fillRect(outerX,colorY,boxWidth,boxHeight),ctx.strokeRect(outerX,colorY,boxWidth,boxHeight),ctx.fillStyle=labelColors.backgroundColor,ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2))}ctx.fillStyle=this.labelTextColors[i]}drawBody(pt,ctx,options){const{body}=this,{bodySpacing,bodyAlign,displayColors,boxHeight,boxWidth,boxPadding}=options,bodyFont=toFont(options.bodyFont);let bodyLineHeight=bodyFont.lineHeight,xLinePadding=0;const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width),fillLineOfText=__name(function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyLineHeight/2),pt.y+=bodyLineHeight+bodySpacing},"fillLineOfText"),bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign);let bodyItem,textColor,lines,i,j,ilen,jlen;for(ctx.textAlign=bodyAlign,ctx.textBaseline="middle",ctx.font=bodyFont.string,pt.x=getAlignedX(this,bodyAlignForCalculation,options),ctx.fillStyle=options.bodyColor,each(this.beforeBody,fillLineOfText),xLinePadding=displayColors&&"right"!==bodyAlignForCalculation?"center"===bodyAlign?boxWidth/2+boxPadding:boxWidth+2+boxPadding:0,i=0,ilen=body.length;i0&&ctx.stroke()}_updateAnimationTarget(options){const chart=this.chart,anims=this.$animations,animX=anims&&anims.x,animY=anims&&anims.y;if(animX||animY){const position=positioners[options.position].call(this,this._active,this._eventPosition);if(!position)return;const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,this._size),alignment=determineAlignment(chart,options,positionAndSize),point=getBackgroundPoint(options,positionAndSize,alignment,chart);(animX._to!==point.x||animY._to!==point.y)&&(this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,this.width=size.width,this.height=size.height,this.caretX=position.x,this.caretY=position.y,this._resolveAnimations().update(this,point))}}_willRender(){return!!this.opacity}draw(ctx){const options=this.options.setContext(this.getContext());let opacity=this.opacity;if(!opacity)return;this._updateAnimationTarget(options);const tooltipSize={width:this.width,height:this.height},pt={x:this.x,y:this.y};opacity=Math.abs(opacity)<.001?0:opacity;const padding=toPadding(options.padding),hasTooltipContent=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;options.enabled&&hasTooltipContent&&(ctx.save(),ctx.globalAlpha=opacity,this.drawBackground(pt,ctx,tooltipSize,options),overrideTextDirection(ctx,options.textDirection),pt.y+=padding.top,this.drawTitle(pt,ctx,options),this.drawBody(pt,ctx,options),this.drawFooter(pt,ctx,options),restoreTextDirection(ctx,options.textDirection),ctx.restore())}getActiveElements(){return this._active||[]}setActiveElements(activeElements,eventPosition){const lastActive=this._active,active=activeElements.map(({datasetIndex,index:index2})=>{const meta=this.chart.getDatasetMeta(datasetIndex);if(!meta)throw new Error("Cannot find a dataset at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}}),changed=!_elementsEqual(lastActive,active),positionChanged=this._positionChanged(active,eventPosition);(changed||positionChanged)&&(this._active=active,this._eventPosition=eventPosition,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,replay,inChartArea=!0){if(replay&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const options=this.options,lastActive=this._active||[],active=this._getActiveElements(e,lastActive,replay,inChartArea),positionChanged=this._positionChanged(active,e),changed=replay||!_elementsEqual(active,lastActive)||positionChanged;return changed&&(this._active=active,(options.enabled||options.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,replay))),changed}_getActiveElements(e,lastActive,replay,inChartArea){const options=this.options;if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;const active=this.chart.getElementsAtEventForMode(e,options.mode,options,replay);return options.reverse&&active.reverse(),active}_positionChanged(active,e){const{caretX,caretY,options}=this,position=positioners[options.position].call(this,active,e);return!1!==position&&(caretX!==position.x||caretY!==position.y)}}__name(Tooltip,"Tooltip"),Tooltip.positioners=positioners;var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(chart,_args,options){options&&(chart.tooltip=new Tooltip({chart,options}))},beforeUpdate(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},reset(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},afterDraw(chart){const tooltip=chart.tooltip;if(tooltip&&tooltip._willRender()){const args={tooltip};if(!1===chart.notifyPlugins("beforeTooltipDraw",args))return;tooltip.draw(chart.ctx),chart.notifyPlugins("afterTooltipDraw",args)}},afterEvent(chart,args){if(chart.tooltip){const useFinalPosition=args.replay;chart.tooltip.handleEvent(args.event,useFinalPosition,args.inChartArea)&&(args.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:(ctx,opts)=>opts.bodyFont.size,boxWidth:(ctx,opts)=>opts.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:noop,title(tooltipItems){if(tooltipItems.length>0){const item=tooltipItems[0],labels=item.chart.data.labels,labelCount=labels?labels.length:0;if(this&&this.options&&"dataset"===this.options.mode)return item.dataset.label||"";if(item.label)return item.label;if(labelCount>0&&item.dataIndex"filter"!==name&&"itemSort"!==name&&"external"!==name,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=__name((labels,raw,index2,addedLabels)=>("string"==typeof raw?(index2=labels.push(raw)-1,addedLabels.unshift({index:index2,label:raw})):isNaN(raw)&&(index2=null),index2),"addIfString");function findOrAddLabel(labels,raw,index2,addedLabels){const first=labels.indexOf(raw);if(-1===first)return addIfString(labels,raw,index2,addedLabels);return first!==labels.lastIndexOf(raw)?index2:first}__name(findOrAddLabel,"findOrAddLabel");const validIndex=__name((index2,max)=>null===index2?null:_limitValue(Math.round(index2),0,max),"validIndex");class CategoryScale extends Scale{constructor(cfg){super(cfg),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(scaleOptions){const added=this._addedLabels;if(added.length){const labels=this.getLabels();for(const{index:index2,label}of added)labels[index2]===label&&labels.splice(index2,1);this._addedLabels=[]}super.init(scaleOptions)}parse(raw,index2){if(isNullOrUndef(raw))return null;const labels=this.getLabels();return index2=isFinite(index2)&&labels[index2]===raw?index2:findOrAddLabel(labels,raw,valueOrDefault(index2,raw),this._addedLabels),validIndex(index2,labels.length-1)}determineDataLimits(){const{minDefined,maxDefined}=this.getUserBounds();let{min,max}=this.getMinMax(!0);"ticks"===this.options.bounds&&(minDefined||(min=0),maxDefined||(max=this.getLabels().length-1)),this.min=min,this.max=max}buildTicks(){const min=this.min,max=this.max,offset=this.options.offset,ticks=[];let labels=this.getLabels();labels=0===min&&max===labels.length-1?labels:labels.slice(min,max+1),this._valueRange=Math.max(labels.length-(offset?0:1),1),this._startValue=this.min-(offset?.5:0);for(let value=min;value<=max;value++)ticks.push({value});return ticks}getLabelForValue(value){const labels=this.getLabels();return value>=0&&valueticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getValueForPixel(pixel){return Math.round(this._startValue+this.getDecimalForPixel(pixel)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(generationOptions,dataRange){const ticks=[],{bounds,step,min,max,precision,count,maxTicks,maxDigits,includeBounds}=generationOptions,unit=step||1,maxSpaces=maxTicks-1,{min:rmin,max:rmax}=dataRange,minDefined=!isNullOrUndef(min),maxDefined=!isNullOrUndef(max),countDefined=!isNullOrUndef(count),minSpacing=(rmax-rmin)/(maxDigits+1);let factor,niceMin,niceMax,numSpaces,spacing=niceNum((rmax-rmin)/maxSpaces/unit)*unit;if(spacing<1e-14&&!minDefined&&!maxDefined)return[{value:rmin},{value:rmax}];numSpaces=Math.ceil(rmax/spacing)-Math.floor(rmin/spacing),numSpaces>maxSpaces&&(spacing=niceNum(numSpaces*spacing/maxSpaces/unit)*unit),isNullOrUndef(precision)||(factor=Math.pow(10,precision),spacing=Math.ceil(spacing*factor)/factor),"ticks"===bounds?(niceMin=Math.floor(rmin/spacing)*spacing,niceMax=Math.ceil(rmax/spacing)*spacing):(niceMin=rmin,niceMax=rmax),minDefined&&maxDefined&&step&&almostWhole((max-min)/step,spacing/1e3)?(numSpaces=Math.round(Math.min((max-min)/spacing,maxTicks)),spacing=(max-min)/numSpaces,niceMin=min,niceMax=max):countDefined?(niceMin=minDefined?min:niceMin,niceMax=maxDefined?max:niceMax,numSpaces=count-1,spacing=(niceMax-niceMin)/numSpaces):(numSpaces=(niceMax-niceMin)/spacing,numSpaces=almostEquals(numSpaces,Math.round(numSpaces),spacing/1e3)?Math.round(numSpaces):Math.ceil(numSpaces));const decimalPlaces=Math.max(_decimalPlaces(spacing),_decimalPlaces(niceMin));factor=Math.pow(10,isNullOrUndef(precision)?decimalPlaces:precision),niceMin=Math.round(niceMin*factor)/factor,niceMax=Math.round(niceMax*factor)/factor;let j=0;for(minDefined&&(includeBounds&&niceMin!==min?(ticks.push({value:min}),niceMinmin=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax");if(beginAtZero){const minSign=sign(min),maxSign=sign(max);minSign<0&&maxSign<0?setMax(0):minSign>0&&maxSign>0&&setMin(0)}if(min===max){let offset=1;(max>=Number.MAX_SAFE_INTEGER||min<=Number.MIN_SAFE_INTEGER)&&(offset=Math.abs(.05*max)),setMax(max+offset),beginAtZero||setMin(min-offset)}this.min=min,this.max=max}getTickLimit(){const tickOpts=this.options.ticks;let maxTicks,{maxTicksLimit,stepSize}=tickOpts;return stepSize?(maxTicks=Math.ceil(this.max/stepSize)-Math.floor(this.min/stepSize)+1,maxTicks>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`),maxTicks=1e3)):(maxTicks=this.computeTickLimit(),maxTicksLimit=maxTicksLimit||11),maxTicksLimit&&(maxTicks=Math.min(maxTicksLimit,maxTicks)),maxTicks}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const opts=this.options,tickOpts=opts.ticks;let maxTicks=this.getTickLimit();maxTicks=Math.max(2,maxTicks);const ticks=generateTicks$1({maxTicks,bounds:opts.bounds,min:opts.min,max:opts.max,precision:tickOpts.precision,step:tickOpts.stepSize,count:tickOpts.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:tickOpts.minRotation||0,includeBounds:!1!==tickOpts.includeBounds},this._range||this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}configure(){const ticks=this.ticks;let start=this.min,end=this.max;if(super.configure(),this.options.offset&&ticks.length){const offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset,end+=offset}this._startValue=start,this._endValue=end,this._valueRange=end-start}getLabelForValue(value){return formatNumber(value,this.chart.options.locale,this.options.ticks.format)}}__name(LinearScaleBase,"LinearScaleBase");class LinearScale extends LinearScaleBase{determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?min:0,this.max=isNumberFinite(max)?max:1,this.handleTickRangeOptions()}computeTickLimit(){const horizontal=this.isHorizontal(),length=horizontal?this.width:this.height,minRotation=toRadians(this.options.ticks.minRotation),ratio=(horizontal?Math.sin(minRotation):Math.cos(minRotation))||.001,tickFont=this._resolveTickFontOptions(0);return Math.ceil(length/Math.min(40,tickFont.lineHeight/ratio))}getPixelForValue(value){return null===value?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getValueForPixel(pixel){return this._startValue+this.getDecimalForPixel(pixel)*this._valueRange}}function isMajor(tickVal){return tickVal/Math.pow(10,Math.floor(log10(tickVal)))==1}function generateTicks(generationOptions,dataRange){const endExp=Math.floor(log10(dataRange.max)),endSignificand=Math.ceil(dataRange.max/Math.pow(10,endExp)),ticks=[];let tickVal=finiteOrDefault(generationOptions.min,Math.pow(10,Math.floor(log10(dataRange.min)))),exp=Math.floor(log10(tickVal)),significand=Math.floor(tickVal/Math.pow(10,exp)),precision=exp<0?Math.pow(10,Math.abs(exp)):1;do{ticks.push({value:tickVal,major:isMajor(tickVal)}),++significand,10===significand&&(significand=1,++exp,precision=exp>=0?1:precision),tickVal=Math.round(significand*Math.pow(10,exp)*precision)/precision}while(exp0?value:null;this._zero=!0}determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?Math.max(0,min):null,this.max=isNumberFinite(max)?Math.max(0,max):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined,maxDefined}=this.getUserBounds();let min=this.min,max=this.max;const setMin=__name(v=>min=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax"),exp=__name((v,m)=>Math.pow(10,Math.floor(log10(v))+m),"exp");min===max&&(min<=0?(setMin(1),setMax(10)):(setMin(exp(min,-1)),setMax(exp(max,1)))),min<=0&&setMin(exp(max,-1)),max<=0&&setMax(exp(min,1)),this._zero&&this.min!==this._suggestedMin&&min===exp(this.min,0)&&setMin(exp(min,-1)),this.min=min,this.max=max}buildTicks(){const opts=this.options,ticks=generateTicks({min:this._userMin,max:this._userMax},this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}getLabelForValue(value){return void 0===value?"0":formatNumber(value,this.chart.options.locale,this.options.ticks.format)}configure(){const start=this.min;super.configure(),this._startValue=log10(start),this._valueRange=log10(this.max)-log10(start)}getPixelForValue(value){return(void 0===value||0===value)&&(value=this.min),null===value||isNaN(value)?NaN:this.getPixelForDecimal(value===this.min?0:(log10(value)-this._startValue)/this._valueRange)}getValueForPixel(pixel){const decimal=this.getDecimalForPixel(pixel);return Math.pow(10,this._startValue+decimal*this._valueRange)}}function getTickBackdropHeight(opts){const tickOpts=opts.ticks;if(tickOpts.display&&opts.display){const padding=toPadding(tickOpts.backdropPadding);return valueOrDefault(tickOpts.font&&tickOpts.font.size,defaults.font.size)+padding.height}return 0}function measureLabelSize(ctx,font,label){return label=isArray(label)?label:[label],{w:_longestText(ctx,font.string,label),h:label.length*font.lineHeight}}function determineLimits(angle,pos,size,min,max){return angle===min||angle===max?{start:pos-size/2,end:pos+size/2}:anglemax?{start:pos-size,end:pos}:{start:pos,end:pos+size}}function fitWithPointLabels(scale){const orig={l:scale.left+scale._padding.left,r:scale.right-scale._padding.right,t:scale.top+scale._padding.top,b:scale.bottom-scale._padding.bottom},limits=Object.assign({},orig),labelSizes=[],padding=[],valueCount=scale._pointLabels.length,pointLabelOpts=scale.options.pointLabels,additionalAngle=pointLabelOpts.centerPointLabels?PI/valueCount:0;for(let i=0;iorig.r&&(x=(hLimits.end-orig.r)/sin,limits.r=Math.max(limits.r,orig.r+x)),vLimits.startorig.b&&(y=(vLimits.end-orig.b)/cos,limits.b=Math.max(limits.b,orig.b+y))}function buildPointLabelItems(scale,labelSizes,padding){const items=[],valueCount=scale._pointLabels.length,opts=scale.options,extra=getTickBackdropHeight(opts)/2,outerDistance=scale.drawingArea,additionalAngle=opts.pointLabels.centerPointLabels?PI/valueCount:0;for(let i=0;i270||angle<90)&&(y-=h),y}function drawPointLabels(scale,labelCount){const{ctx,options:{pointLabels}}=scale;for(let i=labelCount-1;i>=0;i--){const optsAtIndex=pointLabels.setContext(scale.getPointLabelContext(i)),plFont=toFont(optsAtIndex.font),{x,y,textAlign,left,top,right,bottom}=scale._pointLabelItems[i],{backdropColor}=optsAtIndex;if(!isNullOrUndef(backdropColor)){const borderRadius=toTRBLCorners(optsAtIndex.borderRadius),padding=toPadding(optsAtIndex.backdropPadding);ctx.fillStyle=backdropColor;const backdropLeft=left-padding.left,backdropTop=top-padding.top,backdropWidth=right-left+padding.width,backdropHeight=bottom-top+padding.height;Object.values(borderRadius).some(v=>0!==v)?(ctx.beginPath(),addRoundedRectPath(ctx,{x:backdropLeft,y:backdropTop,w:backdropWidth,h:backdropHeight,radius:borderRadius}),ctx.fill()):ctx.fillRect(backdropLeft,backdropTop,backdropWidth,backdropHeight)}renderText(ctx,scale._pointLabels[i],x,y+plFont.lineHeight/2,plFont,{color:optsAtIndex.color,textAlign,textBaseline:"middle"})}}function pathRadiusLine(scale,radius,circular,labelCount){const{ctx}=scale;if(circular)ctx.arc(scale.xCenter,scale.yCenter,radius,0,TAU);else{let pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(let i=1;i{const label=callback(this.options.pointLabels.callback,[value,index2],this);return label||0===label?label:""}).filter((v,i)=>this.chart.getDataVisibility(i))}fit(){const opts=this.options;opts.display&&opts.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(leftMovement,rightMovement,topMovement,bottomMovement){this.xCenter+=Math.floor((leftMovement-rightMovement)/2),this.yCenter+=Math.floor((topMovement-bottomMovement)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(leftMovement,rightMovement,topMovement,bottomMovement))}getIndexAngle(index2){return _normalizeAngle(index2*(TAU/(this._pointLabels.length||1))+toRadians(this.options.startAngle||0))}getDistanceFromCenterForValue(value){if(isNullOrUndef(value))return NaN;const scalingFactor=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-value)*scalingFactor:(value-this.min)*scalingFactor}getValueForDistanceFromCenter(distance){if(isNullOrUndef(distance))return NaN;const scaledDistance=distance/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-scaledDistance:this.min+scaledDistance}getPointLabelContext(index2){const pointLabels=this._pointLabels||[];if(index2>=0&&index2{if(0!==index2){offset=this.getDistanceFromCenterForValue(tick.value);drawRadiusLine(this,grid.setContext(this.getContext(index2-1)),offset,labelCount)}}),angleLines.display){for(ctx.save(),i=labelCount-1;i>=0;i--){const optsAtIndex=angleLines.setContext(this.getPointLabelContext(i)),{color:color2,lineWidth}=optsAtIndex;!lineWidth||!color2||(ctx.lineWidth=lineWidth,ctx.strokeStyle=color2,ctx.setLineDash(optsAtIndex.borderDash),ctx.lineDashOffset=optsAtIndex.borderDashOffset,offset=this.getDistanceFromCenterForValue(opts.ticks.reverse?this.min:this.max),position=this.getPointPosition(i,offset),ctx.beginPath(),ctx.moveTo(this.xCenter,this.yCenter),ctx.lineTo(position.x,position.y),ctx.stroke())}ctx.restore()}}drawBorder(){}drawLabels(){const ctx=this.ctx,opts=this.options,tickOpts=opts.ticks;if(!tickOpts.display)return;const startAngle=this.getIndexAngle(0);let offset,width;ctx.save(),ctx.translate(this.xCenter,this.yCenter),ctx.rotate(startAngle),ctx.textAlign="center",ctx.textBaseline="middle",this.ticks.forEach((tick,index2)=>{if(0===index2&&!opts.reverse)return;const optsAtIndex=tickOpts.setContext(this.getContext(index2)),tickFont=toFont(optsAtIndex.font);if(offset=this.getDistanceFromCenterForValue(this.ticks[index2].value),optsAtIndex.showLabelBackdrop){ctx.font=tickFont.string,width=ctx.measureText(tick.label).width,ctx.fillStyle=optsAtIndex.backdropColor;const padding=toPadding(optsAtIndex.backdropPadding);ctx.fillRect(-width/2-padding.left,-offset-tickFont.size/2-padding.top,width+padding.width,tickFont.size+padding.height)}renderText(ctx,tick.label,0,-offset,tickFont,{color:optsAtIndex.color})}),ctx.restore()}drawTitle(){}}__name(RadialLinearScale,"RadialLinearScale"),RadialLinearScale.id="radialLinear",RadialLinearScale.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:label=>label,padding:5,centerPointLabels:!1}},RadialLinearScale.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},RadialLinearScale.descriptors={angleLines:{_fallback:"grid"}};const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(a,b){return a-b}function parse(scale,input){if(isNullOrUndef(input))return null;const adapter=scale._adapter,{parser,round:round2,isoWeekday}=scale._parseOpts;let value=input;return"function"==typeof parser&&(value=parser(value)),isNumberFinite(value)||(value="string"==typeof parser?adapter.parse(value,parser):adapter.parse(value)),null===value?null:(round2&&(value="week"!==round2||!isNumber(isoWeekday)&&!0!==isoWeekday?adapter.startOf(value,round2):adapter.startOf(value,"isoWeek",isoWeekday)),+value)}function determineUnitForAutoTicks(minUnit,min,max,capacity){const ilen=UNITS.length;for(let i=UNITS.indexOf(minUnit);i=UNITS.indexOf(minUnit);i--){const unit=UNITS[i];if(INTERVALS[unit].common&&scale._adapter.diff(max,min,unit)>=numTicks-1)return unit}return UNITS[minUnit?UNITS.indexOf(minUnit):0]}function determineMajorUnit(unit){for(let i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i=time?timestamps[lo]:timestamps[hi]]=!0}}else ticks[time]=!0}function setMajorTicks(scale,ticks,map2,majorUnit){const adapter=scale._adapter,first=+adapter.startOf(ticks[0].value,majorUnit),last=ticks[ticks.length-1].value;let major,index2;for(major=first;major<=last;major=+adapter.add(major,1,majorUnit))index2=map2[major],index2>=0&&(ticks[index2].major=!0);return ticks}function ticksFromTimestamps(scale,values,majorUnit){const ticks=[],map2={},ilen=values.length;let i,value;for(i=0;i+tick.value))}initOffsets(timestamps){let first,last,start=0,end=0;this.options.offset&×tamps.length&&(first=this.getDecimalForValue(timestamps[0]),start=1===timestamps.length?1-first:(this.getDecimalForValue(timestamps[1])-first)/2,last=this.getDecimalForValue(timestamps[timestamps.length-1]),end=1===timestamps.length?last:(last-this.getDecimalForValue(timestamps[timestamps.length-2]))/2);const limit=timestamps.length<3?.5:.25;start=_limitValue(start,0,limit),end=_limitValue(end,0,limit),this._offsets={start,end,factor:1/(start+1+end)}}_generate(){const adapter=this._adapter,min=this.min,max=this.max,options=this.options,timeOpts=options.time,minor=timeOpts.unit||determineUnitForAutoTicks(timeOpts.minUnit,min,max,this._getLabelCapacity(min)),stepSize=valueOrDefault(timeOpts.stepSize,1),weekday="week"===minor&&timeOpts.isoWeekday,hasWeekday=isNumber(weekday)||!0===weekday,ticks={};let time,count,first=min;if(hasWeekday&&(first=+adapter.startOf(first,"isoWeek",weekday)),first=+adapter.startOf(first,hasWeekday?"day":minor),adapter.diff(max,min,minor)>1e5*stepSize)throw new Error(min+" and "+max+" are too far apart with stepSize of "+stepSize+" "+minor);const timestamps="data"===options.ticks.source&&this.getDataTimestamps();for(time=first,count=0;timea-b).map(x=>+x)}getLabelForValue(value){const adapter=this._adapter,timeOpts=this.options.time;return timeOpts.tooltipFormat?adapter.format(value,timeOpts.tooltipFormat):adapter.format(value,timeOpts.displayFormats.datetime)}_tickFormatFunction(time,index2,ticks,format){const options=this.options,formats=options.time.displayFormats,unit=this._unit,majorUnit=this._majorUnit,minorFormat=unit&&formats[unit],majorFormat=majorUnit&&formats[majorUnit],tick=ticks[index2],major=majorUnit&&majorFormat&&tick&&tick.major,label=this._adapter.format(time,format||(major?majorFormat:minorFormat)),formatter=options.ticks.callback;return formatter?callback(formatter,[label,index2,ticks],this):label}generateTickLabels(ticks){let i,ilen,tick;for(i=0,ilen=ticks.length;i0?capacity:1}getDataTimestamps(){let i,ilen,timestamps=this._cache.data||[];if(timestamps.length)return timestamps;const metas=this.getMatchingVisibleMetas();if(this._normalized&&metas.length)return this._cache.data=metas[0].controller.getAllParsedValues(this);for(i=0,ilen=metas.length;i=table[lo].pos&&val<=table[hi].pos&&({lo,hi}=_lookupByKey(table,"pos",val)),({pos:prevSource,time:prevTarget}=table[lo]),({pos:nextSource,time:nextTarget}=table[hi])):(val>=table[lo].time&&val<=table[hi].time&&({lo,hi}=_lookupByKey(table,"time",val)),({time:prevSource,pos:prevTarget}=table[lo]),({time:nextSource,pos:nextTarget}=table[hi]));const span=nextSource-prevSource;return span?prevTarget+(nextTarget-prevTarget)*(val-prevSource)/span:prevTarget}__name(TimeScale,"TimeScale"),TimeScale.id="time",TimeScale.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}},__name(chart_esm_interpolate,"chart_esm_interpolate");class TimeSeriesScale extends TimeScale{constructor(props){super(props),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const timestamps=this._getTimestampsForTable(),table=this._table=this.buildLookupTable(timestamps);this._minPos=chart_esm_interpolate(table,this.min),this._tableRange=chart_esm_interpolate(table,this.max)-this._minPos,super.initOffsets(timestamps)}buildLookupTable(timestamps){const{min,max}=this,items=[],table=[];let i,ilen,prev,curr,next;for(i=0,ilen=timestamps.length;i=min&&curr<=max&&items.push(curr);if(items.length<2)return[{time:min,pos:0},{time:max,pos:1}];for(i=0,ilen=items.length;i__defProp(target,"name",{value,configurable:!0});exports.id=781,exports.ids=[781],exports.modules={90050:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{var RendezvousStates,RendezvousStates2;__webpack_require__.d(__webpack_exports__,{R:()=>RendezvousStates}),(RendezvousStates2=RendezvousStates||(RendezvousStates={})).PENDING="PENDING",RendezvousStates2.APPROVED="APPROVED",RendezvousStates2.FINISHED="FINISHED",RendezvousStates2.CANCELED="CANCELED",RendezvousStates2.DELETED="DELETED"},87781:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{RendezvousModule:()=>RendezvousModule});var common=__webpack_require__(69808),asyncToGenerator=__webpack_require__(15861),rendezvous=__webpack_require__(90050),core=__webpack_require__(5e3),auth_service=__webpack_require__(16518),rendezvous_service=__webpack_require__(64286),ngx_translate_core=__webpack_require__(81981),translating_service=__webpack_require__(57694),table_component=__webpack_require__(6912),rdv_form_component=__webpack_require__(70362);function MyRendezvousComponent_div_1_Template(rf,ctx){if(1&rf){const _r7=core.EpF();core.TgZ(0,"div",4)(1,"div",5)(2,"span",6),core._uU(3),core.ALo(4,"translate"),core.qZA()(),core.TgZ(5,"app-table",7),core.NdJ("updateInfosEvent",__name(function($event){core.CHM(_r7);const ctx_r6=core.oxw();return core.KtG(ctx_r6.showHalfwayPopup($event))},"MyRendezvousComponent_div_1_Template_app_table_updateInfosEvent_5_listener")),core.qZA()()}if(2&rf){const rdvs_r5=ctx.ngIf,ctx_r0=core.oxw();core.xp6(3),core.Oqu(core.lcZ(4,4,"My Approved Rendezvous")),core.xp6(2),core.Q6J("tableCols",ctx_r0.myApprovedRDVsCols)("infos",rdvs_r5)("currentUser",ctx_r0.user)}}function MyRendezvousComponent_div_3_Template(rf,ctx){if(1&rf){const _r10=core.EpF();core.TgZ(0,"div",4)(1,"div",5)(2,"span",6),core._uU(3),core.ALo(4,"translate"),core.qZA()(),core.TgZ(5,"app-table",7),core.NdJ("updateInfosEvent",__name(function($event){core.CHM(_r10);const ctx_r9=core.oxw();return core.KtG(ctx_r9.showHalfwayPopup($event))},"MyRendezvousComponent_div_3_Template_app_table_updateInfosEvent_5_listener")),core.qZA()()}if(2&rf){const rdvs_r8=ctx.ngIf,ctx_r1=core.oxw();core.xp6(3),core.Oqu(core.lcZ(4,4,"My Pending Rendezvous")),core.xp6(2),core.Q6J("tableCols",ctx_r1.myPendingRDVsCols)("infos",rdvs_r8)("currentUser",ctx_r1.user)}}function MyRendezvousComponent_div_5_span_3_Template(rf,ctx){1&rf&&(core.TgZ(0,"span"),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Update or Delete this Rendezvous")))}function MyRendezvousComponent_div_5_span_4_Template(rf,ctx){1&rf&&(core.TgZ(0,"span"),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Update or Call Off this Rendezvous")))}function MyRendezvousComponent_div_5_span_20_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"span"),core._uU(1),core.ALo(2,"translate"),core.TgZ(3,"strong"),core._uU(4),core.qZA()()),2&rf){const ctx_r13=core.oxw(2);core.xp6(1),core.hij("- ",core.lcZ(2,2,"Rendezvous Date:")," "),core.xp6(3),core.Oqu(null==ctx_r13.rdv?null:ctx_r13.rdv.rdvDate)}}function MyRendezvousComponent_div_5_button_25_Template(rf,ctx){if(1&rf){const _r18=core.EpF();core.TgZ(0,"button",19),core.NdJ("click",__name(function(){core.CHM(_r18);const ctx_r17=core.oxw(2);return core.KtG(ctx_r17.deleteRendezvous())},"MyRendezvousComponent_div_5_button_25_Template_button_click_0_listener")),core._uU(1),core.ALo(2,"translate"),core.qZA()}2&rf&&(core.xp6(1),core.hij(" ",core.lcZ(2,1,"Delete Rendezvous")," "))}function MyRendezvousComponent_div_5_button_26_Template(rf,ctx){if(1&rf){const _r20=core.EpF();core.TgZ(0,"button",19),core.NdJ("click",__name(function(){core.CHM(_r20);const ctx_r19=core.oxw(2);return core.KtG(ctx_r19.cancelRendezvous())},"MyRendezvousComponent_div_5_button_26_Template_button_click_0_listener")),core._uU(1),core.ALo(2,"translate"),core.qZA()}2&rf&&(core.xp6(1),core.hij(" ",core.lcZ(2,1,"Call Off Rendezvous")," "))}function MyRendezvousComponent_div_5_div_27_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"div",20),core._uU(1),core.qZA()),2&rf){const ctx_r16=core.oxw(2);core.xp6(1),core.hij(" ",ctx_r16.errMsg," ")}}function MyRendezvousComponent_div_5_Template(rf,ctx){if(1&rf){const _r22=core.EpF();core.TgZ(0,"div",8)(1,"div",9)(2,"div",10),core.YNc(3,MyRendezvousComponent_div_5_span_3_Template,3,3,"span",11),core.YNc(4,MyRendezvousComponent_div_5_span_4_Template,3,3,"span",11),core.qZA(),core.TgZ(5,"div",12),core.NdJ("click",__name(function(){core.CHM(_r22);const ctx_r21=core.oxw();return core.KtG(ctx_r21.hidePopup())},"MyRendezvousComponent_div_5_Template_div_click_5_listener")),core.ALo(6,"translate"),core._uU(7," \xd7 "),core.qZA()(),core.TgZ(8,"div",13)(9,"div",14),core._uU(10),core.ALo(11,"translate"),core.TgZ(12,"strong"),core._uU(13),core.qZA(),core._UZ(14,"br"),core._uU(15),core.ALo(16,"translate"),core.TgZ(17,"strong"),core._uU(18),core.qZA(),core._UZ(19,"br"),core.YNc(20,MyRendezvousComponent_div_5_span_20_Template,5,4,"span",11),core.qZA(),core.TgZ(21,"div",15)(22,"button",16),core.NdJ("click",__name(function(){core.CHM(_r22);const ctx_r23=core.oxw();return core.KtG(ctx_r23.proceedToUpdate())},"MyRendezvousComponent_div_5_Template_button_click_22_listener")),core._uU(23),core.ALo(24,"translate"),core.qZA(),core.YNc(25,MyRendezvousComponent_div_5_button_25_Template,3,3,"button",17),core.YNc(26,MyRendezvousComponent_div_5_button_26_Template,3,3,"button",17),core.qZA(),core.YNc(27,MyRendezvousComponent_div_5_div_27_Template,2,1,"div",18),core.qZA()()}if(2&rf){const ctx_r2=core.oxw();core.xp6(3),core.Q6J("ngIf",ctx_r2.isPending),core.xp6(1),core.Q6J("ngIf",ctx_r2.isApproved),core.xp6(1),core.s9C("title",core.lcZ(6,12,"Cancel")),core.xp6(5),core.hij(" - ",core.lcZ(11,14,"Name:")," "),core.xp6(3),core.Oqu(null==ctx_r2.rdv?null:ctx_r2.rdv.displayName),core.xp6(2),core.hij(" - ",core.lcZ(16,16,"Created in:")," "),core.xp6(3),core.Oqu(null==ctx_r2.rdv?null:ctx_r2.rdv.createdAt),core.xp6(2),core.Q6J("ngIf",ctx_r2.isApproved),core.xp6(3),core.hij(" ",core.lcZ(24,18,"Update Rendezvous")," "),core.xp6(2),core.Q6J("ngIf",ctx_r2.isPending),core.xp6(1),core.Q6J("ngIf",ctx_r2.isApproved),core.xp6(1),core.Q6J("ngIf",ctx_r2.errMsg)}}function MyRendezvousComponent_div_6_div_10_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"div",20),core._uU(1),core.qZA()),2&rf){const ctx_r24=core.oxw(2);core.xp6(1),core.hij(" ",ctx_r24.errMsg," ")}}function MyRendezvousComponent_div_6_Template(rf,ctx){if(1&rf){const _r26=core.EpF();core.TgZ(0,"div",8)(1,"div",9)(2,"div",10),core._uU(3),core.ALo(4,"translate"),core.qZA(),core.TgZ(5,"div",12),core.NdJ("click",__name(function(){core.CHM(_r26);const ctx_r25=core.oxw();return core.KtG(ctx_r25.hidePopup())},"MyRendezvousComponent_div_6_Template_div_click_5_listener")),core.ALo(6,"translate"),core._uU(7," \xd7 "),core.qZA()(),core.TgZ(8,"div",13)(9,"app-rdv-form",21),core.NdJ("rdvFormValue",__name(function($event){core.CHM(_r26);const ctx_r27=core.oxw();return core.KtG(ctx_r27.updateRendezvous($event))},"MyRendezvousComponent_div_6_Template_app_rdv_form_rdvFormValue_9_listener")),core.qZA(),core.YNc(10,MyRendezvousComponent_div_6_div_10_Template,2,1,"div",18),core.qZA()()}if(2&rf){const ctx_r3=core.oxw();core.xp6(3),core.hij(" ",core.lcZ(4,4,"Updating Rendezvous")," "),core.xp6(2),core.s9C("title",core.lcZ(6,6,"Cancel")),core.xp6(4),core.Q6J("rdv",ctx_r3.rdv),core.xp6(1),core.Q6J("ngIf",ctx_r3.errMsg)}}function MyRendezvousComponent_div_7_Template(rf,ctx){if(1&rf){const _r29=core.EpF();core.TgZ(0,"div",22),core.NdJ("click",__name(function(){core.CHM(_r29);const ctx_r28=core.oxw();return core.KtG(ctx_r28.hidePopup())},"MyRendezvousComponent_div_7_Template_div_click_0_listener")),core.qZA()}}__name(MyRendezvousComponent_div_1_Template,"MyRendezvousComponent_div_1_Template"),__name(MyRendezvousComponent_div_3_Template,"MyRendezvousComponent_div_3_Template"),__name(MyRendezvousComponent_div_5_span_3_Template,"MyRendezvousComponent_div_5_span_3_Template"),__name(MyRendezvousComponent_div_5_span_4_Template,"MyRendezvousComponent_div_5_span_4_Template"),__name(MyRendezvousComponent_div_5_span_20_Template,"MyRendezvousComponent_div_5_span_20_Template"),__name(MyRendezvousComponent_div_5_button_25_Template,"MyRendezvousComponent_div_5_button_25_Template"),__name(MyRendezvousComponent_div_5_button_26_Template,"MyRendezvousComponent_div_5_button_26_Template"),__name(MyRendezvousComponent_div_5_div_27_Template,"MyRendezvousComponent_div_5_div_27_Template"),__name(MyRendezvousComponent_div_5_Template,"MyRendezvousComponent_div_5_Template"),__name(MyRendezvousComponent_div_6_div_10_Template,"MyRendezvousComponent_div_6_div_10_Template"),__name(MyRendezvousComponent_div_6_Template,"MyRendezvousComponent_div_6_Template"),__name(MyRendezvousComponent_div_7_Template,"MyRendezvousComponent_div_7_Template");class MyRendezvousComponent{constructor(authService,rdvService,translate,translatingService){this.authService=authService,this.rdvService=rdvService,this.translate=translate,this.translatingService=translatingService,this.myApprovedRDVsCols=this.translatingService.getApprovedRDVsCols(),this.myPendingRDVsCols=this.translatingService.getPendingRDVsCols(),this.halfwayPopup=!1,this.updatePopup=!1,this.errMsg=""}ngOnInit(){this.authService.getUser().subscribe(usr=>{this.user=usr,this.user.email&&(this.myApprovedRDVs=this.rdvService.getRDVsByEmailAndState(this.user.email,rendezvous.R.APPROVED,"rdvDate"),this.myPendingRDVs=this.rdvService.getRDVsByEmailAndState(this.user.email,rendezvous.R.PENDING,"createdAt"))})}showHalfwayPopup(data){this.rdv=data,this.halfwayPopup=!0}proceedToUpdate(){this.halfwayPopup=!1,this.updatePopup=!0}get isPending(){var _a;return(null===(_a=this.rdv)||void 0===_a?void 0:_a.rdvState)===rendezvous.R.PENDING}get isApproved(){var _a;return(null===(_a=this.rdv)||void 0===_a?void 0:_a.rdvState)===rendezvous.R.APPROVED}updateRendezvous(data){var _this=this;return(0,asyncToGenerator.Z)(function*(){var _a;if(null===(_a=_this.rdv)||void 0===_a||!_a.rdvID)return _this.errMsg="Rendezvous not found";if(data.displayName===_this.rdv.displayName&&data.phoneNumber===_this.rdv.phoneNumber)return _this.hidePopup();try{return yield _this.rdvService.updateRendezvous(_this.rdv.rdvID,data),_this.hidePopup()}catch(error){_this.errMsg=error}})()}deleteRendezvous(){var _this2=this;return(0,asyncToGenerator.Z)(function*(){var _a;if(null===(_a=_this2.rdv)||void 0===_a||!_a.rdvID)return _this2.errMsg="Rendezvous ID not found";if(confirm(_this2.translatingService.getDeleteConfirmMsg(_this2.rdv)))try{return yield _this2.rdvService.deleteRendezvous(_this2.rdv.rdvID,_this2.rdv,_this2.user),_this2.hidePopup()}catch(error){_this2.errMsg=error}})()}cancelRendezvous(){var _this3=this;return(0,asyncToGenerator.Z)(function*(){var _a;if(null===(_a=_this3.rdv)||void 0===_a||!_a.rdvID)return _this3.errMsg="Rendezvous ID not found";if(confirm(_this3.translatingService.getCancelConfirmMsg(_this3.rdv))){_this3.rdv.rdvState=rendezvous.R.CANCELED;try{return yield _this3.rdvService.cancelRendezvous(_this3.rdv.rdvID,_this3.rdv,_this3.user),_this3.hidePopup()}catch(error){_this3.errMsg=error}}})()}hidePopup(){this.halfwayPopup=!1,this.updatePopup=!1,this.rdv=null,this.errMsg=""}}__name(MyRendezvousComponent,"MyRendezvousComponent"),MyRendezvousComponent.\u0275fac=__name(function(t){return new(t||MyRendezvousComponent)(core.Y36(auth_service.e),core.Y36(rendezvous_service.b),core.Y36(ngx_translate_core.sK),core.Y36(translating_service.o))},"MyRendezvousComponent_Factory"),MyRendezvousComponent.\u0275cmp=core.Xpm({type:MyRendezvousComponent,selectors:[["app-my-rendezvous"]],decls:8,vars:9,consts:[[1,"my-rdvs-container"],["class","facebook-style table-container",4,"ngIf"],["class","popup-modal facebook-style",4,"ngIf"],["class","overlay",3,"click",4,"ngIf"],[1,"facebook-style","table-container"],[1,"t-title-container"],[1,"t-title"],[3,"tableCols","infos","currentUser","updateInfosEvent"],[1,"popup-modal","facebook-style"],[1,"popup-modal-header"],[1,"title"],[4,"ngIf"],[1,"close-btn",3,"title","click"],[1,"popup-modal-body"],[2,"margin","15px 0 30px 0"],[1,"btns-container"],[1,"btn","btn-primary",3,"click"],["class","btn btn-danger",3,"click",4,"ngIf"],["class","alert alert-danger",4,"ngIf"],[1,"btn","btn-danger",3,"click"],[1,"alert","alert-danger"],[3,"rdv","rdvFormValue"],[1,"overlay",3,"click"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0),core.YNc(1,MyRendezvousComponent_div_1_Template,6,6,"div",1),core.ALo(2,"async"),core.YNc(3,MyRendezvousComponent_div_3_Template,6,6,"div",1),core.ALo(4,"async"),core.YNc(5,MyRendezvousComponent_div_5_Template,28,20,"div",2),core.YNc(6,MyRendezvousComponent_div_6_Template,11,8,"div",2),core.YNc(7,MyRendezvousComponent_div_7_Template,1,0,"div",3),core.qZA()),2&rf&&(core.xp6(1),core.Q6J("ngIf",core.lcZ(2,5,ctx.myApprovedRDVs)),core.xp6(2),core.Q6J("ngIf",core.lcZ(4,7,ctx.myPendingRDVs)),core.xp6(2),core.Q6J("ngIf",ctx.halfwayPopup),core.xp6(1),core.Q6J("ngIf",ctx.updatePopup),core.xp6(1),core.Q6J("ngIf",ctx.halfwayPopup||ctx.updatePopup))},"MyRendezvousComponent_Template"),dependencies:[common.O5,table_component.a,rdv_form_component.X,common.Ov,ngx_translate_core.X$],styles:[".my-rdvs-container[_ngcontent-%COMP%]{position:relative;width:100%;min-height:100vh;padding:15px}.btns-container[_ngcontent-%COMP%]{margin-top:15px;display:grid;grid-template-columns:1fr 1fr;gap:15px}"]});var router=__webpack_require__(74202);function RendezvousComponent_div_7_Template(rf,ctx){if(1&rf){const _r5=core.EpF();core.TgZ(0,"div",8)(1,"div",9)(2,"span",10),core._uU(3),core.ALo(4,"translate"),core.qZA()(),core.TgZ(5,"app-table",11),core.NdJ("updateInfosEvent",__name(function($event){core.CHM(_r5);const ctx_r4=core.oxw();return core.KtG(ctx_r4.proceedToUpdate($event))},"RendezvousComponent_div_7_Template_app_table_updateInfosEvent_5_listener")),core.qZA(),core.TgZ(6,"div",12)(7,"button",13),core.NdJ("click",__name(function(){core.CHM(_r5);const ctx_r6=core.oxw();return core.KtG(ctx_r6.onPreviousBtn())},"RendezvousComponent_div_7_Template_button_click_7_listener")),core._uU(8,"Previous Page"),core.qZA(),core.TgZ(9,"button",14),core.NdJ("click",__name(function(){core.CHM(_r5);const ctx_r7=core.oxw();return core.KtG(ctx_r7.onNextBtn())},"RendezvousComponent_div_7_Template_button_click_9_listener")),core._uU(10,"Next Page"),core.qZA()()()}if(2&rf){const RDVs_r3=ctx.ngIf,ctx_r0=core.oxw();core.xp6(3),core.Oqu(core.lcZ(4,5,"Approved Rendezvous")),core.xp6(2),core.Q6J("tableCols",ctx_r0.rdvCol)("infos",RDVs_r3)("showBtns",!1)("currentUser",ctx_r0.user)}}function RendezvousComponent_div_9_span_3_Template(rf,ctx){1&rf&&(core.TgZ(0,"span"),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Create New Rendezvous")))}function RendezvousComponent_div_9_span_4_Template(rf,ctx){1&rf&&(core.TgZ(0,"span"),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Update Rendezvous")))}function RendezvousComponent_div_9_p_10_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"p",23),core._uU(1),core.qZA()),2&rf){const ctx_r10=core.oxw(2);core.xp6(1),core.Oqu(ctx_r10.formErrorMsg)}}function RendezvousComponent_div_9_Template(rf,ctx){if(1&rf){const _r12=core.EpF();core.TgZ(0,"div",15)(1,"div",16)(2,"div",17),core.YNc(3,RendezvousComponent_div_9_span_3_Template,3,3,"span",18),core.YNc(4,RendezvousComponent_div_9_span_4_Template,3,3,"span",18),core.qZA(),core.TgZ(5,"div",19),core.NdJ("click",__name(function(){core.CHM(_r12);const ctx_r11=core.oxw();return core.KtG(ctx_r11.hidePopup())},"RendezvousComponent_div_9_Template_div_click_5_listener")),core.ALo(6,"translate"),core._uU(7," \xd7 "),core.qZA()(),core.TgZ(8,"div",20)(9,"app-rdv-form",21),core.NdJ("rdvFormValue",__name(function($event){core.CHM(_r12);const ctx_r13=core.oxw();return core.KtG(ctx_r13.submitRDVform($event))},"RendezvousComponent_div_9_Template_app_rdv_form_rdvFormValue_9_listener")),core.qZA(),core.YNc(10,RendezvousComponent_div_9_p_10_Template,2,1,"p",22),core.qZA()()}if(2&rf){const ctx_r1=core.oxw();core.xp6(3),core.Q6J("ngIf",!ctx_r1.rdv),core.xp6(1),core.Q6J("ngIf",ctx_r1.rdv),core.xp6(1),core.s9C("title",core.lcZ(6,6,"Cancel")),core.xp6(4),core.Q6J("rdv",ctx_r1.rdv)("showDeleteBtn",!1),core.xp6(1),core.Q6J("ngIf",ctx_r1.formErrorMsg)}}function RendezvousComponent_div_10_Template(rf,ctx){if(1&rf){const _r15=core.EpF();core.TgZ(0,"div",24),core.NdJ("click",__name(function(){core.CHM(_r15);const ctx_r14=core.oxw();return core.KtG(ctx_r14.hidePopup())},"RendezvousComponent_div_10_Template_div_click_0_listener")),core.qZA()}}__name(RendezvousComponent_div_7_Template,"RendezvousComponent_div_7_Template"),__name(RendezvousComponent_div_9_span_3_Template,"RendezvousComponent_div_9_span_3_Template"),__name(RendezvousComponent_div_9_span_4_Template,"RendezvousComponent_div_9_span_4_Template"),__name(RendezvousComponent_div_9_p_10_Template,"RendezvousComponent_div_9_p_10_Template"),__name(RendezvousComponent_div_9_Template,"RendezvousComponent_div_9_Template"),__name(RendezvousComponent_div_10_Template,"RendezvousComponent_div_10_Template");class RendezvousComponent{constructor(authService,rdvService,translatingService){this.authService=authService,this.rdvService=rdvService,this.translatingService=translatingService,this.rdvCol=this.translatingService.getApprovedRDVsCols(),this.showForm=!1,this.formErrorMsg="",this.rdv=null}ngOnInit(){this.approvedRDVs=this.rdvService.getRDVsByState(rendezvous.R.APPROVED,"rdvDate","BEGINNING"),this.authService.getUser().subscribe(value=>{this.user=value}),this.setLastDoc()}onNextBtn(){this.rdvService.getDocByID(this.lastDoc.id).get().subscribe(ds=>{this.approvedRDVs=this.rdvService.getRDVsByState(rendezvous.R.APPROVED,"rdvDate","NEXT",ds),this.setLastDoc(),this.setFirstDoc()})}onPreviousBtn(){this.rdvService.getDocByID(this.firstDoc.id).get().subscribe(ds=>{this.approvedRDVs=this.rdvService.getRDVsByState(rendezvous.R.APPROVED,"rdvDate","PREVIOUS",ds),this.setLastDoc(),this.setFirstDoc()})}setLastDoc(){this.approvedRDVs.subscribe(rdvs=>{let lastRDV=rdvs[rdvs.length-1];this.rdvService.getDocByID(lastRDV.rdvID).snapshotChanges().subscribe(doc=>this.lastDoc=doc.payload)})}setFirstDoc(){this.approvedRDVs.subscribe(rdvs=>{let firstRDV=rdvs[0];this.rdvService.getDocByID(firstRDV.rdvID).snapshotChanges().subscribe(doc=>this.firstDoc=doc.payload)})}proceedToUpdate(data){this.rdv=data,this.showForm=!0}showPopup(){this.showForm=!0}hidePopup(){this.showForm=!1,this.formErrorMsg="",this.rdv=null}submitRDVform(data){var _this=this;return(0,asyncToGenerator.Z)(function*(){var _a,_b;if(_this.user.email){if(null===(_a=_this.rdv)||void 0===_a||!_a.rdvID)try{yield _this.rdvService.createRendezvous(data,_this.user)}catch(error){_this.formErrorMsg=error}if(null!==(_b=_this.rdv)&&void 0!==_b&&_b.rdvID)try{yield _this.rdvService.updateRendezvous(_this.rdv.rdvID,data)}catch(error){_this.formErrorMsg=error}_this.hidePopup()}else _this.formErrorMsg="You need Email to create new Rendezvous!"})()}}__name(RendezvousComponent,"RendezvousComponent"),RendezvousComponent.\u0275fac=__name(function(t){return new(t||RendezvousComponent)(core.Y36(auth_service.e),core.Y36(rendezvous_service.b),core.Y36(translating_service.o))},"RendezvousComponent_Factory"),RendezvousComponent.\u0275cmp=core.Xpm({type:RendezvousComponent,selectors:[["app-rendezvous"]],decls:11,vars:8,consts:[[1,"rdv-container"],[1,"newRDV-btn-container"],[1,"btn","btn-success",3,"click"],[1,"far","fa-calendar-plus"],[2,"margin-left","7px"],["class","facebook-style table-container rdv-table",4,"ngIf"],["class","popup-modal facebook-style",4,"ngIf"],["class","overlay",3,"click",4,"ngIf"],[1,"facebook-style","table-container","rdv-table"],[1,"t-title-container"],[1,"t-title"],[3,"tableCols","infos","showBtns","currentUser","updateInfosEvent"],[2,"margin","5px","text-align","center"],[1,"btn","btn-info",3,"click"],[1,"btn","btn-info",2,"margin-left","5px",3,"click"],[1,"popup-modal","facebook-style"],[1,"popup-modal-header"],[1,"title"],[4,"ngIf"],[1,"close-btn",3,"title","click"],[1,"popup-modal-body"],[3,"rdv","showDeleteBtn","rdvFormValue"],["class","text-danger",4,"ngIf"],[1,"text-danger"],[1,"overlay",3,"click"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0)(1,"div",1)(2,"button",2),core.NdJ("click",__name(function(){return ctx.showPopup()},"RendezvousComponent_Template_button_click_2_listener")),core._UZ(3,"i",3),core.TgZ(4,"span",4),core._uU(5),core.ALo(6,"translate"),core.qZA()()(),core.YNc(7,RendezvousComponent_div_7_Template,11,7,"div",5),core.ALo(8,"async"),core.YNc(9,RendezvousComponent_div_9_Template,11,8,"div",6),core.YNc(10,RendezvousComponent_div_10_Template,1,0,"div",7),core.qZA()),2&rf&&(core.xp6(5),core.Oqu(core.lcZ(6,4,"New Rendezvous")),core.xp6(2),core.Q6J("ngIf",core.lcZ(8,6,ctx.approvedRDVs)),core.xp6(2),core.Q6J("ngIf",ctx.showForm),core.xp6(1),core.Q6J("ngIf",ctx.showForm))},"RendezvousComponent_Template"),dependencies:[common.O5,table_component.a,rdv_form_component.X,common.Ov,ngx_translate_core.X$],styles:[".rdv-container[_ngcontent-%COMP%]{position:relative;padding:15px;margin:0 auto;min-width:300px;max-width:90%}.newRDV-btn-container[_ngcontent-%COMP%]{margin-bottom:15px}.newRDV-btn-container[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{box-shadow:0 0 11px #0006}.rdv-table[_ngcontent-%COMP%]{max-width:100%!important}@media screen and (max-width: 950px){.rdv-container[_ngcontent-%COMP%]{max-width:100%}}"]});var auth_guard=__webpack_require__(36471);const routes=[{path:"",component:RendezvousComponent,canActivate:[auth_guard.a]},{path:"my-rendezvous",component:MyRendezvousComponent,canActivate:[auth_guard.a]}];class RendezvousRoutingModule{}__name(RendezvousRoutingModule,"RendezvousRoutingModule"),RendezvousRoutingModule.\u0275fac=__name(function(t){return new(t||RendezvousRoutingModule)},"RendezvousRoutingModule_Factory"),RendezvousRoutingModule.\u0275mod=core.oAB({type:RendezvousRoutingModule}),RendezvousRoutingModule.\u0275inj=core.cJS({imports:[router.Bz.forChild(routes),router.Bz]});var shared_module=__webpack_require__(83436);class RendezvousModule{}__name(RendezvousModule,"RendezvousModule"),RendezvousModule.\u0275fac=__name(function(t){return new(t||RendezvousModule)},"RendezvousModule_Factory"),RendezvousModule.\u0275mod=core.oAB({type:RendezvousModule}),RendezvousModule.\u0275inj=core.cJS({imports:[common.ez,RendezvousRoutingModule,shared_module.m]})},64286:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>RendezvousService});var _home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(15861),_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(90050),rxjs__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(76477),_angular_core__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(5e3),_angular_fire_compat_firestore__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(54223),_translating_service__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(57694);class RendezvousService{constructor(fireStore,translatingService){this.fireStore=fireStore,this.translatingService=translatingService}createRendezvous(rdv,currentUser){var _this=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){if(!currentUser.email)throw"You need Email to create new Rendezvous!";return rdv.createdAt=new Date,rdv.createdBy=currentUser.email,rdv.rdvState=_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__.R.PENDING,yield _this.fireStore.collection("Rendezvous").add(rdv)})()}deleteRendezvous(id,rdv,user){var _this2=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){return rdv.createdAt=new Date(rdv.createdAt),rdv.lastUpdate&&"Not Updated"!==rdv.lastUpdate&&(rdv.lastUpdate=new Date(rdv.lastUpdate)),rdv.rdvState=_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__.R.DELETED,rdv.deletedAt=new Date,rdv.deletedBy=user.email,yield _this2.fireStore.collection("Rendezvous").doc(id).update(rdv)})()}updateRendezvous(id,rdv){var _this3=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){return rdv.lastUpdate=new Date,yield _this3.fireStore.collection("Rendezvous").doc(id).update(rdv)})()}approveRendezvous(id,rdv,user){var _this4=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){return rdv.createdAt=new Date(rdv.createdAt),rdv.lastUpdate&&"Not Updated"!==rdv.lastUpdate&&(rdv.lastUpdate=new Date(rdv.lastUpdate)),rdv.rdvState=_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__.R.APPROVED,rdv.approvedAt=new Date,rdv.approvedBy=user.email,yield _this4.fireStore.collection("Rendezvous").doc(id).update(rdv)})()}finishRendezvous(id,rdv){var _this5=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){return rdv.createdAt=new Date(rdv.createdAt),rdv.lastUpdate&&"Not Updated"!==rdv.lastUpdate&&(rdv.lastUpdate=new Date(rdv.lastUpdate)),rdv.approvedAt&&(rdv.approvedAt=new Date(rdv.approvedAt)),rdv.rdvDate&&(rdv.rdvDate=new Date(rdv.rdvDate)),rdv.rdvState=_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__.R.FINISHED,rdv.finishedAt=new Date,yield _this5.fireStore.collection("Rendezvous").doc(id).update(rdv)})()}cancelRendezvous(id,rdv,user){var _this6=this;return(0,_home_redouane_Documents_coding_development_ANGULAR_projects_new_rdv_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__.Z)(function*(){return rdv.createdAt=new Date(rdv.createdAt),rdv.lastUpdate&&"Not Updated"!==rdv.lastUpdate&&(rdv.lastUpdate=new Date(rdv.lastUpdate)),rdv.approvedAt&&(rdv.approvedAt=new Date(rdv.approvedAt)),rdv.rdvDate&&(rdv.rdvDate=new Date(rdv.rdvDate)),rdv.rdvState=_models_rendezvous__WEBPACK_IMPORTED_MODULE_0__.R.CANCELED,rdv.canceledAt=new Date,rdv.canceledBy=user.email,yield _this6.fireStore.collection("Rendezvous").doc(id).update(rdv)})()}getRDVsByState(stateOfRDV,orderBy,type,paginationDoc){return this.fireStore.collection("Rendezvous",ref=>{const queries=ref.where("rdvState","==",stateOfRDV).orderBy(orderBy).limit(5);return"NEXT"===type?queries.startAfter(paginationDoc):"PREVIOUS"===type?queries.endBefore(paginationDoc):queries}).snapshotChanges().pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_3__.map)(values=>{let i=1;return values.map(rdv=>{const load=rdv.payload.doc.data();return{...load,rdvID:rdv.payload.doc.id,createdAt:this.translatingService.convertToDateString(load.createdAt),lastUpdate:this.getLastUpdate(load.lastUpdate),rdvDate:load.rdvDate?this.translatingService.convertToDateString(load.rdvDate):void 0,approvedAt:load.approvedAt?this.translatingService.convertToDateString(load.approvedAt):void 0,finishedAt:load.finishedAt?this.translatingService.convertToDateString(load.finishedAt):void 0,canceledAt:load.canceledAt?this.translatingService.convertToDateString(load.canceledAt):void 0,deletedAt:load.deletedAt?this.translatingService.convertToDateString(load.deletedAt):void 0,order:i++}})}))}getRDVsByEmailAndState(usrMail,stateOfRDV,orderBy){return this.fireStore.collection("Rendezvous",ref=>ref.where("createdBy","==",usrMail).where("rdvState","==",stateOfRDV).orderBy(orderBy)).snapshotChanges().pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_3__.map)(values=>{let i=1;return values.map(rdv=>{const load=rdv.payload.doc.data();return{...load,rdvID:rdv.payload.doc.id,createdAt:this.translatingService.convertToDateString(load.createdAt),lastUpdate:this.getLastUpdate(load.lastUpdate),rdvDate:load.rdvDate?this.translatingService.convertToDateString(load.rdvDate):void 0,approvedAt:load.approvedAt?this.translatingService.convertToDateString(load.approvedAt):void 0,finishedAt:load.finishedAt?this.translatingService.convertToDateString(load.finishedAt):void 0,canceledAt:load.canceledAt?this.translatingService.convertToDateString(load.canceledAt):void 0,deletedAt:load.deletedAt?this.translatingService.convertToDateString(load.deletedAt):void 0,order:i++}})}))}getAllRendezvous(){return this.fireStore.collection("Rendezvous",ref=>ref.orderBy("createdAt")).snapshotChanges().pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_3__.map)(values=>{let i=1;return values.map(rdv=>{const load=rdv.payload.doc.data();return{...load,rdvID:rdv.payload.doc.id,createdAt:this.translatingService.convertToDateString(load.createdAt),lastUpdate:this.getLastUpdate(load.lastUpdate),rdvDate:load.rdvDate?this.translatingService.convertToDateString(load.rdvDate):void 0,approvedAt:load.approvedAt?this.translatingService.convertToDateString(load.approvedAt):void 0,finishedAt:load.finishedAt?this.translatingService.convertToDateString(load.finishedAt):void 0,canceledAt:load.canceledAt?this.translatingService.convertToDateString(load.canceledAt):void 0,deletedAt:load.deletedAt?this.translatingService.convertToDateString(load.deletedAt):void 0,order:i++}})}))}getDocByID(docID){return this.fireStore.collection("Rendezvous").doc(docID)}getLastUpdate(param){return param&&"Not Updated"!==param?this.translatingService.convertToDateString(param):"Not Updated"}}__name(RendezvousService,"RendezvousService"),RendezvousService.\u0275fac=__name(function(t){return new(t||RendezvousService)(_angular_core__WEBPACK_IMPORTED_MODULE_4__.LFG(_angular_fire_compat_firestore__WEBPACK_IMPORTED_MODULE_5__.ST),_angular_core__WEBPACK_IMPORTED_MODULE_4__.LFG(_translating_service__WEBPACK_IMPORTED_MODULE_1__.o))},"RendezvousService_Factory"),RendezvousService.\u0275prov=_angular_core__WEBPACK_IMPORTED_MODULE_4__.Yz7({token:RendezvousService,factory:RendezvousService.\u0275fac,providedIn:"root"})},70362:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{X:()=>RdvFormComponent});var _angular_core__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5e3),_angular_forms__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(93075),_angular_common__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(69808),_ngx_translate_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(81981);function RdvFormComponent_p_4_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"p",10),_angular_core__WEBPACK_IMPORTED_MODULE_0__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(2,1,"invalid name")))}function RdvFormComponent_p_8_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"p",10),_angular_core__WEBPACK_IMPORTED_MODULE_0__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(2,1,"Phone Number must contain 10 digit numbers")))}function RdvFormComponent_span_11_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"span"),_angular_core__WEBPACK_IMPORTED_MODULE_0__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(2,1,"Add Rendezvous")))}function RdvFormComponent_span_12_Template(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"span"),_angular_core__WEBPACK_IMPORTED_MODULE_0__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(2,1,"Update Rendezvous")))}function RdvFormComponent_button_13_Template(rf,ctx){if(1&rf){const _r6=_angular_core__WEBPACK_IMPORTED_MODULE_0__.EpF();_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"button",11),_angular_core__WEBPACK_IMPORTED_MODULE_0__.NdJ("click",__name(function(){_angular_core__WEBPACK_IMPORTED_MODULE_0__.CHM(_r6);const ctx_r5=_angular_core__WEBPACK_IMPORTED_MODULE_0__.oxw();return _angular_core__WEBPACK_IMPORTED_MODULE_0__.KtG(ctx_r5.deleteRDV())},"RdvFormComponent_button_13_Template_button_click_0_listener")),_angular_core__WEBPACK_IMPORTED_MODULE_0__._uU(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(2,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()}2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Oqu(_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(2,1,"Delete Rendezvous")))}__name(RdvFormComponent_p_4_Template,"RdvFormComponent_p_4_Template"),__name(RdvFormComponent_p_8_Template,"RdvFormComponent_p_8_Template"),__name(RdvFormComponent_span_11_Template,"RdvFormComponent_span_11_Template"),__name(RdvFormComponent_span_12_Template,"RdvFormComponent_span_12_Template"),__name(RdvFormComponent_button_13_Template,"RdvFormComponent_button_13_Template");const _c0=__name(function(a0){return{"full-width-btn":a0}},"_c0");class RdvFormComponent{constructor(formBuilder){this.formBuilder=formBuilder,this.rdvFormValue=new _angular_core__WEBPACK_IMPORTED_MODULE_0__.vpe,this.deleteRDVid=new _angular_core__WEBPACK_IMPORTED_MODULE_0__.vpe}ngOnInit(){var _a;this.rdvID=null===(_a=this.rdv)||void 0===_a?void 0:_a.rdvID,this.initForm()}initForm(){var _a,_b;const nameInput=null===(_a=this.rdv)||void 0===_a?void 0:_a.displayName,mobileInput=null===(_b=this.rdv)||void 0===_b?void 0:_b.phoneNumber;this.rdvform=this.formBuilder.group({displayName:[nameInput,[_angular_forms__WEBPACK_IMPORTED_MODULE_1__.kI.required,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.kI.pattern(/.*\S.*/)]],phoneNumber:[mobileInput,[_angular_forms__WEBPACK_IMPORTED_MODULE_1__.kI.required,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.kI.pattern(/^(\+213|0)?[0-9]{9}$/)]]})}submitForm(){this.rdvform.invalid||this.rdvFormValue.emit(this.rdvform.value)}deleteRDV(){this.deleteRDVid.emit(this.rdvID)}}__name(RdvFormComponent,"RdvFormComponent"),RdvFormComponent.\u0275fac=__name(function(t){return new(t||RdvFormComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Y36(_angular_forms__WEBPACK_IMPORTED_MODULE_1__.QS))},"RdvFormComponent_Factory"),RdvFormComponent.\u0275cmp=_angular_core__WEBPACK_IMPORTED_MODULE_0__.Xpm({type:RdvFormComponent,selectors:[["app-rdv-form"]],inputs:{rdv:"rdv",showDeleteBtn:"showDeleteBtn"},outputs:{rdvFormValue:"rdvFormValue",deleteRDVid:"deleteRDVid"},decls:14,vars:16,consts:[[1,"form",3,"formGroup"],[1,"name-div"],["type","text","formControlName","displayName",1,"input-form",3,"placeholder"],["class","danger-msg",4,"ngIf"],[1,"mobile-div"],["type","tel","formControlName","phoneNumber",1,"input-form",3,"placeholder"],[1,"btns-container"],[1,"btn","btn-success",3,"disabled","ngClass","click"],[4,"ngIf"],["class","btn btn-danger",3,"click",4,"ngIf"],[1,"danger-msg"],[1,"btn","btn-danger",3,"click"]],template:__name(function(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(0,"form",0)(1,"div",1),_angular_core__WEBPACK_IMPORTED_MODULE_0__._UZ(2,"input",2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(3,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.YNc(4,RdvFormComponent_p_4_Template,3,3,"p",3),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(5,"div",4),_angular_core__WEBPACK_IMPORTED_MODULE_0__._UZ(6,"input",5),_angular_core__WEBPACK_IMPORTED_MODULE_0__.ALo(7,"translate"),_angular_core__WEBPACK_IMPORTED_MODULE_0__.YNc(8,RdvFormComponent_p_8_Template,3,3,"p",3),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_0__.TgZ(9,"div",6)(10,"button",7),_angular_core__WEBPACK_IMPORTED_MODULE_0__.NdJ("click",__name(function(){return ctx.submitForm()},"RdvFormComponent_Template_button_click_10_listener")),_angular_core__WEBPACK_IMPORTED_MODULE_0__.YNc(11,RdvFormComponent_span_11_Template,3,3,"span",8),_angular_core__WEBPACK_IMPORTED_MODULE_0__.YNc(12,RdvFormComponent_span_12_Template,3,3,"span",8),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA(),_angular_core__WEBPACK_IMPORTED_MODULE_0__.YNc(13,RdvFormComponent_button_13_Template,3,3,"button",9),_angular_core__WEBPACK_IMPORTED_MODULE_0__.qZA()()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("formGroup",ctx.rdvform),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.s9C("placeholder",_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(3,10,"Enter a name")),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("ngIf",ctx.rdvform.controls.displayName.touched&&ctx.rdvform.controls.displayName.invalid),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.s9C("placeholder",_angular_core__WEBPACK_IMPORTED_MODULE_0__.lcZ(7,12,"Phone Number")),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("ngIf",ctx.rdvform.controls.phoneNumber.touched&&ctx.rdvform.controls.phoneNumber.invalid),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(2),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("disabled",ctx.rdvform.invalid)("ngClass",_angular_core__WEBPACK_IMPORTED_MODULE_0__.VKq(14,_c0,!ctx.rdvID||!ctx.showDeleteBtn)),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("ngIf",!ctx.rdvID),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("ngIf",ctx.rdvID),_angular_core__WEBPACK_IMPORTED_MODULE_0__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_0__.Q6J("ngIf",ctx.rdvID&&ctx.showDeleteBtn))},"RdvFormComponent_Template"),dependencies:[_angular_common__WEBPACK_IMPORTED_MODULE_2__.mk,_angular_common__WEBPACK_IMPORTED_MODULE_2__.O5,_angular_forms__WEBPACK_IMPORTED_MODULE_1__._Y,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.Fj,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.JJ,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.JL,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.sg,_angular_forms__WEBPACK_IMPORTED_MODULE_1__.u,_ngx_translate_core__WEBPACK_IMPORTED_MODULE_3__.X$],styles:[".name-div[_ngcontent-%COMP%], .mobile-div[_ngcontent-%COMP%], .error-msg-div[_ngcontent-%COMP%]{margin:15px 0}.btns-container[_ngcontent-%COMP%]{display:flex;margin-top:25px}.btn[_ngcontent-%COMP%]{width:50%}.full-width-btn[_ngcontent-%COMP%]{width:100%}.btn-success[_ngcontent-%COMP%]{margin-right:7px}.btn-danger[_ngcontent-%COMP%]{margin-left:7px}"]})},83436:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{m:()=>SharedModule});var common=__webpack_require__(69808),angular_datatables=__webpack_require__(65415),fesm2015_forms=__webpack_require__(93075),core=__webpack_require__(5e3),chart_esm=__webpack_require__(34393),operators=__webpack_require__(83292);function listCacheClear(){this.__data__=[],this.size=0}__name(listCacheClear,"listCacheClear");const _listCacheClear=listCacheClear;function eq(value,other){return value===other||value!=value&&other!=other}__name(eq,"eq");const lodash_es_eq=eq;function assocIndexOf(array,key){for(var length=array.length;length--;)if(lodash_es_eq(array[length][0],key))return length;return-1}__name(assocIndexOf,"assocIndexOf");const _assocIndexOf=assocIndexOf;var splice=Array.prototype.splice;function listCacheDelete(key){var data=this.__data__,index=_assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)}__name(listCacheDelete,"listCacheDelete");const _listCacheDelete=listCacheDelete;function listCacheGet(key){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?void 0:data[index][1]}__name(listCacheGet,"listCacheGet");const _listCacheGet=listCacheGet;function listCacheHas(key){return _assocIndexOf(this.__data__,key)>-1}__name(listCacheHas,"listCacheHas");const _listCacheHas=listCacheHas;function listCacheSet(key,value){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}__name(listCacheSet,"listCacheSet");const _listCacheSet=listCacheSet;function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index-1&&value%1==0&&value<=9007199254740991}__name(isLength,"isLength");const lodash_es_isLength=isLength;function isArrayLike(value){return null!=value&&lodash_es_isLength(value.length)&&!lodash_es_isFunction(value)}__name(isArrayLike,"isArrayLike");const lodash_es_isArrayLike=isArrayLike;function isArrayLikeObject(value){return lodash_es_isObjectLike(value)&&lodash_es_isArrayLike(value)}__name(isArrayLikeObject,"isArrayLikeObject");const lodash_es_isArrayLikeObject=isArrayLikeObject;function stubFalse(){return!1}__name(stubFalse,"stubFalse");const lodash_es_stubFalse=stubFalse;var isBuffer_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,isBuffer_freeModule=isBuffer_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,isBuffer_Buffer=isBuffer_freeModule&&isBuffer_freeModule.exports===isBuffer_freeExports?_root.Buffer:void 0;const lodash_es_isBuffer=(isBuffer_Buffer?isBuffer_Buffer.isBuffer:void 0)||lodash_es_stubFalse;var isPlainObject_funcProto=Function.prototype,isPlainObject_objectProto=Object.prototype,isPlainObject_funcToString=isPlainObject_funcProto.toString,isPlainObject_hasOwnProperty=isPlainObject_objectProto.hasOwnProperty,objectCtorString=isPlainObject_funcToString.call(Object);function isPlainObject(value){if(!lodash_es_isObjectLike(value)||"[object Object]"!=_baseGetTag(value))return!1;var proto=_getPrototype(value);if(null===proto)return!0;var Ctor=isPlainObject_hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&isPlainObject_funcToString.call(Ctor)==objectCtorString}__name(isPlainObject,"isPlainObject");const lodash_es_isPlainObject=isPlainObject;var typedArrayTags={};function baseIsTypedArray(value){return lodash_es_isObjectLike(value)&&lodash_es_isLength(value.length)&&!!typedArrayTags[_baseGetTag(value)]}typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1,__name(baseIsTypedArray,"baseIsTypedArray");const _baseIsTypedArray=baseIsTypedArray;function baseUnary(func){return function(value){return func(value)}}__name(baseUnary,"baseUnary");const _baseUnary=baseUnary;var _nodeUtil_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,_nodeUtil_freeModule=_nodeUtil_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=_nodeUtil_freeModule&&_nodeUtil_freeModule.exports===_nodeUtil_freeExports&&_freeGlobal.process,nodeUtil=function(){try{return _nodeUtil_freeModule&&_nodeUtil_freeModule.require&&_nodeUtil_freeModule.require("util").types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}();var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;const lodash_es_isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray;function safeGet(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]}__name(safeGet,"safeGet");const _safeGet=safeGet;var _assignValue_hasOwnProperty=Object.prototype.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];(!_assignValue_hasOwnProperty.call(object,key)||!lodash_es_eq(objValue,value)||void 0===value&&!(key in object))&&_baseAssignValue(object,key,value)}__name(assignValue,"assignValue");const _assignValue=assignValue;function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index-1&&value%1==0&&value0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)}}__name(shortOut,"shortOut");const _setToString=shortOut(_baseSetToString);function baseRest(func,start){return _setToString(_overRest(func,start,lodash_es_identity),func+"")}__name(baseRest,"baseRest");const _baseRest=baseRest;function isIterateeCall(value,index,object){if(!lodash_es_isObject(object))return!1;var type=typeof index;return!!("number"==type?lodash_es_isArrayLike(object)&&_isIndex(index,object.length):"string"==type&&index in object)&&lodash_es_eq(object[index],value)}__name(isIterateeCall,"isIterateeCall");const _isIterateeCall=isIterateeCall;function createAssigner(assigner){return _baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&_isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++indexthis.themeChanged(r)))}ngOnChanges(changes){const requireRender=["type"],propertyNames=Object.getOwnPropertyNames(changes);if(propertyNames.some(key=>requireRender.includes(key))||propertyNames.every(key=>changes[key].isFirstChange()))this.render();else{const config=this.getChartConfiguration();this.chart&&(Object.assign(this.chart.config.data,config.data),Object.assign(this.chart.config.plugins,config.plugins),Object.assign(this.chart.config.options,config.options)),this.update()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(s=>s.unsubscribe())}render(){return this.chart&&this.chart.destroy(),this.zone.runOutsideAngular(()=>this.chart=new chart_esm.kL(this.ctx,this.getChartConfiguration()))}update(duration){this.chart&&this.zone.runOutsideAngular(()=>{var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.update(duration)})}hideDataset(index,hidden){this.chart&&(this.chart.getDatasetMeta(index).hidden=hidden,this.update())}isDatasetHidden(index){var _a,_b;return null===(_b=null===(_a=this.chart)||void 0===_a?void 0:_a.getDatasetMeta(index))||void 0===_b?void 0:_b.hidden}toBase64Image(){var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.toBase64Image()}themeChanged(options){this.themeOverrides=options,this.chart&&(Object.assign(this.chart.config.options,this.getChartOptions()),this.update())}getChartOptions(){return lodash_es_merge({onHover:(event,active)=>{!this.chartHover.observed&&!this.chartHover.observers.length||this.zone.run(()=>this.chartHover.emit({event,active}))},onClick:(event,active)=>{!this.chartClick.observed&&!this.chartClick.observers.length||this.zone.run(()=>this.chartClick.emit({event,active}))}},this.themeOverrides,this.options,{plugins:{legend:{display:this.legend}}})}getChartConfiguration(){return{type:this.type,data:this.getChartData(),plugins:this.plugins,options:this.getChartOptions()}}getChartData(){return this.data?this.data:{labels:this.labels||[],datasets:this.datasets||[]}}}__name(BaseChartDirective,"BaseChartDirective"),BaseChartDirective.\u0275fac=__name(function(t){return new(t||BaseChartDirective)(core.Y36(core.SBq),core.Y36(core.R0b),core.Y36(ThemeService))},"BaseChartDirective_Factory"),BaseChartDirective.\u0275dir=core.lG2({type:BaseChartDirective,selectors:[["canvas","baseChart",""]],inputs:{type:"type",legend:"legend",data:"data",options:"options",plugins:"plugins",labels:"labels",datasets:"datasets"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[core.TTD]});const baseColors=[[255,99,132],[54,162,235],[255,206,86],[231,233,237],[75,192,192],[151,187,205],[220,220,220],[247,70,74],[70,191,189],[253,180,92],[148,159,177],[77,83,96]],builtInDefaults={datasets:{line:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.4),borderColor:context=>rgba(generateColor(context.datasetIndex),1),pointBackgroundColor:context=>rgba(generateColor(context.datasetIndex),1),pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:context=>rgba(generateColor(context.datasetIndex),.8)},bar:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.6),borderColor:context=>rgba(generateColor(context.datasetIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.datasetIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.datasetIndex),1)},get radar(){return this.line},doughnut:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:"#fff",hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),1),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get pie(){return this.doughnut},polarArea:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:context=>rgba(generateColor(context.dataIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get bubble(){return this.doughnut},get scatter(){return this.doughnut},get area(){return this.polarArea}}};function rgba(colour,alpha){return"rgba("+colour.concat(alpha).join(",")+")"}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getRandomColor(){return[getRandomInt(0,255),getRandomInt(0,255),getRandomInt(0,255)]}function generateColor(index=0){return baseColors[index]||getRandomColor()}__name(rgba,"rgba"),__name(getRandomInt,"getRandomInt"),__name(getRandomColor,"getRandomColor"),__name(generateColor,"generateColor"),chart_esm.kL.register(chart_esm.Dx,chart_esm.u,chart_esm.Gu,chart_esm.De,chart_esm.ST,chart_esm.jn,chart_esm.od,chart_esm.f$,chart_esm.uw,chart_esm.vn,chart_esm.ZL,chart_esm.jI,chart_esm.qi,chart_esm.Xi,chart_esm.l7,chart_esm.tt,chart_esm.CV,chart_esm.N0,chart_esm.ho,chart_esm.RM);class NgChartsConfiguration{}__name(NgChartsConfiguration,"NgChartsConfiguration"),NgChartsConfiguration.\u0275fac=__name(function(t){return new(t||NgChartsConfiguration)},"NgChartsConfiguration_Factory"),NgChartsConfiguration.\u0275prov=core.Yz7({token:NgChartsConfiguration,factory:NgChartsConfiguration.\u0275fac,providedIn:"root"});class NgChartsModule{constructor(config){null!=config&&config.plugins&&chart_esm.kL.register(...null==config?void 0:config.plugins);const ngChartsDefaults=lodash_es_merge(builtInDefaults,(null==config?void 0:config.defaults)||{});chart_esm.ce.set(ngChartsDefaults)}static forRoot(config){return{ngModule:NgChartsModule,providers:[{provide:NgChartsConfiguration,useValue:config}]}}}__name(NgChartsModule,"NgChartsModule"),NgChartsModule.\u0275fac=__name(function(t){return new(t||NgChartsModule)(core.LFG(NgChartsConfiguration,8))},"NgChartsModule_Factory"),NgChartsModule.\u0275mod=core.oAB({type:NgChartsModule}),NgChartsModule.\u0275inj=core.cJS({imports:[[]]});var http=__webpack_require__(40520),ngx_translate_core=__webpack_require__(81981),ngx_translate_http_loader=__webpack_require__(80040);function HttpLoaderFactory(http2){return new ngx_translate_http_loader.w(http2)}__name(HttpLoaderFactory,"HttpLoaderFactory");class SharedModule{}__name(SharedModule,"SharedModule"),SharedModule.\u0275fac=__name(function(t){return new(t||SharedModule)},"SharedModule_Factory"),SharedModule.\u0275mod=core.oAB({type:SharedModule}),SharedModule.\u0275inj=core.cJS({imports:[common.ez,angular_datatables.T,fesm2015_forms.UX,fesm2015_forms.u5,NgChartsModule,http.JF,ngx_translate_core.aw.forChild({loader:{provide:ngx_translate_core.Zw,useFactory:HttpLoaderFactory,deps:[http.eN]}}),ngx_translate_core.aw]})},6912:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{a:()=>TableComponent});var _angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5e3),angular_datatables__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(65415),rxjs__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(76477),src_app_auth_services_auth_service__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(16518),_ngx_translate_core__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(81981);class TableComponent{constructor(authService,translate){this.authService=authService,this.translate=translate,this.updateInfosEvent=new _angular_core__WEBPACK_IMPORTED_MODULE_2__.vpe,this.loadMoreData=new _angular_core__WEBPACK_IMPORTED_MODULE_2__.vpe,this.dtOptions={},this.dtTrigger=new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject,this.tableBTNs=showBTNs=>showBTNs?[{extend:"colvis",className:"export-btns"},{extend:"csv",className:"export-btns"},{extend:"excel",className:"export-btns"}]:[]}ngOnChanges(changes){changes.infos&&this.rerenderTable()}ngOnInit(){var _a;this.dtOptions=this.tableOptions(this.infos,this.tableCols,null===(_a=this.currentUser)||void 0===_a?void 0:_a.email,this.showBtns),window.onresize=()=>this.rerenderTable()}ngAfterViewInit(){this.dtTrigger.next(this.dtOptions)}ngOnDestroy(){this.dtTrigger.unsubscribe()}tableOptions(tableData,cols,usrMail,showBTNs){return{data:tableData,columns:cols,responsive:!0,pagingType:"full_numbers",pageLength:5,lengthMenu:[3,5,10,25,50,100],dom:"Bfrtip",initComplete:(settings,json)=>{$("button").removeClass("dt-button"),$("button").removeClass("buttons-excel"),$("button").removeClass("buttons-html5 "),$("#DataTables_Table_0_next").on("click",()=>this.loadMoreData.emit())},buttons:this.tableBTNs(showBTNs),rowCallback:(row,data,index)=>{const self2=this;$(row).addClass("t-row"),$(row).css({"white-space":"nowrap"});let dt=data;if(dt.createdBy===usrMail||this.canCRUD){const btn=document.createElement("button");btn.textContent=this.translate.instant("Edit"),btn.setAttribute("id","tableBtn"),btn.classList.add("btn","btn-dark"),btn.onclick=()=>self2.updateInfosEvent.emit(dt);const last=$(row.lastChild);last.addClass("row-btn-container"),last.children("button").remove(),last.append(btn)}return row},language:{processing:this.translate.instant("Processing..."),search:this.translate.instant("Search:"),lengthMenu:this.translate.instant("Show _MENU_ entries"),info:this.translate.instant("Showing _START_ to _END_ of _TOTAL_ entries"),infoEmpty:this.translate.instant("Showing 0 to 0 of 0 entries"),infoFiltered:this.translate.instant("(filtered from _MAX_ total entries)"),infoPostFix:"",loadingRecords:this.translate.instant("Loading..."),zeroRecords:this.translate.instant("No matching records found"),emptyTable:this.translate.instant("No data available in table"),paginate:{first:this.translate.instant("First"),previous:this.translate.instant("Previous"),next:this.translate.instant("Next"),last:this.translate.instant("Last")},aria:{sortAscending:this.translate.instant(": activate to sort column ascending"),sortDescending:this.translate.instant(": activate to sort column descending")}}}}rerenderTable(){this.dtOptions&&this.dtElement&&this.dtElement.dtInstance.then(dtInstance=>{dtInstance.destroy(),this.dtOptions.data=this.infos,this.dtTrigger.next(this.dtOptions)})}get canCRUD(){return this.authService.canCRUDrendezvous(this.currentUser)}}__name(TableComponent,"TableComponent"),TableComponent.\u0275fac=__name(function(t){return new(t||TableComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y36(src_app_auth_services_auth_service__WEBPACK_IMPORTED_MODULE_1__.e),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Y36(_ngx_translate_core__WEBPACK_IMPORTED_MODULE_4__.sK))},"TableComponent_Factory"),TableComponent.\u0275cmp=_angular_core__WEBPACK_IMPORTED_MODULE_2__.Xpm({type:TableComponent,selectors:[["app-table"]],viewQuery:__name(function(rf,ctx){if(1&rf&&_angular_core__WEBPACK_IMPORTED_MODULE_2__.Gf(angular_datatables__WEBPACK_IMPORTED_MODULE_0__.G,5),2&rf){let _t;_angular_core__WEBPACK_IMPORTED_MODULE_2__.iGM(_t=_angular_core__WEBPACK_IMPORTED_MODULE_2__.CRH())&&(ctx.dtElement=_t.first)}},"TableComponent_Query"),inputs:{infos:"infos",tableCols:"tableCols",currentUser:"currentUser",showBtns:"showBtns"},outputs:{updateInfosEvent:"updateInfosEvent",loadMoreData:"loadMoreData"},features:[_angular_core__WEBPACK_IMPORTED_MODULE_2__.TTD],decls:2,vars:2,consts:[[2,"overflow","scroll","overflow-y","hidden","padding","5px"],["datatable","",1,"table","table-responsive","row-border",2,"color","var(--template-color)",3,"dtOptions","dtTrigger"]],template:__name(function(rf,ctx){1&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TgZ(0,"div",0),_angular_core__WEBPACK_IMPORTED_MODULE_2__._UZ(1,"table",1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.qZA()),2&rf&&(_angular_core__WEBPACK_IMPORTED_MODULE_2__.xp6(1),_angular_core__WEBPACK_IMPORTED_MODULE_2__.Q6J("dtOptions",ctx.dtOptions)("dtTrigger",ctx.dtTrigger))},"TableComponent_Template"),dependencies:[angular_datatables__WEBPACK_IMPORTED_MODULE_0__.G]})},34393:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{qi:()=>ArcElement,vn:()=>BarController,ZL:()=>BarElement,N0:()=>BubbleController,uw:()=>CategoryScale,kL:()=>Chart,jI:()=>DoughnutController,Gu:()=>index,De:()=>plugin_legend,ST:()=>LineController,jn:()=>LineElement,f$:()=>LinearScale,tt:()=>PieController,od:()=>PointElement,CV:()=>PolarAreaController,Xi:()=>RadarController,l7:()=>RadialLinearScale,ho:()=>ScatterController,RM:()=>TimeSeriesScale,Dx:()=>plugin_title,u:()=>plugin_tooltip,ce:()=>defaults}),__name(function fontString(pixelSize,fontStyle,fontFamily){return fontStyle+" "+pixelSize+"px "+fontFamily},"fontString");const requestAnimFrame="undefined"==typeof window?function(callback2){return callback2()}:window.requestAnimationFrame;function throttled(fn,thisArg,updateFn){const updateArgs=updateFn||(args2=>Array.prototype.slice.call(args2));let ticking=!1,args=[];return function(...rest){args=updateArgs(rest),ticking||(ticking=!0,requestAnimFrame.call(window,()=>{ticking=!1,fn.apply(thisArg,args)}))}}function debounce(fn,delay){let timeout;return function(...args){return delay?(clearTimeout(timeout),timeout=setTimeout(fn,delay,args)):fn.apply(this,args),delay}}__name(throttled,"throttled"),__name(debounce,"debounce");const _toLeftRightCenter=__name(align=>"start"===align?"left":"end"===align?"right":"center","_toLeftRightCenter"),_alignStartEnd=__name((align,start,end)=>"start"===align?start:"end"===align?end:(start+end)/2,"_alignStartEnd"),_textX=__name((align,left,right,rtl)=>align===(rtl?"left":"right")?right:"center"===align?(left+right)/2:left,"_textX");function noop(){}__name(noop,"noop");const uid=function(){let id=0;return function(){return id++}}();function isNullOrUndef(value){return null==value}function isArray(value){if(Array.isArray&&Array.isArray(value))return!0;const type=Object.prototype.toString.call(value);return"[object"===type.slice(0,7)&&"Array]"===type.slice(-6)}function isObject(value){return null!==value&&"[object Object]"===Object.prototype.toString.call(value)}__name(isNullOrUndef,"isNullOrUndef"),__name(isArray,"isArray"),__name(isObject,"isObject");const isNumberFinite=__name(value=>("number"==typeof value||value instanceof Number)&&isFinite(+value),"isNumberFinite");function finiteOrDefault(value,defaultValue){return isNumberFinite(value)?value:defaultValue}function valueOrDefault(value,defaultValue){return void 0===value?defaultValue:value}__name(finiteOrDefault,"finiteOrDefault"),__name(valueOrDefault,"valueOrDefault");const toPercentage=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100:value/dimension,"toPercentage"),toDimension=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100*dimension:+value,"toDimension");function callback(fn,args,thisArg){if(fn&&"function"==typeof fn.call)return fn.apply(thisArg,args)}function each(loopable,fn,thisArg,reverse){let i,len,keys;if(isArray(loopable))if(len=loopable.length,reverse)for(i=len-1;i>=0;i--)fn.call(thisArg,loopable[i],i);else for(i=0;ipos;)obj=obj[key.slice(pos,idx)],pos=idx+1,idx=indexOfDotOrLength(key,pos);return obj}function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1)}__name(indexOfDotOrLength,"indexOfDotOrLength"),__name(resolveObjectKey,"resolveObjectKey"),__name(_capitalize,"_capitalize");const defined=__name(value=>void 0!==value,"defined"),isFunction=__name(value=>"function"==typeof value,"isFunction"),setsEqual=__name((a,b)=>{if(a.size!==b.size)return!1;for(const item of a)if(!b.has(item))return!1;return!0},"setsEqual");function _isClickEvent(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}__name(_isClickEvent,"_isClickEvent");const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=2*PI/3,log10=Math.log10,sign=Math.sign;function niceNum(range){const roundedRange=Math.round(range);range=almostEquals(range,roundedRange,range/1e3)?roundedRange:range;const niceRange=Math.pow(10,Math.floor(log10(range))),fraction=range/niceRange;return(fraction<=1?1:fraction<=2?2:fraction<=5?5:10)*niceRange}function _factorize(value){const result=[],sqrt=Math.sqrt(value);let i;for(i=1;ia-b).pop(),result}function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}function almostEquals(x,y,epsilon){return Math.abs(x-y)=x}function _setMinAndMaxByKey(array,target,property){let i,ilen,value;for(i=0,ilen=array.length;iangleToEnd&&startToAngle=Math.min(start,end)-epsilon&&value<=Math.max(start,end)+epsilon}__name(niceNum,"niceNum"),__name(_factorize,"_factorize"),__name(isNumber,"isNumber"),__name(almostEquals,"almostEquals"),__name(almostWhole,"almostWhole"),__name(_setMinAndMaxByKey,"_setMinAndMaxByKey"),__name(toRadians,"toRadians"),__name(toDegrees,"toDegrees"),__name(_decimalPlaces,"_decimalPlaces"),__name(getAngleFromPoint,"getAngleFromPoint"),__name(distanceBetweenPoints,"distanceBetweenPoints"),__name(_angleDiff,"_angleDiff"),__name(_normalizeAngle,"_normalizeAngle"),__name(_angleBetween,"_angleBetween"),__name(_limitValue,"_limitValue"),__name(_int16Range,"_int16Range"),__name(_isBetween,"_isBetween");const atEdge=__name(t=>0===t||1===t,"atEdge"),elasticIn=__name((t,s,p)=>-Math.pow(2,10*(t-=1))*Math.sin((t-s)*TAU/p),"elasticIn"),elasticOut=__name((t,s,p)=>Math.pow(2,-10*t)*Math.sin((t-s)*TAU/p)+1,"elasticOut"),effects={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*HALF_PI),easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>atEdge(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic:t=>atEdge(t)?t:t<.5?.5*elasticIn(2*t,.1125,.45):.5+.5*elasticOut(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let s=1.70158;return(t/=.5)<1?t*t*((1+(s*=1.525))*t-s)*.5:.5*((t-=2)*t*((1+(s*=1.525))*t+s)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,easeInOutBounce:t=>t<.5?.5*effects.easeInBounce(2*t):.5*effects.easeOutBounce(2*t-1)+.5};function round(v){return v+.5|0}__name(round,"round");const lim=__name((v,l,h)=>Math.max(Math.min(v,h),l),"lim");function p2b(v){return lim(round(2.55*v),0,255)}function n2b(v){return lim(round(255*v),0,255)}function b2n(v){return lim(round(v/2.55)/100,0,1)}function n2p(v){return lim(round(100*v),0,100)}__name(p2b,"p2b"),__name(n2b,"n2b"),__name(b2n,"b2n"),__name(n2p,"n2p");const map$1={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},hex=[..."0123456789ABCDEF"],h1=__name(b=>hex[15&b],"h1"),h2=__name(b=>hex[(240&b)>>4]+hex[15&b],"h2"),eq=__name(b=>(240&b)>>4==(15&b),"eq"),isShort=__name(v=>eq(v.r)&&eq(v.g)&&eq(v.b)&&eq(v.a),"isShort");function hexParse(str){var ret,len=str.length;return"#"===str[0]&&(4===len||5===len?ret={r:255&17*map$1[str[1]],g:255&17*map$1[str[2]],b:255&17*map$1[str[3]],a:5===len?17*map$1[str[4]]:255}:(7===len||9===len)&&(ret={r:map$1[str[1]]<<4|map$1[str[2]],g:map$1[str[3]]<<4|map$1[str[4]],b:map$1[str[5]]<<4|map$1[str[6]],a:9===len?map$1[str[7]]<<4|map$1[str[8]]:255})),ret}__name(hexParse,"hexParse");const alpha=__name((a,f)=>a<255?f(a):"","alpha");function hexString(v){var f=isShort(v)?h1:h2;return v?"#"+f(v.r)+f(v.g)+f(v.b)+alpha(v.a,f):void 0}__name(hexString,"hexString");const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(h,s,l){const a=s*Math.min(l,1-l),f=__name((n,k=(n+h/30)%12)=>l-a*Math.max(Math.min(k-3,9-k,1),-1),"f");return[f(0),f(8),f(4)]}function hsv2rgbn(h,s,v){const f=__name((n,k=(n+h/60)%6)=>v-v*s*Math.max(Math.min(k,4-k,1),0),"f");return[f(5),f(3),f(1)]}function hwb2rgbn(h,w,b){const rgb=hsl2rgbn(h,1,.5);let i;for(w+b>1&&(i=1/(w+b),w*=i,b*=i),i=0;i<3;i++)rgb[i]*=1-w-b,rgb[i]+=w;return rgb}function hueValue(r,g,b,d,max){return r===max?(g-b)/d+(g.5?d/(2-max-min):d/(max+min),h=hueValue(r,g,b,d,max),h=60*h+.5),[0|h,s||0,l]}function calln(f,a,b,c){return(Array.isArray(a)?f(a[0],a[1],a[2]):f(a,b,c)).map(n2b)}function hsl2rgb(h,s,l){return calln(hsl2rgbn,h,s,l)}function hwb2rgb(h,w,b){return calln(hwb2rgbn,h,w,b)}function hsv2rgb(h,s,v){return calln(hsv2rgbn,h,s,v)}function hue(h){return(h%360+360)%360}function hueParse(str){const m=HUE_RE.exec(str);let v,a=255;if(!m)return;m[5]!==v&&(a=m[6]?p2b(+m[5]):n2b(+m[5]));const h=hue(+m[2]),p1=+m[3]/100,p2=+m[4]/100;return v="hwb"===m[1]?hwb2rgb(h,p1,p2):"hsv"===m[1]?hsv2rgb(h,p1,p2):hsl2rgb(h,p1,p2),{r:v[0],g:v[1],b:v[2],a}}function rotate(v,deg){var h=rgb2hsl(v);h[0]=hue(h[0]+deg),h=hsl2rgb(h),v.r=h[0],v.g=h[1],v.b=h[2]}function hslString(v){if(!v)return;const a=rgb2hsl(v),h=a[0],s=n2p(a[1]),l=n2p(a[2]);return v.a<255?`hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`:`hsl(${h}, ${s}%, ${l}%)`}__name(hsl2rgbn,"hsl2rgbn"),__name(hsv2rgbn,"hsv2rgbn"),__name(hwb2rgbn,"hwb2rgbn"),__name(hueValue,"hueValue"),__name(rgb2hsl,"rgb2hsl"),__name(calln,"calln"),__name(hsl2rgb,"hsl2rgb"),__name(hwb2rgb,"hwb2rgb"),__name(hsv2rgb,"hsv2rgb"),__name(hue,"hue"),__name(hueParse,"hueParse"),__name(rotate,"rotate"),__name(hslString,"hslString");const map={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"},names$1={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 unpack(){const unpacked={},keys=Object.keys(names$1),tkeys=Object.keys(map);let i,j,k,ok,nk;for(i=0;i>16&255,k>>8&255,255&k]}return unpacked}let names;function nameParse(str){names||(names=unpack(),names.transparent=[0,0,0,0]);const a=names[str.toLowerCase()];return a&&{r:a[0],g:a[1],b:a[2],a:4===a.length?a[3]:255}}__name(unpack,"unpack"),__name(nameParse,"nameParse");const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(str){const m=RGB_RE.exec(str);let r,g,b,a=255;if(m){if(m[7]!==r){const v=+m[7];a=m[8]?p2b(v):lim(255*v,0,255)}return r=+m[1],g=+m[3],b=+m[5],r=255&(m[2]?p2b(r):lim(r,0,255)),g=255&(m[4]?p2b(g):lim(g,0,255)),b=255&(m[6]?p2b(b):lim(b,0,255)),{r,g,b,a}}}function rgbString(v){return v&&(v.a<255?`rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`:`rgb(${v.r}, ${v.g}, ${v.b})`)}__name(rgbParse,"rgbParse"),__name(rgbString,"rgbString");const to=__name(v=>v<=.0031308?12.92*v:1.055*Math.pow(v,1/2.4)-.055,"to"),from=__name(v=>v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4),"from");function interpolate(rgb1,rgb2,t){const r=from(b2n(rgb1.r)),g=from(b2n(rgb1.g)),b=from(b2n(rgb1.b));return{r:n2b(to(r+t*(from(b2n(rgb2.r))-r))),g:n2b(to(g+t*(from(b2n(rgb2.g))-g))),b:n2b(to(b+t*(from(b2n(rgb2.b))-b))),a:rgb1.a+t*(rgb2.a-rgb1.a)}}function modHSL(v,i,ratio){if(v){let tmp=rgb2hsl(v);tmp[i]=Math.max(0,Math.min(tmp[i]+tmp[i]*ratio,0===i?360:1)),tmp=hsl2rgb(tmp),v.r=tmp[0],v.g=tmp[1],v.b=tmp[2]}}function clone(v,proto){return v&&Object.assign(proto||{},v)}function fromObject(input){var v={r:0,g:0,b:0,a:255};return Array.isArray(input)?input.length>=3&&(v={r:input[0],g:input[1],b:input[2],a:255},input.length>3&&(v.a=n2b(input[3]))):(v=clone(input,{r:0,g:0,b:0,a:1})).a=n2b(v.a),v}function functionParse(str){return"r"===str.charAt(0)?rgbParse(str):hueParse(str)}__name(interpolate,"interpolate"),__name(modHSL,"modHSL"),__name(clone,"clone"),__name(fromObject,"fromObject"),__name(functionParse,"functionParse");class Color{constructor(input){if(input instanceof Color)return input;const type=typeof input;let v;"object"===type?v=fromObject(input):"string"===type&&(v=hexParse(input)||nameParse(input)||functionParse(input)),this._rgb=v,this._valid=!!v}get valid(){return this._valid}get rgb(){var v=clone(this._rgb);return v&&(v.a=b2n(v.a)),v}set rgb(obj){this._rgb=fromObject(obj)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(color2,weight){if(color2){const c1=this.rgb,c2=color2.rgb;let w2;const p=weight===w2?.5:weight,w=2*p-1,a=c1.a-c2.a,w1=((w*a==-1?w:(w+a)/(1+w*a))+1)/2;w2=1-w1,c1.r=255&w1*c1.r+w2*c2.r+.5,c1.g=255&w1*c1.g+w2*c2.g+.5,c1.b=255&w1*c1.b+w2*c2.b+.5,c1.a=p*c1.a+(1-p)*c2.a,this.rgb=c1}return this}interpolate(color2,t){return color2&&(this._rgb=interpolate(this._rgb,color2._rgb,t)),this}clone(){return new Color(this.rgb)}alpha(a){return this._rgb.a=n2b(a),this}clearer(ratio){return this._rgb.a*=1-ratio,this}greyscale(){const rgb=this._rgb,val=round(.3*rgb.r+.59*rgb.g+.11*rgb.b);return rgb.r=rgb.g=rgb.b=val,this}opaquer(ratio){return this._rgb.a*=1+ratio,this}negate(){const v=this._rgb;return v.r=255-v.r,v.g=255-v.g,v.b=255-v.b,this}lighten(ratio){return modHSL(this._rgb,2,ratio),this}darken(ratio){return modHSL(this._rgb,2,-ratio),this}saturate(ratio){return modHSL(this._rgb,1,ratio),this}desaturate(ratio){return modHSL(this._rgb,1,-ratio),this}rotate(deg){return rotate(this._rgb,deg),this}}function index_esm(input){return new Color(input)}function isPatternOrGradient(value){if(value&&"object"==typeof value){const type=value.toString();return"[object CanvasPattern]"===type||"[object CanvasGradient]"===type}return!1}function color(value){return isPatternOrGradient(value)?value:index_esm(value)}function getHoverColor(value){return isPatternOrGradient(value)?value:index_esm(value).saturate(.5).darken(.1).hexString()}__name(Color,"Color"),__name(index_esm,"index_esm"),__name(isPatternOrGradient,"isPatternOrGradient"),__name(color,"color"),__name(getHoverColor,"getHoverColor");const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(node,key){if(!key)return node;const keys=key.split(".");for(let i=0,n=keys.length;icontext.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=(ctx,options)=>getHoverColor(options.backgroundColor),this.hoverBorderColor=(ctx,options)=>getHoverColor(options.borderColor),this.hoverColor=(ctx,options)=>getHoverColor(options.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(_descriptors2)}set(scope,values){return set(this,scope,values)}get(scope){return getScope$1(this,scope)}describe(scope,values){return set(descriptors,scope,values)}override(scope,values){return set(overrides,scope,values)}route(scope,name,targetScope,targetName){const scopeObject=getScope$1(this,scope),targetScopeObject=getScope$1(this,targetScope),privateName="_"+name;Object.defineProperties(scopeObject,{[privateName]:{value:scopeObject[name],writable:!0},[name]:{enumerable:!0,get(){const local=this[privateName],target=targetScopeObject[targetName];return isObject(local)?Object.assign({},target,local):valueOrDefault(local,target)},set(value){this[privateName]=value}}})}}__name(Defaults,"Defaults");var defaults=new Defaults({_scriptable:name=>!name.startsWith("on"),_indexable:name=>"events"!==name,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function toFontString(font){return!font||isNullOrUndef(font.size)||isNullOrUndef(font.family)?null:(font.style?font.style+" ":"")+(font.weight?font.weight+" ":"")+font.size+"px "+font.family}function _measureText(ctx,data,gc,longest,string){let textWidth=data[string];return textWidth||(textWidth=data[string]=ctx.measureText(string).width,gc.push(string)),textWidth>longest&&(longest=textWidth),longest}function _longestText(ctx,font,arrayOfThings,cache){let data=(cache=cache||{}).data=cache.data||{},gc=cache.garbageCollect=cache.garbageCollect||[];cache.font!==font&&(data=cache.data={},gc=cache.garbageCollect=[],cache.font=font),ctx.save(),ctx.font=font;let longest=0;const ilen=arrayOfThings.length;let i,j,jlen,thing,nestedThing;for(i=0;iarrayOfThings.length){for(i=0;i0&&ctx.stroke()}}function _isPointInArea(point,area,margin){return margin=margin||.5,!area||point&&point.x>area.left-margin&&point.xarea.top-margin&&point.y0&&""!==opts.strokeColor;let i,line;for(ctx.save(),ctx.font=font.string,setRenderOpts(ctx,opts),i=0;i+v||0,"numberOrZero");function _readValueToProps(value,props){const ret={},objProps=isObject(props),keys=objProps?Object.keys(props):props,read=isObject(value)?objProps?prop=>valueOrDefault(value[prop],value[props[prop]]):prop=>value[prop]:()=>value;for(const prop of keys)ret[prop]=numberOrZero(read(prop));return ret}function toTRBL(value){return _readValueToProps(value,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(value){return _readValueToProps(value,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(value){const obj=toTRBL(value);return obj.width=obj.left+obj.right,obj.height=obj.top+obj.bottom,obj}function toFont(options,fallback){options=options||{},fallback=fallback||defaults.font;let size=valueOrDefault(options.size,fallback.size);"string"==typeof size&&(size=parseInt(size,10));let style=valueOrDefault(options.style,fallback.style);style&&!(""+style).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+style+'"'),style="");const font={family:valueOrDefault(options.family,fallback.family),lineHeight:toLineHeight(valueOrDefault(options.lineHeight,fallback.lineHeight),size),size,style,weight:valueOrDefault(options.weight,fallback.weight),string:""};return font.string=toFontString(font),font}function resolve(inputs,context,index2,info){let i,ilen,value,cacheable=!0;for(i=0,ilen=inputs.length;ibeginAtZero&&0===value?0:value+add,"keepZero");return{min:keepZero(min,-Math.abs(change)),max:keepZero(max,change)}}function createContext(parentContext,context){return Object.assign(Object.create(parentContext),context)}function _lookup(table,value,cmp){cmp=cmp||(index2=>table[index2]1;)mid=lo+hi>>1,cmp(mid)?lo=mid:hi=mid;return{lo,hi}}__name(_readValueToProps,"_readValueToProps"),__name(toTRBL,"toTRBL"),__name(toTRBLCorners,"toTRBLCorners"),__name(toPadding,"toPadding"),__name(toFont,"toFont"),__name(resolve,"resolve"),__name(_addGrace,"_addGrace"),__name(createContext,"createContext"),__name(_lookup,"_lookup");const _lookupByKey=__name((table,key,value)=>_lookup(table,value,index2=>table[index2][key]_lookup(table,value,index2=>table[index2][key]>=value),"_rlookupByKey");function _filterBetween(values,min,max){let start=0,end=values.length;for(;startstart&&values[end-1]>max;)end--;return start>0||end{const method="_onData"+_capitalize(key),base=array[key];Object.defineProperty(array,key,{configurable:!0,enumerable:!1,value(...args){const res=base.apply(this,args);return array._chartjs.listeners.forEach(object=>{"function"==typeof object[method]&&object[method](...args)}),res}})}))}function unlistenArrayEvents(array,listener){const stub=array._chartjs;if(!stub)return;const listeners=stub.listeners,index2=listeners.indexOf(listener);-1!==index2&&listeners.splice(index2,1),!(listeners.length>0)&&(arrayEvents.forEach(key=>{delete array[key]}),delete array._chartjs)}function _arrayUnique(items){const set2=new Set;let i,ilen;for(i=0,ilen=items.length;iscopes[0])){defined(fallback)||(fallback=_resolve("_fallback",scopes));const cache={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:scopes,_rootScopes:rootScopes,_fallback:fallback,_getTarget:getTarget,override:scope=>_createResolver([scope,...scopes],prefixes,rootScopes,fallback)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete target._keys,delete scopes[0][prop],!0),get:(target,prop)=>_cached(target,prop,()=>_resolveWithPrefixes(prop,prefixes,scopes,target)),getOwnPropertyDescriptor:(target,prop)=>Reflect.getOwnPropertyDescriptor(target._scopes[0],prop),getPrototypeOf:()=>Reflect.getPrototypeOf(scopes[0]),has:(target,prop)=>getKeysFromAllScopes(target).includes(prop),ownKeys:target=>getKeysFromAllScopes(target),set(target,prop,value){const storage=target._storage||(target._storage=getTarget());return target[prop]=storage[prop]=value,delete target._keys,!0}})}function _attachContext(proxy,context,subProxy,descriptorDefaults){const cache={_cacheable:!1,_proxy:proxy,_context:context,_subProxy:subProxy,_stack:new Set,_descriptors:_descriptors(proxy,descriptorDefaults),setContext:ctx=>_attachContext(proxy,ctx,subProxy,descriptorDefaults),override:scope=>_attachContext(proxy.override(scope),context,subProxy,descriptorDefaults)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete proxy[prop],!0),get:(target,prop,receiver)=>_cached(target,prop,()=>_resolveWithContext(target,prop,receiver)),getOwnPropertyDescriptor:(target,prop)=>target._descriptors.allKeys?Reflect.has(proxy,prop)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(proxy,prop),getPrototypeOf:()=>Reflect.getPrototypeOf(proxy),has:(target,prop)=>Reflect.has(proxy,prop),ownKeys:()=>Reflect.ownKeys(proxy),set:(target,prop,value)=>(proxy[prop]=value,delete target[prop],!0)})}function _descriptors(proxy,defaults2={scriptable:!0,indexable:!0}){const{_scriptable=defaults2.scriptable,_indexable=defaults2.indexable,_allKeys=defaults2.allKeys}=proxy;return{allKeys:_allKeys,scriptable:_scriptable,indexable:_indexable,isScriptable:isFunction(_scriptable)?_scriptable:()=>_scriptable,isIndexable:isFunction(_indexable)?_indexable:()=>_indexable}}__name(listenArrayEvents,"listenArrayEvents"),__name(unlistenArrayEvents,"unlistenArrayEvents"),__name(_arrayUnique,"_arrayUnique"),__name(_createResolver,"_createResolver"),__name(_attachContext,"_attachContext"),__name(_descriptors,"_descriptors");const readKey=__name((prefix,name)=>prefix?prefix+_capitalize(name):name,"readKey"),needsSubResolver=__name((prop,value)=>isObject(value)&&"adapters"!==prop&&(null===Object.getPrototypeOf(value)||value.constructor===Object),"needsSubResolver");function _cached(target,prop,resolve2){if(Object.prototype.hasOwnProperty.call(target,prop))return target[prop];const value=resolve2();return target[prop]=value,value}function _resolveWithContext(target,prop,receiver){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;let value=_proxy[prop];return isFunction(value)&&descriptors2.isScriptable(prop)&&(value=_resolveScriptable(prop,value,target,receiver)),isArray(value)&&value.length&&(value=_resolveArray(prop,value,target,descriptors2.isIndexable)),needsSubResolver(prop,value)&&(value=_attachContext(value,_context,_subProxy&&_subProxy[prop],descriptors2)),value}function _resolveScriptable(prop,value,target,receiver){const{_proxy,_context,_subProxy,_stack}=target;if(_stack.has(prop))throw new Error("Recursion detected: "+Array.from(_stack).join("->")+"->"+prop);return _stack.add(prop),value=value(_context,_subProxy||receiver),_stack.delete(prop),needsSubResolver(prop,value)&&(value=createSubResolver(_proxy._scopes,_proxy,prop,value)),value}function _resolveArray(prop,value,target,isIndexable){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;if(defined(_context.index)&&isIndexable(prop))value=value[_context.index%value.length];else if(isObject(value[0])){const arr=value,scopes=_proxy._scopes.filter(s=>s!==arr);value=[];for(const item of arr){const resolver=createSubResolver(scopes,_proxy,prop,item);value.push(_attachContext(resolver,_context,_subProxy&&_subProxy[prop],descriptors2))}}return value}function resolveFallback(fallback,prop,value){return isFunction(fallback)?fallback(prop,value):fallback}__name(_cached,"_cached"),__name(_resolveWithContext,"_resolveWithContext"),__name(_resolveScriptable,"_resolveScriptable"),__name(_resolveArray,"_resolveArray"),__name(resolveFallback,"resolveFallback");const getScope=__name((key,parent)=>!0===key?parent:"string"==typeof key?resolveObjectKey(parent,key):void 0,"getScope");function addScopes(set2,parentScopes,key,parentFallback,value){for(const parent of parentScopes){const scope=getScope(key,parent);if(scope){set2.add(scope);const fallback=resolveFallback(scope._fallback,key,value);if(defined(fallback)&&fallback!==key&&fallback!==parentFallback)return fallback}else if(!1===scope&&defined(parentFallback)&&key!==parentFallback)return null}return!1}function createSubResolver(parentScopes,resolver,prop,value){const rootScopes=resolver._rootScopes,fallback=resolveFallback(resolver._fallback,prop,value),allScopes=[...parentScopes,...rootScopes],set2=new Set;set2.add(value);let key=addScopesFromKey(set2,allScopes,prop,fallback||prop,value);return!(null===key||defined(fallback)&&fallback!==prop&&(key=addScopesFromKey(set2,allScopes,fallback,key,value),null===key))&&_createResolver(Array.from(set2),[""],rootScopes,fallback,()=>subGetTarget(resolver,prop,value))}function addScopesFromKey(set2,allScopes,key,fallback,item){for(;key;)key=addScopes(set2,allScopes,key,fallback,item);return key}function subGetTarget(resolver,prop,value){const parent=resolver._getTarget();prop in parent||(parent[prop]={});const target=parent[prop];return isArray(target)&&isObject(value)?value:target}function _resolveWithPrefixes(prop,prefixes,scopes,proxy){let value;for(const prefix of prefixes)if(value=_resolve(readKey(prefix,prop),scopes),defined(value))return needsSubResolver(prop,value)?createSubResolver(scopes,proxy,prop,value):value}function _resolve(key,scopes){for(const scope of scopes){if(!scope)continue;const value=scope[key];if(defined(value))return value}}function getKeysFromAllScopes(target){let keys=target._keys;return keys||(keys=target._keys=resolveKeysFromAllScopes(target._scopes)),keys}function resolveKeysFromAllScopes(scopes){const set2=new Set;for(const scope of scopes)for(const key of Object.keys(scope).filter(k=>!k.startsWith("_")))set2.add(key);return Array.from(set2)}function _parseObjectDataRadialScale(meta,data,start,count){const{iScale}=meta,{key="r"}=this._parsing,parsed=new Array(count);let i,ilen,index2,item;for(i=0,ilen=count;ii"x"===indexAxis?"y":"x","getValueAxis");function splineCurve(firstPoint,middlePoint,afterPoint,t){const previous=firstPoint.skip?middlePoint:firstPoint,current=middlePoint,next=afterPoint.skip?middlePoint:afterPoint,d01=distanceBetweenPoints(current,previous),d12=distanceBetweenPoints(next,current);let s01=d01/(d01+d12),s12=d12/(d01+d12);s01=isNaN(s01)?0:s01,s12=isNaN(s12)?0:s12;const fa=t*s01,fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}}}function monotoneAdjust(points,deltaK,mK){const pointsLen=points.length;let alphaK,betaK,tauK,squaredMagnitude,pointCurrent,pointAfter=getPoint(points,0);for(let i=0;i!pt.skip)),"monotone"===options.cubicInterpolationMode)splineCurveMonotone(points,indexAxis);else{let prev=loop?points[points.length-1]:points[0];for(i=0,ilen=points.length;iwindow.getComputedStyle(element,null),"getComputedStyle");function getStyle(el,property){return getComputedStyle(el).getPropertyValue(property)}__name(getStyle,"getStyle");const positions=["top","right","bottom","left"];function getPositionedStyle(styles,style,suffix){const result={};suffix=suffix?"-"+suffix:"";for(let i=0;i<4;i++){const pos=positions[i];result[pos]=parseFloat(styles[style+"-"+pos+suffix])||0}return result.width=result.left+result.right,result.height=result.top+result.bottom,result}__name(getPositionedStyle,"getPositionedStyle");const useOffsetPos=__name((x,y,target)=>(x>0||y>0)&&(!target||!target.shadowRoot),"useOffsetPos");function getCanvasPosition(e,canvas){const touches=e.touches,source=touches&&touches.length?touches[0]:e,{offsetX,offsetY}=source;let x,y,box=!1;if(useOffsetPos(offsetX,offsetY,e.target))x=offsetX,y=offsetY;else{const rect=canvas.getBoundingClientRect();x=source.clientX-rect.left,y=source.clientY-rect.top,box=!0}return{x,y,box}}function getRelativePosition(evt,chart){if("native"in evt)return evt;const{canvas,currentDevicePixelRatio}=chart,style=getComputedStyle(canvas),borderBox="border-box"===style.boxSizing,paddings=getPositionedStyle(style,"padding"),borders=getPositionedStyle(style,"border","width"),{x,y,box}=getCanvasPosition(evt,canvas),xOffset=paddings.left+(box&&borders.left),yOffset=paddings.top+(box&&borders.top);let{width,height}=chart;return borderBox&&(width-=paddings.width+borders.width,height-=paddings.height+borders.height),{x:Math.round((x-xOffset)/width*canvas.width/currentDevicePixelRatio),y:Math.round((y-yOffset)/height*canvas.height/currentDevicePixelRatio)}}function getContainerSize(canvas,width,height){let maxWidth,maxHeight;if(void 0===width||void 0===height){const container=_getParentNode(canvas);if(container){const rect=container.getBoundingClientRect(),containerStyle=getComputedStyle(container),containerBorder=getPositionedStyle(containerStyle,"border","width"),containerPadding=getPositionedStyle(containerStyle,"padding");width=rect.width-containerPadding.width-containerBorder.width,height=rect.height-containerPadding.height-containerBorder.height,maxWidth=parseMaxStyle(containerStyle.maxWidth,container,"clientWidth"),maxHeight=parseMaxStyle(containerStyle.maxHeight,container,"clientHeight")}else width=canvas.clientWidth,height=canvas.clientHeight}return{width,height,maxWidth:maxWidth||INFINITY,maxHeight:maxHeight||INFINITY}}__name(getCanvasPosition,"getCanvasPosition"),__name(getRelativePosition,"getRelativePosition"),__name(getContainerSize,"getContainerSize");const round1=__name(v=>Math.round(10*v)/10,"round1");function getMaximumSize(canvas,bbWidth,bbHeight,aspectRatio){const style=getComputedStyle(canvas),margins=getPositionedStyle(style,"margin"),maxWidth=parseMaxStyle(style.maxWidth,canvas,"clientWidth")||INFINITY,maxHeight=parseMaxStyle(style.maxHeight,canvas,"clientHeight")||INFINITY,containerSize=getContainerSize(canvas,bbWidth,bbHeight);let{width,height}=containerSize;if("content-box"===style.boxSizing){const borders=getPositionedStyle(style,"border","width"),paddings=getPositionedStyle(style,"padding");width-=paddings.width+borders.width,height-=paddings.height+borders.height}return width=Math.max(0,width-margins.width),height=Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height-margins.height),width=round1(Math.min(width,maxWidth,containerSize.maxWidth)),height=round1(Math.min(height,maxHeight,containerSize.maxHeight)),width&&!height&&(height=round1(width/2)),{width,height}}function retinaScale(chart,forceRatio,forceStyle){const pixelRatio=forceRatio||1,deviceHeight=Math.floor(chart.height*pixelRatio),deviceWidth=Math.floor(chart.width*pixelRatio);chart.height=deviceHeight/pixelRatio,chart.width=deviceWidth/pixelRatio;const canvas=chart.canvas;return canvas.style&&(forceStyle||!canvas.style.height&&!canvas.style.width)&&(canvas.style.height=`${chart.height}px`,canvas.style.width=`${chart.width}px`),(chart.currentDevicePixelRatio!==pixelRatio||canvas.height!==deviceHeight||canvas.width!==deviceWidth)&&(chart.currentDevicePixelRatio=pixelRatio,canvas.height=deviceHeight,canvas.width=deviceWidth,chart.ctx.setTransform(pixelRatio,0,0,pixelRatio,0,0),!0)}__name(getMaximumSize,"getMaximumSize"),__name(retinaScale,"retinaScale");const supportsEventListenerOptions=function(){let passiveSupported=!1;try{const options={get passive(){return passiveSupported=!0,!1}};window.addEventListener("test",null,options),window.removeEventListener("test",null,options)}catch{}return passiveSupported}();function readUsedSize(element,property){const value=getStyle(element,property),matches=value&&value.match(/^(\d+)(\.\d+)?px$/);return matches?+matches[1]:void 0}function _pointInLine(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:p1.y+t*(p2.y-p1.y)}}function _steppedInterpolation(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:"middle"===mode?t<.5?p1.y:p2.y:"after"===mode?t<1?p1.y:p2.y:t>0?p2.y:p1.y}}function _bezierInterpolation(p1,p2,t,mode){const cp1={x:p1.cp2x,y:p1.cp2y},cp2={x:p2.cp1x,y:p2.cp1y},a=_pointInLine(p1,cp1,t),b=_pointInLine(cp1,cp2,t),c=_pointInLine(cp2,p2,t),d=_pointInLine(a,b,t),e=_pointInLine(b,c,t);return _pointInLine(d,e,t)}__name(readUsedSize,"readUsedSize"),__name(_pointInLine,"_pointInLine"),__name(_steppedInterpolation,"_steppedInterpolation"),__name(_bezierInterpolation,"_bezierInterpolation");const intlCache=new Map;function getNumberFormat(locale,options){options=options||{};const cacheKey=locale+JSON.stringify(options);let formatter=intlCache.get(cacheKey);return formatter||(formatter=new Intl.NumberFormat(locale,options),intlCache.set(cacheKey,formatter)),formatter}function formatNumber(num,locale,options){return getNumberFormat(locale,options).format(num)}__name(getNumberFormat,"getNumberFormat"),__name(formatNumber,"formatNumber");const getRightToLeftAdapter=__name(function(rectX,width){return{x:x=>rectX+rectX+width-x,setWidth(w){width=w},textAlign:align=>"center"===align?align:"right"===align?"left":"right",xPlus:(x,value)=>x-value,leftForLtr:(x,itemWidth)=>x-itemWidth}},"getRightToLeftAdapter"),getLeftToRightAdapter=__name(function(){return{x:x=>x,setWidth(w){},textAlign:align=>align,xPlus:(x,value)=>x+value,leftForLtr:(x,_itemWidth)=>x}},"getLeftToRightAdapter");function getRtlAdapter(rtl,rectX,width){return rtl?getRightToLeftAdapter(rectX,width):getLeftToRightAdapter()}function overrideTextDirection(ctx,direction){let style,original;("ltr"===direction||"rtl"===direction)&&(style=ctx.canvas.style,original=[style.getPropertyValue("direction"),style.getPropertyPriority("direction")],style.setProperty("direction",direction,"important"),ctx.prevTextDirection=original)}function restoreTextDirection(ctx,original){void 0!==original&&(delete ctx.prevTextDirection,ctx.canvas.style.setProperty("direction",original[0],original[1]))}function propertyFn(property){return"angle"===property?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(a,b)=>a-b,normalize:x=>x}}function normalizeSegment({start,end,count,loop,style}){return{start:start%count,end:end%count,loop:loop&&(end-start+1)%count==0,style}}function getSegment(segment,points,bounds){const{property,start:startBound,end:endBound}=bounds,{between,normalize}=propertyFn(property),count=points.length;let i,ilen,{start,end,loop}=segment;if(loop){for(start+=count,end+=count,i=0,ilen=count;ibetween(startBound,prevValue,value)&&0!==compare(startBound,prevValue),"startIsBefore"),endIsBefore=__name(()=>0===compare(endBound,value)||between(endBound,prevValue,value),"endIsBefore"),shouldStart=__name(()=>inside||startIsBefore(),"shouldStart"),shouldStop=__name(()=>!inside||endIsBefore(),"shouldStop");for(let i=start,prev=start;i<=end;++i)point=points[i%count],!point.skip&&(value=normalize(point[property]),value!==prevValue&&(inside=between(value,startBound,endBound),null===subStart&&shouldStart()&&(subStart=0===compare(value,startBound)?i:prev),null!==subStart&&shouldStop()&&(result.push(normalizeSegment({start:subStart,end:i,loop,count,style})),subStart=null),prev=i,prevValue=value));return null!==subStart&&result.push(normalizeSegment({start:subStart,end,loop,count,style})),result}function _boundSegments(line,bounds){const result=[],segments=line.segments;for(let i=0;istart&&points[end%count].skip;)end--;return end%=count,{start,end}}function solidSegments(points,start,max,loop){const count=points.length,result=[];let end,last=start,prev=points[start];for(end=start+1;end<=max;++end){const cur=points[end%count];cur.skip||cur.stop?prev.skip||(loop=!1,result.push({start:start%count,end:(end-1)%count,loop}),start=last=cur.stop?end:null):(last=end,prev.skip&&(start=end)),prev=cur}return null!==last&&result.push({start:start%count,end:last%count,loop}),result}function _computeSegments(line,segmentOptions){const points=line.points,spanGaps=line.options.spanGaps,count=points.length;if(!count)return[];const loop=!!line._loop,{start,end}=findStartAndEnd(points,count,loop,spanGaps);if(!0===spanGaps)return splitByStyles(line,[{start,end,loop}],points,segmentOptions);return splitByStyles(line,solidSegments(points,start,endfn({chart,initial:anims.initial,numSteps,currentStep:Math.min(date-anims.start,numSteps)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(date=Date.now()){let remaining=0;this._charts.forEach((anims,chart)=>{if(!anims.running||!anims.items.length)return;const items=anims.items;let item,i=items.length-1,draw2=!1;for(;i>=0;--i)item=items[i],item._active?(item._total>anims.duration&&(anims.duration=item._total),item.tick(date),draw2=!0):(items[i]=items[items.length-1],items.pop());draw2&&(chart.draw(),this._notify(chart,anims,date,"progress")),items.length||(anims.running=!1,this._notify(chart,anims,date,"complete"),anims.initial=!1),remaining+=items.length}),this._lastDate=date,0===remaining&&(this._running=!1)}_getAnims(chart){const charts=this._charts;let anims=charts.get(chart);return anims||(anims={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},charts.set(chart,anims)),anims}listen(chart,event,cb){this._getAnims(chart).listeners[event].push(cb)}add(chart,items){!items||!items.length||this._getAnims(chart).items.push(...items)}has(chart){return this._getAnims(chart).items.length>0}start(chart){const anims=this._charts.get(chart);!anims||(anims.running=!0,anims.start=Date.now(),anims.duration=anims.items.reduce((acc,cur)=>Math.max(acc,cur._duration),0),this._refresh())}running(chart){if(!this._running)return!1;const anims=this._charts.get(chart);return!(!anims||!anims.running||!anims.items.length)}stop(chart){const anims=this._charts.get(chart);if(!anims||!anims.items.length)return;const items=anims.items;let i=items.length-1;for(;i>=0;--i)items[i].cancel();anims.items=[],this._notify(chart,anims,Date.now(),"complete")}remove(chart){return this._charts.delete(chart)}}__name(Animator,"Animator");var animator=new Animator;const interpolators={boolean:(from2,to2,factor)=>factor>.5?to2:from2,color(from2,to2,factor){const c0=color(from2||"transparent"),c1=c0.valid&&color(to2||"transparent");return c1&&c1.valid?c1.mix(c0,factor).hexString():to2},number:(from2,to2,factor)=>from2+(to2-from2)*factor};class Animation{constructor(cfg,target,prop,to2){const currentValue=target[prop];to2=resolve([cfg.to,to2,currentValue,cfg.from]);const from2=resolve([cfg.from,currentValue,to2]);this._active=!0,this._fn=cfg.fn||interpolators[cfg.type||typeof from2],this._easing=effects[cfg.easing]||effects.linear,this._start=Math.floor(Date.now()+(cfg.delay||0)),this._duration=this._total=Math.floor(cfg.duration),this._loop=!!cfg.loop,this._target=target,this._prop=prop,this._from=from2,this._to=to2,this._promises=void 0}active(){return this._active}update(cfg,to2,date){if(this._active){this._notify(!1);const currentValue=this._target[this._prop],elapsed=date-this._start,remain=this._duration-elapsed;this._start=date,this._duration=Math.floor(Math.max(remain,cfg.duration)),this._total+=elapsed,this._loop=!!cfg.loop,this._to=resolve([cfg.to,to2,currentValue,cfg.from]),this._from=resolve([cfg.from,currentValue,to2])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(date){const elapsed=date-this._start,duration=this._duration,prop=this._prop,from2=this._from,loop=this._loop,to2=this._to;let factor;if(this._active=from2!==to2&&(loop||elapsed1?2-factor:factor,factor=this._easing(Math.min(1,Math.max(0,factor))),this._target[prop]=this._fn(from2,to2,factor))}wait(){const promises=this._promises||(this._promises=[]);return new Promise((res,rej)=>{promises.push({res,rej})})}_notify(resolved){const method=resolved?"res":"rej",promises=this._promises||[];for(let i=0;i"onProgress"!==name&&"onComplete"!==name&&"fn"!==name}),defaults.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),defaults.describe("animations",{_fallback:"animation"}),defaults.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:v=>0|v}}}});class Animations{constructor(chart,config){this._chart=chart,this._properties=new Map,this.configure(config)}configure(config){if(!isObject(config))return;const animatedProps=this._properties;Object.getOwnPropertyNames(config).forEach(key=>{const cfg=config[key];if(!isObject(cfg))return;const resolved={};for(const option of animationOptions)resolved[option]=cfg[option];(isArray(cfg.properties)&&cfg.properties||[key]).forEach(prop=>{(prop===key||!animatedProps.has(prop))&&animatedProps.set(prop,resolved)})})}_animateOptions(target,values){const newOptions=values.options,options=resolveTargetOptions(target,newOptions);if(!options)return[];const animations=this._createAnimations(options,newOptions);return newOptions.$shared&&awaitAll(target.options.$animations,newOptions).then(()=>{target.options=newOptions},()=>{}),animations}_createAnimations(target,values){const animatedProps=this._properties,animations=[],running=target.$animations||(target.$animations={}),props=Object.keys(values),date=Date.now();let i;for(i=props.length-1;i>=0;--i){const prop=props[i];if("$"===prop.charAt(0))continue;if("options"===prop){animations.push(...this._animateOptions(target,values));continue}const value=values[prop];let animation=running[prop];const cfg=animatedProps.get(prop);if(animation){if(cfg&&animation.active()){animation.update(cfg,value,date);continue}animation.cancel()}cfg&&cfg.duration?(running[prop]=animation=new Animation(cfg,target,prop,value),animations.push(animation)):target[prop]=value}return animations}update(target,values){if(0===this._properties.size)return void Object.assign(target,values);const animations=this._createAnimations(target,values);return animations.length?(animator.add(this._chart,animations),!0):void 0}}function awaitAll(animations,properties){const running=[],keys=Object.keys(properties);for(let i=0;i0||!positive&&value<0)return meta.index}return null}function updateStacks(controller,parsed){const{chart,_cachedMeta:meta}=controller,stacks=chart._stacks||(chart._stacks={}),{iScale,vScale,index:datasetIndex}=meta,iAxis=iScale.axis,vAxis=vScale.axis,key=getStackKey(iScale,vScale,meta),ilen=parsed.length;let stack;for(let i=0;iscales2[key].axis===axis).shift()}function createDatasetContext(parent,index2){return createContext(parent,{active:!1,dataset:void 0,datasetIndex:index2,index:index2,mode:"default",type:"dataset"})}function createDataContext(parent,index2,element){return createContext(parent,{active:!1,dataIndex:index2,parsed:void 0,raw:void 0,element,index:index2,mode:"default",type:"data"})}function clearStacks(meta,items){const datasetIndex=meta.controller.index,axis=meta.vScale&&meta.vScale.axis;if(axis){items=items||meta._parsed;for(const parsed of items){const stacks=parsed._stacks;if(!stacks||void 0===stacks[axis]||void 0===stacks[axis][datasetIndex])return;delete stacks[axis][datasetIndex]}}}__name(Animations,"Animations"),__name(awaitAll,"awaitAll"),__name(resolveTargetOptions,"resolveTargetOptions"),__name(scaleClip,"scaleClip"),__name(defaultClip,"defaultClip"),__name(toClip,"toClip"),__name(getSortedDatasetIndices,"getSortedDatasetIndices"),__name(applyStack,"applyStack"),__name(convertObjectDataToArray,"convertObjectDataToArray"),__name(isStacked,"isStacked"),__name(getStackKey,"getStackKey"),__name(getUserBounds,"getUserBounds"),__name(getOrCreateStack,"getOrCreateStack"),__name(getLastIndexInStack,"getLastIndexInStack"),__name(updateStacks,"updateStacks"),__name(getFirstScaleId,"getFirstScaleId"),__name(createDatasetContext,"createDatasetContext"),__name(createDataContext,"createDataContext"),__name(clearStacks,"clearStacks");const isDirectUpdateMode=__name(mode=>"reset"===mode||"none"===mode,"isDirectUpdateMode"),cloneIfNotShared=__name((cached,shared)=>shared?cached:Object.assign({},cached),"cloneIfNotShared"),createStack=__name((canStack,meta,chart)=>canStack&&!meta.hidden&&meta._stacked&&{keys:getSortedDatasetIndices(chart,!0),values:null},"createStack");class DatasetController{constructor(chart,datasetIndex){this.chart=chart,this._ctx=chart.ctx,this.index=datasetIndex,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 meta=this._cachedMeta;this.configure(),this.linkScales(),meta._stacked=isStacked(meta.vScale,meta),this.addElements()}updateIndex(datasetIndex){this.index!==datasetIndex&&clearStacks(this._cachedMeta),this.index=datasetIndex}linkScales(){const chart=this.chart,meta=this._cachedMeta,dataset=this.getDataset(),chooseId=__name((axis,x,y,r)=>"x"===axis?x:"r"===axis?r:y,"chooseId"),xid=meta.xAxisID=valueOrDefault(dataset.xAxisID,getFirstScaleId(chart,"x")),yid=meta.yAxisID=valueOrDefault(dataset.yAxisID,getFirstScaleId(chart,"y")),rid=meta.rAxisID=valueOrDefault(dataset.rAxisID,getFirstScaleId(chart,"r")),indexAxis=meta.indexAxis,iid=meta.iAxisID=chooseId(indexAxis,xid,yid,rid),vid=meta.vAxisID=chooseId(indexAxis,yid,xid,rid);meta.xScale=this.getScaleForId(xid),meta.yScale=this.getScaleForId(yid),meta.rScale=this.getScaleForId(rid),meta.iScale=this.getScaleForId(iid),meta.vScale=this.getScaleForId(vid)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(scaleID){return this.chart.scales[scaleID]}_getOtherScale(scale){const meta=this._cachedMeta;return scale===meta.iScale?meta.vScale:meta.iScale}reset(){this._update("reset")}_destroy(){const meta=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),meta._stacked&&clearStacks(meta)}_dataCheck(){const dataset=this.getDataset(),data=dataset.data||(dataset.data=[]),_data=this._data;if(isObject(data))this._data=convertObjectDataToArray(data);else if(_data!==data){if(_data){unlistenArrayEvents(_data,this);const meta=this._cachedMeta;clearStacks(meta),meta._parsed=[]}data&&Object.isExtensible(data)&&listenArrayEvents(data,this),this._syncList=[],this._data=data}}addElements(){const meta=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(meta.dataset=new this.datasetElementType)}buildOrUpdateElements(resetNewElements){const meta=this._cachedMeta,dataset=this.getDataset();let stackChanged=!1;this._dataCheck();const oldStacked=meta._stacked;meta._stacked=isStacked(meta.vScale,meta),meta.stack!==dataset.stack&&(stackChanged=!0,clearStacks(meta),meta.stack=dataset.stack),this._resyncElements(resetNewElements),(stackChanged||oldStacked!==meta._stacked)&&updateStacks(this,meta._parsed)}configure(){const config=this.chart.config,scopeKeys=config.datasetScopeKeys(this._type),scopes=config.getOptionScopes(this.getDataset(),scopeKeys,!0);this.options=config.createResolver(scopes,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(start,count){const{_cachedMeta:meta,_data:data}=this,{iScale,_stacked}=meta,iAxis=iScale.axis;let i,cur,parsed,sorted=0===start&&count===data.length||meta._sorted,prev=start>0&&meta._parsed[start-1];if(!1===this._parsing)meta._parsed=data,meta._sorted=!0,parsed=data;else{parsed=isArray(data[start])?this.parseArrayData(meta,data,start,count):isObject(data[start])?this.parseObjectData(meta,data,start,count):this.parsePrimitiveData(meta,data,start,count);const isNotInOrderComparedToPrev=__name(()=>null===cur[iAxis]||prev&&cur[iAxis]otherValue||otherMax=0;--i)if(!_skip()){this.updateRangeFromParsed(range,scale,parsed,stack);break}return range}getAllParsedValues(scale){const parsed=this._cachedMeta._parsed,values=[];let i,ilen,value;for(i=0,ilen=parsed.length;i=0&&index2this.getContext(index2,active),"context"),values=config.resolveNamedOptions(scopes,names2,context,prefixes);return values.$shared&&(values.$shared=sharing,cache[cacheKey]=Object.freeze(cloneIfNotShared(values,sharing))),values}_resolveAnimations(index2,transition,active){const chart=this.chart,cache=this._cachedDataOpts,cacheKey=`animation-${transition}`,cached=cache[cacheKey];if(cached)return cached;let options;if(!1!==chart.options.animation){const config=this.chart.config,scopeKeys=config.datasetAnimationScopeKeys(this._type,transition),scopes=config.getOptionScopes(this.getDataset(),scopeKeys);options=config.createResolver(scopes,this.getContext(index2,active,transition))}const animations=new Animations(chart,options&&options.animations);return options&&options._cacheable&&(cache[cacheKey]=Object.freeze(animations)),animations}getSharedOptions(options){if(options.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},options))}includeOptions(mode,sharedOptions){return!sharedOptions||isDirectUpdateMode(mode)||this.chart._animationsDisabled}updateElement(element,index2,properties,mode){isDirectUpdateMode(mode)?Object.assign(element,properties):this._resolveAnimations(index2,mode).update(element,properties)}updateSharedOptions(sharedOptions,mode,newOptions){sharedOptions&&!isDirectUpdateMode(mode)&&this._resolveAnimations(void 0,mode).update(sharedOptions,newOptions)}_setStyle(element,index2,mode,active){element.active=active;const options=this.getStyle(index2,active);this._resolveAnimations(index2,mode,active).update(element,{options:!active&&this.getSharedOptions(options)||options})}removeHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!1)}setHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!0)}_removeDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!1)}_setDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!0)}_resyncElements(resetNewElements){const data=this._data,elements=this._cachedMeta.data;for(const[method,arg1,arg2]of this._syncList)this[method](arg1,arg2);this._syncList=[];const numMeta=elements.length,numData=data.length,count=Math.min(numData,numMeta);count&&this.parse(0,count),numData>numMeta?this._insertElements(numMeta,numData-numMeta,resetNewElements):numData{for(arr.length+=count,i=arr.length-1;i>=end;i--)arr[i]=arr[i-count]},"move");for(move(data),i=start;ia-b))}return scale._cache.$bar}function computeMinSampleSize(meta){const scale=meta.iScale,values=getAllScaleValues(scale,meta.type);let i,ilen,curr,prev,min=scale._length;const updateMinAndPrev=__name(()=>{32767===curr||-32768===curr||(defined(prev)&&(min=Math.min(min,Math.abs(curr-prev)||min)),prev=curr)},"updateMinAndPrev");for(i=0,ilen=values.length;i0?pixels[index2-1]:null,next=index2Math.abs(max)&&(barStart=max,barEnd=min),item[vScale.axis]=barEnd,item._custom={barStart,barEnd,start:startValue,end:endValue,min,max}}function parseValue(entry,item,vScale,i){return isArray(entry)?parseFloatBar(entry,item,vScale,i):item[vScale.axis]=vScale.parse(entry,i),item}function parseArrayOrPrimitive(meta,data,start,count){const iScale=meta.iScale,vScale=meta.vScale,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=[];let i,ilen,item,entry;for(i=start,ilen=start+count;i=actualBase?1:-1)}function borderProps(properties){let reverse,start,end,top,bottom;return properties.horizontal?(reverse=properties.base>properties.x,start="left",end="right"):(reverse=properties.base=0;--i)max=Math.max(max,data[i].size(this.resolveDataElementOptions(i))/2);return max>0&&max}getLabelAndValue(index2){const meta=this._cachedMeta,{xScale,yScale}=meta,parsed=this.getParsed(index2),x=xScale.getLabelForValue(parsed.x),y=yScale.getLabelForValue(parsed.y),r=parsed._custom;return{label:meta.label,value:"("+x+", "+y+(r?", "+r:"")+")"}}update(mode){const points=this._cachedMeta.data;this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis;for(let i=start;i_angleBetween(angle,startAngle,endAngle,!0)?1:Math.max(a,a*cutout,b,b*cutout),"calcMax"),calcMin=__name((angle,a,b)=>_angleBetween(angle,startAngle,endAngle,!0)?-1:Math.min(a,a*cutout,b,b*cutout),"calcMin"),maxX=calcMax(0,startX,endX),maxY=calcMax(HALF_PI,startY,endY),minX=calcMin(PI,startX,endX),minY=calcMin(PI+HALF_PI,startY,endY);ratioX=(maxX-minX)/2,ratioY=(maxY-minY)/2,offsetX=-(maxX+minX)/2,offsetY=-(maxY+minY)/2}return{ratioX,ratioY,offsetX,offsetY}}__name(BubbleController,"BubbleController"),BubbleController.id="bubble",BubbleController.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},BubbleController.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}},__name(getRatioAndOffset,"getRatioAndOffset");class DoughnutController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(start,count){const data=this.getDataset().data,meta=this._cachedMeta;if(!1===this._parsing)meta._parsed=data;else{let i,ilen,getter=__name(i2=>+data[i2],"getter");if(isObject(data[start])){const{key="value"}=this._parsing;getter=__name(i2=>+resolveObjectKey(data[i2],key),"getter")}for(i=start,ilen=start+count;i0&&!isNaN(value)?TAU*(Math.abs(value)/total):0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2],chart.options.locale);return{label:labels[index2]||"",value}}getMaxBorderWidth(arcs){let max=0;const chart=this.chart;let i,ilen,meta,controller,options;if(!arcs)for(i=0,ilen=chart.data.datasets.length;i"spacing"!==name,_indexable:name=>"spacing"!==name},DoughnutController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label(tooltipItem){let dataLabel=tooltipItem.label;const value=": "+tooltipItem.formattedValue;return isArray(dataLabel)?(dataLabel=dataLabel.slice(),dataLabel[0]+=value):dataLabel+=value,dataLabel}}}}};class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(mode){const meta=this._cachedMeta,{dataset:line,data:points=[],_dataset}=meta,animationsDisabled=this.chart._animationsDisabled;let{start,count}=getStartAndCountOfVisiblePoints(meta,points,animationsDisabled);this._drawStart=start,this._drawCount=count,scaleRangesChanged(meta)&&(start=0,count=points.length),line._chart=this.chart,line._datasetIndex=this.index,line._decimated=!!_dataset._decimated,line.points=points;const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0),options.segment=this.options.segment,this.updateElement(line,void 0,{animated:!animationsDisabled,options},mode),this.updateElements(points,start,count,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale,_stacked,_dataset}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis,{spanGaps,segment}=this.options,maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY,directUpdate=this.chart._animationsDisabled||reset||"none"===mode;let prevParsed=start>0&&this.getParsed(start-1);for(let i=start;i0&&Math.abs(parsed[iAxis]-prevParsed[iAxis])>maxGapLength,segment&&(properties.parsed=parsed,properties.raw=_dataset.data[i]),includeOptions&&(properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?"active":mode)),directUpdate||this.updateElement(point,i,properties,mode),prevParsed=parsed}this.updateSharedOptions(sharedOptions,mode,firstOpts)}getMaxOverflow(){const meta=this._cachedMeta,dataset=meta.dataset,border=dataset.options&&dataset.options.borderWidth||0,data=meta.data||[];if(!data.length)return border;const firstPoint=data[0].size(this.resolveDataElementOptions(0)),lastPoint=data[data.length-1].size(this.resolveDataElementOptions(data.length-1));return Math.max(border,firstPoint,lastPoint)/2}draw(){const meta=this._cachedMeta;meta.dataset.updateControlPoints(this.chart.chartArea,meta.iScale.axis),super.draw()}}function getStartAndCountOfVisiblePoints(meta,points,animationsDisabled){const pointCount=points.length;let start=0,count=pointCount;if(meta._sorted){const{iScale,_parsed}=meta,axis=iScale.axis,{min,max,minDefined,maxDefined}=iScale.getUserBounds();minDefined&&(start=_limitValue(Math.min(_lookupByKey(_parsed,iScale.axis,min).lo,animationsDisabled?pointCount:_lookupByKey(points,axis,iScale.getPixelForValue(min)).lo),0,pointCount-1)),count=maxDefined?_limitValue(Math.max(_lookupByKey(_parsed,iScale.axis,max).hi+1,animationsDisabled?0:_lookupByKey(points,axis,iScale.getPixelForValue(max)).hi+1),start,pointCount)-start:pointCount-start}return{start,count}}function scaleRangesChanged(meta){const{xScale,yScale,_scaleRanges}=meta,newRanges={xmin:xScale.min,xmax:xScale.max,ymin:yScale.min,ymax:yScale.max};if(!_scaleRanges)return meta._scaleRanges=newRanges,!0;const changed=_scaleRanges.xmin!==xScale.min||_scaleRanges.xmax!==xScale.max||_scaleRanges.ymin!==yScale.min||_scaleRanges.ymax!==yScale.max;return Object.assign(_scaleRanges,newRanges),changed}__name(LineController,"LineController"),LineController.id="line",LineController.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},LineController.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}},__name(getStartAndCountOfVisiblePoints,"getStartAndCountOfVisiblePoints"),__name(scaleRangesChanged,"scaleRangesChanged");class PolarAreaController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2].r,chart.options.locale);return{label:labels[index2]||"",value}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const arcs=this._cachedMeta.data;this._updateRadius(),this.updateElements(arcs,0,arcs.length,mode)}getMinMax(){const meta=this._cachedMeta,range={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return meta.data.forEach((element,index2)=>{const parsed=this.getParsed(index2).r;!isNaN(parsed)&&this.chart.getDataVisibility(index2)&&(parsedrange.max&&(range.max=parsed))}),range}_updateRadius(){const chart=this.chart,chartArea=chart.chartArea,opts=chart.options,minSize=Math.min(chartArea.right-chartArea.left,chartArea.bottom-chartArea.top),outerRadius=Math.max(minSize/2,0),radiusLength=(outerRadius-Math.max(opts.cutoutPercentage?outerRadius/100*opts.cutoutPercentage:1,0))/chart.getVisibleDatasetCount();this.outerRadius=outerRadius-radiusLength*this.index,this.innerRadius=this.outerRadius-radiusLength}updateElements(arcs,start,count,mode){const reset="reset"===mode,chart=this.chart,animationOpts=chart.options.animation,scale=this._cachedMeta.rScale,centerX=scale.xCenter,centerY=scale.yCenter,datasetStartAngle=scale.getIndexAngle(0)-.5*PI;let i,angle=datasetStartAngle;const defaultAngle=360/this.countVisibleElements();for(i=0;i{!isNaN(this.getParsed(index2).r)&&this.chart.getDataVisibility(index2)&&count++}),count}_computeAngle(index2,mode,defaultAngle){return this.chart.getDataVisibility(index2)?toRadians(this.resolveDataElementOptions(index2,mode).angle||defaultAngle):0}}__name(PolarAreaController,"PolarAreaController"),PolarAreaController.id="polarArea",PolarAreaController.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},PolarAreaController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label:context=>context.chart.data.labels[context.dataIndex]+": "+context.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class PieController extends DoughnutController{}__name(PieController,"PieController"),PieController.id="pie",PieController.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class RadarController extends DatasetController{getLabelAndValue(index2){const vScale=this._cachedMeta.vScale,parsed=this.getParsed(index2);return{label:vScale.getLabels()[index2],value:""+vScale.getLabelForValue(parsed[vScale.axis])}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const meta=this._cachedMeta,line=meta.dataset,points=meta.data||[],labels=meta.iScale.getLabels();if(line.points=points,"resize"!==mode){const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0);const properties={_loop:!0,_fullLoop:labels.length===points.length,options};this.updateElement(line,void 0,properties,mode)}this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const scale=this._cachedMeta.rScale,reset="reset"===mode;for(let i=start;i"",label:item=>"("+item.label+", "+item.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function chart_esm_abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}__name(chart_esm_abstract,"chart_esm_abstract");class DateAdapter{constructor(options){this.options=options||{}}formats(){return chart_esm_abstract()}parse(value,format){return chart_esm_abstract()}format(timestamp,format){return chart_esm_abstract()}add(timestamp,amount,unit){return chart_esm_abstract()}diff(a,b,unit){return chart_esm_abstract()}startOf(timestamp,unit,weekday){return chart_esm_abstract()}endOf(timestamp,unit){return chart_esm_abstract()}}__name(DateAdapter,"DateAdapter"),DateAdapter.override=function(members){Object.assign(DateAdapter.prototype,members)};var adapters={_date:DateAdapter};function binarySearch(metaset,axis,value,intersect){const{controller,data,_sorted}=metaset,iScale=controller._cachedMeta.iScale;if(iScale&&axis===iScale.axis&&"r"!==axis&&_sorted&&data.length){const lookupMethod=iScale._reversePixels?_rlookupByKey:_lookupByKey;if(!intersect)return lookupMethod(data,axis,value);if(controller._sharedOptions){const el=data[0],range="function"==typeof el.getRange&&el.getRange(axis);if(range){const start=lookupMethod(data,axis,value-range),end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi}}}}return{lo:0,hi:data.length-1}}function evaluateInteractionItems(chart,axis,position,handler,intersect){const metasets=chart.getSortedVisibleDatasetMetas(),value=position[axis];for(let i=0,ilen=metasets.length;i{element[rangeMethod](position[axis],useFinalPosition)&&(items.push({element,datasetIndex,index:index2}),intersectsItem=intersectsItem||element.inRange(position.x,position.y,useFinalPosition))}),intersect&&!intersectsItem?[]:items}__name(binarySearch,"binarySearch"),__name(evaluateInteractionItems,"evaluateInteractionItems"),__name(getDistanceMetricForAxis,"getDistanceMetricForAxis"),__name(getIntersectItems,"getIntersectItems"),__name(getNearestRadialItems,"getNearestRadialItems"),__name(getNearestCartesianItems,"getNearestCartesianItems"),__name(getNearestItems,"getNearestItems"),__name(getAxisItems,"getAxisItems");var Interaction={evaluateInteractionItems,modes:{index(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"x",includeInvisible=options.includeInvisible||!1,items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible),elements=[];return items.length?(chart.getSortedVisibleDatasetMetas().forEach(meta=>{const index2=items[0].index,element=meta.data[index2];element&&!element.skip&&elements.push({element,datasetIndex:meta.index,index:index2})}),elements):[]},dataset(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;let items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible);if(items.length>0){const datasetIndex=items[0].datasetIndex,data=chart.getDatasetMeta(datasetIndex).data;items=[];for(let i=0;igetIntersectItems(chart,getRelativePosition(e,chart),options.axis||"xy",useFinalPosition,options.includeInvisible||!1),nearest(chart,e,options,useFinalPosition){const position=getRelativePosition(e,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;return getNearestItems(chart,position,axis,options.intersect,useFinalPosition,includeInvisible)},x:(chart,e,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e,chart),"x",options.intersect,useFinalPosition),y:(chart,e,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e,chart),"y",options.intersect,useFinalPosition)}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(array,position){return array.filter(v=>v.pos===position)}function filterDynamicPositionByAxis(array,axis){return array.filter(v=>-1===STATIC_POSITIONS.indexOf(v.pos)&&v.box.axis===axis)}function sortByWeight(array,reverse){return array.sort((a,b)=>{const v0=reverse?b:a,v1=reverse?a:b;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight})}function wrapBoxes(boxes){const layoutBoxes=[];let i,ilen,box,pos,stack,stackWeight;for(i=0,ilen=(boxes||[]).length;iwrap.box.fullSize),!0),left=sortByWeight(filterByPosition(layoutBoxes,"left"),!0),right=sortByWeight(filterByPosition(layoutBoxes,"right")),top=sortByWeight(filterByPosition(layoutBoxes,"top"),!0),bottom=sortByWeight(filterByPosition(layoutBoxes,"bottom")),centerHorizontal=filterDynamicPositionByAxis(layoutBoxes,"x"),centerVertical=filterDynamicPositionByAxis(layoutBoxes,"y");return{fullSize,leftAndTop:left.concat(top),rightAndBottom:right.concat(centerVertical).concat(bottom).concat(centerHorizontal),chartArea:filterByPosition(layoutBoxes,"chartArea"),vertical:left.concat(right).concat(centerVertical),horizontal:top.concat(bottom).concat(centerHorizontal)}}function getCombinedMax(maxPadding,chartArea,a,b){return Math.max(maxPadding[a],chartArea[a])+Math.max(maxPadding[b],chartArea[b])}function updateMaxPadding(maxPadding,boxPadding){maxPadding.top=Math.max(maxPadding.top,boxPadding.top),maxPadding.left=Math.max(maxPadding.left,boxPadding.left),maxPadding.bottom=Math.max(maxPadding.bottom,boxPadding.bottom),maxPadding.right=Math.max(maxPadding.right,boxPadding.right)}function updateDims(chartArea,params,layout,stacks){const{pos,box}=layout,maxPadding=chartArea.maxPadding;if(!isObject(pos)){layout.size&&(chartArea[pos]-=layout.size);const stack=stacks[layout.stack]||{size:0,count:1};stack.size=Math.max(stack.size,layout.horizontal?box.height:box.width),layout.size=stack.size/stack.count,chartArea[pos]+=layout.size}box.getPadding&&updateMaxPadding(maxPadding,box.getPadding());const newWidth=Math.max(0,params.outerWidth-getCombinedMax(maxPadding,chartArea,"left","right")),newHeight=Math.max(0,params.outerHeight-getCombinedMax(maxPadding,chartArea,"top","bottom")),widthChanged=newWidth!==chartArea.w,heightChanged=newHeight!==chartArea.h;return chartArea.w=newWidth,chartArea.h=newHeight,layout.horizontal?{same:widthChanged,other:heightChanged}:{same:heightChanged,other:widthChanged}}function handleMaxPadding(chartArea){const maxPadding=chartArea.maxPadding;function updatePos(pos){const change=Math.max(maxPadding[pos]-chartArea[pos],0);return chartArea[pos]+=change,change}__name(updatePos,"updatePos"),chartArea.y+=updatePos("top"),chartArea.x+=updatePos("left"),updatePos("right"),updatePos("bottom")}function getMargins(horizontal,chartArea){const maxPadding=chartArea.maxPadding;function marginForPositions(positions2){const margin={left:0,top:0,right:0,bottom:0};return positions2.forEach(pos=>{margin[pos]=Math.max(chartArea[pos],maxPadding[pos])}),margin}return __name(marginForPositions,"marginForPositions"),marginForPositions(horizontal?["left","right"]:["top","bottom"])}function fitBoxes(boxes,chartArea,params,stacks){const refitBoxes=[];let i,ilen,layout,box,refit,changed;for(i=0,ilen=boxes.length,refit=0;i{"function"==typeof box.beforeLayout&&box.beforeLayout()});const visibleVerticalBoxCount=verticalBoxes.reduce((total,wrap)=>wrap.box.options&&!1===wrap.box.options.display?total:total+1,0)||1,params=Object.freeze({outerWidth:width,outerHeight:height,padding,availableWidth,availableHeight,vBoxMaxWidth:availableWidth/2/visibleVerticalBoxCount,hBoxMaxHeight:availableHeight/2}),maxPadding=Object.assign({},padding);updateMaxPadding(maxPadding,toPadding(minPadding));const chartArea=Object.assign({maxPadding,w:availableWidth,h:availableHeight,x:padding.left,y:padding.top},padding),stacks=setLayoutDims(verticalBoxes.concat(horizontalBoxes),params);fitBoxes(boxes.fullSize,chartArea,params,stacks),fitBoxes(verticalBoxes,chartArea,params,stacks),fitBoxes(horizontalBoxes,chartArea,params,stacks)&&fitBoxes(verticalBoxes,chartArea,params,stacks),handleMaxPadding(chartArea),placeBoxes(boxes.leftAndTop,chartArea,params,stacks),chartArea.x+=chartArea.w,chartArea.y+=chartArea.h,placeBoxes(boxes.rightAndBottom,chartArea,params,stacks),chart.chartArea={left:chartArea.left,top:chartArea.top,right:chartArea.left+chartArea.w,bottom:chartArea.top+chartArea.h,height:chartArea.h,width:chartArea.w},each(boxes.chartArea,layout=>{const box=layout.box;Object.assign(box,chart.chartArea),box.update(chartArea.w,chartArea.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(canvas,aspectRatio){}releaseContext(context){return!1}addEventListener(chart,type,listener){}removeEventListener(chart,type,listener){}getDevicePixelRatio(){return 1}getMaximumSize(element,width,height,aspectRatio){return width=Math.max(0,width||element.width),height=height||element.height,{width,height:Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height)}}isAttached(canvas){return!0}updateConfig(config){}}__name(BasePlatform,"BasePlatform");class BasicPlatform extends BasePlatform{acquireContext(item){return item&&item.getContext&&item.getContext("2d")||null}updateConfig(config){config.options.animation=!1}}__name(BasicPlatform,"BasicPlatform");const EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=__name(value=>null===value||""===value,"isNullOrEmpty");function initCanvas(canvas,aspectRatio){const style=canvas.style,renderHeight=canvas.getAttribute("height"),renderWidth=canvas.getAttribute("width");if(canvas.$chartjs={initial:{height:renderHeight,width:renderWidth,style:{display:style.display,height:style.height,width:style.width}}},style.display=style.display||"block",style.boxSizing=style.boxSizing||"border-box",isNullOrEmpty(renderWidth)){const displayWidth=readUsedSize(canvas,"width");void 0!==displayWidth&&(canvas.width=displayWidth)}if(isNullOrEmpty(renderHeight))if(""===canvas.style.height)canvas.height=canvas.width/(aspectRatio||2);else{const displayHeight=readUsedSize(canvas,"height");void 0!==displayHeight&&(canvas.height=displayHeight)}return canvas}__name(initCanvas,"initCanvas");const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(node,type,listener){node.addEventListener(type,listener,eventListenerOptions)}function removeListener(chart,type,listener){chart.canvas.removeEventListener(type,listener,eventListenerOptions)}function fromNativeEvent(event,chart){const type=EVENT_TYPES[event.type]||event.type,{x,y}=getRelativePosition(event,chart);return{type,chart,native:event,x:void 0!==x?x:null,y:void 0!==y?y:null}}function nodeListContains(nodeList,canvas){for(const node of nodeList)if(node===canvas||node.contains(canvas))return!0}function createAttachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.addedNodes,canvas),trigger=trigger&&!nodeListContains(entry.removedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}function createDetachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.removedNodes,canvas),trigger=trigger&&!nodeListContains(entry.addedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}__name(addListener,"addListener"),__name(removeListener,"removeListener"),__name(fromNativeEvent,"fromNativeEvent"),__name(nodeListContains,"nodeListContains"),__name(createAttachObserver,"createAttachObserver"),__name(createDetachObserver,"createDetachObserver");const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const dpr=window.devicePixelRatio;dpr!==oldDevicePixelRatio&&(oldDevicePixelRatio=dpr,drpListeningCharts.forEach((resize,chart)=>{chart.currentDevicePixelRatio!==dpr&&resize()}))}function listenDevicePixelRatioChanges(chart,resize){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(chart,resize)}function unlistenDevicePixelRatioChanges(chart){drpListeningCharts.delete(chart),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(chart,type,listener){const canvas=chart.canvas,container=canvas&&_getParentNode(canvas);if(!container)return;const resize=throttled((width,height)=>{const w=container.clientWidth;listener(width,height),w{const entry=entries[0],width=entry.contentRect.width,height=entry.contentRect.height;0===width&&0===height||resize(width,height)});return observer.observe(container),listenDevicePixelRatioChanges(chart,resize),observer}function releaseObserver(chart,type,observer){observer&&observer.disconnect(),"resize"===type&&unlistenDevicePixelRatioChanges(chart)}function createProxyAndListen(chart,type,listener){const canvas=chart.canvas,proxy=throttled(event=>{null!==chart.ctx&&listener(fromNativeEvent(event,chart))},chart,args=>{const event=args[0];return[event,event.offsetX,event.offsetY]});return addListener(canvas,type,proxy),proxy}__name(onWindowResize,"onWindowResize"),__name(listenDevicePixelRatioChanges,"listenDevicePixelRatioChanges"),__name(unlistenDevicePixelRatioChanges,"unlistenDevicePixelRatioChanges"),__name(createResizeObserver,"createResizeObserver"),__name(releaseObserver,"releaseObserver"),__name(createProxyAndListen,"createProxyAndListen");class DomPlatform extends BasePlatform{acquireContext(canvas,aspectRatio){const context=canvas&&canvas.getContext&&canvas.getContext("2d");return context&&context.canvas===canvas?(initCanvas(canvas,aspectRatio),context):null}releaseContext(context){const canvas=context.canvas;if(!canvas.$chartjs)return!1;const initial=canvas.$chartjs.initial;["height","width"].forEach(prop=>{const value=initial[prop];isNullOrUndef(value)?canvas.removeAttribute(prop):canvas.setAttribute(prop,value)});const style=initial.style||{};return Object.keys(style).forEach(key=>{canvas.style[key]=style[key]}),canvas.width=canvas.width,delete canvas.$chartjs,!0}addEventListener(chart,type,listener){this.removeEventListener(chart,type);const proxies=chart.$proxies||(chart.$proxies={}),handler={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[type]||createProxyAndListen;proxies[type]=handler(chart,type,listener)}removeEventListener(chart,type){const proxies=chart.$proxies||(chart.$proxies={}),proxy=proxies[type];proxy&&(({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[type]||removeListener)(chart,type,proxy),proxies[type]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(canvas,width,height,aspectRatio){return getMaximumSize(canvas,width,height,aspectRatio)}isAttached(canvas){const container=_getParentNode(canvas);return!(!container||!container.isConnected)}}function _detectPlatform(canvas){return!_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&canvas instanceof OffscreenCanvas?BasicPlatform:DomPlatform}__name(DomPlatform,"DomPlatform"),__name(_detectPlatform,"_detectPlatform");class Element{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(useFinalPosition){const{x,y}=this.getProps(["x","y"],useFinalPosition);return{x,y}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(props,final){const anims=this.$animations;if(!final||!anims)return this;const ret={};return props.forEach(prop=>{ret[prop]=anims[prop]&&anims[prop].active()?anims[prop]._to:this[prop]}),ret}}__name(Element,"Element"),Element.defaults={},Element.defaultRoutes=void 0;const formatters={values:value=>isArray(value)?value:""+value,numeric(tickValue,index2,ticks){if(0===tickValue)return"0";const locale=this.chart.options.locale;let notation,delta=tickValue;if(ticks.length>1){const maxTick=Math.max(Math.abs(ticks[0].value),Math.abs(ticks[ticks.length-1].value));(maxTick<1e-4||maxTick>1e15)&&(notation="scientific"),delta=calculateDelta(tickValue,ticks)}const logDelta=log10(Math.abs(delta)),numDecimal=Math.max(Math.min(-1*Math.floor(logDelta),20),0),options={notation,minimumFractionDigits:numDecimal,maximumFractionDigits:numDecimal};return Object.assign(options,this.options.ticks.format),formatNumber(tickValue,locale,options)},logarithmic(tickValue,index2,ticks){if(0===tickValue)return"0";const remain=tickValue/Math.pow(10,Math.floor(log10(tickValue)));return 1===remain||2===remain||5===remain?formatters.numeric.call(this,tickValue,index2,ticks):""}};function calculateDelta(tickValue,ticks){let delta=ticks.length>3?ticks[2].value-ticks[1].value:ticks[1].value-ticks[0].value;return Math.abs(delta)>=1&&tickValue!==Math.floor(tickValue)&&(delta=tickValue-Math.floor(tickValue)),delta}__name(calculateDelta,"calculateDelta");var Ticks={formatters};function autoSkip(scale,ticks){const tickOpts=scale.options.ticks,ticksLimit=tickOpts.maxTicksLimit||determineMaxTicks(scale),majorIndices=tickOpts.major.enabled?getMajorIndices(ticks):[],numMajorIndices=majorIndices.length,first=majorIndices[0],last=majorIndices[numMajorIndices-1],newTicks=[];if(numMajorIndices>ticksLimit)return skipMajors(ticks,newTicks,majorIndices,numMajorIndices/ticksLimit),newTicks;const spacing=calculateSpacing(majorIndices,ticks,ticksLimit);if(numMajorIndices>0){let i,ilen;const avgMajorSpacing=numMajorIndices>1?Math.round((last-first)/(numMajorIndices-1)):null;for(skip(ticks,newTicks,spacing,isNullOrUndef(avgMajorSpacing)?0:first-avgMajorSpacing,first),i=0,ilen=numMajorIndices-1;ispacing)return factor}return Math.max(spacing,1)}function getMajorIndices(ticks){const result=[];let i,ilen;for(i=0,ilen=ticks.length;ioptions.lineWidth,tickColor:(_ctx,options)=>options.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:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),defaults.route("scale.ticks","color","","color"),defaults.route("scale.grid","color","","borderColor"),defaults.route("scale.grid","borderColor","","borderColor"),defaults.route("scale.title","color","","color"),defaults.describe("scale",{_fallback:!1,_scriptable:name=>!name.startsWith("before")&&!name.startsWith("after")&&"callback"!==name&&"parser"!==name,_indexable:name=>"borderDash"!==name&&"tickBorderDash"!==name}),defaults.describe("scales",{_fallback:"scale"}),defaults.describe("scale.ticks",{_scriptable:name=>"backdropPadding"!==name&&"callback"!==name,_indexable:name=>"backdropPadding"!==name}),__name(autoSkip,"autoSkip"),__name(determineMaxTicks,"determineMaxTicks"),__name(calculateSpacing,"calculateSpacing"),__name(getMajorIndices,"getMajorIndices"),__name(skipMajors,"skipMajors"),__name(skip,"skip"),__name(getEvenSpacing,"getEvenSpacing");const reverseAlign=__name(align=>"left"===align?"right":"right"===align?"left":align,"reverseAlign"),offsetFromEdge=__name((scale,edge,offset)=>"top"===edge||"left"===edge?scale[edge]+offset:scale[edge]-offset,"offsetFromEdge");function sample(arr,numItems){const result=[],increment=arr.length/numItems,len=arr.length;let i=0;for(;iend+1e-6)))return lineValue}function garbageCollect(caches,length){each(caches,cache=>{const gc=cache.gc,gcLen=gc.length/2;let i;if(gcLen>length){for(i=0;imax?max:min,max=minDefined&&min>max?min:max,{min:finiteOrDefault(min,finiteOrDefault(max,min)),max:finiteOrDefault(max,finiteOrDefault(min,max))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const data=this.chart.data;return this.options.labels||(this.isHorizontal()?data.xLabels:data.yLabels)||data.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(maxWidth,maxHeight,margins){const{beginAtZero,grace,ticks:tickOpts}=this.options,sampleSize=tickOpts.sampleSize;this.beforeUpdate(),this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins=Object.assign({left:0,right:0,top:0,bottom:0},margins),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+margins.left+margins.right:this.height+margins.top+margins.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,grace,beginAtZero),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const samplingEnabled=sampleSize=maxRotation||numTicks<=1||!this.isHorizontal())return void(this.labelRotation=minRotation);const labelSizes=this._getLabelSizes(),maxLabelWidth=labelSizes.widest.width,maxLabelHeight=labelSizes.highest.height,maxWidth=_limitValue(this.chart.width-maxLabelWidth,0,this.maxWidth);tickWidth=options.offset?this.maxWidth/numTicks:maxWidth/(numTicks-1),maxLabelWidth+6>tickWidth&&(tickWidth=maxWidth/(numTicks-(options.offset?.5:1)),maxHeight=this.maxHeight-getTickMarkLength(options.grid)-tickOpts.padding-getTitleHeight(options.title,this.chart.options.font),maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight),labelRotation=toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height+6)/tickWidth,-1,1)),Math.asin(_limitValue(maxHeight/maxLabelDiagonal,-1,1))-Math.asin(_limitValue(maxLabelHeight/maxLabelDiagonal,-1,1)))),labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation))),this.labelRotation=labelRotation}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const minSize={width:0,height:0},{chart,options:{ticks:tickOpts,title:titleOpts,grid:gridOpts}}=this,display=this._isVisible(),isHorizontal=this.isHorizontal();if(display){const titleHeight=getTitleHeight(titleOpts,chart.options.font);if(isHorizontal?(minSize.width=this.maxWidth,minSize.height=getTickMarkLength(gridOpts)+titleHeight):(minSize.height=this.maxHeight,minSize.width=getTickMarkLength(gridOpts)+titleHeight),tickOpts.display&&this.ticks.length){const{first,last,widest,highest}=this._getLabelSizes(),tickPadding=2*tickOpts.padding,angleRadians=toRadians(this.labelRotation),cos=Math.cos(angleRadians),sin=Math.sin(angleRadians);if(isHorizontal){const labelHeight=tickOpts.mirror?0:sin*widest.width+cos*highest.height;minSize.height=Math.min(this.maxHeight,minSize.height+labelHeight+tickPadding)}else{const labelWidth=tickOpts.mirror?0:cos*widest.width+sin*highest.height;minSize.width=Math.min(this.maxWidth,minSize.width+labelWidth+tickPadding)}this._calculatePadding(first,last,sin,cos)}}this._handleMargins(),isHorizontal?(this.width=this._length=chart.width-this._margins.left-this._margins.right,this.height=minSize.height):(this.width=minSize.width,this.height=this._length=chart.height-this._margins.top-this._margins.bottom)}_calculatePadding(first,last,sin,cos){const{ticks:{align,padding},position}=this.options,isRotated=0!==this.labelRotation,labelsBelowTicks="top"!==position&&"x"===this.axis;if(this.isHorizontal()){const offsetLeft=this.getPixelForTick(0)-this.left,offsetRight=this.right-this.getPixelForTick(this.ticks.length-1);let paddingLeft=0,paddingRight=0;isRotated?labelsBelowTicks?(paddingLeft=cos*first.width,paddingRight=sin*last.height):(paddingLeft=sin*first.height,paddingRight=cos*last.width):"start"===align?paddingRight=last.width:"end"===align?paddingLeft=first.width:"inner"!==align&&(paddingLeft=first.width/2,paddingRight=last.width/2),this.paddingLeft=Math.max((paddingLeft-offsetLeft+padding)*this.width/(this.width-offsetLeft),0),this.paddingRight=Math.max((paddingRight-offsetRight+padding)*this.width/(this.width-offsetRight),0)}else{let paddingTop=last.height/2,paddingBottom=first.height/2;"start"===align?(paddingTop=0,paddingBottom=first.height):"end"===align&&(paddingTop=last.height,paddingBottom=0),this.paddingTop=paddingTop+padding,this.paddingBottom=paddingBottom+padding}}_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(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis,position}=this.options;return"top"===position||"bottom"===position||"x"===axis}isFullSize(){return this.options.fullSize}_convertTicksToLabels(ticks){let i,ilen;for(this.beforeTickToLabelConversion(),this.generateTickLabels(ticks),i=0,ilen=ticks.length;i({width:widths[idx]||0,height:heights[idx]||0}),"valueAt");return{first:valueAt(0),last:valueAt(length-1),widest:valueAt(widest),highest:valueAt(highest),widths,heights}}getLabelForValue(value){return value}getPixelForValue(value,index2){return NaN}getValueForPixel(pixel){}getPixelForTick(index2){const ticks=this.ticks;return index2<0||index2>ticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getPixelForDecimal(decimal){this._reversePixels&&(decimal=1-decimal);const pixel=this._startPixel+decimal*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,pixel,0):pixel)}getDecimalForPixel(pixel){const decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min,max}=this;return min<0&&max<0?max:min>0&&max>0?min:0}getContext(index2){const ticks=this.ticks||[];if(index2>=0&&index2w*sin?w/cos:h/sin:h*sin0}_computeGridLineItems(chartArea){const axis=this.axis,chart=this.chart,options=this.options,{grid,position}=options,offset=grid.offset,isHorizontal=this.isHorizontal(),ticksLength=this.ticks.length+(offset?1:0),tl=getTickMarkLength(grid),items=[],borderOpts=grid.setContext(this.getContext()),axisWidth=borderOpts.drawBorder?borderOpts.borderWidth:0,axisHalfWidth=axisWidth/2,alignBorderValue=__name(function(pixel){return _alignPixel(chart,pixel,axisWidth)},"alignBorderValue");let borderValue,i,lineValue,alignedLineValue,tx1,ty1,tx2,ty2,x1,y1,x2,y2;if("top"===position)borderValue=alignBorderValue(this.bottom),ty1=this.bottom-tl,ty2=borderValue-axisHalfWidth,y1=alignBorderValue(chartArea.top)+axisHalfWidth,y2=chartArea.bottom;else if("bottom"===position)borderValue=alignBorderValue(this.top),y1=chartArea.top,y2=alignBorderValue(chartArea.bottom)-axisHalfWidth,ty1=borderValue+axisHalfWidth,ty2=this.top+tl;else if("left"===position)borderValue=alignBorderValue(this.right),tx1=this.right-tl,tx2=borderValue-axisHalfWidth,x1=alignBorderValue(chartArea.left)+axisHalfWidth,x2=chartArea.right;else if("right"===position)borderValue=alignBorderValue(this.left),x1=chartArea.left,x2=alignBorderValue(chartArea.right)-axisHalfWidth,tx1=borderValue+axisHalfWidth,tx2=this.left+tl;else if("x"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.top+chartArea.bottom)/2+.5);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}y1=chartArea.top,y2=chartArea.bottom,ty1=borderValue+axisHalfWidth,ty2=ty1+tl}else if("y"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.left+chartArea.right)/2);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}tx1=borderValue-axisHalfWidth,tx2=tx1-tl,x1=chartArea.left,x2=chartArea.right}const limit=valueOrDefault(options.ticks.maxTicksLimit,ticksLength),step=Math.max(1,Math.ceil(ticksLength/limit));for(i=0;it.value===value);return index2>=0?grid.setContext(this.getContext(index2)).lineWidth:0}drawGrid(chartArea){const grid=this.options.grid,ctx=this.ctx,items=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(chartArea));let i,ilen;const drawLine=__name((p1,p2,style)=>{!style.width||!style.color||(ctx.save(),ctx.lineWidth=style.width,ctx.strokeStyle=style.color,ctx.setLineDash(style.borderDash||[]),ctx.lineDashOffset=style.borderDashOffset,ctx.beginPath(),ctx.moveTo(p1.x,p1.y),ctx.lineTo(p2.x,p2.y),ctx.stroke(),ctx.restore())},"drawLine");if(grid.display)for(i=0,ilen=items.length;i{this.drawBackground(),this.drawGrid(chartArea),this.drawTitle()}},{z:gz+1,draw:()=>{this.drawBorder()}},{z:tz,draw:chartArea=>{this.drawLabels(chartArea)}}]:[{z:tz,draw:chartArea=>{this.draw(chartArea)}}]}getMatchingVisibleMetas(type){const metas=this.chart.getSortedVisibleDatasetMetas(),axisID=this.axis+"AxisID",result=[];let i,ilen;for(i=0,ilen=metas.length;i{const propertyParts=property.split("."),sourceName=propertyParts.pop(),sourceScope=[scope].concat(propertyParts).join("."),parts=routes[property].split("."),targetName=parts.pop(),targetScope=parts.join(".");defaults.route(sourceScope,sourceName,targetScope,targetName)})}function isIChartComponent(proto){return"id"in proto&&"defaults"in proto}__name(TypedRegistry,"TypedRegistry"),__name(registerDefaults,"registerDefaults"),__name(routeDefaults,"routeDefaults"),__name(isIChartComponent,"isIChartComponent");class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...args){this._each("register",args)}remove(...args){this._each("unregister",args)}addControllers(...args){this._each("register",args,this.controllers)}addElements(...args){this._each("register",args,this.elements)}addPlugins(...args){this._each("register",args,this.plugins)}addScales(...args){this._each("register",args,this.scales)}getController(id){return this._get(id,this.controllers,"controller")}getElement(id){return this._get(id,this.elements,"element")}getPlugin(id){return this._get(id,this.plugins,"plugin")}getScale(id){return this._get(id,this.scales,"scale")}removeControllers(...args){this._each("unregister",args,this.controllers)}removeElements(...args){this._each("unregister",args,this.elements)}removePlugins(...args){this._each("unregister",args,this.plugins)}removeScales(...args){this._each("unregister",args,this.scales)}_each(method,args,typedRegistry){[...args].forEach(arg=>{const reg=typedRegistry||this._getRegistryForType(arg);typedRegistry||reg.isForType(arg)||reg===this.plugins&&arg.id?this._exec(method,reg,arg):each(arg,item=>{const itemReg=typedRegistry||this._getRegistryForType(item);this._exec(method,itemReg,item)})})}_exec(method,registry2,component){const camelMethod=_capitalize(method);callback(component["before"+camelMethod],[],component),registry2[method](component),callback(component["after"+camelMethod],[],component)}_getRegistryForType(type){for(let i=0;ia.filter(x=>!b.some(y=>x.plugin.id===y.plugin.id)),"diff");this._notify(diff(previousDescriptors,descriptors2),chart,"stop"),this._notify(diff(descriptors2,previousDescriptors),chart,"start")}}function allPlugins(config){const plugins2=[],keys=Object.keys(registry.plugins.items);for(let i=0;i{const scaleConf=configScales[id];if(!isObject(scaleConf))return console.error(`Invalid scale configuration for scale: ${id}`);if(scaleConf._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${id}`);const axis=determineAxis(id,scaleConf),defaultId=getDefaultScaleIDFromAxis(axis,chartIndexAxis),defaultScaleOptions=chartDefaults.scales||{};firstIDs[axis]=firstIDs[axis]||id,scales2[id]=mergeIf(Object.create(null),[{axis},scaleConf,defaultScaleOptions[axis],defaultScaleOptions[defaultId]])}),config.data.datasets.forEach(dataset=>{const type=dataset.type||config.type,indexAxis=dataset.indexAxis||getIndexAxis(type,options),defaultScaleOptions=(overrides[type]||{}).scales||{};Object.keys(defaultScaleOptions).forEach(defaultID=>{const axis=getAxisFromDefaultScaleID(defaultID,indexAxis),id=dataset[axis+"AxisID"]||firstIDs[axis]||axis;scales2[id]=scales2[id]||Object.create(null),mergeIf(scales2[id],[{axis},configScales[id],defaultScaleOptions[defaultID]])})}),Object.keys(scales2).forEach(key=>{const scale=scales2[key];mergeIf(scale,[defaults.scales[scale.type],defaults.scale])}),scales2}function initOptions(config){const options=config.options||(config.options={});options.plugins=valueOrDefault(options.plugins,{}),options.scales=mergeScaleConfig(config,options)}function initData(data){return(data=data||{}).datasets=data.datasets||[],data.labels=data.labels||[],data}function initConfig(config){return(config=config||{}).data=initData(config.data),initOptions(config),config}__name(PluginService,"PluginService"),__name(allPlugins,"allPlugins"),__name(getOpts,"getOpts"),__name(createDescriptors,"createDescriptors"),__name(pluginOpts,"pluginOpts"),__name(getIndexAxis,"getIndexAxis"),__name(getAxisFromDefaultScaleID,"getAxisFromDefaultScaleID"),__name(getDefaultScaleIDFromAxis,"getDefaultScaleIDFromAxis"),__name(axisFromPosition,"axisFromPosition"),__name(determineAxis,"determineAxis"),__name(mergeScaleConfig,"mergeScaleConfig"),__name(initOptions,"initOptions"),__name(initData,"initData"),__name(initConfig,"initConfig");const keyCache=new Map,keysCached=new Set;function cachedKeys(cacheKey,generate){let keys=keyCache.get(cacheKey);return keys||(keys=generate(),keyCache.set(cacheKey,keys),keysCached.add(keys)),keys}__name(cachedKeys,"cachedKeys");const addIfFound=__name((set2,obj,key)=>{const opts=resolveObjectKey(obj,key);void 0!==opts&&set2.add(opts)},"addIfFound");class Config{constructor(config){this._config=initConfig(config),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(type){this._config.type=type}get data(){return this._config.data}set data(data){this._config.data=initData(data)}get options(){return this._config.options}set options(options){this._config.options=options}get plugins(){return this._config.plugins}update(){const config=this._config;this.clearCache(),initOptions(config)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(datasetType){return cachedKeys(datasetType,()=>[[`datasets.${datasetType}`,""]])}datasetAnimationScopeKeys(datasetType,transition){return cachedKeys(`${datasetType}.transition.${transition}`,()=>[[`datasets.${datasetType}.transitions.${transition}`,`transitions.${transition}`],[`datasets.${datasetType}`,""]])}datasetElementScopeKeys(datasetType,elementType){return cachedKeys(`${datasetType}-${elementType}`,()=>[[`datasets.${datasetType}.elements.${elementType}`,`datasets.${datasetType}`,`elements.${elementType}`,""]])}pluginScopeKeys(plugin){const id=plugin.id;return cachedKeys(`${this.type}-plugin-${id}`,()=>[[`plugins.${id}`,...plugin.additionalOptionScopes||[]]])}_cachedScopes(mainScope,resetCache){const _scopeCache=this._scopeCache;let cache=_scopeCache.get(mainScope);return(!cache||resetCache)&&(cache=new Map,_scopeCache.set(mainScope,cache)),cache}getOptionScopes(mainScope,keyLists,resetCache){const{options,type}=this,cache=this._cachedScopes(mainScope,resetCache),cached=cache.get(keyLists);if(cached)return cached;const scopes=new Set;keyLists.forEach(keys=>{mainScope&&(scopes.add(mainScope),keys.forEach(key=>addIfFound(scopes,mainScope,key))),keys.forEach(key=>addIfFound(scopes,options,key)),keys.forEach(key=>addIfFound(scopes,overrides[type]||{},key)),keys.forEach(key=>addIfFound(scopes,defaults,key)),keys.forEach(key=>addIfFound(scopes,descriptors,key))});const array=Array.from(scopes);return 0===array.length&&array.push(Object.create(null)),keysCached.has(keyLists)&&cache.set(keyLists,array),array}chartOptionScopes(){const{options,type}=this;return[options,overrides[type]||{},defaults.datasets[type]||{},{type},defaults,descriptors]}resolveNamedOptions(scopes,names2,context,prefixes=[""]){const result={$shared:!0},{resolver,subPrefixes}=getResolver(this._resolverCache,scopes,prefixes);let options=resolver;if(needContext(resolver,names2)){result.$shared=!1;options=_attachContext(resolver,context=isFunction(context)?context():context,this.createResolver(scopes,context,subPrefixes))}for(const prop of names2)result[prop]=options[prop];return result}createResolver(scopes,context,prefixes=[""],descriptorDefaults){const{resolver}=getResolver(this._resolverCache,scopes,prefixes);return isObject(context)?_attachContext(resolver,context,void 0,descriptorDefaults):resolver}}function getResolver(resolverCache,scopes,prefixes){let cache=resolverCache.get(scopes);cache||(cache=new Map,resolverCache.set(scopes,cache));const cacheKey=prefixes.join();let cached=cache.get(cacheKey);return cached||(cached={resolver:_createResolver(scopes,prefixes),subPrefixes:prefixes.filter(p=>!p.toLowerCase().includes("hover"))},cache.set(cacheKey,cached)),cached}__name(Config,"Config"),__name(getResolver,"getResolver");const hasFunction=__name(value=>isObject(value)&&Object.getOwnPropertyNames(value).reduce((acc,key)=>acc||isFunction(value[key]),!1),"hasFunction");function needContext(proxy,names2){const{isScriptable,isIndexable}=_descriptors(proxy);for(const prop of names2){const scriptable=isScriptable(prop),indexable=isIndexable(prop),value=(indexable||scriptable)&&proxy[prop];if(scriptable&&(isFunction(value)||hasFunction(value))||indexable&&isArray(value))return!0}return!1}__name(needContext,"needContext");const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(position,axis){return"top"===position||"bottom"===position||-1===KNOWN_POSITIONS.indexOf(position)&&"x"===axis}function compare2Level(l1,l2){return function(a,b){return a[l1]===b[l1]?a[l2]-b[l2]:a[l1]-b[l1]}}function onAnimationsComplete(context){const chart=context.chart,animationOptions2=chart.options.animation;chart.notifyPlugins("afterRender"),callback(animationOptions2&&animationOptions2.onComplete,[context],chart)}function onAnimationProgress(context){const chart=context.chart,animationOptions2=chart.options.animation;callback(animationOptions2&&animationOptions2.onProgress,[context],chart)}function getCanvas(item){return _isDomSupported()&&"string"==typeof item?item=document.getElementById(item):item&&item.length&&(item=item[0]),item&&item.canvas&&(item=item.canvas),item}__name(positionIsHorizontal,"positionIsHorizontal"),__name(compare2Level,"compare2Level"),__name(onAnimationsComplete,"onAnimationsComplete"),__name(onAnimationProgress,"onAnimationProgress"),__name(getCanvas,"getCanvas");const instances={},getChart=__name(key=>{const canvas=getCanvas(key);return Object.values(instances).filter(c=>c.canvas===canvas).pop()},"getChart");function moveNumericKeys(obj,start,move){const keys=Object.keys(obj);for(const key of keys){const intKey=+key;if(intKey>=start){const value=obj[key];delete obj[key],(move>0||intKey>start)&&(obj[intKey+move]=value)}}}function determineLastEvent(e,lastEvent,inChartArea,isClick){return inChartArea&&"mouseout"!==e.type?isClick?lastEvent:e:null}__name(moveNumericKeys,"moveNumericKeys"),__name(determineLastEvent,"determineLastEvent");class Chart{constructor(item,userConfig){const config=this.config=new Config(userConfig),initialCanvas=getCanvas(item),existingChart=getChart(initialCanvas);if(existingChart)throw new Error("Canvas is already in use. Chart with ID '"+existingChart.id+"' must be destroyed before the canvas can be reused.");const options=config.createResolver(config.chartOptionScopes(),this.getContext());this.platform=new(config.platform||_detectPlatform(initialCanvas)),this.platform.updateConfig(config);const context=this.platform.acquireContext(initialCanvas,options.aspectRatio),canvas=context&&context.canvas,height=canvas&&canvas.height,width=canvas&&canvas.width;this.id=uid(),this.ctx=context,this.canvas=canvas,this.width=width,this.height=height,this._options=options,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(mode=>this.update(mode),options.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,context&&canvas?(animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio,maintainAspectRatio},width,height,_aspectRatio}=this;return isNullOrUndef(aspectRatio)?maintainAspectRatio&&_aspectRatio?_aspectRatio:height?width/height:null:aspectRatio}get data(){return this.config.data}set data(data){this.config.data=data}get options(){return this._options}set options(options){this.config.options=options}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(width,height){animator.running(this)?this._resizeBeforeDraw={width,height}:this._resize(width,height)}_resize(width,height){const options=this.options,canvas=this.canvas,aspectRatio=options.maintainAspectRatio&&this.aspectRatio,newSize=this.platform.getMaximumSize(canvas,width,height,aspectRatio),newRatio=options.devicePixelRatio||this.platform.getDevicePixelRatio(),mode=this.width?"resize":"attach";this.width=newSize.width,this.height=newSize.height,this._aspectRatio=this.aspectRatio,retinaScale(this,newRatio,!0)&&(this.notifyPlugins("resize",{size:newSize}),callback(options.onResize,[this,newSize],this),this.attached&&this._doResize(mode)&&this.render())}ensureScalesHaveIDs(){each(this.options.scales||{},(axisOptions,axisID)=>{axisOptions.id=axisID})}buildOrUpdateScales(){const options=this.options,scaleOpts=options.scales,scales2=this.scales,updated=Object.keys(scales2).reduce((obj,id)=>(obj[id]=!1,obj),{});let items=[];scaleOpts&&(items=items.concat(Object.keys(scaleOpts).map(id=>{const scaleOptions=scaleOpts[id],axis=determineAxis(id,scaleOptions),isRadial="r"===axis,isHorizontal="x"===axis;return{options:scaleOptions,dposition:isRadial?"chartArea":isHorizontal?"bottom":"left",dtype:isRadial?"radialLinear":isHorizontal?"category":"linear"}}))),each(items,item=>{const scaleOptions=item.options,id=scaleOptions.id,axis=determineAxis(id,scaleOptions),scaleType=valueOrDefault(scaleOptions.type,item.dtype);(void 0===scaleOptions.position||positionIsHorizontal(scaleOptions.position,axis)!==positionIsHorizontal(item.dposition))&&(scaleOptions.position=item.dposition),updated[id]=!0;let scale=null;if(id in scales2&&scales2[id].type===scaleType)scale=scales2[id];else{scale=new(registry.getScale(scaleType))({id,type:scaleType,ctx:this.ctx,chart:this}),scales2[scale.id]=scale}scale.init(scaleOptions,options)}),each(updated,(hasUpdated,id)=>{hasUpdated||delete scales2[id]}),each(scales2,scale=>{layouts.configure(this,scale,scale.options),layouts.addBox(this,scale)})}_updateMetasets(){const metasets=this._metasets,numData=this.data.datasets.length,numMeta=metasets.length;if(metasets.sort((a,b)=>a.index-b.index),numMeta>numData){for(let i=numData;idatasets.length&&delete this._stacks,metasets.forEach((meta,index2)=>{0===datasets.filter(x=>x===meta._dataset).length&&this._destroyDatasetMeta(index2)})}buildOrUpdateControllers(){const newControllers=[],datasets=this.data.datasets;let i,ilen;for(this._removeUnreferencedMetasets(),i=0,ilen=datasets.length;i{this.getDatasetMeta(datasetIndex).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(mode){const config=this.config;config.update();const options=this._options=config.createResolver(config.chartOptionScopes(),this.getContext()),animsDisabled=this._animationsDisabled=!options.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode,cancelable:!0}))return;const newControllers=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let minPadding=0;for(let i=0,ilen=this.data.datasets.length;i{controller.reset()}),this._updateDatasets(mode),this.notifyPlugins("afterUpdate",{mode}),this._layers.sort(compare2Level("z","_idx"));const{_active,_lastEvent}=this;_lastEvent?this._eventHandler(_lastEvent,!0):_active.length&&this._updateHoverStyles(_active,_active,!0),this.render()}_updateScales(){each(this.scales,scale=>{layouts.removeBox(this,scale)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const options=this.options,existingEvents=new Set(Object.keys(this._listeners)),newEvents=new Set(options.events);(!setsEqual(existingEvents,newEvents)||!!this._responsiveListeners!==options.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices}=this,changes=this._getUniformDataChanges()||[];for(const{method,start,count}of changes){moveNumericKeys(_hiddenIndices,start,"_removeElements"===method?-count:count)}}_getUniformDataChanges(){const _dataChanges=this._dataChanges;if(!_dataChanges||!_dataChanges.length)return;this._dataChanges=[];const datasetCount=this.data.datasets.length,makeSet=__name(idx=>new Set(_dataChanges.filter(c=>c[0]===idx).map((c,i)=>i+","+c.splice(1).join(","))),"makeSet"),changeSet=makeSet(0);for(let i=1;ic.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(minPadding){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,minPadding);const area=this.chartArea,noArea=area.width<=0||area.height<=0;this._layers=[],each(this.boxes,box=>{noArea&&"chartArea"===box.position||(box.configure&&box.configure(),this._layers.push(...box._layers()))},this),this._layers.forEach((item,index2)=>{item._idx=index2}),this.notifyPlugins("afterLayout")}_updateDatasets(mode){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode,cancelable:!0})){for(let i=0,ilen=this.data.datasets.length;i=0;--i)this._drawDataset(metasets[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(meta){const ctx=this.ctx,clip=meta._clip,useClip=!clip.disabled,area=this.chartArea,args={meta,index:meta.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",args)&&(useClip&&clipArea(ctx,{left:!1===clip.left?0:area.left-clip.left,right:!1===clip.right?this.width:area.right+clip.right,top:!1===clip.top?0:area.top-clip.top,bottom:!1===clip.bottom?this.height:area.bottom+clip.bottom}),meta.controller.draw(),useClip&&unclipArea(ctx),args.cancelable=!1,this.notifyPlugins("afterDatasetDraw",args))}isPointInArea(point){return _isPointInArea(point,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,mode,options,useFinalPosition){const method=Interaction.modes[mode];return"function"==typeof method?method(this,e,options,useFinalPosition):[]}getDatasetMeta(datasetIndex){const dataset=this.data.datasets[datasetIndex],metasets=this._metasets;let meta=metasets.filter(x=>x&&x._dataset===dataset).pop();return meta||(meta={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset&&dataset.order||0,index:datasetIndex,_dataset:dataset,_parsed:[],_sorted:!1},metasets.push(meta)),meta}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(datasetIndex){const dataset=this.data.datasets[datasetIndex];if(!dataset)return!1;const meta=this.getDatasetMeta(datasetIndex);return"boolean"==typeof meta.hidden?!meta.hidden:!dataset.hidden}setDatasetVisibility(datasetIndex,visible){this.getDatasetMeta(datasetIndex).hidden=!visible}toggleDataVisibility(index2){this._hiddenIndices[index2]=!this._hiddenIndices[index2]}getDataVisibility(index2){return!this._hiddenIndices[index2]}_updateVisibility(datasetIndex,dataIndex,visible){const mode=visible?"show":"hide",meta=this.getDatasetMeta(datasetIndex),anims=meta.controller._resolveAnimations(void 0,mode);defined(dataIndex)?(meta.data[dataIndex].hidden=!visible,this.update()):(this.setDatasetVisibility(datasetIndex,visible),anims.update(meta,{visible}),this.update(ctx=>ctx.datasetIndex===datasetIndex?mode:void 0))}hide(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!1)}show(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!0)}_destroyDatasetMeta(datasetIndex){const meta=this._metasets[datasetIndex];meta&&meta.controller&&meta.controller._destroy(),delete this._metasets[datasetIndex]}_stop(){let i,ilen;for(this.stop(),animator.remove(this),i=0,ilen=this.data.datasets.length;i{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),listener=__name((e,x,y)=>{e.offsetX=x,e.offsetY=y,this._eventHandler(e)},"listener");each(this.options.events,type=>_add(type,listener))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const listeners=this._responsiveListeners,platform=this.platform,_add=__name((type,listener2)=>{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),_remove=__name((type,listener2)=>{listeners[type]&&(platform.removeEventListener(this,type,listener2),delete listeners[type])},"_remove"),listener=__name((width,height)=>{this.canvas&&this.resize(width,height)},"listener");let detached;const attached=__name(()=>{_remove("attach",attached),this.attached=!0,this.resize(),_add("resize",listener),_add("detach",detached)},"attached");detached=__name(()=>{this.attached=!1,_remove("resize",listener),this._stop(),this._resize(0,0),_add("attach",attached)},"detached"),platform.isAttached(this.canvas)?attached():detached()}unbindEvents(){each(this._listeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._listeners={},each(this._responsiveListeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._responsiveListeners=void 0}updateHoverStyle(items,mode,enabled){const prefix=enabled?"set":"remove";let meta,item,i,ilen;for("dataset"===mode&&(meta=this.getDatasetMeta(items[0].datasetIndex),meta.controller["_"+prefix+"DatasetHoverStyle"]()),i=0,ilen=items.length;i{const meta=this.getDatasetMeta(datasetIndex);if(!meta)throw new Error("No dataset found at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}});!_elementsEqual(active,lastActive)&&(this._active=active,this._lastEvent=null,this._updateHoverStyles(active,lastActive))}notifyPlugins(hook,args,filter){return this._plugins.notify(this,hook,args,filter)}_updateHoverStyles(active,lastActive,replay){const hoverOptions=this.options.hover,diff=__name((a,b)=>a.filter(x=>!b.some(y=>x.datasetIndex===y.datasetIndex&&x.index===y.index)),"diff"),deactivated=diff(lastActive,active),activated=replay?active:diff(active,lastActive);deactivated.length&&this.updateHoverStyle(deactivated,hoverOptions.mode,!1),activated.length&&hoverOptions.mode&&this.updateHoverStyle(activated,hoverOptions.mode,!0)}_eventHandler(e,replay){const args={event:e,replay,cancelable:!0,inChartArea:this.isPointInArea(e)},eventFilter=__name(plugin=>(plugin.options.events||this.options.events).includes(e.native.type),"eventFilter");if(!1===this.notifyPlugins("beforeEvent",args,eventFilter))return;const changed=this._handleEvent(e,replay,args.inChartArea);return args.cancelable=!1,this.notifyPlugins("afterEvent",args,eventFilter),(changed||args.changed)&&this.render(),this}_handleEvent(e,replay,inChartArea){const{_active:lastActive=[],options}=this,useFinalPosition=replay,active=this._getActiveElements(e,lastActive,inChartArea,useFinalPosition),isClick=_isClickEvent(e),lastEvent=determineLastEvent(e,this._lastEvent,inChartArea,isClick);inChartArea&&(this._lastEvent=null,callback(options.onHover,[e,active,this],this),isClick&&callback(options.onClick,[e,active,this],this));const changed=!_elementsEqual(active,lastActive);return(changed||replay)&&(this._active=active,this._updateHoverStyles(active,lastActive,replay)),this._lastEvent=lastEvent,changed}_getActiveElements(e,lastActive,inChartArea,useFinalPosition){if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;const hoverOptions=this.options.hover;return this.getElementsAtEventForMode(e,hoverOptions.mode,hoverOptions,useFinalPosition)}}__name(Chart,"Chart");const invalidatePlugins=__name(()=>each(Chart.instances,chart=>chart._plugins.invalidate()),"invalidatePlugins");function clipArc(ctx,element,endAngle){const{startAngle,pixelMargin,x,y,outerRadius,innerRadius}=element;let angleMargin=pixelMargin/outerRadius;ctx.beginPath(),ctx.arc(x,y,outerRadius,startAngle-angleMargin,endAngle+angleMargin),innerRadius>pixelMargin?(angleMargin=pixelMargin/innerRadius,ctx.arc(x,y,innerRadius,endAngle+angleMargin,startAngle-angleMargin,!0)):ctx.arc(x,y,pixelMargin,endAngle+HALF_PI,startAngle-HALF_PI),ctx.closePath(),ctx.clip()}function toRadiusCorners(value){return _readValueToProps(value,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(arc,innerRadius,outerRadius,angleDelta){const o=toRadiusCorners(arc.options.borderRadius),halfThickness=(outerRadius-innerRadius)/2,innerLimit=Math.min(halfThickness,angleDelta*innerRadius/2),computeOuterLimit=__name(val=>{const outerArcLimit=(outerRadius-Math.min(halfThickness,val))*angleDelta/2;return _limitValue(val,0,Math.min(halfThickness,outerArcLimit))},"computeOuterLimit");return{outerStart:computeOuterLimit(o.outerStart),outerEnd:computeOuterLimit(o.outerEnd),innerStart:_limitValue(o.innerStart,0,innerLimit),innerEnd:_limitValue(o.innerEnd,0,innerLimit)}}function rThetaToXY(r,theta,x,y){return{x:x+r*Math.cos(theta),y:y+r*Math.sin(theta)}}function pathArc(ctx,element,offset,spacing,end){const{x,y,startAngle:start,pixelMargin,innerRadius:innerR}=element,outerRadius=Math.max(element.outerRadius+spacing+offset-pixelMargin,0),innerRadius=innerR>0?innerR+spacing+offset+pixelMargin:0;let spacingOffset=0;const alpha2=end-start;if(spacing){const avNogSpacingRadius=((innerR>0?innerR-spacing:0)+(outerRadius>0?outerRadius-spacing:0))/2;spacingOffset=(alpha2-(0!==avNogSpacingRadius?alpha2*avNogSpacingRadius/(avNogSpacingRadius+spacing):alpha2))/2}const angleOffset=(alpha2-Math.max(.001,alpha2*outerRadius-offset/PI)/outerRadius)/2,startAngle=start+angleOffset+spacingOffset,endAngle=end-angleOffset-spacingOffset,{outerStart,outerEnd,innerStart,innerEnd}=parseBorderRadius$1(element,innerRadius,outerRadius,endAngle-startAngle),outerStartAdjustedRadius=outerRadius-outerStart,outerEndAdjustedRadius=outerRadius-outerEnd,outerStartAdjustedAngle=startAngle+outerStart/outerStartAdjustedRadius,outerEndAdjustedAngle=endAngle-outerEnd/outerEndAdjustedRadius,innerStartAdjustedRadius=innerRadius+innerStart,innerEndAdjustedRadius=innerRadius+innerEnd,innerStartAdjustedAngle=startAngle+innerStart/innerStartAdjustedRadius,innerEndAdjustedAngle=endAngle-innerEnd/innerEndAdjustedRadius;if(ctx.beginPath(),ctx.arc(x,y,outerRadius,outerStartAdjustedAngle,outerEndAdjustedAngle),outerEnd>0){const pCenter=rThetaToXY(outerEndAdjustedRadius,outerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerEnd,outerEndAdjustedAngle,endAngle+HALF_PI)}const p4=rThetaToXY(innerEndAdjustedRadius,endAngle,x,y);if(ctx.lineTo(p4.x,p4.y),innerEnd>0){const pCenter=rThetaToXY(innerEndAdjustedRadius,innerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerEnd,endAngle+HALF_PI,innerEndAdjustedAngle+Math.PI)}if(ctx.arc(x,y,innerRadius,endAngle-innerEnd/innerRadius,startAngle+innerStart/innerRadius,!0),innerStart>0){const pCenter=rThetaToXY(innerStartAdjustedRadius,innerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerStart,innerStartAdjustedAngle+Math.PI,startAngle-HALF_PI)}const p8=rThetaToXY(outerStartAdjustedRadius,startAngle,x,y);if(ctx.lineTo(p8.x,p8.y),outerStart>0){const pCenter=rThetaToXY(outerStartAdjustedRadius,outerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerStart,startAngle-HALF_PI,outerStartAdjustedAngle)}ctx.closePath()}function drawArc(ctx,element,offset,spacing){const{fullCircles,startAngle,circumference}=element;let endAngle=element.endAngle;if(fullCircles){pathArc(ctx,element,offset,spacing,startAngle+TAU);for(let i=0;i{registry.add(...items),invalidatePlugins()}},unregister:{enumerable:true,value:(...items)=>{registry.remove(...items),invalidatePlugins()}}}),__name(clipArc,"clipArc"),__name(toRadiusCorners,"toRadiusCorners"),__name(parseBorderRadius$1,"parseBorderRadius$1"),__name(rThetaToXY,"rThetaToXY"),__name(pathArc,"pathArc"),__name(drawArc,"drawArc"),__name(drawFullCircleBorders,"drawFullCircleBorders"),__name(drawBorder,"drawBorder");class ArcElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}inRange(chartX,chartY,useFinalPosition){const point=this.getProps(["x","y"],useFinalPosition),{angle,distance}=getAngleFromPoint(point,{x:chartX,y:chartY}),{startAngle,endAngle,innerRadius,outerRadius,circumference}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),rAdjust=this.options.spacing/2,betweenAngles=valueOrDefault(circumference,endAngle-startAngle)>=TAU||_angleBetween(angle,startAngle,endAngle),withinRadius=_isBetween(distance,innerRadius+rAdjust,outerRadius+rAdjust);return betweenAngles&&withinRadius}getCenterPoint(useFinalPosition){const{x,y,startAngle,endAngle,innerRadius,outerRadius}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),{offset,spacing}=this.options,halfAngle=(startAngle+endAngle)/2,halfRadius=(innerRadius+outerRadius+spacing+offset)/2;return{x:x+Math.cos(halfAngle)*halfRadius,y:y+Math.sin(halfAngle)*halfRadius}}tooltipPosition(useFinalPosition){return this.getCenterPoint(useFinalPosition)}draw(ctx){const{options,circumference}=this,offset=(options.offset||0)/2,spacing=(options.spacing||0)/2;if(this.pixelMargin="inner"===options.borderAlign?.33:0,this.fullCircles=circumference>TAU?Math.floor(circumference/TAU):0,0===circumference||this.innerRadius<0||this.outerRadius<0)return;ctx.save();let radiusOffset=0;if(offset){radiusOffset=offset/2;const halfAngle=(this.startAngle+this.endAngle)/2;ctx.translate(Math.cos(halfAngle)*radiusOffset,Math.sin(halfAngle)*radiusOffset),this.circumference>=PI&&(radiusOffset=offset)}ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor;drawBorder(ctx,this,radiusOffset,spacing,drawArc(ctx,this,radiusOffset,spacing)),ctx.restore()}}function setStyle(ctx,options,style=options){ctx.lineCap=valueOrDefault(style.borderCapStyle,options.borderCapStyle),ctx.setLineDash(valueOrDefault(style.borderDash,options.borderDash)),ctx.lineDashOffset=valueOrDefault(style.borderDashOffset,options.borderDashOffset),ctx.lineJoin=valueOrDefault(style.borderJoinStyle,options.borderJoinStyle),ctx.lineWidth=valueOrDefault(style.borderWidth,options.borderWidth),ctx.strokeStyle=valueOrDefault(style.borderColor,options.borderColor)}function lineTo(ctx,previous,target){ctx.lineTo(target.x,target.y)}function getLineMethod(options){return options.stepped?_steppedLineTo:options.tension||"monotone"===options.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(points,segment,params={}){const count=points.length,{start:paramsStart=0,end:paramsEnd=count-1}=params,{start:segmentStart,end:segmentEnd}=segment,start=Math.max(paramsStart,segmentStart),end=Math.min(paramsEnd,segmentEnd),outside=paramsStartsegmentEnd&¶msEnd>segmentEnd;return{count,start,loop:segment.loop,ilen:end(start+(reverse?ilen-index2:index2))%count,"pointIndex"),drawX=__name(()=>{minY!==maxY&&(ctx.lineTo(avgX,maxY),ctx.lineTo(avgX,minY),ctx.lineTo(avgX,lastY))},"drawX");for(move&&(point=points[pointIndex(0)],ctx.moveTo(point.x,point.y)),i=0;i<=ilen;++i){if(point=points[pointIndex(i)],point.skip)continue;const x=point.x,y=point.y,truncX=0|x;truncX===prevX?(ymaxY&&(maxY=y),avgX=(countX*avgX+x)/++countX):(drawX(),ctx.lineTo(x,y),prevX=truncX,countX=0,minY=maxY=y),lastY=y}drawX()}function _getSegmentMethod(line){const opts=line.options,borderDash=opts.borderDash&&opts.borderDash.length;return line._decimated||line._loop||opts.tension||"monotone"===opts.cubicInterpolationMode||opts.stepped||borderDash?pathSegment:fastPathSegment}function _getInterpolationMethod(options){return options.stepped?_steppedInterpolation:options.tension||"monotone"===options.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(ctx,line,start,count){let path=line._path;path||(path=line._path=new Path2D,line.path(path,start,count)&&path.closePath()),setStyle(ctx,line.options),ctx.stroke(path)}function strokePathDirect(ctx,line,start,count){const{segments,options}=line,segmentMethod=_getSegmentMethod(line);for(const segment of segments)setStyle(ctx,options,segment.style),ctx.beginPath(),segmentMethod(ctx,line,segment,{start,end:start+count-1})&&ctx.closePath(),ctx.stroke()}__name(ArcElement,"ArcElement"),ArcElement.id="arc",ArcElement.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ArcElement.defaultRoutes={backgroundColor:"backgroundColor"},__name(setStyle,"setStyle"),__name(lineTo,"lineTo"),__name(getLineMethod,"getLineMethod"),__name(pathVars,"pathVars"),__name(pathSegment,"pathSegment"),__name(fastPathSegment,"fastPathSegment"),__name(_getSegmentMethod,"_getSegmentMethod"),__name(_getInterpolationMethod,"_getInterpolationMethod"),__name(strokePathWithCache,"strokePathWithCache"),__name(strokePathDirect,"strokePathDirect");const usePath2D="function"==typeof Path2D;function draw(ctx,line,start,count){usePath2D&&!line.options.segment?strokePathWithCache(ctx,line,start,count):strokePathDirect(ctx,line,start,count)}__name(draw,"draw");class LineElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}updateControlPoints(chartArea,indexAxis){const options=this.options;if((options.tension||"monotone"===options.cubicInterpolationMode)&&!options.stepped&&!this._pointsUpdated){const loop=options.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,options,chartArea,loop,indexAxis),this._pointsUpdated=!0}}set points(points){this._points=points,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const segments=this.segments,points=this.points;return segments.length&&points[segments[0].start]}last(){const segments=this.segments,points=this.points,count=segments.length;return count&&points[segments[count-1].end]}interpolate(point,property){const options=this.options,value=point[property],points=this.points,segments=_boundSegments(this,{property,start:value,end:value});if(!segments.length)return;const result=[],_interpolate=_getInterpolationMethod(options);let i,ilen;for(i=0,ilen=segments.length;i"borderDash"!==name&&"fill"!==name},__name(inRange$1,"inRange$1");class PointElement extends Element{constructor(cfg){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,cfg&&Object.assign(this,cfg)}inRange(mouseX,mouseY,useFinalPosition){const options=this.options,{x,y}=this.getProps(["x","y"],useFinalPosition);return Math.pow(mouseX-x,2)+Math.pow(mouseY-y,2)=count)return data.slice(start,start+count);const decimated=[],bucketWidth=(count-2)/(samples-2);let sampledIndex=0;const endIndex=start+count-1;let i,maxAreaPoint,maxArea,area,nextA,a=start;for(decimated[sampledIndex++]=data[a],i=0;imaxArea&&(maxArea=area,maxAreaPoint=data[j],nextA=j);decimated[sampledIndex++]=maxAreaPoint,a=nextA}return decimated[sampledIndex++]=data[endIndex],decimated}function minMaxDecimation(data,start,count,availableWidth){let i,point,x,y,prevX,minIndex,maxIndex,startIndex,minY,maxY,avgX=0,countX=0;const decimated=[],endIndex=start+count-1,xMin=data[start].x,dx=data[endIndex].x-xMin;for(i=start;imaxY&&(maxY=y,maxIndex=i),avgX=(countX*avgX+point.x)/++countX;else{const lastIndex=i-1;if(!isNullOrUndef(minIndex)&&!isNullOrUndef(maxIndex)){const intermediateIndex1=Math.min(minIndex,maxIndex),intermediateIndex2=Math.max(minIndex,maxIndex);intermediateIndex1!==startIndex&&intermediateIndex1!==lastIndex&&decimated.push({...data[intermediateIndex1],x:avgX}),intermediateIndex2!==startIndex&&intermediateIndex2!==lastIndex&&decimated.push({...data[intermediateIndex2],x:avgX})}i>0&&lastIndex!==startIndex&&decimated.push(data[lastIndex]),decimated.push(point),prevX=truncX,countX=0,minY=maxY=y,minIndex=maxIndex=startIndex=i}}return decimated}function cleanDecimatedDataset(dataset){if(dataset._decimated){const data=dataset._data;delete dataset._decimated,delete dataset._data,Object.defineProperty(dataset,"data",{value:data})}}function cleanDecimatedData(chart){chart.data.datasets.forEach(dataset=>{cleanDecimatedDataset(dataset)})}function getStartAndCountOfVisiblePointsSimplified(meta,points){const pointCount=points.length;let count,start=0;const{iScale}=meta,{min,max,minDefined,maxDefined}=iScale.getUserBounds();return minDefined&&(start=_limitValue(_lookupByKey(points,iScale.axis,min).lo,0,pointCount-1)),count=maxDefined?_limitValue(_lookupByKey(points,iScale.axis,max).hi+1,start,pointCount)-start:pointCount-start,{start,count}}__name(lttbDecimation,"lttbDecimation"),__name(minMaxDecimation,"minMaxDecimation"),__name(cleanDecimatedDataset,"cleanDecimatedDataset"),__name(cleanDecimatedData,"cleanDecimatedData"),__name(getStartAndCountOfVisiblePointsSimplified,"getStartAndCountOfVisiblePointsSimplified");function _segments(line,target,property){const segments=line.segments,points=line.points,tpoints=target.points,parts=[];for(const segment of segments){let{start,end}=segment;end=_findSegmentEnd(start,end,points);const bounds=_getBounds(property,points[start],points[end],segment.loop);if(!target.segments){parts.push({source:segment,target:bounds,start:points[start],end:points[end]});continue}const targetSegments=_boundSegments(target,bounds);for(const tgt of targetSegments){const subBounds=_getBounds(property,tpoints[tgt.start],tpoints[tgt.end],tgt.loop),fillSources=_boundSegment(segment,points,subBounds);for(const fillSource of fillSources)parts.push({source:fillSource,target:tgt,start:{[property]:_getEdge(bounds,subBounds,"start",Math.max)},end:{[property]:_getEdge(bounds,subBounds,"end",Math.min)}})}}return parts}function _getBounds(property,first,last,loop){if(loop)return;let start=first[property],end=last[property];return"angle"===property&&(start=_normalizeAngle(start),end=_normalizeAngle(end)),{property,start,end}}function _pointsFromSegments(boundary,line){const{x=null,y=null}=boundary||{},linePoints=line.points,points=[];return line.segments.forEach(({start,end})=>{end=_findSegmentEnd(start,end,linePoints);const first=linePoints[start],last=linePoints[end];null!==y?(points.push({x:first.x,y}),points.push({x:last.x,y})):null!==x&&(points.push({x,y:first.y}),points.push({x,y:last.y}))}),points}function _findSegmentEnd(start,end,points){for(;end>start;end--){const point=points[end];if(!isNaN(point.x)&&!isNaN(point.y))break}return end}function _getEdge(a,b,prop,fn){return a&&b?fn(a[prop],b[prop]):a?a[prop]:b?b[prop]:0}function _createBoundaryLine(boundary,line){let points=[],_loop=!1;return isArray(boundary)?(_loop=!0,points=boundary):points=_pointsFromSegments(boundary,line),points.length?new LineElement({points,options:{tension:0},_loop,_fullLoop:_loop}):null}function _resolveTarget(sources,index2,propagate){let fill2=sources[index2].fill;const visited=[index2];let target;if(!propagate)return fill2;for(;!1!==fill2&&-1===visited.indexOf(fill2);){if(!isNumberFinite(fill2))return fill2;if(target=sources[fill2],!target)return!1;if(target.visible)return fill2;visited.push(fill2),fill2=target.fill}return!1}function _decodeFill(line,index2,count){const fill2=parseFillOption(line);if(isObject(fill2))return!isNaN(fill2.value)&&fill2;let target=parseFloat(fill2);return isNumberFinite(target)&&Math.floor(target)===target?decodeTargetIndex(fill2[0],index2,target,count):["origin","start","end","stack","shape"].indexOf(fill2)>=0&&fill2}function decodeTargetIndex(firstCh,index2,target,count){return("-"===firstCh||"+"===firstCh)&&(target=index2+target),!(target===index2||target<0||target>=count)&&target}function _getTargetPixel(fill2,scale){let pixel=null;return"start"===fill2?pixel=scale.bottom:"end"===fill2?pixel=scale.top:isObject(fill2)?pixel=scale.getPixelForValue(fill2.value):scale.getBasePixel&&(pixel=scale.getBasePixel()),pixel}function _getTargetValue(fill2,scale,startValue){let value;return value="start"===fill2?startValue:"end"===fill2?scale.options.reverse?scale.min:scale.max:isObject(fill2)?fill2.value:scale.getBaseValue(),value}function parseFillOption(line){const options=line.options,fillOption=options.fill;let fill2=valueOrDefault(fillOption&&fillOption.target,fillOption);return void 0===fill2&&(fill2=!!options.backgroundColor),!1!==fill2&&null!==fill2&&(!0===fill2?"origin":fill2)}function _buildStackLine(source){const{scale,index:index2,line}=source,points=[],segments=line.segments,sourcePoints=line.points,linesBelow=getLinesBelow(scale,index2);linesBelow.push(_createBoundaryLine({x:null,y:scale.bottom},line));for(let i=0;i=0;--i){const source=metasets[i].$filler;!source||(source.line.updateControlPoints(area,source.axis),draw2&&_drawfill(chart.ctx,source,area))}},beforeDatasetsDraw(chart,_args,options){if("beforeDatasetsDraw"!==options.drawTime)return;const metasets=chart.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;source&&_drawfill(chart.ctx,source,chart.chartArea)}},beforeDatasetDraw(chart,args,options){const source=args.meta.$filler;!source||!1===source.fill||"beforeDatasetDraw"!==options.drawTime||_drawfill(chart.ctx,source,chart.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=__name((labelOpts,fontSize)=>{let{boxHeight=fontSize,boxWidth=fontSize}=labelOpts;return labelOpts.usePointStyle&&(boxHeight=Math.min(boxHeight,fontSize),boxWidth=Math.min(boxWidth,fontSize)),{boxWidth,boxHeight,itemHeight:Math.max(fontSize,boxHeight)}},"getBoxSize"),itemsEqual=__name((a,b)=>null!==a&&null!==b&&a.datasetIndex===b.datasetIndex&&a.index===b.index,"itemsEqual");class Legend extends Element{constructor(config){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight,margins){this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins,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 labelOpts=this.options.labels||{};let legendItems=callback(labelOpts.generateLabels,[this.chart],this)||[];labelOpts.filter&&(legendItems=legendItems.filter(item=>labelOpts.filter(item,this.chart.data))),labelOpts.sort&&(legendItems=legendItems.sort((a,b)=>labelOpts.sort(a,b,this.chart.data))),this.options.reverse&&legendItems.reverse(),this.legendItems=legendItems}fit(){const{options,ctx}=this;if(!options.display)return void(this.width=this.height=0);const labelOpts=options.labels,labelFont=toFont(labelOpts.font),fontSize=labelFont.size,titleHeight=this._computeTitleHeight(),{boxWidth,itemHeight}=getBoxSize(labelOpts,fontSize);let width,height;ctx.font=labelFont.string,this.isHorizontal()?(width=this.maxWidth,height=this._fitRows(titleHeight,fontSize,boxWidth,itemHeight)+10):(height=this.maxHeight,width=this._fitCols(titleHeight,fontSize,boxWidth,itemHeight)+10),this.width=Math.min(width,options.maxWidth||this.maxWidth),this.height=Math.min(height,options.maxHeight||this.maxHeight)}_fitRows(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxWidth,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],lineWidths=this.lineWidths=[0],lineHeight=itemHeight+padding;let totalHeight=titleHeight;ctx.textAlign="left",ctx.textBaseline="middle";let row=-1,top=-lineHeight;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;(0===i||lineWidths[lineWidths.length-1]+itemWidth+2*padding>maxWidth)&&(totalHeight+=lineHeight,lineWidths[lineWidths.length-(i>0?0:1)]=0,top+=lineHeight,row++),hitboxes[i]={left:0,top,row,width:itemWidth,height:itemHeight},lineWidths[lineWidths.length-1]+=itemWidth+padding}),totalHeight}_fitCols(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxHeight,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],columnSizes=this.columnSizes=[],heightLimit=maxHeight-titleHeight;let totalWidth=padding,currentColWidth=0,currentColHeight=0,left=0,col=0;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;i>0&¤tColHeight+itemHeight+2*padding>heightLimit&&(totalWidth+=currentColWidth+padding,columnSizes.push({width:currentColWidth,height:currentColHeight}),left+=currentColWidth+padding,col++,currentColWidth=currentColHeight=0),hitboxes[i]={left,top:currentColHeight,col,width:itemWidth,height:itemHeight},currentColWidth=Math.max(currentColWidth,itemWidth),currentColHeight+=itemHeight+padding}),totalWidth+=currentColWidth,columnSizes.push({width:currentColWidth,height:currentColHeight}),totalWidth}adjustHitBoxes(){if(!this.options.display)return;const titleHeight=this._computeTitleHeight(),{legendHitBoxes:hitboxes,options:{align,labels:{padding},rtl}}=this,rtlHelper=getRtlAdapter(rtl,this.left,this.width);if(this.isHorizontal()){let row=0,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row]);for(const hitbox of hitboxes)row!==hitbox.row&&(row=hitbox.row,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row])),hitbox.top+=this.top+titleHeight+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(left),hitbox.width),left+=hitbox.width+padding}else{let col=0,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height);for(const hitbox of hitboxes)hitbox.col!==col&&(col=hitbox.col,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height)),hitbox.top=top,hitbox.left+=this.left+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(hitbox.left),hitbox.width),top+=hitbox.height+padding}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const ctx=this.ctx;clipArea(ctx,this),this._draw(),unclipArea(ctx)}}_draw(){const{options:opts,columnSizes,lineWidths,ctx}=this,{align,labels:labelOpts}=opts,defaultColor=defaults.color,rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),labelFont=toFont(labelOpts.font),{color:fontColor,padding}=labelOpts,fontSize=labelFont.size,halfFontSize=fontSize/2;let cursor;this.drawTitle(),ctx.textAlign=rtlHelper.textAlign("left"),ctx.textBaseline="middle",ctx.lineWidth=.5,ctx.font=labelFont.string;const{boxWidth,boxHeight,itemHeight}=getBoxSize(labelOpts,fontSize),drawLegendBox=__name(function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0||isNaN(boxHeight)||boxHeight<0)return;ctx.save();const lineWidth=valueOrDefault(legendItem.lineWidth,1);if(ctx.fillStyle=valueOrDefault(legendItem.fillStyle,defaultColor),ctx.lineCap=valueOrDefault(legendItem.lineCap,"butt"),ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,0),ctx.lineJoin=valueOrDefault(legendItem.lineJoin,"miter"),ctx.lineWidth=lineWidth,ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,defaultColor),ctx.setLineDash(valueOrDefault(legendItem.lineDash,[])),labelOpts.usePointStyle){const drawOptions={radius:boxWidth*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth},centerX=rtlHelper.xPlus(x,boxWidth/2);drawPoint(ctx,drawOptions,centerX,y+halfFontSize)}else{const yBoxTop=y+Math.max((fontSize-boxHeight)/2,0),xBoxLeft=rtlHelper.leftForLtr(x,boxWidth),borderRadius=toTRBLCorners(legendItem.borderRadius);ctx.beginPath(),Object.values(borderRadius).some(v=>0!==v)?addRoundedRectPath(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius}):ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight),ctx.fill(),0!==lineWidth&&ctx.stroke()}ctx.restore()},"drawLegendBox"),fillText=__name(function(x,y,legendItem){renderText(ctx,legendItem.text,x,y+itemHeight/2,labelFont,{strikethrough:legendItem.hidden,textAlign:rtlHelper.textAlign(legendItem.textAlign)})},"fillText"),isHorizontal=this.isHorizontal(),titleHeight=this._computeTitleHeight();cursor=isHorizontal?{x:_alignStartEnd(align,this.left+padding,this.right-lineWidths[0]),y:this.top+padding+titleHeight,line:0}:{x:this.left+padding,y:_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[0].height),line:0},overrideTextDirection(this.ctx,opts.textDirection);const lineHeight=itemHeight+padding;this.legendItems.forEach((legendItem,i)=>{ctx.strokeStyle=legendItem.fontColor||fontColor,ctx.fillStyle=legendItem.fontColor||fontColor;const textWidth=ctx.measureText(legendItem.text).width,textAlign=rtlHelper.textAlign(legendItem.textAlign||(legendItem.textAlign=labelOpts.textAlign)),width=boxWidth+halfFontSize+textWidth;let x=cursor.x,y=cursor.y;rtlHelper.setWidth(this.width),isHorizontal?i>0&&x+width+padding>this.right&&(y=cursor.y+=lineHeight,cursor.line++,x=cursor.x=_alignStartEnd(align,this.left+padding,this.right-lineWidths[cursor.line])):i>0&&y+lineHeight>this.bottom&&(x=cursor.x=x+columnSizes[cursor.line].width+padding,cursor.line++,y=cursor.y=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[cursor.line].height));const realX=rtlHelper.x(x);drawLegendBox(realX,y,legendItem),x=_textX(textAlign,x+boxWidth+halfFontSize,isHorizontal?x+width:this.right,opts.rtl),fillText(rtlHelper.x(x),y,legendItem),isHorizontal?cursor.x+=width+padding:cursor.y+=lineHeight}),restoreTextDirection(this.ctx,opts.textDirection)}drawTitle(){const opts=this.options,titleOpts=opts.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);if(!titleOpts.display)return;const rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),ctx=this.ctx,position=titleOpts.position,halfFontSize=titleFont.size/2,topPaddingPlusHalfFontSize=titlePadding.top+halfFontSize;let y,left=this.left,maxWidth=this.width;if(this.isHorizontal())maxWidth=Math.max(...this.lineWidths),y=this.top+topPaddingPlusHalfFontSize,left=_alignStartEnd(opts.align,left,this.right-maxWidth);else{const maxHeight=this.columnSizes.reduce((acc,size)=>Math.max(acc,size.height),0);y=topPaddingPlusHalfFontSize+_alignStartEnd(opts.align,this.top,this.bottom-maxHeight-opts.labels.padding-this._computeTitleHeight())}const x=_alignStartEnd(position,left,left+maxWidth);ctx.textAlign=rtlHelper.textAlign(_toLeftRightCenter(position)),ctx.textBaseline="middle",ctx.strokeStyle=titleOpts.color,ctx.fillStyle=titleOpts.color,ctx.font=titleFont.string,renderText(ctx,titleOpts.text,x,y,titleFont)}_computeTitleHeight(){const titleOpts=this.options.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);return titleOpts.display?titleFont.lineHeight+titlePadding.height:0}_getLegendItemAt(x,y){let i,hitBox,lh;if(_isBetween(x,this.left,this.right)&&_isBetween(y,this.top,this.bottom))for(lh=this.legendHitBoxes,i=0;ictx.chart.options.color,boxWidth:40,padding:10,generateLabels(chart){const datasets=chart.data.datasets,{labels:{usePointStyle,pointStyle,textAlign,color:color2}}=chart.legend.options;return chart._getSortedDatasetMetas().map(meta=>{const style=meta.controller.getStyle(usePointStyle?0:void 0),borderWidth=toPadding(style.borderWidth);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,fontColor:color2,hidden:!meta.visible,lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:(borderWidth.width+borderWidth.height)/4,strokeStyle:style.borderColor,pointStyle:pointStyle||style.pointStyle,rotation:style.rotation,textAlign:textAlign||style.textAlign,borderRadius:0,datasetIndex:meta.index}},this)}},title:{color:ctx=>ctx.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:name=>!name.startsWith("on"),labels:{_scriptable:name=>!["generateLabels","filter","sort"].includes(name)}}};class Title extends Element{constructor(config){super(),this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight){const opts=this.options;if(this.left=0,this.top=0,!opts.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=maxWidth,this.height=this.bottom=maxHeight;const lineCount=isArray(opts.text)?opts.text.length:1;this._padding=toPadding(opts.padding);const textSize=lineCount*toFont(opts.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=textSize:this.width=textSize}isHorizontal(){const pos=this.options.position;return"top"===pos||"bottom"===pos}_drawArgs(offset){const{top,left,bottom,right,options}=this,align=options.align;let maxWidth,titleX,titleY,rotation=0;return this.isHorizontal()?(titleX=_alignStartEnd(align,left,right),titleY=top+offset,maxWidth=right-left):("left"===options.position?(titleX=left+offset,titleY=_alignStartEnd(align,bottom,top),rotation=-.5*PI):(titleX=right-offset,titleY=_alignStartEnd(align,top,bottom),rotation=.5*PI),maxWidth=bottom-top),{titleX,titleY,maxWidth,rotation}}draw(){const ctx=this.ctx,opts=this.options;if(!opts.display)return;const fontOpts=toFont(opts.font),offset=fontOpts.lineHeight/2+this._padding.top,{titleX,titleY,maxWidth,rotation}=this._drawArgs(offset);renderText(ctx,opts.text,0,0,fontOpts,{color:opts.color,maxWidth,rotation,textAlign:_toLeftRightCenter(opts.align),textBaseline:"middle",translation:[titleX,titleY]})}}function createTitle(chart,titleOpts){const title=new Title({ctx:chart.ctx,options:titleOpts,chart});layouts.configure(chart,title,titleOpts),layouts.addBox(chart,title),chart.titleBlock=title}__name(Title,"Title"),__name(createTitle,"createTitle");var plugin_title={id:"title",_element:Title,start(chart,_args,options){createTitle(chart,options)},stop(chart){const titleBlock=chart.titleBlock;layouts.removeBox(chart,titleBlock),delete chart.titleBlock},beforeUpdate(chart,_args,options){const title=chart.titleBlock;layouts.configure(chart,title,options),title.options=options},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 positioners={average(items){if(!items.length)return!1;let i,len,x=0,y=0,count=0;for(i=0,len=items.length;i-1?str.split("\n"):str}function createTooltipItem(chart,item){const{element,datasetIndex,index:index2}=item,controller=chart.getDatasetMeta(datasetIndex).controller,{label,value}=controller.getLabelAndValue(index2);return{chart,label,parsed:controller.getParsed(index2),raw:chart.data.datasets[datasetIndex].data[index2],formattedValue:value,dataset:controller.getDataset(),dataIndex:index2,datasetIndex,element}}function getTooltipSize(tooltip,options){const ctx=tooltip.chart.ctx,{body,footer,title}=tooltip,{boxWidth,boxHeight}=options,bodyFont=toFont(options.bodyFont),titleFont=toFont(options.titleFont),footerFont=toFont(options.footerFont),titleLineCount=title.length,footerLineCount=footer.length,bodyLineItemCount=body.length,padding=toPadding(options.padding);let height=padding.height,width=0,combinedBodyLength=body.reduce((count,bodyItem)=>count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length,0);if(combinedBodyLength+=tooltip.beforeBody.length+tooltip.afterBody.length,titleLineCount&&(height+=titleLineCount*titleFont.lineHeight+(titleLineCount-1)*options.titleSpacing+options.titleMarginBottom),combinedBodyLength){height+=bodyLineItemCount*(options.displayColors?Math.max(boxHeight,bodyFont.lineHeight):bodyFont.lineHeight)+(combinedBodyLength-bodyLineItemCount)*bodyFont.lineHeight+(combinedBodyLength-1)*options.bodySpacing}footerLineCount&&(height+=options.footerMarginTop+footerLineCount*footerFont.lineHeight+(footerLineCount-1)*options.footerSpacing);let widthPadding=0;const maxLineWidth=__name(function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding)},"maxLineWidth");return ctx.save(),ctx.font=titleFont.string,each(tooltip.title,maxLineWidth),ctx.font=bodyFont.string,each(tooltip.beforeBody.concat(tooltip.afterBody),maxLineWidth),widthPadding=options.displayColors?boxWidth+2+options.boxPadding:0,each(body,bodyItem=>{each(bodyItem.before,maxLineWidth),each(bodyItem.lines,maxLineWidth),each(bodyItem.after,maxLineWidth)}),widthPadding=0,ctx.font=footerFont.string,each(tooltip.footer,maxLineWidth),ctx.restore(),width+=padding.width,{width,height}}function determineYAlign(chart,size){const{y,height}=size;return ychart.height-height/2?"bottom":"center"}function doesNotFitWithAlign(xAlign,chart,options,size){const{x,width}=size,caret=options.caretSize+options.caretPadding;if("left"===xAlign&&x+width+caret>chart.width||"right"===xAlign&&x-width-caret<0)return!0}function determineXAlign(chart,options,size,yAlign){const{x,width}=size,{width:chartWidth,chartArea:{left,right}}=chart;let xAlign="center";return"center"===yAlign?xAlign=x<=(left+right)/2?"left":"right":x<=width/2?xAlign="left":x>=chartWidth-width/2&&(xAlign="right"),doesNotFitWithAlign(xAlign,chart,options,size)&&(xAlign="center"),xAlign}function determineAlignment(chart,options,size){const yAlign=size.yAlign||options.yAlign||determineYAlign(chart,size);return{xAlign:size.xAlign||options.xAlign||determineXAlign(chart,options,size,yAlign),yAlign}}function alignX(size,xAlign){let{x,width}=size;return"right"===xAlign?x-=width:"center"===xAlign&&(x-=width/2),x}function alignY(size,yAlign,paddingAndSize){let{y,height}=size;return"top"===yAlign?y+=paddingAndSize:y-="bottom"===yAlign?height+paddingAndSize:height/2,y}function getBackgroundPoint(options,size,alignment,chart){const{caretSize,caretPadding,cornerRadius}=options,{xAlign,yAlign}=alignment,paddingAndSize=caretSize+caretPadding,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius);let x=alignX(size,xAlign);const y=alignY(size,yAlign,paddingAndSize);return"center"===yAlign?"left"===xAlign?x+=paddingAndSize:"right"===xAlign&&(x-=paddingAndSize):"left"===xAlign?x-=Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign&&(x+=Math.max(topRight,bottomRight)+caretSize),{x:_limitValue(x,0,chart.width-size.width),y:_limitValue(y,0,chart.height-size.height)}}function getAlignedX(tooltip,align,options){const padding=toPadding(options.padding);return"center"===align?tooltip.x+tooltip.width/2:"right"===align?tooltip.x+tooltip.width-padding.right:tooltip.x+padding.left}function getBeforeAfterBodyLines(callback2){return pushOrConcat([],splitNewlines(callback2))}function createTooltipContext(parent,tooltip,tooltipItems){return createContext(parent,{tooltip,tooltipItems,type:"tooltip"})}function overrideCallbacks(callbacks,context){const override=context&&context.dataset&&context.dataset.tooltip&&context.dataset.tooltip.callbacks;return override?callbacks.override(override):callbacks}__name(pushOrConcat,"pushOrConcat"),__name(splitNewlines,"splitNewlines"),__name(createTooltipItem,"createTooltipItem"),__name(getTooltipSize,"getTooltipSize"),__name(determineYAlign,"determineYAlign"),__name(doesNotFitWithAlign,"doesNotFitWithAlign"),__name(determineXAlign,"determineXAlign"),__name(determineAlignment,"determineAlignment"),__name(alignX,"alignX"),__name(alignY,"alignY"),__name(getBackgroundPoint,"getBackgroundPoint"),__name(getAlignedX,"getAlignedX"),__name(getBeforeAfterBodyLines,"getBeforeAfterBodyLines"),__name(createTooltipContext,"createTooltipContext"),__name(overrideCallbacks,"overrideCallbacks");class Tooltip extends Element{constructor(config){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=config.chart||config._chart,this._chart=this.chart,this.options=config.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(options){this.options=options,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const cached=this._cachedAnimations;if(cached)return cached;const chart=this.chart,options=this.options.setContext(this.getContext()),opts=options.enabled&&chart.options.animation&&options.animations,animations=new Animations(this.chart,opts);return opts._cacheable&&(this._cachedAnimations=Object.freeze(animations)),animations}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(context,options){const{callbacks}=options,beforeTitle=callbacks.beforeTitle.apply(this,[context]),title=callbacks.title.apply(this,[context]),afterTitle=callbacks.afterTitle.apply(this,[context]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeTitle)),lines=pushOrConcat(lines,splitNewlines(title)),lines=pushOrConcat(lines,splitNewlines(afterTitle)),lines}getBeforeBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this,[tooltipItems]))}getBody(tooltipItems,options){const{callbacks}=options,bodyItems=[];return each(tooltipItems,context=>{const bodyItem={before:[],lines:[],after:[]},scoped=overrideCallbacks(callbacks,context);pushOrConcat(bodyItem.before,splitNewlines(scoped.beforeLabel.call(this,context))),pushOrConcat(bodyItem.lines,scoped.label.call(this,context)),pushOrConcat(bodyItem.after,splitNewlines(scoped.afterLabel.call(this,context))),bodyItems.push(bodyItem)}),bodyItems}getAfterBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this,[tooltipItems]))}getFooter(tooltipItems,options){const{callbacks}=options,beforeFooter=callbacks.beforeFooter.apply(this,[tooltipItems]),footer=callbacks.footer.apply(this,[tooltipItems]),afterFooter=callbacks.afterFooter.apply(this,[tooltipItems]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeFooter)),lines=pushOrConcat(lines,splitNewlines(footer)),lines=pushOrConcat(lines,splitNewlines(afterFooter)),lines}_createItems(options){const active=this._active,data=this.chart.data,labelColors=[],labelPointStyles=[],labelTextColors=[];let i,len,tooltipItems=[];for(i=0,len=active.length;ioptions.filter(element,index2,array,data))),options.itemSort&&(tooltipItems=tooltipItems.sort((a,b)=>options.itemSort(a,b,data))),each(tooltipItems,context=>{const scoped=overrideCallbacks(options.callbacks,context);labelColors.push(scoped.labelColor.call(this,context)),labelPointStyles.push(scoped.labelPointStyle.call(this,context)),labelTextColors.push(scoped.labelTextColor.call(this,context))}),this.labelColors=labelColors,this.labelPointStyles=labelPointStyles,this.labelTextColors=labelTextColors,this.dataPoints=tooltipItems,tooltipItems}update(changed,replay){const options=this.options.setContext(this.getContext()),active=this._active;let properties,tooltipItems=[];if(active.length){const position=positioners[options.position].call(this,active,this._eventPosition);tooltipItems=this._createItems(options),this.title=this.getTitle(tooltipItems,options),this.beforeBody=this.getBeforeBody(tooltipItems,options),this.body=this.getBody(tooltipItems,options),this.afterBody=this.getAfterBody(tooltipItems,options),this.footer=this.getFooter(tooltipItems,options);const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,size),alignment=determineAlignment(this.chart,options,positionAndSize),backgroundPoint=getBackgroundPoint(options,positionAndSize,alignment,this.chart);this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,properties={opacity:1,x:backgroundPoint.x,y:backgroundPoint.y,width:size.width,height:size.height,caretX:position.x,caretY:position.y}}else 0!==this.opacity&&(properties={opacity:0});this._tooltipItems=tooltipItems,this.$context=void 0,properties&&this._resolveAnimations().update(this,properties),changed&&options.external&&options.external.call(this,{chart:this.chart,tooltip:this,replay})}drawCaret(tooltipPoint,ctx,size,options){const caretPosition=this.getCaretPosition(tooltipPoint,size,options);ctx.lineTo(caretPosition.x1,caretPosition.y1),ctx.lineTo(caretPosition.x2,caretPosition.y2),ctx.lineTo(caretPosition.x3,caretPosition.y3)}getCaretPosition(tooltipPoint,size,options){const{xAlign,yAlign}=this,{caretSize,cornerRadius}=options,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius),{x:ptX,y:ptY}=tooltipPoint,{width,height}=size;let x1,x2,x3,y1,y2,y3;return"center"===yAlign?(y2=ptY+height/2,"left"===xAlign?(x1=ptX,x2=x1-caretSize,y1=y2+caretSize,y3=y2-caretSize):(x1=ptX+width,x2=x1+caretSize,y1=y2-caretSize,y3=y2+caretSize),x3=x1):(x2="left"===xAlign?ptX+Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign?ptX+width-Math.max(topRight,bottomRight)-caretSize:this.caretX,"top"===yAlign?(y1=ptY,y2=y1-caretSize,x1=x2-caretSize,x3=x2+caretSize):(y1=ptY+height,y2=y1+caretSize,x1=x2+caretSize,x3=x2-caretSize),y3=y1),{x1,x2,x3,y1,y2,y3}}drawTitle(pt,ctx,options){const title=this.title,length=title.length;let titleFont,titleSpacing,i;if(length){const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width);for(pt.x=getAlignedX(this,options.titleAlign,options),ctx.textAlign=rtlHelper.textAlign(options.titleAlign),ctx.textBaseline="middle",titleFont=toFont(options.titleFont),titleSpacing=options.titleSpacing,ctx.fillStyle=options.titleColor,ctx.font=titleFont.string,i=0;i0!==v)?(ctx.beginPath(),ctx.fillStyle=options.multiKeyBackground,addRoundedRectPath(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius}),ctx.fill(),ctx.stroke(),ctx.fillStyle=labelColors.backgroundColor,ctx.beginPath(),addRoundedRectPath(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius}),ctx.fill()):(ctx.fillStyle=options.multiKeyBackground,ctx.fillRect(outerX,colorY,boxWidth,boxHeight),ctx.strokeRect(outerX,colorY,boxWidth,boxHeight),ctx.fillStyle=labelColors.backgroundColor,ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2))}ctx.fillStyle=this.labelTextColors[i]}drawBody(pt,ctx,options){const{body}=this,{bodySpacing,bodyAlign,displayColors,boxHeight,boxWidth,boxPadding}=options,bodyFont=toFont(options.bodyFont);let bodyLineHeight=bodyFont.lineHeight,xLinePadding=0;const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width),fillLineOfText=__name(function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyLineHeight/2),pt.y+=bodyLineHeight+bodySpacing},"fillLineOfText"),bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign);let bodyItem,textColor,lines,i,j,ilen,jlen;for(ctx.textAlign=bodyAlign,ctx.textBaseline="middle",ctx.font=bodyFont.string,pt.x=getAlignedX(this,bodyAlignForCalculation,options),ctx.fillStyle=options.bodyColor,each(this.beforeBody,fillLineOfText),xLinePadding=displayColors&&"right"!==bodyAlignForCalculation?"center"===bodyAlign?boxWidth/2+boxPadding:boxWidth+2+boxPadding:0,i=0,ilen=body.length;i0&&ctx.stroke()}_updateAnimationTarget(options){const chart=this.chart,anims=this.$animations,animX=anims&&anims.x,animY=anims&&anims.y;if(animX||animY){const position=positioners[options.position].call(this,this._active,this._eventPosition);if(!position)return;const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,this._size),alignment=determineAlignment(chart,options,positionAndSize),point=getBackgroundPoint(options,positionAndSize,alignment,chart);(animX._to!==point.x||animY._to!==point.y)&&(this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,this.width=size.width,this.height=size.height,this.caretX=position.x,this.caretY=position.y,this._resolveAnimations().update(this,point))}}_willRender(){return!!this.opacity}draw(ctx){const options=this.options.setContext(this.getContext());let opacity=this.opacity;if(!opacity)return;this._updateAnimationTarget(options);const tooltipSize={width:this.width,height:this.height},pt={x:this.x,y:this.y};opacity=Math.abs(opacity)<.001?0:opacity;const padding=toPadding(options.padding),hasTooltipContent=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;options.enabled&&hasTooltipContent&&(ctx.save(),ctx.globalAlpha=opacity,this.drawBackground(pt,ctx,tooltipSize,options),overrideTextDirection(ctx,options.textDirection),pt.y+=padding.top,this.drawTitle(pt,ctx,options),this.drawBody(pt,ctx,options),this.drawFooter(pt,ctx,options),restoreTextDirection(ctx,options.textDirection),ctx.restore())}getActiveElements(){return this._active||[]}setActiveElements(activeElements,eventPosition){const lastActive=this._active,active=activeElements.map(({datasetIndex,index:index2})=>{const meta=this.chart.getDatasetMeta(datasetIndex);if(!meta)throw new Error("Cannot find a dataset at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}}),changed=!_elementsEqual(lastActive,active),positionChanged=this._positionChanged(active,eventPosition);(changed||positionChanged)&&(this._active=active,this._eventPosition=eventPosition,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,replay,inChartArea=!0){if(replay&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const options=this.options,lastActive=this._active||[],active=this._getActiveElements(e,lastActive,replay,inChartArea),positionChanged=this._positionChanged(active,e),changed=replay||!_elementsEqual(active,lastActive)||positionChanged;return changed&&(this._active=active,(options.enabled||options.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,replay))),changed}_getActiveElements(e,lastActive,replay,inChartArea){const options=this.options;if("mouseout"===e.type)return[];if(!inChartArea)return lastActive;const active=this.chart.getElementsAtEventForMode(e,options.mode,options,replay);return options.reverse&&active.reverse(),active}_positionChanged(active,e){const{caretX,caretY,options}=this,position=positioners[options.position].call(this,active,e);return!1!==position&&(caretX!==position.x||caretY!==position.y)}}__name(Tooltip,"Tooltip"),Tooltip.positioners=positioners;var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(chart,_args,options){options&&(chart.tooltip=new Tooltip({chart,options}))},beforeUpdate(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},reset(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},afterDraw(chart){const tooltip=chart.tooltip;if(tooltip&&tooltip._willRender()){const args={tooltip};if(!1===chart.notifyPlugins("beforeTooltipDraw",args))return;tooltip.draw(chart.ctx),chart.notifyPlugins("afterTooltipDraw",args)}},afterEvent(chart,args){if(chart.tooltip){const useFinalPosition=args.replay;chart.tooltip.handleEvent(args.event,useFinalPosition,args.inChartArea)&&(args.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:(ctx,opts)=>opts.bodyFont.size,boxWidth:(ctx,opts)=>opts.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:noop,title(tooltipItems){if(tooltipItems.length>0){const item=tooltipItems[0],labels=item.chart.data.labels,labelCount=labels?labels.length:0;if(this&&this.options&&"dataset"===this.options.mode)return item.dataset.label||"";if(item.label)return item.label;if(labelCount>0&&item.dataIndex"filter"!==name&&"itemSort"!==name&&"external"!==name,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=__name((labels,raw,index2,addedLabels)=>("string"==typeof raw?(index2=labels.push(raw)-1,addedLabels.unshift({index:index2,label:raw})):isNaN(raw)&&(index2=null),index2),"addIfString");function findOrAddLabel(labels,raw,index2,addedLabels){const first=labels.indexOf(raw);if(-1===first)return addIfString(labels,raw,index2,addedLabels);return first!==labels.lastIndexOf(raw)?index2:first}__name(findOrAddLabel,"findOrAddLabel");const validIndex=__name((index2,max)=>null===index2?null:_limitValue(Math.round(index2),0,max),"validIndex");class CategoryScale extends Scale{constructor(cfg){super(cfg),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(scaleOptions){const added=this._addedLabels;if(added.length){const labels=this.getLabels();for(const{index:index2,label}of added)labels[index2]===label&&labels.splice(index2,1);this._addedLabels=[]}super.init(scaleOptions)}parse(raw,index2){if(isNullOrUndef(raw))return null;const labels=this.getLabels();return index2=isFinite(index2)&&labels[index2]===raw?index2:findOrAddLabel(labels,raw,valueOrDefault(index2,raw),this._addedLabels),validIndex(index2,labels.length-1)}determineDataLimits(){const{minDefined,maxDefined}=this.getUserBounds();let{min,max}=this.getMinMax(!0);"ticks"===this.options.bounds&&(minDefined||(min=0),maxDefined||(max=this.getLabels().length-1)),this.min=min,this.max=max}buildTicks(){const min=this.min,max=this.max,offset=this.options.offset,ticks=[];let labels=this.getLabels();labels=0===min&&max===labels.length-1?labels:labels.slice(min,max+1),this._valueRange=Math.max(labels.length-(offset?0:1),1),this._startValue=this.min-(offset?.5:0);for(let value=min;value<=max;value++)ticks.push({value});return ticks}getLabelForValue(value){const labels=this.getLabels();return value>=0&&valueticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getValueForPixel(pixel){return Math.round(this._startValue+this.getDecimalForPixel(pixel)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(generationOptions,dataRange){const ticks=[],{bounds,step,min,max,precision,count,maxTicks,maxDigits,includeBounds}=generationOptions,unit=step||1,maxSpaces=maxTicks-1,{min:rmin,max:rmax}=dataRange,minDefined=!isNullOrUndef(min),maxDefined=!isNullOrUndef(max),countDefined=!isNullOrUndef(count),minSpacing=(rmax-rmin)/(maxDigits+1);let factor,niceMin,niceMax,numSpaces,spacing=niceNum((rmax-rmin)/maxSpaces/unit)*unit;if(spacing<1e-14&&!minDefined&&!maxDefined)return[{value:rmin},{value:rmax}];numSpaces=Math.ceil(rmax/spacing)-Math.floor(rmin/spacing),numSpaces>maxSpaces&&(spacing=niceNum(numSpaces*spacing/maxSpaces/unit)*unit),isNullOrUndef(precision)||(factor=Math.pow(10,precision),spacing=Math.ceil(spacing*factor)/factor),"ticks"===bounds?(niceMin=Math.floor(rmin/spacing)*spacing,niceMax=Math.ceil(rmax/spacing)*spacing):(niceMin=rmin,niceMax=rmax),minDefined&&maxDefined&&step&&almostWhole((max-min)/step,spacing/1e3)?(numSpaces=Math.round(Math.min((max-min)/spacing,maxTicks)),spacing=(max-min)/numSpaces,niceMin=min,niceMax=max):countDefined?(niceMin=minDefined?min:niceMin,niceMax=maxDefined?max:niceMax,numSpaces=count-1,spacing=(niceMax-niceMin)/numSpaces):(numSpaces=(niceMax-niceMin)/spacing,numSpaces=almostEquals(numSpaces,Math.round(numSpaces),spacing/1e3)?Math.round(numSpaces):Math.ceil(numSpaces));const decimalPlaces=Math.max(_decimalPlaces(spacing),_decimalPlaces(niceMin));factor=Math.pow(10,isNullOrUndef(precision)?decimalPlaces:precision),niceMin=Math.round(niceMin*factor)/factor,niceMax=Math.round(niceMax*factor)/factor;let j=0;for(minDefined&&(includeBounds&&niceMin!==min?(ticks.push({value:min}),niceMinmin=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax");if(beginAtZero){const minSign=sign(min),maxSign=sign(max);minSign<0&&maxSign<0?setMax(0):minSign>0&&maxSign>0&&setMin(0)}if(min===max){let offset=1;(max>=Number.MAX_SAFE_INTEGER||min<=Number.MIN_SAFE_INTEGER)&&(offset=Math.abs(.05*max)),setMax(max+offset),beginAtZero||setMin(min-offset)}this.min=min,this.max=max}getTickLimit(){const tickOpts=this.options.ticks;let maxTicks,{maxTicksLimit,stepSize}=tickOpts;return stepSize?(maxTicks=Math.ceil(this.max/stepSize)-Math.floor(this.min/stepSize)+1,maxTicks>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`),maxTicks=1e3)):(maxTicks=this.computeTickLimit(),maxTicksLimit=maxTicksLimit||11),maxTicksLimit&&(maxTicks=Math.min(maxTicksLimit,maxTicks)),maxTicks}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const opts=this.options,tickOpts=opts.ticks;let maxTicks=this.getTickLimit();maxTicks=Math.max(2,maxTicks);const ticks=generateTicks$1({maxTicks,bounds:opts.bounds,min:opts.min,max:opts.max,precision:tickOpts.precision,step:tickOpts.stepSize,count:tickOpts.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:tickOpts.minRotation||0,includeBounds:!1!==tickOpts.includeBounds},this._range||this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}configure(){const ticks=this.ticks;let start=this.min,end=this.max;if(super.configure(),this.options.offset&&ticks.length){const offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset,end+=offset}this._startValue=start,this._endValue=end,this._valueRange=end-start}getLabelForValue(value){return formatNumber(value,this.chart.options.locale,this.options.ticks.format)}}__name(LinearScaleBase,"LinearScaleBase");class LinearScale extends LinearScaleBase{determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?min:0,this.max=isNumberFinite(max)?max:1,this.handleTickRangeOptions()}computeTickLimit(){const horizontal=this.isHorizontal(),length=horizontal?this.width:this.height,minRotation=toRadians(this.options.ticks.minRotation),ratio=(horizontal?Math.sin(minRotation):Math.cos(minRotation))||.001,tickFont=this._resolveTickFontOptions(0);return Math.ceil(length/Math.min(40,tickFont.lineHeight/ratio))}getPixelForValue(value){return null===value?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getValueForPixel(pixel){return this._startValue+this.getDecimalForPixel(pixel)*this._valueRange}}function isMajor(tickVal){return tickVal/Math.pow(10,Math.floor(log10(tickVal)))==1}function generateTicks(generationOptions,dataRange){const endExp=Math.floor(log10(dataRange.max)),endSignificand=Math.ceil(dataRange.max/Math.pow(10,endExp)),ticks=[];let tickVal=finiteOrDefault(generationOptions.min,Math.pow(10,Math.floor(log10(dataRange.min)))),exp=Math.floor(log10(tickVal)),significand=Math.floor(tickVal/Math.pow(10,exp)),precision=exp<0?Math.pow(10,Math.abs(exp)):1;do{ticks.push({value:tickVal,major:isMajor(tickVal)}),++significand,10===significand&&(significand=1,++exp,precision=exp>=0?1:precision),tickVal=Math.round(significand*Math.pow(10,exp)*precision)/precision}while(exp0?value:null;this._zero=!0}determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?Math.max(0,min):null,this.max=isNumberFinite(max)?Math.max(0,max):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined,maxDefined}=this.getUserBounds();let min=this.min,max=this.max;const setMin=__name(v=>min=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax"),exp=__name((v,m)=>Math.pow(10,Math.floor(log10(v))+m),"exp");min===max&&(min<=0?(setMin(1),setMax(10)):(setMin(exp(min,-1)),setMax(exp(max,1)))),min<=0&&setMin(exp(max,-1)),max<=0&&setMax(exp(min,1)),this._zero&&this.min!==this._suggestedMin&&min===exp(this.min,0)&&setMin(exp(min,-1)),this.min=min,this.max=max}buildTicks(){const opts=this.options,ticks=generateTicks({min:this._userMin,max:this._userMax},this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}getLabelForValue(value){return void 0===value?"0":formatNumber(value,this.chart.options.locale,this.options.ticks.format)}configure(){const start=this.min;super.configure(),this._startValue=log10(start),this._valueRange=log10(this.max)-log10(start)}getPixelForValue(value){return(void 0===value||0===value)&&(value=this.min),null===value||isNaN(value)?NaN:this.getPixelForDecimal(value===this.min?0:(log10(value)-this._startValue)/this._valueRange)}getValueForPixel(pixel){const decimal=this.getDecimalForPixel(pixel);return Math.pow(10,this._startValue+decimal*this._valueRange)}}function getTickBackdropHeight(opts){const tickOpts=opts.ticks;if(tickOpts.display&&opts.display){const padding=toPadding(tickOpts.backdropPadding);return valueOrDefault(tickOpts.font&&tickOpts.font.size,defaults.font.size)+padding.height}return 0}function measureLabelSize(ctx,font,label){return label=isArray(label)?label:[label],{w:_longestText(ctx,font.string,label),h:label.length*font.lineHeight}}function determineLimits(angle,pos,size,min,max){return angle===min||angle===max?{start:pos-size/2,end:pos+size/2}:anglemax?{start:pos-size,end:pos}:{start:pos,end:pos+size}}function fitWithPointLabels(scale){const orig={l:scale.left+scale._padding.left,r:scale.right-scale._padding.right,t:scale.top+scale._padding.top,b:scale.bottom-scale._padding.bottom},limits=Object.assign({},orig),labelSizes=[],padding=[],valueCount=scale._pointLabels.length,pointLabelOpts=scale.options.pointLabels,additionalAngle=pointLabelOpts.centerPointLabels?PI/valueCount:0;for(let i=0;iorig.r&&(x=(hLimits.end-orig.r)/sin,limits.r=Math.max(limits.r,orig.r+x)),vLimits.startorig.b&&(y=(vLimits.end-orig.b)/cos,limits.b=Math.max(limits.b,orig.b+y))}function buildPointLabelItems(scale,labelSizes,padding){const items=[],valueCount=scale._pointLabels.length,opts=scale.options,extra=getTickBackdropHeight(opts)/2,outerDistance=scale.drawingArea,additionalAngle=opts.pointLabels.centerPointLabels?PI/valueCount:0;for(let i=0;i270||angle<90)&&(y-=h),y}function drawPointLabels(scale,labelCount){const{ctx,options:{pointLabels}}=scale;for(let i=labelCount-1;i>=0;i--){const optsAtIndex=pointLabels.setContext(scale.getPointLabelContext(i)),plFont=toFont(optsAtIndex.font),{x,y,textAlign,left,top,right,bottom}=scale._pointLabelItems[i],{backdropColor}=optsAtIndex;if(!isNullOrUndef(backdropColor)){const borderRadius=toTRBLCorners(optsAtIndex.borderRadius),padding=toPadding(optsAtIndex.backdropPadding);ctx.fillStyle=backdropColor;const backdropLeft=left-padding.left,backdropTop=top-padding.top,backdropWidth=right-left+padding.width,backdropHeight=bottom-top+padding.height;Object.values(borderRadius).some(v=>0!==v)?(ctx.beginPath(),addRoundedRectPath(ctx,{x:backdropLeft,y:backdropTop,w:backdropWidth,h:backdropHeight,radius:borderRadius}),ctx.fill()):ctx.fillRect(backdropLeft,backdropTop,backdropWidth,backdropHeight)}renderText(ctx,scale._pointLabels[i],x,y+plFont.lineHeight/2,plFont,{color:optsAtIndex.color,textAlign,textBaseline:"middle"})}}function pathRadiusLine(scale,radius,circular,labelCount){const{ctx}=scale;if(circular)ctx.arc(scale.xCenter,scale.yCenter,radius,0,TAU);else{let pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(let i=1;i{const label=callback(this.options.pointLabels.callback,[value,index2],this);return label||0===label?label:""}).filter((v,i)=>this.chart.getDataVisibility(i))}fit(){const opts=this.options;opts.display&&opts.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(leftMovement,rightMovement,topMovement,bottomMovement){this.xCenter+=Math.floor((leftMovement-rightMovement)/2),this.yCenter+=Math.floor((topMovement-bottomMovement)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(leftMovement,rightMovement,topMovement,bottomMovement))}getIndexAngle(index2){return _normalizeAngle(index2*(TAU/(this._pointLabels.length||1))+toRadians(this.options.startAngle||0))}getDistanceFromCenterForValue(value){if(isNullOrUndef(value))return NaN;const scalingFactor=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-value)*scalingFactor:(value-this.min)*scalingFactor}getValueForDistanceFromCenter(distance){if(isNullOrUndef(distance))return NaN;const scaledDistance=distance/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-scaledDistance:this.min+scaledDistance}getPointLabelContext(index2){const pointLabels=this._pointLabels||[];if(index2>=0&&index2{if(0!==index2){offset=this.getDistanceFromCenterForValue(tick.value);drawRadiusLine(this,grid.setContext(this.getContext(index2-1)),offset,labelCount)}}),angleLines.display){for(ctx.save(),i=labelCount-1;i>=0;i--){const optsAtIndex=angleLines.setContext(this.getPointLabelContext(i)),{color:color2,lineWidth}=optsAtIndex;!lineWidth||!color2||(ctx.lineWidth=lineWidth,ctx.strokeStyle=color2,ctx.setLineDash(optsAtIndex.borderDash),ctx.lineDashOffset=optsAtIndex.borderDashOffset,offset=this.getDistanceFromCenterForValue(opts.ticks.reverse?this.min:this.max),position=this.getPointPosition(i,offset),ctx.beginPath(),ctx.moveTo(this.xCenter,this.yCenter),ctx.lineTo(position.x,position.y),ctx.stroke())}ctx.restore()}}drawBorder(){}drawLabels(){const ctx=this.ctx,opts=this.options,tickOpts=opts.ticks;if(!tickOpts.display)return;const startAngle=this.getIndexAngle(0);let offset,width;ctx.save(),ctx.translate(this.xCenter,this.yCenter),ctx.rotate(startAngle),ctx.textAlign="center",ctx.textBaseline="middle",this.ticks.forEach((tick,index2)=>{if(0===index2&&!opts.reverse)return;const optsAtIndex=tickOpts.setContext(this.getContext(index2)),tickFont=toFont(optsAtIndex.font);if(offset=this.getDistanceFromCenterForValue(this.ticks[index2].value),optsAtIndex.showLabelBackdrop){ctx.font=tickFont.string,width=ctx.measureText(tick.label).width,ctx.fillStyle=optsAtIndex.backdropColor;const padding=toPadding(optsAtIndex.backdropPadding);ctx.fillRect(-width/2-padding.left,-offset-tickFont.size/2-padding.top,width+padding.width,tickFont.size+padding.height)}renderText(ctx,tick.label,0,-offset,tickFont,{color:optsAtIndex.color})}),ctx.restore()}drawTitle(){}}__name(RadialLinearScale,"RadialLinearScale"),RadialLinearScale.id="radialLinear",RadialLinearScale.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:label=>label,padding:5,centerPointLabels:!1}},RadialLinearScale.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},RadialLinearScale.descriptors={angleLines:{_fallback:"grid"}};const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(a,b){return a-b}function parse(scale,input){if(isNullOrUndef(input))return null;const adapter=scale._adapter,{parser,round:round2,isoWeekday}=scale._parseOpts;let value=input;return"function"==typeof parser&&(value=parser(value)),isNumberFinite(value)||(value="string"==typeof parser?adapter.parse(value,parser):adapter.parse(value)),null===value?null:(round2&&(value="week"!==round2||!isNumber(isoWeekday)&&!0!==isoWeekday?adapter.startOf(value,round2):adapter.startOf(value,"isoWeek",isoWeekday)),+value)}function determineUnitForAutoTicks(minUnit,min,max,capacity){const ilen=UNITS.length;for(let i=UNITS.indexOf(minUnit);i=UNITS.indexOf(minUnit);i--){const unit=UNITS[i];if(INTERVALS[unit].common&&scale._adapter.diff(max,min,unit)>=numTicks-1)return unit}return UNITS[minUnit?UNITS.indexOf(minUnit):0]}function determineMajorUnit(unit){for(let i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i=time?timestamps[lo]:timestamps[hi]]=!0}}else ticks[time]=!0}function setMajorTicks(scale,ticks,map2,majorUnit){const adapter=scale._adapter,first=+adapter.startOf(ticks[0].value,majorUnit),last=ticks[ticks.length-1].value;let major,index2;for(major=first;major<=last;major=+adapter.add(major,1,majorUnit))index2=map2[major],index2>=0&&(ticks[index2].major=!0);return ticks}function ticksFromTimestamps(scale,values,majorUnit){const ticks=[],map2={},ilen=values.length;let i,value;for(i=0;i+tick.value))}initOffsets(timestamps){let first,last,start=0,end=0;this.options.offset&×tamps.length&&(first=this.getDecimalForValue(timestamps[0]),start=1===timestamps.length?1-first:(this.getDecimalForValue(timestamps[1])-first)/2,last=this.getDecimalForValue(timestamps[timestamps.length-1]),end=1===timestamps.length?last:(last-this.getDecimalForValue(timestamps[timestamps.length-2]))/2);const limit=timestamps.length<3?.5:.25;start=_limitValue(start,0,limit),end=_limitValue(end,0,limit),this._offsets={start,end,factor:1/(start+1+end)}}_generate(){const adapter=this._adapter,min=this.min,max=this.max,options=this.options,timeOpts=options.time,minor=timeOpts.unit||determineUnitForAutoTicks(timeOpts.minUnit,min,max,this._getLabelCapacity(min)),stepSize=valueOrDefault(timeOpts.stepSize,1),weekday="week"===minor&&timeOpts.isoWeekday,hasWeekday=isNumber(weekday)||!0===weekday,ticks={};let time,count,first=min;if(hasWeekday&&(first=+adapter.startOf(first,"isoWeek",weekday)),first=+adapter.startOf(first,hasWeekday?"day":minor),adapter.diff(max,min,minor)>1e5*stepSize)throw new Error(min+" and "+max+" are too far apart with stepSize of "+stepSize+" "+minor);const timestamps="data"===options.ticks.source&&this.getDataTimestamps();for(time=first,count=0;timea-b).map(x=>+x)}getLabelForValue(value){const adapter=this._adapter,timeOpts=this.options.time;return timeOpts.tooltipFormat?adapter.format(value,timeOpts.tooltipFormat):adapter.format(value,timeOpts.displayFormats.datetime)}_tickFormatFunction(time,index2,ticks,format){const options=this.options,formats=options.time.displayFormats,unit=this._unit,majorUnit=this._majorUnit,minorFormat=unit&&formats[unit],majorFormat=majorUnit&&formats[majorUnit],tick=ticks[index2],major=majorUnit&&majorFormat&&tick&&tick.major,label=this._adapter.format(time,format||(major?majorFormat:minorFormat)),formatter=options.ticks.callback;return formatter?callback(formatter,[label,index2,ticks],this):label}generateTickLabels(ticks){let i,ilen,tick;for(i=0,ilen=ticks.length;i0?capacity:1}getDataTimestamps(){let i,ilen,timestamps=this._cache.data||[];if(timestamps.length)return timestamps;const metas=this.getMatchingVisibleMetas();if(this._normalized&&metas.length)return this._cache.data=metas[0].controller.getAllParsedValues(this);for(i=0,ilen=metas.length;i=table[lo].pos&&val<=table[hi].pos&&({lo,hi}=_lookupByKey(table,"pos",val)),({pos:prevSource,time:prevTarget}=table[lo]),({pos:nextSource,time:nextTarget}=table[hi])):(val>=table[lo].time&&val<=table[hi].time&&({lo,hi}=_lookupByKey(table,"time",val)),({time:prevSource,pos:prevTarget}=table[lo]),({time:nextSource,pos:nextTarget}=table[hi]));const span=nextSource-prevSource;return span?prevTarget+(nextTarget-prevTarget)*(val-prevSource)/span:prevTarget}__name(TimeScale,"TimeScale"),TimeScale.id="time",TimeScale.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}},__name(chart_esm_interpolate,"chart_esm_interpolate");class TimeSeriesScale extends TimeScale{constructor(props){super(props),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const timestamps=this._getTimestampsForTable(),table=this._table=this.buildLookupTable(timestamps);this._minPos=chart_esm_interpolate(table,this.min),this._tableRange=chart_esm_interpolate(table,this.max)-this._minPos,super.initOffsets(timestamps)}buildLookupTable(timestamps){const{min,max}=this,items=[],table=[];let i,ilen,prev,curr,next;for(i=0,ilen=timestamps.length;i=min&&curr<=max&&items.push(curr);if(items.length<2)return[{time:min,pos:0},{time:max,pos:1}];for(i=0,ilen=items.length;i__defProp(target,"name",{value,configurable:!0});exports.id=814,exports.ids=[814],exports.modules={21814:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AuthModule:()=>AuthModule});var common=__webpack_require__(69808),fesm2015_forms=__webpack_require__(93075),asyncToGenerator=__webpack_require__(15861),utilities=__webpack_require__(83670),core=__webpack_require__(5e3),auth_service=__webpack_require__(16518),angular_fire_compat_auth=__webpack_require__(20948),router=__webpack_require__(74202),libphonenumber=__webpack_require__(95724);class Trigger{constructor(open,close){this.open=open,this.close=close||open}isManual(){return"manual"===this.open||"manual"===this.close}}__name(Trigger,"Trigger"),__name(function ListenOptions(){},"ListenOptions");const DEFAULT_ALIASES={hover:["mouseover","mouseout"],focus:["focusin","focusout"]};function parseTriggers(triggers,aliases=DEFAULT_ALIASES){const trimmedTriggers=(triggers||"").trim();if(0===trimmedTriggers.length)return[];const parsedTriggers=trimmedTriggers.split(/\s+/).map(trigger=>trigger.split(":")).map(triggerPair=>{const alias=aliases[triggerPair[0]]||triggerPair;return new Trigger(alias[0],alias[1])}),manualTriggers=parsedTriggers.filter(triggerPair=>triggerPair.isManual());if(manualTriggers.length>1)throw new Error("Triggers parse error: only one manual trigger is allowed");if(1===manualTriggers.length&&parsedTriggers.length>1)throw new Error("Triggers parse error: manual trigger can't be mixed with other triggers");return parsedTriggers}function listenToTriggersV2(renderer,options){const parsedTriggers=parseTriggers(options.triggers),target=options.target;if(1===parsedTriggers.length&&parsedTriggers[0].isManual())return Function.prototype;const listeners=[],_registerHide=[],registerHide=__name(()=>{_registerHide.forEach(fn=>listeners.push(fn())),_registerHide.length=0},"registerHide");return parsedTriggers.forEach(trigger=>{const useToggle=trigger.open===trigger.close,showFn=useToggle?options.toggle:options.show;useToggle||_registerHide.push(()=>renderer.listen(target,trigger.close,options.hide)),listeners.push(renderer.listen(target,trigger.open,()=>showFn(registerHide)))}),()=>{listeners.forEach(unsubscribeFn=>unsubscribeFn())}}function registerOutsideClick(renderer,options){return options.outsideClick?renderer.listen("document","click",event=>{options.target&&options.target.contains(event.target)||options.targets&&options.targets.some(target=>target.contains(event.target))||options.hide()}):Function.prototype}function registerEscClick(renderer,options){return options.outsideEsc?renderer.listen("document","keyup.esc",event=>{options.target&&options.target.contains(event.target)||options.targets&&options.targets.some(target=>target.contains(event.target))||options.hide()}):Function.prototype}__name(parseTriggers,"parseTriggers"),__name(function listenToTriggers(renderer,target,triggers,showFn,hideFn,toggleFn){const parsedTriggers=parseTriggers(triggers),listeners=[];return 1===parsedTriggers.length&&parsedTriggers[0].isManual()?Function.prototype:(parsedTriggers.forEach(trigger=>{trigger.open!==trigger.close?listeners.push(renderer.listen(target,trigger.open,showFn),renderer.listen(target,trigger.close,hideFn)):listeners.push(renderer.listen(target,trigger.open,toggleFn))}),()=>{listeners.forEach(unsubscribeFn=>unsubscribeFn())})},"listenToTriggers"),__name(listenToTriggersV2,"listenToTriggersV2"),__name(registerOutsideClick,"registerOutsideClick"),__name(registerEscClick,"registerEscClick");const win="undefined"!=typeof window&&window||{};win.document,win.location,win.gc,win.performance&&win.performance,win.Event,win.MouseEvent,win.KeyboardEvent,win.EventTarget,win.History,win.Location,win.EventListener;let guessedVersion;function _guessBsVersion(){if("undefined"==typeof document)return null;const spanEl=document.createElement("span");spanEl.innerText="test bs version",document.body.appendChild(spanEl),spanEl.classList.add("d-none");const rect=spanEl.getBoundingClientRect();return document.body.removeChild(spanEl),rect&&0===rect.top?"bs4":"bs3"}function setTheme(theme){guessedVersion=theme}function isBs3(){return void 0===win||(void 0===win.__theme?(guessedVersion||(guessedVersion=_guessBsVersion()),"bs3"===guessedVersion):"bs4"!==win.__theme)}__name(_guessBsVersion,"_guessBsVersion"),__name(setTheme,"setTheme"),__name(isBs3,"isBs3");__name(class LinkedList{constructor(){this.length=0,this.asArray=[]}get(position){if(0===this.length||position<0||position>=this.length)return;let current=this.head;for(let index=0;indexthis.length)throw new Error("Position is out of the list");const node={value,next:void 0,previous:void 0};if(0===this.length)this.head=node,this.tail=node,this.current=node;else if(0===position)node.next=this.head,this.head.previous=node,this.head=node;else if(position===this.length)this.tail.next=node,node.previous=this.tail,this.tail=node;else{const currentPreviousNode=this.getNode(position-1),currentNextNode=currentPreviousNode.next;currentPreviousNode.next=node,currentNextNode.previous=node,node.previous=currentPreviousNode,node.next=currentNextNode}this.length++,this.createInternalArrayRepresentation()}remove(position=0){if(0===this.length||position<0||position>=this.length)throw new Error("Position is out of the list");if(0===position)this.head=this.head.next,this.head?this.head.previous=void 0:this.tail=void 0;else if(position===this.length-1)this.tail=this.tail.previous,this.tail.next=void 0;else{const removedNode=this.getNode(position);removedNode.next.previous=removedNode.previous,removedNode.previous.next=removedNode.next}this.length--,this.createInternalArrayRepresentation()}set(position,value){if(0===this.length||position<0||position>=this.length)throw new Error("Position is out of the list");this.getNode(position).value=value,this.createInternalArrayRepresentation()}toArray(){return this.asArray}findAll(fn){let current=this.head;const result=[];for(let index=0;index{this.add(arg)}),this.length}pop(){if(0===this.length)return;const last=this.tail;return this.remove(this.length-1),last.value}unshift(...args){return args.reverse(),args.forEach(arg=>{this.add(arg,0)}),this.length}shift(){if(0===this.length)return;const lastItem=this.head.value;return this.remove(),lastItem}forEach(fn){let current=this.head;for(let index=0;index=this.length)throw new Error("Position is out of the list");let current=this.head;for(let index=0;indexObject.assign(Object.assign({key},rects[key]),{area:getArea(rects[key])})).sort((a2,b2)=>b2.area-a2.area);let filteredAreas=sortedAreas.filter(({width,height})=>width>=target.clientWidth&&height>=target.clientHeight);filteredAreas=filteredAreas.filter(position=>allowedPositions.some(allowedPosition=>allowedPosition===position.key));const computedPlacement=filteredAreas.length>0?filteredAreas[0].key:sortedAreas[0].key,variation=placement.split(" ")[1];return target.className=target.className.replace(/bs-tooltip-auto/g,`bs-tooltip-${computedPlacement}`),computedPlacement+(variation?`-${variation}`:"")}function getOffsets(data){return{width:data.offsets.target.width,height:data.offsets.target.height,left:Math.floor(data.offsets.target.left),top:Math.round(data.offsets.target.top),bottom:Math.round(data.offsets.target.bottom),right:Math.floor(data.offsets.target.right)}}function getOppositePlacement(placement){const hash={left:"right",right:"left",bottom:"top",top:"bottom"};return placement.replace(/left|right|bottom|top/g,matched=>hash[matched])}function getOppositeVariation(variation){return"right"===variation?"left":"left"===variation?"right":variation}function getOuterSizes(element){const styles=element.ownerDocument.defaultView.getComputedStyle(element),x=parseFloat(styles.marginTop||0)+parseFloat(styles.marginBottom||0),y=parseFloat(styles.marginLeft||0)+parseFloat(styles.marginRight||0);return{width:Number(element.offsetWidth)+y,height:Number(element.offsetHeight)+x}}function getReferenceOffsets(target,host,fixedPosition=null){return getOffsetRectRelativeToArbitraryNode(host,fixedPosition?getFixedPositionOffsetParent(target):findCommonOffsetParent(target,host),fixedPosition)}function getTargetOffsets(target,hostOffsets,position){const placement=position.split(" ")[0],targetRect=getOuterSizes(target),targetOffsets={width:targetRect.width,height:targetRect.height},isHoriz=-1!==["right","left"].indexOf(placement),mainSide=isHoriz?"top":"left",secondarySide=isHoriz?"left":"top",measurement=isHoriz?"height":"width",secondaryMeasurement=isHoriz?"width":"height";return targetOffsets[mainSide]=hostOffsets[mainSide]+hostOffsets[measurement]/2-targetRect[measurement]/2,targetOffsets[secondarySide]=placement===secondarySide?hostOffsets[secondarySide]-targetRect[secondaryMeasurement]:hostOffsets[getOppositePlacement(secondarySide)],targetOffsets}function isModifierEnabled(options,modifierName){return options&&options.modifiers&&options.modifiers[modifierName]&&options.modifiers[modifierName].enabled}function isNumeric(n){return""!==n&&!isNaN(parseFloat(n))&&isFinite(n)}function updateContainerClass(data,renderer){const target=data.instance.target;let containerClass=target.className;data.placementAuto&&(containerClass=containerClass.replace(/bs-popover-auto/g,`bs-popover-${data.placement}`),containerClass=containerClass.replace(/bs-tooltip-auto/g,`bs-tooltip-${data.placement}`),containerClass=containerClass.replace(/\sauto/g,` ${data.placement}`),-1!==containerClass.indexOf("popover")&&-1===containerClass.indexOf("popover-auto")&&(containerClass+=" popover-auto"),-1!==containerClass.indexOf("tooltip")&&-1===containerClass.indexOf("tooltip-auto")&&(containerClass+=" tooltip-auto")),containerClass=containerClass.replace(/left|right|top|bottom/g,`${data.placement.split(" ")[0]}`),renderer?renderer.setAttribute(target,"class",containerClass):target.className=containerClass}function setStyles(element,styles,renderer){Object.keys(styles).forEach(prop=>{let unit="";-1!==["width","height","top","right","bottom","left"].indexOf(prop)&&isNumeric(styles[prop])&&(unit="px"),renderer?renderer.setStyle(element,prop,`${String(styles[prop])}${unit}`):element.style[prop]=String(styles[prop])+unit})}function arrow(data){let targetOffsets=data.offsets.target;const arrowElement=data.instance.target.querySelector(".arrow");if(!arrowElement)return data;const isVertical=-1!==["left","right"].indexOf(data.placement.split(" ")[0]),len=isVertical?"height":"width",sideCapitalized=isVertical?"Top":"Left",side=sideCapitalized.toLowerCase(),altSide=isVertical?"left":"top",opSide=isVertical?"bottom":"right",arrowElementSize=getOuterSizes(arrowElement)[len],placementVariation=data.placement.split(" ")[1];data.offsets.host[opSide]-arrowElementSizetargetOffsets[opSide]&&(targetOffsets[side]+=Number(data.offsets.host[side])+Number(arrowElementSize)-Number(targetOffsets[opSide])),targetOffsets=getClientRect(targetOffsets);const css=getStyleComputedProperty(data.instance.target),targetMarginSide=parseFloat(css[`margin${sideCapitalized}`]),targetBorderSide=parseFloat(css[`border${sideCapitalized}Width`]);let center;if(placementVariation){const targetBorderRadius=parseFloat(css.borderRadius),targetSideArrowOffset=Number(targetMarginSide+targetBorderSide+targetBorderRadius);center=side===placementVariation?Number(data.offsets.host[side])+targetSideArrowOffset:Number(data.offsets.host[side])+Number(data.offsets.host[len]-targetSideArrowOffset)}else center=Number(data.offsets.host[side])+Number(data.offsets.host[len]/2-arrowElementSize/2);let sideValue=center-targetOffsets[side]-targetMarginSide-targetBorderSide;return sideValue=Math.max(Math.min(targetOffsets[len]-arrowElementSize,sideValue),0),data.offsets.arrow={[side]:Math.round(sideValue),[altSide]:""},data.instance.arrow=arrowElement,data}function flip(data){if(data.offsets.target=getClientRect(data.offsets.target),!isModifierEnabled(data.options,"flip"))return data.offsets.target=Object.assign(Object.assign({},data.offsets.target),getTargetOffsets(data.instance.target,data.offsets.host,data.placement)),data;const boundaries=getBoundaries(data.instance.target,data.instance.host,0,"viewport",!1);let placement=data.placement.split(" ")[0],variation=data.placement.split(" ")[1]||"";const adaptivePosition=computeAutoPlacement("auto",data.offsets.host,data.instance.target,data.instance.host,data.options.allowedPositions),flipOrder=[placement,adaptivePosition];return flipOrder.forEach((step,index)=>{if(placement!==step||flipOrder.length===index+1)return data;placement=data.placement.split(" ")[0];const overlapsRef="left"===placement&&Math.floor(data.offsets.target.right)>Math.floor(data.offsets.host.left)||"right"===placement&&Math.floor(data.offsets.target.left)Math.floor(data.offsets.host.top)||"bottom"===placement&&Math.floor(data.offsets.target.top)Math.floor(boundaries.right),overflowsTop=Math.floor(data.offsets.target.top)Math.floor(boundaries.bottom),overflowsBoundaries="left"===placement&&overflowsLeft||"right"===placement&&overflowsRight||"top"===placement&&overflowsTop||"bottom"===placement&&overflowsBottom,isVertical=-1!==["top","bottom"].indexOf(placement),flippedVariation=isVertical&&"left"===variation&&overflowsLeft||isVertical&&"right"===variation&&overflowsRight||!isVertical&&"left"===variation&&overflowsTop||!isVertical&&"right"===variation&&overflowsBottom;(overlapsRef||overflowsBoundaries||flippedVariation)&&((overlapsRef||overflowsBoundaries)&&(placement=flipOrder[index+1]),flippedVariation&&(variation=getOppositeVariation(variation)),data.placement=placement+(variation?` ${variation}`:""),data.offsets.target=Object.assign(Object.assign({},data.offsets.target),getTargetOffsets(data.instance.target,data.offsets.host,data.placement)))}),data}function initData(targetElement,hostElement,position,options){const hostElPosition=getReferenceOffsets(targetElement,hostElement);!position.match(/^(auto)*\s*(left|right|top|bottom)*$/)&&!position.match(/^(left|right|top|bottom)*(?: (left|right|top|bottom))?\s*(start|end)*$/)&&(position="auto");const placementAuto=!!position.match(/auto/g);let placement=position.match(/auto\s(left|right|top|bottom)/)?position.split(" ")[1]||"auto":position;const matches=placement.match(/^(left|right|top|bottom)* ?(?!\1)(left|right|top|bottom)?/);matches&&(placement=matches[1]+(matches[2]?` ${matches[2]}`:"")),-1!==["left right","right left","top bottom","bottom top"].indexOf(placement)&&(placement="auto");const targetOffset=getTargetOffsets(targetElement,hostElPosition,placement);return placement=computeAutoPlacement(placement,hostElPosition,targetElement,hostElement,options?options.allowedPositions:void 0),{options,instance:{target:targetElement,host:hostElement,arrow:null},offsets:{target:targetOffset,host:hostElPosition,arrow:null},positionFixed:!1,placement,placementAuto}}function preventOverflow(data){if(!isModifierEnabled(data.options,"preventOverflow"))return data;const transformProp="transform",targetStyles=data.instance.target.style,{top,left,[transformProp]:transform}=targetStyles;targetStyles.top="",targetStyles.left="",targetStyles[transformProp]="";const boundaries=getBoundaries(data.instance.target,data.instance.host,0,"scrollParent",!1);targetStyles.top=top,targetStyles.left=left,targetStyles[transformProp]=transform;const check={primary(placement){let value=data.offsets.target[placement];return data.offsets.target[placement]boundaries[placement]&&(value=Math.min(data.offsets.target[mainSide],boundaries[placement]-("right"===placement?data.offsets.target.width:data.offsets.target.height))),{[mainSide]:value}}};let side;return["left","right","top","bottom"].forEach(placement=>{side=-1!==["left","top"].indexOf(placement)?"primary":"secondary",data.offsets.target=Object.assign(Object.assign({},data.offsets.target),check[side](placement))}),data}function shift(data){const placement=data.placement,basePlacement=placement.split(" ")[0],shiftVariation=placement.split(" ")[1];if(shiftVariation){const{host,target}=data.offsets,isVertical=-1!==["bottom","top"].indexOf(basePlacement),side=isVertical?"left":"top",measurement=isVertical?"width":"height",shiftOffsets={start:{[side]:host[side]},end:{[side]:host[side]+host[measurement]-target[measurement]}};data.offsets.target=Object.assign(Object.assign({},target),{[side]:side===shiftVariation?shiftOffsets.start[side]:shiftOffsets.end[side]})}return data}__name(isIE,"isIE"),__name(getOffsetParent,"getOffsetParent"),__name(isOffsetContainer,"isOffsetContainer"),__name(getRoot,"getRoot"),__name(findCommonOffsetParent,"findCommonOffsetParent"),__name(getBordersSize,"getBordersSize"),__name(getSize,"getSize"),__name(getWindowSizes,"getWindowSizes"),__name(getScroll,"getScroll"),__name(getClientRect,"getClientRect"),__name(getBoundingClientRect,"getBoundingClientRect"),__name(includeScroll,"includeScroll"),__name(getOffsetRectRelativeToArbitraryNode,"getOffsetRectRelativeToArbitraryNode"),__name(getViewportOffsetRectRelativeToArtbitraryNode,"getViewportOffsetRectRelativeToArtbitraryNode"),__name(isFixed,"isFixed"),__name(getFixedPositionOffsetParent,"getFixedPositionOffsetParent"),__name(getBoundaries,"getBoundaries"),__name(getArea,"getArea"),__name(computeAutoPlacement,"computeAutoPlacement"),__name(getOffsets,"getOffsets"),__name(getOppositePlacement,"getOppositePlacement"),__name(getOppositeVariation,"getOppositeVariation"),__name(getOuterSizes,"getOuterSizes"),__name(getReferenceOffsets,"getReferenceOffsets"),__name(getTargetOffsets,"getTargetOffsets"),__name(isModifierEnabled,"isModifierEnabled"),__name(isNumeric,"isNumeric"),__name(updateContainerClass,"updateContainerClass"),__name(setStyles,"setStyles"),__name(arrow,"arrow"),__name(flip,"flip"),__name(initData,"initData"),__name(preventOverflow,"preventOverflow"),__name(shift,"shift");class Positioning{position(hostElement,targetElement,round=!0){return this.offset(hostElement,targetElement,!1)}offset(hostElement,targetElement,round=!0){return getReferenceOffsets(targetElement,hostElement)}positionElements(hostElement,targetElement,position,appendToBody,options){return[flip,shift,preventOverflow,arrow].reduce((modifiedData,modifier)=>modifier(modifiedData),initData(targetElement,hostElement,position,options))}}__name(Positioning,"Positioning");const positionService=new Positioning;function positionElements(hostElement,targetElement,placement,appendToBody,options,renderer){const data=positionService.positionElements(hostElement,targetElement,placement,appendToBody,options),offsets=getOffsets(data);setStyles(targetElement,{"will-change":"transform",top:"0px",left:"0px",transform:`translate3d(${offsets.left}px, ${offsets.top}px, 0px)`},renderer),data.instance.arrow&&setStyles(data.instance.arrow,data.offsets.arrow,renderer),updateContainerClass(data,renderer)}__name(positionElements,"positionElements"),__name(function PositioningOptions(){},"PositioningOptions");class PositioningService{constructor(ngZone,rendererFactory,platformId){this.update$$=new cjs.Subject,this.positionElements=new Map,this.isDisabled=!1,(0,common.NF)(platformId)&&ngZone.runOutsideAngular(()=>{this.triggerEvent$=(0,cjs.merge)((0,cjs.fromEvent)(window,"scroll",{passive:!0}),(0,cjs.fromEvent)(window,"resize",{passive:!0}),(0,cjs.of)(0,cjs.animationFrameScheduler),this.update$$),this.triggerEvent$.subscribe(()=>{this.isDisabled||this.positionElements.forEach(positionElement=>{positionElements(_getHtmlElement(positionElement.target),_getHtmlElement(positionElement.element),positionElement.attachment,positionElement.appendToBody,this.options,rendererFactory.createRenderer(null,null))})})})}position(options){this.addPositionElement(options)}get event$(){return this.triggerEvent$}disable(){this.isDisabled=!0}enable(){this.isDisabled=!1}addPositionElement(options){this.positionElements.set(_getHtmlElement(options.element),options)}calcPosition(){this.update$$.next()}deletePositionElement(elRef){this.positionElements.delete(_getHtmlElement(elRef))}setOptions(options){this.options=options}}function _getHtmlElement(element){return"string"==typeof element?document.querySelector(element):element instanceof core.SBq?element.nativeElement:element}__name(PositioningService,"PositioningService"),PositioningService.\u0275fac=__name(function(t){return new(t||PositioningService)(core.LFG(core.R0b),core.LFG(core.FYo),core.LFG(core.Lbi))},"PositioningService_Factory"),PositioningService.\u0275prov=core.Yz7({token:PositioningService,factory:PositioningService.\u0275fac}),PositioningService.ctorParameters=()=>[{type:core.R0b},{type:core.FYo},{type:Number,decorators:[{type:core.tBr,args:[core.Lbi]}]}],__name(_getHtmlElement,"_getHtmlElement");__name(class BsComponentRef{},"BsComponentRef");class ContentRef{constructor(nodes,viewRef,componentRef){this.nodes=nodes,this.viewRef=viewRef,this.componentRef=componentRef}}__name(ContentRef,"ContentRef");class ComponentLoader{constructor(_viewContainerRef,_renderer,_elementRef,_injector,_componentFactoryResolver,_ngZone,_applicationRef,_posService){this._viewContainerRef=_viewContainerRef,this._renderer=_renderer,this._elementRef=_elementRef,this._injector=_injector,this._componentFactoryResolver=_componentFactoryResolver,this._ngZone=_ngZone,this._applicationRef=_applicationRef,this._posService=_posService,this.onBeforeShow=new core.vpe,this.onShown=new core.vpe,this.onBeforeHide=new core.vpe,this.onHidden=new core.vpe,this._providers=[],this._isHiding=!1,this.containerDefaultSelector="body",this._listenOpts={},this._globalListener=Function.prototype}get isShown(){return!this._isHiding&&!!this._componentRef}attach(compType){return this._componentFactory=this._componentFactoryResolver.resolveComponentFactory(compType),this}to(container){return this.container=container||this.container,this}position(opts){return this.attachment=opts.attachment||this.attachment,this._elementRef=opts.target||this._elementRef,this}provide(provider){return this._providers.push(provider),this}show(opts={}){if(this._subscribePositioning(),this._innerComponent=null,!this._componentRef){this.onBeforeShow.emit(),this._contentRef=this._getContentRef(opts.content,opts.context,opts.initialState);const injector=core.zs3.create({providers:this._providers,parent:this._injector});this._componentRef=this._componentFactory.create(injector,this._contentRef.nodes),this._applicationRef.attachView(this._componentRef.hostView),this.instance=this._componentRef.instance,Object.assign(this._componentRef.instance,opts),this.container instanceof core.SBq&&this.container.nativeElement.appendChild(this._componentRef.location.nativeElement),"string"==typeof this.container&&"undefined"!=typeof document&&(document.querySelector(this.container)||document.querySelector(this.containerDefaultSelector)).appendChild(this._componentRef.location.nativeElement),!this.container&&this._elementRef&&this._elementRef.nativeElement.parentElement&&this._elementRef.nativeElement.parentElement.appendChild(this._componentRef.location.nativeElement),this._contentRef.componentRef&&(this._innerComponent=this._contentRef.componentRef.instance,this._contentRef.componentRef.changeDetectorRef.markForCheck(),this._contentRef.componentRef.changeDetectorRef.detectChanges()),this._componentRef.changeDetectorRef.markForCheck(),this._componentRef.changeDetectorRef.detectChanges(),this.onShown.emit(opts.id?{id:opts.id}:this._componentRef.instance)}return this._registerOutsideClick(),this._componentRef}hide(id){if(!this._componentRef)return this;this._posService.deletePositionElement(this._componentRef.location),this.onBeforeHide.emit(this._componentRef.instance);const componentEl=this._componentRef.location.nativeElement;return componentEl.parentNode.removeChild(componentEl),this._contentRef.componentRef&&this._contentRef.componentRef.destroy(),this._viewContainerRef&&this._contentRef.viewRef&&this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._contentRef.viewRef)),this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._contentRef=null,this._componentRef=null,this._removeGlobalListener(),this.onHidden.emit(id?{id}:null),this}toggle(){this.isShown?this.hide():this.show()}dispose(){this.isShown&&this.hide(),this._unsubscribePositioning(),this._unregisterListenersFn&&this._unregisterListenersFn()}listen(listenOpts){this.triggers=listenOpts.triggers||this.triggers,this._listenOpts.outsideClick=listenOpts.outsideClick,this._listenOpts.outsideEsc=listenOpts.outsideEsc,listenOpts.target=listenOpts.target||this._elementRef.nativeElement;const hide=this._listenOpts.hide=()=>listenOpts.hide?listenOpts.hide():void this.hide(),show=this._listenOpts.show=registerHide=>{listenOpts.show?listenOpts.show(registerHide):this.show(registerHide),registerHide()},toggle=__name(registerHide=>{this.isShown?hide():show(registerHide)},"toggle");return this._unregisterListenersFn=listenToTriggersV2(this._renderer,{target:listenOpts.target,triggers:listenOpts.triggers,show,hide,toggle}),this}_removeGlobalListener(){this._globalListener&&(this._globalListener(),this._globalListener=null)}attachInline(vRef,template){return this._inlineViewRef=vRef.createEmbeddedView(template),this}_registerOutsideClick(){if(this._componentRef&&this._componentRef.location){if(this._listenOpts.outsideClick){const target=this._componentRef.location.nativeElement;setTimeout(()=>{this._globalListener=registerOutsideClick(this._renderer,{targets:[target,this._elementRef.nativeElement],outsideClick:this._listenOpts.outsideClick,hide:()=>this._listenOpts.hide()})})}if(this._listenOpts.outsideEsc){const target=this._componentRef.location.nativeElement;this._globalListener=registerEscClick(this._renderer,{targets:[target,this._elementRef.nativeElement],outsideEsc:this._listenOpts.outsideEsc,hide:()=>this._listenOpts.hide()})}}}getInnerComponent(){return this._innerComponent}_subscribePositioning(){this._zoneSubscription||!this.attachment||(this.onShown.subscribe(()=>{this._posService.position({element:this._componentRef.location,target:this._elementRef,attachment:this.attachment,appendToBody:"body"===this.container})}),this._zoneSubscription=this._ngZone.onStable.subscribe(()=>{!this._componentRef||this._posService.calcPosition()}))}_unsubscribePositioning(){!this._zoneSubscription||(this._zoneSubscription.unsubscribe(),this._zoneSubscription=null)}_getContentRef(content,context,initialState){if(!content)return new ContentRef([]);if(content instanceof core.Rgc){if(this._viewContainerRef){const _viewRef=this._viewContainerRef.createEmbeddedView(content,context);return _viewRef.markForCheck(),new ContentRef([_viewRef.rootNodes],_viewRef)}const viewRef=content.createEmbeddedView({});return this._applicationRef.attachView(viewRef),new ContentRef([viewRef.rootNodes],viewRef)}if("function"==typeof content){const contentCmptFactory=this._componentFactoryResolver.resolveComponentFactory(content),modalContentInjector=core.zs3.create({providers:this._providers,parent:this._injector}),componentRef=contentCmptFactory.create(modalContentInjector);return Object.assign(componentRef.instance,initialState),this._applicationRef.attachView(componentRef.hostView),new ContentRef([[componentRef.location.nativeElement]],componentRef.hostView,componentRef)}return new ContentRef([[this._renderer.createText(`${content}`)]])}}__name(ComponentLoader,"ComponentLoader");class ComponentLoaderFactory{constructor(_componentFactoryResolver,_ngZone,_injector,_posService,_applicationRef){this._componentFactoryResolver=_componentFactoryResolver,this._ngZone=_ngZone,this._injector=_injector,this._posService=_posService,this._applicationRef=_applicationRef}createLoader(_elementRef,_viewContainerRef,_renderer){return new ComponentLoader(_viewContainerRef,_renderer,_elementRef,this._injector,this._componentFactoryResolver,this._ngZone,this._applicationRef,this._posService)}}__name(ComponentLoaderFactory,"ComponentLoaderFactory"),ComponentLoaderFactory.\u0275fac=__name(function(t){return new(t||ComponentLoaderFactory)(core.LFG(core._Vd),core.LFG(core.R0b),core.LFG(core.zs3),core.LFG(PositioningService),core.LFG(core.z2F))},"ComponentLoaderFactory_Factory"),ComponentLoaderFactory.\u0275prov=core.Yz7({token:ComponentLoaderFactory,factory:ComponentLoaderFactory.\u0275fac}),ComponentLoaderFactory.ctorParameters=()=>[{type:core._Vd},{type:core.R0b},{type:core.zs3},{type:PositioningService},{type:core.z2F}];var animations=__webpack_require__(41777);class BsDropdownConfig{constructor(){this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1}}__name(BsDropdownConfig,"BsDropdownConfig"),BsDropdownConfig.\u0275fac=__name(function(t){return new(t||BsDropdownConfig)},"BsDropdownConfig_Factory"),BsDropdownConfig.\u0275prov=(0,core.Yz7)({factory:__name(function(){return new BsDropdownConfig},"BsDropdownConfig_Factory"),token:BsDropdownConfig,providedIn:"root"});class BsDropdownState{constructor(){this.direction="down",this.isOpenChange=new core.vpe,this.isDisabledChange=new core.vpe,this.toggleClick=new core.vpe,this.dropdownMenu=new Promise(resolve=>{this.resolveDropdownMenu=resolve})}}__name(BsDropdownState,"BsDropdownState"),BsDropdownState.\u0275fac=__name(function(t){return new(t||BsDropdownState)},"BsDropdownState_Factory"),BsDropdownState.\u0275prov=core.Yz7({token:BsDropdownState,factory:BsDropdownState.\u0275fac}),BsDropdownState.ctorParameters=()=>[];const dropdownAnimation=[(0,animations.oB)({height:0,overflow:"hidden"}),(0,animations.jt)("220ms cubic-bezier(0, 0, 0.2, 1)",(0,animations.oB)({height:"*",overflow:"hidden"}))];class BsDropdownContainerComponent{constructor(_state,cd,_renderer,_element,_builder){this._state=_state,this.cd=cd,this._renderer=_renderer,this._element=_element,this.isOpen=!1,this._factoryDropDownAnimation=_builder.build(dropdownAnimation),this._subscription=_state.isOpenChange.subscribe(value=>{this.isOpen=value;const dropdown=this._element.nativeElement.querySelector(".dropdown-menu");this._renderer.addClass(this._element.nativeElement.querySelector("div"),"open"),dropdown&&!isBs3()&&(this._renderer.addClass(dropdown,"show"),dropdown.classList.contains("dropdown-menu-right")&&(this._renderer.setStyle(dropdown,"left","auto"),this._renderer.setStyle(dropdown,"right","0")),"up"===this.direction&&(this._renderer.setStyle(dropdown,"top","auto"),this._renderer.setStyle(dropdown,"transform","translateY(-101%)"))),dropdown&&this._state.isAnimated&&this._factoryDropDownAnimation.create(dropdown).play(),this.cd.markForCheck(),this.cd.detectChanges()})}get direction(){return this._state.direction}_contains(el){return this._element.nativeElement.contains(el)}ngOnDestroy(){this._subscription.unsubscribe()}}__name(BsDropdownContainerComponent,"BsDropdownContainerComponent"),BsDropdownContainerComponent.\u0275fac=__name(function(t){return new(t||BsDropdownContainerComponent)(core.Y36(BsDropdownState),core.Y36(core.sBO),core.Y36(core.Qsj),core.Y36(core.SBq),core.Y36(animations._j))},"BsDropdownContainerComponent_Factory"),BsDropdownContainerComponent.\u0275cmp=core.Xpm({type:BsDropdownContainerComponent,selectors:[["bs-dropdown-container"]],hostAttrs:[2,"display","block","position","absolute","z-index","1040"],ngContentSelectors:["*"],decls:2,vars:8,template:__name(function(rf,ctx){1&rf&&(core.F$t(),core.TgZ(0,"div"),core.Hsn(1),core.qZA()),2&rf&&core.ekj("dropup","up"===ctx.direction)("dropdown","down"===ctx.direction)("show",ctx.isOpen)("open",ctx.isOpen)},"BsDropdownContainerComponent_Template"),dependencies:function(){return[BsDropdownDirective]},encapsulation:2,changeDetection:0}),BsDropdownContainerComponent.ctorParameters=()=>[{type:BsDropdownState},{type:core.sBO},{type:core.Qsj},{type:core.SBq},{type:animations._j}];class BsDropdownDirective{constructor(_elementRef,_renderer,_viewContainerRef,_cis,_state,_config,_builder){this._elementRef=_elementRef,this._renderer=_renderer,this._viewContainerRef=_viewContainerRef,this._cis=_cis,this._state=_state,this._config=_config,this._isInlineOpen=!1,this._subscriptions=[],this._isInited=!1,this._state.autoClose=this._config.autoClose,this._state.insideClick=this._config.insideClick,this._state.isAnimated=this._config.isAnimated,this._factoryDropDownAnimation=_builder.build(dropdownAnimation),this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:BsDropdownState,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange}set autoClose(value){this._state.autoClose=value}get autoClose(){return this._state.autoClose}set isAnimated(value){this._state.isAnimated=value}get isAnimated(){return this._state.isAnimated}set insideClick(value){this._state.insideClick=value}get insideClick(){return this._state.insideClick}set isDisabled(value){this._isDisabled=value,this._state.isDisabledChange.emit(value),value&&this.hide()}get isDisabled(){return this._isDisabled}get isOpen(){return this._showInline?this._isInlineOpen:this._dropdown.isShown}set isOpen(value){value?this.show():this.hide()}get isBs4(){return!isBs3()}get _showInline(){return!this.container}ngOnInit(){this._isInited||(this._isInited=!0,this._dropdown.listen({outsideClick:!1,triggers:this.triggers,show:()=>this.show()}),this._subscriptions.push(this._state.toggleClick.subscribe(value=>this.toggle(value))),this._subscriptions.push(this._state.isDisabledChange.pipe((0,operators.hX)(value=>value)).subscribe(value=>this.hide())))}show(){if(!this.isOpen&&!this.isDisabled){if(this._showInline)return this._inlinedMenu||this._state.dropdownMenu.then(dropdownMenu=>{this._dropdown.attachInline(dropdownMenu.viewContainer,dropdownMenu.templateRef),this._inlinedMenu=this._dropdown._inlineViewRef,this.addBs4Polyfills(),this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode,"open"),this.playAnimation()}).catch(),this.addBs4Polyfills(),this._isInlineOpen=!0,this.onShown.emit(!0),this._state.isOpenChange.emit(!0),void this.playAnimation();this._state.dropdownMenu.then(dropdownMenu=>{const _dropup=this.dropup||void 0!==this.dropup&&this.dropup;this._state.direction=_dropup?"up":"down";const _placement=this.placement||(_dropup?"top start":"bottom start");this._dropdown.attach(BsDropdownContainerComponent).to(this.container).position({attachment:_placement}).show({content:dropdownMenu.templateRef,placement:_placement}),this._state.isOpenChange.emit(!0)}).catch()}}hide(){!this.isOpen||(this._showInline?(this.removeShowClass(),this.removeDropupStyles(),this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))}toggle(value){return this.isOpen||!value?this.hide():this.show()}_contains(event){return this._elementRef.nativeElement.contains(event.target)||this._dropdown.instance&&this._dropdown.instance._contains(event.target)}ngOnDestroy(){for(const sub of this._subscriptions)sub.unsubscribe();this._dropdown.dispose()}addBs4Polyfills(){isBs3()||(this.addShowClass(),this.checkRightAlignment(),this.addDropupStyles())}playAnimation(){this._state.isAnimated&&this._inlinedMenu&&setTimeout(()=>{this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play()})}addShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.addClass(this._inlinedMenu.rootNodes[0],"show")}removeShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.removeClass(this._inlinedMenu.rootNodes[0],"show")}checkRightAlignment(){if(this._inlinedMenu&&this._inlinedMenu.rootNodes[0]){const isRightAligned=this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-right");this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"left",isRightAligned?"auto":"0"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"right",isRightAligned?"0":"auto")}}addDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"top",this.dropup?"auto":"100%"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"transform",this.dropup?"translateY(-101%)":"translateY(0)"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"bottom","auto"))}removeDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"top"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"transform"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"bottom"))}}__name(BsDropdownDirective,"BsDropdownDirective"),BsDropdownDirective.\u0275fac=__name(function(t){return new(t||BsDropdownDirective)(core.Y36(core.SBq),core.Y36(core.Qsj),core.Y36(core.s_b),core.Y36(ComponentLoaderFactory),core.Y36(BsDropdownState),core.Y36(BsDropdownConfig),core.Y36(animations._j))},"BsDropdownDirective_Factory"),BsDropdownDirective.\u0275dir=core.lG2({type:BsDropdownDirective,selectors:[["","bsDropdown",""],["","dropdown",""]],hostVars:6,hostBindings:__name(function(rf,ctx){2&rf&&core.ekj("dropup",ctx.dropup)("open",ctx.isOpen)("show",ctx.isOpen&&ctx.isBs4)},"BsDropdownDirective_HostBindings"),inputs:{autoClose:"autoClose",isAnimated:"isAnimated",insideClick:"insideClick",isDisabled:"isDisabled",isOpen:"isOpen",placement:"placement",triggers:"triggers",container:"container",dropup:"dropup"},outputs:{onShown:"onShown",onHidden:"onHidden",isOpenChange:"isOpenChange"},exportAs:["bs-dropdown"],features:[core._Bn([BsDropdownState])]}),BsDropdownDirective.ctorParameters=()=>[{type:core.SBq},{type:core.Qsj},{type:core.s_b},{type:ComponentLoaderFactory},{type:BsDropdownState},{type:BsDropdownConfig},{type:animations._j}],BsDropdownDirective.propDecorators={placement:[{type:core.IIB}],triggers:[{type:core.IIB}],container:[{type:core.IIB}],dropup:[{type:core.IIB}],autoClose:[{type:core.IIB}],isAnimated:[{type:core.IIB}],insideClick:[{type:core.IIB}],isDisabled:[{type:core.IIB}],isOpen:[{type:core.IIB}],isOpenChange:[{type:core.r_U}],onShown:[{type:core.r_U}],onHidden:[{type:core.r_U}]};class BsDropdownMenuDirective{constructor(_state,_viewContainer,_templateRef){_state.resolveDropdownMenu({templateRef:_templateRef,viewContainer:_viewContainer})}}__name(BsDropdownMenuDirective,"BsDropdownMenuDirective"),BsDropdownMenuDirective.\u0275fac=__name(function(t){return new(t||BsDropdownMenuDirective)(core.Y36(BsDropdownState),core.Y36(core.s_b),core.Y36(core.Rgc))},"BsDropdownMenuDirective_Factory"),BsDropdownMenuDirective.\u0275dir=core.lG2({type:BsDropdownMenuDirective,selectors:[["","bsDropdownMenu",""],["","dropdownMenu",""]],exportAs:["bs-dropdown-menu"]}),BsDropdownMenuDirective.ctorParameters=()=>[{type:BsDropdownState},{type:core.s_b},{type:core.Rgc}];class BsDropdownToggleDirective{constructor(_changeDetectorRef,_dropdown,_element,_renderer,_state){this._changeDetectorRef=_changeDetectorRef,this._dropdown=_dropdown,this._element=_element,this._renderer=_renderer,this._state=_state,this.isDisabled=null,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(value=>{this.isOpen=value,value?(this._documentClickListener=this._renderer.listen("document","click",event=>{this._state.autoClose&&2!==event.button&&!this._element.nativeElement.contains(event.target)&&(!this._state.insideClick||!this._dropdown._contains(event))&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())}),this._escKeyUpListener=this._renderer.listen(this._element.nativeElement,"keyup.esc",()=>{this._state.autoClose&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())})):(this._documentClickListener(),this._escKeyUpListener())})),this._subscriptions.push(this._state.isDisabledChange.subscribe(value=>this.isDisabled=value||null))}onClick(){this.isDisabled||this._state.toggleClick.emit(!0)}ngOnDestroy(){this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener();for(const sub of this._subscriptions)sub.unsubscribe()}}__name(BsDropdownToggleDirective,"BsDropdownToggleDirective"),BsDropdownToggleDirective.\u0275fac=__name(function(t){return new(t||BsDropdownToggleDirective)(core.Y36(core.sBO),core.Y36(BsDropdownDirective),core.Y36(core.SBq),core.Y36(core.Qsj),core.Y36(BsDropdownState))},"BsDropdownToggleDirective_Factory"),BsDropdownToggleDirective.\u0275dir=core.lG2({type:BsDropdownToggleDirective,selectors:[["","bsDropdownToggle",""],["","dropdownToggle",""]],hostVars:3,hostBindings:__name(function(rf,ctx){1&rf&&core.NdJ("click",__name(function(){return ctx.onClick()},"BsDropdownToggleDirective_click_HostBindingHandler")),2&rf&&core.uIk("aria-haspopup",!0)("disabled",ctx.isDisabled)("aria-expanded",ctx.isOpen)},"BsDropdownToggleDirective_HostBindings"),exportAs:["bs-dropdown-toggle"]}),BsDropdownToggleDirective.ctorParameters=()=>[{type:core.sBO},{type:BsDropdownDirective},{type:core.SBq},{type:core.Qsj},{type:BsDropdownState}],BsDropdownToggleDirective.propDecorators={isDisabled:[{type:core.pfw,args:["attr.disabled"]}],isOpen:[{type:core.pfw,args:["attr.aria-expanded"]}],onClick:[{type:core.L6J,args:["click",[]]}]};class BsDropdownModule{static forRoot(config){return{ngModule:BsDropdownModule,providers:[ComponentLoaderFactory,PositioningService,BsDropdownState]}}}__name(BsDropdownModule,"BsDropdownModule"),BsDropdownModule.\u0275fac=__name(function(t){return new(t||BsDropdownModule)},"BsDropdownModule_Factory"),BsDropdownModule.\u0275mod=core.oAB({type:BsDropdownModule}),BsDropdownModule.\u0275inj=core.cJS({});const ngx_intl_tel_input_c0=["countryList"];function NgxIntlTelInputComponent_div_4_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"div",9),core._uU(1),core.qZA()),2&rf){const ctx_r0=core.oxw();core.xp6(1),core.hij("+",ctx_r0.selectedCountry.dialCode,"")}}function NgxIntlTelInputComponent_div_6_div_1_Template(rf,ctx){if(1&rf){const _r9=core.EpF();core.TgZ(0,"div",17)(1,"input",18),core.NdJ("ngModelChange",__name(function($event){core.CHM(_r9);const ctx_r8=core.oxw(2);return core.KtG(ctx_r8.countrySearchText=$event)},"NgxIntlTelInputComponent_div_6_div_1_Template_input_ngModelChange_1_listener"))("keyup",__name(function(){core.CHM(_r9);const ctx_r10=core.oxw(2);return core.KtG(ctx_r10.searchCountry())},"NgxIntlTelInputComponent_div_6_div_1_Template_input_keyup_1_listener"))("click",__name(function($event){return $event.stopPropagation()},"NgxIntlTelInputComponent_div_6_div_1_Template_input_click_1_listener")),core.qZA()()}if(2&rf){const ctx_r3=core.oxw(2);core.xp6(1),core.Q6J("ngModel",ctx_r3.countrySearchText)("placeholder",ctx_r3.searchCountryPlaceholder)}}function NgxIntlTelInputComponent_div_6_li_4_Template(rf,ctx){if(1&rf){const _r14=core.EpF();core.TgZ(0,"li",19),core.NdJ("click",__name(function(){const country_r12=core.CHM(_r14).$implicit,ctx_r13=core.oxw(2),_r2=core.MAs(8);return core.KtG(ctx_r13.onCountrySelect(country_r12,_r2))},"NgxIntlTelInputComponent_div_6_li_4_Template_li_click_0_listener")),core.TgZ(1,"div",20),core._UZ(2,"div",3),core.qZA(),core.TgZ(3,"span",21),core._uU(4),core.qZA(),core.TgZ(5,"span",22),core._uU(6),core.qZA()()}if(2&rf){const country_r12=ctx.$implicit;core.Q6J("id",country_r12.htmlId+"-preferred"),core.xp6(2),core.Q6J("ngClass",country_r12.flagClass),core.xp6(2),core.Oqu(country_r12.name),core.xp6(2),core.hij("+",country_r12.dialCode,"")}}function NgxIntlTelInputComponent_div_6_li_5_Template(rf,ctx){1&rf&&core._UZ(0,"li",23)}function NgxIntlTelInputComponent_div_6_li_6_Template(rf,ctx){if(1&rf){const _r17=core.EpF();core.TgZ(0,"li",24),core.NdJ("click",__name(function(){const country_r15=core.CHM(_r17).$implicit,ctx_r16=core.oxw(2),_r2=core.MAs(8);return core.KtG(ctx_r16.onCountrySelect(country_r15,_r2))},"NgxIntlTelInputComponent_div_6_li_6_Template_li_click_0_listener")),core.TgZ(1,"div",20),core._UZ(2,"div",3),core.qZA(),core.TgZ(3,"span",21),core._uU(4),core.qZA(),core.TgZ(5,"span",22),core._uU(6),core.qZA()()}if(2&rf){const country_r15=ctx.$implicit;core.Q6J("id",country_r15.htmlId),core.xp6(2),core.Q6J("ngClass",country_r15.flagClass),core.xp6(2),core.Oqu(country_r15.name),core.xp6(2),core.hij("+",country_r15.dialCode,"")}}function NgxIntlTelInputComponent_div_6_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"div",10),core.YNc(1,NgxIntlTelInputComponent_div_6_div_1_Template,2,2,"div",11),core.TgZ(2,"ul",12,13),core.YNc(4,NgxIntlTelInputComponent_div_6_li_4_Template,7,4,"li",14),core.YNc(5,NgxIntlTelInputComponent_div_6_li_5_Template,1,0,"li",15),core.YNc(6,NgxIntlTelInputComponent_div_6_li_6_Template,7,4,"li",16),core.qZA()()),2&rf){const ctx_r1=core.oxw();core.xp6(1),core.Q6J("ngIf",ctx_r1.searchCountryFlag&&ctx_r1.searchCountryField),core.xp6(3),core.Q6J("ngForOf",ctx_r1.preferredCountriesInDropDown),core.xp6(1),core.Q6J("ngIf",null==ctx_r1.preferredCountriesInDropDown?null:ctx_r1.preferredCountriesInDropDown.length),core.xp6(1),core.Q6J("ngForOf",ctx_r1.allCountries)}}__name(NgxIntlTelInputComponent_div_4_Template,"NgxIntlTelInputComponent_div_4_Template"),__name(NgxIntlTelInputComponent_div_6_div_1_Template,"NgxIntlTelInputComponent_div_6_div_1_Template"),__name(NgxIntlTelInputComponent_div_6_li_4_Template,"NgxIntlTelInputComponent_div_6_li_4_Template"),__name(NgxIntlTelInputComponent_div_6_li_5_Template,"NgxIntlTelInputComponent_div_6_li_5_Template"),__name(NgxIntlTelInputComponent_div_6_li_6_Template,"NgxIntlTelInputComponent_div_6_li_6_Template"),__name(NgxIntlTelInputComponent_div_6_Template,"NgxIntlTelInputComponent_div_6_Template");const _c1=__name(function(a0){return{disabled:a0}},"_c1");var CountryISO,CountryISO2,SearchCountryField,SearchCountryField2;(CountryISO2=CountryISO||(CountryISO={})).Afghanistan="af",CountryISO2.Albania="al",CountryISO2.Algeria="dz",CountryISO2.AmericanSamoa="as",CountryISO2.Andorra="ad",CountryISO2.Angola="ao",CountryISO2.Anguilla="ai",CountryISO2.AntiguaAndBarbuda="ag",CountryISO2.Argentina="ar",CountryISO2.Armenia="am",CountryISO2.Aruba="aw",CountryISO2.Australia="au",CountryISO2.Austria="at",CountryISO2.Azerbaijan="az",CountryISO2.Bahamas="bs",CountryISO2.Bahrain="bh",CountryISO2.Bangladesh="bd",CountryISO2.Barbados="bb",CountryISO2.Belarus="by",CountryISO2.Belgium="be",CountryISO2.Belize="bz",CountryISO2.Benin="bj",CountryISO2.Bermuda="bm",CountryISO2.Bhutan="bt",CountryISO2.Bolivia="bo",CountryISO2.BosniaAndHerzegovina="ba",CountryISO2.Botswana="bw",CountryISO2.Brazil="br",CountryISO2.BritishIndianOceanTerritory="io",CountryISO2.BritishVirginIslands="vg",CountryISO2.Brunei="bn",CountryISO2.Bulgaria="bg",CountryISO2.BurkinaFaso="bf",CountryISO2.Burundi="bi",CountryISO2.Cambodia="kh",CountryISO2.Cameroon="cm",CountryISO2.Canada="ca",CountryISO2.CapeVerde="cv",CountryISO2.CaribbeanNetherlands="bq",CountryISO2.CaymanIslands="ky",CountryISO2.CentralAfricanRepublic="cf",CountryISO2.Chad="td",CountryISO2.Chile="cl",CountryISO2.China="cn",CountryISO2.ChristmasIsland="cx",CountryISO2.Cocos="cc",CountryISO2.Colombia="co",CountryISO2.Comoros="km",CountryISO2.CongoDRCJamhuriYaKidemokrasiaYaKongo="cd",CountryISO2.CongoRepublicCongoBrazzaville="cg",CountryISO2.CookIslands="ck",CountryISO2.CostaRica="cr",CountryISO2.C\u00f4teDIvoire="ci",CountryISO2.Croatia="hr",CountryISO2.Cuba="cu",CountryISO2.Cura\u00e7ao="cw",CountryISO2.Cyprus="cy",CountryISO2.CzechRepublic="cz",CountryISO2.Denmark="dk",CountryISO2.Djibouti="dj",CountryISO2.Dominica="dm",CountryISO2.DominicanRepublic="do",CountryISO2.Ecuador="ec",CountryISO2.Egypt="eg",CountryISO2.ElSalvador="sv",CountryISO2.EquatorialGuinea="gq",CountryISO2.Eritrea="er",CountryISO2.Estonia="ee",CountryISO2.Ethiopia="et",CountryISO2.FalklandIslands="fk",CountryISO2.FaroeIslands="fo",CountryISO2.Fiji="fj",CountryISO2.Finland="fi",CountryISO2.France="fr",CountryISO2.FrenchGuiana="gf",CountryISO2.FrenchPolynesia="pf",CountryISO2.Gabon="ga",CountryISO2.Gambia="gm",CountryISO2.Georgia="ge",CountryISO2.Germany="de",CountryISO2.Ghana="gh",CountryISO2.Gibraltar="gi",CountryISO2.Greece="gr",CountryISO2.Greenland="gl",CountryISO2.Grenada="gd",CountryISO2.Guadeloupe="gp",CountryISO2.Guam="gu",CountryISO2.Guatemala="gt",CountryISO2.Guernsey="gg",CountryISO2.Guinea="gn",CountryISO2.GuineaBissau="gw",CountryISO2.Guyana="gy",CountryISO2.Haiti="ht",CountryISO2.Honduras="hn",CountryISO2.HongKong="hk",CountryISO2.Hungary="hu",CountryISO2.Iceland="is",CountryISO2.India="in",CountryISO2.Indonesia="id",CountryISO2.Iran="ir",CountryISO2.Iraq="iq",CountryISO2.Ireland="ie",CountryISO2.IsleOfMan="im",CountryISO2.Israel="il",CountryISO2.Italy="it",CountryISO2.Jamaica="jm",CountryISO2.Japan="jp",CountryISO2.Jersey="je",CountryISO2.Jordan="jo",CountryISO2.Kazakhstan="kz",CountryISO2.Kenya="ke",CountryISO2.Kiribati="ki",CountryISO2.Kosovo="xk",CountryISO2.Kuwait="kw",CountryISO2.Kyrgyzstan="kg",CountryISO2.Laos="la",CountryISO2.Latvia="lv",CountryISO2.Lebanon="lb",CountryISO2.Lesotho="ls",CountryISO2.Liberia="lr",CountryISO2.Libya="ly",CountryISO2.Liechtenstein="li",CountryISO2.Lithuania="lt",CountryISO2.Luxembourg="lu",CountryISO2.Macau="mo",CountryISO2.Macedonia="mk",CountryISO2.Madagascar="mg",CountryISO2.Malawi="mw",CountryISO2.Malaysia="my",CountryISO2.Maldives="mv",CountryISO2.Mali="ml",CountryISO2.Malta="mt",CountryISO2.MarshallIslands="mh",CountryISO2.Martinique="mq",CountryISO2.Mauritania="mr",CountryISO2.Mauritius="mu",CountryISO2.Mayotte="yt",CountryISO2.Mexico="mx",CountryISO2.Micronesia="fm",CountryISO2.Moldova="md",CountryISO2.Monaco="mc",CountryISO2.Mongolia="mn",CountryISO2.Montenegro="me",CountryISO2.Montserrat="ms",CountryISO2.Morocco="ma",CountryISO2.Mozambique="mz",CountryISO2.Myanmar="mm",CountryISO2.Namibia="na",CountryISO2.Nauru="nr",CountryISO2.Nepal="np",CountryISO2.Netherlands="nl",CountryISO2.NewCaledonia="nc",CountryISO2.NewZealand="nz",CountryISO2.Nicaragua="ni",CountryISO2.Niger="ne",CountryISO2.Nigeria="ng",CountryISO2.Niue="nu",CountryISO2.NorfolkIsland="nf",CountryISO2.NorthKorea="kp",CountryISO2.NorthernMarianaIslands="mp",CountryISO2.Norway="no",CountryISO2.Oman="om",CountryISO2.Pakistan="pk",CountryISO2.Palau="pw",CountryISO2.Palestine="ps",CountryISO2.Panama="pa",CountryISO2.PapuaNewGuinea="pg",CountryISO2.Paraguay="py",CountryISO2.Peru="pe",CountryISO2.Philippines="ph",CountryISO2.Poland="pl",CountryISO2.Portugal="pt",CountryISO2.PuertoRico="pr",CountryISO2.Qatar="qa",CountryISO2.R\u00e9union="re",CountryISO2.Romania="ro",CountryISO2.Russia="ru",CountryISO2.Rwanda="rw",CountryISO2.SaintBarth\u00e9lemy="bl",CountryISO2.SaintHelena="sh",CountryISO2.SaintKittsAndNevis="kn",CountryISO2.SaintLucia="lc",CountryISO2.SaintMartin="mf",CountryISO2.SaintPierreAndMiquelon="pm",CountryISO2.SaintVincentAndTheGrenadines="vc",CountryISO2.Samoa="ws",CountryISO2.SanMarino="sm",CountryISO2.S\u00e3oTom\u00e9AndPr\u00edncipe="st",CountryISO2.SaudiArabia="sa",CountryISO2.Senegal="sn",CountryISO2.Serbia="rs",CountryISO2.Seychelles="sc",CountryISO2.SierraLeone="sl",CountryISO2.Singapore="sg",CountryISO2.SintMaarten="sx",CountryISO2.Slovakia="sk",CountryISO2.Slovenia="si",CountryISO2.SolomonIslands="sb",CountryISO2.Somalia="so",CountryISO2.SouthAfrica="za",CountryISO2.SouthKorea="kr",CountryISO2.SouthSudan="ss",CountryISO2.Spain="es",CountryISO2.SriLanka="lk",CountryISO2.Sudan="sd",CountryISO2.Suriname="sr",CountryISO2.SvalbardAndJanMayen="sj",CountryISO2.Swaziland="sz",CountryISO2.Sweden="se",CountryISO2.Switzerland="ch",CountryISO2.Syria="sy",CountryISO2.Taiwan="tw",CountryISO2.Tajikistan="tj",CountryISO2.Tanzania="tz",CountryISO2.Thailand="th",CountryISO2.TimorLeste="tl",CountryISO2.Togo="tg",CountryISO2.Tokelau="tk",CountryISO2.Tonga="to",CountryISO2.TrinidadAndTobago="tt",CountryISO2.Tunisia="tn",CountryISO2.Turkey="tr",CountryISO2.Turkmenistan="tm",CountryISO2.TurksAndCaicosIslands="tc",CountryISO2.Tuvalu="tv",CountryISO2.USVirginIslands="vi",CountryISO2.Uganda="ug",CountryISO2.Ukraine="ua",CountryISO2.UnitedArabEmirates="ae",CountryISO2.UnitedKingdom="gb",CountryISO2.UnitedStates="us",CountryISO2.Uruguay="uy",CountryISO2.Uzbekistan="uz",CountryISO2.Vanuatu="vu",CountryISO2.VaticanCity="va",CountryISO2.Venezuela="ve",CountryISO2.Vietnam="vn",CountryISO2.WallisAndFutuna="wf",CountryISO2.WesternSahara="eh",CountryISO2.Yemen="ye",CountryISO2.Zambia="zm",CountryISO2.Zimbabwe="zw",CountryISO2.\u00c5landIslands="ax";class CountryCode{constructor(){this.allCountries=[["Afghanistan (\u202b\u0627\u0641\u063a\u0627\u0646\u0633\u062a\u0627\u0646\u202c\u200e)",CountryISO.Afghanistan,"93"],["Albania (Shqip\xebri)",CountryISO.Albania,"355"],["Algeria (\u202b\u0627\u0644\u062c\u0632\u0627\u0626\u0631\u202c\u200e)",CountryISO.Algeria,"213"],["American Samoa","as","1",1,["684"]],["Andorra",CountryISO.Andorra,"376"],["Angola",CountryISO.Angola,"244"],["Anguilla","ai","1",1,["264"]],["Antigua and Barbuda","ag","1",1,["268"]],["Argentina",CountryISO.Argentina,"54"],["Armenia (\u0540\u0561\u0575\u0561\u057d\u057f\u0561\u0576)",CountryISO.Armenia,"374"],["Aruba",CountryISO.Aruba,"297"],["Australia",CountryISO.Australia,"61",0],["Austria (\xd6sterreich)",CountryISO.Austria,"43"],["Azerbaijan (Az\u0259rbaycan)",CountryISO.Azerbaijan,"994"],["Bahamas","bs","1",1,["242"]],["Bahrain (\u202b\u0627\u0644\u0628\u062d\u0631\u064a\u0646\u202c\u200e)",CountryISO.Bahrain,"973"],["Bangladesh (\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)",CountryISO.Bangladesh,"880"],["Barbados","bb","1",1,["246"]],["Belarus (\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u044c)",CountryISO.Belarus,"375"],["Belgium (Belgi\xeb)",CountryISO.Belgium,"32"],["Belize",CountryISO.Belize,"501"],["Benin (B\xe9nin)",CountryISO.Benin,"229"],["Bermuda","bm","1",1,["441"]],["Bhutan (\u0f60\u0f56\u0fb2\u0f74\u0f42)",CountryISO.Bhutan,"975"],["Bolivia",CountryISO.Bolivia,"591"],["Bosnia and Herzegovina (\u0411\u043e\u0441\u043d\u0430 \u0438 \u0425\u0435\u0440\u0446\u0435\u0433\u043e\u0432\u0438\u043d\u0430)",CountryISO.BosniaAndHerzegovina,"387"],["Botswana",CountryISO.Botswana,"267"],["Brazil (Brasil)",CountryISO.Brazil,"55"],["British Indian Ocean Territory",CountryISO.BritishIndianOceanTerritory,"246"],["British Virgin Islands","vg","1",1,["284"]],["Brunei",CountryISO.Brunei,"673"],["Bulgaria (\u0411\u044a\u043b\u0433\u0430\u0440\u0438\u044f)",CountryISO.Bulgaria,"359"],["Burkina Faso",CountryISO.BurkinaFaso,"226"],["Burundi (Uburundi)",CountryISO.Burundi,"257"],["Cambodia (\u1780\u1798\u17d2\u1796\u17bb\u1787\u17b6)",CountryISO.Cambodia,"855"],["Cameroon (Cameroun)",CountryISO.Cameroon,"237"],["Canada",CountryISO.Canada,"1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)",CountryISO.CapeVerde,"238"],["Caribbean Netherlands",CountryISO.CaribbeanNetherlands,"599",1],["Cayman Islands","ky","1",1,["345"]],["Central African Republic (R\xe9publique centrafricaine)",CountryISO.CentralAfricanRepublic,"236"],["Chad (Tchad)",CountryISO.Chad,"235"],["Chile",CountryISO.Chile,"56"],["China (\u4e2d\u56fd)",CountryISO.China,"86"],["Christmas Island",CountryISO.ChristmasIsland,"61",2],["Cocos (Keeling) Islands",CountryISO.Cocos,"61",1],["Colombia",CountryISO.Colombia,"57"],["Comoros (\u202b\u062c\u0632\u0631 \u0627\u0644\u0642\u0645\u0631\u202c\u200e)",CountryISO.Comoros,"269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)",CountryISO.CongoDRCJamhuriYaKidemokrasiaYaKongo,"243"],["Congo (Republic) (Congo-Brazzaville)",CountryISO.CongoRepublicCongoBrazzaville,"242"],["Cook Islands",CountryISO.CookIslands,"682"],["Costa Rica",CountryISO.CostaRica,"506"],["C\xf4te d\u2019Ivoire",CountryISO.C\u00f4teDIvoire,"225"],["Croatia (Hrvatska)",CountryISO.Croatia,"385"],["Cuba",CountryISO.Cuba,"53"],["Cura\xe7ao",CountryISO.Cura\u00e7ao,"599",0],["Cyprus (\u039a\u03cd\u03c0\u03c1\u03bf\u03c2)",CountryISO.Cyprus,"357"],["Czech Republic (\u010cesk\xe1 republika)",CountryISO.CzechRepublic,"420"],["Denmark (Danmark)",CountryISO.Denmark,"45"],["Djibouti",CountryISO.Djibouti,"253"],["Dominica",CountryISO.Dominica,"1767"],["Dominican Republic (Rep\xfablica Dominicana)",CountryISO.DominicanRepublic,"1",2,["809","829","849"]],["Ecuador",CountryISO.Ecuador,"593"],["Egypt (\u202b\u0645\u0635\u0631\u202c\u200e)",CountryISO.Egypt,"20"],["El Salvador",CountryISO.ElSalvador,"503"],["Equatorial Guinea (Guinea Ecuatorial)",CountryISO.EquatorialGuinea,"240"],["Eritrea",CountryISO.Eritrea,"291"],["Estonia (Eesti)",CountryISO.Estonia,"372"],["Ethiopia",CountryISO.Ethiopia,"251"],["Falkland Islands (Islas Malvinas)",CountryISO.FalklandIslands,"500"],["Faroe Islands (F\xf8royar)",CountryISO.FaroeIslands,"298"],["Fiji",CountryISO.Fiji,"679"],["Finland (Suomi)",CountryISO.Finland,"358",0],["France",CountryISO.France,"33"],["French Guiana (Guyane fran\xe7aise)",CountryISO.FrenchGuiana,"594"],["French Polynesia (Polyn\xe9sie fran\xe7aise)",CountryISO.FrenchPolynesia,"689"],["Gabon",CountryISO.Gabon,"241"],["Gambia",CountryISO.Gambia,"220"],["Georgia (\u10e1\u10d0\u10e5\u10d0\u10e0\u10d7\u10d5\u10d4\u10da\u10dd)",CountryISO.Georgia,"995"],["Germany (Deutschland)",CountryISO.Germany,"49"],["Ghana (Gaana)",CountryISO.Ghana,"233"],["Gibraltar",CountryISO.Gibraltar,"350"],["Greece (\u0395\u03bb\u03bb\u03ac\u03b4\u03b1)",CountryISO.Greece,"30"],["Greenland (Kalaallit Nunaat)",CountryISO.Greenland,"299"],["Grenada",CountryISO.Grenada,"1473"],["Guadeloupe",CountryISO.Guadeloupe,"590",0],["Guam","gu","1",1,["671"]],["Guatemala",CountryISO.Guatemala,"502"],["Guernsey",CountryISO.Guernsey,"44",1,[1481]],["Guinea (Guin\xe9e)",CountryISO.Guinea,"224"],["Guinea-Bissau (Guin\xe9 Bissau)",CountryISO.GuineaBissau,"245"],["Guyana",CountryISO.Guyana,"592"],["Haiti",CountryISO.Haiti,"509"],["Honduras",CountryISO.Honduras,"504"],["Hong Kong (\u9999\u6e2f)",CountryISO.HongKong,"852"],["Hungary (Magyarorsz\xe1g)",CountryISO.Hungary,"36"],["Iceland (\xcdsland)",CountryISO.Iceland,"354"],["India (\u092d\u093e\u0930\u0924)",CountryISO.India,"91"],["Indonesia",CountryISO.Indonesia,"62"],["Iran (\u202b\u0627\u06cc\u0631\u0627\u0646\u202c\u200e)",CountryISO.Iran,"98"],["Iraq (\u202b\u0627\u0644\u0639\u0631\u0627\u0642\u202c\u200e)",CountryISO.Iraq,"964"],["Ireland",CountryISO.Ireland,"353"],["Isle of Man",CountryISO.IsleOfMan,"44",2,[1624]],["Israel (\u202b\u05d9\u05e9\u05e8\u05d0\u05dc\u202c\u200e)",CountryISO.Israel,"972"],["Italy (Italia)",CountryISO.Italy,"39",0],["Jamaica","jm","1",1,["876"]],["Japan (\u65e5\u672c)",CountryISO.Japan,"81"],["Jersey",CountryISO.Jersey,"44",3,[1534]],["Jordan (\u202b\u0627\u0644\u0623\u0631\u062f\u0646\u202c\u200e)",CountryISO.Jordan,"962"],["Kazakhstan (\u041a\u0430\u0437\u0430\u0445\u0441\u0442\u0430\u043d)",CountryISO.Kazakhstan,"7",1],["Kenya",CountryISO.Kenya,"254"],["Kiribati",CountryISO.Kiribati,"686"],["Kosovo",CountryISO.Kosovo,"383"],["Kuwait (\u202b\u0627\u0644\u0643\u0648\u064a\u062a\u202c\u200e)",CountryISO.Kuwait,"965"],["Kyrgyzstan (\u041a\u044b\u0440\u0433\u044b\u0437\u0441\u0442\u0430\u043d)",CountryISO.Kyrgyzstan,"996"],["Laos (\u0ea5\u0eb2\u0ea7)",CountryISO.Laos,"856"],["Latvia (Latvija)",CountryISO.Latvia,"371"],["Lebanon (\u202b\u0644\u0628\u0646\u0627\u0646\u202c\u200e)",CountryISO.Lebanon,"961"],["Lesotho",CountryISO.Lesotho,"266"],["Liberia",CountryISO.Liberia,"231"],["Libya (\u202b\u0644\u064a\u0628\u064a\u0627\u202c\u200e)",CountryISO.Libya,"218"],["Liechtenstein",CountryISO.Liechtenstein,"423"],["Lithuania (Lietuva)",CountryISO.Lithuania,"370"],["Luxembourg",CountryISO.Luxembourg,"352"],["Macau (\u6fb3\u9580)",CountryISO.Macau,"853"],["Macedonia (FYROM) (\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0438\u0458\u0430)",CountryISO.Macedonia,"389"],["Madagascar (Madagasikara)",CountryISO.Madagascar,"261"],["Malawi",CountryISO.Malawi,"265"],["Malaysia",CountryISO.Malaysia,"60"],["Maldives",CountryISO.Maldives,"960"],["Mali",CountryISO.Mali,"223"],["Malta",CountryISO.Malta,"356"],["Marshall Islands",CountryISO.MarshallIslands,"692"],["Martinique",CountryISO.Martinique,"596"],["Mauritania (\u202b\u0645\u0648\u0631\u064a\u062a\u0627\u0646\u064a\u0627\u202c\u200e)",CountryISO.Mauritania,"222"],["Mauritius (Moris)",CountryISO.Mauritius,"230"],["Mayotte",CountryISO.Mayotte,"262",1],["Mexico (M\xe9xico)",CountryISO.Mexico,"52"],["Micronesia",CountryISO.Micronesia,"691"],["Moldova (Republica Moldova)",CountryISO.Moldova,"373"],["Monaco",CountryISO.Monaco,"377"],["Mongolia (\u041c\u043e\u043d\u0433\u043e\u043b)",CountryISO.Mongolia,"976"],["Montenegro (Crna Gora)",CountryISO.Montenegro,"382"],["Montserrat","ms","1",1,["664"]],["Morocco (\u202b\u0627\u0644\u0645\u063a\u0631\u0628\u202c\u200e)",CountryISO.Morocco,"212",0],["Mozambique (Mo\xe7ambique)",CountryISO.Mozambique,"258"],["Myanmar (Burma) (\u1019\u103c\u1014\u103a\u1019\u102c)",CountryISO.Myanmar,"95"],["Namibia (Namibi\xeb)",CountryISO.Namibia,"264"],["Nauru",CountryISO.Nauru,"674"],["Nepal (\u0928\u0947\u092a\u093e\u0932)",CountryISO.Nepal,"977"],["Netherlands (Nederland)",CountryISO.Netherlands,"31"],["New Caledonia (Nouvelle-Cal\xe9donie)",CountryISO.NewCaledonia,"687"],["New Zealand",CountryISO.NewZealand,"64"],["Nicaragua",CountryISO.Nicaragua,"505"],["Niger (Nijar)",CountryISO.Niger,"227"],["Nigeria",CountryISO.Nigeria,"234"],["Niue",CountryISO.Niue,"683"],["Norfolk Island",CountryISO.NorfolkIsland,"672"],["North Korea (\uc870\uc120 \ubbfc\uc8fc\uc8fc\uc758 \uc778\ubbfc \uacf5\ud654\uad6d)",CountryISO.NorthKorea,"850"],["Northern Mariana Islands",CountryISO.NorthernMarianaIslands,"1670"],["Norway (Norge)",CountryISO.Norway,"47",0],["Oman (\u202b\u0639\u064f\u0645\u0627\u0646\u202c\u200e)",CountryISO.Oman,"968"],["Pakistan (\u202b\u067e\u0627\u06a9\u0633\u062a\u0627\u0646\u202c\u200e)",CountryISO.Pakistan,"92"],["Palau",CountryISO.Palau,"680"],["Palestine (\u202b\u0641\u0644\u0633\u0637\u064a\u0646\u202c\u200e)",CountryISO.Palestine,"970"],["Panama (Panam\xe1)",CountryISO.Panama,"507"],["Papua New Guinea",CountryISO.PapuaNewGuinea,"675"],["Paraguay",CountryISO.Paraguay,"595"],["Peru (Per\xfa)",CountryISO.Peru,"51"],["Philippines",CountryISO.Philippines,"63"],["Poland (Polska)",CountryISO.Poland,"48"],["Portugal",CountryISO.Portugal,"351"],["Puerto Rico",CountryISO.PuertoRico,"1",3,["787","939"]],["Qatar (\u202b\u0642\u0637\u0631\u202c\u200e)",CountryISO.Qatar,"974"],["R\xe9union (La R\xe9union)",CountryISO.R\u00e9union,"262",0],["Romania (Rom\xe2nia)",CountryISO.Romania,"40"],["Russia (\u0420\u043e\u0441\u0441\u0438\u044f)",CountryISO.Russia,"7",0],["Rwanda",CountryISO.Rwanda,"250"],["Saint Barth\xe9lemy (Saint-Barth\xe9lemy)",CountryISO.SaintBarth\u00e9lemy,"590",1],["Saint Helena",CountryISO.SaintHelena,"290"],["Saint Kitts and Nevis",CountryISO.SaintKittsAndNevis,"1869"],["Saint Lucia","lc","1",1,["758"]],["Saint Martin (Saint-Martin (partie fran\xe7aise))",CountryISO.SaintMartin,"590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)",CountryISO.SaintPierreAndMiquelon,"508"],["Saint Vincent and the Grenadines","vc","1",1,["784"]],["Samoa",CountryISO.Samoa,"685"],["San Marino",CountryISO.SanMarino,"378"],["S\xe3o Tom\xe9 and Pr\xedncipe (S\xe3o Tom\xe9 e Pr\xedncipe)",CountryISO.S\u00e3oTom\u00e9AndPr\u00edncipe,"239"],["Saudi Arabia (\u202b\u0627\u0644\u0645\u0645\u0644\u0643\u0629 \u0627\u0644\u0639\u0631\u0628\u064a\u0629 \u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629\u202c\u200e)",CountryISO.SaudiArabia,"966"],["Senegal (S\xe9n\xe9gal)",CountryISO.Senegal,"221"],["Serbia (\u0421\u0440\u0431\u0438\u0458\u0430)",CountryISO.Serbia,"381"],["Seychelles",CountryISO.Seychelles,"248"],["Sierra Leone",CountryISO.SierraLeone,"232"],["Singapore",CountryISO.Singapore,"65"],["Sint Maarten","sx","1",1,["721"]],["Slovakia (Slovensko)",CountryISO.Slovakia,"421"],["Slovenia (Slovenija)",CountryISO.Slovenia,"386"],["Solomon Islands",CountryISO.SolomonIslands,"677"],["Somalia (Soomaaliya)",CountryISO.Somalia,"252"],["South Africa",CountryISO.SouthAfrica,"27"],["South Korea (\ub300\ud55c\ubbfc\uad6d)",CountryISO.SouthKorea,"82"],["South Sudan (\u202b\u062c\u0646\u0648\u0628 \u0627\u0644\u0633\u0648\u062f\u0627\u0646\u202c\u200e)",CountryISO.SouthSudan,"211"],["Spain (Espa\xf1a)",CountryISO.Spain,"34"],["Sri Lanka (\u0dc1\u0dca\u200d\u0dbb\u0dd3 \u0dbd\u0d82\u0d9a\u0dcf\u0dc0)",CountryISO.SriLanka,"94"],["Sudan (\u202b\u0627\u0644\u0633\u0648\u062f\u0627\u0646\u202c\u200e)",CountryISO.Sudan,"249"],["Suriname",CountryISO.Suriname,"597"],["Svalbard and Jan Mayen",CountryISO.SvalbardAndJanMayen,"47",1],["Swaziland",CountryISO.Swaziland,"268"],["Sweden (Sverige)",CountryISO.Sweden,"46"],["Switzerland (Schweiz)",CountryISO.Switzerland,"41"],["Syria (\u202b\u0633\u0648\u0631\u064a\u0627\u202c\u200e)",CountryISO.Syria,"963"],["Taiwan (\u53f0\u7063)",CountryISO.Taiwan,"886"],["Tajikistan",CountryISO.Tajikistan,"992"],["Tanzania",CountryISO.Tanzania,"255"],["Thailand (\u0e44\u0e17\u0e22)",CountryISO.Thailand,"66"],["Timor-Leste",CountryISO.TimorLeste,"670"],["Togo",CountryISO.Togo,"228"],["Tokelau",CountryISO.Tokelau,"690"],["Tonga",CountryISO.Tonga,"676"],["Trinidad and Tobago","tt","1",1,["868"]],["Tunisia (\u202b\u062a\u0648\u0646\u0633\u202c\u200e)",CountryISO.Tunisia,"216"],["Turkey (T\xfcrkiye)",CountryISO.Turkey,"90"],["Turkmenistan",CountryISO.Turkmenistan,"993"],["Turks and Caicos Islands",CountryISO.TurksAndCaicosIslands,"1649"],["Tuvalu",CountryISO.Tuvalu,"688"],["U.S. Virgin Islands","vi","1",1,["340"]],["Uganda",CountryISO.Uganda,"256"],["Ukraine (\u0423\u043a\u0440\u0430\u0457\u043d\u0430)",CountryISO.Ukraine,"380"],["United Arab Emirates (\u202b\u0627\u0644\u0625\u0645\u0627\u0631\u0627\u062a \u0627\u0644\u0639\u0631\u0628\u064a\u0629 \u0627\u0644\u0645\u062a\u062d\u062f\u0629\u202c\u200e)",CountryISO.UnitedArabEmirates,"971"],["United Kingdom",CountryISO.UnitedKingdom,"44",0],["United States",CountryISO.UnitedStates,"1",0],["Uruguay",CountryISO.Uruguay,"598"],["Uzbekistan (O\u02bbzbekiston)",CountryISO.Uzbekistan,"998"],["Vanuatu",CountryISO.Vanuatu,"678"],["Vatican City (Citt\xe0 del Vaticano)",CountryISO.VaticanCity,"39",1],["Venezuela",CountryISO.Venezuela,"58"],["Vietnam (Vi\u1ec7t Nam)",CountryISO.Vietnam,"84"],["Wallis and Futuna",CountryISO.WallisAndFutuna,"681"],["Western Sahara (\u202b\u0627\u0644\u0635\u062d\u0631\u0627\u0621 \u0627\u0644\u063a\u0631\u0628\u064a\u0629\u202c\u200e)",CountryISO.WesternSahara,"212",1],["Yemen (\u202b\u0627\u0644\u064a\u0645\u0646\u202c\u200e)",CountryISO.Yemen,"967"],["Zambia",CountryISO.Zambia,"260"],["Zimbabwe",CountryISO.Zimbabwe,"263"],["\xc5land Islands",CountryISO.\u00c5landIslands,"358",1]]}}__name(CountryCode,"CountryCode"),CountryCode.\u0275fac=__name(function(t){return new(t||CountryCode)},"CountryCode_Factory"),CountryCode.\u0275prov=core.Yz7({token:CountryCode,factory:CountryCode.\u0275fac}),(SearchCountryField2=SearchCountryField||(SearchCountryField={})).DialCode="dialCode",SearchCountryField2.Iso2="iso2",SearchCountryField2.Name="name",SearchCountryField2.All="all";const phoneNumberValidator=__name(control=>{if(!control.value)return;const el=control.nativeElement,inputBox=el?el.querySelector('input[type="tel"]'):void 0;if(inputBox){inputBox.id;const isCheckValidation=inputBox.getAttribute("validation");if("true"===isCheckValidation){const isRequired=control.errors&&!0===control.errors.required,error={validatePhoneNumber:{valid:!1}};let number;inputBox.setCustomValidity("Invalid field.");try{number=libphonenumber.PhoneNumberUtil.getInstance().parse(control.value.number,control.value.countryCode)}catch{if(isRequired)return error;inputBox.setCustomValidity("")}if(control.value){if(!number)return error;if(!libphonenumber.PhoneNumberUtil.getInstance().isValidNumberForRegion(number,control.value.countryCode))return error;inputBox.setCustomValidity("")}}else"false"===isCheckValidation&&(inputBox.setCustomValidity(""),control.clearValidators())}},"phoneNumberValidator");var PhoneNumberFormat,PhoneNumberFormat2;(PhoneNumberFormat2=PhoneNumberFormat||(PhoneNumberFormat={})).International="INTERNATIONAL",PhoneNumberFormat2.National="NATIONAL";class NativeElementInjectorDirective{constructor(controlDir,host){this.controlDir=controlDir,this.host=host}ngOnInit(){this.controlDir.control&&(this.controlDir.control.nativeElement=this.host.nativeElement)}}__name(NativeElementInjectorDirective,"NativeElementInjectorDirective"),NativeElementInjectorDirective.\u0275fac=__name(function(t){return new(t||NativeElementInjectorDirective)(core.Y36(fesm2015_forms.a5),core.Y36(core.SBq))},"NativeElementInjectorDirective_Factory"),NativeElementInjectorDirective.\u0275dir=core.lG2({type:NativeElementInjectorDirective,selectors:[["","ngModel",""],["","formControl",""],["","formControlName",""]]});class NgxIntlTelInputComponent{constructor(countryCodeData){this.countryCodeData=countryCodeData,this.value="",this.preferredCountries=[],this.enablePlaceholder=!0,this.numberFormat=PhoneNumberFormat.International,this.cssClass="form-control",this.onlyCountries=[],this.enableAutoCountrySelect=!0,this.searchCountryFlag=!1,this.searchCountryField=[SearchCountryField.All],this.searchCountryPlaceholder="Search Country",this.selectFirstCountry=!0,this.phoneValidation=!0,this.inputId="phone",this.separateDialCode=!1,this.countryChange=new core.vpe,this.selectedCountry={areaCodes:void 0,dialCode:"",htmlId:"",flagClass:"",iso2:"",name:"",placeHolder:"",priority:0},this.phoneNumber="",this.allCountries=[],this.preferredCountriesInDropDown=[],this.phoneUtil=libphonenumber.PhoneNumberUtil.getInstance(),this.disabled=!1,this.errors=["Phone number is required."],this.countrySearchText="",this.onTouched=()=>{},this.propagateChange=_=>{},setTheme("bs4")}ngOnInit(){this.init()}ngOnChanges(changes){const selectedISO=changes.selectedCountryISO;this.allCountries&&selectedISO&&selectedISO.currentValue!==selectedISO.previousValue&&this.updateSelectedCountry(),changes.preferredCountries&&this.updatePreferredCountries(),this.checkSeparateDialCodeStyle()}init(){this.fetchCountryData(),this.preferredCountries.length&&this.updatePreferredCountries(),this.onlyCountries.length&&(this.allCountries=this.allCountries.filter(c2=>this.onlyCountries.includes(c2.iso2))),this.selectFirstCountry&&(this.preferredCountriesInDropDown.length?this.setSelectedCountry(this.preferredCountriesInDropDown[0]):this.setSelectedCountry(this.allCountries[0])),this.updateSelectedCountry(),this.checkSeparateDialCodeStyle()}setSelectedCountry(country){this.selectedCountry=country,this.countryChange.emit(country)}searchCountry(){if(!this.countrySearchText)return void this.countryList.nativeElement.querySelector(".iti__country-list li").scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});const countrySearchTextLower=this.countrySearchText.toLowerCase(),country=this.allCountries.filter(c2=>{if(this.searchCountryField.indexOf(SearchCountryField.All)>-1){if(c2.iso2.toLowerCase().startsWith(countrySearchTextLower)||c2.name.toLowerCase().startsWith(countrySearchTextLower)||c2.dialCode.startsWith(this.countrySearchText))return c2}else if(this.searchCountryField.indexOf(SearchCountryField.Iso2)>-1&&c2.iso2.toLowerCase().startsWith(countrySearchTextLower)||this.searchCountryField.indexOf(SearchCountryField.Name)>-1&&c2.name.toLowerCase().startsWith(countrySearchTextLower)||this.searchCountryField.indexOf(SearchCountryField.DialCode)>-1&&c2.dialCode.startsWith(this.countrySearchText))return c2});if(country.length>0){const el=this.countryList.nativeElement.querySelector("#"+country[0].htmlId);el&&el.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}this.checkSeparateDialCodeStyle()}onPhoneNumberChange(){let countryCode;if(this.phoneNumber&&"object"==typeof this.phoneNumber){const numberObj=this.phoneNumber;this.phoneNumber=numberObj.number,countryCode=numberObj.countryCode}this.value=this.phoneNumber,countryCode=countryCode||this.selectedCountry.iso2;const number=this.getParsedNumber(this.phoneNumber,countryCode);if(this.enableAutoCountrySelect&&(countryCode=number&&number.getCountryCode()?this.getCountryIsoCode(number.getCountryCode(),number):this.selectedCountry.iso2,countryCode&&countryCode!==this.selectedCountry.iso2)){const newCountry=this.allCountries.sort((a2,b2)=>a2.priority-b2.priority).find(c2=>c2.iso2===countryCode);newCountry&&(this.selectedCountry=newCountry)}if(countryCode=countryCode||this.selectedCountry.iso2,this.checkSeparateDialCodeStyle(),this.value){const intlNo=number?this.phoneUtil.format(number,libphonenumber.PhoneNumberFormat.INTERNATIONAL):"";this.separateDialCode&&intlNo&&(this.value=this.removeDialCode(intlNo)),this.propagateChange({number:this.value,internationalNumber:intlNo,nationalNumber:number?this.phoneUtil.format(number,libphonenumber.PhoneNumberFormat.NATIONAL):"",e164Number:number?this.phoneUtil.format(number,libphonenumber.PhoneNumberFormat.E164):"",countryCode:countryCode.toUpperCase(),dialCode:"+"+this.selectedCountry.dialCode})}else this.propagateChange(null)}onCountrySelect(country,el){if(this.setSelectedCountry(country),this.checkSeparateDialCodeStyle(),this.phoneNumber&&this.phoneNumber.length>0){this.value=this.phoneNumber;const number=this.getParsedNumber(this.phoneNumber,this.selectedCountry.iso2),intlNo=number?this.phoneUtil.format(number,libphonenumber.PhoneNumberFormat.INTERNATIONAL):"";this.separateDialCode&&intlNo&&(this.value=this.removeDialCode(intlNo)),this.propagateChange({number:this.value,internationalNumber:intlNo,nationalNumber:number?this.phoneUtil.format(number,libphonenumber.PhoneNumberFormat.NATIONAL):"",e164Number:number?this.phoneUtil.format(number,libphonenumber.PhoneNumberFormat.E164):"",countryCode:this.selectedCountry.iso2.toUpperCase(),dialCode:"+"+this.selectedCountry.dialCode})}else this.propagateChange(null);el.focus()}onInputKeyPress(event){!/[0-9\+\-\(\)\ ]/.test(event.key)&&(!event.ctrlKey||!/[axcv]/.test(event.key))&&!["ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End","Insert","Delete","Backspace"].includes(event.key)&&event.preventDefault()}registerOnChange(fn){this.propagateChange=fn}registerOnTouched(fn){this.onTouched=fn}setDisabledState(isDisabled){this.disabled=isDisabled}writeValue(obj){void 0===obj&&this.init(),this.phoneNumber=obj,setTimeout(()=>{this.onPhoneNumberChange()},1)}resolvePlaceholder(){let placeholder="";return this.customPlaceholder?placeholder=this.customPlaceholder:this.selectedCountry.placeHolder&&(placeholder=this.selectedCountry.placeHolder,this.separateDialCode&&(placeholder=this.removeDialCode(placeholder))),placeholder}getParsedNumber(phoneNumber,countryCode){let number;try{number=this.phoneUtil.parse(phoneNumber,countryCode.toUpperCase())}catch{}return number}checkSeparateDialCodeStyle(){if(this.separateDialCode&&this.selectedCountry){const cntryCd=this.selectedCountry.dialCode;this.separateDialCodeClass="separate-dial-code iti-sdc-"+(cntryCd.length+1)}else this.separateDialCodeClass=""}removeDialCode(phoneNumber){const number=this.getParsedNumber(phoneNumber,this.selectedCountry.iso2);return(phoneNumber=this.phoneUtil.format(number,libphonenumber.PhoneNumberFormat[this.numberFormat])).startsWith("+")&&this.separateDialCode&&(phoneNumber=phoneNumber.substr(phoneNumber.indexOf(" ")+1)),phoneNumber}getCountryIsoCode(countryCode,number){const rawNumber=number.values_[2].toString(),countries=this.allCountries.filter(c2=>c2.dialCode===countryCode.toString()),mainCountry=countries.find(c2=>void 0===c2.areaCodes),secondaryCountries=countries.filter(c2=>void 0!==c2.areaCodes);let matchedCountry=mainCountry?mainCountry.iso2:void 0;return secondaryCountries.forEach(country=>{country.areaCodes.forEach(areaCode=>{rawNumber.startsWith(areaCode)&&(matchedCountry=country.iso2)})}),matchedCountry}getPhoneNumberPlaceHolder(countryCode){try{return this.phoneUtil.format(this.phoneUtil.getExampleNumber(countryCode),libphonenumber.PhoneNumberFormat[this.numberFormat])}catch(e2){return e2}}fetchCountryData(){this.allCountries=[],this.countryCodeData.allCountries.forEach(c2=>{const country={name:c2[0].toString(),iso2:c2[1].toString(),dialCode:c2[2].toString(),priority:+c2[3]||0,areaCodes:c2[4]||void 0,htmlId:`iti-0__item-${c2[1].toString()}`,flagClass:`iti__${c2[1].toString().toLocaleLowerCase()}`,placeHolder:""};this.enablePlaceholder&&(country.placeHolder=this.getPhoneNumberPlaceHolder(country.iso2.toUpperCase())),this.allCountries.push(country)})}updatePreferredCountries(){this.preferredCountries.length&&(this.preferredCountriesInDropDown=[],this.preferredCountries.forEach(iso2=>{const preferredCountry=this.allCountries.filter(c2=>c2.iso2===iso2);this.preferredCountriesInDropDown.push(preferredCountry[0])}))}updateSelectedCountry(){this.selectedCountryISO&&(this.selectedCountry=this.allCountries.find(c2=>c2.iso2.toLowerCase()===this.selectedCountryISO.toLowerCase()),this.selectedCountry&&(this.phoneNumber?this.onPhoneNumberChange():this.propagateChange(null)))}}__name(NgxIntlTelInputComponent,"NgxIntlTelInputComponent"),NgxIntlTelInputComponent.\u0275fac=__name(function(t){return new(t||NgxIntlTelInputComponent)(core.Y36(CountryCode))},"NgxIntlTelInputComponent_Factory"),NgxIntlTelInputComponent.\u0275cmp=core.Xpm({type:NgxIntlTelInputComponent,selectors:[["ngx-intl-tel-input"]],viewQuery:__name(function(rf,ctx){if(1&rf&&core.Gf(ngx_intl_tel_input_c0,5),2&rf){let _t;core.iGM(_t=core.CRH())&&(ctx.countryList=_t.first)}},"NgxIntlTelInputComponent_Query"),inputs:{value:"value",preferredCountries:"preferredCountries",enablePlaceholder:"enablePlaceholder",customPlaceholder:"customPlaceholder",numberFormat:"numberFormat",cssClass:"cssClass",onlyCountries:"onlyCountries",enableAutoCountrySelect:"enableAutoCountrySelect",searchCountryFlag:"searchCountryFlag",searchCountryField:"searchCountryField",searchCountryPlaceholder:"searchCountryPlaceholder",maxLength:"maxLength",selectFirstCountry:"selectFirstCountry",selectedCountryISO:"selectedCountryISO",phoneValidation:"phoneValidation",inputId:"inputId",separateDialCode:"separateDialCode"},outputs:{countryChange:"countryChange"},features:[core._Bn([CountryCode,{provide:fesm2015_forms.JU,useExisting:(0,core.Gpc)(()=>NgxIntlTelInputComponent),multi:!0},{provide:fesm2015_forms.Cf,useValue:phoneNumberValidator,multi:!0}]),core.TTD],decls:9,vars:14,consts:[[1,"iti","iti--allow-dropdown",3,"ngClass"],["dropdown","",1,"iti__flag-container",3,"ngClass","isDisabled"],["dropdownToggle","",1,"iti__selected-flag","dropdown-toggle"],[1,"iti__flag",3,"ngClass"],["class","selected-dial-code",4,"ngIf"],[1,"iti__arrow"],["class","dropdown-menu country-dropdown",4,"dropdownMenu"],["type","tel","autocomplete","off",3,"id","ngClass","ngModel","disabled","placeholder","blur","keypress","ngModelChange"],["focusable",""],[1,"selected-dial-code"],[1,"dropdown-menu","country-dropdown"],["class","search-container",4,"ngIf"],[1,"iti__country-list"],["countryList",""],["class","iti__country iti__preferred",3,"id","click",4,"ngFor","ngForOf"],["class","iti__divider",4,"ngIf"],["class","iti__country iti__standard",3,"id","click",4,"ngFor","ngForOf"],[1,"search-container"],["id","country-search-box","autofocus","",3,"ngModel","placeholder","ngModelChange","keyup","click"],[1,"iti__country","iti__preferred",3,"id","click"],[1,"iti__flag-box"],[1,"iti__country-name"],[1,"iti__dial-code"],[1,"iti__divider"],[1,"iti__country","iti__standard",3,"id","click"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0)(1,"div",1)(2,"div",2),core._UZ(3,"div",3),core.YNc(4,NgxIntlTelInputComponent_div_4_Template,2,1,"div",4),core._UZ(5,"div",5),core.qZA(),core.YNc(6,NgxIntlTelInputComponent_div_6_Template,7,4,"div",6),core.qZA(),core.TgZ(7,"input",7,8),core.NdJ("blur",__name(function(){return ctx.onTouched()},"NgxIntlTelInputComponent_Template_input_blur_7_listener"))("keypress",__name(function($event){return ctx.onInputKeyPress($event)},"NgxIntlTelInputComponent_Template_input_keypress_7_listener"))("ngModelChange",__name(function($event){return ctx.phoneNumber=$event},"NgxIntlTelInputComponent_Template_input_ngModelChange_7_listener"))("ngModelChange",__name(function(){return ctx.onPhoneNumberChange()},"NgxIntlTelInputComponent_Template_input_ngModelChange_7_listener")),core.qZA()()),2&rf&&(core.Q6J("ngClass",ctx.separateDialCodeClass),core.xp6(1),core.Q6J("ngClass",core.VKq(12,_c1,ctx.disabled))("isDisabled",ctx.disabled),core.xp6(2),core.Q6J("ngClass",(null==ctx.selectedCountry?null:ctx.selectedCountry.flagClass)||""),core.xp6(1),core.Q6J("ngIf",ctx.separateDialCode),core.xp6(3),core.Q6J("id",ctx.inputId)("ngClass",ctx.cssClass)("ngModel",ctx.phoneNumber)("disabled",ctx.disabled)("placeholder",ctx.resolvePlaceholder()),core.uIk("maxLength",ctx.maxLength)("validation",ctx.phoneValidation))},"NgxIntlTelInputComponent_Template"),dependencies:[common.mk,BsDropdownDirective,BsDropdownToggleDirective,common.O5,BsDropdownMenuDirective,fesm2015_forms.Fj,fesm2015_forms.JJ,fesm2015_forms.On,NativeElementInjectorDirective,common.sg],styles:['.dropup[_ngcontent-%COMP%], .dropright[_ngcontent-%COMP%], .dropdown[_ngcontent-%COMP%], .dropleft[_ngcontent-%COMP%]{position:relative}.dropdown-toggle[_ngcontent-%COMP%]{white-space:nowrap}.dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle[_ngcontent-%COMP%]:empty:after{margin-left:0}.dropdown-menu[_ngcontent-%COMP%]{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left[_ngcontent-%COMP%]{right:auto;left:0}.dropdown-menu-right[_ngcontent-%COMP%]{right:0;left:auto}@media (min-width: 576px){.dropdown-menu-sm-left[_ngcontent-%COMP%]{right:auto;left:0}.dropdown-menu-sm-right[_ngcontent-%COMP%]{right:0;left:auto}}@media (min-width: 768px){.dropdown-menu-md-left[_ngcontent-%COMP%]{right:auto;left:0}.dropdown-menu-md-right[_ngcontent-%COMP%]{right:0;left:auto}}@media (min-width: 992px){.dropdown-menu-lg-left[_ngcontent-%COMP%]{right:auto;left:0}.dropdown-menu-lg-right[_ngcontent-%COMP%]{right:0;left:auto}}@media (min-width: 1200px){.dropdown-menu-xl-left[_ngcontent-%COMP%]{right:auto;left:0}.dropdown-menu-xl-right[_ngcontent-%COMP%]{right:0;left:auto}}.dropup[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:empty:after{margin-left:0}.dropright[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:empty:after{margin-left:0}.dropright[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{vertical-align:0}.dropleft[_ngcontent-%COMP%] .dropdown-menu[_ngcontent-%COMP%]{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropleft[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:none}.dropleft[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:empty:after{margin-left:0}.dropleft[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:before{vertical-align:0}.dropdown-menu[x-placement^=top][_ngcontent-%COMP%], .dropdown-menu[x-placement^=right][_ngcontent-%COMP%], .dropdown-menu[x-placement^=bottom][_ngcontent-%COMP%], .dropdown-menu[x-placement^=left][_ngcontent-%COMP%]{right:auto;bottom:auto}.dropdown-divider[_ngcontent-%COMP%]{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item[_ngcontent-%COMP%]{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item[_ngcontent-%COMP%]:hover, .dropdown-item[_ngcontent-%COMP%]:focus{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active[_ngcontent-%COMP%], .dropdown-item[_ngcontent-%COMP%]:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled[_ngcontent-%COMP%], .dropdown-item[_ngcontent-%COMP%]:disabled{color:#6c757d;pointer-events:none;background-color:transparent}.dropdown-menu.show[_ngcontent-%COMP%]{display:block}.dropdown-header[_ngcontent-%COMP%]{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text[_ngcontent-%COMP%]{display:block;padding:.25rem 1.5rem;color:#212529}',"li.iti__country[_ngcontent-%COMP%]:hover{background-color:#0000000d}.iti__selected-flag.dropdown-toggle[_ngcontent-%COMP%]:after{content:none}.iti__flag-container.disabled[_ngcontent-%COMP%]{cursor:default!important}.iti.iti--allow-dropdown[_ngcontent-%COMP%] .flag-container.disabled[_ngcontent-%COMP%]:hover .iti__selected-flag[_ngcontent-%COMP%]{background:none}.country-dropdown[_ngcontent-%COMP%]{border:1px solid #ccc;width:-moz-fit-content;width:fit-content;padding:1px;border-collapse:collapse}.search-container[_ngcontent-%COMP%]{position:relative}.search-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%;border:none;border-bottom:1px solid #ccc;padding-left:10px}.search-icon[_ngcontent-%COMP%]{position:absolute;z-index:2;width:25px;margin:1px 10px}.iti__country-list[_ngcontent-%COMP%]{position:relative;border:none}.iti[_ngcontent-%COMP%] input#country-search-box[_ngcontent-%COMP%]{padding-left:6px}.iti[_ngcontent-%COMP%] .selected-dial-code[_ngcontent-%COMP%]{margin-left:6px}.iti.separate-dial-code[_ngcontent-%COMP%] .iti__selected-flag[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-2[_ngcontent-%COMP%] .iti__selected-flag[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-3[_ngcontent-%COMP%] .iti__selected-flag[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-4[_ngcontent-%COMP%] .iti__selected-flag[_ngcontent-%COMP%]{width:93px}.iti.separate-dial-code[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-2[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-3[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .iti.separate-dial-code.iti--allow-dropdown.iti-sdc-4[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:98px}"]});const dropdownModuleForRoot=BsDropdownModule.forRoot();class NgxIntlTelInputModule{}__name(NgxIntlTelInputModule,"NgxIntlTelInputModule"),NgxIntlTelInputModule.\u0275fac=__name(function(t){return new(t||NgxIntlTelInputModule)},"NgxIntlTelInputModule_Factory"),NgxIntlTelInputModule.\u0275mod=core.oAB({type:NgxIntlTelInputModule}),NgxIntlTelInputModule.\u0275inj=core.cJS({imports:[[common.ez,fesm2015_forms.u5,fesm2015_forms.UX,dropdownModuleForRoot]]});var ngx_translate_core=__webpack_require__(81981);function ForgotPasswordComponent_p_12_Template(rf,ctx){1&rf&&(core.TgZ(0,"p",11),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.hij(" ",core.lcZ(2,1,"Email is invalid")," "))}function ForgotPasswordComponent_div_13_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"div",11),core._uU(1),core.qZA()),2&rf){const ctx_r1=core.oxw();core.xp6(1),core.Oqu(ctx_r1.firebaseErrorMessage)}}function ForgotPasswordComponent_div_18_Template(rf,ctx){1&rf&&(core.TgZ(0,"div",12)(1,"span",13),core._uU(2),core.ALo(3,"translate"),core.qZA()()),2&rf&&(core.xp6(2),core.Oqu(core.lcZ(3,1,"A link has been sent to your email address!")))}__name(ForgotPasswordComponent_p_12_Template,"ForgotPasswordComponent_p_12_Template"),__name(ForgotPasswordComponent_div_13_Template,"ForgotPasswordComponent_div_13_Template"),__name(ForgotPasswordComponent_div_18_Template,"ForgotPasswordComponent_div_18_Template");class ForgotPasswordComponent{constructor(authService,angularFireAuth,formBuilder){this.authService=authService,this.angularFireAuth=angularFireAuth,this.formBuilder=formBuilder,this.mailSent=!1,this.forgotPasswordForm=this.formBuilder.group({email:["",[fesm2015_forms.kI.required,fesm2015_forms.kI.email]]})}ngOnInit(){this.angularFireAuth.authState.subscribe(user=>{user&&this.forgotPasswordForm.patchValue({email:user.email})})}retrievePassword(){var _this=this;return(0,asyncToGenerator.Z)(function*(){try{yield _this.authService.resetPassword(_this.forgotPasswordForm.value.email),_this.mailSent=!0}catch(error){(0,utilities.kY)(error)&&(_this.firebaseErrorMessage=error.message)}})()}}function LoginComponent_p_11_Template(rf,ctx){1&rf&&(core.TgZ(0,"p",18),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Email is invalid")))}function LoginComponent_p_17_Template(rf,ctx){1&rf&&(core.TgZ(0,"p",18),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Password must contain at least 6 characters")))}function LoginComponent_div_18_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"div",19)(1,"span"),core._uU(2),core.qZA()()),2&rf){const ctx_r2=core.oxw();core.xp6(2),core.Oqu(ctx_r2.errorMessage)}}__name(ForgotPasswordComponent,"ForgotPasswordComponent"),ForgotPasswordComponent.\u0275fac=__name(function(t){return new(t||ForgotPasswordComponent)(core.Y36(auth_service.e),core.Y36(angular_fire_compat_auth.zQ),core.Y36(fesm2015_forms.QS))},"ForgotPasswordComponent_Factory"),ForgotPasswordComponent.\u0275cmp=core.Xpm({type:ForgotPasswordComponent,selectors:[["app-forgot-password"]],decls:26,vars:23,consts:[["id","container"],[1,"form","facebook-style",3,"formGroup","ngSubmit"],[2,"opacity","0.7"],[2,"margin","35px 0"],["type","email","formControlName","email",1,"form-control",3,"placeholder"],["class","warning-message",4,"ngIf"],[2,"margin-top","15px"],[1,"btn","btn-info",3,"disabled"],["style","margin-top: 15px; text-align: center;",4,"ngIf"],[2,"text-align","center"],["routerLink","/auth/login"],[1,"warning-message"],[2,"margin-top","15px","text-align","center"],[1,"text-success"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0)(1,"form",1),core.NdJ("ngSubmit",__name(function(){return ctx.retrievePassword()},"ForgotPasswordComponent_Template_form_ngSubmit_1_listener")),core.TgZ(2,"h1"),core._uU(3),core.ALo(4,"translate"),core.qZA(),core.TgZ(5,"p",2),core._uU(6),core.ALo(7,"translate"),core.qZA(),core._UZ(8,"hr",3),core.TgZ(9,"div"),core._UZ(10,"input",4),core.ALo(11,"translate"),core.YNc(12,ForgotPasswordComponent_p_12_Template,3,3,"p",5),core.qZA(),core.YNc(13,ForgotPasswordComponent_div_13_Template,2,1,"div",5),core.TgZ(14,"div",6)(15,"button",7),core._uU(16),core.ALo(17,"translate"),core.qZA()(),core.YNc(18,ForgotPasswordComponent_div_18_Template,4,3,"div",8),core._UZ(19,"hr",3),core.TgZ(20,"div",9),core._uU(21),core.ALo(22,"translate"),core.TgZ(23,"a",10),core._uU(24),core.ALo(25,"translate"),core.qZA()()()()),2&rf&&(core.xp6(1),core.Q6J("formGroup",ctx.forgotPasswordForm),core.xp6(2),core.Oqu(core.lcZ(4,11,"Find your account")),core.xp6(3),core.Oqu(core.lcZ(7,13,"Enter your e-mail address so we can send you a reset password link.")),core.xp6(4),core.s9C("placeholder",core.lcZ(11,15,"Email")),core.xp6(2),core.Q6J("ngIf",ctx.forgotPasswordForm.controls.email.touched&&ctx.forgotPasswordForm.controls.email.invalid),core.xp6(1),core.Q6J("ngIf",ctx.firebaseErrorMessage),core.xp6(2),core.Q6J("disabled",ctx.mailSent||ctx.forgotPasswordForm.invalid),core.xp6(1),core.hij(" ",core.lcZ(17,17,"Reset my password")," "),core.xp6(2),core.Q6J("ngIf",ctx.mailSent),core.xp6(3),core.hij("",core.lcZ(22,19,"Go back to login?")," "),core.xp6(3),core.Oqu(core.lcZ(25,21,"Log In")))},"ForgotPasswordComponent_Template"),dependencies:[common.O5,router.yS,fesm2015_forms._Y,fesm2015_forms.Fj,fesm2015_forms.JJ,fesm2015_forms.JL,fesm2015_forms.sg,fesm2015_forms.u,NativeElementInjectorDirective,ngx_translate_core.X$],styles:["#container[_ngcontent-%COMP%]{min-height:100vh}.form[_ngcontent-%COMP%]{min-width:300px;max-width:550px;padding:15px;margin:15px auto}.warning-message[_ngcontent-%COMP%]{color:#fd335b;font-size:small;padding:0 5px;margin:11px 0;border-radius:3px}.btn[_ngcontent-%COMP%]{width:100%;margin-top:15px}.text-success[_ngcontent-%COMP%]{font-size:large}"]}),__name(LoginComponent_p_11_Template,"LoginComponent_p_11_Template"),__name(LoginComponent_p_17_Template,"LoginComponent_p_17_Template"),__name(LoginComponent_div_18_Template,"LoginComponent_div_18_Template");const login_component_c0=__name(function(a0){return{warning:a0}},"login_component_c0");class LoginComponent{constructor(router2,formBuilder,authService){this.router=router2,this.formBuilder=formBuilder,this.authService=authService,this.showPhoneTemplate=!1,this.loginForm=this.formBuilder.group({email:["",[fesm2015_forms.kI.required,fesm2015_forms.kI.email]],password:["",[fesm2015_forms.kI.required,fesm2015_forms.kI.pattern(/[0-9a-zA-Z]{6,}/)]]})}ngOnInit(){this.authService.getUser().subscribe(usr=>{usr&&this.router.navigate(["home"])})}onSubmitForm(){var _this=this;return(0,asyncToGenerator.Z)(function*(){const email=_this.loginForm.controls.email.value,password=_this.loginForm.controls.password.value;try{yield _this.authService.logIn(email,password),_this.router.navigate(["home"])}catch(error){(0,utilities.kY)(error)&&(_this.errorMessage=error.message)}})()}loginWithGoogle(){var _this2=this;return(0,asyncToGenerator.Z)(function*(){try{yield _this2.authService.signinWithGoogle()}catch(error){_this2.errorMessage=error}})()}}function SignupComponent_p_14_Template(rf,ctx){1&rf&&(core.TgZ(0,"p",25),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"First Name is invalid")))}function SignupComponent_p_20_Template(rf,ctx){1&rf&&(core.TgZ(0,"p",25),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Last Name is invalid")))}function SignupComponent_p_26_Template(rf,ctx){1&rf&&(core.TgZ(0,"p",25),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Email is invalid")))}function SignupComponent_p_32_Template(rf,ctx){1&rf&&(core.TgZ(0,"p",25),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Phone Number must contain 10 digit numbers")))}function SignupComponent_p_38_Template(rf,ctx){1&rf&&(core.TgZ(0,"p",25),core._uU(1),core.ALo(2,"translate"),core.qZA()),2&rf&&(core.xp6(1),core.Oqu(core.lcZ(2,1,"Password must contain at least 6 characters")))}function SignupComponent_div_39_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"div",26)(1,"span"),core._uU(2),core.qZA()()),2&rf){const ctx_r5=core.oxw();core.xp6(2),core.Oqu(ctx_r5.errorMessage)}}__name(LoginComponent,"LoginComponent"),LoginComponent.\u0275fac=__name(function(t){return new(t||LoginComponent)(core.Y36(router.F0),core.Y36(fesm2015_forms.QS),core.Y36(auth_service.e))},"LoginComponent_Factory"),LoginComponent.\u0275cmp=core.Xpm({type:LoginComponent,selectors:[["app-login"]],decls:33,vars:29,consts:[[1,"form-container","facebook-style"],[2,"margin","15px","text-align","center","cursor","pointer","color","chocolate","border","1px solid chocolate","padding","11px",3,"click"],["routerLink","/auth/phone-auth",2,"margin","0 15px 15px 15px","text-align","center","cursor","pointer","color","teal","border","1px solid teal","padding","5px"],["autocomplete","off",1,"signup-form",3,"formGroup","ngSubmit"],[1,"form-section","email"],["for","email"],["type","email","formControlName","email",1,"form-control",3,"ngClass"],["class","warning-message",4,"ngIf"],[1,"form-section","password"],["for","password"],["type","password","formControlName","password",1,"form-control",3,"ngClass"],["class","error-message",4,"ngIf"],["type","submit",1,"btn","btn-success",3,"disabled"],[2,"text-align","center"],["routerLink","/auth/forgot-password",1,"link"],[1,"hr"],[2,"margin-top","25px","text-align","center"],["routerLink","/auth/signup",1,"link"],[1,"warning-message"],[1,"error-message"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0)(1,"div",1),core.NdJ("click",__name(function(){return ctx.loginWithGoogle()},"LoginComponent_Template_div_click_1_listener")),core._uU(2," Continue with Google "),core.qZA(),core.TgZ(3,"div",2),core._uU(4," continue with Phone Number "),core.qZA(),core.TgZ(5,"form",3),core.NdJ("ngSubmit",__name(function(){return ctx.onSubmitForm()},"LoginComponent_Template_form_ngSubmit_5_listener")),core.TgZ(6,"div",4)(7,"label",5),core._uU(8),core.ALo(9,"translate"),core.qZA(),core._UZ(10,"input",6),core.YNc(11,LoginComponent_p_11_Template,3,3,"p",7),core.qZA(),core.TgZ(12,"div",8)(13,"label",9),core._uU(14),core.ALo(15,"translate"),core.qZA(),core._UZ(16,"input",10),core.YNc(17,LoginComponent_p_17_Template,3,3,"p",7),core.qZA(),core.YNc(18,LoginComponent_div_18_Template,3,1,"div",11),core.TgZ(19,"button",12),core._uU(20),core.ALo(21,"translate"),core.qZA(),core.TgZ(22,"div",13)(23,"a",14),core._uU(24),core.ALo(25,"translate"),core.qZA()(),core._UZ(26,"hr",15),core.TgZ(27,"div",16),core._uU(28),core.ALo(29,"translate"),core.TgZ(30,"a",17),core._uU(31),core.ALo(32,"translate"),core.qZA()()()()),2&rf&&(core.xp6(5),core.Q6J("formGroup",ctx.loginForm),core.xp6(3),core.Oqu(core.lcZ(9,13,"Email")),core.xp6(2),core.Q6J("ngClass",core.VKq(25,login_component_c0,ctx.loginForm.controls.email.invalid&&ctx.loginForm.controls.email.touched)),core.xp6(1),core.Q6J("ngIf",ctx.loginForm.controls.email.invalid&&ctx.loginForm.controls.email.touched),core.xp6(3),core.Oqu(core.lcZ(15,15,"Password")),core.xp6(2),core.Q6J("ngClass",core.VKq(27,login_component_c0,ctx.loginForm.controls.password.invalid&&ctx.loginForm.controls.password.touched)),core.xp6(1),core.Q6J("ngIf",ctx.loginForm.controls.password.invalid&&ctx.loginForm.controls.password.touched),core.xp6(1),core.Q6J("ngIf",ctx.errorMessage),core.xp6(1),core.Q6J("disabled",ctx.loginForm.invalid),core.xp6(1),core.Oqu(core.lcZ(21,17,"Log In")),core.xp6(4),core.hij("",core.lcZ(25,19,"Forgot Password"),"?"),core.xp6(4),core.hij(" ",core.lcZ(29,21,"You don not have an account")," "),core.xp6(3),core.Oqu(core.lcZ(32,23,"Sign Up")))},"LoginComponent_Template"),dependencies:[common.mk,common.O5,router.rH,router.yS,fesm2015_forms._Y,fesm2015_forms.Fj,fesm2015_forms.JJ,fesm2015_forms.JL,fesm2015_forms.sg,fesm2015_forms.u,NativeElementInjectorDirective,ngx_translate_core.X$],styles:[".form-container[_ngcontent-%COMP%]{width:50%;margin:25px auto;padding:25px 15px}.form-section[_ngcontent-%COMP%]{margin-bottom:5px}.btn[_ngcontent-%COMP%]{width:100%;margin:15px 0}.link[_ngcontent-%COMP%]{text-decoration:none}.link[_ngcontent-%COMP%]:hover{text-decoration:underline}.warning-message[_ngcontent-%COMP%]{color:#fd335b;font-size:smaller;padding:0 5px;border-radius:3px}.warning[_ngcontent-%COMP%]{border:1px solid rgb(253,51,91)}.error-message[_ngcontent-%COMP%]{background-color:#ffd1da;color:#ff093a;font-size:small;padding:7px;border-radius:3px}@media only screen and (max-width: 800px){.form-container[_ngcontent-%COMP%]{width:90%}}@media only screen and (max-width: 500px){.form-container[_ngcontent-%COMP%]{width:95%}}"]}),__name(SignupComponent_p_14_Template,"SignupComponent_p_14_Template"),__name(SignupComponent_p_20_Template,"SignupComponent_p_20_Template"),__name(SignupComponent_p_26_Template,"SignupComponent_p_26_Template"),__name(SignupComponent_p_32_Template,"SignupComponent_p_32_Template"),__name(SignupComponent_p_38_Template,"SignupComponent_p_38_Template"),__name(SignupComponent_div_39_Template,"SignupComponent_div_39_Template");const signup_component_c0=__name(function(a0){return{warning:a0}},"signup_component_c0");class SignupComponent{constructor(formBuilder,authService,router2){this.formBuilder=formBuilder,this.authService=authService,this.router=router2,this.isFormSubmitted=!1,this.signupForm=this.formBuilder.group({firstName:["",[fesm2015_forms.kI.required,fesm2015_forms.kI.pattern(/.*\S.*/)]],lastName:["",[fesm2015_forms.kI.required,fesm2015_forms.kI.pattern(/.*\S.*/)]],email:["",[fesm2015_forms.kI.required,fesm2015_forms.kI.email]],phoneNumber:["",[fesm2015_forms.kI.required,fesm2015_forms.kI.pattern(/^(\+213|0)?[0-9]{9}$/)]],password:["",[fesm2015_forms.kI.required,fesm2015_forms.kI.pattern(/[0-9a-zA-Z]{6,}/)]]})}ngOnInit(){this.authService.getUser().subscribe(usr=>{usr&&this.router.navigate(["home"])})}onSubmitForm(){var _this=this;return(0,asyncToGenerator.Z)(function*(){if(_this.signupForm.invalid)return;let password=_this.signupForm.controls.password.value,formValues=_this.signupForm.value;delete formValues.password;try{yield _this.authService.createNewUser(formValues,password),_this.router.navigate(["/home"])}catch(error){(0,utilities.kY)(error)?_this.errorMessage=error.message:_this.errorMessage=error}})()}}__name(SignupComponent,"SignupComponent"),SignupComponent.\u0275fac=__name(function(t){return new(t||SignupComponent)(core.Y36(fesm2015_forms.QS),core.Y36(auth_service.e),core.Y36(router.F0))},"SignupComponent_Factory"),SignupComponent.\u0275cmp=core.Xpm({type:SignupComponent,selectors:[["app-signup"]],decls:49,vars:50,consts:[[1,"form-container","facebook-style"],["autocomplete","off",1,"signup-form",3,"formGroup","ngSubmit"],[1,"form-title"],[2,"margin-top","-20px","font-size","15px","opacity","0.8"],[1,"hr"],[1,"form-section","first-name"],["for","firstName"],["type","text","formControlName","firstName",1,"form-control",3,"ngClass"],["class","warning-message",4,"ngIf"],[1,"form-section","last-name"],["for","lastName"],["type","text","formControlName","lastName",1,"form-control",3,"ngClass"],[1,"form-section","email"],["for","email"],["type","email","formControlName","email",1,"form-control",3,"ngClass"],[1,"form-section","phone-number"],["for","phoneNumber"],["type","tel","formControlName","phoneNumber",1,"form-control",3,"ngClass"],[1,"form-section","password"],["for","password"],["type","password","formControlName","password",1,"form-control",3,"ngClass"],["class","error-message",4,"ngIf"],["type","submit",1,"btn","btn-success",3,"disabled"],[1,"link",2,"margin-top","25px","text-align","center"],["routerLink","/auth/login"],[1,"warning-message"],[1,"error-message"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"div",0)(1,"form",1),core.NdJ("ngSubmit",__name(function(){return ctx.onSubmitForm()},"SignupComponent_Template_form_ngSubmit_1_listener")),core.TgZ(2,"h2",2),core._uU(3),core.ALo(4,"translate"),core.qZA(),core.TgZ(5,"div",3),core._uU(6),core.ALo(7,"translate"),core.qZA(),core._UZ(8,"hr",4),core.TgZ(9,"div",5)(10,"label",6),core._uU(11),core.ALo(12,"translate"),core.qZA(),core._UZ(13,"input",7),core.YNc(14,SignupComponent_p_14_Template,3,3,"p",8),core.qZA(),core.TgZ(15,"div",9)(16,"label",10),core._uU(17),core.ALo(18,"translate"),core.qZA(),core._UZ(19,"input",11),core.YNc(20,SignupComponent_p_20_Template,3,3,"p",8),core.qZA(),core.TgZ(21,"div",12)(22,"label",13),core._uU(23),core.ALo(24,"translate"),core.qZA(),core._UZ(25,"input",14),core.YNc(26,SignupComponent_p_26_Template,3,3,"p",8),core.qZA(),core.TgZ(27,"div",15)(28,"label",16),core._uU(29),core.ALo(30,"translate"),core.qZA(),core._UZ(31,"input",17),core.YNc(32,SignupComponent_p_32_Template,3,3,"p",8),core.qZA(),core.TgZ(33,"div",18)(34,"label",19),core._uU(35),core.ALo(36,"translate"),core.qZA(),core._UZ(37,"input",20),core.YNc(38,SignupComponent_p_38_Template,3,3,"p",8),core.qZA(),core.YNc(39,SignupComponent_div_39_Template,3,1,"div",21),core.TgZ(40,"button",22),core._uU(41,"Submit"),core.qZA(),core._UZ(42,"hr",4),core.TgZ(43,"div",23),core._uU(44),core.ALo(45,"translate"),core.TgZ(46,"a",24),core._uU(47),core.ALo(48,"translate"),core.qZA()()()()),2&rf&&(core.xp6(1),core.Q6J("formGroup",ctx.signupForm),core.xp6(2),core.Oqu(core.lcZ(4,22,"Sign Up")),core.xp6(3),core.Oqu(core.lcZ(7,24,"It is quick and easy")),core.xp6(5),core.Oqu(core.lcZ(12,26,"First Name")),core.xp6(2),core.Q6J("ngClass",core.VKq(40,signup_component_c0,ctx.signupForm.controls.firstName.invalid&&ctx.signupForm.controls.firstName.touched)),core.xp6(1),core.Q6J("ngIf",ctx.signupForm.controls.firstName.invalid&&ctx.signupForm.controls.firstName.touched),core.xp6(3),core.Oqu(core.lcZ(18,28,"Last Name")),core.xp6(2),core.Q6J("ngClass",core.VKq(42,signup_component_c0,ctx.signupForm.controls.lastName.invalid&&ctx.signupForm.controls.lastName.touched)),core.xp6(1),core.Q6J("ngIf",ctx.signupForm.controls.lastName.invalid&&ctx.signupForm.controls.lastName.touched),core.xp6(3),core.Oqu(core.lcZ(24,30,"Email")),core.xp6(2),core.Q6J("ngClass",core.VKq(44,signup_component_c0,ctx.signupForm.controls.email.invalid&&ctx.signupForm.controls.email.touched)),core.xp6(1),core.Q6J("ngIf",ctx.signupForm.controls.email.invalid&&ctx.signupForm.controls.email.touched),core.xp6(3),core.Oqu(core.lcZ(30,32,"Phone Number")),core.xp6(2),core.Q6J("ngClass",core.VKq(46,signup_component_c0,ctx.signupForm.controls.phoneNumber.invalid&&ctx.signupForm.controls.phoneNumber.touched)),core.xp6(1),core.Q6J("ngIf",ctx.signupForm.controls.phoneNumber.invalid&&ctx.signupForm.controls.phoneNumber.touched),core.xp6(3),core.Oqu(core.lcZ(36,34,"Password")),core.xp6(2),core.Q6J("ngClass",core.VKq(48,signup_component_c0,ctx.signupForm.controls.password.invalid&&ctx.signupForm.controls.password.touched)),core.xp6(1),core.Q6J("ngIf",ctx.signupForm.controls.password.invalid&&ctx.signupForm.controls.password.touched),core.xp6(1),core.Q6J("ngIf",ctx.errorMessage),core.xp6(1),core.Q6J("disabled",ctx.signupForm.invalid),core.xp6(4),core.hij(" ",core.lcZ(45,36,"Already have an account"),"? "),core.xp6(3),core.Oqu(core.lcZ(48,38,"Sign in")))},"SignupComponent_Template"),dependencies:[common.mk,common.O5,router.yS,fesm2015_forms._Y,fesm2015_forms.Fj,fesm2015_forms.JJ,fesm2015_forms.JL,fesm2015_forms.sg,fesm2015_forms.u,NativeElementInjectorDirective,ngx_translate_core.X$],styles:[".form-container[_ngcontent-%COMP%]{width:50%;margin:25px auto;padding:25px 15px}.signup-form[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto;grid-gap:11px}.form-section[_ngcontent-%COMP%]{margin-bottom:5px}.btn[_ngcontent-%COMP%], .error-message[_ngcontent-%COMP%], .link[_ngcontent-%COMP%], .form-title[_ngcontent-%COMP%], .password[_ngcontent-%COMP%], .hr[_ngcontent-%COMP%]{grid-column-start:1;grid-column-end:3}.btn[_ngcontent-%COMP%]{margin-top:25px}.warning-message[_ngcontent-%COMP%]{color:#fd335b;font-size:smaller;padding:0 5px;border-radius:3px}.warning[_ngcontent-%COMP%]{border:1px solid rgb(253,51,91)}.error-message[_ngcontent-%COMP%]{background-color:#ffd1da;color:#ff093a;font-size:small;padding:7px;border-radius:3px}@media only screen and (max-width: 800px){.form-container[_ngcontent-%COMP%]{width:90%}}@media only screen and (max-width: 500px){.form-container[_ngcontent-%COMP%]{width:98%}.form-section[_ngcontent-%COMP%]{grid-column-start:1;grid-column-end:3}}"]});var dist=__webpack_require__(59607);function PhoneAuthComponent_div_1_Template(rf,ctx){1&rf&&(core.TgZ(0,"div",5)(1,"button",6),core._uU(2,"Go back to Login"),core.qZA()())}function PhoneAuthComponent_form_2_small_5_span_1_Template(rf,ctx){1&rf&&(core.TgZ(0,"span"),core._uU(1," Phone number is required. "),core.qZA())}function PhoneAuthComponent_form_2_small_5_span_2_Template(rf,ctx){1&rf&&(core.TgZ(0,"span"),core._uU(1," Phone number must be 10 numbers "),core.qZA())}function PhoneAuthComponent_form_2_small_5_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"small",14),core.YNc(1,PhoneAuthComponent_form_2_small_5_span_1_Template,2,0,"span",3),core.YNc(2,PhoneAuthComponent_form_2_small_5_span_2_Template,2,0,"span",3),core.qZA()),2&rf){const ctx_r5=core.oxw(2);core.xp6(1),core.Q6J("ngIf",null==ctx_r5.phoneForm.controls.phone.errors?null:ctx_r5.phoneForm.controls.phone.errors.required),core.xp6(1),core.Q6J("ngIf",ctx_r5.phoneForm.controls.phone.errors)}}__name(PhoneAuthComponent_div_1_Template,"PhoneAuthComponent_div_1_Template"),__name(PhoneAuthComponent_form_2_small_5_span_1_Template,"PhoneAuthComponent_form_2_small_5_span_1_Template"),__name(PhoneAuthComponent_form_2_small_5_span_2_Template,"PhoneAuthComponent_form_2_small_5_span_2_Template"),__name(PhoneAuthComponent_form_2_small_5_Template,"PhoneAuthComponent_form_2_small_5_Template");const phone_auth_component_c0=__name(function(a0,a1){return[a0,a1]},"phone_auth_component_c0");function PhoneAuthComponent_form_2_Template(rf,ctx){if(1&rf){const _r9=core.EpF();core.TgZ(0,"form",7,8)(2,"div",9),core._UZ(3,"ngx-intl-tel-input",10),core.TgZ(4,"div",11),core.YNc(5,PhoneAuthComponent_form_2_small_5_Template,3,2,"small",4),core.qZA()(),core._UZ(6,"div",12),core.TgZ(7,"div")(8,"button",13),core.NdJ("click",__name(function(){core.CHM(_r9);const ctx_r8=core.oxw();return core.KtG(ctx_r8.sendVerificationCode())},"PhoneAuthComponent_form_2_Template_button_click_8_listener")),core._uU(9," Send Verification Code "),core.qZA()()()}if(2&rf){const ctx_r1=core.oxw();core.Q6J("formGroup",ctx_r1.phoneForm),core.xp6(3),core.Q6J("cssClass","form-control")("enableAutoCountrySelect",!0)("enablePlaceholder",!0)("customPlaceholder","Enter Your Number")("searchCountryFlag",!0)("searchCountryField",core.WLB(15,phone_auth_component_c0,ctx_r1.searchCountryField.Iso2,ctx_r1.searchCountryField.Name))("selectFirstCountry",!1)("selectedCountryISO",ctx_r1.countryISO.Algeria)("maxLength",10)("phoneValidation",!0)("separateDialCode",!0)("numberFormat",ctx_r1.phoneNumberFormat.National),core.xp6(2),core.Q6J("ngIf",!ctx_r1.phoneForm.controls.phone.valid&&ctx_r1.phoneForm.controls.phone.touched),core.xp6(3),core.Q6J("disabled",ctx_r1.sendingCode)}}function PhoneAuthComponent_div_3_div_1_Template(rf,ctx){1&rf&&(core.TgZ(0,"div",21),core._uU(1," Verification Code sent successfully "),core.qZA())}function PhoneAuthComponent_div_3_Template(rf,ctx){if(1&rf){const _r12=core.EpF();core.TgZ(0,"div"),core.YNc(1,PhoneAuthComponent_div_3_div_1_Template,2,0,"div",15),core.TgZ(2,"label",16),core._uU(3,"Enter your verification code here"),core.qZA(),core.TgZ(4,"input",17),core.NdJ("ngModelChange",__name(function($event){core.CHM(_r12);const ctx_r11=core.oxw();return core.KtG(ctx_r11.verificationCode=$event)},"PhoneAuthComponent_div_3_Template_input_ngModelChange_4_listener")),core.qZA(),core.TgZ(5,"div",18)(6,"button",19),core.NdJ("click",__name(function(){core.CHM(_r12);const ctx_r13=core.oxw();return core.KtG(ctx_r13.vefifyLoginCode())},"PhoneAuthComponent_div_3_Template_button_click_6_listener")),core._uU(7,"Vefify Code"),core.qZA(),core.TgZ(8,"button",20),core.NdJ("click",__name(function(){core.CHM(_r12);const ctx_r14=core.oxw();return ctx_r14.codeSent=!1,core.KtG(ctx_r14.phoneForm.reset())},"PhoneAuthComponent_div_3_Template_button_click_8_listener")),core._uU(9,"Reset"),core.qZA()()()}if(2&rf){const ctx_r2=core.oxw();core.xp6(1),core.Q6J("ngIf",ctx_r2.codeSent),core.xp6(3),core.Q6J("ngModel",ctx_r2.verificationCode)}}function PhoneAuthComponent_div_4_Template(rf,ctx){if(1&rf&&(core.TgZ(0,"div",14),core._uU(1),core.qZA()),2&rf){const ctx_r3=core.oxw();core.xp6(1),core.Oqu(ctx_r3.errMsg)}}__name(PhoneAuthComponent_form_2_Template,"PhoneAuthComponent_form_2_Template"),__name(PhoneAuthComponent_div_3_div_1_Template,"PhoneAuthComponent_div_3_div_1_Template"),__name(PhoneAuthComponent_div_3_Template,"PhoneAuthComponent_div_3_Template"),__name(PhoneAuthComponent_div_4_Template,"PhoneAuthComponent_div_4_Template");class PhoneAuthComponent{constructor(router2,afAuth,formBuilder,authService){this.router=router2,this.afAuth=afAuth,this.formBuilder=formBuilder,this.authService=authService,this.searchCountryField=SearchCountryField,this.countryISO=CountryISO,this.phoneNumberFormat=PhoneNumberFormat,this.sendingCode=!1,this.codeSent=!1,this.phoneForm=this.formBuilder.group({phone:[void 0,[fesm2015_forms.kI.required]]})}ngOnInit(){}sendVerificationCode(){var _this=this;return(0,asyncToGenerator.Z)(function*(){const inputVal=_this.phoneForm.controls.phone.value;if(inputVal){try{_this.sendingCode=!0,_this.reCaptchaVerifier=new dist.Z.auth.RecaptchaVerifier("reCaptcha-container",{size:"invisible"});const credential=yield _this.afAuth.signInWithPhoneNumber(inputVal.e164Number,_this.reCaptchaVerifier);localStorage.setItem("verificationId",JSON.stringify(credential.verificationId)),_this.codeSent=!0}catch(error){_this.errMsg=error}_this.sendingCode=!1}else _this.errMsg="Input field is empty!"})()}vefifyLoginCode(){var _this2=this;return(0,asyncToGenerator.Z)(function*(){try{yield _this2.authService.vefifyPhoneNumberAndSignin(_this2.verificationCode),_this2.router.navigate(["home"]),_this2.codeSent=!1}catch(error){_this2.errMsg=error}})()}}__name(PhoneAuthComponent,"PhoneAuthComponent"),PhoneAuthComponent.\u0275fac=__name(function(t){return new(t||PhoneAuthComponent)(core.Y36(router.F0),core.Y36(angular_fire_compat_auth.zQ),core.Y36(fesm2015_forms.QS),core.Y36(auth_service.e))},"PhoneAuthComponent_Factory"),PhoneAuthComponent.\u0275cmp=core.Xpm({type:PhoneAuthComponent,selectors:[["app-phone-auth"]],decls:5,vars:4,consts:[[1,"sec-container","facebook-style"],["style","margin-bottom: 15px;",4,"ngIf"],[3,"formGroup",4,"ngIf"],[4,"ngIf"],["class","alert alert-danger",4,"ngIf"],[2,"margin-bottom","15px"],["routerLink","/auth/login",1,"btn","btn-info"],[3,"formGroup"],["f","ngForm"],[1,"wrapper"],["name","phone","formControlName","phone",3,"cssClass","enableAutoCountrySelect","enablePlaceholder","customPlaceholder","searchCountryFlag","searchCountryField","selectFirstCountry","selectedCountryISO","maxLength","phoneValidation","separateDialCode","numberFormat"],[2,"margin-top","20px","margin-bottom","10px"],["id","reCaptcha-container"],[1,"btn","btn-success",3,"disabled","click"],[1,"alert","alert-danger"],["class","alert alert-success","style","margin-bottom: 15px;",4,"ngIf"],["for","code"],["type","text","name","code",1,"form-control",3,"ngModel","ngModelChange"],[2,"display","flex","justify-content","space-around","margin-top","15px"],[1,"btn","btn-success",3,"click"],[1,"btn","btn-primary",3,"click"],[1,"alert","alert-success",2,"margin-bottom","15px"]],template:__name(function(rf,ctx){1&rf&&(core.TgZ(0,"section",0),core.YNc(1,PhoneAuthComponent_div_1_Template,3,0,"div",1),core.YNc(2,PhoneAuthComponent_form_2_Template,10,18,"form",2),core.YNc(3,PhoneAuthComponent_div_3_Template,10,2,"div",3),core.YNc(4,PhoneAuthComponent_div_4_Template,2,1,"div",4),core.qZA()),2&rf&&(core.xp6(1),core.Q6J("ngIf",!ctx.codeSent),core.xp6(1),core.Q6J("ngIf",!ctx.codeSent),core.xp6(1),core.Q6J("ngIf",ctx.codeSent),core.xp6(1),core.Q6J("ngIf",ctx.errMsg))},"PhoneAuthComponent_Template"),dependencies:[common.O5,router.rH,fesm2015_forms._Y,fesm2015_forms.Fj,fesm2015_forms.JJ,fesm2015_forms.JL,fesm2015_forms.sg,fesm2015_forms.u,fesm2015_forms.On,NgxIntlTelInputComponent,NativeElementInjectorDirective],styles:[".sec-container[_ngcontent-%COMP%]{max-width:500px;min-width:300px;margin:25px auto;padding:25px 15px}@media only screen and (max-width: 530px){.sec-container[_ngcontent-%COMP%]{margin-inline:15px}}"]});const routes=[{path:"signup",component:SignupComponent},{path:"login",component:LoginComponent},{path:"phone-auth",component:PhoneAuthComponent},{path:"forgot-password",component:ForgotPasswordComponent}];class AuthRoutingModule{}__name(AuthRoutingModule,"AuthRoutingModule"),AuthRoutingModule.\u0275fac=__name(function(t){return new(t||AuthRoutingModule)},"AuthRoutingModule_Factory"),AuthRoutingModule.\u0275mod=core.oAB({type:AuthRoutingModule}),AuthRoutingModule.\u0275inj=core.cJS({imports:[router.Bz.forChild(routes),router.Bz]});var shared_module=__webpack_require__(83436);class AuthModule{}__name(AuthModule,"AuthModule"),AuthModule.\u0275fac=__name(function(t){return new(t||AuthModule)},"AuthModule_Factory"),AuthModule.\u0275mod=core.oAB({type:AuthModule}),AuthModule.\u0275inj=core.cJS({imports:[common.ez,AuthRoutingModule,fesm2015_forms.UX,fesm2015_forms.u5,shared_module.m,NgxIntlTelInputModule]})},83436:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{m:()=>SharedModule});var common=__webpack_require__(69808),angular_datatables=__webpack_require__(65415),fesm2015_forms=__webpack_require__(93075),core=__webpack_require__(5e3),chart_esm=__webpack_require__(34393),operators=__webpack_require__(83292);function listCacheClear(){this.__data__=[],this.size=0}__name(listCacheClear,"listCacheClear");const _listCacheClear=listCacheClear;function eq(value,other){return value===other||value!=value&&other!=other}__name(eq,"eq");const lodash_es_eq=eq;function assocIndexOf(array,key){for(var length=array.length;length--;)if(lodash_es_eq(array[length][0],key))return length;return-1}__name(assocIndexOf,"assocIndexOf");const _assocIndexOf=assocIndexOf;var splice=Array.prototype.splice;function listCacheDelete(key){var data=this.__data__,index=_assocIndexOf(data,key);return!(index<0)&&(index==data.length-1?data.pop():splice.call(data,index,1),--this.size,!0)}__name(listCacheDelete,"listCacheDelete");const _listCacheDelete=listCacheDelete;function listCacheGet(key){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?void 0:data[index][1]}__name(listCacheGet,"listCacheGet");const _listCacheGet=listCacheGet;function listCacheHas(key){return _assocIndexOf(this.__data__,key)>-1}__name(listCacheHas,"listCacheHas");const _listCacheHas=listCacheHas;function listCacheSet(key,value){var data=this.__data__,index=_assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}__name(listCacheSet,"listCacheSet");const _listCacheSet=listCacheSet;function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index-1&&value%1==0&&value<=9007199254740991}__name(isLength,"isLength");const lodash_es_isLength=isLength;function isArrayLike(value){return null!=value&&lodash_es_isLength(value.length)&&!lodash_es_isFunction(value)}__name(isArrayLike,"isArrayLike");const lodash_es_isArrayLike=isArrayLike;function isArrayLikeObject(value){return lodash_es_isObjectLike(value)&&lodash_es_isArrayLike(value)}__name(isArrayLikeObject,"isArrayLikeObject");const lodash_es_isArrayLikeObject=isArrayLikeObject;function stubFalse(){return!1}__name(stubFalse,"stubFalse");const lodash_es_stubFalse=stubFalse;var isBuffer_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,isBuffer_freeModule=isBuffer_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,isBuffer_Buffer=isBuffer_freeModule&&isBuffer_freeModule.exports===isBuffer_freeExports?_root.Buffer:void 0;const lodash_es_isBuffer=(isBuffer_Buffer?isBuffer_Buffer.isBuffer:void 0)||lodash_es_stubFalse;var isPlainObject_funcProto=Function.prototype,isPlainObject_objectProto=Object.prototype,isPlainObject_funcToString=isPlainObject_funcProto.toString,isPlainObject_hasOwnProperty=isPlainObject_objectProto.hasOwnProperty,objectCtorString=isPlainObject_funcToString.call(Object);function isPlainObject(value){if(!lodash_es_isObjectLike(value)||"[object Object]"!=_baseGetTag(value))return!1;var proto=_getPrototype(value);if(null===proto)return!0;var Ctor=isPlainObject_hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&isPlainObject_funcToString.call(Ctor)==objectCtorString}__name(isPlainObject,"isPlainObject");const lodash_es_isPlainObject=isPlainObject;var typedArrayTags={};function baseIsTypedArray(value){return lodash_es_isObjectLike(value)&&lodash_es_isLength(value.length)&&!!typedArrayTags[_baseGetTag(value)]}typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1,__name(baseIsTypedArray,"baseIsTypedArray");const _baseIsTypedArray=baseIsTypedArray;function baseUnary(func){return function(value){return func(value)}}__name(baseUnary,"baseUnary");const _baseUnary=baseUnary;var _nodeUtil_freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,_nodeUtil_freeModule=_nodeUtil_freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=_nodeUtil_freeModule&&_nodeUtil_freeModule.exports===_nodeUtil_freeExports&&_freeGlobal.process,nodeUtil=function(){try{return _nodeUtil_freeModule&&_nodeUtil_freeModule.require&&_nodeUtil_freeModule.require("util").types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch{}}();var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;const lodash_es_isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray;function safeGet(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]}__name(safeGet,"safeGet");const _safeGet=safeGet;var _assignValue_hasOwnProperty=Object.prototype.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];(!_assignValue_hasOwnProperty.call(object,key)||!lodash_es_eq(objValue,value)||void 0===value&&!(key in object))&&_baseAssignValue(object,key,value)}__name(assignValue,"assignValue");const _assignValue=assignValue;function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});for(var index=-1,length=props.length;++index-1&&value%1==0&&value0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)}}__name(shortOut,"shortOut");const _setToString=shortOut(_baseSetToString);function baseRest(func,start){return _setToString(_overRest(func,start,lodash_es_identity),func+"")}__name(baseRest,"baseRest");const _baseRest=baseRest;function isIterateeCall(value,index,object){if(!lodash_es_isObject(object))return!1;var type=typeof index;return!!("number"==type?lodash_es_isArrayLike(object)&&_isIndex(index,object.length):"string"==type&&index in object)&&lodash_es_eq(object[index],value)}__name(isIterateeCall,"isIterateeCall");const _isIterateeCall=isIterateeCall;function createAssigner(assigner){return _baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&_isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++indexthis.themeChanged(r)))}ngOnChanges(changes){const requireRender=["type"],propertyNames=Object.getOwnPropertyNames(changes);if(propertyNames.some(key=>requireRender.includes(key))||propertyNames.every(key=>changes[key].isFirstChange()))this.render();else{const config=this.getChartConfiguration();this.chart&&(Object.assign(this.chart.config.data,config.data),Object.assign(this.chart.config.plugins,config.plugins),Object.assign(this.chart.config.options,config.options)),this.update()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(s=>s.unsubscribe())}render(){return this.chart&&this.chart.destroy(),this.zone.runOutsideAngular(()=>this.chart=new chart_esm.kL(this.ctx,this.getChartConfiguration()))}update(duration){this.chart&&this.zone.runOutsideAngular(()=>{var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.update(duration)})}hideDataset(index,hidden){this.chart&&(this.chart.getDatasetMeta(index).hidden=hidden,this.update())}isDatasetHidden(index){var _a,_b;return null===(_b=null===(_a=this.chart)||void 0===_a?void 0:_a.getDatasetMeta(index))||void 0===_b?void 0:_b.hidden}toBase64Image(){var _a;return null===(_a=this.chart)||void 0===_a?void 0:_a.toBase64Image()}themeChanged(options){this.themeOverrides=options,this.chart&&(Object.assign(this.chart.config.options,this.getChartOptions()),this.update())}getChartOptions(){return lodash_es_merge({onHover:(event,active)=>{!this.chartHover.observed&&!this.chartHover.observers.length||this.zone.run(()=>this.chartHover.emit({event,active}))},onClick:(event,active)=>{!this.chartClick.observed&&!this.chartClick.observers.length||this.zone.run(()=>this.chartClick.emit({event,active}))}},this.themeOverrides,this.options,{plugins:{legend:{display:this.legend}}})}getChartConfiguration(){return{type:this.type,data:this.getChartData(),plugins:this.plugins,options:this.getChartOptions()}}getChartData(){return this.data?this.data:{labels:this.labels||[],datasets:this.datasets||[]}}}__name(BaseChartDirective,"BaseChartDirective"),BaseChartDirective.\u0275fac=__name(function(t){return new(t||BaseChartDirective)(core.Y36(core.SBq),core.Y36(core.R0b),core.Y36(ThemeService))},"BaseChartDirective_Factory"),BaseChartDirective.\u0275dir=core.lG2({type:BaseChartDirective,selectors:[["canvas","baseChart",""]],inputs:{type:"type",legend:"legend",data:"data",options:"options",plugins:"plugins",labels:"labels",datasets:"datasets"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[core.TTD]});const baseColors=[[255,99,132],[54,162,235],[255,206,86],[231,233,237],[75,192,192],[151,187,205],[220,220,220],[247,70,74],[70,191,189],[253,180,92],[148,159,177],[77,83,96]],builtInDefaults={datasets:{line:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.4),borderColor:context=>rgba(generateColor(context.datasetIndex),1),pointBackgroundColor:context=>rgba(generateColor(context.datasetIndex),1),pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:context=>rgba(generateColor(context.datasetIndex),.8)},bar:{backgroundColor:context=>rgba(generateColor(context.datasetIndex),.6),borderColor:context=>rgba(generateColor(context.datasetIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.datasetIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.datasetIndex),1)},get radar(){return this.line},doughnut:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:"#fff",hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),1),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get pie(){return this.doughnut},polarArea:{backgroundColor:context=>rgba(generateColor(context.dataIndex),.6),borderColor:context=>rgba(generateColor(context.dataIndex),1),hoverBackgroundColor:context=>rgba(generateColor(context.dataIndex),.8),hoverBorderColor:context=>rgba(generateColor(context.dataIndex),1)},get bubble(){return this.doughnut},get scatter(){return this.doughnut},get area(){return this.polarArea}}};function rgba(colour,alpha){return"rgba("+colour.concat(alpha).join(",")+")"}function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function getRandomColor(){return[getRandomInt(0,255),getRandomInt(0,255),getRandomInt(0,255)]}function generateColor(index=0){return baseColors[index]||getRandomColor()}__name(rgba,"rgba"),__name(getRandomInt,"getRandomInt"),__name(getRandomColor,"getRandomColor"),__name(generateColor,"generateColor"),chart_esm.kL.register(chart_esm.Dx,chart_esm.u,chart_esm.Gu,chart_esm.De,chart_esm.ST,chart_esm.jn,chart_esm.od,chart_esm.f$,chart_esm.uw,chart_esm.vn,chart_esm.ZL,chart_esm.jI,chart_esm.qi,chart_esm.Xi,chart_esm.l7,chart_esm.tt,chart_esm.CV,chart_esm.N0,chart_esm.ho,chart_esm.RM);class NgChartsConfiguration{}__name(NgChartsConfiguration,"NgChartsConfiguration"),NgChartsConfiguration.\u0275fac=__name(function(t){return new(t||NgChartsConfiguration)},"NgChartsConfiguration_Factory"),NgChartsConfiguration.\u0275prov=core.Yz7({token:NgChartsConfiguration,factory:NgChartsConfiguration.\u0275fac,providedIn:"root"});class NgChartsModule{constructor(config){null!=config&&config.plugins&&chart_esm.kL.register(...null==config?void 0:config.plugins);const ngChartsDefaults=lodash_es_merge(builtInDefaults,(null==config?void 0:config.defaults)||{});chart_esm.ce.set(ngChartsDefaults)}static forRoot(config){return{ngModule:NgChartsModule,providers:[{provide:NgChartsConfiguration,useValue:config}]}}}__name(NgChartsModule,"NgChartsModule"),NgChartsModule.\u0275fac=__name(function(t){return new(t||NgChartsModule)(core.LFG(NgChartsConfiguration,8))},"NgChartsModule_Factory"),NgChartsModule.\u0275mod=core.oAB({type:NgChartsModule}),NgChartsModule.\u0275inj=core.cJS({imports:[[]]});var http=__webpack_require__(40520),ngx_translate_core=__webpack_require__(81981),ngx_translate_http_loader=__webpack_require__(80040);function HttpLoaderFactory(http2){return new ngx_translate_http_loader.w(http2)}__name(HttpLoaderFactory,"HttpLoaderFactory");class SharedModule{}__name(SharedModule,"SharedModule"),SharedModule.\u0275fac=__name(function(t){return new(t||SharedModule)},"SharedModule_Factory"),SharedModule.\u0275mod=core.oAB({type:SharedModule}),SharedModule.\u0275inj=core.cJS({imports:[common.ez,angular_datatables.T,fesm2015_forms.UX,fesm2015_forms.u5,NgChartsModule,http.JF,ngx_translate_core.aw.forChild({loader:{provide:ngx_translate_core.Zw,useFactory:HttpLoaderFactory,deps:[http.eN]}}),ngx_translate_core.aw]})},34393:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{qi:()=>ArcElement,vn:()=>BarController,ZL:()=>BarElement,N0:()=>BubbleController,uw:()=>CategoryScale,kL:()=>Chart,jI:()=>DoughnutController,Gu:()=>index,De:()=>plugin_legend,ST:()=>LineController,jn:()=>LineElement,f$:()=>LinearScale,tt:()=>PieController,od:()=>PointElement,CV:()=>PolarAreaController,Xi:()=>RadarController,l7:()=>RadialLinearScale,ho:()=>ScatterController,RM:()=>TimeSeriesScale,Dx:()=>plugin_title,u:()=>plugin_tooltip,ce:()=>defaults}),__name(function fontString(pixelSize,fontStyle,fontFamily){return fontStyle+" "+pixelSize+"px "+fontFamily},"fontString");const requestAnimFrame="undefined"==typeof window?function(callback2){return callback2()}:window.requestAnimationFrame;function throttled(fn,thisArg,updateFn){const updateArgs=updateFn||(args2=>Array.prototype.slice.call(args2));let ticking=!1,args=[];return function(...rest){args=updateArgs(rest),ticking||(ticking=!0,requestAnimFrame.call(window,()=>{ticking=!1,fn.apply(thisArg,args)}))}}function debounce(fn,delay){let timeout;return function(...args){return delay?(clearTimeout(timeout),timeout=setTimeout(fn,delay,args)):fn.apply(this,args),delay}}__name(throttled,"throttled"),__name(debounce,"debounce");const _toLeftRightCenter=__name(align=>"start"===align?"left":"end"===align?"right":"center","_toLeftRightCenter"),_alignStartEnd=__name((align,start,end)=>"start"===align?start:"end"===align?end:(start+end)/2,"_alignStartEnd"),_textX=__name((align,left,right,rtl)=>align===(rtl?"left":"right")?right:"center"===align?(left+right)/2:left,"_textX");function noop(){}__name(noop,"noop");const uid=function(){let id=0;return function(){return id++}}();function isNullOrUndef(value){return null==value}function isArray(value){if(Array.isArray&&Array.isArray(value))return!0;const type=Object.prototype.toString.call(value);return"[object"===type.slice(0,7)&&"Array]"===type.slice(-6)}function isObject(value){return null!==value&&"[object Object]"===Object.prototype.toString.call(value)}__name(isNullOrUndef,"isNullOrUndef"),__name(isArray,"isArray"),__name(isObject,"isObject");const isNumberFinite=__name(value=>("number"==typeof value||value instanceof Number)&&isFinite(+value),"isNumberFinite");function finiteOrDefault(value,defaultValue){return isNumberFinite(value)?value:defaultValue}function valueOrDefault(value,defaultValue){return void 0===value?defaultValue:value}__name(finiteOrDefault,"finiteOrDefault"),__name(valueOrDefault,"valueOrDefault");const toPercentage=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100:value/dimension,"toPercentage"),toDimension=__name((value,dimension)=>"string"==typeof value&&value.endsWith("%")?parseFloat(value)/100*dimension:+value,"toDimension");function callback(fn,args,thisArg){if(fn&&"function"==typeof fn.call)return fn.apply(thisArg,args)}function each(loopable,fn,thisArg,reverse){let i,len,keys;if(isArray(loopable))if(len=loopable.length,reverse)for(i=len-1;i>=0;i--)fn.call(thisArg,loopable[i],i);else for(i=0;ipos;)obj=obj[key.slice(pos,idx)],pos=idx+1,idx=indexOfDotOrLength(key,pos);return obj}function _capitalize(str){return str.charAt(0).toUpperCase()+str.slice(1)}__name(indexOfDotOrLength,"indexOfDotOrLength"),__name(resolveObjectKey,"resolveObjectKey"),__name(_capitalize,"_capitalize");const defined=__name(value=>void 0!==value,"defined"),isFunction=__name(value=>"function"==typeof value,"isFunction"),setsEqual=__name((a2,b2)=>{if(a2.size!==b2.size)return!1;for(const item of a2)if(!b2.has(item))return!1;return!0},"setsEqual");function _isClickEvent(e2){return"mouseup"===e2.type||"click"===e2.type||"contextmenu"===e2.type}__name(_isClickEvent,"_isClickEvent");const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=2*PI/3,log10=Math.log10,sign=Math.sign;function niceNum(range){const roundedRange=Math.round(range);range=almostEquals(range,roundedRange,range/1e3)?roundedRange:range;const niceRange=Math.pow(10,Math.floor(log10(range))),fraction=range/niceRange;return(fraction<=1?1:fraction<=2?2:fraction<=5?5:10)*niceRange}function _factorize(value){const result=[],sqrt=Math.sqrt(value);let i;for(i=1;ia2-b2).pop(),result}function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n)}function almostEquals(x,y,epsilon){return Math.abs(x-y)=x}function _setMinAndMaxByKey(array,target,property){let i,ilen,value;for(i=0,ilen=array.length;iangleToEnd&&startToAngle=Math.min(start,end)-epsilon&&value<=Math.max(start,end)+epsilon}__name(niceNum,"niceNum"),__name(_factorize,"_factorize"),__name(isNumber,"isNumber"),__name(almostEquals,"almostEquals"),__name(almostWhole,"almostWhole"),__name(_setMinAndMaxByKey,"_setMinAndMaxByKey"),__name(toRadians,"toRadians"),__name(toDegrees,"toDegrees"),__name(_decimalPlaces,"_decimalPlaces"),__name(getAngleFromPoint,"getAngleFromPoint"),__name(distanceBetweenPoints,"distanceBetweenPoints"),__name(_angleDiff,"_angleDiff"),__name(_normalizeAngle,"_normalizeAngle"),__name(_angleBetween,"_angleBetween"),__name(_limitValue,"_limitValue"),__name(_int16Range,"_int16Range"),__name(_isBetween,"_isBetween");const atEdge=__name(t=>0===t||1===t,"atEdge"),elasticIn=__name((t,s,p)=>-Math.pow(2,10*(t-=1))*Math.sin((t-s)*TAU/p),"elasticIn"),elasticOut=__name((t,s,p)=>Math.pow(2,-10*t)*Math.sin((t-s)*TAU/p)+1,"elasticOut"),effects={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*HALF_PI),easeOutSine:t=>Math.sin(t*HALF_PI),easeInOutSine:t=>-.5*(Math.cos(PI*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>atEdge(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>atEdge(t)?t:elasticIn(t,.075,.3),easeOutElastic:t=>atEdge(t)?t:elasticOut(t,.075,.3),easeInOutElastic:t=>atEdge(t)?t:t<.5?.5*elasticIn(2*t,.1125,.45):.5+.5*elasticOut(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let s=1.70158;return(t/=.5)<1?t*t*((1+(s*=1.525))*t-s)*.5:.5*((t-=2)*t*((1+(s*=1.525))*t+s)+2)},easeInBounce:t=>1-effects.easeOutBounce(1-t),easeOutBounce:t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,easeInOutBounce:t=>t<.5?.5*effects.easeInBounce(2*t):.5*effects.easeOutBounce(2*t-1)+.5};function round(v){return v+.5|0}__name(round,"round");const lim=__name((v,l,h)=>Math.max(Math.min(v,h),l),"lim");function p2b(v){return lim(round(2.55*v),0,255)}function n2b(v){return lim(round(255*v),0,255)}function b2n(v){return lim(round(v/2.55)/100,0,1)}function n2p(v){return lim(round(100*v),0,100)}__name(p2b,"p2b"),__name(n2b,"n2b"),__name(b2n,"b2n"),__name(n2p,"n2p");const map$1={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},hex=[..."0123456789ABCDEF"],h1=__name(b2=>hex[15&b2],"h1"),h2=__name(b2=>hex[(240&b2)>>4]+hex[15&b2],"h2"),eq=__name(b2=>(240&b2)>>4==(15&b2),"eq"),isShort=__name(v=>eq(v.r)&&eq(v.g)&&eq(v.b)&&eq(v.a),"isShort");function hexParse(str){var ret,len=str.length;return"#"===str[0]&&(4===len||5===len?ret={r:255&17*map$1[str[1]],g:255&17*map$1[str[2]],b:255&17*map$1[str[3]],a:5===len?17*map$1[str[4]]:255}:(7===len||9===len)&&(ret={r:map$1[str[1]]<<4|map$1[str[2]],g:map$1[str[3]]<<4|map$1[str[4]],b:map$1[str[5]]<<4|map$1[str[6]],a:9===len?map$1[str[7]]<<4|map$1[str[8]]:255})),ret}__name(hexParse,"hexParse");const alpha=__name((a2,f2)=>a2<255?f2(a2):"","alpha");function hexString(v){var f2=isShort(v)?h1:h2;return v?"#"+f2(v.r)+f2(v.g)+f2(v.b)+alpha(v.a,f2):void 0}__name(hexString,"hexString");const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(h,s,l){const a2=s*Math.min(l,1-l),f2=__name((n,k=(n+h/30)%12)=>l-a2*Math.max(Math.min(k-3,9-k,1),-1),"f");return[f2(0),f2(8),f2(4)]}function hsv2rgbn(h,s,v){const f2=__name((n,k=(n+h/60)%6)=>v-v*s*Math.max(Math.min(k,4-k,1),0),"f");return[f2(5),f2(3),f2(1)]}function hwb2rgbn(h,w,b2){const rgb=hsl2rgbn(h,1,.5);let i;for(w+b2>1&&(i=1/(w+b2),w*=i,b2*=i),i=0;i<3;i++)rgb[i]*=1-w-b2,rgb[i]+=w;return rgb}function hueValue(r,g2,b2,d2,max){return r===max?(g2-b2)/d2+(g2.5?d2/(2-max-min):d2/(max+min),h=hueValue(r,g2,b2,d2,max),h=60*h+.5),[0|h,s||0,l]}function calln(f2,a2,b2,c2){return(Array.isArray(a2)?f2(a2[0],a2[1],a2[2]):f2(a2,b2,c2)).map(n2b)}function hsl2rgb(h,s,l){return calln(hsl2rgbn,h,s,l)}function hwb2rgb(h,w,b2){return calln(hwb2rgbn,h,w,b2)}function hsv2rgb(h,s,v){return calln(hsv2rgbn,h,s,v)}function hue(h){return(h%360+360)%360}function hueParse(str){const m=HUE_RE.exec(str);let v,a2=255;if(!m)return;m[5]!==v&&(a2=m[6]?p2b(+m[5]):n2b(+m[5]));const h=hue(+m[2]),p1=+m[3]/100,p2=+m[4]/100;return v="hwb"===m[1]?hwb2rgb(h,p1,p2):"hsv"===m[1]?hsv2rgb(h,p1,p2):hsl2rgb(h,p1,p2),{r:v[0],g:v[1],b:v[2],a:a2}}function rotate(v,deg){var h=rgb2hsl(v);h[0]=hue(h[0]+deg),h=hsl2rgb(h),v.r=h[0],v.g=h[1],v.b=h[2]}function hslString(v){if(!v)return;const a2=rgb2hsl(v),h=a2[0],s=n2p(a2[1]),l=n2p(a2[2]);return v.a<255?`hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`:`hsl(${h}, ${s}%, ${l}%)`}__name(hsl2rgbn,"hsl2rgbn"),__name(hsv2rgbn,"hsv2rgbn"),__name(hwb2rgbn,"hwb2rgbn"),__name(hueValue,"hueValue"),__name(rgb2hsl,"rgb2hsl"),__name(calln,"calln"),__name(hsl2rgb,"hsl2rgb"),__name(hwb2rgb,"hwb2rgb"),__name(hsv2rgb,"hsv2rgb"),__name(hue,"hue"),__name(hueParse,"hueParse"),__name(rotate,"rotate"),__name(hslString,"hslString");const map={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"},names$1={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 unpack(){const unpacked={},keys=Object.keys(names$1),tkeys=Object.keys(map);let i,j,k,ok,nk;for(i=0;i>16&255,k>>8&255,255&k]}return unpacked}let names;function nameParse(str){names||(names=unpack(),names.transparent=[0,0,0,0]);const a2=names[str.toLowerCase()];return a2&&{r:a2[0],g:a2[1],b:a2[2],a:4===a2.length?a2[3]:255}}__name(unpack,"unpack"),__name(nameParse,"nameParse");const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(str){const m=RGB_RE.exec(str);let r,g2,b2,a2=255;if(m){if(m[7]!==r){const v=+m[7];a2=m[8]?p2b(v):lim(255*v,0,255)}return r=+m[1],g2=+m[3],b2=+m[5],r=255&(m[2]?p2b(r):lim(r,0,255)),g2=255&(m[4]?p2b(g2):lim(g2,0,255)),b2=255&(m[6]?p2b(b2):lim(b2,0,255)),{r,g:g2,b:b2,a:a2}}}function rgbString(v){return v&&(v.a<255?`rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`:`rgb(${v.r}, ${v.g}, ${v.b})`)}__name(rgbParse,"rgbParse"),__name(rgbString,"rgbString");const to=__name(v=>v<=.0031308?12.92*v:1.055*Math.pow(v,1/2.4)-.055,"to"),from=__name(v=>v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4),"from");function interpolate(rgb1,rgb2,t){const r=from(b2n(rgb1.r)),g2=from(b2n(rgb1.g)),b2=from(b2n(rgb1.b));return{r:n2b(to(r+t*(from(b2n(rgb2.r))-r))),g:n2b(to(g2+t*(from(b2n(rgb2.g))-g2))),b:n2b(to(b2+t*(from(b2n(rgb2.b))-b2))),a:rgb1.a+t*(rgb2.a-rgb1.a)}}function modHSL(v,i,ratio){if(v){let tmp=rgb2hsl(v);tmp[i]=Math.max(0,Math.min(tmp[i]+tmp[i]*ratio,0===i?360:1)),tmp=hsl2rgb(tmp),v.r=tmp[0],v.g=tmp[1],v.b=tmp[2]}}function clone(v,proto){return v&&Object.assign(proto||{},v)}function fromObject(input){var v={r:0,g:0,b:0,a:255};return Array.isArray(input)?input.length>=3&&(v={r:input[0],g:input[1],b:input[2],a:255},input.length>3&&(v.a=n2b(input[3]))):(v=clone(input,{r:0,g:0,b:0,a:1})).a=n2b(v.a),v}function functionParse(str){return"r"===str.charAt(0)?rgbParse(str):hueParse(str)}__name(interpolate,"interpolate"),__name(modHSL,"modHSL"),__name(clone,"clone"),__name(fromObject,"fromObject"),__name(functionParse,"functionParse");class Color{constructor(input){if(input instanceof Color)return input;const type=typeof input;let v;"object"===type?v=fromObject(input):"string"===type&&(v=hexParse(input)||nameParse(input)||functionParse(input)),this._rgb=v,this._valid=!!v}get valid(){return this._valid}get rgb(){var v=clone(this._rgb);return v&&(v.a=b2n(v.a)),v}set rgb(obj){this._rgb=fromObject(obj)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(color2,weight){if(color2){const c1=this.rgb,c2=color2.rgb;let w2;const p=weight===w2?.5:weight,w=2*p-1,a2=c1.a-c2.a,w1=((w*a2==-1?w:(w+a2)/(1+w*a2))+1)/2;w2=1-w1,c1.r=255&w1*c1.r+w2*c2.r+.5,c1.g=255&w1*c1.g+w2*c2.g+.5,c1.b=255&w1*c1.b+w2*c2.b+.5,c1.a=p*c1.a+(1-p)*c2.a,this.rgb=c1}return this}interpolate(color2,t){return color2&&(this._rgb=interpolate(this._rgb,color2._rgb,t)),this}clone(){return new Color(this.rgb)}alpha(a2){return this._rgb.a=n2b(a2),this}clearer(ratio){return this._rgb.a*=1-ratio,this}greyscale(){const rgb=this._rgb,val=round(.3*rgb.r+.59*rgb.g+.11*rgb.b);return rgb.r=rgb.g=rgb.b=val,this}opaquer(ratio){return this._rgb.a*=1+ratio,this}negate(){const v=this._rgb;return v.r=255-v.r,v.g=255-v.g,v.b=255-v.b,this}lighten(ratio){return modHSL(this._rgb,2,ratio),this}darken(ratio){return modHSL(this._rgb,2,-ratio),this}saturate(ratio){return modHSL(this._rgb,1,ratio),this}desaturate(ratio){return modHSL(this._rgb,1,-ratio),this}rotate(deg){return rotate(this._rgb,deg),this}}function index_esm(input){return new Color(input)}function isPatternOrGradient(value){if(value&&"object"==typeof value){const type=value.toString();return"[object CanvasPattern]"===type||"[object CanvasGradient]"===type}return!1}function color(value){return isPatternOrGradient(value)?value:index_esm(value)}function getHoverColor(value){return isPatternOrGradient(value)?value:index_esm(value).saturate(.5).darken(.1).hexString()}__name(Color,"Color"),__name(index_esm,"index_esm"),__name(isPatternOrGradient,"isPatternOrGradient"),__name(color,"color"),__name(getHoverColor,"getHoverColor");const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(node,key){if(!key)return node;const keys=key.split(".");for(let i=0,n=keys.length;icontext.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=(ctx,options)=>getHoverColor(options.backgroundColor),this.hoverBorderColor=(ctx,options)=>getHoverColor(options.borderColor),this.hoverColor=(ctx,options)=>getHoverColor(options.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(_descriptors2)}set(scope,values){return set(this,scope,values)}get(scope){return getScope$1(this,scope)}describe(scope,values){return set(descriptors,scope,values)}override(scope,values){return set(overrides,scope,values)}route(scope,name,targetScope,targetName){const scopeObject=getScope$1(this,scope),targetScopeObject=getScope$1(this,targetScope),privateName="_"+name;Object.defineProperties(scopeObject,{[privateName]:{value:scopeObject[name],writable:!0},[name]:{enumerable:!0,get(){const local=this[privateName],target=targetScopeObject[targetName];return isObject(local)?Object.assign({},target,local):valueOrDefault(local,target)},set(value){this[privateName]=value}}})}}__name(Defaults,"Defaults");var defaults=new Defaults({_scriptable:name=>!name.startsWith("on"),_indexable:name=>"events"!==name,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function toFontString(font){return!font||isNullOrUndef(font.size)||isNullOrUndef(font.family)?null:(font.style?font.style+" ":"")+(font.weight?font.weight+" ":"")+font.size+"px "+font.family}function _measureText(ctx,data,gc,longest,string){let textWidth=data[string];return textWidth||(textWidth=data[string]=ctx.measureText(string).width,gc.push(string)),textWidth>longest&&(longest=textWidth),longest}function _longestText(ctx,font,arrayOfThings,cache){let data=(cache=cache||{}).data=cache.data||{},gc=cache.garbageCollect=cache.garbageCollect||[];cache.font!==font&&(data=cache.data={},gc=cache.garbageCollect=[],cache.font=font),ctx.save(),ctx.font=font;let longest=0;const ilen=arrayOfThings.length;let i,j,jlen,thing,nestedThing;for(i=0;iarrayOfThings.length){for(i=0;i0&&ctx.stroke()}}function _isPointInArea(point,area,margin){return margin=margin||.5,!area||point&&point.x>area.left-margin&&point.xarea.top-margin&&point.y0&&""!==opts.strokeColor;let i,line;for(ctx.save(),ctx.font=font.string,setRenderOpts(ctx,opts),i=0;i+v||0,"numberOrZero");function _readValueToProps(value,props){const ret={},objProps=isObject(props),keys=objProps?Object.keys(props):props,read=isObject(value)?objProps?prop=>valueOrDefault(value[prop],value[props[prop]]):prop=>value[prop]:()=>value;for(const prop of keys)ret[prop]=numberOrZero(read(prop));return ret}function toTRBL(value){return _readValueToProps(value,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(value){return _readValueToProps(value,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(value){const obj=toTRBL(value);return obj.width=obj.left+obj.right,obj.height=obj.top+obj.bottom,obj}function toFont(options,fallback){options=options||{},fallback=fallback||defaults.font;let size=valueOrDefault(options.size,fallback.size);"string"==typeof size&&(size=parseInt(size,10));let style=valueOrDefault(options.style,fallback.style);style&&!(""+style).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+style+'"'),style="");const font={family:valueOrDefault(options.family,fallback.family),lineHeight:toLineHeight(valueOrDefault(options.lineHeight,fallback.lineHeight),size),size,style,weight:valueOrDefault(options.weight,fallback.weight),string:""};return font.string=toFontString(font),font}function resolve(inputs,context,index2,info){let i,ilen,value,cacheable=!0;for(i=0,ilen=inputs.length;ibeginAtZero&&0===value?0:value+add,"keepZero");return{min:keepZero(min,-Math.abs(change)),max:keepZero(max,change)}}function createContext(parentContext,context){return Object.assign(Object.create(parentContext),context)}function _lookup(table,value,cmp){cmp=cmp||(index2=>table[index2]1;)mid=lo+hi>>1,cmp(mid)?lo=mid:hi=mid;return{lo,hi}}__name(_readValueToProps,"_readValueToProps"),__name(toTRBL,"toTRBL"),__name(toTRBLCorners,"toTRBLCorners"),__name(toPadding,"toPadding"),__name(toFont,"toFont"),__name(resolve,"resolve"),__name(_addGrace,"_addGrace"),__name(createContext,"createContext"),__name(_lookup,"_lookup");const _lookupByKey=__name((table,key,value)=>_lookup(table,value,index2=>table[index2][key]_lookup(table,value,index2=>table[index2][key]>=value),"_rlookupByKey");function _filterBetween(values,min,max){let start=0,end=values.length;for(;startstart&&values[end-1]>max;)end--;return start>0||end{const method="_onData"+_capitalize(key),base=array[key];Object.defineProperty(array,key,{configurable:!0,enumerable:!1,value(...args){const res=base.apply(this,args);return array._chartjs.listeners.forEach(object=>{"function"==typeof object[method]&&object[method](...args)}),res}})}))}function unlistenArrayEvents(array,listener){const stub=array._chartjs;if(!stub)return;const listeners=stub.listeners,index2=listeners.indexOf(listener);-1!==index2&&listeners.splice(index2,1),!(listeners.length>0)&&(arrayEvents.forEach(key=>{delete array[key]}),delete array._chartjs)}function _arrayUnique(items){const set2=new Set;let i,ilen;for(i=0,ilen=items.length;iscopes[0])){defined(fallback)||(fallback=_resolve("_fallback",scopes));const cache={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:scopes,_rootScopes:rootScopes,_fallback:fallback,_getTarget:getTarget,override:scope=>_createResolver([scope,...scopes],prefixes,rootScopes,fallback)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete target._keys,delete scopes[0][prop],!0),get:(target,prop)=>_cached(target,prop,()=>_resolveWithPrefixes(prop,prefixes,scopes,target)),getOwnPropertyDescriptor:(target,prop)=>Reflect.getOwnPropertyDescriptor(target._scopes[0],prop),getPrototypeOf:()=>Reflect.getPrototypeOf(scopes[0]),has:(target,prop)=>getKeysFromAllScopes(target).includes(prop),ownKeys:target=>getKeysFromAllScopes(target),set(target,prop,value){const storage=target._storage||(target._storage=getTarget());return target[prop]=storage[prop]=value,delete target._keys,!0}})}function _attachContext(proxy,context,subProxy,descriptorDefaults){const cache={_cacheable:!1,_proxy:proxy,_context:context,_subProxy:subProxy,_stack:new Set,_descriptors:_descriptors(proxy,descriptorDefaults),setContext:ctx=>_attachContext(proxy,ctx,subProxy,descriptorDefaults),override:scope=>_attachContext(proxy.override(scope),context,subProxy,descriptorDefaults)};return new Proxy(cache,{deleteProperty:(target,prop)=>(delete target[prop],delete proxy[prop],!0),get:(target,prop,receiver)=>_cached(target,prop,()=>_resolveWithContext(target,prop,receiver)),getOwnPropertyDescriptor:(target,prop)=>target._descriptors.allKeys?Reflect.has(proxy,prop)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(proxy,prop),getPrototypeOf:()=>Reflect.getPrototypeOf(proxy),has:(target,prop)=>Reflect.has(proxy,prop),ownKeys:()=>Reflect.ownKeys(proxy),set:(target,prop,value)=>(proxy[prop]=value,delete target[prop],!0)})}function _descriptors(proxy,defaults2={scriptable:!0,indexable:!0}){const{_scriptable=defaults2.scriptable,_indexable=defaults2.indexable,_allKeys=defaults2.allKeys}=proxy;return{allKeys:_allKeys,scriptable:_scriptable,indexable:_indexable,isScriptable:isFunction(_scriptable)?_scriptable:()=>_scriptable,isIndexable:isFunction(_indexable)?_indexable:()=>_indexable}}__name(listenArrayEvents,"listenArrayEvents"),__name(unlistenArrayEvents,"unlistenArrayEvents"),__name(_arrayUnique,"_arrayUnique"),__name(_createResolver,"_createResolver"),__name(_attachContext,"_attachContext"),__name(_descriptors,"_descriptors");const readKey=__name((prefix,name)=>prefix?prefix+_capitalize(name):name,"readKey"),needsSubResolver=__name((prop,value)=>isObject(value)&&"adapters"!==prop&&(null===Object.getPrototypeOf(value)||value.constructor===Object),"needsSubResolver");function _cached(target,prop,resolve2){if(Object.prototype.hasOwnProperty.call(target,prop))return target[prop];const value=resolve2();return target[prop]=value,value}function _resolveWithContext(target,prop,receiver){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;let value=_proxy[prop];return isFunction(value)&&descriptors2.isScriptable(prop)&&(value=_resolveScriptable(prop,value,target,receiver)),isArray(value)&&value.length&&(value=_resolveArray(prop,value,target,descriptors2.isIndexable)),needsSubResolver(prop,value)&&(value=_attachContext(value,_context,_subProxy&&_subProxy[prop],descriptors2)),value}function _resolveScriptable(prop,value,target,receiver){const{_proxy,_context,_subProxy,_stack}=target;if(_stack.has(prop))throw new Error("Recursion detected: "+Array.from(_stack).join("->")+"->"+prop);return _stack.add(prop),value=value(_context,_subProxy||receiver),_stack.delete(prop),needsSubResolver(prop,value)&&(value=createSubResolver(_proxy._scopes,_proxy,prop,value)),value}function _resolveArray(prop,value,target,isIndexable){const{_proxy,_context,_subProxy,_descriptors:descriptors2}=target;if(defined(_context.index)&&isIndexable(prop))value=value[_context.index%value.length];else if(isObject(value[0])){const arr=value,scopes=_proxy._scopes.filter(s=>s!==arr);value=[];for(const item of arr){const resolver=createSubResolver(scopes,_proxy,prop,item);value.push(_attachContext(resolver,_context,_subProxy&&_subProxy[prop],descriptors2))}}return value}function resolveFallback(fallback,prop,value){return isFunction(fallback)?fallback(prop,value):fallback}__name(_cached,"_cached"),__name(_resolveWithContext,"_resolveWithContext"),__name(_resolveScriptable,"_resolveScriptable"),__name(_resolveArray,"_resolveArray"),__name(resolveFallback,"resolveFallback");const getScope=__name((key,parent)=>!0===key?parent:"string"==typeof key?resolveObjectKey(parent,key):void 0,"getScope");function addScopes(set2,parentScopes,key,parentFallback,value){for(const parent of parentScopes){const scope=getScope(key,parent);if(scope){set2.add(scope);const fallback=resolveFallback(scope._fallback,key,value);if(defined(fallback)&&fallback!==key&&fallback!==parentFallback)return fallback}else if(!1===scope&&defined(parentFallback)&&key!==parentFallback)return null}return!1}function createSubResolver(parentScopes,resolver,prop,value){const rootScopes=resolver._rootScopes,fallback=resolveFallback(resolver._fallback,prop,value),allScopes=[...parentScopes,...rootScopes],set2=new Set;set2.add(value);let key=addScopesFromKey(set2,allScopes,prop,fallback||prop,value);return!(null===key||defined(fallback)&&fallback!==prop&&(key=addScopesFromKey(set2,allScopes,fallback,key,value),null===key))&&_createResolver(Array.from(set2),[""],rootScopes,fallback,()=>subGetTarget(resolver,prop,value))}function addScopesFromKey(set2,allScopes,key,fallback,item){for(;key;)key=addScopes(set2,allScopes,key,fallback,item);return key}function subGetTarget(resolver,prop,value){const parent=resolver._getTarget();prop in parent||(parent[prop]={});const target=parent[prop];return isArray(target)&&isObject(value)?value:target}function _resolveWithPrefixes(prop,prefixes,scopes,proxy){let value;for(const prefix of prefixes)if(value=_resolve(readKey(prefix,prop),scopes),defined(value))return needsSubResolver(prop,value)?createSubResolver(scopes,proxy,prop,value):value}function _resolve(key,scopes){for(const scope of scopes){if(!scope)continue;const value=scope[key];if(defined(value))return value}}function getKeysFromAllScopes(target){let keys=target._keys;return keys||(keys=target._keys=resolveKeysFromAllScopes(target._scopes)),keys}function resolveKeysFromAllScopes(scopes){const set2=new Set;for(const scope of scopes)for(const key of Object.keys(scope).filter(k=>!k.startsWith("_")))set2.add(key);return Array.from(set2)}function _parseObjectDataRadialScale(meta,data,start,count){const{iScale}=meta,{key="r"}=this._parsing,parsed=new Array(count);let i,ilen,index2,item;for(i=0,ilen=count;ii"x"===indexAxis?"y":"x","getValueAxis");function splineCurve(firstPoint,middlePoint,afterPoint,t){const previous=firstPoint.skip?middlePoint:firstPoint,current=middlePoint,next=afterPoint.skip?middlePoint:afterPoint,d01=distanceBetweenPoints(current,previous),d12=distanceBetweenPoints(next,current);let s01=d01/(d01+d12),s12=d12/(d01+d12);s01=isNaN(s01)?0:s01,s12=isNaN(s12)?0:s12;const fa=t*s01,fb=t*s12;return{previous:{x:current.x-fa*(next.x-previous.x),y:current.y-fa*(next.y-previous.y)},next:{x:current.x+fb*(next.x-previous.x),y:current.y+fb*(next.y-previous.y)}}}function monotoneAdjust(points,deltaK,mK){const pointsLen=points.length;let alphaK,betaK,tauK,squaredMagnitude,pointCurrent,pointAfter=getPoint(points,0);for(let i=0;i!pt.skip)),"monotone"===options.cubicInterpolationMode)splineCurveMonotone(points,indexAxis);else{let prev=loop?points[points.length-1]:points[0];for(i=0,ilen=points.length;iwindow.getComputedStyle(element,null),"getComputedStyle");function getStyle(el,property){return getComputedStyle2(el).getPropertyValue(property)}__name(getStyle,"getStyle");const positions=["top","right","bottom","left"];function getPositionedStyle(styles,style,suffix){const result={};suffix=suffix?"-"+suffix:"";for(let i=0;i<4;i++){const pos=positions[i];result[pos]=parseFloat(styles[style+"-"+pos+suffix])||0}return result.width=result.left+result.right,result.height=result.top+result.bottom,result}__name(getPositionedStyle,"getPositionedStyle");const useOffsetPos=__name((x,y,target)=>(x>0||y>0)&&(!target||!target.shadowRoot),"useOffsetPos");function getCanvasPosition(e2,canvas){const touches=e2.touches,source=touches&&touches.length?touches[0]:e2,{offsetX,offsetY}=source;let x,y,box=!1;if(useOffsetPos(offsetX,offsetY,e2.target))x=offsetX,y=offsetY;else{const rect=canvas.getBoundingClientRect();x=source.clientX-rect.left,y=source.clientY-rect.top,box=!0}return{x,y,box}}function getRelativePosition(evt,chart){if("native"in evt)return evt;const{canvas,currentDevicePixelRatio}=chart,style=getComputedStyle2(canvas),borderBox="border-box"===style.boxSizing,paddings=getPositionedStyle(style,"padding"),borders=getPositionedStyle(style,"border","width"),{x,y,box}=getCanvasPosition(evt,canvas),xOffset=paddings.left+(box&&borders.left),yOffset=paddings.top+(box&&borders.top);let{width,height}=chart;return borderBox&&(width-=paddings.width+borders.width,height-=paddings.height+borders.height),{x:Math.round((x-xOffset)/width*canvas.width/currentDevicePixelRatio),y:Math.round((y-yOffset)/height*canvas.height/currentDevicePixelRatio)}}function getContainerSize(canvas,width,height){let maxWidth,maxHeight;if(void 0===width||void 0===height){const container=_getParentNode(canvas);if(container){const rect=container.getBoundingClientRect(),containerStyle=getComputedStyle2(container),containerBorder=getPositionedStyle(containerStyle,"border","width"),containerPadding=getPositionedStyle(containerStyle,"padding");width=rect.width-containerPadding.width-containerBorder.width,height=rect.height-containerPadding.height-containerBorder.height,maxWidth=parseMaxStyle(containerStyle.maxWidth,container,"clientWidth"),maxHeight=parseMaxStyle(containerStyle.maxHeight,container,"clientHeight")}else width=canvas.clientWidth,height=canvas.clientHeight}return{width,height,maxWidth:maxWidth||INFINITY,maxHeight:maxHeight||INFINITY}}__name(getCanvasPosition,"getCanvasPosition"),__name(getRelativePosition,"getRelativePosition"),__name(getContainerSize,"getContainerSize");const round1=__name(v=>Math.round(10*v)/10,"round1");function getMaximumSize(canvas,bbWidth,bbHeight,aspectRatio){const style=getComputedStyle2(canvas),margins=getPositionedStyle(style,"margin"),maxWidth=parseMaxStyle(style.maxWidth,canvas,"clientWidth")||INFINITY,maxHeight=parseMaxStyle(style.maxHeight,canvas,"clientHeight")||INFINITY,containerSize=getContainerSize(canvas,bbWidth,bbHeight);let{width,height}=containerSize;if("content-box"===style.boxSizing){const borders=getPositionedStyle(style,"border","width"),paddings=getPositionedStyle(style,"padding");width-=paddings.width+borders.width,height-=paddings.height+borders.height}return width=Math.max(0,width-margins.width),height=Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height-margins.height),width=round1(Math.min(width,maxWidth,containerSize.maxWidth)),height=round1(Math.min(height,maxHeight,containerSize.maxHeight)),width&&!height&&(height=round1(width/2)),{width,height}}function retinaScale(chart,forceRatio,forceStyle){const pixelRatio=forceRatio||1,deviceHeight=Math.floor(chart.height*pixelRatio),deviceWidth=Math.floor(chart.width*pixelRatio);chart.height=deviceHeight/pixelRatio,chart.width=deviceWidth/pixelRatio;const canvas=chart.canvas;return canvas.style&&(forceStyle||!canvas.style.height&&!canvas.style.width)&&(canvas.style.height=`${chart.height}px`,canvas.style.width=`${chart.width}px`),(chart.currentDevicePixelRatio!==pixelRatio||canvas.height!==deviceHeight||canvas.width!==deviceWidth)&&(chart.currentDevicePixelRatio=pixelRatio,canvas.height=deviceHeight,canvas.width=deviceWidth,chart.ctx.setTransform(pixelRatio,0,0,pixelRatio,0,0),!0)}__name(getMaximumSize,"getMaximumSize"),__name(retinaScale,"retinaScale");const supportsEventListenerOptions=function(){let passiveSupported=!1;try{const options={get passive(){return passiveSupported=!0,!1}};window.addEventListener("test",null,options),window.removeEventListener("test",null,options)}catch{}return passiveSupported}();function readUsedSize(element,property){const value=getStyle(element,property),matches=value&&value.match(/^(\d+)(\.\d+)?px$/);return matches?+matches[1]:void 0}function _pointInLine(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:p1.y+t*(p2.y-p1.y)}}function _steppedInterpolation(p1,p2,t,mode){return{x:p1.x+t*(p2.x-p1.x),y:"middle"===mode?t<.5?p1.y:p2.y:"after"===mode?t<1?p1.y:p2.y:t>0?p2.y:p1.y}}function _bezierInterpolation(p1,p2,t,mode){const cp1={x:p1.cp2x,y:p1.cp2y},cp2={x:p2.cp1x,y:p2.cp1y},a2=_pointInLine(p1,cp1,t),b2=_pointInLine(cp1,cp2,t),c2=_pointInLine(cp2,p2,t),d2=_pointInLine(a2,b2,t),e2=_pointInLine(b2,c2,t);return _pointInLine(d2,e2,t)}__name(readUsedSize,"readUsedSize"),__name(_pointInLine,"_pointInLine"),__name(_steppedInterpolation,"_steppedInterpolation"),__name(_bezierInterpolation,"_bezierInterpolation");const intlCache=new Map;function getNumberFormat(locale,options){options=options||{};const cacheKey=locale+JSON.stringify(options);let formatter=intlCache.get(cacheKey);return formatter||(formatter=new Intl.NumberFormat(locale,options),intlCache.set(cacheKey,formatter)),formatter}function formatNumber(num,locale,options){return getNumberFormat(locale,options).format(num)}__name(getNumberFormat,"getNumberFormat"),__name(formatNumber,"formatNumber");const getRightToLeftAdapter=__name(function(rectX,width){return{x:x=>rectX+rectX+width-x,setWidth(w){width=w},textAlign:align=>"center"===align?align:"right"===align?"left":"right",xPlus:(x,value)=>x-value,leftForLtr:(x,itemWidth)=>x-itemWidth}},"getRightToLeftAdapter"),getLeftToRightAdapter=__name(function(){return{x:x=>x,setWidth(w){},textAlign:align=>align,xPlus:(x,value)=>x+value,leftForLtr:(x,_itemWidth)=>x}},"getLeftToRightAdapter");function getRtlAdapter(rtl,rectX,width){return rtl?getRightToLeftAdapter(rectX,width):getLeftToRightAdapter()}function overrideTextDirection(ctx,direction){let style,original;("ltr"===direction||"rtl"===direction)&&(style=ctx.canvas.style,original=[style.getPropertyValue("direction"),style.getPropertyPriority("direction")],style.setProperty("direction",direction,"important"),ctx.prevTextDirection=original)}function restoreTextDirection(ctx,original){void 0!==original&&(delete ctx.prevTextDirection,ctx.canvas.style.setProperty("direction",original[0],original[1]))}function propertyFn(property){return"angle"===property?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(a2,b2)=>a2-b2,normalize:x=>x}}function normalizeSegment({start,end,count,loop,style}){return{start:start%count,end:end%count,loop:loop&&(end-start+1)%count==0,style}}function getSegment(segment,points,bounds){const{property,start:startBound,end:endBound}=bounds,{between,normalize}=propertyFn(property),count=points.length;let i,ilen,{start,end,loop}=segment;if(loop){for(start+=count,end+=count,i=0,ilen=count;ibetween(startBound,prevValue,value)&&0!==compare(startBound,prevValue),"startIsBefore"),endIsBefore=__name(()=>0===compare(endBound,value)||between(endBound,prevValue,value),"endIsBefore"),shouldStart=__name(()=>inside||startIsBefore(),"shouldStart"),shouldStop=__name(()=>!inside||endIsBefore(),"shouldStop");for(let i=start,prev=start;i<=end;++i)point=points[i%count],!point.skip&&(value=normalize(point[property]),value!==prevValue&&(inside=between(value,startBound,endBound),null===subStart&&shouldStart()&&(subStart=0===compare(value,startBound)?i:prev),null!==subStart&&shouldStop()&&(result.push(normalizeSegment({start:subStart,end:i,loop,count,style})),subStart=null),prev=i,prevValue=value));return null!==subStart&&result.push(normalizeSegment({start:subStart,end,loop,count,style})),result}function _boundSegments(line,bounds){const result=[],segments=line.segments;for(let i=0;istart&&points[end%count].skip;)end--;return end%=count,{start,end}}function solidSegments(points,start,max,loop){const count=points.length,result=[];let end,last=start,prev=points[start];for(end=start+1;end<=max;++end){const cur=points[end%count];cur.skip||cur.stop?prev.skip||(loop=!1,result.push({start:start%count,end:(end-1)%count,loop}),start=last=cur.stop?end:null):(last=end,prev.skip&&(start=end)),prev=cur}return null!==last&&result.push({start:start%count,end:last%count,loop}),result}function _computeSegments(line,segmentOptions){const points=line.points,spanGaps=line.options.spanGaps,count=points.length;if(!count)return[];const loop=!!line._loop,{start,end}=findStartAndEnd(points,count,loop,spanGaps);if(!0===spanGaps)return splitByStyles(line,[{start,end,loop}],points,segmentOptions);return splitByStyles(line,solidSegments(points,start,endfn({chart,initial:anims.initial,numSteps,currentStep:Math.min(date-anims.start,numSteps)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(date=Date.now()){let remaining=0;this._charts.forEach((anims,chart)=>{if(!anims.running||!anims.items.length)return;const items=anims.items;let item,i=items.length-1,draw2=!1;for(;i>=0;--i)item=items[i],item._active?(item._total>anims.duration&&(anims.duration=item._total),item.tick(date),draw2=!0):(items[i]=items[items.length-1],items.pop());draw2&&(chart.draw(),this._notify(chart,anims,date,"progress")),items.length||(anims.running=!1,this._notify(chart,anims,date,"complete"),anims.initial=!1),remaining+=items.length}),this._lastDate=date,0===remaining&&(this._running=!1)}_getAnims(chart){const charts=this._charts;let anims=charts.get(chart);return anims||(anims={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},charts.set(chart,anims)),anims}listen(chart,event,cb){this._getAnims(chart).listeners[event].push(cb)}add(chart,items){!items||!items.length||this._getAnims(chart).items.push(...items)}has(chart){return this._getAnims(chart).items.length>0}start(chart){const anims=this._charts.get(chart);!anims||(anims.running=!0,anims.start=Date.now(),anims.duration=anims.items.reduce((acc,cur)=>Math.max(acc,cur._duration),0),this._refresh())}running(chart){if(!this._running)return!1;const anims=this._charts.get(chart);return!(!anims||!anims.running||!anims.items.length)}stop(chart){const anims=this._charts.get(chart);if(!anims||!anims.items.length)return;const items=anims.items;let i=items.length-1;for(;i>=0;--i)items[i].cancel();anims.items=[],this._notify(chart,anims,Date.now(),"complete")}remove(chart){return this._charts.delete(chart)}}__name(Animator,"Animator");var animator=new Animator;const interpolators={boolean:(from2,to2,factor)=>factor>.5?to2:from2,color(from2,to2,factor){const c0=color(from2||"transparent"),c1=c0.valid&&color(to2||"transparent");return c1&&c1.valid?c1.mix(c0,factor).hexString():to2},number:(from2,to2,factor)=>from2+(to2-from2)*factor};class Animation{constructor(cfg,target,prop,to2){const currentValue=target[prop];to2=resolve([cfg.to,to2,currentValue,cfg.from]);const from2=resolve([cfg.from,currentValue,to2]);this._active=!0,this._fn=cfg.fn||interpolators[cfg.type||typeof from2],this._easing=effects[cfg.easing]||effects.linear,this._start=Math.floor(Date.now()+(cfg.delay||0)),this._duration=this._total=Math.floor(cfg.duration),this._loop=!!cfg.loop,this._target=target,this._prop=prop,this._from=from2,this._to=to2,this._promises=void 0}active(){return this._active}update(cfg,to2,date){if(this._active){this._notify(!1);const currentValue=this._target[this._prop],elapsed=date-this._start,remain=this._duration-elapsed;this._start=date,this._duration=Math.floor(Math.max(remain,cfg.duration)),this._total+=elapsed,this._loop=!!cfg.loop,this._to=resolve([cfg.to,to2,currentValue,cfg.from]),this._from=resolve([cfg.from,currentValue,to2])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(date){const elapsed=date-this._start,duration=this._duration,prop=this._prop,from2=this._from,loop=this._loop,to2=this._to;let factor;if(this._active=from2!==to2&&(loop||elapsed1?2-factor:factor,factor=this._easing(Math.min(1,Math.max(0,factor))),this._target[prop]=this._fn(from2,to2,factor))}wait(){const promises=this._promises||(this._promises=[]);return new Promise((res,rej)=>{promises.push({res,rej})})}_notify(resolved){const method=resolved?"res":"rej",promises=this._promises||[];for(let i=0;i"onProgress"!==name&&"onComplete"!==name&&"fn"!==name}),defaults.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),defaults.describe("animations",{_fallback:"animation"}),defaults.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:v=>0|v}}}});class Animations{constructor(chart,config){this._chart=chart,this._properties=new Map,this.configure(config)}configure(config){if(!isObject(config))return;const animatedProps=this._properties;Object.getOwnPropertyNames(config).forEach(key=>{const cfg=config[key];if(!isObject(cfg))return;const resolved={};for(const option of animationOptions)resolved[option]=cfg[option];(isArray(cfg.properties)&&cfg.properties||[key]).forEach(prop=>{(prop===key||!animatedProps.has(prop))&&animatedProps.set(prop,resolved)})})}_animateOptions(target,values){const newOptions=values.options,options=resolveTargetOptions(target,newOptions);if(!options)return[];const animations=this._createAnimations(options,newOptions);return newOptions.$shared&&awaitAll(target.options.$animations,newOptions).then(()=>{target.options=newOptions},()=>{}),animations}_createAnimations(target,values){const animatedProps=this._properties,animations=[],running=target.$animations||(target.$animations={}),props=Object.keys(values),date=Date.now();let i;for(i=props.length-1;i>=0;--i){const prop=props[i];if("$"===prop.charAt(0))continue;if("options"===prop){animations.push(...this._animateOptions(target,values));continue}const value=values[prop];let animation=running[prop];const cfg=animatedProps.get(prop);if(animation){if(cfg&&animation.active()){animation.update(cfg,value,date);continue}animation.cancel()}cfg&&cfg.duration?(running[prop]=animation=new Animation(cfg,target,prop,value),animations.push(animation)):target[prop]=value}return animations}update(target,values){if(0===this._properties.size)return void Object.assign(target,values);const animations=this._createAnimations(target,values);return animations.length?(animator.add(this._chart,animations),!0):void 0}}function awaitAll(animations,properties){const running=[],keys=Object.keys(properties);for(let i=0;i0||!positive&&value<0)return meta.index}return null}function updateStacks(controller,parsed){const{chart,_cachedMeta:meta}=controller,stacks=chart._stacks||(chart._stacks={}),{iScale,vScale,index:datasetIndex}=meta,iAxis=iScale.axis,vAxis=vScale.axis,key=getStackKey(iScale,vScale,meta),ilen=parsed.length;let stack;for(let i=0;iscales2[key].axis===axis).shift()}function createDatasetContext(parent,index2){return createContext(parent,{active:!1,dataset:void 0,datasetIndex:index2,index:index2,mode:"default",type:"dataset"})}function createDataContext(parent,index2,element){return createContext(parent,{active:!1,dataIndex:index2,parsed:void 0,raw:void 0,element,index:index2,mode:"default",type:"data"})}function clearStacks(meta,items){const datasetIndex=meta.controller.index,axis=meta.vScale&&meta.vScale.axis;if(axis){items=items||meta._parsed;for(const parsed of items){const stacks=parsed._stacks;if(!stacks||void 0===stacks[axis]||void 0===stacks[axis][datasetIndex])return;delete stacks[axis][datasetIndex]}}}__name(Animations,"Animations"),__name(awaitAll,"awaitAll"),__name(resolveTargetOptions,"resolveTargetOptions"),__name(scaleClip,"scaleClip"),__name(defaultClip,"defaultClip"),__name(toClip,"toClip"),__name(getSortedDatasetIndices,"getSortedDatasetIndices"),__name(applyStack,"applyStack"),__name(convertObjectDataToArray,"convertObjectDataToArray"),__name(isStacked,"isStacked"),__name(getStackKey,"getStackKey"),__name(getUserBounds,"getUserBounds"),__name(getOrCreateStack,"getOrCreateStack"),__name(getLastIndexInStack,"getLastIndexInStack"),__name(updateStacks,"updateStacks"),__name(getFirstScaleId,"getFirstScaleId"),__name(createDatasetContext,"createDatasetContext"),__name(createDataContext,"createDataContext"),__name(clearStacks,"clearStacks");const isDirectUpdateMode=__name(mode=>"reset"===mode||"none"===mode,"isDirectUpdateMode"),cloneIfNotShared=__name((cached,shared)=>shared?cached:Object.assign({},cached),"cloneIfNotShared"),createStack=__name((canStack,meta,chart)=>canStack&&!meta.hidden&&meta._stacked&&{keys:getSortedDatasetIndices(chart,!0),values:null},"createStack");class DatasetController{constructor(chart,datasetIndex){this.chart=chart,this._ctx=chart.ctx,this.index=datasetIndex,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 meta=this._cachedMeta;this.configure(),this.linkScales(),meta._stacked=isStacked(meta.vScale,meta),this.addElements()}updateIndex(datasetIndex){this.index!==datasetIndex&&clearStacks(this._cachedMeta),this.index=datasetIndex}linkScales(){const chart=this.chart,meta=this._cachedMeta,dataset=this.getDataset(),chooseId=__name((axis,x,y,r)=>"x"===axis?x:"r"===axis?r:y,"chooseId"),xid=meta.xAxisID=valueOrDefault(dataset.xAxisID,getFirstScaleId(chart,"x")),yid=meta.yAxisID=valueOrDefault(dataset.yAxisID,getFirstScaleId(chart,"y")),rid=meta.rAxisID=valueOrDefault(dataset.rAxisID,getFirstScaleId(chart,"r")),indexAxis=meta.indexAxis,iid=meta.iAxisID=chooseId(indexAxis,xid,yid,rid),vid=meta.vAxisID=chooseId(indexAxis,yid,xid,rid);meta.xScale=this.getScaleForId(xid),meta.yScale=this.getScaleForId(yid),meta.rScale=this.getScaleForId(rid),meta.iScale=this.getScaleForId(iid),meta.vScale=this.getScaleForId(vid)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(scaleID){return this.chart.scales[scaleID]}_getOtherScale(scale){const meta=this._cachedMeta;return scale===meta.iScale?meta.vScale:meta.iScale}reset(){this._update("reset")}_destroy(){const meta=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),meta._stacked&&clearStacks(meta)}_dataCheck(){const dataset=this.getDataset(),data=dataset.data||(dataset.data=[]),_data=this._data;if(isObject(data))this._data=convertObjectDataToArray(data);else if(_data!==data){if(_data){unlistenArrayEvents(_data,this);const meta=this._cachedMeta;clearStacks(meta),meta._parsed=[]}data&&Object.isExtensible(data)&&listenArrayEvents(data,this),this._syncList=[],this._data=data}}addElements(){const meta=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(meta.dataset=new this.datasetElementType)}buildOrUpdateElements(resetNewElements){const meta=this._cachedMeta,dataset=this.getDataset();let stackChanged=!1;this._dataCheck();const oldStacked=meta._stacked;meta._stacked=isStacked(meta.vScale,meta),meta.stack!==dataset.stack&&(stackChanged=!0,clearStacks(meta),meta.stack=dataset.stack),this._resyncElements(resetNewElements),(stackChanged||oldStacked!==meta._stacked)&&updateStacks(this,meta._parsed)}configure(){const config=this.chart.config,scopeKeys=config.datasetScopeKeys(this._type),scopes=config.getOptionScopes(this.getDataset(),scopeKeys,!0);this.options=config.createResolver(scopes,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(start,count){const{_cachedMeta:meta,_data:data}=this,{iScale,_stacked}=meta,iAxis=iScale.axis;let i,cur,parsed,sorted=0===start&&count===data.length||meta._sorted,prev=start>0&&meta._parsed[start-1];if(!1===this._parsing)meta._parsed=data,meta._sorted=!0,parsed=data;else{parsed=isArray(data[start])?this.parseArrayData(meta,data,start,count):isObject(data[start])?this.parseObjectData(meta,data,start,count):this.parsePrimitiveData(meta,data,start,count);const isNotInOrderComparedToPrev=__name(()=>null===cur[iAxis]||prev&&cur[iAxis]otherValue||otherMax=0;--i)if(!_skip()){this.updateRangeFromParsed(range,scale,parsed,stack);break}return range}getAllParsedValues(scale){const parsed=this._cachedMeta._parsed,values=[];let i,ilen,value;for(i=0,ilen=parsed.length;i=0&&index2this.getContext(index2,active),"context"),values=config.resolveNamedOptions(scopes,names2,context,prefixes);return values.$shared&&(values.$shared=sharing,cache[cacheKey]=Object.freeze(cloneIfNotShared(values,sharing))),values}_resolveAnimations(index2,transition,active){const chart=this.chart,cache=this._cachedDataOpts,cacheKey=`animation-${transition}`,cached=cache[cacheKey];if(cached)return cached;let options;if(!1!==chart.options.animation){const config=this.chart.config,scopeKeys=config.datasetAnimationScopeKeys(this._type,transition),scopes=config.getOptionScopes(this.getDataset(),scopeKeys);options=config.createResolver(scopes,this.getContext(index2,active,transition))}const animations=new Animations(chart,options&&options.animations);return options&&options._cacheable&&(cache[cacheKey]=Object.freeze(animations)),animations}getSharedOptions(options){if(options.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},options))}includeOptions(mode,sharedOptions){return!sharedOptions||isDirectUpdateMode(mode)||this.chart._animationsDisabled}updateElement(element,index2,properties,mode){isDirectUpdateMode(mode)?Object.assign(element,properties):this._resolveAnimations(index2,mode).update(element,properties)}updateSharedOptions(sharedOptions,mode,newOptions){sharedOptions&&!isDirectUpdateMode(mode)&&this._resolveAnimations(void 0,mode).update(sharedOptions,newOptions)}_setStyle(element,index2,mode,active){element.active=active;const options=this.getStyle(index2,active);this._resolveAnimations(index2,mode,active).update(element,{options:!active&&this.getSharedOptions(options)||options})}removeHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!1)}setHoverStyle(element,datasetIndex,index2){this._setStyle(element,index2,"active",!0)}_removeDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!1)}_setDatasetHoverStyle(){const element=this._cachedMeta.dataset;element&&this._setStyle(element,void 0,"active",!0)}_resyncElements(resetNewElements){const data=this._data,elements=this._cachedMeta.data;for(const[method,arg1,arg2]of this._syncList)this[method](arg1,arg2);this._syncList=[];const numMeta=elements.length,numData=data.length,count=Math.min(numData,numMeta);count&&this.parse(0,count),numData>numMeta?this._insertElements(numMeta,numData-numMeta,resetNewElements):numData{for(arr.length+=count,i=arr.length-1;i>=end;i--)arr[i]=arr[i-count]},"move");for(move(data),i=start;ia2-b2))}return scale._cache.$bar}function computeMinSampleSize(meta){const scale=meta.iScale,values=getAllScaleValues(scale,meta.type);let i,ilen,curr,prev,min=scale._length;const updateMinAndPrev=__name(()=>{32767===curr||-32768===curr||(defined(prev)&&(min=Math.min(min,Math.abs(curr-prev)||min)),prev=curr)},"updateMinAndPrev");for(i=0,ilen=values.length;i0?pixels[index2-1]:null,next=index2Math.abs(max)&&(barStart=max,barEnd=min),item[vScale.axis]=barEnd,item._custom={barStart,barEnd,start:startValue,end:endValue,min,max}}function parseValue(entry,item,vScale,i){return isArray(entry)?parseFloatBar(entry,item,vScale,i):item[vScale.axis]=vScale.parse(entry,i),item}function parseArrayOrPrimitive(meta,data,start,count){const iScale=meta.iScale,vScale=meta.vScale,labels=iScale.getLabels(),singleScale=iScale===vScale,parsed=[];let i,ilen,item,entry;for(i=start,ilen=start+count;i=actualBase?1:-1)}function borderProps(properties){let reverse,start,end,top,bottom;return properties.horizontal?(reverse=properties.base>properties.x,start="left",end="right"):(reverse=properties.base=0;--i)max=Math.max(max,data[i].size(this.resolveDataElementOptions(i))/2);return max>0&&max}getLabelAndValue(index2){const meta=this._cachedMeta,{xScale,yScale}=meta,parsed=this.getParsed(index2),x=xScale.getLabelForValue(parsed.x),y=yScale.getLabelForValue(parsed.y),r=parsed._custom;return{label:meta.label,value:"("+x+", "+y+(r?", "+r:"")+")"}}update(mode){const points=this._cachedMeta.data;this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis;for(let i=start;i_angleBetween(angle,startAngle,endAngle,!0)?1:Math.max(a2,a2*cutout,b2,b2*cutout),"calcMax"),calcMin=__name((angle,a2,b2)=>_angleBetween(angle,startAngle,endAngle,!0)?-1:Math.min(a2,a2*cutout,b2,b2*cutout),"calcMin"),maxX=calcMax(0,startX,endX),maxY=calcMax(HALF_PI,startY,endY),minX=calcMin(PI,startX,endX),minY=calcMin(PI+HALF_PI,startY,endY);ratioX=(maxX-minX)/2,ratioY=(maxY-minY)/2,offsetX=-(maxX+minX)/2,offsetY=-(maxY+minY)/2}return{ratioX,ratioY,offsetX,offsetY}}__name(BubbleController,"BubbleController"),BubbleController.id="bubble",BubbleController.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},BubbleController.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}},__name(getRatioAndOffset,"getRatioAndOffset");class DoughnutController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(start,count){const data=this.getDataset().data,meta=this._cachedMeta;if(!1===this._parsing)meta._parsed=data;else{let i,ilen,getter=__name(i2=>+data[i2],"getter");if(isObject(data[start])){const{key="value"}=this._parsing;getter=__name(i2=>+resolveObjectKey(data[i2],key),"getter")}for(i=start,ilen=start+count;i0&&!isNaN(value)?TAU*(Math.abs(value)/total):0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2],chart.options.locale);return{label:labels[index2]||"",value}}getMaxBorderWidth(arcs){let max=0;const chart=this.chart;let i,ilen,meta,controller,options;if(!arcs)for(i=0,ilen=chart.data.datasets.length;i"spacing"!==name,_indexable:name=>"spacing"!==name},DoughnutController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e2,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label(tooltipItem){let dataLabel=tooltipItem.label;const value=": "+tooltipItem.formattedValue;return isArray(dataLabel)?(dataLabel=dataLabel.slice(),dataLabel[0]+=value):dataLabel+=value,dataLabel}}}}};class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(mode){const meta=this._cachedMeta,{dataset:line,data:points=[],_dataset}=meta,animationsDisabled=this.chart._animationsDisabled;let{start,count}=getStartAndCountOfVisiblePoints(meta,points,animationsDisabled);this._drawStart=start,this._drawCount=count,scaleRangesChanged(meta)&&(start=0,count=points.length),line._chart=this.chart,line._datasetIndex=this.index,line._decimated=!!_dataset._decimated,line.points=points;const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0),options.segment=this.options.segment,this.updateElement(line,void 0,{animated:!animationsDisabled,options},mode),this.updateElements(points,start,count,mode)}updateElements(points,start,count,mode){const reset="reset"===mode,{iScale,vScale,_stacked,_dataset}=this._cachedMeta,firstOpts=this.resolveDataElementOptions(start,mode),sharedOptions=this.getSharedOptions(firstOpts),includeOptions=this.includeOptions(mode,sharedOptions),iAxis=iScale.axis,vAxis=vScale.axis,{spanGaps,segment}=this.options,maxGapLength=isNumber(spanGaps)?spanGaps:Number.POSITIVE_INFINITY,directUpdate=this.chart._animationsDisabled||reset||"none"===mode;let prevParsed=start>0&&this.getParsed(start-1);for(let i=start;i0&&Math.abs(parsed[iAxis]-prevParsed[iAxis])>maxGapLength,segment&&(properties.parsed=parsed,properties.raw=_dataset.data[i]),includeOptions&&(properties.options=sharedOptions||this.resolveDataElementOptions(i,point.active?"active":mode)),directUpdate||this.updateElement(point,i,properties,mode),prevParsed=parsed}this.updateSharedOptions(sharedOptions,mode,firstOpts)}getMaxOverflow(){const meta=this._cachedMeta,dataset=meta.dataset,border=dataset.options&&dataset.options.borderWidth||0,data=meta.data||[];if(!data.length)return border;const firstPoint=data[0].size(this.resolveDataElementOptions(0)),lastPoint=data[data.length-1].size(this.resolveDataElementOptions(data.length-1));return Math.max(border,firstPoint,lastPoint)/2}draw(){const meta=this._cachedMeta;meta.dataset.updateControlPoints(this.chart.chartArea,meta.iScale.axis),super.draw()}}function getStartAndCountOfVisiblePoints(meta,points,animationsDisabled){const pointCount=points.length;let start=0,count=pointCount;if(meta._sorted){const{iScale,_parsed}=meta,axis=iScale.axis,{min,max,minDefined,maxDefined}=iScale.getUserBounds();minDefined&&(start=_limitValue(Math.min(_lookupByKey(_parsed,iScale.axis,min).lo,animationsDisabled?pointCount:_lookupByKey(points,axis,iScale.getPixelForValue(min)).lo),0,pointCount-1)),count=maxDefined?_limitValue(Math.max(_lookupByKey(_parsed,iScale.axis,max).hi+1,animationsDisabled?0:_lookupByKey(points,axis,iScale.getPixelForValue(max)).hi+1),start,pointCount)-start:pointCount-start}return{start,count}}function scaleRangesChanged(meta){const{xScale,yScale,_scaleRanges}=meta,newRanges={xmin:xScale.min,xmax:xScale.max,ymin:yScale.min,ymax:yScale.max};if(!_scaleRanges)return meta._scaleRanges=newRanges,!0;const changed=_scaleRanges.xmin!==xScale.min||_scaleRanges.xmax!==xScale.max||_scaleRanges.ymin!==yScale.min||_scaleRanges.ymax!==yScale.max;return Object.assign(_scaleRanges,newRanges),changed}__name(LineController,"LineController"),LineController.id="line",LineController.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},LineController.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}},__name(getStartAndCountOfVisiblePoints,"getStartAndCountOfVisiblePoints"),__name(scaleRangesChanged,"scaleRangesChanged");class PolarAreaController extends DatasetController{constructor(chart,datasetIndex){super(chart,datasetIndex),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(index2){const meta=this._cachedMeta,chart=this.chart,labels=chart.data.labels||[],value=formatNumber(meta._parsed[index2].r,chart.options.locale);return{label:labels[index2]||"",value}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const arcs=this._cachedMeta.data;this._updateRadius(),this.updateElements(arcs,0,arcs.length,mode)}getMinMax(){const meta=this._cachedMeta,range={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return meta.data.forEach((element,index2)=>{const parsed=this.getParsed(index2).r;!isNaN(parsed)&&this.chart.getDataVisibility(index2)&&(parsedrange.max&&(range.max=parsed))}),range}_updateRadius(){const chart=this.chart,chartArea=chart.chartArea,opts=chart.options,minSize=Math.min(chartArea.right-chartArea.left,chartArea.bottom-chartArea.top),outerRadius=Math.max(minSize/2,0),radiusLength=(outerRadius-Math.max(opts.cutoutPercentage?outerRadius/100*opts.cutoutPercentage:1,0))/chart.getVisibleDatasetCount();this.outerRadius=outerRadius-radiusLength*this.index,this.innerRadius=this.outerRadius-radiusLength}updateElements(arcs,start,count,mode){const reset="reset"===mode,chart=this.chart,animationOpts=chart.options.animation,scale=this._cachedMeta.rScale,centerX=scale.xCenter,centerY=scale.yCenter,datasetStartAngle=scale.getIndexAngle(0)-.5*PI;let i,angle=datasetStartAngle;const defaultAngle=360/this.countVisibleElements();for(i=0;i{!isNaN(this.getParsed(index2).r)&&this.chart.getDataVisibility(index2)&&count++}),count}_computeAngle(index2,mode,defaultAngle){return this.chart.getDataVisibility(index2)?toRadians(this.resolveDataElementOptions(index2,mode).angle||defaultAngle):0}}__name(PolarAreaController,"PolarAreaController"),PolarAreaController.id="polarArea",PolarAreaController.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},PolarAreaController.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(chart){const data=chart.data;if(data.labels.length&&data.datasets.length){const{labels:{pointStyle}}=chart.legend.options;return data.labels.map((label,i)=>{const style=chart.getDatasetMeta(0).controller.getStyle(i);return{text:label,fillStyle:style.backgroundColor,strokeStyle:style.borderColor,lineWidth:style.borderWidth,pointStyle,hidden:!chart.getDataVisibility(i),index:i}})}return[]}},onClick(e2,legendItem,legend){legend.chart.toggleDataVisibility(legendItem.index),legend.chart.update()}},tooltip:{callbacks:{title:()=>"",label:context=>context.chart.data.labels[context.dataIndex]+": "+context.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class PieController extends DoughnutController{}__name(PieController,"PieController"),PieController.id="pie",PieController.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class RadarController extends DatasetController{getLabelAndValue(index2){const vScale=this._cachedMeta.vScale,parsed=this.getParsed(index2);return{label:vScale.getLabels()[index2],value:""+vScale.getLabelForValue(parsed[vScale.axis])}}parseObjectData(meta,data,start,count){return _parseObjectDataRadialScale.bind(this)(meta,data,start,count)}update(mode){const meta=this._cachedMeta,line=meta.dataset,points=meta.data||[],labels=meta.iScale.getLabels();if(line.points=points,"resize"!==mode){const options=this.resolveDatasetElementOptions(mode);this.options.showLine||(options.borderWidth=0);const properties={_loop:!0,_fullLoop:labels.length===points.length,options};this.updateElement(line,void 0,properties,mode)}this.updateElements(points,0,points.length,mode)}updateElements(points,start,count,mode){const scale=this._cachedMeta.rScale,reset="reset"===mode;for(let i=start;i"",label:item=>"("+item.label+", "+item.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function chart_esm_abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}__name(chart_esm_abstract,"chart_esm_abstract");class DateAdapter{constructor(options){this.options=options||{}}formats(){return chart_esm_abstract()}parse(value,format){return chart_esm_abstract()}format(timestamp,format){return chart_esm_abstract()}add(timestamp,amount,unit){return chart_esm_abstract()}diff(a2,b2,unit){return chart_esm_abstract()}startOf(timestamp,unit,weekday){return chart_esm_abstract()}endOf(timestamp,unit){return chart_esm_abstract()}}__name(DateAdapter,"DateAdapter"),DateAdapter.override=function(members){Object.assign(DateAdapter.prototype,members)};var adapters={_date:DateAdapter};function binarySearch(metaset,axis,value,intersect){const{controller,data,_sorted}=metaset,iScale=controller._cachedMeta.iScale;if(iScale&&axis===iScale.axis&&"r"!==axis&&_sorted&&data.length){const lookupMethod=iScale._reversePixels?_rlookupByKey:_lookupByKey;if(!intersect)return lookupMethod(data,axis,value);if(controller._sharedOptions){const el=data[0],range="function"==typeof el.getRange&&el.getRange(axis);if(range){const start=lookupMethod(data,axis,value-range),end=lookupMethod(data,axis,value+range);return{lo:start.lo,hi:end.hi}}}}return{lo:0,hi:data.length-1}}function evaluateInteractionItems(chart,axis,position,handler,intersect){const metasets=chart.getSortedVisibleDatasetMetas(),value=position[axis];for(let i=0,ilen=metasets.length;i{element[rangeMethod](position[axis],useFinalPosition)&&(items.push({element,datasetIndex,index:index2}),intersectsItem=intersectsItem||element.inRange(position.x,position.y,useFinalPosition))}),intersect&&!intersectsItem?[]:items}__name(binarySearch,"binarySearch"),__name(evaluateInteractionItems,"evaluateInteractionItems"),__name(getDistanceMetricForAxis,"getDistanceMetricForAxis"),__name(getIntersectItems,"getIntersectItems"),__name(getNearestRadialItems,"getNearestRadialItems"),__name(getNearestCartesianItems,"getNearestCartesianItems"),__name(getNearestItems,"getNearestItems"),__name(getAxisItems,"getAxisItems");var Interaction={evaluateInteractionItems,modes:{index(chart,e2,options,useFinalPosition){const position=getRelativePosition(e2,chart),axis=options.axis||"x",includeInvisible=options.includeInvisible||!1,items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible),elements=[];return items.length?(chart.getSortedVisibleDatasetMetas().forEach(meta=>{const index2=items[0].index,element=meta.data[index2];element&&!element.skip&&elements.push({element,datasetIndex:meta.index,index:index2})}),elements):[]},dataset(chart,e2,options,useFinalPosition){const position=getRelativePosition(e2,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;let items=options.intersect?getIntersectItems(chart,position,axis,useFinalPosition,includeInvisible):getNearestItems(chart,position,axis,!1,useFinalPosition,includeInvisible);if(items.length>0){const datasetIndex=items[0].datasetIndex,data=chart.getDatasetMeta(datasetIndex).data;items=[];for(let i=0;igetIntersectItems(chart,getRelativePosition(e2,chart),options.axis||"xy",useFinalPosition,options.includeInvisible||!1),nearest(chart,e2,options,useFinalPosition){const position=getRelativePosition(e2,chart),axis=options.axis||"xy",includeInvisible=options.includeInvisible||!1;return getNearestItems(chart,position,axis,options.intersect,useFinalPosition,includeInvisible)},x:(chart,e2,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e2,chart),"x",options.intersect,useFinalPosition),y:(chart,e2,options,useFinalPosition)=>getAxisItems(chart,getRelativePosition(e2,chart),"y",options.intersect,useFinalPosition)}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(array,position){return array.filter(v=>v.pos===position)}function filterDynamicPositionByAxis(array,axis){return array.filter(v=>-1===STATIC_POSITIONS.indexOf(v.pos)&&v.box.axis===axis)}function sortByWeight(array,reverse){return array.sort((a2,b2)=>{const v0=reverse?b2:a2,v1=reverse?a2:b2;return v0.weight===v1.weight?v0.index-v1.index:v0.weight-v1.weight})}function wrapBoxes(boxes){const layoutBoxes=[];let i,ilen,box,pos,stack,stackWeight;for(i=0,ilen=(boxes||[]).length;iwrap.box.fullSize),!0),left=sortByWeight(filterByPosition(layoutBoxes,"left"),!0),right=sortByWeight(filterByPosition(layoutBoxes,"right")),top=sortByWeight(filterByPosition(layoutBoxes,"top"),!0),bottom=sortByWeight(filterByPosition(layoutBoxes,"bottom")),centerHorizontal=filterDynamicPositionByAxis(layoutBoxes,"x"),centerVertical=filterDynamicPositionByAxis(layoutBoxes,"y");return{fullSize,leftAndTop:left.concat(top),rightAndBottom:right.concat(centerVertical).concat(bottom).concat(centerHorizontal),chartArea:filterByPosition(layoutBoxes,"chartArea"),vertical:left.concat(right).concat(centerVertical),horizontal:top.concat(bottom).concat(centerHorizontal)}}function getCombinedMax(maxPadding,chartArea,a2,b2){return Math.max(maxPadding[a2],chartArea[a2])+Math.max(maxPadding[b2],chartArea[b2])}function updateMaxPadding(maxPadding,boxPadding){maxPadding.top=Math.max(maxPadding.top,boxPadding.top),maxPadding.left=Math.max(maxPadding.left,boxPadding.left),maxPadding.bottom=Math.max(maxPadding.bottom,boxPadding.bottom),maxPadding.right=Math.max(maxPadding.right,boxPadding.right)}function updateDims(chartArea,params,layout,stacks){const{pos,box}=layout,maxPadding=chartArea.maxPadding;if(!isObject(pos)){layout.size&&(chartArea[pos]-=layout.size);const stack=stacks[layout.stack]||{size:0,count:1};stack.size=Math.max(stack.size,layout.horizontal?box.height:box.width),layout.size=stack.size/stack.count,chartArea[pos]+=layout.size}box.getPadding&&updateMaxPadding(maxPadding,box.getPadding());const newWidth=Math.max(0,params.outerWidth-getCombinedMax(maxPadding,chartArea,"left","right")),newHeight=Math.max(0,params.outerHeight-getCombinedMax(maxPadding,chartArea,"top","bottom")),widthChanged=newWidth!==chartArea.w,heightChanged=newHeight!==chartArea.h;return chartArea.w=newWidth,chartArea.h=newHeight,layout.horizontal?{same:widthChanged,other:heightChanged}:{same:heightChanged,other:widthChanged}}function handleMaxPadding(chartArea){const maxPadding=chartArea.maxPadding;function updatePos(pos){const change=Math.max(maxPadding[pos]-chartArea[pos],0);return chartArea[pos]+=change,change}__name(updatePos,"updatePos"),chartArea.y+=updatePos("top"),chartArea.x+=updatePos("left"),updatePos("right"),updatePos("bottom")}function getMargins(horizontal,chartArea){const maxPadding=chartArea.maxPadding;function marginForPositions(positions2){const margin={left:0,top:0,right:0,bottom:0};return positions2.forEach(pos=>{margin[pos]=Math.max(chartArea[pos],maxPadding[pos])}),margin}return __name(marginForPositions,"marginForPositions"),marginForPositions(horizontal?["left","right"]:["top","bottom"])}function fitBoxes(boxes,chartArea,params,stacks){const refitBoxes=[];let i,ilen,layout,box,refit,changed;for(i=0,ilen=boxes.length,refit=0;i{"function"==typeof box.beforeLayout&&box.beforeLayout()});const visibleVerticalBoxCount=verticalBoxes.reduce((total,wrap)=>wrap.box.options&&!1===wrap.box.options.display?total:total+1,0)||1,params=Object.freeze({outerWidth:width,outerHeight:height,padding,availableWidth,availableHeight,vBoxMaxWidth:availableWidth/2/visibleVerticalBoxCount,hBoxMaxHeight:availableHeight/2}),maxPadding=Object.assign({},padding);updateMaxPadding(maxPadding,toPadding(minPadding));const chartArea=Object.assign({maxPadding,w:availableWidth,h:availableHeight,x:padding.left,y:padding.top},padding),stacks=setLayoutDims(verticalBoxes.concat(horizontalBoxes),params);fitBoxes(boxes.fullSize,chartArea,params,stacks),fitBoxes(verticalBoxes,chartArea,params,stacks),fitBoxes(horizontalBoxes,chartArea,params,stacks)&&fitBoxes(verticalBoxes,chartArea,params,stacks),handleMaxPadding(chartArea),placeBoxes(boxes.leftAndTop,chartArea,params,stacks),chartArea.x+=chartArea.w,chartArea.y+=chartArea.h,placeBoxes(boxes.rightAndBottom,chartArea,params,stacks),chart.chartArea={left:chartArea.left,top:chartArea.top,right:chartArea.left+chartArea.w,bottom:chartArea.top+chartArea.h,height:chartArea.h,width:chartArea.w},each(boxes.chartArea,layout=>{const box=layout.box;Object.assign(box,chart.chartArea),box.update(chartArea.w,chartArea.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(canvas,aspectRatio){}releaseContext(context){return!1}addEventListener(chart,type,listener){}removeEventListener(chart,type,listener){}getDevicePixelRatio(){return 1}getMaximumSize(element,width,height,aspectRatio){return width=Math.max(0,width||element.width),height=height||element.height,{width,height:Math.max(0,aspectRatio?Math.floor(width/aspectRatio):height)}}isAttached(canvas){return!0}updateConfig(config){}}__name(BasePlatform,"BasePlatform");class BasicPlatform extends BasePlatform{acquireContext(item){return item&&item.getContext&&item.getContext("2d")||null}updateConfig(config){config.options.animation=!1}}__name(BasicPlatform,"BasicPlatform");const EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=__name(value=>null===value||""===value,"isNullOrEmpty");function initCanvas(canvas,aspectRatio){const style=canvas.style,renderHeight=canvas.getAttribute("height"),renderWidth=canvas.getAttribute("width");if(canvas.$chartjs={initial:{height:renderHeight,width:renderWidth,style:{display:style.display,height:style.height,width:style.width}}},style.display=style.display||"block",style.boxSizing=style.boxSizing||"border-box",isNullOrEmpty(renderWidth)){const displayWidth=readUsedSize(canvas,"width");void 0!==displayWidth&&(canvas.width=displayWidth)}if(isNullOrEmpty(renderHeight))if(""===canvas.style.height)canvas.height=canvas.width/(aspectRatio||2);else{const displayHeight=readUsedSize(canvas,"height");void 0!==displayHeight&&(canvas.height=displayHeight)}return canvas}__name(initCanvas,"initCanvas");const eventListenerOptions=!!supportsEventListenerOptions&&{passive:!0};function addListener(node,type,listener){node.addEventListener(type,listener,eventListenerOptions)}function removeListener(chart,type,listener){chart.canvas.removeEventListener(type,listener,eventListenerOptions)}function fromNativeEvent(event,chart){const type=EVENT_TYPES[event.type]||event.type,{x,y}=getRelativePosition(event,chart);return{type,chart,native:event,x:void 0!==x?x:null,y:void 0!==y?y:null}}function nodeListContains(nodeList,canvas){for(const node of nodeList)if(node===canvas||node.contains(canvas))return!0}function createAttachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.addedNodes,canvas),trigger=trigger&&!nodeListContains(entry.removedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}function createDetachObserver(chart,type,listener){const canvas=chart.canvas,observer=new MutationObserver(entries=>{let trigger=!1;for(const entry of entries)trigger=trigger||nodeListContains(entry.removedNodes,canvas),trigger=trigger&&!nodeListContains(entry.addedNodes,canvas);trigger&&listener()});return observer.observe(document,{childList:!0,subtree:!0}),observer}__name(addListener,"addListener"),__name(removeListener,"removeListener"),__name(fromNativeEvent,"fromNativeEvent"),__name(nodeListContains,"nodeListContains"),__name(createAttachObserver,"createAttachObserver"),__name(createDetachObserver,"createDetachObserver");const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const dpr=window.devicePixelRatio;dpr!==oldDevicePixelRatio&&(oldDevicePixelRatio=dpr,drpListeningCharts.forEach((resize,chart)=>{chart.currentDevicePixelRatio!==dpr&&resize()}))}function listenDevicePixelRatioChanges(chart,resize){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(chart,resize)}function unlistenDevicePixelRatioChanges(chart){drpListeningCharts.delete(chart),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(chart,type,listener){const canvas=chart.canvas,container=canvas&&_getParentNode(canvas);if(!container)return;const resize=throttled((width,height)=>{const w=container.clientWidth;listener(width,height),w{const entry=entries[0],width=entry.contentRect.width,height=entry.contentRect.height;0===width&&0===height||resize(width,height)});return observer.observe(container),listenDevicePixelRatioChanges(chart,resize),observer}function releaseObserver(chart,type,observer){observer&&observer.disconnect(),"resize"===type&&unlistenDevicePixelRatioChanges(chart)}function createProxyAndListen(chart,type,listener){const canvas=chart.canvas,proxy=throttled(event=>{null!==chart.ctx&&listener(fromNativeEvent(event,chart))},chart,args=>{const event=args[0];return[event,event.offsetX,event.offsetY]});return addListener(canvas,type,proxy),proxy}__name(onWindowResize,"onWindowResize"),__name(listenDevicePixelRatioChanges,"listenDevicePixelRatioChanges"),__name(unlistenDevicePixelRatioChanges,"unlistenDevicePixelRatioChanges"),__name(createResizeObserver,"createResizeObserver"),__name(releaseObserver,"releaseObserver"),__name(createProxyAndListen,"createProxyAndListen");class DomPlatform extends BasePlatform{acquireContext(canvas,aspectRatio){const context=canvas&&canvas.getContext&&canvas.getContext("2d");return context&&context.canvas===canvas?(initCanvas(canvas,aspectRatio),context):null}releaseContext(context){const canvas=context.canvas;if(!canvas.$chartjs)return!1;const initial=canvas.$chartjs.initial;["height","width"].forEach(prop=>{const value=initial[prop];isNullOrUndef(value)?canvas.removeAttribute(prop):canvas.setAttribute(prop,value)});const style=initial.style||{};return Object.keys(style).forEach(key=>{canvas.style[key]=style[key]}),canvas.width=canvas.width,delete canvas.$chartjs,!0}addEventListener(chart,type,listener){this.removeEventListener(chart,type);const proxies=chart.$proxies||(chart.$proxies={}),handler={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[type]||createProxyAndListen;proxies[type]=handler(chart,type,listener)}removeEventListener(chart,type){const proxies=chart.$proxies||(chart.$proxies={}),proxy=proxies[type];proxy&&(({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[type]||removeListener)(chart,type,proxy),proxies[type]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(canvas,width,height,aspectRatio){return getMaximumSize(canvas,width,height,aspectRatio)}isAttached(canvas){const container=_getParentNode(canvas);return!(!container||!container.isConnected)}}function _detectPlatform(canvas){return!_isDomSupported()||"undefined"!=typeof OffscreenCanvas&&canvas instanceof OffscreenCanvas?BasicPlatform:DomPlatform}__name(DomPlatform,"DomPlatform"),__name(_detectPlatform,"_detectPlatform");class Element{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(useFinalPosition){const{x,y}=this.getProps(["x","y"],useFinalPosition);return{x,y}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(props,final){const anims=this.$animations;if(!final||!anims)return this;const ret={};return props.forEach(prop=>{ret[prop]=anims[prop]&&anims[prop].active()?anims[prop]._to:this[prop]}),ret}}__name(Element,"Element"),Element.defaults={},Element.defaultRoutes=void 0;const formatters={values:value=>isArray(value)?value:""+value,numeric(tickValue,index2,ticks){if(0===tickValue)return"0";const locale=this.chart.options.locale;let notation,delta=tickValue;if(ticks.length>1){const maxTick=Math.max(Math.abs(ticks[0].value),Math.abs(ticks[ticks.length-1].value));(maxTick<1e-4||maxTick>1e15)&&(notation="scientific"),delta=calculateDelta(tickValue,ticks)}const logDelta=log10(Math.abs(delta)),numDecimal=Math.max(Math.min(-1*Math.floor(logDelta),20),0),options={notation,minimumFractionDigits:numDecimal,maximumFractionDigits:numDecimal};return Object.assign(options,this.options.ticks.format),formatNumber(tickValue,locale,options)},logarithmic(tickValue,index2,ticks){if(0===tickValue)return"0";const remain=tickValue/Math.pow(10,Math.floor(log10(tickValue)));return 1===remain||2===remain||5===remain?formatters.numeric.call(this,tickValue,index2,ticks):""}};function calculateDelta(tickValue,ticks){let delta=ticks.length>3?ticks[2].value-ticks[1].value:ticks[1].value-ticks[0].value;return Math.abs(delta)>=1&&tickValue!==Math.floor(tickValue)&&(delta=tickValue-Math.floor(tickValue)),delta}__name(calculateDelta,"calculateDelta");var Ticks={formatters};function autoSkip(scale,ticks){const tickOpts=scale.options.ticks,ticksLimit=tickOpts.maxTicksLimit||determineMaxTicks(scale),majorIndices=tickOpts.major.enabled?getMajorIndices(ticks):[],numMajorIndices=majorIndices.length,first=majorIndices[0],last=majorIndices[numMajorIndices-1],newTicks=[];if(numMajorIndices>ticksLimit)return skipMajors(ticks,newTicks,majorIndices,numMajorIndices/ticksLimit),newTicks;const spacing=calculateSpacing(majorIndices,ticks,ticksLimit);if(numMajorIndices>0){let i,ilen;const avgMajorSpacing=numMajorIndices>1?Math.round((last-first)/(numMajorIndices-1)):null;for(skip(ticks,newTicks,spacing,isNullOrUndef(avgMajorSpacing)?0:first-avgMajorSpacing,first),i=0,ilen=numMajorIndices-1;ispacing)return factor}return Math.max(spacing,1)}function getMajorIndices(ticks){const result=[];let i,ilen;for(i=0,ilen=ticks.length;ioptions.lineWidth,tickColor:(_ctx,options)=>options.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:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),defaults.route("scale.ticks","color","","color"),defaults.route("scale.grid","color","","borderColor"),defaults.route("scale.grid","borderColor","","borderColor"),defaults.route("scale.title","color","","color"),defaults.describe("scale",{_fallback:!1,_scriptable:name=>!name.startsWith("before")&&!name.startsWith("after")&&"callback"!==name&&"parser"!==name,_indexable:name=>"borderDash"!==name&&"tickBorderDash"!==name}),defaults.describe("scales",{_fallback:"scale"}),defaults.describe("scale.ticks",{_scriptable:name=>"backdropPadding"!==name&&"callback"!==name,_indexable:name=>"backdropPadding"!==name}),__name(autoSkip,"autoSkip"),__name(determineMaxTicks,"determineMaxTicks"),__name(calculateSpacing,"calculateSpacing"),__name(getMajorIndices,"getMajorIndices"),__name(skipMajors,"skipMajors"),__name(skip,"skip"),__name(getEvenSpacing,"getEvenSpacing");const reverseAlign=__name(align=>"left"===align?"right":"right"===align?"left":align,"reverseAlign"),offsetFromEdge=__name((scale,edge,offset)=>"top"===edge||"left"===edge?scale[edge]+offset:scale[edge]-offset,"offsetFromEdge");function sample(arr,numItems){const result=[],increment=arr.length/numItems,len=arr.length;let i=0;for(;iend+1e-6)))return lineValue}function garbageCollect(caches,length){each(caches,cache=>{const gc=cache.gc,gcLen=gc.length/2;let i;if(gcLen>length){for(i=0;imax?max:min,max=minDefined&&min>max?min:max,{min:finiteOrDefault(min,finiteOrDefault(max,min)),max:finiteOrDefault(max,finiteOrDefault(min,max))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const data=this.chart.data;return this.options.labels||(this.isHorizontal()?data.xLabels:data.yLabels)||data.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(maxWidth,maxHeight,margins){const{beginAtZero,grace,ticks:tickOpts}=this.options,sampleSize=tickOpts.sampleSize;this.beforeUpdate(),this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins=Object.assign({left:0,right:0,top:0,bottom:0},margins),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+margins.left+margins.right:this.height+margins.top+margins.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,grace,beginAtZero),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const samplingEnabled=sampleSize=maxRotation||numTicks<=1||!this.isHorizontal())return void(this.labelRotation=minRotation);const labelSizes=this._getLabelSizes(),maxLabelWidth=labelSizes.widest.width,maxLabelHeight=labelSizes.highest.height,maxWidth=_limitValue(this.chart.width-maxLabelWidth,0,this.maxWidth);tickWidth=options.offset?this.maxWidth/numTicks:maxWidth/(numTicks-1),maxLabelWidth+6>tickWidth&&(tickWidth=maxWidth/(numTicks-(options.offset?.5:1)),maxHeight=this.maxHeight-getTickMarkLength(options.grid)-tickOpts.padding-getTitleHeight(options.title,this.chart.options.font),maxLabelDiagonal=Math.sqrt(maxLabelWidth*maxLabelWidth+maxLabelHeight*maxLabelHeight),labelRotation=toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height+6)/tickWidth,-1,1)),Math.asin(_limitValue(maxHeight/maxLabelDiagonal,-1,1))-Math.asin(_limitValue(maxLabelHeight/maxLabelDiagonal,-1,1)))),labelRotation=Math.max(minRotation,Math.min(maxRotation,labelRotation))),this.labelRotation=labelRotation}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const minSize={width:0,height:0},{chart,options:{ticks:tickOpts,title:titleOpts,grid:gridOpts}}=this,display=this._isVisible(),isHorizontal=this.isHorizontal();if(display){const titleHeight=getTitleHeight(titleOpts,chart.options.font);if(isHorizontal?(minSize.width=this.maxWidth,minSize.height=getTickMarkLength(gridOpts)+titleHeight):(minSize.height=this.maxHeight,minSize.width=getTickMarkLength(gridOpts)+titleHeight),tickOpts.display&&this.ticks.length){const{first,last,widest,highest}=this._getLabelSizes(),tickPadding=2*tickOpts.padding,angleRadians=toRadians(this.labelRotation),cos=Math.cos(angleRadians),sin=Math.sin(angleRadians);if(isHorizontal){const labelHeight=tickOpts.mirror?0:sin*widest.width+cos*highest.height;minSize.height=Math.min(this.maxHeight,minSize.height+labelHeight+tickPadding)}else{const labelWidth=tickOpts.mirror?0:cos*widest.width+sin*highest.height;minSize.width=Math.min(this.maxWidth,minSize.width+labelWidth+tickPadding)}this._calculatePadding(first,last,sin,cos)}}this._handleMargins(),isHorizontal?(this.width=this._length=chart.width-this._margins.left-this._margins.right,this.height=minSize.height):(this.width=minSize.width,this.height=this._length=chart.height-this._margins.top-this._margins.bottom)}_calculatePadding(first,last,sin,cos){const{ticks:{align,padding},position}=this.options,isRotated=0!==this.labelRotation,labelsBelowTicks="top"!==position&&"x"===this.axis;if(this.isHorizontal()){const offsetLeft=this.getPixelForTick(0)-this.left,offsetRight=this.right-this.getPixelForTick(this.ticks.length-1);let paddingLeft=0,paddingRight=0;isRotated?labelsBelowTicks?(paddingLeft=cos*first.width,paddingRight=sin*last.height):(paddingLeft=sin*first.height,paddingRight=cos*last.width):"start"===align?paddingRight=last.width:"end"===align?paddingLeft=first.width:"inner"!==align&&(paddingLeft=first.width/2,paddingRight=last.width/2),this.paddingLeft=Math.max((paddingLeft-offsetLeft+padding)*this.width/(this.width-offsetLeft),0),this.paddingRight=Math.max((paddingRight-offsetRight+padding)*this.width/(this.width-offsetRight),0)}else{let paddingTop=last.height/2,paddingBottom=first.height/2;"start"===align?(paddingTop=0,paddingBottom=first.height):"end"===align&&(paddingTop=last.height,paddingBottom=0),this.paddingTop=paddingTop+padding,this.paddingBottom=paddingBottom+padding}}_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(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis,position}=this.options;return"top"===position||"bottom"===position||"x"===axis}isFullSize(){return this.options.fullSize}_convertTicksToLabels(ticks){let i,ilen;for(this.beforeTickToLabelConversion(),this.generateTickLabels(ticks),i=0,ilen=ticks.length;i({width:widths[idx]||0,height:heights[idx]||0}),"valueAt");return{first:valueAt(0),last:valueAt(length-1),widest:valueAt(widest),highest:valueAt(highest),widths,heights}}getLabelForValue(value){return value}getPixelForValue(value,index2){return NaN}getValueForPixel(pixel){}getPixelForTick(index2){const ticks=this.ticks;return index2<0||index2>ticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getPixelForDecimal(decimal){this._reversePixels&&(decimal=1-decimal);const pixel=this._startPixel+decimal*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,pixel,0):pixel)}getDecimalForPixel(pixel){const decimal=(pixel-this._startPixel)/this._length;return this._reversePixels?1-decimal:decimal}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min,max}=this;return min<0&&max<0?max:min>0&&max>0?min:0}getContext(index2){const ticks=this.ticks||[];if(index2>=0&&index2w*sin?w/cos:h/sin:h*sin0}_computeGridLineItems(chartArea){const axis=this.axis,chart=this.chart,options=this.options,{grid,position}=options,offset=grid.offset,isHorizontal=this.isHorizontal(),ticksLength=this.ticks.length+(offset?1:0),tl=getTickMarkLength(grid),items=[],borderOpts=grid.setContext(this.getContext()),axisWidth=borderOpts.drawBorder?borderOpts.borderWidth:0,axisHalfWidth=axisWidth/2,alignBorderValue=__name(function(pixel){return _alignPixel(chart,pixel,axisWidth)},"alignBorderValue");let borderValue,i,lineValue,alignedLineValue,tx1,ty1,tx2,ty2,x1,y1,x2,y2;if("top"===position)borderValue=alignBorderValue(this.bottom),ty1=this.bottom-tl,ty2=borderValue-axisHalfWidth,y1=alignBorderValue(chartArea.top)+axisHalfWidth,y2=chartArea.bottom;else if("bottom"===position)borderValue=alignBorderValue(this.top),y1=chartArea.top,y2=alignBorderValue(chartArea.bottom)-axisHalfWidth,ty1=borderValue+axisHalfWidth,ty2=this.top+tl;else if("left"===position)borderValue=alignBorderValue(this.right),tx1=this.right-tl,tx2=borderValue-axisHalfWidth,x1=alignBorderValue(chartArea.left)+axisHalfWidth,x2=chartArea.right;else if("right"===position)borderValue=alignBorderValue(this.left),x1=chartArea.left,x2=alignBorderValue(chartArea.right)-axisHalfWidth,tx1=borderValue+axisHalfWidth,tx2=this.left+tl;else if("x"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.top+chartArea.bottom)/2+.5);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}y1=chartArea.top,y2=chartArea.bottom,ty1=borderValue+axisHalfWidth,ty2=ty1+tl}else if("y"===axis){if("center"===position)borderValue=alignBorderValue((chartArea.left+chartArea.right)/2);else if(isObject(position)){const positionAxisID=Object.keys(position)[0],value=position[positionAxisID];borderValue=alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value))}tx1=borderValue-axisHalfWidth,tx2=tx1-tl,x1=chartArea.left,x2=chartArea.right}const limit=valueOrDefault(options.ticks.maxTicksLimit,ticksLength),step=Math.max(1,Math.ceil(ticksLength/limit));for(i=0;it.value===value);return index2>=0?grid.setContext(this.getContext(index2)).lineWidth:0}drawGrid(chartArea){const grid=this.options.grid,ctx=this.ctx,items=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(chartArea));let i,ilen;const drawLine=__name((p1,p2,style)=>{!style.width||!style.color||(ctx.save(),ctx.lineWidth=style.width,ctx.strokeStyle=style.color,ctx.setLineDash(style.borderDash||[]),ctx.lineDashOffset=style.borderDashOffset,ctx.beginPath(),ctx.moveTo(p1.x,p1.y),ctx.lineTo(p2.x,p2.y),ctx.stroke(),ctx.restore())},"drawLine");if(grid.display)for(i=0,ilen=items.length;i{this.drawBackground(),this.drawGrid(chartArea),this.drawTitle()}},{z:gz+1,draw:()=>{this.drawBorder()}},{z:tz,draw:chartArea=>{this.drawLabels(chartArea)}}]:[{z:tz,draw:chartArea=>{this.draw(chartArea)}}]}getMatchingVisibleMetas(type){const metas=this.chart.getSortedVisibleDatasetMetas(),axisID=this.axis+"AxisID",result=[];let i,ilen;for(i=0,ilen=metas.length;i{const propertyParts=property.split("."),sourceName=propertyParts.pop(),sourceScope=[scope].concat(propertyParts).join("."),parts=routes[property].split("."),targetName=parts.pop(),targetScope=parts.join(".");defaults.route(sourceScope,sourceName,targetScope,targetName)})}function isIChartComponent(proto){return"id"in proto&&"defaults"in proto}__name(TypedRegistry,"TypedRegistry"),__name(registerDefaults,"registerDefaults"),__name(routeDefaults,"routeDefaults"),__name(isIChartComponent,"isIChartComponent");class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...args){this._each("register",args)}remove(...args){this._each("unregister",args)}addControllers(...args){this._each("register",args,this.controllers)}addElements(...args){this._each("register",args,this.elements)}addPlugins(...args){this._each("register",args,this.plugins)}addScales(...args){this._each("register",args,this.scales)}getController(id){return this._get(id,this.controllers,"controller")}getElement(id){return this._get(id,this.elements,"element")}getPlugin(id){return this._get(id,this.plugins,"plugin")}getScale(id){return this._get(id,this.scales,"scale")}removeControllers(...args){this._each("unregister",args,this.controllers)}removeElements(...args){this._each("unregister",args,this.elements)}removePlugins(...args){this._each("unregister",args,this.plugins)}removeScales(...args){this._each("unregister",args,this.scales)}_each(method,args,typedRegistry){[...args].forEach(arg=>{const reg=typedRegistry||this._getRegistryForType(arg);typedRegistry||reg.isForType(arg)||reg===this.plugins&&arg.id?this._exec(method,reg,arg):each(arg,item=>{const itemReg=typedRegistry||this._getRegistryForType(item);this._exec(method,itemReg,item)})})}_exec(method,registry2,component){const camelMethod=_capitalize(method);callback(component["before"+camelMethod],[],component),registry2[method](component),callback(component["after"+camelMethod],[],component)}_getRegistryForType(type){for(let i=0;ia2.filter(x=>!b2.some(y=>x.plugin.id===y.plugin.id)),"diff");this._notify(diff(previousDescriptors,descriptors2),chart,"stop"),this._notify(diff(descriptors2,previousDescriptors),chart,"start")}}function allPlugins(config){const plugins2=[],keys=Object.keys(registry.plugins.items);for(let i=0;i{const scaleConf=configScales[id];if(!isObject(scaleConf))return console.error(`Invalid scale configuration for scale: ${id}`);if(scaleConf._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${id}`);const axis=determineAxis(id,scaleConf),defaultId=getDefaultScaleIDFromAxis(axis,chartIndexAxis),defaultScaleOptions=chartDefaults.scales||{};firstIDs[axis]=firstIDs[axis]||id,scales2[id]=mergeIf(Object.create(null),[{axis},scaleConf,defaultScaleOptions[axis],defaultScaleOptions[defaultId]])}),config.data.datasets.forEach(dataset=>{const type=dataset.type||config.type,indexAxis=dataset.indexAxis||getIndexAxis(type,options),defaultScaleOptions=(overrides[type]||{}).scales||{};Object.keys(defaultScaleOptions).forEach(defaultID=>{const axis=getAxisFromDefaultScaleID(defaultID,indexAxis),id=dataset[axis+"AxisID"]||firstIDs[axis]||axis;scales2[id]=scales2[id]||Object.create(null),mergeIf(scales2[id],[{axis},configScales[id],defaultScaleOptions[defaultID]])})}),Object.keys(scales2).forEach(key=>{const scale=scales2[key];mergeIf(scale,[defaults.scales[scale.type],defaults.scale])}),scales2}function initOptions(config){const options=config.options||(config.options={});options.plugins=valueOrDefault(options.plugins,{}),options.scales=mergeScaleConfig(config,options)}function initData(data){return(data=data||{}).datasets=data.datasets||[],data.labels=data.labels||[],data}function initConfig(config){return(config=config||{}).data=initData(config.data),initOptions(config),config}__name(PluginService,"PluginService"),__name(allPlugins,"allPlugins"),__name(getOpts,"getOpts"),__name(createDescriptors,"createDescriptors"),__name(pluginOpts,"pluginOpts"),__name(getIndexAxis,"getIndexAxis"),__name(getAxisFromDefaultScaleID,"getAxisFromDefaultScaleID"),__name(getDefaultScaleIDFromAxis,"getDefaultScaleIDFromAxis"),__name(axisFromPosition,"axisFromPosition"),__name(determineAxis,"determineAxis"),__name(mergeScaleConfig,"mergeScaleConfig"),__name(initOptions,"initOptions"),__name(initData,"initData"),__name(initConfig,"initConfig");const keyCache=new Map,keysCached=new Set;function cachedKeys(cacheKey,generate){let keys=keyCache.get(cacheKey);return keys||(keys=generate(),keyCache.set(cacheKey,keys),keysCached.add(keys)),keys}__name(cachedKeys,"cachedKeys");const addIfFound=__name((set2,obj,key)=>{const opts=resolveObjectKey(obj,key);void 0!==opts&&set2.add(opts)},"addIfFound");class Config{constructor(config){this._config=initConfig(config),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(type){this._config.type=type}get data(){return this._config.data}set data(data){this._config.data=initData(data)}get options(){return this._config.options}set options(options){this._config.options=options}get plugins(){return this._config.plugins}update(){const config=this._config;this.clearCache(),initOptions(config)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(datasetType){return cachedKeys(datasetType,()=>[[`datasets.${datasetType}`,""]])}datasetAnimationScopeKeys(datasetType,transition){return cachedKeys(`${datasetType}.transition.${transition}`,()=>[[`datasets.${datasetType}.transitions.${transition}`,`transitions.${transition}`],[`datasets.${datasetType}`,""]])}datasetElementScopeKeys(datasetType,elementType){return cachedKeys(`${datasetType}-${elementType}`,()=>[[`datasets.${datasetType}.elements.${elementType}`,`datasets.${datasetType}`,`elements.${elementType}`,""]])}pluginScopeKeys(plugin){const id=plugin.id;return cachedKeys(`${this.type}-plugin-${id}`,()=>[[`plugins.${id}`,...plugin.additionalOptionScopes||[]]])}_cachedScopes(mainScope,resetCache){const _scopeCache=this._scopeCache;let cache=_scopeCache.get(mainScope);return(!cache||resetCache)&&(cache=new Map,_scopeCache.set(mainScope,cache)),cache}getOptionScopes(mainScope,keyLists,resetCache){const{options,type}=this,cache=this._cachedScopes(mainScope,resetCache),cached=cache.get(keyLists);if(cached)return cached;const scopes=new Set;keyLists.forEach(keys=>{mainScope&&(scopes.add(mainScope),keys.forEach(key=>addIfFound(scopes,mainScope,key))),keys.forEach(key=>addIfFound(scopes,options,key)),keys.forEach(key=>addIfFound(scopes,overrides[type]||{},key)),keys.forEach(key=>addIfFound(scopes,defaults,key)),keys.forEach(key=>addIfFound(scopes,descriptors,key))});const array=Array.from(scopes);return 0===array.length&&array.push(Object.create(null)),keysCached.has(keyLists)&&cache.set(keyLists,array),array}chartOptionScopes(){const{options,type}=this;return[options,overrides[type]||{},defaults.datasets[type]||{},{type},defaults,descriptors]}resolveNamedOptions(scopes,names2,context,prefixes=[""]){const result={$shared:!0},{resolver,subPrefixes}=getResolver(this._resolverCache,scopes,prefixes);let options=resolver;if(needContext(resolver,names2)){result.$shared=!1;options=_attachContext(resolver,context=isFunction(context)?context():context,this.createResolver(scopes,context,subPrefixes))}for(const prop of names2)result[prop]=options[prop];return result}createResolver(scopes,context,prefixes=[""],descriptorDefaults){const{resolver}=getResolver(this._resolverCache,scopes,prefixes);return isObject(context)?_attachContext(resolver,context,void 0,descriptorDefaults):resolver}}function getResolver(resolverCache,scopes,prefixes){let cache=resolverCache.get(scopes);cache||(cache=new Map,resolverCache.set(scopes,cache));const cacheKey=prefixes.join();let cached=cache.get(cacheKey);return cached||(cached={resolver:_createResolver(scopes,prefixes),subPrefixes:prefixes.filter(p=>!p.toLowerCase().includes("hover"))},cache.set(cacheKey,cached)),cached}__name(Config,"Config"),__name(getResolver,"getResolver");const hasFunction=__name(value=>isObject(value)&&Object.getOwnPropertyNames(value).reduce((acc,key)=>acc||isFunction(value[key]),!1),"hasFunction");function needContext(proxy,names2){const{isScriptable,isIndexable}=_descriptors(proxy);for(const prop of names2){const scriptable=isScriptable(prop),indexable=isIndexable(prop),value=(indexable||scriptable)&&proxy[prop];if(scriptable&&(isFunction(value)||hasFunction(value))||indexable&&isArray(value))return!0}return!1}__name(needContext,"needContext");const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(position,axis){return"top"===position||"bottom"===position||-1===KNOWN_POSITIONS.indexOf(position)&&"x"===axis}function compare2Level(l1,l2){return function(a2,b2){return a2[l1]===b2[l1]?a2[l2]-b2[l2]:a2[l1]-b2[l1]}}function onAnimationsComplete(context){const chart=context.chart,animationOptions2=chart.options.animation;chart.notifyPlugins("afterRender"),callback(animationOptions2&&animationOptions2.onComplete,[context],chart)}function onAnimationProgress(context){const chart=context.chart,animationOptions2=chart.options.animation;callback(animationOptions2&&animationOptions2.onProgress,[context],chart)}function getCanvas(item){return _isDomSupported()&&"string"==typeof item?item=document.getElementById(item):item&&item.length&&(item=item[0]),item&&item.canvas&&(item=item.canvas),item}__name(positionIsHorizontal,"positionIsHorizontal"),__name(compare2Level,"compare2Level"),__name(onAnimationsComplete,"onAnimationsComplete"),__name(onAnimationProgress,"onAnimationProgress"),__name(getCanvas,"getCanvas");const instances={},getChart=__name(key=>{const canvas=getCanvas(key);return Object.values(instances).filter(c2=>c2.canvas===canvas).pop()},"getChart");function moveNumericKeys(obj,start,move){const keys=Object.keys(obj);for(const key of keys){const intKey=+key;if(intKey>=start){const value=obj[key];delete obj[key],(move>0||intKey>start)&&(obj[intKey+move]=value)}}}function determineLastEvent(e2,lastEvent,inChartArea,isClick){return inChartArea&&"mouseout"!==e2.type?isClick?lastEvent:e2:null}__name(moveNumericKeys,"moveNumericKeys"),__name(determineLastEvent,"determineLastEvent");class Chart{constructor(item,userConfig){const config=this.config=new Config(userConfig),initialCanvas=getCanvas(item),existingChart=getChart(initialCanvas);if(existingChart)throw new Error("Canvas is already in use. Chart with ID '"+existingChart.id+"' must be destroyed before the canvas can be reused.");const options=config.createResolver(config.chartOptionScopes(),this.getContext());this.platform=new(config.platform||_detectPlatform(initialCanvas)),this.platform.updateConfig(config);const context=this.platform.acquireContext(initialCanvas,options.aspectRatio),canvas=context&&context.canvas,height=canvas&&canvas.height,width=canvas&&canvas.width;this.id=uid(),this.ctx=context,this.canvas=canvas,this.width=width,this.height=height,this._options=options,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 PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce(mode=>this.update(mode),options.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,context&&canvas?(animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio,maintainAspectRatio},width,height,_aspectRatio}=this;return isNullOrUndef(aspectRatio)?maintainAspectRatio&&_aspectRatio?_aspectRatio:height?width/height:null:aspectRatio}get data(){return this.config.data}set data(data){this.config.data=data}get options(){return this._options}set options(options){this.config.options=options}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(width,height){animator.running(this)?this._resizeBeforeDraw={width,height}:this._resize(width,height)}_resize(width,height){const options=this.options,canvas=this.canvas,aspectRatio=options.maintainAspectRatio&&this.aspectRatio,newSize=this.platform.getMaximumSize(canvas,width,height,aspectRatio),newRatio=options.devicePixelRatio||this.platform.getDevicePixelRatio(),mode=this.width?"resize":"attach";this.width=newSize.width,this.height=newSize.height,this._aspectRatio=this.aspectRatio,retinaScale(this,newRatio,!0)&&(this.notifyPlugins("resize",{size:newSize}),callback(options.onResize,[this,newSize],this),this.attached&&this._doResize(mode)&&this.render())}ensureScalesHaveIDs(){each(this.options.scales||{},(axisOptions,axisID)=>{axisOptions.id=axisID})}buildOrUpdateScales(){const options=this.options,scaleOpts=options.scales,scales2=this.scales,updated=Object.keys(scales2).reduce((obj,id)=>(obj[id]=!1,obj),{});let items=[];scaleOpts&&(items=items.concat(Object.keys(scaleOpts).map(id=>{const scaleOptions=scaleOpts[id],axis=determineAxis(id,scaleOptions),isRadial="r"===axis,isHorizontal="x"===axis;return{options:scaleOptions,dposition:isRadial?"chartArea":isHorizontal?"bottom":"left",dtype:isRadial?"radialLinear":isHorizontal?"category":"linear"}}))),each(items,item=>{const scaleOptions=item.options,id=scaleOptions.id,axis=determineAxis(id,scaleOptions),scaleType=valueOrDefault(scaleOptions.type,item.dtype);(void 0===scaleOptions.position||positionIsHorizontal(scaleOptions.position,axis)!==positionIsHorizontal(item.dposition))&&(scaleOptions.position=item.dposition),updated[id]=!0;let scale=null;if(id in scales2&&scales2[id].type===scaleType)scale=scales2[id];else{scale=new(registry.getScale(scaleType))({id,type:scaleType,ctx:this.ctx,chart:this}),scales2[scale.id]=scale}scale.init(scaleOptions,options)}),each(updated,(hasUpdated,id)=>{hasUpdated||delete scales2[id]}),each(scales2,scale=>{layouts.configure(this,scale,scale.options),layouts.addBox(this,scale)})}_updateMetasets(){const metasets=this._metasets,numData=this.data.datasets.length,numMeta=metasets.length;if(metasets.sort((a2,b2)=>a2.index-b2.index),numMeta>numData){for(let i=numData;idatasets.length&&delete this._stacks,metasets.forEach((meta,index2)=>{0===datasets.filter(x=>x===meta._dataset).length&&this._destroyDatasetMeta(index2)})}buildOrUpdateControllers(){const newControllers=[],datasets=this.data.datasets;let i,ilen;for(this._removeUnreferencedMetasets(),i=0,ilen=datasets.length;i{this.getDatasetMeta(datasetIndex).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(mode){const config=this.config;config.update();const options=this._options=config.createResolver(config.chartOptionScopes(),this.getContext()),animsDisabled=this._animationsDisabled=!options.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode,cancelable:!0}))return;const newControllers=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let minPadding=0;for(let i=0,ilen=this.data.datasets.length;i{controller.reset()}),this._updateDatasets(mode),this.notifyPlugins("afterUpdate",{mode}),this._layers.sort(compare2Level("z","_idx"));const{_active,_lastEvent}=this;_lastEvent?this._eventHandler(_lastEvent,!0):_active.length&&this._updateHoverStyles(_active,_active,!0),this.render()}_updateScales(){each(this.scales,scale=>{layouts.removeBox(this,scale)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const options=this.options,existingEvents=new Set(Object.keys(this._listeners)),newEvents=new Set(options.events);(!setsEqual(existingEvents,newEvents)||!!this._responsiveListeners!==options.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices}=this,changes=this._getUniformDataChanges()||[];for(const{method,start,count}of changes){moveNumericKeys(_hiddenIndices,start,"_removeElements"===method?-count:count)}}_getUniformDataChanges(){const _dataChanges=this._dataChanges;if(!_dataChanges||!_dataChanges.length)return;this._dataChanges=[];const datasetCount=this.data.datasets.length,makeSet=__name(idx=>new Set(_dataChanges.filter(c2=>c2[0]===idx).map((c2,i)=>i+","+c2.splice(1).join(","))),"makeSet"),changeSet=makeSet(0);for(let i=1;ic2.split(",")).map(a2=>({method:a2[1],start:+a2[2],count:+a2[3]}))}_updateLayout(minPadding){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;layouts.update(this,this.width,this.height,minPadding);const area=this.chartArea,noArea=area.width<=0||area.height<=0;this._layers=[],each(this.boxes,box=>{noArea&&"chartArea"===box.position||(box.configure&&box.configure(),this._layers.push(...box._layers()))},this),this._layers.forEach((item,index2)=>{item._idx=index2}),this.notifyPlugins("afterLayout")}_updateDatasets(mode){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode,cancelable:!0})){for(let i=0,ilen=this.data.datasets.length;i=0;--i)this._drawDataset(metasets[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(meta){const ctx=this.ctx,clip=meta._clip,useClip=!clip.disabled,area=this.chartArea,args={meta,index:meta.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",args)&&(useClip&&clipArea(ctx,{left:!1===clip.left?0:area.left-clip.left,right:!1===clip.right?this.width:area.right+clip.right,top:!1===clip.top?0:area.top-clip.top,bottom:!1===clip.bottom?this.height:area.bottom+clip.bottom}),meta.controller.draw(),useClip&&unclipArea(ctx),args.cancelable=!1,this.notifyPlugins("afterDatasetDraw",args))}isPointInArea(point){return _isPointInArea(point,this.chartArea,this._minPadding)}getElementsAtEventForMode(e2,mode,options,useFinalPosition){const method=Interaction.modes[mode];return"function"==typeof method?method(this,e2,options,useFinalPosition):[]}getDatasetMeta(datasetIndex){const dataset=this.data.datasets[datasetIndex],metasets=this._metasets;let meta=metasets.filter(x=>x&&x._dataset===dataset).pop();return meta||(meta={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:dataset&&dataset.order||0,index:datasetIndex,_dataset:dataset,_parsed:[],_sorted:!1},metasets.push(meta)),meta}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(datasetIndex){const dataset=this.data.datasets[datasetIndex];if(!dataset)return!1;const meta=this.getDatasetMeta(datasetIndex);return"boolean"==typeof meta.hidden?!meta.hidden:!dataset.hidden}setDatasetVisibility(datasetIndex,visible){this.getDatasetMeta(datasetIndex).hidden=!visible}toggleDataVisibility(index2){this._hiddenIndices[index2]=!this._hiddenIndices[index2]}getDataVisibility(index2){return!this._hiddenIndices[index2]}_updateVisibility(datasetIndex,dataIndex,visible){const mode=visible?"show":"hide",meta=this.getDatasetMeta(datasetIndex),anims=meta.controller._resolveAnimations(void 0,mode);defined(dataIndex)?(meta.data[dataIndex].hidden=!visible,this.update()):(this.setDatasetVisibility(datasetIndex,visible),anims.update(meta,{visible}),this.update(ctx=>ctx.datasetIndex===datasetIndex?mode:void 0))}hide(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!1)}show(datasetIndex,dataIndex){this._updateVisibility(datasetIndex,dataIndex,!0)}_destroyDatasetMeta(datasetIndex){const meta=this._metasets[datasetIndex];meta&&meta.controller&&meta.controller._destroy(),delete this._metasets[datasetIndex]}_stop(){let i,ilen;for(this.stop(),animator.remove(this),i=0,ilen=this.data.datasets.length;i{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),listener=__name((e2,x,y)=>{e2.offsetX=x,e2.offsetY=y,this._eventHandler(e2)},"listener");each(this.options.events,type=>_add(type,listener))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const listeners=this._responsiveListeners,platform=this.platform,_add=__name((type,listener2)=>{platform.addEventListener(this,type,listener2),listeners[type]=listener2},"_add"),_remove=__name((type,listener2)=>{listeners[type]&&(platform.removeEventListener(this,type,listener2),delete listeners[type])},"_remove"),listener=__name((width,height)=>{this.canvas&&this.resize(width,height)},"listener");let detached;const attached=__name(()=>{_remove("attach",attached),this.attached=!0,this.resize(),_add("resize",listener),_add("detach",detached)},"attached");detached=__name(()=>{this.attached=!1,_remove("resize",listener),this._stop(),this._resize(0,0),_add("attach",attached)},"detached"),platform.isAttached(this.canvas)?attached():detached()}unbindEvents(){each(this._listeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._listeners={},each(this._responsiveListeners,(listener,type)=>{this.platform.removeEventListener(this,type,listener)}),this._responsiveListeners=void 0}updateHoverStyle(items,mode,enabled){const prefix=enabled?"set":"remove";let meta,item,i,ilen;for("dataset"===mode&&(meta=this.getDatasetMeta(items[0].datasetIndex),meta.controller["_"+prefix+"DatasetHoverStyle"]()),i=0,ilen=items.length;i{const meta=this.getDatasetMeta(datasetIndex);if(!meta)throw new Error("No dataset found at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}});!_elementsEqual(active,lastActive)&&(this._active=active,this._lastEvent=null,this._updateHoverStyles(active,lastActive))}notifyPlugins(hook,args,filter){return this._plugins.notify(this,hook,args,filter)}_updateHoverStyles(active,lastActive,replay){const hoverOptions=this.options.hover,diff=__name((a2,b2)=>a2.filter(x=>!b2.some(y=>x.datasetIndex===y.datasetIndex&&x.index===y.index)),"diff"),deactivated=diff(lastActive,active),activated=replay?active:diff(active,lastActive);deactivated.length&&this.updateHoverStyle(deactivated,hoverOptions.mode,!1),activated.length&&hoverOptions.mode&&this.updateHoverStyle(activated,hoverOptions.mode,!0)}_eventHandler(e2,replay){const args={event:e2,replay,cancelable:!0,inChartArea:this.isPointInArea(e2)},eventFilter=__name(plugin=>(plugin.options.events||this.options.events).includes(e2.native.type),"eventFilter");if(!1===this.notifyPlugins("beforeEvent",args,eventFilter))return;const changed=this._handleEvent(e2,replay,args.inChartArea);return args.cancelable=!1,this.notifyPlugins("afterEvent",args,eventFilter),(changed||args.changed)&&this.render(),this}_handleEvent(e2,replay,inChartArea){const{_active:lastActive=[],options}=this,useFinalPosition=replay,active=this._getActiveElements(e2,lastActive,inChartArea,useFinalPosition),isClick=_isClickEvent(e2),lastEvent=determineLastEvent(e2,this._lastEvent,inChartArea,isClick);inChartArea&&(this._lastEvent=null,callback(options.onHover,[e2,active,this],this),isClick&&callback(options.onClick,[e2,active,this],this));const changed=!_elementsEqual(active,lastActive);return(changed||replay)&&(this._active=active,this._updateHoverStyles(active,lastActive,replay)),this._lastEvent=lastEvent,changed}_getActiveElements(e2,lastActive,inChartArea,useFinalPosition){if("mouseout"===e2.type)return[];if(!inChartArea)return lastActive;const hoverOptions=this.options.hover;return this.getElementsAtEventForMode(e2,hoverOptions.mode,hoverOptions,useFinalPosition)}}__name(Chart,"Chart");const invalidatePlugins=__name(()=>each(Chart.instances,chart=>chart._plugins.invalidate()),"invalidatePlugins");function clipArc(ctx,element,endAngle){const{startAngle,pixelMargin,x,y,outerRadius,innerRadius}=element;let angleMargin=pixelMargin/outerRadius;ctx.beginPath(),ctx.arc(x,y,outerRadius,startAngle-angleMargin,endAngle+angleMargin),innerRadius>pixelMargin?(angleMargin=pixelMargin/innerRadius,ctx.arc(x,y,innerRadius,endAngle+angleMargin,startAngle-angleMargin,!0)):ctx.arc(x,y,pixelMargin,endAngle+HALF_PI,startAngle-HALF_PI),ctx.closePath(),ctx.clip()}function toRadiusCorners(value){return _readValueToProps(value,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(arc,innerRadius,outerRadius,angleDelta){const o=toRadiusCorners(arc.options.borderRadius),halfThickness=(outerRadius-innerRadius)/2,innerLimit=Math.min(halfThickness,angleDelta*innerRadius/2),computeOuterLimit=__name(val=>{const outerArcLimit=(outerRadius-Math.min(halfThickness,val))*angleDelta/2;return _limitValue(val,0,Math.min(halfThickness,outerArcLimit))},"computeOuterLimit");return{outerStart:computeOuterLimit(o.outerStart),outerEnd:computeOuterLimit(o.outerEnd),innerStart:_limitValue(o.innerStart,0,innerLimit),innerEnd:_limitValue(o.innerEnd,0,innerLimit)}}function rThetaToXY(r,theta,x,y){return{x:x+r*Math.cos(theta),y:y+r*Math.sin(theta)}}function pathArc(ctx,element,offset,spacing,end){const{x,y,startAngle:start,pixelMargin,innerRadius:innerR}=element,outerRadius=Math.max(element.outerRadius+spacing+offset-pixelMargin,0),innerRadius=innerR>0?innerR+spacing+offset+pixelMargin:0;let spacingOffset=0;const alpha2=end-start;if(spacing){const avNogSpacingRadius=((innerR>0?innerR-spacing:0)+(outerRadius>0?outerRadius-spacing:0))/2;spacingOffset=(alpha2-(0!==avNogSpacingRadius?alpha2*avNogSpacingRadius/(avNogSpacingRadius+spacing):alpha2))/2}const angleOffset=(alpha2-Math.max(.001,alpha2*outerRadius-offset/PI)/outerRadius)/2,startAngle=start+angleOffset+spacingOffset,endAngle=end-angleOffset-spacingOffset,{outerStart,outerEnd,innerStart,innerEnd}=parseBorderRadius$1(element,innerRadius,outerRadius,endAngle-startAngle),outerStartAdjustedRadius=outerRadius-outerStart,outerEndAdjustedRadius=outerRadius-outerEnd,outerStartAdjustedAngle=startAngle+outerStart/outerStartAdjustedRadius,outerEndAdjustedAngle=endAngle-outerEnd/outerEndAdjustedRadius,innerStartAdjustedRadius=innerRadius+innerStart,innerEndAdjustedRadius=innerRadius+innerEnd,innerStartAdjustedAngle=startAngle+innerStart/innerStartAdjustedRadius,innerEndAdjustedAngle=endAngle-innerEnd/innerEndAdjustedRadius;if(ctx.beginPath(),ctx.arc(x,y,outerRadius,outerStartAdjustedAngle,outerEndAdjustedAngle),outerEnd>0){const pCenter=rThetaToXY(outerEndAdjustedRadius,outerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerEnd,outerEndAdjustedAngle,endAngle+HALF_PI)}const p4=rThetaToXY(innerEndAdjustedRadius,endAngle,x,y);if(ctx.lineTo(p4.x,p4.y),innerEnd>0){const pCenter=rThetaToXY(innerEndAdjustedRadius,innerEndAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerEnd,endAngle+HALF_PI,innerEndAdjustedAngle+Math.PI)}if(ctx.arc(x,y,innerRadius,endAngle-innerEnd/innerRadius,startAngle+innerStart/innerRadius,!0),innerStart>0){const pCenter=rThetaToXY(innerStartAdjustedRadius,innerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,innerStart,innerStartAdjustedAngle+Math.PI,startAngle-HALF_PI)}const p8=rThetaToXY(outerStartAdjustedRadius,startAngle,x,y);if(ctx.lineTo(p8.x,p8.y),outerStart>0){const pCenter=rThetaToXY(outerStartAdjustedRadius,outerStartAdjustedAngle,x,y);ctx.arc(pCenter.x,pCenter.y,outerStart,startAngle-HALF_PI,outerStartAdjustedAngle)}ctx.closePath()}function drawArc(ctx,element,offset,spacing){const{fullCircles,startAngle,circumference}=element;let endAngle=element.endAngle;if(fullCircles){pathArc(ctx,element,offset,spacing,startAngle+TAU);for(let i=0;i{registry.add(...items),invalidatePlugins()}},unregister:{enumerable:true,value:(...items)=>{registry.remove(...items),invalidatePlugins()}}}),__name(clipArc,"clipArc"),__name(toRadiusCorners,"toRadiusCorners"),__name(parseBorderRadius$1,"parseBorderRadius$1"),__name(rThetaToXY,"rThetaToXY"),__name(pathArc,"pathArc"),__name(drawArc,"drawArc"),__name(drawFullCircleBorders,"drawFullCircleBorders"),__name(drawBorder,"drawBorder");class ArcElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}inRange(chartX,chartY,useFinalPosition){const point=this.getProps(["x","y"],useFinalPosition),{angle,distance}=getAngleFromPoint(point,{x:chartX,y:chartY}),{startAngle,endAngle,innerRadius,outerRadius,circumference}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),rAdjust=this.options.spacing/2,betweenAngles=valueOrDefault(circumference,endAngle-startAngle)>=TAU||_angleBetween(angle,startAngle,endAngle),withinRadius=_isBetween(distance,innerRadius+rAdjust,outerRadius+rAdjust);return betweenAngles&&withinRadius}getCenterPoint(useFinalPosition){const{x,y,startAngle,endAngle,innerRadius,outerRadius}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],useFinalPosition),{offset,spacing}=this.options,halfAngle=(startAngle+endAngle)/2,halfRadius=(innerRadius+outerRadius+spacing+offset)/2;return{x:x+Math.cos(halfAngle)*halfRadius,y:y+Math.sin(halfAngle)*halfRadius}}tooltipPosition(useFinalPosition){return this.getCenterPoint(useFinalPosition)}draw(ctx){const{options,circumference}=this,offset=(options.offset||0)/2,spacing=(options.spacing||0)/2;if(this.pixelMargin="inner"===options.borderAlign?.33:0,this.fullCircles=circumference>TAU?Math.floor(circumference/TAU):0,0===circumference||this.innerRadius<0||this.outerRadius<0)return;ctx.save();let radiusOffset=0;if(offset){radiusOffset=offset/2;const halfAngle=(this.startAngle+this.endAngle)/2;ctx.translate(Math.cos(halfAngle)*radiusOffset,Math.sin(halfAngle)*radiusOffset),this.circumference>=PI&&(radiusOffset=offset)}ctx.fillStyle=options.backgroundColor,ctx.strokeStyle=options.borderColor;drawBorder(ctx,this,radiusOffset,spacing,drawArc(ctx,this,radiusOffset,spacing)),ctx.restore()}}function setStyle(ctx,options,style=options){ctx.lineCap=valueOrDefault(style.borderCapStyle,options.borderCapStyle),ctx.setLineDash(valueOrDefault(style.borderDash,options.borderDash)),ctx.lineDashOffset=valueOrDefault(style.borderDashOffset,options.borderDashOffset),ctx.lineJoin=valueOrDefault(style.borderJoinStyle,options.borderJoinStyle),ctx.lineWidth=valueOrDefault(style.borderWidth,options.borderWidth),ctx.strokeStyle=valueOrDefault(style.borderColor,options.borderColor)}function lineTo(ctx,previous,target){ctx.lineTo(target.x,target.y)}function getLineMethod(options){return options.stepped?_steppedLineTo:options.tension||"monotone"===options.cubicInterpolationMode?_bezierCurveTo:lineTo}function pathVars(points,segment,params={}){const count=points.length,{start:paramsStart=0,end:paramsEnd=count-1}=params,{start:segmentStart,end:segmentEnd}=segment,start=Math.max(paramsStart,segmentStart),end=Math.min(paramsEnd,segmentEnd),outside=paramsStartsegmentEnd&¶msEnd>segmentEnd;return{count,start,loop:segment.loop,ilen:end(start+(reverse?ilen-index2:index2))%count,"pointIndex"),drawX=__name(()=>{minY!==maxY&&(ctx.lineTo(avgX,maxY),ctx.lineTo(avgX,minY),ctx.lineTo(avgX,lastY))},"drawX");for(move&&(point=points[pointIndex(0)],ctx.moveTo(point.x,point.y)),i=0;i<=ilen;++i){if(point=points[pointIndex(i)],point.skip)continue;const x=point.x,y=point.y,truncX=0|x;truncX===prevX?(ymaxY&&(maxY=y),avgX=(countX*avgX+x)/++countX):(drawX(),ctx.lineTo(x,y),prevX=truncX,countX=0,minY=maxY=y),lastY=y}drawX()}function _getSegmentMethod(line){const opts=line.options,borderDash=opts.borderDash&&opts.borderDash.length;return line._decimated||line._loop||opts.tension||"monotone"===opts.cubicInterpolationMode||opts.stepped||borderDash?pathSegment:fastPathSegment}function _getInterpolationMethod(options){return options.stepped?_steppedInterpolation:options.tension||"monotone"===options.cubicInterpolationMode?_bezierInterpolation:_pointInLine}function strokePathWithCache(ctx,line,start,count){let path=line._path;path||(path=line._path=new Path2D,line.path(path,start,count)&&path.closePath()),setStyle(ctx,line.options),ctx.stroke(path)}function strokePathDirect(ctx,line,start,count){const{segments,options}=line,segmentMethod=_getSegmentMethod(line);for(const segment of segments)setStyle(ctx,options,segment.style),ctx.beginPath(),segmentMethod(ctx,line,segment,{start,end:start+count-1})&&ctx.closePath(),ctx.stroke()}__name(ArcElement,"ArcElement"),ArcElement.id="arc",ArcElement.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},ArcElement.defaultRoutes={backgroundColor:"backgroundColor"},__name(setStyle,"setStyle"),__name(lineTo,"lineTo"),__name(getLineMethod,"getLineMethod"),__name(pathVars,"pathVars"),__name(pathSegment,"pathSegment"),__name(fastPathSegment,"fastPathSegment"),__name(_getSegmentMethod,"_getSegmentMethod"),__name(_getInterpolationMethod,"_getInterpolationMethod"),__name(strokePathWithCache,"strokePathWithCache"),__name(strokePathDirect,"strokePathDirect");const usePath2D="function"==typeof Path2D;function draw(ctx,line,start,count){usePath2D&&!line.options.segment?strokePathWithCache(ctx,line,start,count):strokePathDirect(ctx,line,start,count)}__name(draw,"draw");class LineElement extends Element{constructor(cfg){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,cfg&&Object.assign(this,cfg)}updateControlPoints(chartArea,indexAxis){const options=this.options;if((options.tension||"monotone"===options.cubicInterpolationMode)&&!options.stepped&&!this._pointsUpdated){const loop=options.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,options,chartArea,loop,indexAxis),this._pointsUpdated=!0}}set points(points){this._points=points,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const segments=this.segments,points=this.points;return segments.length&&points[segments[0].start]}last(){const segments=this.segments,points=this.points,count=segments.length;return count&&points[segments[count-1].end]}interpolate(point,property){const options=this.options,value=point[property],points=this.points,segments=_boundSegments(this,{property,start:value,end:value});if(!segments.length)return;const result=[],_interpolate=_getInterpolationMethod(options);let i,ilen;for(i=0,ilen=segments.length;i"borderDash"!==name&&"fill"!==name},__name(inRange$1,"inRange$1");class PointElement extends Element{constructor(cfg){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,cfg&&Object.assign(this,cfg)}inRange(mouseX,mouseY,useFinalPosition){const options=this.options,{x,y}=this.getProps(["x","y"],useFinalPosition);return Math.pow(mouseX-x,2)+Math.pow(mouseY-y,2)=count)return data.slice(start,start+count);const decimated=[],bucketWidth=(count-2)/(samples-2);let sampledIndex=0;const endIndex=start+count-1;let i,maxAreaPoint,maxArea,area,nextA,a2=start;for(decimated[sampledIndex++]=data[a2],i=0;imaxArea&&(maxArea=area,maxAreaPoint=data[j],nextA=j);decimated[sampledIndex++]=maxAreaPoint,a2=nextA}return decimated[sampledIndex++]=data[endIndex],decimated}function minMaxDecimation(data,start,count,availableWidth){let i,point,x,y,prevX,minIndex,maxIndex,startIndex,minY,maxY,avgX=0,countX=0;const decimated=[],endIndex=start+count-1,xMin=data[start].x,dx=data[endIndex].x-xMin;for(i=start;imaxY&&(maxY=y,maxIndex=i),avgX=(countX*avgX+point.x)/++countX;else{const lastIndex=i-1;if(!isNullOrUndef(minIndex)&&!isNullOrUndef(maxIndex)){const intermediateIndex1=Math.min(minIndex,maxIndex),intermediateIndex2=Math.max(minIndex,maxIndex);intermediateIndex1!==startIndex&&intermediateIndex1!==lastIndex&&decimated.push({...data[intermediateIndex1],x:avgX}),intermediateIndex2!==startIndex&&intermediateIndex2!==lastIndex&&decimated.push({...data[intermediateIndex2],x:avgX})}i>0&&lastIndex!==startIndex&&decimated.push(data[lastIndex]),decimated.push(point),prevX=truncX,countX=0,minY=maxY=y,minIndex=maxIndex=startIndex=i}}return decimated}function cleanDecimatedDataset(dataset){if(dataset._decimated){const data=dataset._data;delete dataset._decimated,delete dataset._data,Object.defineProperty(dataset,"data",{value:data})}}function cleanDecimatedData(chart){chart.data.datasets.forEach(dataset=>{cleanDecimatedDataset(dataset)})}function getStartAndCountOfVisiblePointsSimplified(meta,points){const pointCount=points.length;let count,start=0;const{iScale}=meta,{min,max,minDefined,maxDefined}=iScale.getUserBounds();return minDefined&&(start=_limitValue(_lookupByKey(points,iScale.axis,min).lo,0,pointCount-1)),count=maxDefined?_limitValue(_lookupByKey(points,iScale.axis,max).hi+1,start,pointCount)-start:pointCount-start,{start,count}}__name(lttbDecimation,"lttbDecimation"),__name(minMaxDecimation,"minMaxDecimation"),__name(cleanDecimatedDataset,"cleanDecimatedDataset"),__name(cleanDecimatedData,"cleanDecimatedData"),__name(getStartAndCountOfVisiblePointsSimplified,"getStartAndCountOfVisiblePointsSimplified");function _segments(line,target,property){const segments=line.segments,points=line.points,tpoints=target.points,parts=[];for(const segment of segments){let{start,end}=segment;end=_findSegmentEnd(start,end,points);const bounds=_getBounds(property,points[start],points[end],segment.loop);if(!target.segments){parts.push({source:segment,target:bounds,start:points[start],end:points[end]});continue}const targetSegments=_boundSegments(target,bounds);for(const tgt of targetSegments){const subBounds=_getBounds(property,tpoints[tgt.start],tpoints[tgt.end],tgt.loop),fillSources=_boundSegment(segment,points,subBounds);for(const fillSource of fillSources)parts.push({source:fillSource,target:tgt,start:{[property]:_getEdge(bounds,subBounds,"start",Math.max)},end:{[property]:_getEdge(bounds,subBounds,"end",Math.min)}})}}return parts}function _getBounds(property,first,last,loop){if(loop)return;let start=first[property],end=last[property];return"angle"===property&&(start=_normalizeAngle(start),end=_normalizeAngle(end)),{property,start,end}}function _pointsFromSegments(boundary,line){const{x=null,y=null}=boundary||{},linePoints=line.points,points=[];return line.segments.forEach(({start,end})=>{end=_findSegmentEnd(start,end,linePoints);const first=linePoints[start],last=linePoints[end];null!==y?(points.push({x:first.x,y}),points.push({x:last.x,y})):null!==x&&(points.push({x,y:first.y}),points.push({x,y:last.y}))}),points}function _findSegmentEnd(start,end,points){for(;end>start;end--){const point=points[end];if(!isNaN(point.x)&&!isNaN(point.y))break}return end}function _getEdge(a2,b2,prop,fn){return a2&&b2?fn(a2[prop],b2[prop]):a2?a2[prop]:b2?b2[prop]:0}function _createBoundaryLine(boundary,line){let points=[],_loop=!1;return isArray(boundary)?(_loop=!0,points=boundary):points=_pointsFromSegments(boundary,line),points.length?new LineElement({points,options:{tension:0},_loop,_fullLoop:_loop}):null}function _resolveTarget(sources,index2,propagate){let fill2=sources[index2].fill;const visited=[index2];let target;if(!propagate)return fill2;for(;!1!==fill2&&-1===visited.indexOf(fill2);){if(!isNumberFinite(fill2))return fill2;if(target=sources[fill2],!target)return!1;if(target.visible)return fill2;visited.push(fill2),fill2=target.fill}return!1}function _decodeFill(line,index2,count){const fill2=parseFillOption(line);if(isObject(fill2))return!isNaN(fill2.value)&&fill2;let target=parseFloat(fill2);return isNumberFinite(target)&&Math.floor(target)===target?decodeTargetIndex(fill2[0],index2,target,count):["origin","start","end","stack","shape"].indexOf(fill2)>=0&&fill2}function decodeTargetIndex(firstCh,index2,target,count){return("-"===firstCh||"+"===firstCh)&&(target=index2+target),!(target===index2||target<0||target>=count)&&target}function _getTargetPixel(fill2,scale){let pixel=null;return"start"===fill2?pixel=scale.bottom:"end"===fill2?pixel=scale.top:isObject(fill2)?pixel=scale.getPixelForValue(fill2.value):scale.getBasePixel&&(pixel=scale.getBasePixel()),pixel}function _getTargetValue(fill2,scale,startValue){let value;return value="start"===fill2?startValue:"end"===fill2?scale.options.reverse?scale.min:scale.max:isObject(fill2)?fill2.value:scale.getBaseValue(),value}function parseFillOption(line){const options=line.options,fillOption=options.fill;let fill2=valueOrDefault(fillOption&&fillOption.target,fillOption);return void 0===fill2&&(fill2=!!options.backgroundColor),!1!==fill2&&null!==fill2&&(!0===fill2?"origin":fill2)}function _buildStackLine(source){const{scale,index:index2,line}=source,points=[],segments=line.segments,sourcePoints=line.points,linesBelow=getLinesBelow(scale,index2);linesBelow.push(_createBoundaryLine({x:null,y:scale.bottom},line));for(let i=0;i=0;--i){const source=metasets[i].$filler;!source||(source.line.updateControlPoints(area,source.axis),draw2&&_drawfill(chart.ctx,source,area))}},beforeDatasetsDraw(chart,_args,options){if("beforeDatasetsDraw"!==options.drawTime)return;const metasets=chart.getSortedVisibleDatasetMetas();for(let i=metasets.length-1;i>=0;--i){const source=metasets[i].$filler;source&&_drawfill(chart.ctx,source,chart.chartArea)}},beforeDatasetDraw(chart,args,options){const source=args.meta.$filler;!source||!1===source.fill||"beforeDatasetDraw"!==options.drawTime||_drawfill(chart.ctx,source,chart.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=__name((labelOpts,fontSize)=>{let{boxHeight=fontSize,boxWidth=fontSize}=labelOpts;return labelOpts.usePointStyle&&(boxHeight=Math.min(boxHeight,fontSize),boxWidth=Math.min(boxWidth,fontSize)),{boxWidth,boxHeight,itemHeight:Math.max(fontSize,boxHeight)}},"getBoxSize"),itemsEqual=__name((a2,b2)=>null!==a2&&null!==b2&&a2.datasetIndex===b2.datasetIndex&&a2.index===b2.index,"itemsEqual");class Legend extends Element{constructor(config){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight,margins){this.maxWidth=maxWidth,this.maxHeight=maxHeight,this._margins=margins,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 labelOpts=this.options.labels||{};let legendItems=callback(labelOpts.generateLabels,[this.chart],this)||[];labelOpts.filter&&(legendItems=legendItems.filter(item=>labelOpts.filter(item,this.chart.data))),labelOpts.sort&&(legendItems=legendItems.sort((a2,b2)=>labelOpts.sort(a2,b2,this.chart.data))),this.options.reverse&&legendItems.reverse(),this.legendItems=legendItems}fit(){const{options,ctx}=this;if(!options.display)return void(this.width=this.height=0);const labelOpts=options.labels,labelFont=toFont(labelOpts.font),fontSize=labelFont.size,titleHeight=this._computeTitleHeight(),{boxWidth,itemHeight}=getBoxSize(labelOpts,fontSize);let width,height;ctx.font=labelFont.string,this.isHorizontal()?(width=this.maxWidth,height=this._fitRows(titleHeight,fontSize,boxWidth,itemHeight)+10):(height=this.maxHeight,width=this._fitCols(titleHeight,fontSize,boxWidth,itemHeight)+10),this.width=Math.min(width,options.maxWidth||this.maxWidth),this.height=Math.min(height,options.maxHeight||this.maxHeight)}_fitRows(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxWidth,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],lineWidths=this.lineWidths=[0],lineHeight=itemHeight+padding;let totalHeight=titleHeight;ctx.textAlign="left",ctx.textBaseline="middle";let row=-1,top=-lineHeight;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;(0===i||lineWidths[lineWidths.length-1]+itemWidth+2*padding>maxWidth)&&(totalHeight+=lineHeight,lineWidths[lineWidths.length-(i>0?0:1)]=0,top+=lineHeight,row++),hitboxes[i]={left:0,top,row,width:itemWidth,height:itemHeight},lineWidths[lineWidths.length-1]+=itemWidth+padding}),totalHeight}_fitCols(titleHeight,fontSize,boxWidth,itemHeight){const{ctx,maxHeight,options:{labels:{padding}}}=this,hitboxes=this.legendHitBoxes=[],columnSizes=this.columnSizes=[],heightLimit=maxHeight-titleHeight;let totalWidth=padding,currentColWidth=0,currentColHeight=0,left=0,col=0;return this.legendItems.forEach((legendItem,i)=>{const itemWidth=boxWidth+fontSize/2+ctx.measureText(legendItem.text).width;i>0&¤tColHeight+itemHeight+2*padding>heightLimit&&(totalWidth+=currentColWidth+padding,columnSizes.push({width:currentColWidth,height:currentColHeight}),left+=currentColWidth+padding,col++,currentColWidth=currentColHeight=0),hitboxes[i]={left,top:currentColHeight,col,width:itemWidth,height:itemHeight},currentColWidth=Math.max(currentColWidth,itemWidth),currentColHeight+=itemHeight+padding}),totalWidth+=currentColWidth,columnSizes.push({width:currentColWidth,height:currentColHeight}),totalWidth}adjustHitBoxes(){if(!this.options.display)return;const titleHeight=this._computeTitleHeight(),{legendHitBoxes:hitboxes,options:{align,labels:{padding},rtl}}=this,rtlHelper=getRtlAdapter(rtl,this.left,this.width);if(this.isHorizontal()){let row=0,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row]);for(const hitbox of hitboxes)row!==hitbox.row&&(row=hitbox.row,left=_alignStartEnd(align,this.left+padding,this.right-this.lineWidths[row])),hitbox.top+=this.top+titleHeight+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(left),hitbox.width),left+=hitbox.width+padding}else{let col=0,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height);for(const hitbox of hitboxes)hitbox.col!==col&&(col=hitbox.col,top=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-this.columnSizes[col].height)),hitbox.top=top,hitbox.left+=this.left+padding,hitbox.left=rtlHelper.leftForLtr(rtlHelper.x(hitbox.left),hitbox.width),top+=hitbox.height+padding}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const ctx=this.ctx;clipArea(ctx,this),this._draw(),unclipArea(ctx)}}_draw(){const{options:opts,columnSizes,lineWidths,ctx}=this,{align,labels:labelOpts}=opts,defaultColor=defaults.color,rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),labelFont=toFont(labelOpts.font),{color:fontColor,padding}=labelOpts,fontSize=labelFont.size,halfFontSize=fontSize/2;let cursor;this.drawTitle(),ctx.textAlign=rtlHelper.textAlign("left"),ctx.textBaseline="middle",ctx.lineWidth=.5,ctx.font=labelFont.string;const{boxWidth,boxHeight,itemHeight}=getBoxSize(labelOpts,fontSize),drawLegendBox=__name(function(x,y,legendItem){if(isNaN(boxWidth)||boxWidth<=0||isNaN(boxHeight)||boxHeight<0)return;ctx.save();const lineWidth=valueOrDefault(legendItem.lineWidth,1);if(ctx.fillStyle=valueOrDefault(legendItem.fillStyle,defaultColor),ctx.lineCap=valueOrDefault(legendItem.lineCap,"butt"),ctx.lineDashOffset=valueOrDefault(legendItem.lineDashOffset,0),ctx.lineJoin=valueOrDefault(legendItem.lineJoin,"miter"),ctx.lineWidth=lineWidth,ctx.strokeStyle=valueOrDefault(legendItem.strokeStyle,defaultColor),ctx.setLineDash(valueOrDefault(legendItem.lineDash,[])),labelOpts.usePointStyle){const drawOptions={radius:boxWidth*Math.SQRT2/2,pointStyle:legendItem.pointStyle,rotation:legendItem.rotation,borderWidth:lineWidth},centerX=rtlHelper.xPlus(x,boxWidth/2);drawPoint(ctx,drawOptions,centerX,y+halfFontSize)}else{const yBoxTop=y+Math.max((fontSize-boxHeight)/2,0),xBoxLeft=rtlHelper.leftForLtr(x,boxWidth),borderRadius=toTRBLCorners(legendItem.borderRadius);ctx.beginPath(),Object.values(borderRadius).some(v=>0!==v)?addRoundedRectPath(ctx,{x:xBoxLeft,y:yBoxTop,w:boxWidth,h:boxHeight,radius:borderRadius}):ctx.rect(xBoxLeft,yBoxTop,boxWidth,boxHeight),ctx.fill(),0!==lineWidth&&ctx.stroke()}ctx.restore()},"drawLegendBox"),fillText=__name(function(x,y,legendItem){renderText(ctx,legendItem.text,x,y+itemHeight/2,labelFont,{strikethrough:legendItem.hidden,textAlign:rtlHelper.textAlign(legendItem.textAlign)})},"fillText"),isHorizontal=this.isHorizontal(),titleHeight=this._computeTitleHeight();cursor=isHorizontal?{x:_alignStartEnd(align,this.left+padding,this.right-lineWidths[0]),y:this.top+padding+titleHeight,line:0}:{x:this.left+padding,y:_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[0].height),line:0},overrideTextDirection(this.ctx,opts.textDirection);const lineHeight=itemHeight+padding;this.legendItems.forEach((legendItem,i)=>{ctx.strokeStyle=legendItem.fontColor||fontColor,ctx.fillStyle=legendItem.fontColor||fontColor;const textWidth=ctx.measureText(legendItem.text).width,textAlign=rtlHelper.textAlign(legendItem.textAlign||(legendItem.textAlign=labelOpts.textAlign)),width=boxWidth+halfFontSize+textWidth;let x=cursor.x,y=cursor.y;rtlHelper.setWidth(this.width),isHorizontal?i>0&&x+width+padding>this.right&&(y=cursor.y+=lineHeight,cursor.line++,x=cursor.x=_alignStartEnd(align,this.left+padding,this.right-lineWidths[cursor.line])):i>0&&y+lineHeight>this.bottom&&(x=cursor.x=x+columnSizes[cursor.line].width+padding,cursor.line++,y=cursor.y=_alignStartEnd(align,this.top+titleHeight+padding,this.bottom-columnSizes[cursor.line].height));const realX=rtlHelper.x(x);drawLegendBox(realX,y,legendItem),x=_textX(textAlign,x+boxWidth+halfFontSize,isHorizontal?x+width:this.right,opts.rtl),fillText(rtlHelper.x(x),y,legendItem),isHorizontal?cursor.x+=width+padding:cursor.y+=lineHeight}),restoreTextDirection(this.ctx,opts.textDirection)}drawTitle(){const opts=this.options,titleOpts=opts.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);if(!titleOpts.display)return;const rtlHelper=getRtlAdapter(opts.rtl,this.left,this.width),ctx=this.ctx,position=titleOpts.position,halfFontSize=titleFont.size/2,topPaddingPlusHalfFontSize=titlePadding.top+halfFontSize;let y,left=this.left,maxWidth=this.width;if(this.isHorizontal())maxWidth=Math.max(...this.lineWidths),y=this.top+topPaddingPlusHalfFontSize,left=_alignStartEnd(opts.align,left,this.right-maxWidth);else{const maxHeight=this.columnSizes.reduce((acc,size)=>Math.max(acc,size.height),0);y=topPaddingPlusHalfFontSize+_alignStartEnd(opts.align,this.top,this.bottom-maxHeight-opts.labels.padding-this._computeTitleHeight())}const x=_alignStartEnd(position,left,left+maxWidth);ctx.textAlign=rtlHelper.textAlign(_toLeftRightCenter(position)),ctx.textBaseline="middle",ctx.strokeStyle=titleOpts.color,ctx.fillStyle=titleOpts.color,ctx.font=titleFont.string,renderText(ctx,titleOpts.text,x,y,titleFont)}_computeTitleHeight(){const titleOpts=this.options.title,titleFont=toFont(titleOpts.font),titlePadding=toPadding(titleOpts.padding);return titleOpts.display?titleFont.lineHeight+titlePadding.height:0}_getLegendItemAt(x,y){let i,hitBox,lh;if(_isBetween(x,this.left,this.right)&&_isBetween(y,this.top,this.bottom))for(lh=this.legendHitBoxes,i=0;ictx.chart.options.color,boxWidth:40,padding:10,generateLabels(chart){const datasets=chart.data.datasets,{labels:{usePointStyle,pointStyle,textAlign,color:color2}}=chart.legend.options;return chart._getSortedDatasetMetas().map(meta=>{const style=meta.controller.getStyle(usePointStyle?0:void 0),borderWidth=toPadding(style.borderWidth);return{text:datasets[meta.index].label,fillStyle:style.backgroundColor,fontColor:color2,hidden:!meta.visible,lineCap:style.borderCapStyle,lineDash:style.borderDash,lineDashOffset:style.borderDashOffset,lineJoin:style.borderJoinStyle,lineWidth:(borderWidth.width+borderWidth.height)/4,strokeStyle:style.borderColor,pointStyle:pointStyle||style.pointStyle,rotation:style.rotation,textAlign:textAlign||style.textAlign,borderRadius:0,datasetIndex:meta.index}},this)}},title:{color:ctx=>ctx.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:name=>!name.startsWith("on"),labels:{_scriptable:name=>!["generateLabels","filter","sort"].includes(name)}}};class Title extends Element{constructor(config){super(),this.chart=config.chart,this.options=config.options,this.ctx=config.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(maxWidth,maxHeight){const opts=this.options;if(this.left=0,this.top=0,!opts.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=maxWidth,this.height=this.bottom=maxHeight;const lineCount=isArray(opts.text)?opts.text.length:1;this._padding=toPadding(opts.padding);const textSize=lineCount*toFont(opts.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=textSize:this.width=textSize}isHorizontal(){const pos=this.options.position;return"top"===pos||"bottom"===pos}_drawArgs(offset){const{top,left,bottom,right,options}=this,align=options.align;let maxWidth,titleX,titleY,rotation=0;return this.isHorizontal()?(titleX=_alignStartEnd(align,left,right),titleY=top+offset,maxWidth=right-left):("left"===options.position?(titleX=left+offset,titleY=_alignStartEnd(align,bottom,top),rotation=-.5*PI):(titleX=right-offset,titleY=_alignStartEnd(align,top,bottom),rotation=.5*PI),maxWidth=bottom-top),{titleX,titleY,maxWidth,rotation}}draw(){const ctx=this.ctx,opts=this.options;if(!opts.display)return;const fontOpts=toFont(opts.font),offset=fontOpts.lineHeight/2+this._padding.top,{titleX,titleY,maxWidth,rotation}=this._drawArgs(offset);renderText(ctx,opts.text,0,0,fontOpts,{color:opts.color,maxWidth,rotation,textAlign:_toLeftRightCenter(opts.align),textBaseline:"middle",translation:[titleX,titleY]})}}function createTitle(chart,titleOpts){const title=new Title({ctx:chart.ctx,options:titleOpts,chart});layouts.configure(chart,title,titleOpts),layouts.addBox(chart,title),chart.titleBlock=title}__name(Title,"Title"),__name(createTitle,"createTitle");var plugin_title={id:"title",_element:Title,start(chart,_args,options){createTitle(chart,options)},stop(chart){const titleBlock=chart.titleBlock;layouts.removeBox(chart,titleBlock),delete chart.titleBlock},beforeUpdate(chart,_args,options){const title=chart.titleBlock;layouts.configure(chart,title,options),title.options=options},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 positioners={average(items){if(!items.length)return!1;let i,len,x=0,y=0,count=0;for(i=0,len=items.length;i-1?str.split("\n"):str}function createTooltipItem(chart,item){const{element,datasetIndex,index:index2}=item,controller=chart.getDatasetMeta(datasetIndex).controller,{label,value}=controller.getLabelAndValue(index2);return{chart,label,parsed:controller.getParsed(index2),raw:chart.data.datasets[datasetIndex].data[index2],formattedValue:value,dataset:controller.getDataset(),dataIndex:index2,datasetIndex,element}}function getTooltipSize(tooltip,options){const ctx=tooltip.chart.ctx,{body,footer,title}=tooltip,{boxWidth,boxHeight}=options,bodyFont=toFont(options.bodyFont),titleFont=toFont(options.titleFont),footerFont=toFont(options.footerFont),titleLineCount=title.length,footerLineCount=footer.length,bodyLineItemCount=body.length,padding=toPadding(options.padding);let height=padding.height,width=0,combinedBodyLength=body.reduce((count,bodyItem)=>count+bodyItem.before.length+bodyItem.lines.length+bodyItem.after.length,0);if(combinedBodyLength+=tooltip.beforeBody.length+tooltip.afterBody.length,titleLineCount&&(height+=titleLineCount*titleFont.lineHeight+(titleLineCount-1)*options.titleSpacing+options.titleMarginBottom),combinedBodyLength){height+=bodyLineItemCount*(options.displayColors?Math.max(boxHeight,bodyFont.lineHeight):bodyFont.lineHeight)+(combinedBodyLength-bodyLineItemCount)*bodyFont.lineHeight+(combinedBodyLength-1)*options.bodySpacing}footerLineCount&&(height+=options.footerMarginTop+footerLineCount*footerFont.lineHeight+(footerLineCount-1)*options.footerSpacing);let widthPadding=0;const maxLineWidth=__name(function(line){width=Math.max(width,ctx.measureText(line).width+widthPadding)},"maxLineWidth");return ctx.save(),ctx.font=titleFont.string,each(tooltip.title,maxLineWidth),ctx.font=bodyFont.string,each(tooltip.beforeBody.concat(tooltip.afterBody),maxLineWidth),widthPadding=options.displayColors?boxWidth+2+options.boxPadding:0,each(body,bodyItem=>{each(bodyItem.before,maxLineWidth),each(bodyItem.lines,maxLineWidth),each(bodyItem.after,maxLineWidth)}),widthPadding=0,ctx.font=footerFont.string,each(tooltip.footer,maxLineWidth),ctx.restore(),width+=padding.width,{width,height}}function determineYAlign(chart,size){const{y,height}=size;return ychart.height-height/2?"bottom":"center"}function doesNotFitWithAlign(xAlign,chart,options,size){const{x,width}=size,caret=options.caretSize+options.caretPadding;if("left"===xAlign&&x+width+caret>chart.width||"right"===xAlign&&x-width-caret<0)return!0}function determineXAlign(chart,options,size,yAlign){const{x,width}=size,{width:chartWidth,chartArea:{left,right}}=chart;let xAlign="center";return"center"===yAlign?xAlign=x<=(left+right)/2?"left":"right":x<=width/2?xAlign="left":x>=chartWidth-width/2&&(xAlign="right"),doesNotFitWithAlign(xAlign,chart,options,size)&&(xAlign="center"),xAlign}function determineAlignment(chart,options,size){const yAlign=size.yAlign||options.yAlign||determineYAlign(chart,size);return{xAlign:size.xAlign||options.xAlign||determineXAlign(chart,options,size,yAlign),yAlign}}function alignX(size,xAlign){let{x,width}=size;return"right"===xAlign?x-=width:"center"===xAlign&&(x-=width/2),x}function alignY(size,yAlign,paddingAndSize){let{y,height}=size;return"top"===yAlign?y+=paddingAndSize:y-="bottom"===yAlign?height+paddingAndSize:height/2,y}function getBackgroundPoint(options,size,alignment,chart){const{caretSize,caretPadding,cornerRadius}=options,{xAlign,yAlign}=alignment,paddingAndSize=caretSize+caretPadding,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius);let x=alignX(size,xAlign);const y=alignY(size,yAlign,paddingAndSize);return"center"===yAlign?"left"===xAlign?x+=paddingAndSize:"right"===xAlign&&(x-=paddingAndSize):"left"===xAlign?x-=Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign&&(x+=Math.max(topRight,bottomRight)+caretSize),{x:_limitValue(x,0,chart.width-size.width),y:_limitValue(y,0,chart.height-size.height)}}function getAlignedX(tooltip,align,options){const padding=toPadding(options.padding);return"center"===align?tooltip.x+tooltip.width/2:"right"===align?tooltip.x+tooltip.width-padding.right:tooltip.x+padding.left}function getBeforeAfterBodyLines(callback2){return pushOrConcat([],splitNewlines(callback2))}function createTooltipContext(parent,tooltip,tooltipItems){return createContext(parent,{tooltip,tooltipItems,type:"tooltip"})}function overrideCallbacks(callbacks,context){const override=context&&context.dataset&&context.dataset.tooltip&&context.dataset.tooltip.callbacks;return override?callbacks.override(override):callbacks}__name(pushOrConcat,"pushOrConcat"),__name(splitNewlines,"splitNewlines"),__name(createTooltipItem,"createTooltipItem"),__name(getTooltipSize,"getTooltipSize"),__name(determineYAlign,"determineYAlign"),__name(doesNotFitWithAlign,"doesNotFitWithAlign"),__name(determineXAlign,"determineXAlign"),__name(determineAlignment,"determineAlignment"),__name(alignX,"alignX"),__name(alignY,"alignY"),__name(getBackgroundPoint,"getBackgroundPoint"),__name(getAlignedX,"getAlignedX"),__name(getBeforeAfterBodyLines,"getBeforeAfterBodyLines"),__name(createTooltipContext,"createTooltipContext"),__name(overrideCallbacks,"overrideCallbacks");class Tooltip extends Element{constructor(config){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=config.chart||config._chart,this._chart=this.chart,this.options=config.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(options){this.options=options,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const cached=this._cachedAnimations;if(cached)return cached;const chart=this.chart,options=this.options.setContext(this.getContext()),opts=options.enabled&&chart.options.animation&&options.animations,animations=new Animations(this.chart,opts);return opts._cacheable&&(this._cachedAnimations=Object.freeze(animations)),animations}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(context,options){const{callbacks}=options,beforeTitle=callbacks.beforeTitle.apply(this,[context]),title=callbacks.title.apply(this,[context]),afterTitle=callbacks.afterTitle.apply(this,[context]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeTitle)),lines=pushOrConcat(lines,splitNewlines(title)),lines=pushOrConcat(lines,splitNewlines(afterTitle)),lines}getBeforeBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this,[tooltipItems]))}getBody(tooltipItems,options){const{callbacks}=options,bodyItems=[];return each(tooltipItems,context=>{const bodyItem={before:[],lines:[],after:[]},scoped=overrideCallbacks(callbacks,context);pushOrConcat(bodyItem.before,splitNewlines(scoped.beforeLabel.call(this,context))),pushOrConcat(bodyItem.lines,scoped.label.call(this,context)),pushOrConcat(bodyItem.after,splitNewlines(scoped.afterLabel.call(this,context))),bodyItems.push(bodyItem)}),bodyItems}getAfterBody(tooltipItems,options){return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this,[tooltipItems]))}getFooter(tooltipItems,options){const{callbacks}=options,beforeFooter=callbacks.beforeFooter.apply(this,[tooltipItems]),footer=callbacks.footer.apply(this,[tooltipItems]),afterFooter=callbacks.afterFooter.apply(this,[tooltipItems]);let lines=[];return lines=pushOrConcat(lines,splitNewlines(beforeFooter)),lines=pushOrConcat(lines,splitNewlines(footer)),lines=pushOrConcat(lines,splitNewlines(afterFooter)),lines}_createItems(options){const active=this._active,data=this.chart.data,labelColors=[],labelPointStyles=[],labelTextColors=[];let i,len,tooltipItems=[];for(i=0,len=active.length;ioptions.filter(element,index2,array,data))),options.itemSort&&(tooltipItems=tooltipItems.sort((a2,b2)=>options.itemSort(a2,b2,data))),each(tooltipItems,context=>{const scoped=overrideCallbacks(options.callbacks,context);labelColors.push(scoped.labelColor.call(this,context)),labelPointStyles.push(scoped.labelPointStyle.call(this,context)),labelTextColors.push(scoped.labelTextColor.call(this,context))}),this.labelColors=labelColors,this.labelPointStyles=labelPointStyles,this.labelTextColors=labelTextColors,this.dataPoints=tooltipItems,tooltipItems}update(changed,replay){const options=this.options.setContext(this.getContext()),active=this._active;let properties,tooltipItems=[];if(active.length){const position=positioners[options.position].call(this,active,this._eventPosition);tooltipItems=this._createItems(options),this.title=this.getTitle(tooltipItems,options),this.beforeBody=this.getBeforeBody(tooltipItems,options),this.body=this.getBody(tooltipItems,options),this.afterBody=this.getAfterBody(tooltipItems,options),this.footer=this.getFooter(tooltipItems,options);const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,size),alignment=determineAlignment(this.chart,options,positionAndSize),backgroundPoint=getBackgroundPoint(options,positionAndSize,alignment,this.chart);this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,properties={opacity:1,x:backgroundPoint.x,y:backgroundPoint.y,width:size.width,height:size.height,caretX:position.x,caretY:position.y}}else 0!==this.opacity&&(properties={opacity:0});this._tooltipItems=tooltipItems,this.$context=void 0,properties&&this._resolveAnimations().update(this,properties),changed&&options.external&&options.external.call(this,{chart:this.chart,tooltip:this,replay})}drawCaret(tooltipPoint,ctx,size,options){const caretPosition=this.getCaretPosition(tooltipPoint,size,options);ctx.lineTo(caretPosition.x1,caretPosition.y1),ctx.lineTo(caretPosition.x2,caretPosition.y2),ctx.lineTo(caretPosition.x3,caretPosition.y3)}getCaretPosition(tooltipPoint,size,options){const{xAlign,yAlign}=this,{caretSize,cornerRadius}=options,{topLeft,topRight,bottomLeft,bottomRight}=toTRBLCorners(cornerRadius),{x:ptX,y:ptY}=tooltipPoint,{width,height}=size;let x1,x2,x3,y1,y2,y3;return"center"===yAlign?(y2=ptY+height/2,"left"===xAlign?(x1=ptX,x2=x1-caretSize,y1=y2+caretSize,y3=y2-caretSize):(x1=ptX+width,x2=x1+caretSize,y1=y2-caretSize,y3=y2+caretSize),x3=x1):(x2="left"===xAlign?ptX+Math.max(topLeft,bottomLeft)+caretSize:"right"===xAlign?ptX+width-Math.max(topRight,bottomRight)-caretSize:this.caretX,"top"===yAlign?(y1=ptY,y2=y1-caretSize,x1=x2-caretSize,x3=x2+caretSize):(y1=ptY+height,y2=y1+caretSize,x1=x2+caretSize,x3=x2-caretSize),y3=y1),{x1,x2,x3,y1,y2,y3}}drawTitle(pt,ctx,options){const title=this.title,length=title.length;let titleFont,titleSpacing,i;if(length){const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width);for(pt.x=getAlignedX(this,options.titleAlign,options),ctx.textAlign=rtlHelper.textAlign(options.titleAlign),ctx.textBaseline="middle",titleFont=toFont(options.titleFont),titleSpacing=options.titleSpacing,ctx.fillStyle=options.titleColor,ctx.font=titleFont.string,i=0;i0!==v)?(ctx.beginPath(),ctx.fillStyle=options.multiKeyBackground,addRoundedRectPath(ctx,{x:outerX,y:colorY,w:boxWidth,h:boxHeight,radius:borderRadius}),ctx.fill(),ctx.stroke(),ctx.fillStyle=labelColors.backgroundColor,ctx.beginPath(),addRoundedRectPath(ctx,{x:innerX,y:colorY+1,w:boxWidth-2,h:boxHeight-2,radius:borderRadius}),ctx.fill()):(ctx.fillStyle=options.multiKeyBackground,ctx.fillRect(outerX,colorY,boxWidth,boxHeight),ctx.strokeRect(outerX,colorY,boxWidth,boxHeight),ctx.fillStyle=labelColors.backgroundColor,ctx.fillRect(innerX,colorY+1,boxWidth-2,boxHeight-2))}ctx.fillStyle=this.labelTextColors[i]}drawBody(pt,ctx,options){const{body}=this,{bodySpacing,bodyAlign,displayColors,boxHeight,boxWidth,boxPadding}=options,bodyFont=toFont(options.bodyFont);let bodyLineHeight=bodyFont.lineHeight,xLinePadding=0;const rtlHelper=getRtlAdapter(options.rtl,this.x,this.width),fillLineOfText=__name(function(line){ctx.fillText(line,rtlHelper.x(pt.x+xLinePadding),pt.y+bodyLineHeight/2),pt.y+=bodyLineHeight+bodySpacing},"fillLineOfText"),bodyAlignForCalculation=rtlHelper.textAlign(bodyAlign);let bodyItem,textColor,lines,i,j,ilen,jlen;for(ctx.textAlign=bodyAlign,ctx.textBaseline="middle",ctx.font=bodyFont.string,pt.x=getAlignedX(this,bodyAlignForCalculation,options),ctx.fillStyle=options.bodyColor,each(this.beforeBody,fillLineOfText),xLinePadding=displayColors&&"right"!==bodyAlignForCalculation?"center"===bodyAlign?boxWidth/2+boxPadding:boxWidth+2+boxPadding:0,i=0,ilen=body.length;i0&&ctx.stroke()}_updateAnimationTarget(options){const chart=this.chart,anims=this.$animations,animX=anims&&anims.x,animY=anims&&anims.y;if(animX||animY){const position=positioners[options.position].call(this,this._active,this._eventPosition);if(!position)return;const size=this._size=getTooltipSize(this,options),positionAndSize=Object.assign({},position,this._size),alignment=determineAlignment(chart,options,positionAndSize),point=getBackgroundPoint(options,positionAndSize,alignment,chart);(animX._to!==point.x||animY._to!==point.y)&&(this.xAlign=alignment.xAlign,this.yAlign=alignment.yAlign,this.width=size.width,this.height=size.height,this.caretX=position.x,this.caretY=position.y,this._resolveAnimations().update(this,point))}}_willRender(){return!!this.opacity}draw(ctx){const options=this.options.setContext(this.getContext());let opacity=this.opacity;if(!opacity)return;this._updateAnimationTarget(options);const tooltipSize={width:this.width,height:this.height},pt={x:this.x,y:this.y};opacity=Math.abs(opacity)<.001?0:opacity;const padding=toPadding(options.padding),hasTooltipContent=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;options.enabled&&hasTooltipContent&&(ctx.save(),ctx.globalAlpha=opacity,this.drawBackground(pt,ctx,tooltipSize,options),overrideTextDirection(ctx,options.textDirection),pt.y+=padding.top,this.drawTitle(pt,ctx,options),this.drawBody(pt,ctx,options),this.drawFooter(pt,ctx,options),restoreTextDirection(ctx,options.textDirection),ctx.restore())}getActiveElements(){return this._active||[]}setActiveElements(activeElements,eventPosition){const lastActive=this._active,active=activeElements.map(({datasetIndex,index:index2})=>{const meta=this.chart.getDatasetMeta(datasetIndex);if(!meta)throw new Error("Cannot find a dataset at index "+datasetIndex);return{datasetIndex,element:meta.data[index2],index:index2}}),changed=!_elementsEqual(lastActive,active),positionChanged=this._positionChanged(active,eventPosition);(changed||positionChanged)&&(this._active=active,this._eventPosition=eventPosition,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e2,replay,inChartArea=!0){if(replay&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const options=this.options,lastActive=this._active||[],active=this._getActiveElements(e2,lastActive,replay,inChartArea),positionChanged=this._positionChanged(active,e2),changed=replay||!_elementsEqual(active,lastActive)||positionChanged;return changed&&(this._active=active,(options.enabled||options.external)&&(this._eventPosition={x:e2.x,y:e2.y},this.update(!0,replay))),changed}_getActiveElements(e2,lastActive,replay,inChartArea){const options=this.options;if("mouseout"===e2.type)return[];if(!inChartArea)return lastActive;const active=this.chart.getElementsAtEventForMode(e2,options.mode,options,replay);return options.reverse&&active.reverse(),active}_positionChanged(active,e2){const{caretX,caretY,options}=this,position=positioners[options.position].call(this,active,e2);return!1!==position&&(caretX!==position.x||caretY!==position.y)}}__name(Tooltip,"Tooltip"),Tooltip.positioners=positioners;var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(chart,_args,options){options&&(chart.tooltip=new Tooltip({chart,options}))},beforeUpdate(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},reset(chart,_args,options){chart.tooltip&&chart.tooltip.initialize(options)},afterDraw(chart){const tooltip=chart.tooltip;if(tooltip&&tooltip._willRender()){const args={tooltip};if(!1===chart.notifyPlugins("beforeTooltipDraw",args))return;tooltip.draw(chart.ctx),chart.notifyPlugins("afterTooltipDraw",args)}},afterEvent(chart,args){if(chart.tooltip){const useFinalPosition=args.replay;chart.tooltip.handleEvent(args.event,useFinalPosition,args.inChartArea)&&(args.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:(ctx,opts)=>opts.bodyFont.size,boxWidth:(ctx,opts)=>opts.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:noop,title(tooltipItems){if(tooltipItems.length>0){const item=tooltipItems[0],labels=item.chart.data.labels,labelCount=labels?labels.length:0;if(this&&this.options&&"dataset"===this.options.mode)return item.dataset.label||"";if(item.label)return item.label;if(labelCount>0&&item.dataIndex"filter"!==name&&"itemSort"!==name&&"external"!==name,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=__name((labels,raw,index2,addedLabels)=>("string"==typeof raw?(index2=labels.push(raw)-1,addedLabels.unshift({index:index2,label:raw})):isNaN(raw)&&(index2=null),index2),"addIfString");function findOrAddLabel(labels,raw,index2,addedLabels){const first=labels.indexOf(raw);if(-1===first)return addIfString(labels,raw,index2,addedLabels);return first!==labels.lastIndexOf(raw)?index2:first}__name(findOrAddLabel,"findOrAddLabel");const validIndex=__name((index2,max)=>null===index2?null:_limitValue(Math.round(index2),0,max),"validIndex");class CategoryScale extends Scale{constructor(cfg){super(cfg),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(scaleOptions){const added=this._addedLabels;if(added.length){const labels=this.getLabels();for(const{index:index2,label}of added)labels[index2]===label&&labels.splice(index2,1);this._addedLabels=[]}super.init(scaleOptions)}parse(raw,index2){if(isNullOrUndef(raw))return null;const labels=this.getLabels();return index2=isFinite(index2)&&labels[index2]===raw?index2:findOrAddLabel(labels,raw,valueOrDefault(index2,raw),this._addedLabels),validIndex(index2,labels.length-1)}determineDataLimits(){const{minDefined,maxDefined}=this.getUserBounds();let{min,max}=this.getMinMax(!0);"ticks"===this.options.bounds&&(minDefined||(min=0),maxDefined||(max=this.getLabels().length-1)),this.min=min,this.max=max}buildTicks(){const min=this.min,max=this.max,offset=this.options.offset,ticks=[];let labels=this.getLabels();labels=0===min&&max===labels.length-1?labels:labels.slice(min,max+1),this._valueRange=Math.max(labels.length-(offset?0:1),1),this._startValue=this.min-(offset?.5:0);for(let value=min;value<=max;value++)ticks.push({value});return ticks}getLabelForValue(value){const labels=this.getLabels();return value>=0&&valueticks.length-1?null:this.getPixelForValue(ticks[index2].value)}getValueForPixel(pixel){return Math.round(this._startValue+this.getDecimalForPixel(pixel)*this._valueRange)}getBasePixel(){return this.bottom}}function generateTicks$1(generationOptions,dataRange){const ticks=[],{bounds,step,min,max,precision,count,maxTicks,maxDigits,includeBounds}=generationOptions,unit=step||1,maxSpaces=maxTicks-1,{min:rmin,max:rmax}=dataRange,minDefined=!isNullOrUndef(min),maxDefined=!isNullOrUndef(max),countDefined=!isNullOrUndef(count),minSpacing=(rmax-rmin)/(maxDigits+1);let factor,niceMin,niceMax,numSpaces,spacing=niceNum((rmax-rmin)/maxSpaces/unit)*unit;if(spacing<1e-14&&!minDefined&&!maxDefined)return[{value:rmin},{value:rmax}];numSpaces=Math.ceil(rmax/spacing)-Math.floor(rmin/spacing),numSpaces>maxSpaces&&(spacing=niceNum(numSpaces*spacing/maxSpaces/unit)*unit),isNullOrUndef(precision)||(factor=Math.pow(10,precision),spacing=Math.ceil(spacing*factor)/factor),"ticks"===bounds?(niceMin=Math.floor(rmin/spacing)*spacing,niceMax=Math.ceil(rmax/spacing)*spacing):(niceMin=rmin,niceMax=rmax),minDefined&&maxDefined&&step&&almostWhole((max-min)/step,spacing/1e3)?(numSpaces=Math.round(Math.min((max-min)/spacing,maxTicks)),spacing=(max-min)/numSpaces,niceMin=min,niceMax=max):countDefined?(niceMin=minDefined?min:niceMin,niceMax=maxDefined?max:niceMax,numSpaces=count-1,spacing=(niceMax-niceMin)/numSpaces):(numSpaces=(niceMax-niceMin)/spacing,numSpaces=almostEquals(numSpaces,Math.round(numSpaces),spacing/1e3)?Math.round(numSpaces):Math.ceil(numSpaces));const decimalPlaces=Math.max(_decimalPlaces(spacing),_decimalPlaces(niceMin));factor=Math.pow(10,isNullOrUndef(precision)?decimalPlaces:precision),niceMin=Math.round(niceMin*factor)/factor,niceMax=Math.round(niceMax*factor)/factor;let j=0;for(minDefined&&(includeBounds&&niceMin!==min?(ticks.push({value:min}),niceMinmin=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax");if(beginAtZero){const minSign=sign(min),maxSign=sign(max);minSign<0&&maxSign<0?setMax(0):minSign>0&&maxSign>0&&setMin(0)}if(min===max){let offset=1;(max>=Number.MAX_SAFE_INTEGER||min<=Number.MIN_SAFE_INTEGER)&&(offset=Math.abs(.05*max)),setMax(max+offset),beginAtZero||setMin(min-offset)}this.min=min,this.max=max}getTickLimit(){const tickOpts=this.options.ticks;let maxTicks,{maxTicksLimit,stepSize}=tickOpts;return stepSize?(maxTicks=Math.ceil(this.max/stepSize)-Math.floor(this.min/stepSize)+1,maxTicks>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`),maxTicks=1e3)):(maxTicks=this.computeTickLimit(),maxTicksLimit=maxTicksLimit||11),maxTicksLimit&&(maxTicks=Math.min(maxTicksLimit,maxTicks)),maxTicks}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const opts=this.options,tickOpts=opts.ticks;let maxTicks=this.getTickLimit();maxTicks=Math.max(2,maxTicks);const ticks=generateTicks$1({maxTicks,bounds:opts.bounds,min:opts.min,max:opts.max,precision:tickOpts.precision,step:tickOpts.stepSize,count:tickOpts.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:tickOpts.minRotation||0,includeBounds:!1!==tickOpts.includeBounds},this._range||this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}configure(){const ticks=this.ticks;let start=this.min,end=this.max;if(super.configure(),this.options.offset&&ticks.length){const offset=(end-start)/Math.max(ticks.length-1,1)/2;start-=offset,end+=offset}this._startValue=start,this._endValue=end,this._valueRange=end-start}getLabelForValue(value){return formatNumber(value,this.chart.options.locale,this.options.ticks.format)}}__name(LinearScaleBase,"LinearScaleBase");class LinearScale extends LinearScaleBase{determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?min:0,this.max=isNumberFinite(max)?max:1,this.handleTickRangeOptions()}computeTickLimit(){const horizontal=this.isHorizontal(),length=horizontal?this.width:this.height,minRotation=toRadians(this.options.ticks.minRotation),ratio=(horizontal?Math.sin(minRotation):Math.cos(minRotation))||.001,tickFont=this._resolveTickFontOptions(0);return Math.ceil(length/Math.min(40,tickFont.lineHeight/ratio))}getPixelForValue(value){return null===value?NaN:this.getPixelForDecimal((value-this._startValue)/this._valueRange)}getValueForPixel(pixel){return this._startValue+this.getDecimalForPixel(pixel)*this._valueRange}}function isMajor(tickVal){return tickVal/Math.pow(10,Math.floor(log10(tickVal)))==1}function generateTicks(generationOptions,dataRange){const endExp=Math.floor(log10(dataRange.max)),endSignificand=Math.ceil(dataRange.max/Math.pow(10,endExp)),ticks=[];let tickVal=finiteOrDefault(generationOptions.min,Math.pow(10,Math.floor(log10(dataRange.min)))),exp=Math.floor(log10(tickVal)),significand=Math.floor(tickVal/Math.pow(10,exp)),precision=exp<0?Math.pow(10,Math.abs(exp)):1;do{ticks.push({value:tickVal,major:isMajor(tickVal)}),++significand,10===significand&&(significand=1,++exp,precision=exp>=0?1:precision),tickVal=Math.round(significand*Math.pow(10,exp)*precision)/precision}while(exp0?value:null;this._zero=!0}determineDataLimits(){const{min,max}=this.getMinMax(!0);this.min=isNumberFinite(min)?Math.max(0,min):null,this.max=isNumberFinite(max)?Math.max(0,max):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined,maxDefined}=this.getUserBounds();let min=this.min,max=this.max;const setMin=__name(v=>min=minDefined?min:v,"setMin"),setMax=__name(v=>max=maxDefined?max:v,"setMax"),exp=__name((v,m)=>Math.pow(10,Math.floor(log10(v))+m),"exp");min===max&&(min<=0?(setMin(1),setMax(10)):(setMin(exp(min,-1)),setMax(exp(max,1)))),min<=0&&setMin(exp(max,-1)),max<=0&&setMax(exp(min,1)),this._zero&&this.min!==this._suggestedMin&&min===exp(this.min,0)&&setMin(exp(min,-1)),this.min=min,this.max=max}buildTicks(){const opts=this.options,ticks=generateTicks({min:this._userMin,max:this._userMax},this);return"ticks"===opts.bounds&&_setMinAndMaxByKey(ticks,this,"value"),opts.reverse?(ticks.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),ticks}getLabelForValue(value){return void 0===value?"0":formatNumber(value,this.chart.options.locale,this.options.ticks.format)}configure(){const start=this.min;super.configure(),this._startValue=log10(start),this._valueRange=log10(this.max)-log10(start)}getPixelForValue(value){return(void 0===value||0===value)&&(value=this.min),null===value||isNaN(value)?NaN:this.getPixelForDecimal(value===this.min?0:(log10(value)-this._startValue)/this._valueRange)}getValueForPixel(pixel){const decimal=this.getDecimalForPixel(pixel);return Math.pow(10,this._startValue+decimal*this._valueRange)}}function getTickBackdropHeight(opts){const tickOpts=opts.ticks;if(tickOpts.display&&opts.display){const padding=toPadding(tickOpts.backdropPadding);return valueOrDefault(tickOpts.font&&tickOpts.font.size,defaults.font.size)+padding.height}return 0}function measureLabelSize(ctx,font,label){return label=isArray(label)?label:[label],{w:_longestText(ctx,font.string,label),h:label.length*font.lineHeight}}function determineLimits(angle,pos,size,min,max){return angle===min||angle===max?{start:pos-size/2,end:pos+size/2}:anglemax?{start:pos-size,end:pos}:{start:pos,end:pos+size}}function fitWithPointLabels(scale){const orig={l:scale.left+scale._padding.left,r:scale.right-scale._padding.right,t:scale.top+scale._padding.top,b:scale.bottom-scale._padding.bottom},limits=Object.assign({},orig),labelSizes=[],padding=[],valueCount=scale._pointLabels.length,pointLabelOpts=scale.options.pointLabels,additionalAngle=pointLabelOpts.centerPointLabels?PI/valueCount:0;for(let i=0;iorig.r&&(x=(hLimits.end-orig.r)/sin,limits.r=Math.max(limits.r,orig.r+x)),vLimits.startorig.b&&(y=(vLimits.end-orig.b)/cos,limits.b=Math.max(limits.b,orig.b+y))}function buildPointLabelItems(scale,labelSizes,padding){const items=[],valueCount=scale._pointLabels.length,opts=scale.options,extra=getTickBackdropHeight(opts)/2,outerDistance=scale.drawingArea,additionalAngle=opts.pointLabels.centerPointLabels?PI/valueCount:0;for(let i=0;i270||angle<90)&&(y-=h),y}function drawPointLabels(scale,labelCount){const{ctx,options:{pointLabels}}=scale;for(let i=labelCount-1;i>=0;i--){const optsAtIndex=pointLabels.setContext(scale.getPointLabelContext(i)),plFont=toFont(optsAtIndex.font),{x,y,textAlign,left,top,right,bottom}=scale._pointLabelItems[i],{backdropColor}=optsAtIndex;if(!isNullOrUndef(backdropColor)){const borderRadius=toTRBLCorners(optsAtIndex.borderRadius),padding=toPadding(optsAtIndex.backdropPadding);ctx.fillStyle=backdropColor;const backdropLeft=left-padding.left,backdropTop=top-padding.top,backdropWidth=right-left+padding.width,backdropHeight=bottom-top+padding.height;Object.values(borderRadius).some(v=>0!==v)?(ctx.beginPath(),addRoundedRectPath(ctx,{x:backdropLeft,y:backdropTop,w:backdropWidth,h:backdropHeight,radius:borderRadius}),ctx.fill()):ctx.fillRect(backdropLeft,backdropTop,backdropWidth,backdropHeight)}renderText(ctx,scale._pointLabels[i],x,y+plFont.lineHeight/2,plFont,{color:optsAtIndex.color,textAlign,textBaseline:"middle"})}}function pathRadiusLine(scale,radius,circular,labelCount){const{ctx}=scale;if(circular)ctx.arc(scale.xCenter,scale.yCenter,radius,0,TAU);else{let pointPosition=scale.getPointPosition(0,radius);ctx.moveTo(pointPosition.x,pointPosition.y);for(let i=1;i{const label=callback(this.options.pointLabels.callback,[value,index2],this);return label||0===label?label:""}).filter((v,i)=>this.chart.getDataVisibility(i))}fit(){const opts=this.options;opts.display&&opts.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(leftMovement,rightMovement,topMovement,bottomMovement){this.xCenter+=Math.floor((leftMovement-rightMovement)/2),this.yCenter+=Math.floor((topMovement-bottomMovement)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(leftMovement,rightMovement,topMovement,bottomMovement))}getIndexAngle(index2){return _normalizeAngle(index2*(TAU/(this._pointLabels.length||1))+toRadians(this.options.startAngle||0))}getDistanceFromCenterForValue(value){if(isNullOrUndef(value))return NaN;const scalingFactor=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-value)*scalingFactor:(value-this.min)*scalingFactor}getValueForDistanceFromCenter(distance){if(isNullOrUndef(distance))return NaN;const scaledDistance=distance/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-scaledDistance:this.min+scaledDistance}getPointLabelContext(index2){const pointLabels=this._pointLabels||[];if(index2>=0&&index2{if(0!==index2){offset=this.getDistanceFromCenterForValue(tick.value);drawRadiusLine(this,grid.setContext(this.getContext(index2-1)),offset,labelCount)}}),angleLines.display){for(ctx.save(),i=labelCount-1;i>=0;i--){const optsAtIndex=angleLines.setContext(this.getPointLabelContext(i)),{color:color2,lineWidth}=optsAtIndex;!lineWidth||!color2||(ctx.lineWidth=lineWidth,ctx.strokeStyle=color2,ctx.setLineDash(optsAtIndex.borderDash),ctx.lineDashOffset=optsAtIndex.borderDashOffset,offset=this.getDistanceFromCenterForValue(opts.ticks.reverse?this.min:this.max),position=this.getPointPosition(i,offset),ctx.beginPath(),ctx.moveTo(this.xCenter,this.yCenter),ctx.lineTo(position.x,position.y),ctx.stroke())}ctx.restore()}}drawBorder(){}drawLabels(){const ctx=this.ctx,opts=this.options,tickOpts=opts.ticks;if(!tickOpts.display)return;const startAngle=this.getIndexAngle(0);let offset,width;ctx.save(),ctx.translate(this.xCenter,this.yCenter),ctx.rotate(startAngle),ctx.textAlign="center",ctx.textBaseline="middle",this.ticks.forEach((tick,index2)=>{if(0===index2&&!opts.reverse)return;const optsAtIndex=tickOpts.setContext(this.getContext(index2)),tickFont=toFont(optsAtIndex.font);if(offset=this.getDistanceFromCenterForValue(this.ticks[index2].value),optsAtIndex.showLabelBackdrop){ctx.font=tickFont.string,width=ctx.measureText(tick.label).width,ctx.fillStyle=optsAtIndex.backdropColor;const padding=toPadding(optsAtIndex.backdropPadding);ctx.fillRect(-width/2-padding.left,-offset-tickFont.size/2-padding.top,width+padding.width,tickFont.size+padding.height)}renderText(ctx,tick.label,0,-offset,tickFont,{color:optsAtIndex.color})}),ctx.restore()}drawTitle(){}}__name(RadialLinearScale,"RadialLinearScale"),RadialLinearScale.id="radialLinear",RadialLinearScale.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:label=>label,padding:5,centerPointLabels:!1}},RadialLinearScale.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},RadialLinearScale.descriptors={angleLines:{_fallback:"grid"}};const INTERVALS={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}},UNITS=Object.keys(INTERVALS);function sorter(a2,b2){return a2-b2}function parse(scale,input){if(isNullOrUndef(input))return null;const adapter=scale._adapter,{parser,round:round2,isoWeekday}=scale._parseOpts;let value=input;return"function"==typeof parser&&(value=parser(value)),isNumberFinite(value)||(value="string"==typeof parser?adapter.parse(value,parser):adapter.parse(value)),null===value?null:(round2&&(value="week"!==round2||!isNumber(isoWeekday)&&!0!==isoWeekday?adapter.startOf(value,round2):adapter.startOf(value,"isoWeek",isoWeekday)),+value)}function determineUnitForAutoTicks(minUnit,min,max,capacity){const ilen=UNITS.length;for(let i=UNITS.indexOf(minUnit);i=UNITS.indexOf(minUnit);i--){const unit=UNITS[i];if(INTERVALS[unit].common&&scale._adapter.diff(max,min,unit)>=numTicks-1)return unit}return UNITS[minUnit?UNITS.indexOf(minUnit):0]}function determineMajorUnit(unit){for(let i=UNITS.indexOf(unit)+1,ilen=UNITS.length;i=time?timestamps[lo]:timestamps[hi]]=!0}}else ticks[time]=!0}function setMajorTicks(scale,ticks,map2,majorUnit){const adapter=scale._adapter,first=+adapter.startOf(ticks[0].value,majorUnit),last=ticks[ticks.length-1].value;let major,index2;for(major=first;major<=last;major=+adapter.add(major,1,majorUnit))index2=map2[major],index2>=0&&(ticks[index2].major=!0);return ticks}function ticksFromTimestamps(scale,values,majorUnit){const ticks=[],map2={},ilen=values.length;let i,value;for(i=0;i+tick.value))}initOffsets(timestamps){let first,last,start=0,end=0;this.options.offset&×tamps.length&&(first=this.getDecimalForValue(timestamps[0]),start=1===timestamps.length?1-first:(this.getDecimalForValue(timestamps[1])-first)/2,last=this.getDecimalForValue(timestamps[timestamps.length-1]),end=1===timestamps.length?last:(last-this.getDecimalForValue(timestamps[timestamps.length-2]))/2);const limit=timestamps.length<3?.5:.25;start=_limitValue(start,0,limit),end=_limitValue(end,0,limit),this._offsets={start,end,factor:1/(start+1+end)}}_generate(){const adapter=this._adapter,min=this.min,max=this.max,options=this.options,timeOpts=options.time,minor=timeOpts.unit||determineUnitForAutoTicks(timeOpts.minUnit,min,max,this._getLabelCapacity(min)),stepSize=valueOrDefault(timeOpts.stepSize,1),weekday="week"===minor&&timeOpts.isoWeekday,hasWeekday=isNumber(weekday)||!0===weekday,ticks={};let time,count,first=min;if(hasWeekday&&(first=+adapter.startOf(first,"isoWeek",weekday)),first=+adapter.startOf(first,hasWeekday?"day":minor),adapter.diff(max,min,minor)>1e5*stepSize)throw new Error(min+" and "+max+" are too far apart with stepSize of "+stepSize+" "+minor);const timestamps="data"===options.ticks.source&&this.getDataTimestamps();for(time=first,count=0;timea2-b2).map(x=>+x)}getLabelForValue(value){const adapter=this._adapter,timeOpts=this.options.time;return timeOpts.tooltipFormat?adapter.format(value,timeOpts.tooltipFormat):adapter.format(value,timeOpts.displayFormats.datetime)}_tickFormatFunction(time,index2,ticks,format){const options=this.options,formats=options.time.displayFormats,unit=this._unit,majorUnit=this._majorUnit,minorFormat=unit&&formats[unit],majorFormat=majorUnit&&formats[majorUnit],tick=ticks[index2],major=majorUnit&&majorFormat&&tick&&tick.major,label=this._adapter.format(time,format||(major?majorFormat:minorFormat)),formatter=options.ticks.callback;return formatter?callback(formatter,[label,index2,ticks],this):label}generateTickLabels(ticks){let i,ilen,tick;for(i=0,ilen=ticks.length;i0?capacity:1}getDataTimestamps(){let i,ilen,timestamps=this._cache.data||[];if(timestamps.length)return timestamps;const metas=this.getMatchingVisibleMetas();if(this._normalized&&metas.length)return this._cache.data=metas[0].controller.getAllParsedValues(this);for(i=0,ilen=metas.length;i=table[lo].pos&&val<=table[hi].pos&&({lo,hi}=_lookupByKey(table,"pos",val)),({pos:prevSource,time:prevTarget}=table[lo]),({pos:nextSource,time:nextTarget}=table[hi])):(val>=table[lo].time&&val<=table[hi].time&&({lo,hi}=_lookupByKey(table,"time",val)),({time:prevSource,pos:prevTarget}=table[lo]),({time:nextSource,pos:nextTarget}=table[hi]));const span=nextSource-prevSource;return span?prevTarget+(nextTarget-prevTarget)*(val-prevSource)/span:prevTarget}__name(TimeScale,"TimeScale"),TimeScale.id="time",TimeScale.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}},__name(chart_esm_interpolate,"chart_esm_interpolate");class TimeSeriesScale extends TimeScale{constructor(props){super(props),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const timestamps=this._getTimestampsForTable(),table=this._table=this.buildLookupTable(timestamps);this._minPos=chart_esm_interpolate(table,this.min),this._tableRange=chart_esm_interpolate(table,this.max)-this._minPos,super.initOffsets(timestamps)}buildLookupTable(timestamps){const{min,max}=this,items=[],table=[];let i,ilen,prev,curr,next;for(i=0,ilen=timestamps.length;i=min&&curr<=max&&items.push(curr);if(items.length<2)return[{time:min,pos:0},{time:max,pos:1}];for(i=0,ilen=items.length;i{var f2;f2=function(){var define,module,exports;return function(){function r(e2,n,t){function o(i2,f2){if(!n[i2]){if(!e2[i2]){if(u)return u(i2,!0);var a2=new Error("Cannot find module '"+i2+"'");throw a2.code="MODULE_NOT_FOUND",a2}var p=n[i2]={exports:{}};e2[i2][0].call(p.exports,function(r2){return o(e2[i2][1][r2]||r2)},p,p.exports,r,e2,n,t)}return n[i2].exports}__name(o,"o");for(var u=void 0,i=0;i=e2}},"es6","es3"),$jscomp.findInternal=function(a2,b2,c2){a2 instanceof String&&(a2=String(a2));for(var d2=a2.length,e2=0;e2=f2}},"es6","es3"),$jscomp.polyfill("String.prototype.repeat",function(a2){return a2||function(b2){var c2=$jscomp.checkStringArgs(this,null,"repeat");if(0>b2||1342177279>>=1)&&(c2+=c2);return d2}},"es6","es3"),$jscomp.initSymbol=function(){},$jscomp.polyfill("Symbol",function(a2){if(a2)return a2;var b2=__name(function(e2,f2){this.$jscomp$symbol$id_=e2,$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:f2})},"b");b2.prototype.toString=function(){return this.$jscomp$symbol$id_};var c2=0,d2=__name(function(e2){if(this instanceof d2)throw new TypeError("Symbol is not a constructor");return new b2("jscomp_symbol_"+(e2||"")+"_"+c2++,e2)},"d");return d2},"es6","es3"),$jscomp.polyfill("Symbol.iterator",function(a2){if(a2)return a2;a2=Symbol("Symbol.iterator");for(var b2="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c2=0;c2(c2=c2||0)&&(c2=Math.max(c2+e2,0));c2>>0),goog.uidCounter_=0,goog.cloneObject=function(a2){var b2=goog.typeOf(a2);if("object"==b2||"array"==b2){if("function"==typeof a2.clone)return a2.clone();for(var c2 in b2="array"==b2?[]:{},a2)b2[c2]=goog.cloneObject(a2[c2]);return b2}return a2},goog.bindNative_=function(a2,b2,c2){return a2.call.apply(a2.bind,arguments)},goog.bindJs_=function(a2,b2,c2){if(!a2)throw Error();if(2").replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&")),b2&&(a2=a2.replace(/\{\$([^}]+)}/g,function(d2,e2){return null!=b2&&e2 in b2?b2[e2]:d2})),a2},goog.getMsgWithFallback=function(a2,b2){return a2},goog.exportSymbol=function(a2,b2,c2){goog.exportPath_(a2,b2,!0,c2)},goog.exportProperty=function(a2,b2,c2){a2[b2]=c2},goog.inherits=function(a2,b2){function c2(){}__name(c2,"c"),c2.prototype=b2.prototype,a2.superClass_=b2.prototype,a2.prototype=new c2,a2.prototype.constructor=a2,a2.base=function(d2,e2,f2){for(var g2=Array(arguments.length-2),h=2;h{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')}),a("es7",function(){return b("2 ** 2 == 4")}),a("es8",function(){return b("async () => 1, true")}),a("es9",function(){return b("({...rest} = {}), true")}),a("es_next",function(){return!1}),{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(a2,b2){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;if(!this.requiresTranspilation_){var c2=this.createRequiresTranspilation_();this.requiresTranspilation_=c2.map,this.transpilationTarget_=this.transpilationTarget_||c2.target}if(a2 in this.requiresTranspilation_)return!!this.requiresTranspilation_[a2]||!(!goog.inHtmlDocument_()||"es6"!=b2||"noModule"in goog.global.document.createElement("script"));throw Error("Unknown language mode: "+a2)},goog.Transpiler.prototype.transpile=function(a2,b2){return goog.transpile_(a2,b2,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(a2){return a2.replace(/<\/(SCRIPT)/gi,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={},this.idToPath_={},this.written_={},this.loadingDeps_=[],this.depsToLoad_=[],this.paused_=!1,this.factory_=new goog.DependencyFactory(goog.transpiler_),this.deferredCallbacks_={},this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(a2,b2){function c2(){d2&&(goog.global.setTimeout(d2,0),d2=null)}__name(c2,"c");var d2=b2;if(a2.length){b2=[];for(var e2=0;e2<\/script>';f2+="",f2=goog.Dependency.defer_?f2+"document.getElementById('script-"+e2+"').onload = function() {\n goog.Dependency.callback_('"+e2+"', this);\n};\n":f2+"goog.Dependency.callback_('"+e2+"', document.getElementById('script-"+e2+"'));",f2+="<\/script>",b2.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(f2):f2)}else{var g2=b2.createElement("script");g2.defer=goog.Dependency.defer_,g2.async=!1,c2&&(g2.nonce=c2),goog.DebugLoader_.IS_OLD_IE_?(a2.pause(),g2.onreadystatechange=function(){("loaded"==g2.readyState||"complete"==g2.readyState)&&(a2.loaded(),a2.resume())}):g2.onload=function(){g2.onload=null,a2.loaded()},g2.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path,b2.head.appendChild(g2)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."),a2.loaded()):a2.pause()},goog.Es6ModuleDependency=function(a2,b2,c2,d2,e2){goog.Dependency.call(this,a2,b2,c2,d2,e2)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(a2){function b2(l,p){var m="",n=goog.getScriptNonce();n&&(m=' nonce="'+n+'"'),l=p?'