1import{T as ve,U as K,_ as me,R as j,E as B,F as S,x as g,G as v,P,W as U,J as D,K as A,I as T,X as Wn,N as ie,Y as Te,L as Y,M as de,Z as Rr,V as yl,$ as oe,a0 as q,a1 as Q,a2 as Bt,z as Je,H as V,a3 as Ue,Q as H,y as ze,a4 as Ft,a5 as It,a6 as Zn,a7 as Ku,a8 as He,a9 as We,O as ue,aa as Er,ab as Bo,ac as ya,ad as Dr,ae as Fo,af as Xu,ag as Lo,ah as Pt,g as qn,p as Qn,ai as ju,u as xl,r as vt,f as it,j as Jn,aj as Yu,ak as wl,al as Zu,am as qu,an as Qu,ao as _l,a as Ju,ap as ec,aq as tc,ar as nc,s as so,as as rc,at as xa,au as ic,av as bl,t as Et,A as Vn,aw as oc,m as ac,k as Cl,q as Al,ax as sc,ay as El,az as Sl,aA as lc,aB as uc,aC as cc,aD as fc,aE as dc,aF as hc,aG as pc,aH as gc,aI as vc,aJ as mc,aK as yc,aL as xc,aM as Il,aN as Tl,aO as kr,aP as Vo,aQ as wa,aR as wc,aS as _a,aT as Sr,aU as _c,aV as en,aW as mr,aX as Vi,aY as bc,aZ as Cc,a_ as Ac,a$ as Ec}from"./index-ChduCKJ_.js";import{u as Pe,a as ae,b as ct,F as Kt}from"./columnStore-ihxRnrzy.js";import{u as cn}from"./cellStore-FjnxhxQe.js";import{A as Ol,B as Sc,f as Ic,a as Tc,V as Oc}from"./VPagination-1IahLbXb.js";import{a as ge,V as wt}from"./VRow-Ct6WV83Y.js";import{V as Ii}from"./VContainer-DQSvakYM.js";import{V as rn,a as Ml}from"./VList-q8rMJ6gm.js";import{V as Qe,a as gi,b as ba}from"./VListItem-B9cEElS-.js";import{V as li}from"./VMenu-DvO_0Zfb.js";
1import{V as Uo}from"./VForm-CKrycnli.js";import{V as Ne}from"./VTextField-CdPI9QmO.js";import{_ as Rl,b as Mc,V as Ca}from"./bottomSheet-DMexgyT2.js";import{f as Dl,i as Rc,V as Dc,a as Ui,L as kc,S as Pc,b as vi}from"./VTextarea-Ceqb2ZOx.js";import{V as Nc}from"./exceljs.min-CzDjpiIq.js";import{V as kl,a as Bc,u as Fc}from"./ssrBoot-CoapMtKL.js";import{V as mi,a as Aa,m as Lc}from"./VChip-j640jWhi.js";import{V as Vc}from"./VVirtualScroll-lDncbxTJ.js";import{c as Pl,d as Uc}from"./colors-DXHss-U_.js";import{e as $c}from"./ExportExcel-BX_ADXXN.js";import{V as $o}from"./VAlert-DClW0CN2.js";import{V as $i}from"./filter-hhDup2qs.js";import{V as Nl}from"./VCheckbox-BmVTS7YJ.js";import{V as Bl}from"./VListItemAction-BDDJXcZC.js";import{P as Hc,V as Wc}from"./PremiumPaywall-BvXxLIMW.js";import{V as zc,a as Ea}from"./VRadioGroup-DpIiJZI2.js";import{V as Sa,a as Gc}from"./VMain-BATXBOrZ.js";import{V as Ia}from"./VAppBarNavIcon-CceJLdOV.js";import{V as Ut}from"./VTooltip-CZQNmAMY.js";import{V as Kc}from"./VLayout-BQN7smmk.js";import"./VSwitch-BhxZoKiS.js";import"./VCheckboxBtn-DuUwTgFZ.js";const Xc={name:"CardView",emits:["media"],components:{BaseCol:Sc,AudioPlayerComponent:Ol},data(){return{resetDynamicScroller:0,showImage:!1,showAudio:!1,mediaUrl:"",columnLimit:8}},computed:{visibleRowKeys(){console.log("visible");const t=(this.page-1)*this.perPage,e=t+this.perPage;return this.sortedRowKeys.slice(t,e)},visibleColumnKeys(){return this.getVisibleColumnKeys()},isSmallScreen(){return this.$vuetify.display.xs},...K(ae,["sortedRowKeys","mainRows","rowKeys","page","perPage"]),...K(Pe,["hiddenColumns","sortedColumnKeys","columns"]),...K(cn,["activeCell"])},methods:{mediaClicked(t,e){this.mediaUrl=t.display,this.mediaUrl&&(e==="AUDIO"?this.showAudio=!0:this.showImage=!0)},...ve(Pe,["getVisibleColumnKeys"]),getTitle(){return this.columns?.[this.activeCell.columnKey]?.name??""},toggleCards(){this.columnLimit=this.columnLimit===this.visibleColumnKeys.length?8:this.visibleColumnKeys.length,this.isSmallScreen&&this.resetDynamicScroller++}}},jc={key:1,style:{height:"85vh"}};function Yc(t,e,n,r,i,o){const a=j("base-col"),s=j("DynamicScrollerItem"),l=j("DynamicScroller"),u=j("audio-player-component");return S(),B(Y,null,[g(Ii,{class:"wrapper",fluid:""},{default:v(()=>[o.visibleColumnKeys.length>8?(S(),P(D,{key:0,color:"primary",class:"ma-2",variant:"text",onClick:o.toggleCards},{default:v(()=>[A(T(i.columnLimit===o.visibleColumnKeys.length?t.$t("collapse"):t.$t("expand")),1)]),_:1},8,["onClick"])):U("",!0),o.isSmallScreen?(S(),B("div",jc,[(S(),P(l,{items:t.rowKeys.map(c=>t.mainRows[c]),"min-item-size":54,class:"scroller","key-field":"key",key:i.resetDynamicScroller},{default:v(({item:c,index:f,active:d})=>[g(s,{item:c,active:d,"size-dependencies":[c],"data-index":f},{default:v(()=>[Wn(g(ge,{cols:"12"},{default:v(()=>[g(ie,{height:"100%"},{default:v(()=>[g(Te,null,{default:v(()=>[A(T(c.index+1),1)]),_:2},1024),(S(!0),B(Y,null,de(o.visibleColumnKeys,(h,p)=>(S(),B(Y,{key:h},[o.visibleColumnKeys.length<8||p<i.columnLimit?(S(),P(a,{key:0,cells:c.cells[h],type:t.columns[h]?.type??"STRING","col-name":t.columns[h]?.name??"",class:"px-2"},null,8,["cells","type","col-name"])):U("",!0)],64))),128))]),_:2},1024)]),_:2},1536),[[Rr,!c.hide]])]),_:2},1032,["item","active","size-dependencies","data-index"])]),_:1},8,["items"]))])):(S(),P(wt,{key:2,dense:""},{default:v(()=>[(S(!0),B(Y,null,de(o.visibleRowKeys,c=>(S(),P(ge,{key:c,lg:"4",md:"4",xl:"3",sm:"4",cols:"12"},{default:v(()=>[g(ie,{height:"100%"},{default:v(()=>[g(Te,null,{default:v(()=>[A(T((t.mainRows[c]?.index??0)+1),1)]),_:2},1024),(S(!0),B(Y,null,de(t.mainRows[c]?.cells,(f,d,h)=>(S(),B(Y,{key:d},[o.visibleColumnKeys.length<8||h<i.columnLimit&&o.visibleColumnKeys.includes(d)?(S(),P(a,{key:0,cells:f,type:t.columns[d]?.type??"STRING","col-name":t.columns[d]?.name??"",class:"px-2",onMedia:p=>o.mediaClicked(f,t.columns[d]?.type??"STRING")},null,8,["cells","type","col-name","onMedia"])):U("",!0)],64))),128))]),_:2},1024)]),_:2},1024))),128))]),_:1}))]),_:1}),g(Q,{fullscreen:!0,modelValue:i.showImage,"onUpdate:modelValue":e[1]||(e[1]=c=>i.showImage=c)},{default:v(()=>[g(ie,null,{default:v(()=>[g(yl,{height:"80vh",src:i.mediaUrl,alt:"Fluid image",contain:""},null,8,["src"]),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[0]||(e[0]=c=>i.showImage=!1)},{default:v(()=>[A(T(t.$t("close")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(Q,{modelValue:i.showAudio,"onUpdate:modelValue":e[3]||(e[3]=c=>i.showAudio=c),title:o.getTitle(),width:"350"},{default:v(()=>[g(u,{url:i.mediaUrl,onClose:e[2]||(e[2]=c=>i.showAudio=!1)},null,8,["url"])]),_:1},8,["modelValue","title"])],64)}const Zc=me(Xc,[["render",Yc],["__scopeId","data-v-1c1843c8"]]),qc={name:"BaseRowIndex",emits:["select"],data(){return{showCheckBox:!1}},computed:{...K(ae,["selectedRows"]),...K(Bt,["darkMode"]),...K(ct,["access"])},props:{value:{type:Number,required:!0},rowKey:String,users:String,isSelected:Boolean}},Qc=["checked"],Jc={key:1};function ef(t,e,n,r,i,o){return S(),B("th",{class:Je(["indexCell",{dark:t.darkMode}]),onMouseenter:e[1]||(e[1]=a=>i.showCheckBox=!0),onMouseleave:e[2]||(e[2]=a=>i.showCheckBox=!1)},[t.access===2&&(i.showCheckBox||n.isSelected)?(S(),B("input",{key:0,id:"rowCheck",type:"checkbox",onInput:e[0]||(e[0]=a=>t.$emit("select",n.rowKey)),checked:n.isSelected},null,40,Qc)):(S(),B("span",Jc,T(n.value+1),1))],34)}const tf=me(qc,[["render",ef],["__scopeId","data-v-5ad30965"]]),nf={name:"StringCell",emits:["singleClick","longPress","editClick"],props:{cell:{type:Object,required:!1},align:{type:String,required:!1,default:"start"},showEditIcon:{type:Boolean,default:!1},cellWidth:String}};function rf(t,e,n,r,i,o){return S(),B("td",{dir:"auto",class:Je({"editable-cell":n.showEditIcon}),style:ze({backgroundColor:n.cell?.bgColor,color:n.cell?.textColor,fontWeight:n.cell?.bold?"bold":"normal",fontStyle:n.cell?.italic?"italic":"normal",minWidth:n.cellWidth,verticalAlign:"top"}),onClick:e[1]||(e[1]=a=>t.$emit("singleClick")),onContextmenu:e[2]||(e[2]=Ue(a=>t.$emit("longPress"),["prevent"]))},[n.showEditIcon?(S(),B("button",{key:0,class:"cell-edit-button",type:"button","aria-label":"Edit cell",onClick:e[0]||(e[0]=Ue(a=>t.$emit("editClick"),["stop"]))},[g(H,{size:"14"},{default:v(()=>e[3]||(e[3]=[A("mdi-pencil",-1)])),_:1,__:[3]})])):U("",!0),V("div",{style:ze(`white-space: pre-line; text-align: ${n.align}; unicode-bidi: plaintext;`)},T(n.cell?.display??""),5)],38)}const of=me(nf,[["render",rf]]),af={name:"StringCell",props:{cell:{type:Object,required:!1},cellWidth:String}},sf={style:{"white-space":"pre-line"},align:"center"},lf=["checked"];function uf(t,e,n,r,i,o){return S(),B("td",{style:ze({backgroundColor:n.cell?.bgColor??"transparent",color:n.cell?.textColor,fontWeight:n.cell?.bold?"bold":"normal",fontStyle:n.cell?.italic?"italic":"normal",minWidth:n.cellWidth,verticalAlign:"top"}),onClick:e[1]||(e[1]=()=>{}),onContextmenu:e[2]||(e[2]=Ue(()=>{},["prevent"]))},[V("div",sf,[V("input",{type:"checkbox",name:"",id:"",onInput:e[0]||(e[0]=()=>{}),checked:n.cell?.raw==="true"},null,40,lf)])],36)}const cf=me(af,[["render",uf]]),ff={name:"StringCell",emits:["singleClick","longPress","editClick"],props:{cell:{type:Object,required:!1},showEditIcon:{type:Boolean,default:!1},cellWidth:String}},df={style:{"white-space":"pre-line"}},hf={key:0,class:"audioLogo"};function pf(t,e,n,r,i,o){return S(),B("td",{class:Je({"editable-cell":n.showEditIcon}),style:ze({backgroundColor:n.cell?.bgColor??"transparent",color:n.cell?.textColor,fontWeight:n.cell?.bold?"bold":"normal",fontStyle:n.cell?.italic?"italic":"normal",minWidth:n.cellWidth,verticalAlign:"top"}),onClick:e[1]||(e[1]=a=>t.$emit("singleClick")),onContextmenu:e[2]||(e[2]=Ue(a=>t.$emit("longPress"),["prevent"]))},[n.showEditIcon?(S(),B("button",{key:0,class:"cell-edit-button",type:"button","aria-label":"Edit cell",onClick:e[0]||(e[0]=Ue(a=>t.$emit("editClick"),["stop"]))},[g(H,{size:"14"},{default:v(()=>e[3]||(e[3]=[A("mdi-pencil",-1)])),_:1,__:[3]})])):U("",!0),V("div",df,[n.cell?.display?(S(),B("div",hf)):U("",!0)])],38)}const gf=me(ff,[["render",pf]]),vf={name:"ImageCell",emits:["singleClick","longPress","editClick"],props:{cell:{type:Object,required:!1},align:{type:String,required:!1,default:"left"},showEditIcon:{type:Boolean,default:!1},cellWidth:String}},mf=["src"];function yf(t,e,n,r,i,o){return S(),B("td",{class:Je({"editable-cell":n.showEditIcon}),style:ze({backgroundColor:n.cell?.bgColor,color:n.cell?.textColor,fontWeight:n.cell?.bold?"bold":"normal",fontStyle:n.cell?.italic?"italic":"normal",minWidth:n.cellWidth,verticalAlign:"top"}),onClick:e[1]||(e[1]=a=>t.$emit("singleClick")),onContextmenu:e[2]||(e[2]=Ue(a=>t.$emit("longPress"),["prevent"]))},[n.showEditIcon?(S(),B("button",{key:0,class:"cell-edit-button",type:"button","aria-label":"Edit cell",onClick:e[0]||(e[0]=Ue(a=>t.$emit("editClick"),["stop"]))},[g(H,{size:"14"},{default:v(()=>e[3]||(e[3]=[A("mdi-pencil",-1)])),_:1,__:[3]})])):U("",!0),n.cell?.display?(S(),B("img",{key:1,loading:"lazy",src:n.cell?.display,alt:"",height:"75"},null,8,mf)):U("",!0)],38)}
1const xf=me(vf,[["render",yf]]),wf={name:"BaseRow",emits:["cellClicked","cellEditClicked"],components:{StringCell:of,CheckboxCell:cf,AudioCell:gf,ImageCell:xf,rowIndex:tf},props:{row:{type:Object,required:!0},index:{type:Number,required:!0},columnKeys:{type:Array,required:!0},rowKey:{type:String,required:!0}},methods:{getAlign(t,e){return t===1?"start":t===2?"center":t===3||e==="INTEGER"?"end":e==="CHECKBOX"||e==="TIME"||e==="DATEONLY"?"center":"start"},setActiveCellForColumn(t){const e={rowKey:this.rowKey,columnKey:t,type:this.columns[t]?.type??"STRING",cells:this.row?.cells[t]??{display:"",raw:""}};this.setActiveCell(e)},cellClicked(t,e){this.selectedRows.length>0?this.selectRow(this.rowKey):(console.log(t),this.setActiveCellForColumn(e),this.$emit("cellClicked",t))},cellEditClicked(t){this.selectedRows.length>0?this.selectRow(this.rowKey):(this.setActiveCellForColumn(t),this.$emit("cellEditClicked"))},canEditCell(t){const e=Ft().currentUser?.uid;if(this.selectedRows.length>0||!e||!this.row)return!1;const n=this.columns[t]?.type??"STRING";if(n==="FORMULA"||n==="CHECKBOX")return!1;const r=this.row.cells[t]?.display??"";if(r==="")return!1;const i=this.columns[t]?.editor?.[e]??!1;return this.access===2||this.isEditor&&i||this.isContributor&&this.row.users===e&&(i||r==="")},selectRowUi(t){this.selectRow(t)},...ve(ae,["selectRow"]),...ve(cn,["setActiveCell"])},computed:{...K(Pe,["columns"]),...K(ae,["selectedRows"]),...K(ct,["access","isEditor","isContributor","isSelfViewContributor"]),isSelected(){return this.selectedRows.includes(this.rowKey)}}};function _f(t,e,n,r,i,o){const a=j("row-index"),s=j("CheckboxCell"),l=j("ImageCell"),u=j("AudioCell"),c=j("StringCell");return n.row?(S(),B("tr",{key:0,class:Je({stripe1:n.index%2===0,stripe2:n.index%2!==0,selected:o.isSelected,selectable:t.selectedRows.length>0})},[g(a,{value:n.index,"row-key":n.row?.key,users:n.row?.users,"is-selected":o.isSelected,onSelect:o.selectRowUi},null,8,["value","row-key","users","is-selected","onSelect"]),(S(!0),B(Y,null,de(n.columnKeys,f=>(S(),B(Y,{key:f},[t.columns[f]?.type==="CHECKBOX"?(S(),P(s,{key:0,cell:n.row?.cells[f],cellWidth:100*(t.columns[f].size?Number(t.columns[f].size):1)+"px",onClick:d=>o.cellClicked(!1,f)},null,8,["cell","cellWidth","onClick"])):t.columns[f]?.type==="IMAGE"||t.columns[f]?.type==="DRAW"?(S(),P(l,{key:1,cell:n.row.cells[f],"show-edit-icon":o.canEditCell(f),onSingleClick:d=>o.cellClicked(!1,f),onLongPress:d=>o.cellClicked(!0,f),onEditClick:d=>o.cellEditClicked(f),cellWidth:100*(t.columns[f].size?Number(t.columns[f].size):1)+"px"},null,8,["cell","show-edit-icon","onSingleClick","onLongPress","onEditClick","cellWidth"])):t.columns[f]?.type==="AUDIO"?(S(),P(u,{key:2,cell:n.row.cells[f],"show-edit-icon":o.canEditCell(f),cellWidth:100*(t.columns[f].size?Number(t.columns[f].size):1)+"px",onSingleClick:d=>o.cellClicked(!1,f),onLongPress:d=>o.cellClicked(!0,f),onEditClick:d=>o.cellEditClicked(f)},null,8,["cell","show-edit-icon","cellWidth","onSingleClick","onLongPress","onEditClick"])):(S(),P(c,{key:3,cell:n.row.cells[f],cellWidth:100*(t.columns[f]?.size?Number(t.columns[f].size):1)+"px",align:o.getAlign(t.columns[f]?.alignment??-1,t.columns[f]?.type??"STRING"),"show-edit-icon":o.canEditCell(f),onSingleClick:d=>o.cellClicked(!1,f),onLongPress:d=>o.cellClicked(!0,f),onEditClick:d=>o.cellEditClicked(f)},null,8,["cell","cellWidth","align","show-edit-icon","onSingleClick","onLongPress","onEditClick"]))],64))),128))],2)):U("",!0)}const bf=me(wf,[["render",_f],["__scopeId","data-v-6f97ca40"]]),Cf={name:"BaseHeader",emits:["rename","move","type","style","delete","formula","filter","select","graph"],data(){return{columnOptions:[{title:"filter",value:"filter",icon:"mdi-filter"},{title:"rename",value:"rename",icon:"mdi-rename-box"},{title:"delete",value:"delete",icon:"mdi-delete"},{title:"set_formula",value:"formula",icon:"mdi-function-variant"},{title:"move",value:"move",icon:"mdi-swap-horizontal"},{title:"column_type",value:"type",icon:"mdi-clipboard-file"},{title:"style",value:"style",icon:"mdi-palette"},{title:"import_items",value:"select",icon:"mdi-playlist-edit"},{title:"graph",value:"graph",icon:"mdi-chart-bar"},{title:"sort_asc",value:"sort_asc",icon:"mdi-sort-alphabetical-ascending"},{title:"sort_des",value:"sort_des",icon:"mdi-sort-alphabetical-descending"}]}},computed:{...K(Pe,["columns"]),...K(ae,["filterList","rangeList","getActiveFilter"]),...K(Bt,["darkMode","wrapColumnNamesVx"]),...K(ct,["access"]),val(){return this.columns[this.colKey]},headerColor(){return this.filterList[this.colKey]||this.rangeList[this.colKey]?"#90EE90":this.darkMode?"#363636":"#e5edf5"}},props:{colKey:{type:String,required:!0},type:{type:String,required:!0}},methods:{shouldShow(t){let e=!0;switch(this.type){case"AUDIO":case"IMAGE":case"DRAW":(t==="sort_asc"||t==="sort_des"||t==="filter"||t==="graph")&&(e=!1);break}return t==="formula"&&this.type==="FORMULA"?e=!0:t==="formula"&&this.type!=="FORMULA"&&(e=!1),t==="select"&&this.type==="SELECT"?e=!0:t==="select"&&this.type!=="SELECT"&&(e=!1),this.access<2&&t!=="sort_asc"&&t!=="sort_des"&&t!=="filter"&&(e=!1),e},...ve(ae,["sortRows"]),...ve(Pe,["setActiveColumnHeader"]),shouldSort(t){return!(t==="AUDIO"||t==="IMAGE"||t==="DRAW")},handleColumnAction(t){switch(this.setActiveColumnHeader(this.colKey),t){case"sort_asc":this.sort(this.colKey,!0);break;case"sort_des":this.sort(this.colKey,!1);break;case"rename":this.$emit("rename");break;case"move":this.$emit("move");break;case"type":this.$emit("type");break;case"style":this.$emit("style");break;case"delete":this.$emit("delete");break;case"formula":this.$emit("formula");break;case"select":this.$emit("select");break;case"filter":this.$emit("filter");break;case"graph":this.$emit("graph");break}},sort(t,e){this.sortRows(t,e)}}};function Af(t,e,n,r,i,o){return S(),P(li,{scrim:"transparent","close-on-click":"","close-on-content-click":"",bottom:"","offset-y":"",width:"200",rounded:!0},{activator:v(({props:a})=>[V("th",It(a,{class:{dark:t.darkMode},style:{backgroundColor:t.getActiveFilter?.filter?.[n.colKey]?t.getActiveFilter.color:o.headerColor,whiteSpace:t.wrapColumnNamesVx?"pre-line":"nowrap"}}),[A(T(o.val?.name)+" ",1),g(H,{color:t.darkMode?"white":"#495074"},{default:v(()=>e[0]||(e[0]=[A("mdi-chevron-down",-1)])),_:1,__:[0]},8,["color"])],16)]),default:v(()=>[g(rn,null,{default:v(()=>[(S(!0),B(Y,null,de(i.columnOptions,a=>(S(),B(Y,null,[o.shouldShow(a.value)?(S(),P(Qe,{key:0,title:t.$t(`${a.title}`),density:"comfortable",onClick:s=>o.handleColumnAction(a.value)},{prepend:v(()=>[g(H,null,{default:v(()=>[A(T(a.icon),1)]),_:2},1024)]),_:2},1032,["title","onClick"])):U("",!0)],64))),256))]),_:1})]),_:1})}const Ef=me(Cf,[["render",Af],["__scopeId","data-v-a8973736"]]),Sf=Zn({name:"edit-column",emits:["close"],props:{columnKey:{type:String,required:!0},tableKey:{type:String,required:!0}},data(){return{name:"",rules:[t=>!!t||"Name is required"],valid:!1}},created(){this.name=this.columns?.[this.columnKey]?.name??""},computed:{...K(Bt,{mode:"getDarkMode"}),...K(Pe,["columns"])},methods:{...ve(Pe,["renameColumn"]),async onSubmit(){await this.$refs.form.validate(),this.valid&&(Ku(He(We,`tables/${this.tableKey}/columns/${this.columnKey}/name`),this.name).then(()=>{this.renameColumn({key:this.columnKey,name:this.name})}),this.$emit("close"))}}});function If(t,e,n,r,i,o){return S(),P(ie,null,{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.name),1)]),_:1}),g(ue,null,{default:v(()=>[g(Uo,{modelValue:t.valid,"onUpdate:modelValue":e[1]||(e[1]=a=>t.valid=a),ref:"form",onSubmit:Ue(t.onSubmit,["prevent","stop"])},{default:v(()=>[g(Ne,{autofocus:"",modelValue:t.name,"onUpdate:modelValue":e[0]||(e[0]=a=>t.name=a),modelModifiers:{trim:!0},rules:t.rules,label:t.$t("column_name"),variant:"outlined"},null,8,["modelValue","rules","label"])]),_:1},8,["modelValue","onSubmit"])]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[2]||(e[2]=a=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1}),g(D,{onClick:t.onSubmit},{default:v(()=>[A(T(t.$t("ok")),1)]),_:1},8,["onClick"])]),_:1})]),_:1})}const Tf=me(Sf,[["render",If],["__scopeId","data-v-a34cb10d"]]),Of={name:"MapComponent",emits:["close","location"],props:["tempValue"],data(){return{location:{lat:0,lng:0},locationPlaceholder:"Search Location",selectedLocation:"",searchQuery:"",locationSearch:[],showMap:!1,searchQuery:""}},watch:{selectedLocation(t){if(t){const n=document.querySelector("#locsearch");var e=new Event("test");n.dispatchEvent(e)}}},methods:{search(t){t&&this.searchForLocation(t)},searchForLocation:Rl.debounce(async function(t){this.locationSearch=await Dl(t)},300),async openmaps(){if(this.showMap=!0,await this.$nextTick(),document.getElementById("map")){let r=function(f){const d=new google.maps.InfoWindow({content:f});e.addEventListener("gmp-click",()=>{d.open({anchor:e,map:n,shouldFocus:!1})})},i=function(f){e&&(e.map=null),e=new o({position:f,map:n,gmpClickable:!0})};const{AdvancedMarkerElement:o}=await google.maps.importLibrary("marker");console.log("here");const a=document.getElementById("location"),s=document.getElementById("savelocation"),l=document.querySelector("#locsearch");console.log(l);var e,n=new google.maps.Map(document.getElementById("map"),{center:this.location,fullscreenControl:!1,mapId:"DEMO_MAP_ID",mapTypeControl:!1,streetViewControl:!1,zoom:15});if(this.tempValue){this.locationPlaceholder=this.tempValue;const f=await c(this.tempValue);this.location=f,typeof f=="string"?console.log(f):(i(f),n.panTo(f),r(this.tempValue))}else navigator.geolocation&&navigator.geolocation.getCurrentPosition(async f=>{const d={lat:f.coords.latitude,lng:f.coords.longitude};this.location=d,console.log(d),n.panTo(d),i(this.location);const h=await u(this.location.lat,this.location.lng);this.locationPlaceholder=h,r(h)});l.addEventListener("test",async f=>{const d=await c(this.selectedLocation);d!=="ZERO_RESULTS"&&(this.location=d,i(d),this.locationPlaceholder=this.selectedLocation,r(this.selectedLocation),n.panTo(d))}),a&&a.addEventListener("click",()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(async f=>{const d={lat:f.coords.latitude,lng:f.coords.longitude};this.location=d,n.panTo(d),i(this.location);const h=await u(this.location.lat,this.location.lng);this.locationPlaceholder=h,r(h)})}),s.addEventListener("click",async()=>{const f=await u(this.location.lat,this.location.lng);this.$emit("location",f)});async function u(f,d){const h=await fetch(`https://maps.googleapis.com/ma
1ps/api/geocode/json?latlng=${f},${d}&key=AIzaSyBvTZEKpvvqMnZ0JP8JSnPgrKlps30hwR0`);if(h.ok){const p=await h.json();console.log(p);try{return p.results[0].formatted_address}catch(m){console.log(m)}}}async function c(f){const d=await fetch(`https://maps.googleapis.com/maps/api/geocode/json?address=${f}&key=AIzaSyBvTZEKpvvqMnZ0JP8JSnPgrKlps30hwR0`);if(d.ok){const h=await d.json();return h.status==="OK"?h.results[0].geometry.location:h.status}}n.addListener("click",async f=>{this.location={lat:f.latLng.lat(),lng:f.latLng.lng()},i(this.location);const d=await u(this.location.lat,this.location.lng);this.selectedLocation="",this.locationPlaceholder=d,r(d)})}}},mounted(){this.openmaps()}};function Mf(t,e,n,r,i,o){return S(),B(Y,null,[e[7]||(e[7]=V("div",{id:"map"},null,-1)),g(Nc,{search:i.searchQuery,"onUpdate:search":[e[0]||(e[0]=a=>i.searchQuery=a),e[2]||(e[2]=a=>o.search(a))],modelValue:i.selectedLocation,"onUpdate:modelValue":e[1]||(e[1]=a=>i.selectedLocation=a),id:"locsearch",variant:"solo",items:i.locationSearch,placeholder:i.locationPlaceholder},null,8,["search","modelValue","items","placeholder"]),g(D,{icon:"",onClick:e[3]||(e[3]=a=>t.$emit("close")),id:"close",size:"large",variant:"flat",class:"white black--text absoluteButton A-right A-top"},{default:v(()=>[g(H,null,{default:v(()=>e[4]||(e[4]=[A("mdi-close",-1)])),_:1,__:[4]})]),_:1}),g(D,{icon:"",id:"location",elevation:"2",size:"large",class:"white black--text absoluteButton"},{default:v(()=>[g(H,null,{default:v(()=>e[5]||(e[5]=[A("mdi-crosshairs-gps",-1)])),_:1,__:[5]})]),_:1}),g(D,{icon:"",id:"savelocation",elevation:"2",size:"x-large",class:"absoluteButton A-left A-bottom"},{default:v(()=>[g(H,{color:"white",size:"x-large"},{default:v(()=>e[6]||(e[6]=[A("mdi-check",-1)])),_:1,__:[6]})]),_:1})],64)}const Rf=me(Of,[["render",Mf],["__scopeId","data-v-6b1caacb"]]);function Df(t,e){var n=Object.setPrototypeOf;n?n(t,e):t.__proto__=e}function kf(t,e){e===void 0&&(e=t.constructor);var n=Error.captureStackTrace;n&&n(t,e)}var Pf=(function(){var t=function(n,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a])},t(n,r)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Nf=(function(t){Pf(e,t);function e(n,r){var i=this.constructor,o=t.call(this,n,r)||this;return Object.defineProperty(o,"name",{value:i.name,enumerable:!1,configurable:!0}),Df(o,i.prototype),kf(o),o}return e})(Error),Bf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ot=(function(t){Bf(e,t);function e(n){n===void 0&&(n=void 0);var r=t.call(this,n)||this;return r.message=n,r}return e.prototype.getKind=function(){var n=this.constructor;return n.kind},e.kind="Exception",e})(Nf),Ff=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),At=(function(t){Ff(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="ArgumentException",e})(ot),Lf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),G=(function(t){Lf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="IllegalArgumentException",e})(ot),Vf=(function(){function t(e){if(this.binarizer=e,e===null)throw new G("Binarizer must be non-null.")}return t.prototype.getWidth=function(){return this.binarizer.getWidth()},t.prototype.getHeight=function(){return this.binarizer.getHeight()},t.prototype.getBlackRow=function(e,n){return this.binarizer.getBlackRow(e,n)},t.prototype.getBlackMatrix=function(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,n,r,i){var o=this.binarizer.getLuminanceSource().crop(e,n,r,i);return new t(this.binarizer.createBinarizer(o))},t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))},t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))},t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},t})(),Uf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
1e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Xe=(function(t){Uf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e})(ot),$f=(function(){function t(e){this.source=e}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t})(),Ce=(function(){function t(){}return t.arraycopy=function(e,n,r,i,o){for(;o--;)r[i++]=e[n++]},t.currentTimeMillis=function(){return Date.now()},t})(),Hf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ho=(function(t){Hf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="IndexOutOfBoundsException",e})(ot),Wf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ta=(function(t){Wf(e,t);function e(n,r){n===void 0&&(n=void 0),r===void 0&&(r=void 0);var i=t.call(this,r)||this;return i.index=n,i.message=r,i}return e.kind="ArrayIndexOutOfBoundsException",e})(Ho),zf=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ft=(function(){function t(){}return t.fill=function(e,n){for(var r=0,i=e.length;r<i;r++)e[r]=n},t.fillWithin=function(e,n,r,i){t.rangeCheck(e.length,n,r);for(var o=n;o<r;o++)e[o]=i},t.rangeCheck=function(e,n,r){if(n>r)throw new G("fromIndex("+n+") > toIndex("+r+")");if(n<0)throw new Ta(n);if(r>e)throw new Ta(r)},t.asList=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e},t.create=function(e,n,r){var i=Array.from({length:e});return i.map(function(o){return Array.from({length:n}).fill(r)})},t.createInt32Array=function(e,n,r){var i=Array.from({length:e});return i.map(function(o){return Int32Array.from({length:n}).fill(r)})},t.equals=function(e,n){if(!e||!n||!e.length||!n.length||e.length!==n.length)return!1;for(var r=0,i=e.length;r<i;r++)if(e[r]!==n[r])return!1;return!0},t.hashCode=function(e){var n,r;if(e===null)return 0;var i=1;try{for(var o=zf(e),a=o.next();!a.done;a=o.next()){var s=a.value;i=31*i+s}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},t.fillUint8Array=function(e,n){for(var r=0;r!==e.length;r++)e[r]=n},t.copyOf=function(e,n){return e.slice(0,n)},t.copyOfUint8Array=function(e,n){if(e.length<=n){var r=new Uint8Array(n);return r.set(e),r}return e.slice(0,n)},t.copyOfRange=function(e,n,r){var i=r-n,o=new Int32Array(i);return Ce.arraycopy(e,n,o,0,i),o},t.binarySearch=function(e,n,r){r===void 0&&(r=t.numberComparator);for(var i=0,o=e.length-1;i<=o;){var a=o+i>>1,s=r(n,e[a]);if(s>0)i=a+1;else if(s<0)o=a-1;else return a}return-i-1},t.numberComparator=function(e,n){return e-n},t})(),J=(function(){function t(){}return t.numberOfTrailingZeros=function(e){var n;if(e===0)return 32;var r=31;return n=e<<16,n!==0&&(r-=16,e=n),n=e<<8,n!==0&&(r-=8,e=n),n=e<<4,n!==0&&(r-=4,e=n),n=e<<2,n!==0&&(r-=2,e=n),r-(e<<1>>>31)},t.numberOfLeadingZeros=function(e){if(e===0)return 32;var n=1;return e>>>16||(n+=16,e<<=16),e>>>24||(n+=8,e<<=8),e>>>28||(n+=4,e<<=4),e>>>30||(n+=2,e<<=2),n-=e>>>31,n},t.toHexString=function(e){return e.toString(16)},t.toBinaryString=function(e){return String(parseInt(String(e),2))},t.bitCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e=e+(e>>>8),e=e+(e>>>16),e&63},t.truncDivision=function(e,n){return Math.trunc(e/n)},t.parseInt=function(e,n){return n===void 0&&(n=void 0),parseInt(e,n)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t})(),Ge=(function(){function t(e,n){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,n==null?this.bits=t.makeArray(e):this.bits=n)}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>this.bits.length*32){var n=t.makeArray(e);Ce.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},t.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(e&31))!==0},t.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(e&31)},t.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(e&31)},t.prototype.getNextSet=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,i=Math.floor(e/32),o=r[i];o&=~((1<<(e&31))-1);for(var a=r.length;o===0;){if(++i===a)return n;o=r[i]}var s=i*32+J.numberOfTrailingZeros(o);return s>n?n:s},t.prototype.getNextUnset=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,i=Math.floor(e/32),o=~r[i];o&=~((1<<(e&31))-1);for(var a=r.length;o===0;){if(++i===a)return n;o=~r[i]}var s=i*32+J.numberOfTrailingZeros(o);return s>n?n:s},t.prototype.setBulk=function(e,n){this.bits[Math.floor(e/32)]=n},t.prototype.setRange=function(e,n){if(n<e||e<0||n>this.size)throw new G;if(n!==e){n--;for(var r=Math.floor(e/32),i=Math.floor(n/32),o=this.bits,a=r;a<=i;a++){var s=a>r?0:e&31,l=a<i?31:n&31,u=(2<<l)-(1<<s);o[a]|=u}}},t.prototype.clear=function(){for(var e=this.bits.length,n=this.bits,r=0;r<e;r++)n[r]=0},t.prototype.isRange=function(e,n,r){if(n<e||e<0||n>this.size)throw new G;if(n===e)return!0;n--;for(var i=Math.floor(e/32),o=Math.floor(n/32),a=this.bits,s=i;s<=o;s++){var l=s>i?0:e&31,u=s<o?31:n&31,c=(2<<u)-(1<<l)&4294967295;if((a[s]&c)!==(r?c:0))return!1}return!0},t.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},t.prototype.appendBits=function(e,n){if(n<0||n>32)throw new G("Num bits must be between 0 and 32");this.ensureCapacity(this.size+n);for(var r=n;r>0;r--)this.appendBit((e>>r-1&1)===1)},t.prototype.appendBitArray=function(e){var n=e.size;this.ensureCapacity(this.size+n);for(var r=0;r<n;r++)this.appendBit(e.get(r))},t.prototype.xor=function(e){if(this.size!==e.size)throw new G("Sizes don't match");for(var n=this.bits,r=0,i=n.length;r<i;r++)n[r]^=e.bits[r]},t.prototype.toBytes=function(e,n,r,i){for(var o=0;o<i;o++){for(var a=0,s=0;s<8;s++)this.get(e)&&(a|=1<<7-s),e++;n[r+o]=a}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),n=Math.floor((this.size-1)/32),r=n+1,i=this.bits,o=0;o<r;o++){var a=i[o];a=a>>1&1431655765|(a&1431655765)<<1,a=a>>2&858993459|(a&858993459)<<2,a=a>>4&252645135|(a&252645135)<<4,a=a>>8&16711935|(a&16711935)<<8,a=a>>16&65535|(a&65535)<<16,e[n-o]=a}if(this.size!==r*32){for(var s=r*32-this.size,l=e[0]>>>s,o=1;o<r;o++){var u=e[o];l|=u<<32-s,e[o-1]=l,l=u>>>s}e[r-1]=l}this.bits=e},t.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.size===n.size&&ft.equals(this.bits,n.bits)}
1,t.prototype.hashCode=function(){return 31*this.size+ft.hashCode(this.bits)},t.prototype.toString=function(){for(var e="",n=0,r=this.size;n<r;n++)(n&7)===0&&(e+=" "),e+=this.get(n)?"X":".";return e},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t})(),lo;(function(t){t[t.OTHER=0]="OTHER",t[t.PURE_BARCODE=1]="PURE_BARCODE",t[t.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",t[t.TRY_HARDER=3]="TRY_HARDER",t[t.CHARACTER_SET=4]="CHARACTER_SET",t[t.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",t[t.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",t[t.ASSUME_GS1=7]="ASSUME_GS1",t[t.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",t[t.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",t[t.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(lo||(lo={}));const Me=lo;var Gf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),L=(function(t){Gf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.getFormatInstance=function(){return new e},e.kind="FormatException",e})(ot),Kf=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},he;(function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"})(he||(he={}));var Le=(function(){function t(e,n,r){for(var i,o,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=e,this.name=r,typeof n=="number"?this.values=Int32Array.from([n]):this.values=n,this.otherEncodingNames=a,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(r,this);for(var l=this.values,u=0,c=l.length;u!==c;u++){var f=l[u];t.VALUES_TO_ECI.set(f,this)}try{for(var d=Kf(a),h=d.next();!h.done;h=d.next()){var p=h.value;t.NAME_TO_ECI.set(p,this)}}catch(m){i={error:m}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}return t.prototype.getValueIdentifier=function(){return this.valueIdentifier},t.prototype.getName=function(){return this.name},t.prototype.getValue=function(){return this.values[0]},t.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new L("incorect value");var n=t.VALUES_TO_ECI.get(e);if(n===void 0)throw new L("incorect value");return n},t.getCharacterSetECIByName=function(e){var n=t.NAME_TO_ECI.get(e);if(n===void 0)throw new L("incorect value");return n},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.getName()===n.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(he.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(he.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(he.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(he.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(he.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(he.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(he.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(he.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(he.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(he.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(he.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(he.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(he.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(he.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(he.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(he.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(he.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(he.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(he.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(he.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(he.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(he.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(he.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(he.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(he.Big5,28,"Big5"),t.GB18030=new t(he.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(he.EUC_KR,30,"EUC_KR","EUC-KR"),t})(),Xf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
1e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ui=(function(t){Xf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="UnsupportedOperationException",e})(ot),Lt=(function(){function t(){}return t.decode=function(e,n){var r=this.encodingName(n);return this.customDecoder?this.customDecoder(e,r):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(r)?this.decodeFallback(e,r):new TextDecoder(r).decode(e)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&e==="ISO-8859-1"},t.encode=function(e,n){var r=this.encodingName(n);return this.customEncoder?this.customEncoder(e,r):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)},t.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},t.encodingName=function(e){return typeof e=="string"?e:e.getName()},t.encodingCharacterSet=function(e){return e instanceof Le?e:Le.getCharacterSetECIByName(e)},t.decodeFallback=function(e,n){var r=this.encodingCharacterSet(n);if(t.isDecodeFallbackSupported(r)){for(var i="",o=0,a=e.length;o<a;o++){var s=e[o].toString(16);s.length<2&&(s="0"+s),i+="%"+s}return decodeURIComponent(i)}if(r.equals(Le.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new ui("Encoding "+this.encodingName(n)+" not supported by fallback.")},t.isDecodeFallbackSupported=function(e){return e.equals(Le.UTF8)||e.equals(Le.ISO8859_1)||e.equals(Le.ASCII)},t.encodeFallback=function(e){for(var n=btoa(unescape(encodeURIComponent(e))),r=n.split(""),i=[],o=0;o<r.length;o++)i.push(r[o].charCodeAt(0));return new Uint8Array(i)},t})(),_e=(function(){function t(){}
1return t.castAsNonUtf8Char=function(e,n){n===void 0&&(n=null);var r=n?n.getName():this.ISO88591;return Lt.decode(new Uint8Array([e]),r)},t.guessEncoding=function(e,n){if(n!=null&&n.get(Me.CHARACTER_SET)!==void 0)return n.get(Me.CHARACTER_SET).toString();for(var r=e.length,i=!0,o=!0,a=!0,s=0,l=0,u=0,c=0,f=0,d=0,h=0,p=0,m=0,y=0,w=0,_=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191,C=0;C<r&&(i||o||a);C++){var E=e[C]&255;a&&(s>0?(E&128)===0?a=!1:s--:(E&128)!==0&&((E&64)===0?a=!1:(s++,(E&32)===0?l++:(s++,(E&16)===0?u++:(s++,(E&8)===0?c++:a=!1))))),i&&(E>127&&E<160?i=!1:E>159&&(E<192||E===215||E===247)&&w++),o&&(f>0?E<64||E===127||E>252?o=!1:f--:E===128||E===160||E>239?o=!1:E>160&&E<224?(d++,p=0,h++,h>m&&(m=h)):E>127?(f++,h=0,p++,p>y&&(y=p)):(h=0,p=0))}return a&&s>0&&(a=!1),o&&f>0&&(o=!1),a&&(_||l+u+c>0)?t.UTF8:o&&(t.ASSUME_SHIFT_JIS||m>=3||y>=3)?t.SHIFT_JIS:i&&o?m===2&&d===2||w*10>=r?t.SHIFT_JIS:t.ISO88591:i?t.ISO88591:o?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=-1;function o(s,l,u,c,f,d){if(s==="%%")return"%";if(n[++i]!==void 0){s=c?parseInt(c.substr(1)):void 0;var h=f?parseInt(f.substr(1)):void 0,p;switch(d){case"s":p=n[i];break;case"c":p=n[i][0];break;case"f":p=parseFloat(n[i]).toFixed(s);break;case"p":p=parseFloat(n[i]).toPrecision(s);break;case"e":p=parseFloat(n[i]).toExponential(s);break;case"x":p=parseInt(n[i]).toString(h||16);break;case"d":p=parseFloat(parseInt(n[i],h||10).toPrecision(s)).toFixed(0);break}p=typeof p=="object"?JSON.stringify(p):(+p).toString(h);for(var m=parseInt(u),y=u&&u[0]+""=="0"?"0":" ";p.length<m;)p=l!==void 0?p+y:y+p;return p}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(a,o)},t.getBytes=function(e,n){return Lt.encode(e,n)},t.getCharCode=function(e,n){return n===void 0&&(n=0),e.charCodeAt(n)},t.getCharAt=function(e){return String.fromCharCode(e)},t.SHIFT_JIS=Le.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=Le.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=Le.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t})(),xe=(function(){function t(e){e===void 0&&(e=""),this.value=e}return t.prototype.enableDecoding=function(e){return this.encoding=e,this},t.prototype.append=function(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=_e.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},t.prototype.appendChars=function(e,n,r){for(var i=n;n<n+r;i++)this.append(e[i]);return this},t.prototype.length=function(){return this.value.length},t.prototype.charAt=function(e){return this.value.charAt(e)},t.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},t.prototype.setCharAt=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+1)},t.prototype.substring=function(e,n){return this.value.substring(e,n)},t.prototype.setLengthToZero=function(){this.value=""},t.prototype.toString=function(){return this.value},t.prototype.insert=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+n.length)},t})(),Vt=(function(){function t(e,n,r,i){if(this.width=e,this.height=n,this.rowSize=r,this.bits=i,n==null&&(n=e),this.height=n,e<1||n<1)throw new G("Both dimensions must be greater than 0");r==null&&(r=Math.floor((e+31)/32)),this.rowSize=r,i==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var n=e.length,r=e[0].length,i=new t(r,n),o=0;o<n;o++)for(var a=e[o],s=0;s<r;s++)a[s]&&i.set(s,o);return i},t.parseFromString=function(e,n,r){if(e===null)throw new G("stringRepresentation cannot be null");for(var i=new Array(e.length),o=0,a=0,s=-1,l=0,u=0;u<e.length;)if(e.charAt(u)===` 2`||e.charAt(u)==="\r"){if(o>a){if(s===-1)s=o-a;else if(o-a!==s)throw new G("row lengths do not match");a=o,l++}u++}else if(e.substring(u,u+n.length)===n)u+=n.length,i[o]=!0,o++;else if(e.substring(u,u+r.length)===r)u+=r.length,i[o]=!1,o++;else throw new G("illegal character encountered: "+e.substring(u));if(o>a){if(s===-1)s=o-a;else if(o-a!==s)throw new G("row lengths do not match");l++}for(var c=new t(s,l),f=0;f<o;
2f++)i[f]&&c.set(Math.floor(f%s),Math.floor(f/s));return c},t.prototype.get=function(e,n){var r=n*this.rowSize+Math.floor(e/32);return(this.bits[r]>>>(e&31)&1)!==0},t.prototype.set=function(e,n){var r=n*this.rowSize+Math.floor(e/32);this.bits[r]|=1<<(e&31)&4294967295},t.prototype.unset=function(e,n){var r=n*this.rowSize+Math.floor(e/32);this.bits[r]&=~(1<<(e&31)&4294967295)},t.prototype.flip=function(e,n){var r=n*this.rowSize+Math.floor(e/32);this.bits[r]^=1<<(e&31)&4294967295},t.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new G("input matrix dimensions do not match");for(var n=new Ge(Math.floor(this.width/32)+1),r=this.rowSize,i=this.bits,o=0,a=this.height;o<a;o++)for(var s=o*r,l=e.getRow(o,n).getBitArray(),u=0;u<r;u++)i[s+u]^=l[u]},t.prototype.clear=function(){for(var e=this.bits,n=e.length,r=0;r<n;r++)e[r]=0},t.prototype.setRegion=function(e,n,r,i){if(n<0||e<0)throw new G("Left and top must be nonnegative");if(i<1||r<1)throw new G("Height and width must be at least 1");var o=e+r,a=n+i;if(a>this.height||o>this.width)throw new G("The region must fit inside the matrix");for(var s=this.rowSize,l=this.bits,u=n;u<a;u++)for(var c=u*s,f=e;f<o;f++)l[c+Math.floor(f/32)]|=1<<(f&31)&4294967295}
2,t.prototype.getRow=function(e,n){n==null||n.getSize()<this.width?n=new Ge(this.width):n.clear();for(var r=this.rowSize,i=this.bits,o=e*r,a=0;a<r;a++)n.setBulk(a*32,i[o+a]);return n},t.prototype.setRow=function(e,n){Ce.arraycopy(n.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},t.prototype.rotate180=function(){for(var e=this.getWidth(),n=this.getHeight(),r=new Ge(e),i=new Ge(e),o=0,a=Math.floor((n+1)/2);o<a;o++)r=this.getRow(o,r),i=this.getRow(n-1-o,i),r.reverse(),i.reverse(),this.setRow(o,i),this.setRow(n-1-o,r)},t.prototype.getEnclosingRectangle=function(){for(var e=this.width,n=this.height,r=this.rowSize,i=this.bits,o=e,a=n,s=-1,l=-1,u=0;u<n;u++)for(var c=0;c<r;c++){var f=i[u*r+c];if(f!==0){if(u<a&&(a=u),u>l&&(l=u),c*32<o){for(var d=0;(f<<31-d&4294967295)===0;)d++;c*32+d<o&&(o=c*32+d)}if(c*32+31>s){for(var d=31;!(f>>>d);)d--;c*32+d>s&&(s=c*32+d)}}}return s<o||l<a?null:Int32Array.from([o,a,s-o+1,l-a+1])},t.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,n=this.bits,r=0;r<n.length&&n[r]===0;)r++;if(r===n.length)return null;for(var i=r/e,o=r%e*32,a=n[r],s=0;(a<<31-s&4294967295)===0;)s++;return o+=s,Int32Array.from([o,i])},t.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,n=this.bits,r=n.length-1;r>=0&&n[r]===0;)r--;if(r<0)return null;for(var i=Math.floor(r/e),o=Math.floor(r%e)*32,a=n[r],s=31;!(a>>>s);)s--;return o+=s,Int32Array.from([o,i])},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRowSize=function(){return this.rowSize},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.width===n.width&&this.height===n.height&&this.rowSize===n.rowSize&&ft.equals(this.bits,n.bits)},t.prototype.hashCode=function(){var e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+ft.hashCode(this.bits),e},t.prototype.toString=function(e,n,r){return e===void 0&&(e="X "),n===void 0&&(n=" "),r===void 0&&(r=` 3`),this.buildToString(e,n,r)},t.prototype.buildToString=function(e,n,r){for(var i=new xe,o=0,a=this.height;o<a;o++){for(var s=0,l=this.width;s<l;s++)i.append(this.get(s,o)?e:n);i.append(r)}return i.toString()},t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())},t})(),jf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),k=(function(t){jf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e})(ot),Yf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Zf=(function(t){Yf(e,t);function e(n){var r=t.call(this,n)||this;return r.luminances=e.EMPTY,r.buckets=new Int32Array(e.LUMINANCE_BUCKETS),r}return e.prototype.getBlackRow=function(n,r){var i=this.getLuminanceSource(),o=i.getWidth();r==null||r.getSize()<o?r=new Ge(o):r.clear(),this.initArrays(o);for(var a=i.getRow(n,this.luminances),s=this.buckets,l=0;l<o;l++)s[(a[l]&255)>>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(s);if(o<3)for(var l=0;l<o;l++)(a[l]&255)<u&&r.set(l);else for(var c=a[0]&255,f=a[1]&255,l=1;l<o-1;l++){var d=a[l+1]&255;(f*4-c-d)/2<u&&r.set(l),c=f,f=d}return r},e.prototype.getBlackMatrix=function(){var n=this.getLuminanceSource(),r=n.getWidth(),i=n.getHeight(),o=new Vt(r,i);this.initArrays(r);for(var a=this.buckets,s=1;s<5;s++)for(var l=Math.floor(i*s/5),u=n.getRow(l,this.luminances),c=Math.floor(r*4/5),f=Math.floor(r/5);f<c;f++){var d=u[f]&255;a[d>>e.LUMINANCE_SHIFT]++}for(var h=e.estimateBlackPoint(a),p=n.getMatrix(),s=0;s<i;s++)for(var m=s*r,f=0;f<r;f++){var d=p[m+f]&255;d<h&&o.set(f,s)}return o},e.prototype.createBinarizer=function(n){return new e(n)},e.prototype.initArrays=function(n){this.luminances.length<n&&(this.luminances=new Uint8ClampedArray(n));for(var r=this.buckets,i=0;i<e.LUMINANCE_BUCKETS;i++)r[i]=0},e.estimateBlackPoint=function(n){for(var r=n.length,i=0,o=0,a=0,s=0;s<r;s++)n[s]>a&&(o=s,a=n[s]),n[s]>i&&(i=n[s]);for(var l=0,u=0,s=0;s<r;s++){var c=s-o,f=n[s]*c*c;f>u&&(l=s,u=f)}if(o>l){var d=o;o=l,l=d}if(l-o<=r/16)throw new k;for(var h=l-1,p=-1,s=l-1;s>o;s--){var m=s-o,f=m*m*(l-s)*(i-n[s]);f>p&&(h=s,p=f)}return h<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e})($f),qf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
3e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Qf=(function(t){qf(e,t);function e(n){var r=t.call(this,n)||this;return r.matrix=null,r}return e.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var n=this.getLuminanceSource(),r=n.getWidth(),i=n.getHeight();if(r>=e.MINIMUM_DIMENSION&&i>=e.MINIMUM_DIMENSION){var o=n.getMatrix(),a=r>>e.BLOCK_SIZE_POWER;(r&e.BLOCK_SIZE_MASK)!==0&&a++;var s=i>>e.BLOCK_SIZE_POWER;(i&e.BLOCK_SIZE_MASK)!==0&&s++;var l=e.calculateBlackPoints(o,a,s,r,i),u=new Vt(r,i);e.calculateThresholdForBlock(o,a,s,r,i,l,u),this.matrix=u}else this.matrix=t.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(n){return new e(n)},e.calculateThresholdForBlock=function(n,r,i,o,a,s,l){for(var u=a-e.BLOCK_SIZE,c=o-e.BLOCK_SIZE,f=0;f<i;f++){var d=f<<e.BLOCK_SIZE_POWER;d>u&&(d=u);for(var h=e.cap(f,2,i-3),p=0;p<r;p++){var m=p<<e.BLOCK_SIZE_POWER;m>c&&(m=c);for(var y=e.cap(p,2,r-3),w=0,_=-2;_<=2;_++){var C=s[h+_];w+=C[y-2]+C[y-1]+C[y]+C[y+1]+C[y+2]}var E=w/25;e.thresholdBlock(n,m,d,E,o,l)}}},e.cap=function(n,r,i){return n<r?r:n>i?i:n},e.thresholdBlock=function(n,r,i,o,a,s){for(var l=0,u=i*a+r;l<e.BLOCK_SIZE;l++,u+=a)for(var c=0;c<e.BLOCK_SIZE;c++)(n[u+c]&255)<=o&&s.set(r+c,i+l)},e.calculateBlackPoints=function(n,r,i,o,a){for(var s=a-e.BLOCK_SIZE,l=o-e.BLOCK_SIZE,u=new Array(i),c=0;c<i;c++){u[c]=new Int32Array(r);var f=c<<e.BLOCK_SIZE_POWER;f>s&&(f=s);for(var d=0;d<r;d++){var h=d<<e.BLOCK_SIZE_POWER;h>l&&(h=l);for(var p=0,m=255,y=0,w=0,_=f*o+h;w<e.BLOCK_SIZE;w++,_+=o){for(var C=0;C<e.BLOCK_SIZE;C++){var E=n[_+C]&255;p+=E,E<m&&(m=E),E>y&&(y=E)}if(y-m>e.MIN_DYNAMIC_RANGE)for(w++,_+=o;w<e.BLOCK_SIZE;w++,_+=o)for(var C=0;C<e.BLOCK_SIZE;C++)p+=n[_+C]&255}var I=p>>e.BLOCK_SIZE_POWER*2;if(y-m<=e.MIN_DYNAMIC_RANGE&&(I=m/2,c>0&&d>0)){var O=(u[c-1][d]+2*u[c][d-1]+u[c-1][d-1])/4;m<O&&(I=O)}u[c][d]=I}}return u},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=e.BLOCK_SIZE*5,e.MIN_DYNAMIC_RANGE=24,e})(Zf),Ti=(function(){function t(e,n){this.width=e,this.height=n}return t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.isCropSupported=function(){return!1},t.prototype.crop=function(e,n,r,i){throw new ui("This luminance source does not support cropping.")},t.prototype.isRotateSupported=function(){return!1},t.prototype.rotateCounterClockwise=function(){throw new ui("This luminance source does not support rotation by 90 degrees.")},t.prototype.rotateCounterClockwise45=function(){throw new ui("This luminance source does not support rotation by 45 degrees.")},t.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),n=new xe,r=0;r<this.height;r++){for(var i=this.getRow(r,e),o=0;o<this.width;o++){var a=i[o]&255,s=void 0;a<64?s="#":a<128?s="+":a<192?s=".":s=" ",n.append(s)}n.append(` 4`)}return n.toString()},t})(),Jf=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Wo=(function(t){Jf(e,t);function e(n){var r=t.call(this,n.getWidth(),n.getHeight())||this;return r.delegate=n,r}return e.prototype.getRow=function(n,r){for(var i=this.delegate.getRow(n,r),o=this.getWidth(),a=0;a<o;a++)i[a]=255-(i[a]&255);return i},e.prototype.getMatrix=function(){for(var n=this.delegate.getMatrix(),r=this.getWidth()*this.getHeight(),i=new Uint8ClampedArray(r),o=0;o<r;o++)i[o]=255-(n[o]&255);return i},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(n,r,i,o){return new e(this.delegate.crop(n,r,i,o))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e})(Ti),ed=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
4e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),td=(function(t){ed(e,t);function e(n){var r=t.call(this,n.width,n.height)||this;return r.canvas=n,r.tempCanvasElement=null,r.buffer=e.makeBufferFromCanvasImageData(n),r}return e.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d").getImageData(0,0,n.width,n.height);return e.toGrayscaleBuffer(r.data,n.width,n.height)},e.toGrayscaleBuffer=function(n,r,i){for(var o=new Uint8ClampedArray(r*i),a=0,s=0,l=n.length;a<l;a+=4,s++){var u=void 0,c=n[a+3];if(c===0)u=255;else{var f=n[a],d=n[a+1],h=n[a+2];u=306*f+601*d+117*h+512>>10}o[s]=u}return o},e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new G("Requested row is outside the image: "+n);var i=this.getWidth(),o=n*i;return r===null?r=this.buffer.slice(o,o+i):(r.length<i&&(r=new Uint8ClampedArray(i)),r.set(this.buffer.slice(o,o+i))),r},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,i,o){return t.prototype.crop.call(this,n,r,i,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement},e.prototype.rotate=function(n){var r=this.getTempCanvasElement(),i=r.getContext("2d"),o=n*e.DEGREE_TO_RADIANS,a=this.canvas.width,s=this.canvas.height,l=Math.ceil(Math.abs(Math.cos(o))*a+Math.abs(Math.sin(o))*s),u=Math.ceil(Math.abs(Math.sin(o))*a+Math.abs(Math.cos(o))*s);return r.width=l,r.height=u,i.translate(l/2,u/2),i.rotate(o),i.drawImage(this.canvas,a/-2,s/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.prototype.invert=function(){return new Wo(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e})(Ti),nd=(function(){function t(e,n,r){this.deviceId=e,this.label=n,this.kind="videoinput",this.groupId=r||void 0}return t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},t})(),nt=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{u(r.next(c))}catch(f){a(f)}}function l(c){try{u(r.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(t,e||[])).next())})},rt=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},rd=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},er=(function(){function t(e,n,r){n===void 0&&(n=500),this.reader=e,this.timeBetweenScansMillis=n,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"}
4,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return nt(this,void 0,void 0,function(){var e,n,r,i,o,a,s,l,u,c,f,d;return rt(this,function(h){switch(h.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=h.sent(),n=[];try{for(r=rd(e),i=r.next();!i.done;i=r.next())o=i.value,a=o.kind==="video"?"videoinput":o.kind,a==="videoinput"&&(s=o.deviceId||o.id,l=o.label||"Video device "+(n.length+1),u=o.groupId,c={deviceId:s,label:l,kind:a,groupId:u},n.push(c))}catch(p){f={error:p}}finally{try{i&&!i.done&&(d=r.return)&&d.call(r)}finally{if(f)throw f.error}}return[2,n]}})})},t.prototype.getVideoInputDevices=function(){return nt(this,void 0,void 0,function(){var e;return rt(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=n.sent(),[2,e.map(function(r){return new nd(r.deviceId,r.label)})]}})})},t.prototype.findDeviceById=function(e){return nt(this,void 0,void 0,function(){var n;return rt(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return n=r.sent(),n?[2,n.find(function(i){return i.deviceId===e})]:[2,null]}})})},t.prototype.decodeFromInputVideoDevice=function(e,n){return nt(this,void 0,void 0,function(){return rt(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,n)];case 1:return[2,r.sent()]}})})},t.prototype.decodeOnceFromVideoDevice=function(e,n){return nt(this,void 0,void 0,function(){var r,i;return rt(this,function(o){switch(o.label){case 0:return this.reset(),e?r={deviceId:{exact:e}}:r={facingMode:"environment"},i={video:r},[4,this.decodeOnceFromConstraints(i,n)];case 1:return[2,o.sent()]}})})},t.prototype.decodeOnceFromConstraints=function(e,n){return nt(this,void 0,void 0,function(){var r;return rt(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=i.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,i.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,n){return nt(this,void 0,void 0,function(){var r,i;return rt(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,n)];case 1:return r=o.sent(),[4,this.decodeOnce(r)];case 2:return i=o.sent(),[2,i]}})})},t.prototype.decodeFromInputVideoDeviceContinuously=function(e,n,r){return nt(this,void 0,void 0,function(){return rt(this,function(i){switch(i.label){case 0:return[4,this.decodeFromVideoDevice(e,n,r)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromVideoDevice=function(e,n,r){return nt(this,void 0,void 0,function(){var i,o;return rt(this,function(a){switch(a.label){case 0:return e?i={deviceId:{exact:e}}:i={facingMode:"environment"},o={video:i},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,a.sent()]}})})},t.prototype.decodeFromConstraints=function(e,n,r){return nt(this,void 0,void 0,function(){var i;return rt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return i=o.sent(),[4,this.decodeFromStream(i,n,r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeFromStream=function(e,n,r){return nt(this,void 0,void 0,function(){var i;return rt(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,n)];case 1:return i=o.sent(),[4,this.decodeContinuously(i,r)];case 2:return[2,o.sent()]}})})},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(e,n){return nt(this,void 0,void 0,function(){var r;return rt(this,function(i){switch(i.label){case 0:return r=this.prepareVideoElement(n),this.addVideoSource(r,e),this.videoElement=r,this.stream=e,[4,this.playVideoOnLoadAsync(r)];case 1:return i.sent(),[2,r]}})})},t.prototype.playVideoOnLoadAsync=function(e){var n=this;return new Promise(function(r,i){return n.playVideoOnLoad(e,function(){return r()})})},t.prototype.playVideoOnLoad=function(e,n){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",n),this.tryPlayVideo(e)},t.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},t.prototype.tryPlayVideo=function(e){return nt(this,void 0,void 0,function(){return rt(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),[3,4];case 3:return n.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},t.prototype.getMediaElement=function(e,n){var r=document.getElementById(e);if(!r)throw new At("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new At("element with id '"+e+"' must be an "+n+" element");return r},t.prototype.decodeFromImage=function(e,n){if(!e&&!n)throw new At("either imageElement with a src set or an url must be provided");return n&&!e?this.decodeFromImageUrl(n):this.decodeFromImageElement(e)},t.prototype.decodeFromVideo=function(e,n){if(!e&&!n)throw new At("Either an element with a src set or an URL must be provided");return n&&!e?this.decodeFromVideoUrl(n):this.decodeFromVideoElement(e)},t.prototype.decodeFromVideoContinuously=function(e,n,r){if(e===void 0&&n===void 0)throw new At("Either an element with a src set or an URL must be provided");return n&&!e?this.decodeFromVideoUrlContinuously(n,r):this.decodeFromVideoElementContinuously(e,r)},t.prototype.decodeFromImageElement=function(e){if(!e)throw new At("An image element must be provided.");this.reset();var n=this.prepareImageElement(e);this.imageElement=n;var r;return this.isImageLoaded(n)?r=this.decodeOnce(n,!1,!0):r=this._decodeOnLoadImage(n),r},t.prototype.decodeFromVideoElement=function(e){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(n)},t.prototype.decodeFromVideoElementContinuously=function(e,n){var r=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(r,n)},t.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new At("A video element must be provided.");this.reset();var n=this.prepareVideoElement(e);return this.videoElement=n,n},t.prototype.decodeFromImageUrl=function(e){if(!e)throw new At("An URL must be provided.");this.reset();var n=this.prepareImageElement();this.imageElement=n;var r=this._decodeOnLoadImage(n);return n.src=e,r},t.prototype.decodeFromVideoUrl=function(e){if(!e)throw new At("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElement(n);return n.src=e,r},t.prototype.decodeFromVideoUrlContinuously=function(e,n){if(!e)throw new At("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),i=this.decodeFromVideoElementContinuously(r,n);return r.src=e,i},t.prototype._decodeOnLoadImage=function(e){var n=this;return new Promise(function(r,i){n.imageLoadedListener=function(){return n.decodeOnce(e,!1,!0).then(r,i)},e.addEventListener("load",n.imageLoadedListener)})},t.prototype._decodeOnLoadVideo=function(e){return nt(this,void 0,void 0,function(){return rt(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),[4,this.decodeOnce(e)];case 2:return[2,n.sent()]}})})},t.prototype._decodeOnLoadVideoContinuously=function(e,n){return nt(this,void 0,void 0,function(){return rt(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return r.sent(),this.decodeContinuously(e,n),[2]}})})},t.prototype.isImageLoaded=function(e){return!(!e.complete||e.naturalWi
4dth===0)},t.prototype.prepareImageElement=function(e){var n;return typeof e>"u"&&(n=document.createElement("img"),n.width=200,n.height=200),typeof e=="string"&&(n=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(n=e),n},t.prototype.prepareVideoElement=function(e){var n;return!e&&typeof document<"u"&&(n=document.createElement("video"),n.width=200,n.height=200),typeof e=="string"&&(n=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(n=e),n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},t.prototype.decodeOnce=function(e,n,r){var i=this;n===void 0&&(n=!0),r===void 0&&(r=!0),this._stopAsyncDecode=!1;var o=function(a,s){if(i._stopAsyncDecode){s(new k("Video stream has ended before any code could be detected.")),i._stopAsyncDecode=void 0;return}try{var l=i.decode(e);a(l)}catch(d){var u=n&&d instanceof k,c=d instanceof Xe||d instanceof L,f=c&&r;if(u||f)return setTimeout(o,i._timeBetweenDecodingAttempts,a,s);s(d)}};return new Promise(function(a,s){return o(a,s)})},t.prototype.decodeContinuously=function(e,n){var r=this;this._stopContinuousDecode=!1;var i=function(){if(r._stopContinuousDecode){r._stopContinuousDecode=void 0;return}try{var o=r.decode(e);n(o,null),setTimeout(i,r.timeBetweenScansMillis)}catch(l){n(null,l);var a=l instanceof Xe||l instanceof L,s=l instanceof k;(a||s)&&setTimeout(i,r._timeBetweenDecodingAttempts)}};i()},t.prototype.decode=function(e){var n=this.createBinaryBitmap(e);return this.decodeBitmap(n)},t.prototype._isHTMLVideoElement=function(e){var n=e;return n.videoWidth!==0},t.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e),this._isHTMLVideoElement(e)?this.drawFrameOnCanvas(e):this.drawImageOnCanvas(e);var n=this.getCaptureCanvas(e),r=new td(n),i=new Qf(r);return new Vf(i)},t.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var n=this.getCaptureCanvas(e),r=void 0;try{r=n.getContext("2d",{willReadFrequently:!0})}catch{r=n.getContext("2d")}this.captureCanvasContext=r}return this.captureCanvasContext},t.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var n=this.createCaptureCanvas(e);this.captureCanvas=n}return this.captureCanvas},t.prototype.drawFrameOnCanvas=function(e,n,r){n===void 0&&(n={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),r===void 0&&(r=this.captureCanvasContext),r.drawImage(e,n.sx,n.sy,n.sWidth,n.sHeight,n.dx,n.dy,n.dWidth,n.dHeight)},t.prototype.drawImageOnCanvas=function(e,n,r){n===void 0&&(n={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),r===void 0&&(r=this.captureCanvasContext),r.drawImage(e,n.sx,n.sy,n.sWidth,n.sHeight,n.dx,n.dy,n.dWidth,n.dHeight)},t.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},t.prototype.createCaptureCanvas=function(e){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var n=document.createElement("canvas"),r,i;return typeof e<"u"&&(e instanceof HTMLVideoElement?(r=e.videoWidth,i=e.videoHeight):e instanceof HTMLImageElement&&(r=e.naturalWidth||e.width,i=e.naturalHeight||e.height)),n.style.width=r+"px",n.style.height=i+"px",n.width=r,n.height=i,n},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},t.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},t.prototype.addVideoSource=function(e,n){try{e.srcObject=n}catch{e.src=URL.createObjectURL(n)}},t.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")},t})(),ht=(function(){function t(e,n,r,i,o,a){r===void 0&&(r=n==null?0:8*n.length),a===void 0&&(a=Ce.currentTimeMillis()),this.text=e,this.rawBytes=n,this.numBits=r,this.resultPoints=i,this.format=o,this.timestamp=a,this.text=e,this.rawBytes=n,r==null?this.numBits=n==null?0:8*n.length:this.numBits=r,this.resultPoints=i,this.format=o,this.resultMetadata=null,a==null?this.timestamp=Ce.currentTimeMillis():this.timestamp=a}return t.prototype.getText=function(){return this.text},t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.getBarcodeFormat=function(){return this.format},t.prototype.getResultMetadata=function(){return this.resultMetadata},t.prototype.putMetadata=function(e,n){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,n)},t.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))},t.prototype.addResultPoints=function(e){var n=this.resultPoints;if(n===null)this.resultPoints=e;else if(e!==null&&e.length>0){var r=new Array(n.length+e.length);Ce.arraycopy(n,0,r,0,n.length),Ce.arraycopy(e,0,r,n.length,e.length),this.resultPoints=r}},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.toString=function(){return this.text},t})(),uo;
4(function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(uo||(uo={}));const X=uo;var co;(function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(co||(co={}));const je=co;var Oi=(function(){function t(e,n,r,i,o,a){o===void 0&&(o=-1),a===void 0&&(a=-1),this.rawBytes=e,this.text=n,this.byteSegments=r,this.ecLevel=i,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=a,this.numBits=e==null?0:8*e.length}return t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.setNumBits=function(e){this.numBits=e},t.prototype.getText=function(){return this.text},t.prototype.getByteSegments=function(){return this.byteSegments},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getErrorsCorrected=function(){return this.errorsCorrected},t.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},t.prototype.getErasures=function(){return this.erasures},t.prototype.setErasures=function(e){this.erasures=e},t.prototype.getOther=function(){return this.other},t.prototype.setOther=function(e){this.other=e},t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},t})(),yr=(function(){function t(){}return t.prototype.exp=function(e){return this.expTable[e]},t.prototype.log=function(e){if(e===0)throw new G;return this.logTable[e]},t.addOrSubtract=function(e,n){return e^n},t})(),on=(function(){function t(e,n){if(n.length===0)throw new G;this.field=e;var r=n.length;if(r>1&&n[0]===0){for(var i=1;i<r&&n[i]===0;)i++;i===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-i),Ce.arraycopy(n,i,this.coefficients,0,this.coefficients.length))}else this.coefficients=n}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return this.coefficients[0]===0},t.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},t.prototype.evaluateAt=function(e){if(e===0)return this.getCoefficient(0);var n=this.coefficients,r;if(e===1){r=0;for(var i=0,o=n.length;i!==o;i++){var a=n[i];r=yr.addOrSubtract(r,a)}return r}r=n[0];for(var s=n.length,l=this.field,i=1;i<s;i++)r=yr.addOrSubtract(l.multiply(e,r),n[i]);return r},t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new G("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var n=this.coefficients,r=e.coefficients;if(n.length>r.length){var i=n;n=r,r=i}var o=new Int32Array(r.length),a=r.length-n.length;Ce.arraycopy(r,0,o,0,a);for(var s=a;s<r.length;s++)o[s]=yr.addOrSubtract(n[s-a],r[s]);return new t(this.field,o)},t.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new G("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var n=this.coefficients,r=n.length,i=e.coefficients,o=i.length,a=new Int32Array(r+o-1),s=this.field,l=0;l<r;l++)for(var u=n[l],c=0;c<o;c++)a[l+c]=yr.addOrSubtract(a[l+c],s.multiply(u,i[c]));return new t(s,a)},t.prototype.multiplyScalar=function(e){if(e===0)return this.field.getZero();if(e===1)return this;for(var n=this.coefficients.length,r=this.field,i=new Int32Array(n),o=this.coefficients,a=0;a<n;a++)i[a]=r.multiply(o[a],e);return new t(r,i)},t.prototype.multiplyByMonomial=function(e,n){if(e<0)throw new G;if(n===0)return this.field.getZero();for(var r=this.coefficients,i=r.length,o=new Int32Array(i+e),a=this.field,s=0;s<i;s++)o[s]=a.multiply(r[s],n);return new t(a,o)},t.prototype.divide=function(e){if(!this.field.equals(e.field))throw new G("GenericGFPolys do n
4ot have same GenericGF field");if(e.isZero())throw new G("Divide by 0");for(var n=this.field,r=n.getZero(),i=this,o=e.getCoefficient(e.getDegree()),a=n.inverse(o);i.getDegree()>=e.getDegree()&&!i.isZero();){var s=i.getDegree()-e.getDegree(),l=n.multiply(i.getCoefficient(i.getDegree()),a),u=e.multiplyByMonomial(s,l),c=n.buildMonomial(s,l);r=r.addOrSubtract(c),i=i.addOrSubtract(u)}return[r,i]},t.prototype.toString=function(){for(var e="",n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);if(r!==0){if(r<0?(e+=" - ",r=-r):e.length>0&&(e+=" + "),n===0||r!==1){var i=this.field.log(r);i===0?e+="1":i===1?e+="a":(e+="a^",e+=i)}n!==0&&(n===1?e+="x":(e+="x^",e+=n))}}return e},t})(),id=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Fl=(function(t){id(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="ArithmeticException",e})(ot),od=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),lt=(function(t){od(e,t);function e(n,r,i){var o=t.call(this)||this;o.primitive=n,o.size=r,o.generatorBase=i;for(var a=new Int32Array(r),s=1,l=0;l<r;l++)a[l]=s,s*=2,s>=r&&(s^=n,s&=r-1);o.expTable=a;for(var u=new Int32Array(r),l=0;l<r-1;l++)u[a[l]]=l;return o.logTable=u,o.zero=new on(o,Int32Array.from([0])),o.one=new on(o,Int32Array.from([1])),o}return e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(n,r){if(n<0)throw new G;if(r===0)return this.zero;var i=new Int32Array(n+1);return i[0]=r,new on(this,i)},e.prototype.inverse=function(n){if(n===0)throw new Fl;return this.expTable[this.size-this.logTable[n]-1]},e.prototype.multiply=function(n,r){return n===0||r===0?0:this.expTable[(this.logTable[n]+this.logTable[r])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+J.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(n){return n===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e})(yr),ad=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),zr=(function(t){ad(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="ReedSolomonException",e})(ot),sd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ur=(function(t){sd(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="IllegalStateException",e})(ot),Mi=(function(){function t(e){this.field=e}return t.prototype.decode=function(e,n){for(var r=this.field,i=new on(r,e),o=new Int32Array(n),a=!0,s=0;s<n;s++){var l=i.evaluateAt(r.exp(s+r.getGeneratorBase()));o[o.length-1-s]=l,l!==0&&(a=!1)}if(!a)for(var u=new on(r,o),c=this.runEuclideanAlgorithm(r.buildMonomial(n,1),u,n),f=c[0],d=c[1],h=this.findErrorLocations(f),p=this.findErrorMagnitudes(d,h),s=0;s<h.length;s++){var m=e.length-1-r.log(h[s]);if(m<0)throw new zr("Bad error location");e[m]=lt.addOrSubtract(e[m],p[s])}},t.prototype.runEuclideanAlgorithm=function(e,n,r){if(e.getDegree()<n.getDegree()){var i=e;e=n,n=i}for(var o=this.field,a=e,s=n,l=o.getZero(),u=o.getOne();s.getDegree()>=(r/2|0);){var c=a,f=l;if(a=s,l=u,a.isZero())throw new zr("r_{i-1} was zero");s=c;for(var d=o.getZero(),h=a.getCoefficient(a.getDegree()),p=o.inverse(h);s.getDegree()>=a.getDegree()&&!s.isZero();){var m=s.getDegree()-a.getDegree(),y=o.multiply(s.getCoefficient(s.getDegree()),p);d=d.addOrSubtract(o.buildMonomial(m,y)),s=s.addOrSubtract(a.multiplyByMonomial(m,y))}if(u=d.multiply(l).addOrSubtract(f),s.getDegree()>=a.getDegree())throw new Ur("Division algorithm failed to reduce polynomial?")}var w=u.getCoefficient(0);if(w===0)throw new zr("sigmaTilde(0) was zero");var _=o.inverse(w),C=u.multiplyScalar(_),E=s.multiplyScalar(_);return[C,E]},t.prototype.findErrorLocations=function(e){var n=e.getDegree();if(n===1)return Int32Array.from([e.getCoefficient(1)]);for(var r=new Int32Array(n),i=0,o=this.field,a=1;a<o.getSize()&&i<n;a++)e.evaluateAt(a)===0&&(r[i]=o.inverse(a),i++);if(i!==n)throw new zr("Error locator degree does not match number of roots");return r},t.prototype.findErrorMagnitudes=function(e,n){for(var r=n.length,i=new Int32Array(r),o=this.field,a=0;a<r;a++){for(var s=o.inverse(n[a]),l=1,u=0;u<r;u++)if(a!==u){var c=o.multiply(n[u],s),f=(c&1)===0?c|1:c&-2;l=o.multiply(l,f)}i[a]=o.multiply(e.evaluateAt(s),o.inverse(l)),o.getGeneratorBase()!==0&&(i[a]=o.multiply(i[a],s))}return i},t})(),Ke;(function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"})(Ke||(Ke={}));var Oa=(function(){function t(){}return t.prototype.decode=function(e){this.ddata=e;var n=e.getBits(),r=this.extractBits(n),i=this.correctBits(r),o=t.convertBoolArrayToByteArray(i),a=t.getEncodedData(i),s=new Oi(o,a,null,
4null);return s.setNumBits(i.length),s},t.highLevelDecode=function(e){return this.getEncodedData(e)},t.getEncodedData=function(e){for(var n=e.length,r=Ke.UPPER,i=Ke.UPPER,o="",a=0;a<n;)if(i===Ke.BINARY){if(n-a<5)break;var s=t.readCode(e,a,5);if(a+=5,s===0){if(n-a<11)break;s=t.readCode(e,a,11)+31,a+=11}for(var l=0;l<s;l++){if(n-a<8){a=n;break}var u=t.readCode(e,a,8);o+=_e.castAsNonUtf8Char(u),a+=8}i=r}else{var c=i===Ke.DIGIT?4:5;if(n-a<c)break;var u=t.readCode(e,a,c);a+=c;var f=t.getCharacter(i,u);f.startsWith("CTRL_")?(r=i,i=t.getTable(f.charAt(5)),f.charAt(6)==="L"&&(r=i)):(o+=f,i=r)}return o},t.getTable=function(e){switch(e){case"L":return Ke.LOWER;case"P":return Ke.PUNCT;case"M":return Ke.MIXED;case"D":return Ke.DIGIT;case"B":return Ke.BINARY;case"U":default:return Ke.UPPER}},t.getCharacter=function(e,n){switch(e){case Ke.UPPER:return t.UPPER_TABLE[n];case Ke.LOWER:return t.LOWER_TABLE[n];case Ke.MIXED:return t.MIXED_TABLE[n];case Ke.PUNCT:return t.PUNCT_TABLE[n];case Ke.DIGIT:return t.DIGIT_TABLE[n];default:throw new Ur("Bad table")}},t.prototype.correctBits=function(e){var n,r;this.ddata.getNbLayers()<=2?(r=6,n=lt.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(r=8,n=lt.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(r=10,n=lt.AZTEC_DATA_10):(r=12,n=lt.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),o=e.length/r;if(o<i)throw new L;for(var a=e.length%r,s=new Int32Array(o),l=0;l<o;l++,a+=r)s[l]=t.readCode(e,a,r);try{var u=new Mi(n);u.decode(s,o-i)}catch(y){throw new L(y)}for(var c=(1<<r)-1,f=0,l=0;l<i;l++){var d=s[l];if(d===0||d===c)throw new L;(d===1||d===c-1)&&f++}for(var h=new Array(i*r-f),p=0,l=0;l<i;l++){var d=s[l];if(d===1||d===c-1)h.fill(d>1,p,p+r-1),p+=r-1;else for(var m=r-1;m>=0;--m)h[p++]=(d&1<<m)!==0}return h},t.prototype.extractBits=function(e){var n=this.ddata.isCompact(),r=this.ddata.getNbLayers(),i=(n?11:14)+r*4,o=new Int32Array(i),a=new Array(this.totalBitsInLayer(r,n));if(n)for(var s=0;s<o.length;s++)o[s]=s;else for(var l=i+1+2*J.truncDivision(J.truncDivision(i,2)-1,15),u=i/2,c=J.truncDivision(l,2),s=0;s<u;s++){var f=s+J.truncDivision(s,15);o[u-s-1]=c-f-1,o[u+s]=c+f+1}for(var s=0,d=0;s<r;s++){for(var h=(r-s)*4+(n?9:12),p=s*2,m=i-1-p,y=0;y<h;y++)for(var w=y*2,_=0;_<2;_++)a[d+w+_]=e.get(o[p+_],o[p+y]),a[d+2*h+w+_]=e.get(o[p+y],o[m-_]),a[d+4*h+w+_]=e.get(o[m-_],o[m-y]),a[d+6*h+w+_]=e.get(o[m-y],o[p+_]);d+=h*8}return a},t.readCode=function(e,n,r){for(var i=0,o=n;o<n+r;o++)i<<=1,e[o]&&(i|=1);return i},t.readByte=function(e,n){var r=e.length-n;return r>=8?t.readCode(e,n,8):t.readCode(e,n,r)<<8-r},t.convertBoolArrayToByteArray=function(e){for(var n=new Uint8Array((e.length+7)/8),r=0;r<n.length;r++)n[r]=t.readByte(e,8*r);return n},t.prototype.totalBitsInLayer=function(e,n){return((n?88:112)+16*e)*e},t.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],t.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],t.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",` 5`,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],t.PUNCT_TABLE=["","\r",`\r 6`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],t.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],t})(),re=(function(){function t(){}return t.round=function(e){return isNaN(e)?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0},t.distance=function(e,n,r,i){var o=e-r,a=n-i;return Math.sqrt(o*o+a*a)},t.sum=function(e){for(var n=0,r=0,i=e.length;r!==i;r++){var o=e[r];n+=o}return n},t})(),fo=(function(){function t(){}return t.floatToIntBits=function(e){return e},t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t})(),z=(function(){function t(e,n){this.x=e,this.y=n}return t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t.prototype.equals=function(e){if(e instanceof t){var n=e;return this.x===n.x&&this.y===n.y}return!1}
6,t.prototype.hashCode=function(){return 31*fo.floatToIntBits(this.x)+fo.floatToIntBits(this.y)},t.prototype.toString=function(){return"("+this.x+","+this.y+")"},t.orderBestPatterns=function(e){var n=this.distance(e[0],e[1]),r=this.distance(e[1],e[2]),i=this.distance(e[0],e[2]),o,a,s;if(r>=n&&r>=i?(a=e[0],o=e[1],s=e[2]):i>=r&&i>=n?(a=e[1],o=e[0],s=e[2]):(a=e[2],o=e[0],s=e[1]),this.crossProductZ(o,a,s)<0){var l=o;o=s,s=l}e[0]=o,e[1]=a,e[2]=s},t.distance=function(e,n){return re.distance(e.x,e.y,n.x,n.y)},t.crossProductZ=function(e,n,r){var i=n.x,o=n.y;return(r.x-i)*(e.y-o)-(r.y-o)*(e.x-i)},t})(),zo=(function(){function t(e,n){this.bits=e,this.points=n}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t})(),ld=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ud=(function(t){ld(e,t);function e(n,r,i,o,a){var s=t.call(this,n,r)||this;return s.compact=i,s.nbDatablocks=o,s.nbLayers=a,s}return e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e})(zo),ho=(function(){function t(e,n,r,i){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),n==null&&(n=t.INIT_SIZE),r==null&&(r=e.getWidth()/2|0),i==null&&(i=e.getHeight()/2|0);var o=n/2|0;if(this.leftInit=r-o,this.rightInit=r+o,this.upInit=i-o,this.downInit=i+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new k}return t.prototype.detect=function(){for(var e=this.leftInit,n=this.rightInit,r=this.upInit,i=this.downInit,o=!1,a=!0,s=!1,l=!1,u=!1,c=!1,f=!1,d=this.width,h=this.height;a;){a=!1;for(var p=!0;(p||!l)&&n<d;)p=this.containsBlackPoint(r,i,n,!1),p?(n++,a=!0,l=!0):l||n++;if(n>=d){o=!0;break}for(var m=!0;(m||!u)&&i<h;)m=this.containsBlackPoint(e,n,i,!0),m?(i++,a=!0,u=!0):u||i++;if(i>=h){o=!0;break}for(var y=!0;(y||!c)&&e>=0;)y=this.containsBlackPoint(r,i,e,!1),y?(e--,a=!0,c=!0):c||e--;if(e<0){o=!0;break}for(var w=!0;(w||!f)&&r>=0;)w=this.containsBlackPoint(e,n,r,!0),w?(r--,a=!0,f=!0):f||r--;if(r<0){o=!0;break}a&&(s=!0)}if(!o&&s){for(var _=n-e,C=null,E=1;C===null&&E<_;E++)C=this.getBlackPointOnSegment(e,i-E,e+E,i);if(C==null)throw new k;for(var I=null,E=1;I===null&&E<_;E++)I=this.getBlackPointOnSegment(e,r+E,e+E,r);if(I==null)throw new k;for(var O=null,E=1;O===null&&E<_;E++)O=this.getBlackPointOnSegment(n,r+E,n-E,r);if(O==null)throw new k;for(var x=null,E=1;x===null&&E<_;E++)x=this.getBlackPointOnSegment(n,i-E,n-E,i);if(x==null)throw new k;return this.centerEdges(x,C,O,I)}else throw new k},t.prototype.getBlackPointOnSegment=function(e,n,r,i){for(var o=re.round(re.distance(e,n,r,i)),a=(r-e)/o,s=(i-n)/o,l=this.image,u=0;u<o;u++){var c=re.round(e+u*a),f=re.round(n+u*s);if(l.get(c,f))return new z(c,f)}return null},t.prototype.centerEdges=function(e,n,r,i){var o=e.getX(),a=e.getY(),s=n.getX(),l=n.getY(),u=r.getX(),c=r.getY(),f=i.getX(),d=i.getY(),h=t.CORR;return o<this.width/2?[new z(f-h,d+h),new z(s+h,l+h),new z(u-h,c-h),new z(o+h,a-h)]:[new z(f+h,d+h),new z(s+h,l-h),new z(u-h,c+h),new z(o-h,a-h)]},t.prototype.containsBlackPoint=function(e,n,r,i){var o=this.image;if(i){for(var a=e;a<=n;a++)if(o.get(a,r))return!0}else for(var s=e;s<=n;s++)if(o.get(r,s))return!0;return!1},t.INIT_SIZE=10,t.CORR=1,t})(),Ma=(function(){function t(){}return t.checkAndNudgePoints=function(e,n){for(var r=e.getWidth(),i=e.getHeight(),o=!0,a=0;a<n.length&&o;a+=2){var s=Math.floor(n[a]),l=Math.floor(n[a+1]);if(s<-1||s>r||l<-1||l>i)throw new k;o=!1,s===-1?(n[a]=0,o=!0):s===r&&(n[a]=r-1,o=!0),l===-1?(n[a+1]=0,o=!0):l===i&&(n[a+1]=i-1,o=!0)}o=!0;for(var a=n.length-2;a>=0&&o;a-=2){var s=Math.floor(n[a]),l=Math.floor(n[a+1]);if(s<-1||s>r||l<-1||l>i)throw new k;o=!1,s===-1?(n[a]=0,o=!0):s===r&&(n[a]=r-1,o=!0),l===-1?(n[a+1]=0,o=!0):l===i&&(n[a+1]=i-1,o=!0)}},t})(),Ll=(function(){function t(e,n,r,i,o,a,s,l,u){this.a11=e,this.a21=n,this.a31=r,this.a12=i,this.a22=o,this.a32=a,this.a13=s,this.a23=l,this.a33=u}return t.quadrilateralToQuadrilateral=function(e,n,r,i,o,a,s,l,u,c,f,d,h,p,m,y){var w=t.quadrilateralToSquare(e,n,r,i,o,a,s,l),_=t.squareToQuadrilateral(u,c,f,d,h,p,m,y);return _.times(w)},t.prototype.transformPoints=function(e){for(var n=e.length,r=this.a11,i=this.a12,o=this.a13,a=this.a21,s=this.a22,l=this.a23,u=this.a31,c=this.a32,f=this.a33,d=0;d<n;d+=2){var h=e[d],p=e[d+1],m=o*h+l*p+f;e[d]=(r*h+a*p+u)/m,e[d+1]=(i*h+s*p+c)/m}},t.prototype.transformPointsWithValues=function(e,n){for(var r=this.a11,i=this.a12,o=this.a13,a=this.a21,s=this.a22,l=this.a23,u=this.a31,c=this.a32,f=this.a33,d=e.length,h=0;h<d;h++){var p=e[h],m=n[h],y=o*p+l*m+f;e[h]=(r*p+a*m+u)/y,n[h]=(i*p+s*m+c)/y}},t.squareToQuadrilateral=function(e,n,r,i,o,a,s,l){var u=e-r+o-s,c=n-i+a-l;if(u===0&&c===0)return new t(r-e,o-r,e,i-n,a-i,n,0,0,1);var f=r-o,d=s-o,h=i-a,p=l-a,m=f*p-d*h,y=(u*p-d*c)/m,w=(f*c-u*h)/m;return new t(r-e+y*r,s-e+w*s,e,i-n+y*i,l-n+w*l,n,y,w,1)},t.quadrilateralToSquare=function(e,n,r,i,o,a,s,l){return t.squareToQuadrilateral(e,n,r,i,o,a,s,l).buildAdjoint(
6)},t.prototype.buildAdjoint=function(){return new t(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},t.prototype.times=function(e){return new t(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)},t})(),cd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),fd=(function(t){cd(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.sampleGrid=function(n,r,i,o,a,s,l,u,c,f,d,h,p,m,y,w,_,C,E){var I=Ll.quadrilateralToQuadrilateral(o,a,s,l,u,c,f,d,h,p,m,y,w,_,C,E);return this.sampleGridWithTransform(n,r,i,I)},e.prototype.sampleGridWithTransform=function(n,r,i,o){if(r<=0||i<=0)throw new k;for(var a=new Vt(r,i),s=new Float32Array(2*r),l=0;l<i;l++){for(var u=s.length,c=l+.5,f=0;f<u;f+=2)s[f]=f/2+.5,s[f+1]=c;o.transformPoints(s),Ma.checkAndNudgePoints(n,s);try{for(var f=0;f<u;f+=2)n.get(Math.floor(s[f]),Math.floor(s[f+1]))&&a.set(f/2,l)}catch{throw new k}}return a},e})(Ma),Go=(function(){function t(){}return t.setGridSampler=function(e){t.gridSampler=e},t.getInstance=function(){return t.gridSampler},t.gridSampler=new fd,t})(),at=(function(){function t(e,n){this.x=e,this.y=n}return t.prototype.toResultPoint=function(){return new z(this.getX(),this.getY())},t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t})(),dd=(function(){function t(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}return t.prototype.detect=function(){return this.detectMirror(!1)},t.prototype.detectMirror=function(e){var n=this.getMatrixCenter(),r=this.getBullsEyeCorners(n);if(e){var i=r[0];r[0]=r[2],r[2]=i}this.extractParameters(r);var o=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),a=this.getMatrixCornerPoints(r);return new ud(o,a,this.compact,this.nbDataBlocks,this.nbLayers)},t.prototype.extractParameters=function(e){if(!this.isValidPoint(e[0])||!this.isValidPoint(e[1])||!this.isValidPoint(e[2])||!this.isValidPoint(e[3]))throw new k;var n=2*this.nbCenterLayers,r=new Int32Array([this.sampleLine(e[0],e[1],n),this.sampleLine(e[1],e[2],n),this.sampleLine(e[2],e[3],n),this.sampleLine(e[3],e[0],n)]);this.shift=this.getRotation(r,n);for(var i=0,o=0;o<4;o++){var a=r[(this.shift+o)%4];this.compact?(i<<=7,i+=a>>1&127):(i<<=10,i+=(a>>2&992)+(a>>1&31))}var s=this.getCorrectedParameterData(i,this.compact);this.compact?(this.nbLayers=(s>>6)+1,this.nbDataBlocks=(s&63)+1):(this.nbLayers=(s>>11)+1,this.nbDataBlocks=(s&2047)+1)},t.prototype.getRotation=function(e,n){var r=0;e.forEach(function(o,a,s){var l=(o>>n-2<<1)+(o&1);r=(r<<3)+l}),r=((r&1)<<11)+(r>>1);for(var i=0;i<4;i++)if(J.bitCount(r^this.EXPECTED_CORNER_BITS[i])<=2)return i;throw new k},t.prototype.getCorrectedParameterData=function(e,n){var r,i;n?(r=7,i=2):(r=10,i=4);for(var o=r-i,a=new Int32Array(r),s=r-1;s>=0;--s)a[s]=e&15,e>>=4;try{var l=new Mi(lt.AZTEC_PARAM);l.decode(a,o)}catch{throw new k}for(var u=0,s=0;s<i;s++)u=(u<<4)+a[s];return u},t.prototype.getBullsEyeCorners=function(e){var n=e,r=e,i=e,o=e,a=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var s=this.getFirstDifferent(n,a,1,-1),l=this.getFirstDifferent(r,a,1,1),u=this.getFirstDifferent(i,a,-1,1),c=this.getFirstDifferent(o,a,-1,-1);if(this.nbCenterLayers>2){var f=this.distancePoint(c,s)*this.nbCenterLayers/(this.distancePoint(o,n)*(this.nbCenterLayers+2));if(f<.75||f>1.25||!this.isWhiteOrBlackRectangle(s,l,u,c))break}n=s,r=l,i=u,o=c,a=!a}
6if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new k;this.compact=this.nbCenterLayers===5;var d=new z(n.getX()+.5,n.getY()-.5),h=new z(r.getX()+.5,r.getY()+.5),p=new z(i.getX()-.5,i.getY()+.5),m=new z(o.getX()-.5,o.getY()-.5);return this.expandSquare([d,h,p,m],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},t.prototype.getMatrixCenter=function(){var e,n,r,i;try{var o=new ho(this.image).detect();e=o[0],n=o[1],r=o[2],i=o[3]}catch{var a=this.image.getWidth()/2,s=this.image.getHeight()/2;e=this.getFirstDifferent(new at(a+7,s-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new at(a+7,s+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new at(a-7,s+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new at(a-7,s-7),!1,-1,-1).toResultPoint()}var l=re.round((e.getX()+i.getX()+n.getX()+r.getX())/4),u=re.round((e.getY()+i.getY()+n.getY()+r.getY())/4);try{var o=new ho(this.image,15,l,u).detect();e=o[0],n=o[1],r=o[2],i=o[3]}catch{e=this.getFirstDifferent(new at(l+7,u-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new at(l+7,u+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new at(l-7,u+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new at(l-7,u-7),!1,-1,-1).toResultPoint()}return l=re.round((e.getX()+i.getX()+n.getX()+r.getX())/4),u=re.round((e.getY()+i.getY()+n.getY()+r.getY())/4),new at(l,u)},t.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},t.prototype.sampleGrid=function(e,n,r,i,o){var a=Go.getInstance(),s=this.getDimension(),l=s/2-this.nbCenterLayers,u=s/2+this.nbCenterLayers;return a.sampleGrid(e,s,s,l,l,u,l,u,u,l,u,n.getX(),n.getY(),r.getX(),r.getY(),i.getX(),i.getY(),o.getX(),o.getY())},t.prototype.sampleLine=function(e,n,r){for(var i=0,o=this.distanceResultPoint(e,n),a=o/r,s=e.getX(),l=e.getY(),u=a*(n.getX()-e.getX())/o,c=a*(n.getY()-e.getY())/o,f=0;f<r;f++)this.image.get(re.round(s+f*u),re.round(l+f*c))&&(i|=1<<r-f-1);return i},t.prototype.isWhiteOrBlackRectangle=function(e,n,r,i){var o=3;e=new at(e.getX()-o,e.getY()+o),n=new at(n.getX()-o,n.getY()-o),r=new at(r.getX()+o,r.getY()-o),i=new at(i.getX()+o,i.getY()+o);var a=this.getColor(i,e);if(a===0)return!1;var s=this.getColor(e,n);return s!==a||(s=this.getColor(n,r),s!==a)?!1:(s=this.getColor(r,i),s===a)},t.prototype.getColor=function(e,n){for(var r=this.distancePoint(e,n),i=(n.getX()-e.getX())/r,o=(n.getY()-e.getY())/r,a=0,s=e.getX(),l=e.getY(),u=this.image.get(e.getX(),e.getY()),c=Math.ceil(r),f=0;f<c;f++)s+=i,l+=o,this.image.get(re.round(s),re.round(l))!==u&&a++;var d=a/r;return d>.1&&d<.9?0:d<=.1===u?1:-1},t.prototype.getFirstDifferent=function(e,n,r,i){for(var o=e.getX()+r,a=e.getY()+i;this.isValid(o,a)&&this.image.get(o,a)===n;)o+=r,a+=i;for(o-=r,a-=i;this.isValid(o,a)&&this.image.get(o,a)===n;)o+=r;for(o-=r;this.isValid(o,a)&&this.image.get(o,a)===n;)a+=i;return a-=i,new at(o,a)},t.prototype.expandSquare=function(e,n,r){var i=r/(2*n),o=e[0].getX()-e[2].getX(),a=e[0].getY()-e[2].getY(),s=(e[0].getX()+e[2].getX())/2,l=(e[0].getY()+e[2].getY())/2,u=new z(s+i*o,l+i*a),c=new z(s-i*o,l-i*a);o=e[1].getX()-e[3].getX(),a=e[1].getY()-e[3].getY(),s=(e[1].getX()+e[3].getX())/2,l=(e[1].getY()+e[3].getY())/2;var f=new z(s+i*o,l+i*a),d=new z(s-i*o,l-i*a),h=[u,f,c,d];return h},t.prototype.isValid=function(e,n){return e>=0&&e<this.image.getWidth()&&n>0&&n<this.image.getHeight()},t.prototype.isValidPoint=function(e){var n=re.round(e.getX()),r=re.round(e.getY());return this.isValid(n,r)},t.prototype.distancePoint=function(e,n){return re.distance(e.getX(),e.getY(),n.getX(),n.getY())},t.prototype.distanceResultPoint=function(e,n){return re.distance(e.getX(),e.getY(),n.getX(),n.getY())},t.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(J.truncDivision(this.nbLayers-4,8)+1)+15},t})(),po=(function(){function t(){}
6return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r=null,i=new dd(e.getBlackMatrix()),o=null,a=null;try{var s=i.detectMirror(!1);o=s.getPoints(),this.reportFoundResultPoints(n,o),a=new Oa().decode(s)}catch(f){r=f}if(a==null)try{var s=i.detectMirror(!0);o=s.getPoints(),this.reportFoundResultPoints(n,o),a=new Oa().decode(s)}catch(f){throw r??f}var l=new ht(a.getText(),a.getRawBytes(),a.getNumBits(),o,X.AZTEC,Ce.currentTimeMillis()),u=a.getByteSegments();u!=null&&l.putMetadata(je.BYTE_SEGMENTS,u);var c=a.getECLevel();return c!=null&&l.putMetadata(je.ERROR_CORRECTION_LEVEL,c),l},t.prototype.reportFoundResultPoints=function(e,n){if(e!=null){var r=e.get(Me.NEED_RESULT_POINT_CALLBACK);r!=null&&n.forEach(function(i,o,a){r.foundPossibleResultPoint(i)})}},t.prototype.reset=function(){},t})(),hd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){hd(e,t);function e(n){return n===void 0&&(n=500),t.call(this,new po,n)||this}return e})(er);var Ye=(function(){function t(){}return t.prototype.decode=function(e,n){try{return this.doDecode(e,n)}catch{var r=n&&n.get(Me.TRY_HARDER)===!0;if(r&&e.isRotateSupported()){var i=e.rotateCounterClockwise(),o=this.doDecode(i,n),a=o.getResultMetadata(),s=270;a!==null&&a.get(je.ORIENTATION)===!0&&(s=s+a.get(je.ORIENTATION)%360),o.putMetadata(je.ORIENTATION,s);var l=o.getResultPoints();if(l!==null)for(var u=i.getHeight(),c=0;c<l.length;c++)l[c]=new z(u-l[c].getY()-1,l[c].getX());return o}else throw new k}},t.prototype.reset=function(){},t.prototype.doDecode=function(e,n){var r=e.getWidth(),i=e.getHeight(),o=new Ge(r),a=n&&n.get(Me.TRY_HARDER)===!0,s=Math.max(1,i>>(a?8:5)),l;a?l=i:l=15;for(var u=Math.trunc(i/2),c=0;c<l;c++){var f=Math.trunc((c+1)/2),d=(c&1)===0,h=u+s*(d?f:-f);if(h<0||h>=i)break;try{o=e.getBlackRow(h,o)}catch{continue}for(var p=function(_){if(_===1&&(o.reverse(),n&&n.get(Me.NEED_RESULT_POINT_CALLBACK)===!0)){var C=new Map;n.forEach(function(O,x){return C.set(x,O)}),C.delete(Me.NEED_RESULT_POINT_CALLBACK),n=C}try{var E=m.decodeRow(h,o,n);if(_===1){E.putMetadata(je.ORIENTATION,180);var I=E.getResultPoints();I!==null&&(I[0]=new z(r-I[0].getX()-1,I[0].getY()),I[1]=new z(r-I[1].getX()-1,I[1].getY()))}return{value:E}}catch{}},m=this,y=0;y<2;y++){var w=p(y);if(typeof w=="object")return w.value}}throw new k},t.recordPattern=function(e,n,r){for(var i=r.length,o=0;o<i;o++)r[o]=0;var a=e.getSize();if(n>=a)throw new k;for(var s=!e.get(n),l=0,u=n;u<a;){if(e.get(u)!==s)r[l]++;else{if(++l===i)break;r[l]=1,s=!s}u++}if(!(l===i||l===i-1&&u===a))throw new k},t.recordPatternInReverse=function(e,n,r){for(var i=r.length,o=e.get(n);n>0&&i>=0;)e.get(--n)!==o&&(i--,o=!o);if(i>=0)throw new k;t.recordPattern(e,n+1,r)},t.patternMatchVariance=function(e,n,r){for(var i=e.length,o=0,a=0,s=0;s<i;s++)o+=e[s],a+=n[s];if(o<a)return Number.POSITIVE_INFINITY;var l=o/a;r*=l;for(var u=0,c=0;c<i;c++){var f=e[c],d=n[c]*l,h=f>d?f-d:d-f;if(h>r)return Number.POSITIVE_INFINITY;u+=h}return u/o},t})(),pd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ra=(function(t){pd(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.findStartPattern=function(n){for(var r=n.getSize(),i=n.getNextSet(0),o=0,a=Int32Array.from([0,0,0,0,0,0]),s=i,l=!1,u=6,c=i;c<r;c++)if(n.get(c)!==l)a[o]++;else{if(o===u-1){for(var f=e.MAX_AVG_VARIANCE,d=-1,h=e.CODE_START_A;h<=e.CODE_START_C;h++){var p=Ye.patternMatchVariance(a,e.CODE_PATTERNS[h],e.MAX_INDIVIDUAL_VARIANCE);p<f&&(f=p,d=h)}if(d>=0&&n.isRange(Math.max(0,s-(c-s)/2),s,!1))return Int32Array.from([s,c,d]);s+=a[0]+a[1],a=a.slice(2,a.length-1),a[o-1]=0,a[o]=0,o--}else o++;a[o]=1,l=!l}throw new k},e.decodeCode=function(n,r,i){Ye.recordPattern(n,i,r);
6for(var o=e.MAX_AVG_VARIANCE,a=-1,s=0;s<e.CODE_PATTERNS.length;s++){var l=e.CODE_PATTERNS[s],u=this.patternMatchVariance(r,l,e.MAX_INDIVIDUAL_VARIANCE);u<o&&(o=u,a=s)}if(a>=0)return a;throw new k},e.prototype.decodeRow=function(n,r,i){var o=i&&i.get(Me.ASSUME_GS1)===!0,a=e.findStartPattern(r),s=a[2],l=0,u=new Uint8Array(20);u[l++]=s;var c;switch(s){case e.CODE_START_A:c=e.CODE_CODE_A;break;case e.CODE_START_B:c=e.CODE_CODE_B;break;case e.CODE_START_C:c=e.CODE_CODE_C;break;default:throw new L}for(var f=!1,d=!1,h="",p=a[0],m=a[1],y=Int32Array.from([0,0,0,0,0,0]),w=0,_=0,C=s,E=0,I=!0,O=!1,x=!1;!f;){var R=d;switch(d=!1,w=_,_=e.decodeCode(r,y,m),u[l++]=_,_!==e.CODE_STOP&&(I=!0),_!==e.CODE_STOP&&(E++,C+=E*_),p=m,m+=y.reduce(function(Ze,Zt){return Ze+Zt},0),_){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new L}switch(c){case e.CODE_CODE_A:if(_<64)x===O?h+=String.fromCharCode(32+_):h+=String.fromCharCode(32+_+128),x=!1;else if(_<96)x===O?h+=String.fromCharCode(_-64):h+=String.fromCharCode(_+64),x=!1;else switch(_!==e.CODE_STOP&&(I=!1),_){case e.CODE_FNC_1:o&&(h.length===0?h+="]C1":h+="�");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!O&&x?(O=!0,x=!1):O&&x?(O=!1,x=!1):x=!0;break;case e.CODE_SHIFT:d=!0,c=e.CODE_CODE_B;break;case e.CODE_CODE_B:c=e.CODE_CODE_B;break;case e.CODE_CODE_C:c=e.CODE_CODE_C;break;case e.CODE_STOP:f=!0;break}break;case e.CODE_CODE_B:if(_<96)x===O?h+=String.fromCharCode(32+_):h+=String.fromCharCode(32+_+128),x=!1;else switch(_!==e.CODE_STOP&&(I=!1),_){case e.CODE_FNC_1:o&&(h.length===0?h+="]C1":h+="�");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!O&&x?(O=!0,x=!1):O&&x?(O=!1,x=!1):x=!0;break;case e.CODE_SHIFT:d=!0,c=e.CODE_CODE_A;break;case e.CODE_CODE_A:c=e.CODE_CODE_A;break;case e.CODE_CODE_C:c=e.CODE_CODE_C;break;case e.CODE_STOP:f=!0;break}break;case e.CODE_CODE_C:if(_<100)_<10&&(h+="0"),h+=_;else switch(_!==e.CODE_STOP&&(I=!1),_){case e.CODE_FNC_1:o&&(h.length===0?h+="]C1":h+="�");break;case e.CODE_CODE_A:c=e.CODE_CODE_A;break;case e.CODE_CODE_B:c=e.CODE_CODE_B;break;case e.CODE_STOP:f=!0;break}break}R&&(c=c===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var N=m-p;if(m=r.getNextUnset(m),!r.isRange(m,Math.min(r.getSize(),m+(m-p)/2),!1))throw new k;if(C-=E*w,C%103!==w)throw new Xe;var F=h.length;if(F===0)throw new k;F>0&&I&&(c===e.CODE_CODE_C?h=h.substring(0,F-2):h=h.substring(0,F-1));for(var W=(a[1]+a[0])/2,$=p+N/2,Z=u.length,Ae=new Uint8Array(Z),ee=0;ee<Z;ee++)Ae[ee]=u[ee];var De=[new z(W,n),new z($,n)];return new ht(h,Ae,0,De,X.CODE_128,new Date().getTime())},e.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],e.MAX_AVG_VARIANCE=.25,e.MAX_INDIVIDUAL_VARIA
6NCE=.7,e.CODE_SHIFT=98,e.CODE_CODE_C=99,e.CODE_CODE_B=100,e.CODE_CODE_A=101,e.CODE_FNC_1=102,e.CODE_FNC_2=97,e.CODE_FNC_3=96,e.CODE_FNC_4_A=101,e.CODE_FNC_4_B=100,e.CODE_START_A=103,e.CODE_START_B=104,e.CODE_START_C=105,e.CODE_STOP=106,e})(Ye),gd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Hi=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Da=(function(t){gd(e,t);function e(n,r){n===void 0&&(n=!1),r===void 0&&(r=!1);var i=t.call(this)||this;return i.usingCheckDigit=n,i.extendedMode=r,i.decodeRowResult="",i.counters=new Int32Array(9),i}return e.prototype.decodeRow=function(n,r,i){var o,a,s,l,u=this.counters;u.fill(0),this.decodeRowResult="";var c=e.findAsteriskPattern(r,u),f=r.getNextSet(c[1]),d=r.getSize(),h,p;do{e.recordPattern(r,f,u);var m=e.toNarrowWidePattern(u);if(m<0)throw new k;h=e.patternToChar(m),this.decodeRowResult+=h,p=f;try{for(var y=(o=void 0,Hi(u)),w=y.next();!w.done;w=y.next()){var _=w.value;f+=_}}catch(Z){o={error:Z}}finally{try{w&&!w.done&&(a=y.return)&&a.call(y)}finally{if(o)throw o.error}}f=r.getNextSet(f)}while(h!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var C=0;try{for(var E=Hi(u),I=E.next();!I.done;I=E.next()){var _=I.value;C+=_}}catch(Z){s={error:Z}}finally{try{I&&!I.done&&(l=E.return)&&l.call(E)}finally{if(s)throw s.error}}var O=f-p-C;if(f!==d&&O*2<C)throw new k;if(this.usingCheckDigit){for(var x=this.decodeRowResult.length-1,R=0,N=0;N<x;N++)R+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(N));if(this.decodeRowResult.charAt(x)!==e.ALPHABET_STRING.charAt(R%43))throw new Xe;this.decodeRowResult=this.decodeRowResult.substring(0,x)}if(this.decodeRowResult.length===0)throw new k;var F;this.extendedMode?F=e.decodeExtended(this.decodeRowResult):F=this.decodeRowResult;var W=(c[1]+c[0])/2,$=p+C/2;return new ht(F,null,0,[new z(W,n),new z($,n)],X.CODE_39,new Date().getTime())},e.findAsteriskPattern=function(n,r){for(var i=n.getSize(),o=n.getNextSet(0),a=0,s=o,l=!1,u=r.length,c=o;c<i;c++)if(n.get(c)!==l)r[a]++;else{if(a===u-1){if(this.toNarrowWidePattern(r)===e.ASTERISK_ENCODING&&n.isRange(Math.max(0,s-Math.floor((c-s)/2)),s,!1))return[s,c];s+=r[0]+r[1],r.copyWithin(0,2,2+a-1),r[a-1]=0,r[a]=0,a--}else a++;r[a]=1,l=!l}throw new k},e.toNarrowWidePattern=function(n){var r,i,o=n.length,a=0,s;do{var l=2147483647;try{for(var u=(r=void 0,Hi(n)),c=u.next();!c.done;c=u.next()){var f=c.value;f<l&&f>a&&(l=f)}}catch(m){r={error:m}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}a=l,s=0;for(var d=0,h=0,p=0;p<o;p++){var f=n[p];f>a&&(h|=1<<o-1-p,s++,d+=f)}if(s===3){for(var p=0;p<o&&s>0;p++){var f=n[p];if(f>a&&(s--,f*2>=d))return-1}return h}}while(s>3);return-1},e.patternToChar=function(n){for(var r=0;r<e.CHARACTER_ENCODINGS.length;r++)if(e.CHARACTER_ENCODINGS[r]===n)return e.ALPHABET_STRING.charAt(r);if(n===e.ASTERISK_ENCODING)return"*";throw new k},e.decodeExtended=function(n){for(var r=n.length,i="",o=0;o<r;o++){var a=n.charAt(o);if(a==="+"||a==="$"||a==="%"||a==="/"){var s=n.charAt(o+1),l="\0";switch(a){case"+":if(s>="A"&&s<="Z")l=String.fromCharCode(s.charCodeAt(0)+32);else throw new L;break;case"$":if(s>="A"&&s<="Z")l=String.fromCharCode(s.charCodeAt(0)-64);else throw new L;break;case"%":if(s>="A"&&s<="E")l=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")l=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")l=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")l="\0";else if(s==="V")l="@";else if(s==="W")l="`";else if(s==="X"||s==="Y"||s==="Z")l="�";else throw new L;break;case"/":if(s>="A"&&s<="O")l=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")l=":";else throw new L;break}i+=l,o++}else i+=a}return i},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],e.ASTERISK_ENCODING=148,e})(Ye),vd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
6e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),md=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ka=(function(t){vd(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.narrowLineWidth=-1,n}return e.prototype.decodeRow=function(n,r,i){var o,a,s=this.decodeStart(r),l=this.decodeEnd(r),u=new xe;e.decodeMiddle(r,s[1],l[0],u);var c=u.toString(),f=null;i!=null&&(f=i.get(Me.ALLOWED_LENGTHS)),f==null&&(f=e.DEFAULT_ALLOWED_LENGTHS);var d=c.length,h=!1,p=0;try{for(var m=md(f),y=m.next();!y.done;y=m.next()){var w=y.value;if(d===w){h=!0;break}w>p&&(p=w)}}catch(E){o={error:E}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}if(!h&&d>p&&(h=!0),!h)throw new L;var _=[new z(s[1],n),new z(l[0],n)],C=new ht(c,null,0,_,X.ITF,new Date().getTime());return C},e.decodeMiddle=function(n,r,i,o){var a=new Int32Array(10),s=new Int32Array(5),l=new Int32Array(5);for(a.fill(0),s.fill(0),l.fill(0);r<i;){Ye.recordPattern(n,r,a);for(var u=0;u<5;u++){var c=2*u;s[u]=a[c],l[u]=a[c+1]}var f=e.decodeDigit(s);o.append(f.toString()),f=this.decodeDigit(l),o.append(f.toString()),a.forEach(function(d){r+=d})}},e.prototype.decodeStart=function(n){var r=e.skipWhiteSpace(n),i=e.findGuardPattern(n,r,e.START_PATTERN);return this.narrowLineWidth=(i[1]-i[0])/4,this.validateQuietZone(n,i[0]),i},e.prototype.validateQuietZone=function(n,r){var i=this.narrowLineWidth*10;i=i<r?i:r;for(var o=r-1;i>0&&o>=0&&!n.get(o);o--)i--;if(i!==0)throw new k},e.skipWhiteSpace=function(n){var r=n.getSize(),i=n.getNextSet(0);if(i===r)throw new k;return i},e.prototype.decodeEnd=function(n){n.reverse();try{var r=e.skipWhiteSpace(n),i=void 0;try{i=e.findGuardPattern(n,r,e.END_PATTERN_REVERSED[0])}catch(a){a instanceof k&&(i=e.findGuardPattern(n,r,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(n,i[0]);var o=i[0];return i[0]=n.getSize()-i[1],i[1]=n.getSize()-o,i}finally{n.reverse()}},e.findGuardPattern=function(n,r,i){var o=i.length,a=new Int32Array(o),s=n.getSize(),l=!1,u=0,c=r;a.fill(0);for(var f=r;f<s;f++)if(n.get(f)!==l)a[u]++;else{if(u===o-1){if(Ye.patternMatchVariance(a,i,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return[c,f];c+=a[0]+a[1],Ce.arraycopy(a,2,a,0,u-1),a[u-1]=0,a[u]=0,u--}else u++;a[u]=1,l=!l}throw new k},e.decodeDigit=function(n){for(var r=e.MAX_AVG_VARIANCE,i=-1,o=e.PATTERNS.length,a=0;a<o;a++){var s=e.PATTERNS[a],l=Ye.patternMatchVariance(n,s,e.MAX_INDIVIDUAL_VARIANCE);l<r?(r=l,i=a):l===r&&(i=-1)}if(i>=0)return i%10;throw new k},e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e})(Ye),yd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),zn=(function(t){yd(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.decodeRowStringBuffer="",n}return e.findStartGuardPattern=function(n){for(var r=!1,i,o=0,a=Int32Array.from([0,0,0]);!r;){a=Int32Array.from([0,0,0]),i=e.findGuardPattern(n,o,!1,this.START_END_PATTERN,a);var s=i[0];o=i[1];var l=s-(o-s);l>=0&&(r=n.isRange(l,s,!1))}return i},e.checkChecksum=function(n){return e.checkStandardUPCEANChecksum(n)},e.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var i=parseInt(n.charAt(r-1),10);return e.getStandardUPCEANChecksum(n.substring(0,r-1))===i},e.getStandardUPCEANChecksum=function(n){for(var r=n.length,i=0,o=r-1;o>=0;
6o-=2){var a=n.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new L;i+=a}i*=3;for(var o=r-2;o>=0;o-=2){var a=n.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new L;i+=a}return(1e3-i)%10},e.decodeEnd=function(n,r){return e.findGuardPattern(n,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(n,r,i,o){return this.findGuardPattern(n,r,i,o,new Int32Array(o.length))},e.findGuardPattern=function(n,r,i,o,a){var s=n.getSize();r=i?n.getNextUnset(r):n.getNextSet(r);for(var l=0,u=r,c=o.length,f=i,d=r;d<s;d++)if(n.get(d)!==f)a[l]++;else{if(l===c-1){if(Ye.patternMatchVariance(a,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return Int32Array.from([u,d]);u+=a[0]+a[1];for(var h=a.slice(2,a.length-1),p=0;p<l-1;p++)a[p]=h[p];a[l-1]=0,a[l]=0,l--}else l++;a[l]=1,f=!f}throw new k},e.decodeDigit=function(n,r,i,o){this.recordPattern(n,i,r);for(var a=this.MAX_AVG_VARIANCE,s=-1,l=o.length,u=0;u<l;u++){var c=o[u],f=Ye.patternMatchVariance(r,c,e.MAX_INDIVIDUAL_VARIANCE);f<a&&(a=f,s=u)}if(s>=0)return s;throw new k},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],e})(Ye),xd=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},wd=(function(){function t(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,n,r){var i=this.decodeRowStringBuffer,o=this.decodeMiddle(n,r,i),a=i.toString(),s=t.parseExtensionString(a),l=[new z((r[0]+r[1])/2,e),new z(o,e)],u=new ht(a,null,0,l,X.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},t.prototype.decodeMiddle=function(e,n,r){var i,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),l=n[1],u=0,c=0;c<5&&l<s;c++){var f=zn.decodeDigit(e,a,l,zn.L_AND_G_PATTERNS);r+=String.fromCharCode(48+f%10);try{for(var d=(i=void 0,xd(a)),h=d.next();!h.done;h=d.next()){var p=h.value;l+=p}}catch(y){i={error:y}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}f>=10&&(u|=1<<4-c),c!==4&&(l=e.getNextSet(l),l=e.getNextUnset(l))}if(r.length!==5)throw new k;var m=this.determineCheckDigit(u);if(t.extensionChecksum(r.toString())!==m)throw new k;return l},t.extensionChecksum=function(e){for(var n=e.length,r=0,i=n-2;i>=0;i-=2)r+=e.charAt(i).charCodeAt(0)-48;r*=3;for(var i=n-1;i>=0;i-=2)r+=e.charAt(i).charCodeAt(0)-48;return r*=3,r%10},t.prototype.determineCheckDigit=function(e){for(var n=0;n<10;n++)if(e===this.CHECK_DIGIT_ENCODINGS[n])return n;throw new k},t.parseExtensionString=function(e){if(e.length!==5)return null;var n=t.parseExtension5String(e);return n==null?null:new Map([[je.SUGGESTED_PRICE,n]])},t.parseExtension5String=function(e){var n;switch(e.charAt(0)){case"0":n="£";break;case"5":n="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}n="";break;default:n="";break}var r=parseInt(e.substring(1)),i=(r/100).toString(),o=r%100,a=o<10?"0"+o:o.toString();return n+i+"."+a},t})(),_d=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},bd=(function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,n,r){var i=this.decodeRowStringBuffer,o=this.decodeMiddle(n,r,i),a=i.toString(),s=t.parseExtensionString(a),l=[new z((r[0]+r[1])/2,e),new z(o,e)],u=new ht(a,null,0,l,X.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},t.prototype.decodeMiddle=function(e,n,r){var i,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),l=n[1],u=0,c=0;c<2&&l<s;c++){var f=zn.decodeDigit(e,a,l,zn.L_AND_G_PATTERNS);r+=String.fromCharCode(48+f%10);try{for(var d=(i=void 0,_d(a)),h=d.next();!h.done;h=d.next()){var p=h.value;l+=p}}catch(m){i={error:m}}
6finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}f>=10&&(u|=1<<1-c),c!==1&&(l=e.getNextSet(l),l=e.getNextUnset(l))}if(r.length!==2)throw new k;if(parseInt(r.toString())%4!==u)throw new k;return l},t.parseExtensionString=function(e){return e.length!==2?null:new Map([[je.ISSUE_NUMBER,parseInt(e)]])},t})(),Cd=(function(){function t(){}return t.decodeRow=function(e,n,r){var i=zn.findGuardPattern(n,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var o=new wd;return o.decodeRow(e,n,i)}catch{var a=new bd;return a.decodeRow(e,n,i)}},t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),t})(),Ad=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Fe=(function(t){Ad(e,t);function e(){var n=t.call(this)||this;n.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var r=10;r<20;r++){for(var i=e.L_PATTERNS[r-10],o=new Int32Array(i.length),a=0;a<i.length;a++)o[a]=i[i.length-a-1];e.L_AND_G_PATTERNS[r]=o}return n}return e.prototype.decodeRow=function(n,r,i){var o=e.findStartGuardPattern(r),a=i==null?null:i.get(Me.NEED_RESULT_POINT_CALLBACK);if(a!=null){var s=new z((o[0]+o[1])/2,n);a.foundPossibleResultPoint(s)}var l=this.decodeMiddle(r,o,this.decodeRowStringBuffer),u=l.rowOffset,c=l.resultString;if(a!=null){var f=new z(u,n);a.foundPossibleResultPoint(f)}var d=e.decodeEnd(r,u);if(a!=null){var h=new z((d[0]+d[1])/2,n);a.foundPossibleResultPoint(h)}var p=d[1],m=p+(p-d[0]);if(m>=r.getSize()||!r.isRange(p,m,!1))throw new k;var y=c.toString();if(y.length<8)throw new L;if(!e.checkChecksum(y))throw new Xe;var w=(o[1]+o[0])/2,_=(d[1]+d[0])/2,C=this.getBarcodeFormat(),E=[new z(w,n),new z(_,n)],I=new ht(y,null,0,E,C,new Date().getTime()),O=0;try{var x=Cd.decodeRow(n,r,d[1]);I.putMetadata(je.UPC_EAN_EXTENSION,x.getText()),I.putAllMetadata(x.getResultMetadata()),I.addResultPoints(x.getResultPoints()),O=x.getText().length}catch{}var R=i==null?null:i.get(Me.ALLOWED_EAN_EXTENSIONS);if(R!=null){var N=!1;for(var F in R)if(O.toString()===F){N=!0;break}if(!N)throw new k}return C===X.EAN_13||X.UPC_A,I},e.checkChecksum=function(n){return e.checkStandardUPCEANChecksum(n)},e.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var i=parseInt(n.charAt(r-1),10);return e.getStandardUPCEANChecksum(n.substring(0,r-1))===i},e.getStandardUPCEANChecksum=function(n){for(var r=n.length,i=0,o=r-1;o>=0;o-=2){var a=n.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new L;i+=a}i*=3;for(var o=r-2;o>=0;o-=2){var a=n.charAt(o).charCodeAt(0)-48;if(a<0||a>9)throw new L;i+=a}return(1e3-i)%10},e.decodeEnd=function(n,r){return e.findGuardPattern(n,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e})(zn),Ed=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Pa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},go=(function(t){Ed(e,t);function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return e.prototype.decodeMiddle=function(n,r,i){var o,a,s,l,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=n.getSize(),f=r[1],d=0,h=0;h<6&&f<c;h++){var p=Fe.decodeDigit(n,u,f,Fe.L_AND_G_PATTERNS);i+=String.fromCharCode(48+p%10);try{for(var m=(o=void 0,Pa(u)),y=m.next();!y.done;y=m.next()){var w=y.value;f+=w}}catch(I){o={error:I}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}p>=10&&(d|=1<<5-h)}i=e.determineFirstDigit(i,d);var _=Fe.findGuardPattern(n,f,!0,Fe.MIDDLE_PATTERN,new Int32Array(Fe.MIDDLE_PATTERN.length).fill(0));f=_[1];for(var h=0;h<6&&f<c;h++){var p=Fe.decodeDigit(n,u,f,Fe.L_PATTERNS);i+=String.fromCharCode(48+p);try{for(var C=(s=void 0,Pa(u)),E=C.next();!E.done;E=C.next()){var w=E.value;f+=w}}catch(x){s={error:x}}finally{try{E&&!E.done&&(l=C.return)&&l.call(C)}finally{if(s)throw s.error}}}return{rowOffset:f,resultString:i}},e.prototype.getBarcodeFormat=function(){return X.EAN_13},e.determineFirstDigit=function(n,r){for(var i=0;i<10;i++)if(r===this.FIRST_DIGIT_ENCODINGS[i])return n=String.fromCharCode(48+i)+n,n;throw new k},e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],e})(Fe),Sd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
6e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Na=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ba=(function(t){Sd(e,t);function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return e.prototype.decodeMiddle=function(n,r,i){var o,a,s,l,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=n.getSize(),f=r[1],d=0;d<4&&f<c;d++){var h=Fe.decodeDigit(n,u,f,Fe.L_PATTERNS);i+=String.fromCharCode(48+h);try{for(var p=(o=void 0,Na(u)),m=p.next();!m.done;m=p.next()){var y=m.value;f+=y}}catch(E){o={error:E}}finally{try{m&&!m.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}}var w=Fe.findGuardPattern(n,f,!0,Fe.MIDDLE_PATTERN,new Int32Array(Fe.MIDDLE_PATTERN.length).fill(0));f=w[1];for(var d=0;d<4&&f<c;d++){var h=Fe.decodeDigit(n,u,f,Fe.L_PATTERNS);i+=String.fromCharCode(48+h);try{for(var _=(s=void 0,Na(u)),C=_.next();!C.done;C=_.next()){var y=C.value;f+=y}}catch(O){s={error:O}}finally{try{C&&!C.done&&(l=_.return)&&l.call(_)}finally{if(s)throw s.error}}}return{rowOffset:f,resultString:i}},e.prototype.getBarcodeFormat=function(){return X.EAN_8},e})(Fe),Id=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Fa=(function(t){Id(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.ean13Reader=new go,n}return e.prototype.getBarcodeFormat=function(){return X.UPC_A},e.prototype.decode=function(n,r){return this.maybeReturnResult(this.ean13Reader.decode(n))},e.prototype.decodeRow=function(n,r,i){return this.maybeReturnResult(this.ean13Reader.decodeRow(n,r,i))},e.prototype.decodeMiddle=function(n,r,i){return this.ean13Reader.decodeMiddle(n,r,i)},e.prototype.maybeReturnResult=function(n){var r=n.getText();if(r.charAt(0)==="0"){var i=new ht(r.substring(1),null,null,n.getResultPoints(),X.UPC_A);return n.getResultMetadata()!=null&&i.putAllMetadata(n.getResultMetadata()),i}else throw new k},e.prototype.reset=function(){this.ean13Reader.reset()},e})(Fe),Td=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Od=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},La=(function(t){Td(e,t);function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=new Int32Array(4),n}return e.prototype.decodeMiddle=function(n,r,i){var o,a,s=this.decodeMiddleCounters.map(function(y){return y});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var l=n.getSize(),u=r[1],c=0,f=0;f<6&&u<l;f++){var d=e.decodeDigit(n,s,u,e.L_AND_G_PATTERNS);i+=String.fromCharCode(48+d%10);try{for(var h=(o=void 0,Od(s)),p=h.next();!p.done;p=h.next()){var m=p.value;u+=m}}catch(y){o={error:y}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}d>=10&&(c|=1<<5-f)}return e.determineNumSysAndCheckDigit(new xe(i),c),u},e.prototype.decodeEnd=function(n,r){return e.findGuardPatternWithoutCounters(n,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(n){return Fe.checkChecksum(e.convertUPCEtoUPCA(n))},e.determineNumSysAndCheckDigit=function(n,r){for(var i=0;i<=1;i++)for(var o=0;o<10;o++)if(r===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[i][o]){n.insert(0,"0"+i),n.append("0"+o);return}throw k.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return X.UPC_E},e.convertUPCEtoUPCA=function(n){var r=n.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),i=new xe;i.append(n.charAt(0));var o=r[5];switch(o){case 0:case 1:case 2:i.appendChars(r,0,2),i.append(o),i.append("0000"),i.appendChars(r,2,3);break;case 3:i.appendChars(r,0,3),i.append("00000"),i.appendChars(r,3,2);break;case 4:i.appendChars(r,0,4),i.append("00000"),i.append(r[4]);break;default:i.appendChars(r,0,5),i.append("0000"),i.append(o);break}return n.length>=8&&i.append(n.charAt(7)),i.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e})(Fe),Md=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
6e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Va=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Wi=(function(t){Md(e,t);function e(n){var r=t.call(this)||this,i=n==null?null:n.get(Me.POSSIBLE_FORMATS),o=[];return i!=null&&(i.indexOf(X.EAN_13)>-1&&o.push(new go),i.indexOf(X.UPC_A)>-1&&o.push(new Fa),i.indexOf(X.EAN_8)>-1&&o.push(new Ba),i.indexOf(X.UPC_E)>-1&&o.push(new La)),o.length===0&&(o.push(new go),o.push(new Fa),o.push(new Ba),o.push(new La)),r.readers=o,r}return e.prototype.decodeRow=function(n,r,i){var o,a;try{for(var s=Va(this.readers),l=s.next();!l.done;l=s.next()){var u=l.value;try{var c=u.decodeRow(n,r,i),f=c.getBarcodeFormat()===X.EAN_13&&c.getText().charAt(0)==="0",d=i==null?null:i.get(Me.POSSIBLE_FORMATS),h=d==null||d.includes(X.UPC_A);if(f&&h){var p=c.getRawBytes(),m=new ht(c.getText().substring(1),p,p?p.length:null,c.getResultPoints(),X.UPC_A);return m.putAllMetadata(c.getResultMetadata()),m}return c}catch{}}}catch(y){o={error:y}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}throw new k},e.prototype.reset=function(){var n,r;try{for(var i=Va(this.readers),o=i.next();!o.done;o=i.next()){var a=o.value;a.reset()}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e})(Ye),Rd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Dd=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},wn=(function(t){Rd(e,t);function e(){var n=t.call(this)||this;return n.decodeFinderCounters=new Int32Array(4),n.dataCharacterCounters=new Int32Array(8),n.oddRoundingErrors=new Array(4),n.evenRoundingErrors=new Array(4),n.oddCounts=new Array(n.dataCharacterCounters.length/2),n.evenCounts=new Array(n.dataCharacterCounters.length/2),n}return e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(n,r){for(var i=0;i<r.length;i++)if(Ye.patternMatchVariance(n,r[i],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return i;throw new k},e.count=function(n){return re.sum(new Int32Array(n))},e.increment=function(n,r){for(var i=0,o=r[0],a=1;a<n.length;a++)r[a]>o&&(o=r[a],i=a);n[i]++},e.decrement=function(n,r){for(var i=0,o=r[0],a=1;a<n.length;a++)r[a]<o&&(o=r[a],i=a);n[i]--},e.isFinderPattern=function(n){var r,i,o=n[0]+n[1],a=o+n[2]+n[3],s=o/a;if(s>=e.MIN_FINDER_PATTERN_RATIO&&s<=e.MAX_FINDER_PATTERN_RATIO){var l=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER;try{for(var c=Dd(n),f=c.next();!f.done;f=c.next()){var d=f.value;d>u&&(u=d),d<l&&(l=d)}}catch(h){r={error:h}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return u<10*l}return!1},e.MAX_AVG_VARIANCE=.2,e.MAX_INDIVIDUAL_VARIANCE=.45,e.MIN_FINDER_PATTERN_RATIO=9.5/12,e.MAX_FINDER_PATTERN_RATIO=12.5/14,e})(Ye),yi=(function(){function t(e,n){this.value=e,this.checksumPortion=n}return t.prototype.getValue=function(){return this.value},t.prototype.getChecksumPortion=function(){return this.checksumPortion},t.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value&&this.checksumPortion===n.checksumPortion},t.prototype.hashCode=function(){return this.value^this.checksumPortion},t})(),Vl=(function(){function t(e,n,r,i,o){this.value=e,this.startEnd=n,this.value=e,this.startEnd=n,this.resultPoints=new Array,this.resultPoints.push(new z(r,o)),this.resultPoints.push(new z(i,o))}return t.prototype.getValue=function(){return this.value},t.prototype.getStartEnd=function(){return this.startEnd},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.prototype.hashCode=function(){return this.value},t})(),kd=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Nn=(function(){function t(){}return t.getRSSvalue=function(e,n,r){var i,o,a=0;try{for(var s=kd(e),l=s.next();!l.done;l=s.next()){var u=l.value;a+=u}}catch(_){i={error:_}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}for(var c=0,f=0,d=e.length,h=0;h<d-1;h++){var p=void 0;for(p=1,f|=1<<h;p<e[h];p++,f&=~(1<<h)){var m=t.combins(a-p-1,d-h-2);if(r&&f===0&&a-p-(d-h-1)>=d-h-1&&(m-=t.combins(a-p-(d-h),d-h-2)),d-h-1>1){for(var y=0,w=a-p-(d-h-2);w>n;w--)y+=t.combins(a-p-w-1,d-h-3);m-=y*(d-1-h)}else a-p>n&&m--;c+=m}a-=p}return c},t.combins=function(e,n){var r,i;e-n>n?(i=n,r=e-n):(i=e-n,r=n);for(var o=1,a=1,s=e;s>r;s--)o*=s,a<=i&&(o/=a,a++);for(;a<=i;)o/=a,a++;return o},t})(),Pd=(function(){function t(){}return t.buildBitArray=function(e){var n=e.length*2-1;e[e.length-1].getRightChar()==null&&(n-=1);for(var r=12*n,i=new Ge(r),o=0,a=e[0],s=a.getRightChar().getValue(),l=11;l>=0;--l)(s&1<<l)!=0&&i.set(o),o++;for(var l=1;l<e.length;++l){for(var u=e[l],c=u.getLeftChar().getValue(),f=11;f>=0;--f)(c&1<<f)!=0&&i.set(o),o++;if(u.getRightChar()!=null)for(var d=u.getRightChar().getValue(),f=11;f>=0;--f)(d&1<<f)!=0&&i.set(o),o++}return i},t})(),pn=(function(){function t(e,n){n?this.decodedInformation=null:(this.finished=e,this.decodedInformation=n)}return t.prototype.getDecodedInformation=function(){return this.decodedInformation},t.prototype.isFinished=function(){return this.finished},t})(),Ko=(function(){function t(e){this.newPosition=e}return t.prototype.getNewPosition=function(){return this.newPosition},t})(),Nd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
6e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ct=(function(t){Nd(e,t);function e(n,r){var i=t.call(this,n)||this;return i.value=r,i}return e.prototype.getValue=function(){return this.value},e.prototype.isFNC1=function(){return this.value===e.FNC1},e.FNC1="$",e})(Ko),Bd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),gn=(function(t){Bd(e,t);function e(n,r,i){var o=t.call(this,n)||this;return i?(o.remaining=!0,o.remainingValue=o.remainingValue):(o.remaining=!1,o.remainingValue=0),o.newString=r,o}return e.prototype.getNewString=function(){return this.newString},e.prototype.isRemaining=function(){return this.remaining},e.prototype.getRemainingValue=function(){return this.remainingValue},e})(Ko),Fd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),kn=(function(t){Fd(e,t);function e(n,r,i){var o=t.call(this,n)||this;if(r<0||r>10||i<0||i>10)throw new L;return o.firstDigit=r,o.secondDigit=i,o}return e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e})(Ko),Gr=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ld=(function(){function t(){}return t.parseFieldsInGeneralPurpose=function(e){var n,r,i,o,a,s,l,u;if(!e)return null;if(e.length<2)throw new k;var c=e.substring(0,2);try{for(var f=Gr(t.TWO_DIGIT_DATA_LENGTH),d=f.next();!d.done;d=f.next()){var h=d.value;if(h[0]===c)return h[1]===t.VARIABLE_LENGTH?t.processVariableAI(2,h[2],e):t.processFixedAI(2,h[1],e)}}catch(O){n={error:O}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}if(e.length<3)throw new k;var p=e.substring(0,3);try{for(var m=Gr(t.THREE_DIGIT_DATA_LENGTH),y=m.next();!y.done;y=m.next()){var h=y.value;if(h[0]===p)return h[1]===t.VARIABLE_LENGTH?t.processVariableAI(3,h[2],e):t.processFixedAI(3,h[1],e)}}catch(O){i={error:O}}finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var w=Gr(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),_=w.next();!_.done;_=w.next()){var h=_.value;if(h[0]===p)return h[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,h[2],e):t.processFixedAI(4,h[1],e)}}catch(O){a={error:O}}finally{try{_&&!_.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}if(e.length<4)throw new k;var C=e.substring(0,4);try{for(var E=Gr(t.FOUR_DIGIT_DATA_LENGTH),I=E.next();!I.done;I=E.next()){var h=I.value;if(h[0]===C)return h[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,h[2],e):t.processFixedAI(4,h[1],e)}}catch(O){l={error:O}}finally{try{I&&!I.done&&(u=E.return)&&u.call(E)}finally{if(l)throw l.error}}throw new k},t.processFixedAI=function(e,n,r){if(r.length<e)throw new k;var i=r.substring(0,e);if(r.length<e+n)throw new k;var o=r.substring(e,e+n),a=r.substring(e+n),s="("+i+")"+o,l=t.parseFieldsInGeneralPurpose(a);return l==null?s:s+l},t.processVariableAI=function(e,n,r){var i=r.substring(0,e),o;r.length<e+n?o=r.length:o=e+n;var a=r.substring(e,o),s=r.substring(o),l="("+i+")"+a,u=t.parseFieldsInGeneralPurpose(s);return u==null?l:l+u},t.VARIABLE_LENGTH=[],t.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",t.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",t.VARIABLE_LENGTH,20],["22",t.VARIABLE_LENGTH,29],["30",t.VARIABLE_LENGTH,8],["37",t.VARIABLE_LENGTH,8],["90",t.VARIABLE_LENGTH,30],["91",t.VARIABLE_LENGTH,30],["92",t.VARIABLE_LENGTH,30],["93",t.VARIABLE_LENGTH,30],["94",t.VARIABLE_LENGTH,30],["95",t.VARIABLE_LENGTH,30],["96",t.VARIABLE_LENGTH,30],["97",t.VARIABLE_LENGTH,3],["98",t.VARIABLE_LENGTH,30],["99",t.VARIABLE_LENGTH,30]],t.THREE_DIGIT_DATA_LENGTH=[["240",t.VARIABLE_LENGTH,30],["241",t.VARIABLE_LENGTH,30],["242",t.VARIABLE_LENGTH,6],["250",t.VARIABLE_LENGTH,30],["251",t.VARIABLE_LENGTH,30],["253",t.VARIABLE_LENGTH,17],["254",t.VARIABLE_LENGTH,20],["400",t.VARIABLE_LENGTH,30],["401",t.VARIABLE_LENGTH,30],["402",17],["403",t.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",t.VARIABLE_LENGTH,20],["421",t.VARIABLE_LENGTH,15],["422",3],["423",t.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["3
660",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",t.VARIABLE_LENGTH,15],["391",t.VARIABLE_LENGTH,18],["392",t.VARIABLE_LENGTH,15],["393",t.VARIABLE_LENGTH,18],["703",t.VARIABLE_LENGTH,30]],t.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",t.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",t.VARIABLE_LENGTH,20],["8003",t.VARIABLE_LENGTH,30],["8004",t.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",t.VARIABLE_LENGTH,30],["8008",t.VARIABLE_LENGTH,12],["8018",18],["8020",t.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",t.VARIABLE_LENGTH,70],["8200",t.VARIABLE_LENGTH,70]],t})(),ci=(function(){function t(e){this.buffer=new xe,this.information=e}return t.prototype.decodeAllCodes=function(e,n){var r=n,i=null;do{var o=this.decodeGeneralPurposeField(r,i),a=Ld.parseFieldsInGeneralPurpose(o.getNewString());if(a!=null&&e.append(a),o.isRemaining()?i=""+o.getRemainingValue():i=null,r===o.getNewPosition())break;r=o.getNewPosition()}while(!0);return e.toString()},t.prototype.isStillNumeric=function(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(var n=e;n<e+3;++n)if(this.information.get(n))return!0;return this.information.get(e+3)},t.prototype.decodeNumeric=function(e){if(e+7>this.information.getSize()){var n=this.extractNumericValueFromBitArray(e,4);return n===0?new kn(this.information.getSize(),kn.FNC1,kn.FNC1):new kn(this.information.getSize(),n-1,kn.FNC1)}var r=this.extractNumericValueFromBitArray(e,7),i=(r-8)/11,o=(r-8)%11;return new kn(e+7,i,o)},t.prototype.extractNumericValueFromBitArray=function(e,n){return t.extractNumericValueFromBitArray(this.information,e,n)},t.extractNumericValueFromBitArray=function(e,n,r){for(var i=0,o=0;o<r;++o)e.get(n+o)&&(i|=1<<r-o-1);return i},t.prototype.decodeGeneralPurposeField=function(e,n){this.buffer.setLengthToZero(),n!=null&&this.buffer.append(n),this.current.setPosition(e);var r=this.parseBlocks();return r!=null&&r.isRemaining()?new gn(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new gn(this.current.getPosition(),this.buffer.toString())},t.prototype.parseBlocks=function(){var e,n;do{var r=this.current.getPosition();this.current.isAlpha()?(n=this.parseAlphaBlock(),e=n.isFinished()):this.current.isIsoIec646()?(n=this.parseIsoIec646Block(),e=n.isFinished()):(n=this.parseNumericBlock(),e=n.isFinished());var i=r!==this.current.getPosition();if(!i&&!e)break}while(!e);return n.getDecodedInformation()},t.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){var n=void 0;return e.isSecondDigitFNC1()?n=new gn(this.current.getPosition(),this.buffer.toString()):n=new gn(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new pn(!0,n)}if(this.buffer.append(e.getFirstDigit()),e.isSecondDigitFNC1()){var n=new gn(this.current.getPosition(),this.buffer.toString());return new pn(!0,n)}this.buffer.append(e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new pn(!1)},t.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var n=new gn(this.current.getPosition(),this.buffer.toString());return new pn(!0,n)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new pn(!1)},t.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var n=new gn(this.current.getPosition(),this.buffer.toString());return new pn(!0,n)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new pn(!1)},t.prototype.isStillIsoIec646=function(e){if(e+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,5);if(n>=5&&n<16)return!0;
6if(e+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<116)return!0;if(e+8>this.information.getSize())return!1;var i=this.extractNumericValueFromBitArray(e,8);return i>=232&&i<253},t.prototype.decodeIsoIec646=function(e){var n=this.extractNumericValueFromBitArray(e,5);if(n===15)return new Ct(e+5,Ct.FNC1);if(n>=5&&n<15)return new Ct(e+5,"0"+(n-5));var r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<90)return new Ct(e+7,""+(r+1));if(r>=90&&r<116)return new Ct(e+7,""+(r+7));var i=this.extractNumericValueFromBitArray(e,8),o;switch(i){case 232:o="!";break;case 233:o='"';break;case 234:o="%";break;case 235:o="&";break;case 236:o="'";break;case 237:o="(";break;case 238:o=")";break;case 239:o="*";break;case 240:o="+";break;case 241:o=",";break;case 242:o="-";break;case 243:o=".";break;case 244:o="/";break;case 245:o=":";break;case 246:o=";";break;case 247:o="<";break;case 248:o="=";break;case 249:o=">";break;case 250:o="?";break;case 251:o="_";break;case 252:o=" ";break;default:throw new L}return new Ct(e+8,o)},t.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,5);if(n>=5&&n<16)return!0;if(e+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,6);return r>=16&&r<63},t.prototype.decodeAlphanumeric=function(e){var n=this.extractNumericValueFromBitArray(e,5);if(n===15)return new Ct(e+5,Ct.FNC1);if(n>=5&&n<15)return new Ct(e+5,"0"+(n-5));var r=this.extractNumericValueFromBitArray(e,6);if(r>=32&&r<58)return new Ct(e+6,""+(r+33));var i;switch(r){case 58:i="*";break;case 59:i=",";break;case 60:i="-";break;case 61:i=".";break;case 62:i="/";break;default:throw new Ur("Decoding invalid alphanumeric value: "+r)}return new Ct(e+6,i)},t.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var n=0;n<5&&n+e<this.information.getSize();++n)if(n===2){if(!this.information.get(e+2))return!1}else if(this.information.get(e+n))return!1;return!0},t.prototype.isAlphaOr646ToNumericLatch=function(e){if(e+3>this.information.getSize())return!1;for(var n=e;n<e+3;++n)if(this.information.get(n))return!1;return!0},t.prototype.isNumericToAlphaNumericLatch=function(e){if(e+1>this.information.getSize())return!1;for(var n=0;n<4&&n+e<this.information.getSize();++n)if(this.information.get(e+n))return!1;return!0},t})(),Ul=(function(){function t(e){this.information=e,this.generalDecoder=new ci(e)}return t.prototype.getInformation=function(){return this.information},t.prototype.getGeneralDecoder=function(){return this.generalDecoder},t})(),Vd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),St=(function(t){Vd(e,t);function e(n){return t.call(this,n)||this}return e.prototype.encodeCompressedGtin=function(n,r){n.append("(01)");var i=n.length();n.append("9"),this.encodeCompressedGtinWithoutAI(n,r,i)},e.prototype.encodeCompressedGtinWithoutAI=function(n,r,i){for(var o=0;o<4;++o){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*o,10);a/100===0&&n.append("0"),a/10===0&&n.append("0"),n.append(a)}e.appendCheckDigit(n,i)},e.appendCheckDigit=function(n,r){for(var i=0,o=0;o<13;o++){var a=n.charAt(o+r).charCodeAt(0)-48;i+=(o&1)===0?3*a:a}i=10-i%10,i===10&&(i=0),n.append(i)},e.GTIN_SIZE=40,e})(Ul),Ud=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),$d=(function(t){Ud(e,t);function e(n){return t.call(this,n)||this}return e.prototype.parseInformation=function(){var n=new xe;n.append("(01)");var r=n.length(),i=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);return n.append(i),this.encodeCompressedGtinWithoutAI(n,e.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(n,e.HEADER_SIZE+44)},e.HEADER_SIZE=4,e})(St),Hd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
6e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Wd=(function(t){Hd(e,t);function e(n){return t.call(this,n)||this}return e.prototype.parseInformation=function(){var n=new xe;return this.getGeneralDecoder().decodeAllCodes(n,e.HEADER_SIZE)},e.HEADER_SIZE=5,e})(Ul),zd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),fi=(function(t){zd(e,t);function e(n){return t.call(this,n)||this}return e.prototype.encodeCompressedWeight=function(n,r,i){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(r,i);this.addWeightCode(n,o);for(var a=this.checkWeight(o),s=1e5,l=0;l<5;++l)a/s===0&&n.append("0"),s/=10;n.append(a)},e})(St),Gd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),$l=(function(t){Gd(e,t);function e(n){return t.call(this,n)||this}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+fi.GTIN_SIZE+e.WEIGHT_SIZE)throw new k;var n=new xe;return this.encodeCompressedGtin(n,e.HEADER_SIZE),this.encodeCompressedWeight(n,e.HEADER_SIZE+fi.GTIN_SIZE,e.WEIGHT_SIZE),n.toString()},e.HEADER_SIZE=5,e.WEIGHT_SIZE=15,e})(fi),Kd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Xd=(function(t){Kd(e,t);function e(n){return t.call(this,n)||this}return e.prototype.addWeightCode=function(n,r){n.append("(3103)")},e.prototype.checkWeight=function(n){return n},e})($l),jd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Yd=(function(t){jd(e,t);function e(n){return t.call(this,n)||this}return e.prototype.addWeightCode=function(n,r){r<1e4?n.append("(3202)"):n.append("(3203)")},e.prototype.checkWeight=function(n){return n<1e4?n:n-1e4},e})($l),Zd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),qd=(function(t){Zd(e,t);function e(n){return t.call(this,n)||this}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+St.GTIN_SIZE)throw new k;var n=new xe;this.encodeCompressedGtin(n,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+St.GTIN_SIZE,e.LAST_DIGIT_SIZE);n.append("(392"),n.append(r),n.append(")");var i=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+St.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);return n.append(i.getNewString()),n.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e})(St),Qd=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Jd=(function(t){Qd(e,t);function e(n){return t.call(this,n)||this}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+St.GTIN_SIZE)throw new k;var n=new xe;this.encodeCompressedGtin(n,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+St.GTIN_SIZE,e.LAST_DIGIT_SIZE);n.append("(393"),n.append(r),n.append(")");var i=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+St.GTIN_SIZE+e.LA
6ST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);i/100==0&&n.append("0"),i/10==0&&n.append("0"),n.append(i);var o=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+St.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);return n.append(o.getNewString()),n.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e.FIRST_THREE_DIGITS_SIZE=10,e})(St),eh=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),qt=(function(t){eh(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.dateCode=i,o.firstAIdigits=r,o}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE)throw new k;var n=new xe;return this.encodeCompressedGtin(n,e.HEADER_SIZE),this.encodeCompressedWeight(n,e.HEADER_SIZE+e.GTIN_SIZE,e.WEIGHT_SIZE),this.encodeCompressedDate(n,e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE),n.toString()},e.prototype.encodeCompressedDate=function(n,r){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(r,e.DATE_SIZE);if(i!=38400){n.append("("),n.append(this.dateCode),n.append(")");var o=i%32;i/=32;var a=i%12+1;i/=12;var s=i;s/10==0&&n.append("0"),n.append(s),a/10==0&&n.append("0"),n.append(a),o/10==0&&n.append("0"),n.append(o)}},e.prototype.addWeightCode=function(n,r){n.append("("),n.append(this.firstAIdigits),n.append(r/1e5),n.append(")")},e.prototype.checkWeight=function(n){return n%1e5},e.HEADER_SIZE=8,e.WEIGHT_SIZE=20,e.DATE_SIZE=16,e})(fi);function th(t){try{if(t.get(1))return new $d(t);if(!t.get(2))return new Wd(t);var e=ci.extractNumericValueFromBitArray(t,1,4);switch(e){case 4:return new Xd(t);case 5:return new Yd(t)}var n=ci.extractNumericValueFromBitArray(t,1,5);switch(n){case 12:return new qd(t);case 13:return new Jd(t)}var r=ci.extractNumericValueFromBitArray(t,1,7);switch(r){case 56:return new qt(t,"310","11");case 57:return new qt(t,"320","11");case 58:return new qt(t,"310","13");case 59:return new qt(t,"320","13");case 60:return new qt(t,"310","15");case 61:return new qt(t,"320","15");case 62:return new qt(t,"310","17");case 63:return new qt(t,"320","17")}}catch(i){throw console.log(i),new Ur("unknown decoder: "+t)}}var Ua=(function(){function t(e,n,r,i){this.leftchar=e,this.rightchar=n,this.finderpattern=r,this.maybeLast=i}return t.prototype.mayBeLast=function(){return this.maybeLast},t.prototype.getLeftChar=function(){return this.leftchar},t.prototype.getRightChar=function(){return this.rightchar},t.prototype.getFinderPattern=function(){return this.finderpattern},t.prototype.mustBeLast=function(){return this.rightchar==null},t.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"},t.equals=function(e,n){return e instanceof t?t.equalsOrNull(e.leftchar,n.leftchar)&&t.equalsOrNull(e.rightchar,n.rightchar)&&t.equalsOrNull(e.finderpattern,n.finderpattern):!1},t.equalsOrNull=function(e,n){return e===null?n===null:t.equals(e,n)},t.prototype.hashCode=function(){var e=this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue();return e},t})(),nh=(function(){function t(e,n,r){this.pairs=e,this.rowNumber=n,this.wasReversed=r}return t.prototype.getPairs=function(){return this.pairs},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.isReversed=function(){return this.wasReversed},t.prototype.isEquivalent=function(e){return this.checkEqualitity(this,e)},t.prototype.toString=function(){return"{ "+this.pairs+" }"},t.prototype.equals=function(e,n){return e instanceof t?this.checkEqualitity(e,n)&&e.wasReversed===n.wasReversed:!1},t.prototype.checkEqualitity=function(e,n){if(!(!e||!n)){var r;return e.forEach(function(i,o){n.forEach(function(a){i.getLeftChar().getValue()===a.getLeftChar().getValue()&&i.getRightChar().getValue()===a.getRightChar().getValue()&&i.getFinderPatter().getValue()===a.getFinderPatter().getValue()&&(r=!0)})}),r}},t})(),rh=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
6e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Qt=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ih=(function(t){rh(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.pairs=new Array(e.MAX_PAIRS),n.rows=new Array,n.startEnd=[2],n}return e.prototype.decodeRow=function(n,r,i){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(n,r))}catch{}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(n,r))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(n,r){for(var i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(r,this.pairs,n))}catch(s){if(s instanceof k){if(!this.pairs.length)throw new k;i=!0}}if(this.checkChecksum())return this.pairs;var o;if(this.rows.length?o=!0:o=!1,this.storeRow(n,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0),a!=null))return a}throw new k},e.prototype.checkRowsBoolean=function(n){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,n&&(this.rows=this.rows.reverse());var r=null;try{r=this.checkRows(new Array,0)}catch(i){console.log(i)}return n&&(this.rows=this.rows.reverse()),r},e.prototype.checkRows=function(n,r){for(var i,o,a=r;a<this.rows.length;a++){var s=this.rows[a];this.pairs.length=0;try{for(var l=(i=void 0,Qt(n)),u=l.next();!u.done;u=l.next()){var c=u.value;this.pairs.push(c.getPairs())}}catch(d){i={error:d}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}if(this.pairs.push(s.getPairs()),!!e.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var f=new Array(n);f.push(s);try{return this.checkRows(f,a+1)}catch(d){console.log(d)}}}throw new k},e.isValidSequence=function(n){var r,i;try{for(var o=Qt(e.FINDER_PATTERN_SEQUENCES),a=o.next();!a.done;a=o.next()){var s=a.value;if(!(n.length>s.length)){for(var l=!0,u=0;u<n.length;u++)if(n[u].getFinderPattern().getValue()!=s[u]){l=!1;break}if(l)return!0}}}catch(c){r={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return!1},e.prototype.storeRow=function(n,r){for(var i=0,o=!1,a=!1;i<this.rows.length;){var s=this.rows[i];if(s.getRowNumber()>n){a=s.isEquivalent(this.pairs);break}o=s.isEquivalent(this.pairs),i++}a||o||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(i,new nh(this.pairs,n,r)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(n,r){var i,o,a,s,l,u;try{for(var c=Qt(r),f=c.next();!f.done;f=c.next()){var d=f.value;if(d.getPairs().length!==n.length){var h=!0;try{for(var p=(a=void 0,Qt(d.getPairs())),m=p.next();!m.done;m=p.next()){var y=m.value,w=!1;try{for(var _=(l=void 0,Qt(n)),C=_.next();!C.done;C=_.next()){var E=C.value;if(Ua.equals(y,E)){w=!0;break}}}catch(I){l={error:I}}finally{try{C&&!C.done&&(u=_.return)&&u.call(_)}finally{if(l)throw l.error}}w||(h=!1)}}catch(I){a={error:I}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}}catch(I){i={error:I}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}},e.isPartialRow=function(n,r){var i,o,a,s,l,u;try{for(var c=Qt(r),f=c.next();!f.done;f=c.next()){var d=f.value,h=!0;try{for(var p=(a=void 0,Qt(n)),m=p.next();!m.done;m=p.next()){var y=m.value,w=!1;try{for(var _=(l=void 0,Qt(d.getPairs())),C=_.next();!C.done;C=_.next()){var E=C.value;if(y.equals(E)){w=!0;break}}}catch(I){l={error:I}}finally{try{C&&!C.done&&(u=_.return)&&u.call(_)}finally{if(l)throw l.error}}if(!w){h=!1;break}}}catch(I){a={error:I}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}if(h)return!0}}catch(I){i={error:I}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(n){var r=Pd.buildBitArray(n),i=th(r),o=i.parseInformation(),a=n[0].getFinderPattern().getResultPoints(),s=n[n.length-1].getFinderPattern().getResultPoints(),l=[a[0],a[1],s[0],s[1]];
6return new ht(o,null,null,l,X.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var n=this.pairs.get(0),r=n.getLeftChar(),i=n.getRightChar();if(i==null)return!1;for(var o=i.getChecksumPortion(),a=2,s=1;s<this.pairs.size();++s){var l=this.pairs.get(s);o+=l.getLeftChar().getChecksumPortion(),a++;var u=l.getRightChar();u!=null&&(o+=u.getChecksumPortion(),a++)}o%=211;var c=211*(a-4)+o;return c==r.getValue()},e.getNextSecondBar=function(n,r){var i;return n.get(r)?(i=n.getNextUnset(r),i=n.getNextSet(i)):(i=n.getNextSet(r),i=n.getNextUnset(i)),i},e.prototype.retrieveNextPair=function(n,r,i){var o=r.length%2==0;this.startFromEven&&(o=!o);var a,s=!0,l=-1;do this.findNextPair(n,r,l),a=this.parseFoundFinderPattern(n,i,o),a==null?l=e.getNextSecondBar(n,this.startEnd[0]):s=!1;while(s);var u=this.decodeDataCharacter(n,a,o,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new k;var c;try{c=this.decodeDataCharacter(n,a,o,!1)}catch(f){c=null,console.log(f)}return new Ua(u,c,a,!0)},e.prototype.isEmptyPair=function(n){return n.length===0},e.prototype.findNextPair=function(n,r,i){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;var a=n.getSize(),s;if(i>=0)s=i;else if(this.isEmptyPair(r))s=0;else{var l=r[r.length-1];s=l.getFinderPattern().getStartEnd()[1]}var u=r.length%2!=0;this.startFromEven&&(u=!u);for(var c=!1;s<a&&(c=!n.get(s),!!c);)s++;for(var f=0,d=s,h=s;h<a;h++)if(n.get(h)!=c)o[f]++;else{if(f==3){if(u&&e.reverseCounters(o),e.isFinderPattern(o)){this.startEnd[0]=d,this.startEnd[1]=h;return}u&&e.reverseCounters(o),d+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,f--}else f++;o[f]=1,c=!c}throw new k},e.reverseCounters=function(n){for(var r=n.length,i=0;i<r/2;++i){var o=n[i];n[i]=n[r-i-1],n[r-i-1]=o}},e.prototype.parseFoundFinderPattern=function(n,r,i){var o,a,s;if(i){for(var l=this.startEnd[0]-1;l>=0&&!n.get(l);)l--;l++,o=this.startEnd[0]-l,a=l,s=this.startEnd[1]}else a=this.startEnd[0],s=n.getNextUnset(this.startEnd[1]+1),o=s-this.startEnd[1];var u=this.getDecodeFinderCounters();Ce.arraycopy(u,0,u,1,u.length-1),u[0]=o;var c;try{c=this.parseFinderValue(u,e.FINDER_PATTERNS)}catch{return null}return new Vl(c,[a,s],a,s,r)},e.prototype.decodeDataCharacter=function(n,r,i,o){for(var a=this.getDataCharacterCounters(),s=0;s<a.length;s++)a[s]=0;if(o)e.recordPatternInReverse(n,r.getStartEnd()[0],a);else{e.recordPattern(n,r.getStartEnd()[1],a);for(var l=0,u=a.length-1;l<u;l++,u--){var c=a[l];a[l]=a[u],a[u]=c}}var f=17,d=re.sum(new Int32Array(a))/f,h=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(d-h)/h>.3)throw new k;for(var p=this.getOddCounts(),m=this.getEvenCounts(),y=this.getOddRoundingErrors(),w=this.getEvenRoundingErrors(),l=0;l<a.length;l++){var _=1*a[l]/d,C=_+.5;if(C<1){if(_<.3)throw new k;C=1}else if(C>8){if(_>8.7)throw new k;C=8}var E=l/2;(l&1)==0?(p[E]=C,y[E]=_-C):(m[E]=C,w[E]=_-C)}this.adjustOddEvenCounts(f);for(var I=4*r.getValue()+(i?0:2)+(o?0:1)-1,O=0,x=0,l=p.length-1;l>=0;l--){if(e.isNotA1left(r,i,o)){var R=e.WEIGHTS[I][2*l];x+=p[l]*R}O+=p[l]}for(var N=0,l=m.length-1;l>=0;l--)if(e.isNotA1left(r,i,o)){var R=e.WEIGHTS[I][2*l+1];N+=m[l]*R}var F=x+N;if((O&1)!=0||O>13||O<4)throw new k;var W=(13-O)/2,$=e.SYMBOL_WIDEST[W],Z=9-$,Ae=Nn.getRSSvalue(p,$,!0),ee=Nn.getRSSvalue(m,Z,!1),De=e.EVEN_TOTAL_SUBSET[W],Ze=e.GSUM[W],Zt=Ae*De+ee+Ze;return new yi(Zt,F)},e.isNotA1left=function(n,r,i){return!(n.getValue()==0&&r&&i)},e.prototype.adjustOddEvenCounts=function(n){var r=re.sum(new Int32Array(this.getOddCounts())),i=re.sum(new Int32Array(this.getEvenCounts())),o=!1,a=!1;r>13?a=!0:r<4&&(o=!0);var s=!1,l=!1;i>13?l=!0:i<4&&(s=!0);var u=r+i-n,c=(r&1)==1,f=(i&1)==0;if(u==1)if(c){if(f)throw new k;a=!0}else{if(!f)throw new k;l=!0}else if(u==-1)if(c){if(f)throw new k;o=!0}else{if(!f)throw new k;s=!0}else if(u==0){if(c){if(!f)throw new k;r<i?(o=!0,l=!0):(a=!0,s=!0)}else if(f)throw new k}else throw new k;if(o){if(a)throw new k;e.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(l)throw new k;e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}
6l&&e.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.SYMBOL_WIDEST=[7,5,4,3,1],e.EVEN_TOTAL_SUBSET=[4,20,52,104,204],e.GSUM=[0,348,1388,2948,3988],e.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],e.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],e.FINDER_PAT_A=0,e.FINDER_PAT_B=1,e.FINDER_PAT_C=2,e.FINDER_PAT_D=3,e.FINDER_PAT_E=4,e.FINDER_PAT_F=5,e.FINDER_PATTERN_SEQUENCES=[[e.FINDER_PAT_A,e.FINDER_PAT_A],[e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B],[e.FINDER_PAT_A,e.FINDER_PAT_C,e.FINDER_PAT_B,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_C],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F]],e.MAX_PAIRS=11,e})(wn),oh=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),ah=(function(t){oh(e,t);function e(n,r,i){var o=t.call(this,n,r)||this;return o.count=0,o.finderPattern=i,o}return e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.getCount=function(){return this.count},e.prototype.incrementCount=function(){this.count++},e})(yi),sh=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),zi=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$a=(function(t){sh(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.possibleLeftPairs=[],n.possibleRightPairs=[],n}return e.prototype.decodeRow=function(n,r,i){var o,a,s,l,u=this.decodePair(r,!1,n,i);e.addOrTally(this.possibleLeftPairs,u),r.reverse();var c=this.decodePair(r,!0,n,i);e.addOrTally(this.possibleRightPairs,c),r.reverse();try{for(var f=zi(this.possibleLeftPairs),d=f.next();!d.done;d=f.next()){var h=d.value;if(h.getCount()>1)try{for(var p=(s=void 0,zi(this.possibleRightPairs)),m=p.next();!m.done;m=p.next()){var y=m.value;if(y.getCount()>1&&e.checkChecksum(h,y))return e.constructResult(h,y)}}catch(w){s={error:w}}finally{try{m&&!m.done&&(l=p.return)&&l.call(p)}finally{if(s)throw s.error}}}}catch(w){o={error:w}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}throw new k},e.addOrTally=function(n,r){var i,o;if(r!=null){var a=!1;try{for(var s=zi(n),l=s.next();!l.done;l=s.next()){var u=l.value;if(u.getValue()===r.getValue()){u.incrementCount(),a=!0;break}}}catch(c){i={error:c}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}a||n.push(r)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(n,r){for(var i=4537077*n.getValue()+r.getValue(),o=new String(i).toString(),a=new xe,s=13-o.length;s>0;s--)a.append("0");a.append(o);for(var l=0,s=0;s<13;
6s++){var u=a.charAt(s).charCodeAt(0)-48;l+=(s&1)===0?3*u:u}l=10-l%10,l===10&&(l=0),a.append(l.toString());var c=n.getFinderPattern().getResultPoints(),f=r.getFinderPattern().getResultPoints();return new ht(a.toString(),null,0,[c[0],c[1],f[0],f[1]],X.RSS_14,new Date().getTime())},e.checkChecksum=function(n,r){var i=(n.getChecksumPortion()+16*r.getChecksumPortion())%79,o=9*n.getFinderPattern().getValue()+r.getFinderPattern().getValue();return o>72&&o--,o>8&&o--,i===o},e.prototype.decodePair=function(n,r,i,o){try{var a=this.findFinderPattern(n,r),s=this.parseFoundFinderPattern(n,i,r,a),l=o==null?null:o.get(Me.NEED_RESULT_POINT_CALLBACK);if(l!=null){var u=(a[0]+a[1])/2;r&&(u=n.getSize()-1-u),l.foundPossibleResultPoint(new z(u,i))}var c=this.decodeDataCharacter(n,s,!0),f=this.decodeDataCharacter(n,s,!1);return new ah(1597*c.getValue()+f.getValue(),c.getChecksumPortion()+4*f.getChecksumPortion(),s)}catch{return null}},e.prototype.decodeDataCharacter=function(n,r,i){for(var o=this.getDataCharacterCounters(),a=0;a<o.length;a++)o[a]=0;if(i)Ye.recordPatternInReverse(n,r.getStartEnd()[0],o);else{Ye.recordPattern(n,r.getStartEnd()[1]+1,o);for(var s=0,l=o.length-1;s<l;s++,l--){var u=o[s];o[s]=o[l],o[l]=u}}for(var c=i?16:15,f=re.sum(new Int32Array(o))/c,d=this.getOddCounts(),h=this.getEvenCounts(),p=this.getOddRoundingErrors(),m=this.getEvenRoundingErrors(),s=0;s<o.length;s++){var y=o[s]/f,w=Math.floor(y+.5);w<1?w=1:w>8&&(w=8);var _=Math.floor(s/2);(s&1)===0?(d[_]=w,p[_]=y-w):(h[_]=w,m[_]=y-w)}this.adjustOddEvenCounts(i,c);for(var C=0,E=0,s=d.length-1;s>=0;s--)E*=9,E+=d[s],C+=d[s];for(var I=0,O=0,s=h.length-1;s>=0;s--)I*=9,I+=h[s],O+=h[s];var x=E+3*I;if(i){if((C&1)!==0||C>12||C<4)throw new k;var R=(12-C)/2,N=e.OUTSIDE_ODD_WIDEST[R],F=9-N,W=Nn.getRSSvalue(d,N,!1),$=Nn.getRSSvalue(h,F,!0),Z=e.OUTSIDE_EVEN_TOTAL_SUBSET[R],Ae=e.OUTSIDE_GSUM[R];return new yi(W*Z+$+Ae,x)}else{if((O&1)!==0||O>10||O<4)throw new k;var R=(10-O)/2,N=e.INSIDE_ODD_WIDEST[R],F=9-N,W=Nn.getRSSvalue(d,N,!0),$=Nn.getRSSvalue(h,F,!1),ee=e.INSIDE_ODD_TOTAL_SUBSET[R],Ae=e.INSIDE_GSUM[R];return new yi($*ee+W+Ae,x)}},e.prototype.findFinderPattern=function(n,r){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var o=n.getSize(),a=!1,s=0;s<o&&(a=!n.get(s),r!==a);)s++;for(var l=0,u=s,c=s;c<o;c++)if(n.get(c)!==a)i[l]++;else{if(l===3){if(wn.isFinderPattern(i))return[u,c];u+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,l--}else l++;i[l]=1,a=!a}throw new k},e.prototype.parseFoundFinderPattern=function(n,r,i,o){for(var a=n.get(o[0]),s=o[0]-1;s>=0&&a!==n.get(s);)s--;s++;var l=o[0]-s,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);Ce.arraycopy(u,0,c,1,u.length-1),c[0]=l;var f=this.parseFinderValue(c,e.FINDER_PATTERNS),d=s,h=o[1];return i&&(d=n.getSize()-1-d,h=n.getSize()-1-h),new Vl(f,[s,o[1]],d,h,r)},e.prototype.adjustOddEvenCounts=function(n,r){var i=re.sum(new Int32Array(this.getOddCounts())),o=re.sum(new Int32Array(this.getEvenCounts())),a=!1,s=!1,l=!1,u=!1;n?(i>12?s=!0:i<4&&(a=!0),o>12?u=!0:o<4&&(l=!0)):(i>11?s=!0:i<5&&(a=!0),o>10?u=!0:o<4&&(l=!0));var c=i+o-r,f=(i&1)===(n?1:0),d=(o&1)===1;if(c===1)if(f){if(d)throw new k;s=!0}else{if(!d)throw new k;u=!0}else if(c===-1)if(f){if(d)throw new k;a=!0}else{if(!d)throw new k;l=!0}else if(c===0){if(f){if(!d)throw new k;i<o?(a=!0,u=!0):(s=!0,l=!0)}else if(d)throw new k}else throw new k;if(a){if(s)throw new k;wn.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(s&&wn.decrement(this.getOddCounts(),this.getOddRoundingErrors()),l){if(u)throw new k;wn.increment(this.getEvenCounts(),this.getOddRoundingErrors())}u&&wn.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],e.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],e.OUTSIDE_GSUM=[0,161,961,2015,2715],e.INSIDE_GSUM=[0,336,1036,1516],e.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],e.INSIDE_ODD_WIDEST=[2,4,6,8],e.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],e})(wn),lh=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
6e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),xr=(function(t){lh(e,t);function e(n){var r=t.call(this)||this;r.readers=[];var i=n?n.get(Me.POSSIBLE_FORMATS):null,o=n&&n.get(Me.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;return i&&((i.includes(X.EAN_13)||i.includes(X.UPC_A)||i.includes(X.EAN_8)||i.includes(X.UPC_E))&&r.readers.push(new Wi(n)),i.includes(X.CODE_39)&&r.readers.push(new Da(o)),i.includes(X.CODE_128)&&r.readers.push(new Ra),i.includes(X.ITF)&&r.readers.push(new ka),i.includes(X.RSS_14)&&r.readers.push(new $a),i.includes(X.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new ih))),r.readers.length===0&&(r.readers.push(new Wi(n)),r.readers.push(new Da),r.readers.push(new Wi(n)),r.readers.push(new Ra),r.readers.push(new ka),r.readers.push(new $a)),r}return e.prototype.decodeRow=function(n,r,i){for(var o=0;o<this.readers.length;o++)try{return this.readers[o].decodeRow(n,r,i)}catch{}throw new k},e.prototype.reset=function(){this.readers.forEach(function(n){return n.reset()})},e})(Ye),uh=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){uh(e,t);function e(n,r){return n===void 0&&(n=500),t.call(this,new xr(r),n,r)||this}return e})(er);var Ha=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fe=(function(){function t(e,n,r){this.ecCodewords=e,this.ecBlocks=[n],r&&this.ecBlocks.push(r)}return t.prototype.getECCodewords=function(){return this.ecCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t})(),le=(function(){function t(e,n){this.count=e,this.dataCodewords=n}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t})(),ch=(function(){function t(e,n,r,i,o,a){var s,l;this.versionNumber=e,this.symbolSizeRows=n,this.symbolSizeColumns=r,this.dataRegionSizeRows=i,this.dataRegionSizeColumns=o,this.ecBlocks=a;var u=0,c=a.getECCodewords(),f=a.getECBlocks();try{for(var d=Ha(f),h=d.next();!h.done;h=d.next()){var p=h.value;u+=p.getCount()*(p.getDataCodewords()+c)}}catch(m){s={error:m}}finally{try{h&&!h.done&&(l=d.return)&&l.call(d)}finally{if(s)throw s.error}}this.totalCodewords=u}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},t.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},t.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},t.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t.getVersionForDimensions=function(e,n){var r,i;if((e&1)!==0||(n&1)!==0)throw new L;try{for(var o=Ha(t.VERSIONS),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===n)return s}}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}throw new L},t.prototype.toString=function(){return""+this.versionNumber},t.buildVersions=function(){return[new t(1,10,10,8,8,new fe(5,new le(1,3))),new t(2,12,12,10,10,new fe(7,new le(1,5))),new t(3,14,14,12,12,new fe(10,new le(1,8))),new t(4,16,16,14,14,new fe(12,new le(1,12))),new t(5,18,18,16,16,new fe(14,new le(1,18))),new t(6,20,20,18,18,new fe(18,new le(1,22))),new t(7,22,22,20,20,new fe(20,new le(1,30))),new t(8,24,24,22,22,new fe(24,new le(1,36))),new t(9,26,26,24,24,new fe(28,new le(1,44))),new t(10,32,32,14,14,new fe(36,new le(1,62))),new t(11,36,36,16,16,new fe(42,new le(1,86))),new t(12,40,40,18,18,new fe(48,new le(1,114))),new t(13,44,44,20,20,new fe(56,new le(1,144))),new t(14,48,48,22,22,new fe(68,new le(1,174))),new t(15,52,52,24,24,new fe(42,new le(2,102))),new t(16,64,64,14,14,new fe(56,new le(2,140))),new t(17,72,72,16,16,new fe(36,new le(4,92))),new t(18,80,80,18,18,new fe(48,new le(4,114))),new t(19,88,88,20,20,new fe(56,new le(4,144))),new t(20,96,96,22,22,new fe(68,new le(4,174))),new t(21,104,104,24,24,new fe(56,new le(6,136))),new t(22,120,120,18,18,new fe(68,new le(6,175))),new t(23,132,132,20,20,new fe(62,new le(8,163))),new t(24,144,144,22,22,new fe(62,new le(8,156),new le(2,155))),new t(25,8,18,6,16,new fe(7,new le(1,5))),new t(26,8,32,6,14,new fe(11,new le(1,10))),new t(27,12,26,10,24,new fe(14,new le(1,16))),new t(28,12,36,10,16,new fe(18,new le(1,22))),new t(29,16,36,14,16,new fe(24,new le(1,32))),new t(30,16,48,14,22,new fe(28,new le(1,49)))]},t.VERSIONS=t.buildVersions(),t})(),fh=(function(){function t(e){var n=e.getHeight();if(n<8||n>144||(n&1)!==0)throw new L;this.version=t.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new Vt(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return t.prototype.getVersion=function(){return this.version},t.readVersion=function(e){var n=e.getHeight(),r=e.getWidth();return ch.getVersionForDimensions(n,r)},t.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),n=0,r=4,i=0,o=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),s=!1,l=!1,u=!1,
6c=!1;do if(r===o&&i===0&&!s)e[n++]=this.readCorner1(o,a)&255,r-=2,i+=2,s=!0;else if(r===o-2&&i===0&&(a&3)!==0&&!l)e[n++]=this.readCorner2(o,a)&255,r-=2,i+=2,l=!0;else if(r===o+4&&i===2&&(a&7)===0&&!u)e[n++]=this.readCorner3(o,a)&255,r-=2,i+=2,u=!0;else if(r===o-2&&i===0&&(a&7)===4&&!c)e[n++]=this.readCorner4(o,a)&255,r-=2,i+=2,c=!0;else{do r<o&&i>=0&&!this.readMappingMatrix.get(i,r)&&(e[n++]=this.readUtah(r,i,o,a)&255),r-=2,i+=2;while(r>=0&&i<a);r+=1,i+=3;do r>=0&&i<a&&!this.readMappingMatrix.get(i,r)&&(e[n++]=this.readUtah(r,i,o,a)&255),r+=2,i-=2;while(r<o&&i>=0);r+=3,i+=1}while(r<o||i<a);if(n!==this.version.getTotalCodewords())throw new L;return e},t.prototype.readModule=function(e,n,r,i){return e<0&&(e+=r,n+=4-(r+4&7)),n<0&&(n+=i,e+=4-(i+4&7)),this.readMappingMatrix.set(n,e),this.mappingBitMatrix.get(n,e)},t.prototype.readUtah=function(e,n,r,i){var o=0;return this.readModule(e-2,n-2,r,i)&&(o|=1),o<<=1,this.readModule(e-2,n-1,r,i)&&(o|=1),o<<=1,this.readModule(e-1,n-2,r,i)&&(o|=1),o<<=1,this.readModule(e-1,n-1,r,i)&&(o|=1),o<<=1,this.readModule(e-1,n,r,i)&&(o|=1),o<<=1,this.readModule(e,n-2,r,i)&&(o|=1),o<<=1,this.readModule(e,n-1,r,i)&&(o|=1),o<<=1,this.readModule(e,n,r,i)&&(o|=1),o},t.prototype.readCorner1=function(e,n){var r=0;return this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,1,e,n)&&(r|=1),r<<=1,this.readModule(e-1,2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(2,n-1,e,n)&&(r|=1),r<<=1,this.readModule(3,n-1,e,n)&&(r|=1),r},t.prototype.readCorner2=function(e,n){var r=0;return this.readModule(e-3,0,e,n)&&(r|=1),r<<=1,this.readModule(e-2,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(0,n-4,e,n)&&(r|=1),r<<=1,this.readModule(0,n-3,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r},t.prototype.readCorner3=function(e,n){var r=0;return this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(0,n-3,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-3,e,n)&&(r|=1),r<<=1,this.readModule(1,n-2,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r},t.prototype.readCorner4=function(e,n){var r=0;return this.readModule(e-3,0,e,n)&&(r|=1),r<<=1,this.readModule(e-2,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(2,n-1,e,n)&&(r|=1),r<<=1,this.readModule(3,n-1,e,n)&&(r|=1),r},t.prototype.extractDataRegion=function(e){var n=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(e.getHeight()!==n)throw new G("Dimension of bitMatrix must match the version size");for(var i=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),a=n/i|0,s=r/o|0,l=a*i,u=s*o,c=new Vt(u,l),f=0;f<a;++f)for(var d=f*i,h=0;h<s;++h)for(var p=h*o,m=0;m<i;++m)for(var y=f*(i+2)+1+m,w=d+m,_=0;_<o;++_){var C=h*(o+2)+1+_;if(e.get(C,y)){var E=p+_;c.set(E,w)}}return c},t})(),Wa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},dh=(function(){function t(e,n){this.numDataCodewords=e,this.codewords=n}return t.getDataBlocks=function(e,n){var r,i,o,a,s=n.getECBlocks(),l=0,u=s.getECBlocks();try{for(var c=Wa(u),f=c.next();!f.done;f=c.next()){var d=f.value;l+=d.getCount()}}catch(Ae){r={error:Ae}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}var h=new Array(l),p=0;try{for(var m=Wa(u),y=m.next();!y.done;y=m.next())for(var d=y.value,w=0;w<d.getCount();w++){var _=d.getDataCodewords(),C=s.getECCodewords()+_;h[p++]=new t(_,new Uint8Array(C))}}catch(Ae){o={error:Ae}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}
6for(var E=h[0].codewords.length,I=E-s.getECCodewords(),O=I-1,x=0,w=0;w<O;w++)for(var R=0;R<p;R++)h[R].codewords[w]=e[x++];for(var N=n.getVersionNumber()===24,F=N?8:p,R=0;R<F;R++)h[R].codewords[I-1]=e[x++];for(var W=h[0].codewords.length,w=I;w<W;w++)for(var R=0;R<p;R++){var $=N?(R+8)%p:R,Z=N&&$>7?w-1:w;h[$].codewords[Z]=e[x++]}if(x!==e.length)throw new G;return h},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t})(),Hl=(function(){function t(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}return t.prototype.getBitOffset=function(){return this.bitOffset},t.prototype.getByteOffset=function(){return this.byteOffset},t.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new G(""+e);var n=0,r=this.bitOffset,i=this.byteOffset,o=this.bytes;if(r>0){var a=8-r,s=e<a?e:a,l=a-s,u=255>>8-s<<l;n=(o[i]&u)>>l,e-=s,r+=s,r===8&&(r=0,i++)}if(e>0){for(;e>=8;)n=n<<8|o[i]&255,i++,e-=8;if(e>0){var l=8-e,u=255>>l<<l;n=n<<e|(o[i]&u)>>l,r+=e}}return this.bitOffset=r,this.byteOffset=i,n},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t})(),Be;(function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"})(Be||(Be={}));var hh=(function(){function t(){}return t.decode=function(e){var n=new Hl(e),r=new xe,i=new xe,o=new Array,a=Be.ASCII_ENCODE;do if(a===Be.ASCII_ENCODE)a=this.decodeAsciiSegment(n,r,i);else{switch(a){case Be.C40_ENCODE:this.decodeC40Segment(n,r);break;case Be.TEXT_ENCODE:this.decodeTextSegment(n,r);break;case Be.ANSIX12_ENCODE:this.decodeAnsiX12Segment(n,r);break;case Be.EDIFACT_ENCODE:this.decodeEdifactSegment(n,r);break;case Be.BASE256_ENCODE:this.decodeBase256Segment(n,r,o);break;default:throw new L}a=Be.ASCII_ENCODE}while(a!==Be.PAD_ENCODE&&n.available()>0);return i.length()>0&&r.append(i.toString()),new Oi(e,r.toString(),o.length===0?null:o,null)},t.decodeAsciiSegment=function(e,n,r){var i=!1;do{var o=e.readBits(8);if(o===0)throw new L;if(o<=128)return i&&(o+=128),n.append(String.fromCharCode(o-1)),Be.ASCII_ENCODE;if(o===129)return Be.PAD_ENCODE;if(o<=229){var a=o-130;a<10&&n.append("0"),n.append(""+a)}else switch(o){case 230:return Be.C40_ENCODE;case 231:return Be.BASE256_ENCODE;case 232:n.append("�");break;case 233:case 234:break;case 235:i=!0;break;case 236:n.append("[)>�05�"),r.insert(0,"��");break;case 237:n.append("[)>�06�"),r.insert(0,"��");break;case 238:return Be.ANSIX12_ENCODE;case 239:return Be.TEXT_ENCODE;case 240:return Be.EDIFACT_ENCODE;case 241:break;default:if(o!==254||e.available()!==0)throw new L;break}}while(e.available()>0);return Be.ASCII_ENCODE},t.decodeC40Segment=function(e,n){var r=!1,i=[],o=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),i);for(var s=0;s<3;s++){var l=i[s];switch(o){case 0:if(l<3)o=l+1;else if(l<this.C40_BASIC_SET_CHARS.length){var u=this.C40_BASIC_SET_CHARS[l];r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u)}else throw new L;break;case 1:r?(n.append(String.fromCharCode(l+128)),r=!1):n.append(String.fromCharCode(l)),o=0;break;case 2:if(l<this.C40_SHIFT2_SET_CHARS.length){var u=this.C40_SHIFT2_SET_CHARS[l];r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u)}else switch(l){case 27:n.append("�");break;case 30:r=!0;break;default:throw new L}o=0;break;case 3:r?(n.append(String.fromCharCode(l+224)),r=!1):n.append(String.fromCharCode(l+96)),o=0;break;default:throw new L}}}while(e.available()>0)},t.decodeTextSegment=function(e,n){var r=!1,i=[],o=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),i);for(var s=0;s<3;s++){var l=i[s];switch(o){case 0:if(l<3)o=l+1;else if(l<this.TEXT_BASIC_SET_CHARS.length){var u=this.TEXT_BASIC_SET_CHARS[l];r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u)}else throw new L;break;case 1:r?(n.append(String.fromCharCode(l+128)),r=!1):n.append(String.fromCharCode(l)),o=0;break;case 2:if(l<this.TEXT_SHIFT2_SET_CHARS.length){var u=this.TEXT_SHIFT2_SET_CHARS[l];r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u)}else switch(l){case 27:n.append("�");break;case 30:r=!0;break;default:throw new L}o=0;break;case 3:if(l<this.TEXT_SHIFT3_SET_CHARS.length){var u=this.TEXT_SHIFT3_SET_CHARS[l];r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u),o=0}else throw new L;break;default:throw new L}}}while(e.available()>0)},t.decodeAnsiX12Segment=function(e,n){var r=[];do{if(e.available()===8)return;var i=e.readBits(8);if(i===254)return;this.parseTwoBytes(i,e.readBits(8),r);for(var o=0;o<3;o++){var a=r[o];switch(a){case 0:n.append("\r");break;case 1:n.append("*");break;case 2:n.append(">");break;case 3:n.append(" ");break;default:if(a<14)n.append(String.fromCharCode(a+44));else if(a<40)n.append(String.fromCharCode(a+51));else throw new L;break}}}while(e.available()>0)},t.parseTwoBytes=function(e,n,r){var i=(e<<8)+n-1,o=Math.floor(i/1600);r[0]=o,i-=o*1600,o=Math.floor(i/40),r[1]=o,r[2]=i-o*40},t.decodeEdifactSegment=function(e,n){do{if(e.available()<=16)return;for(var r=0;r<4;r++){var i=e.readBits(6);if(i===31){var o=8-e.getBitOffset();o!==8&&e.readBits(o);return}(i&32)===0&&(i|=64),n.append(String.fromCharCode(i))}}while(e.available()>0)},t.decodeBase256Segment=function(e,n,r){var i=1+e.getByteOffset(),o=this.unrandomize255State(e.readBits(8),i++),a;if(o===0?a=e.available()/8|0:o<250?a=o:a=250*(o-249)+this.unrandomize255State(e.readBits(8),i++),a<0)throw new L;for(var s=new Uint8Array(a),l=0;l<a;l++){if(e.available()<8)throw new L;s[l]=this.unrandomize255State(e.readBits(8),i++)}r.push(s);try{n.append(Lt.decode(s,_e.ISO88591))}catch(u){throw new Ur("Platform does not support required encoding: "+u.message)}},t.unrandomize255State=function(e,n){var r=149*n%255+1,i=e-r;return i>=0?i:i+256},t.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],t.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],t.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],t.TEXT_SHIFT2_SET_CHARS=t.C40_SHIFT2_SET_CHARS,t.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~","�"],t})(),ph=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},gh=(function(){function t(){this.rsDecoder=new Mi(lt.DATA_MATRIX_FIELD_256)}return t.prototype.decode=function(e){var n,r,i=new fh(e),o=i.getVersion(),a=i.readCodewords(),s=dh.getDataBlocks(a,o),l=0;try{for(var u=ph(s),c=u.next();!c.done;c=u.next()){var f=c.value;l+=f.getNumDataCodewords()}}catch(C){n={error:C}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}for(var d=new Uint8Array(l),h=s.length,p=0;p<h;p++){var m=s[p],y=m.getCodewords(),w=m.getNumDataCodewords();this.correctErrors(y,w);for(var _=0;_<w;_++)d[_*h+p]=y[_]}return hh.decode(d)},t.prototype.correctErrors=function(e,n){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-n)}catch{throw new Xe}for(var i=0;i<n;i++)e[i]=r[i]},t})(),vh=(function(){function t(e){this.image=e,this.rectangleDetector=new ho(this.image)}return t.prototype.detect=function(){var e=this.rectangleDetector.detect(),n=this.detectSolid1(e);if(n=this.detectSolid2(n),n[3]=this.correctTopRight(n),!n[3])throw new k;n=this.shiftToModuleCenter(n);var r=n[0],i=n[1],o=n[2],a=n[3],s=this.transitionsBetween(r,a)+1,l=this.transitionsBetween(o,a)+1;
6(s&1)===1&&(s+=1),(l&1)===1&&(l+=1),4*s<7*l&&4*l<7*s&&(s=l=Math.max(s,l));var u=t.sampleGrid(this.image,r,i,o,a,s,l);return new zo(u,[r,i,o,a])},t.shiftPoint=function(e,n,r){var i=(n.getX()-e.getX())/(r+1),o=(n.getY()-e.getY())/(r+1);return new z(e.getX()+i,e.getY()+o)},t.moveAway=function(e,n,r){var i=e.getX(),o=e.getY();return i<n?i-=1:i+=1,o<r?o-=1:o+=1,new z(i,o)},t.prototype.detectSolid1=function(e){var n=e[0],r=e[1],i=e[3],o=e[2],a=this.transitionsBetween(n,r),s=this.transitionsBetween(r,i),l=this.transitionsBetween(i,o),u=this.transitionsBetween(o,n),c=a,f=[o,n,r,i];return c>s&&(c=s,f[0]=n,f[1]=r,f[2]=i,f[3]=o),c>l&&(c=l,f[0]=r,f[1]=i,f[2]=o,f[3]=n),c>u&&(f[0]=i,f[1]=o,f[2]=n,f[3]=r),f},t.prototype.detectSolid2=function(e){var n=e[0],r=e[1],i=e[2],o=e[3],a=this.transitionsBetween(n,o),s=t.shiftPoint(r,i,(a+1)*4),l=t.shiftPoint(i,r,(a+1)*4),u=this.transitionsBetween(s,n),c=this.transitionsBetween(l,o);return u<c?(e[0]=n,e[1]=r,e[2]=i,e[3]=o):(e[0]=r,e[1]=i,e[2]=o,e[3]=n),e},t.prototype.correctTopRight=function(e){var n=e[0],r=e[1],i=e[2],o=e[3],a=this.transitionsBetween(n,o),s=this.transitionsBetween(r,o),l=t.shiftPoint(n,r,(s+1)*4),u=t.shiftPoint(i,r,(a+1)*4);a=this.transitionsBetween(l,o),s=this.transitionsBetween(u,o);var c=new z(o.getX()+(i.getX()-r.getX())/(a+1),o.getY()+(i.getY()-r.getY())/(a+1)),f=new z(o.getX()+(n.getX()-r.getX())/(s+1),o.getY()+(n.getY()-r.getY())/(s+1));if(!this.isValid(c))return this.isValid(f)?f:null;if(!this.isValid(f))return c;var d=this.transitionsBetween(l,c)+this.transitionsBetween(u,c),h=this.transitionsBetween(l,f)+this.transitionsBetween(u,f);return d>h?c:f},t.prototype.shiftToModuleCenter=function(e){var n=e[0],r=e[1],i=e[2],o=e[3],a=this.transitionsBetween(n,o)+1,s=this.transitionsBetween(i,o)+1,l=t.shiftPoint(n,r,s*4),u=t.shiftPoint(i,r,a*4);a=this.transitionsBetween(l,o)+1,s=this.transitionsBetween(u,o)+1,(a&1)===1&&(a+=1),(s&1)===1&&(s+=1);var c=(n.getX()+r.getX()+i.getX()+o.getX())/4,f=(n.getY()+r.getY()+i.getY()+o.getY())/4;n=t.moveAway(n,c,f),r=t.moveAway(r,c,f),i=t.moveAway(i,c,f),o=t.moveAway(o,c,f);var d,h;return l=t.shiftPoint(n,r,s*4),l=t.shiftPoint(l,o,a*4),d=t.shiftPoint(r,n,s*4),d=t.shiftPoint(d,i,a*4),u=t.shiftPoint(i,o,s*4),u=t.shiftPoint(u,r,a*4),h=t.shiftPoint(o,i,s*4),h=t.shiftPoint(h,n,a*4),[l,d,u,h]},t.prototype.isValid=function(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()},t.sampleGrid=function(e,n,r,i,o,a,s){var l=Go.getInstance();return l.sampleGrid(e,a,s,.5,.5,a-.5,.5,a-.5,s-.5,.5,s-.5,n.getX(),n.getY(),o.getX(),o.getY(),i.getX(),i.getY(),r.getX(),r.getY())},t.prototype.transitionsBetween=function(e,n){var r=Math.trunc(e.getX()),i=Math.trunc(e.getY()),o=Math.trunc(n.getX()),a=Math.trunc(n.getY()),s=Math.abs(a-i)>Math.abs(o-r);if(s){var l=r;r=i,i=l,l=o,o=a,a=l}for(var u=Math.abs(o-r),c=Math.abs(a-i),f=-u/2,d=i<a?1:-1,h=r<o?1:-1,p=0,m=this.image.get(s?i:r,s?r:i),y=r,w=i;y!==o;y+=h){var _=this.image.get(s?w:y,s?y:w);if(_!==m&&(p++,m=_),f+=c,f>0){if(w===a)break;w+=d,f-=u}}return p},t})(),vo=(function(){function t(){this.decoder=new gh}
6return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r,i;if(n!=null&&n.has(Me.PURE_BARCODE)){var o=t.extractPureBits(e.getBlackMatrix());r=this.decoder.decode(o),i=t.NO_POINTS}else{var a=new vh(e.getBlackMatrix()).detect();r=this.decoder.decode(a.getBits()),i=a.getPoints()}var s=r.getRawBytes(),l=new ht(r.getText(),s,8*s.length,i,X.DATA_MATRIX,Ce.currentTimeMillis()),u=r.getByteSegments();u!=null&&l.putMetadata(je.BYTE_SEGMENTS,u);var c=r.getECLevel();return c!=null&&l.putMetadata(je.ERROR_CORRECTION_LEVEL,c),l},t.prototype.reset=function(){},t.extractPureBits=function(e){var n=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(n==null||r==null)throw new k;var i=this.moduleSize(n,e),o=n[1],a=r[1],s=n[0],l=r[0],u=(l-s+1)/i,c=(a-o+1)/i;if(u<=0||c<=0)throw new k;var f=i/2;o+=f,s+=f;for(var d=new Vt(u,c),h=0;h<c;h++)for(var p=o+h*i,m=0;m<u;m++)e.get(s+m*i,p)&&d.set(m,h);return d},t.moduleSize=function(e,n){for(var r=n.getWidth(),i=e[0],o=e[1];i<r&&n.get(i,o);)i++;if(i===r)throw new k;var a=i-e[0];if(a===0)throw new k;return a},t.NO_POINTS=[],t})(),mh=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){mh(e,t);function e(n){return n===void 0&&(n=500),t.call(this,new vo,n)||this}return e})(er);var Bn;(function(t){t[t.L=0]="L",t[t.M=1]="M",t[t.Q=2]="Q",t[t.H=3]="H"})(Bn||(Bn={}));var yh=(function(){function t(e,n,r){this.value=e,this.stringValue=n,this.bits=r,t.FOR_BITS.set(r,this),t.FOR_VALUE.set(e,this)}return t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.fromString=function(e){switch(e){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new At(e+"not available")}},t.prototype.toString=function(){return this.stringValue},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.forBits=function(e){if(e<0||e>=t.FOR_BITS.size)throw new G;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(Bn.L,"L",1),t.M=new t(Bn.M,"M",0),t.Q=new t(Bn.Q,"Q",3),t.H=new t(Bn.H,"H",2),t})(),xh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Wl=(function(){function t(e){this.errorCorrectionLevel=yh.forBits(e>>3&3),this.dataMask=e&7}return t.numBitsDiffering=function(e,n){return J.bitCount(e^n)},t.decodeFormatInformation=function(e,n){var r=t.doDecodeFormatInformation(e,n);return r!==null?r:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,n^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,n){var r,i,o=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=xh(t.FORMAT_INFO_DECODE_LOOKUP),l=s.next();!l.done;l=s.next()){var u=l.value,c=u[0];if(c===e||c===n)return new t(u[1]);var f=t.numBitsDiffering(e,c);f<o&&(a=u[1],o=f),e!==n&&(f=t.numBitsDiffering(n,c),f<o&&(a=u[1],o=f))}}catch(d){r={error:d}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o<=3?new t(a):null},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getDataMask=function(){return this.dataMask},t.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.errorCorrectionLevel===n.errorCorrectionLevel&&this.dataMask===n.dataMask},t.FORMAT_INFO_MASK_QR=21522,t.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],t})(),wh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},M=(function(){function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.ecCodewordsPerBlock=e,this.ecBlocks=n}return t.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},t.prototype.getNumBlocks=function(){var e,n,r=0,i=this.ecBlocks;try{for(var o=wh(i),a=o.next();!a.done;a=o.next()){var s=a.value;r+=s.getCount()}}catch(l){e={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r},t.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},t.prototype.getECBlocks=function(){return this.ecBlocks},t})(),b=(function(){function t(e,n){this.count=e,this.dataCodewords=n}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t})(),_h=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},En=(function(){function t(e,n){for(var r,i,o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];this.versionNumber=e,this.alignmentPatternCenters=n,this.ecBlocks=o;var s=0,l=o[0].getECCodewordsPerBlock(),u=o[0].getECBlocks();try{for(var c=_h(u),f=c.next();!f.done;f=c.next()){var d=f.value;s+=d.getCount()*(d.getDataCodewords()+l)}}catch(h){r={error:h}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}this.totalCodewords=s}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},t.prototype.getECBlocksForLevel=function(e){return this.ecBlocks[e.getValue()]},t.getProvisionalVersionForDimension=function(e){if(e%4!==1)throw new L;try{return this.getVersionForNumber((e-17)/4)}catch{throw new L}},t.getVersionForNumber=function(e){if(e<1||e>40)throw new G;return t.VERSIONS[e-1]},t.decodeVersionInformation=function(e){for(var n=Number.MAX_SAFE_INTEGER,r=0,i=0;i<t.VERSION_DECODE_INFO.length;i++){var o=t.VERSION_DECODE_INFO[i];if(o===e)return t.getVersionForNumber(i+7);var a=Wl.numBitsDiffering(e,o);a<n&&(r=i+7,n=a)}return n<=3?t.getVersionForNumber(r):null},t.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),n=new Vt(e);n.setRegion(0,0,9,9),n.setRegion(e-8,0,8,9),n.setRegion(0,e-8,9,8);for(var r=this.alignmentPatternCenters.length,i=0;i<r;i++)for(var o=this.alignmentPatternCenters[i]-2,a=0;a<r;a++)i===0&&(a===0||a===r-1)||i===r-1&&a===0||n.setRegion(this.alignmentPatternCenters[a]-2,o,5,5);return n.setRegion(6,9,1,e-17),n.setRegion(9,6,e-17,1),this.versionNumber>6&&(n.setRegion(e-11,0,3,6),n.setRegion(0,e-11,6,3)),n},t.prototype.toString=function(){return""+this.versionNumber},t.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),t.VERSIONS=[new t(1,new Int32Array(0),new M(7,new b(1,19)),new M(10,new b(1,16)),new M(13,new b(1,13)),new M(17,new b(1,9))),new t(2,Int32Array.from([6,18]),new M(10,new b(1,34)),new M(16,new b(1,28)),new M(22,new b(1,22)),new M(28,new b(1,16))),new t(3,Int32Array.from([6,22]),new M(15,new b(1,55)),new M(26,new b(1,44)),new M(18,new b(2,17)),new M(22,new b(2,13))),new t(4,Int32Array.from([6,26]),new M(20,new b(1,80)),new M(18,new b(2,32)),new M(26,new b(2,24)),new M(16,new b(4,9))),new t(5,Int32Array.from([6,30]),new M(26,new b(1,108)),new M(24,new b(2,43)),new M(18,new b(2,15),new b(2,16)),new M(22,new b(2,11),new b(2,12))),new t(6,Int32Array.from([6,34]),new M(18,new b(2,68)),new M(16,new b(4,27)),new M(24,new b(4,19)),new M(28,new b(4,15))),new t(7,Int32Array.from([6,22,38]),new M(20,new b(2,78)),new M(18,new b(4,31)),new M(18,new b(2,14),new b(4,15)),new M(26,new b(4,13),new b(1,14))),new t(8,Int32Array.from([6,24,42]),new M(24,new b(2,97)),new M(22,new b(2,38),new b(2,39)),new M(22,new b(4,18),new b(2,19)),new M(26,new b(4,14),new b(2,15))),new t(9,Int32Array.from([6,26,46]),new M(30,new b(2,116)),new M(22,new b(3,36),new b(2,37)),new M(20,new b(4,16),new b(4,17)),new M(24,new b(4,12),new b(4,13))),new t(10,Int32Array.from([6,28,50]),new M(18,new b(2,68),new b(2,69)),new M(26,new b(4,43),new b(1,44)),new M(24,new b(6,19),new b(2,20)),new M(28,new b(6,15),new b(2,16))),new t(11,Int32Array.from([6,30,54]),new M(20,new b(4,81)),new M(30,new b(1,50),new b(4,51)),new M(28,new b(4,22),new b(4,23)),new M(24,new b(3,12),new b(8,13))),new t(12,Int32Array.from([6,32,58]),new M(24,new b(2,92),new b(2,93)),new M(22,new b(6,36),new b(2,37)),new M(26,new b(4,20),new b(6,21)),new M(28,new b(7,14),new b(4,15))),new t(13,Int32Array.from([6,34,62]),new M(26,new b(4,107)),new M(22,new b(8,37),new b(1,38)),new M(24,new b(8,20),new b(4,21)),new M(22,new b(12,11),new b(4,12))),new t(14,Int32Array.from([6,26,46,66]),new M(30,new b(3,115),new b(1,116)),new M(24,new b(4,40),new b(5,41)),new M(20,new b(11,16),new b(5,17)),new M(24,new b(11,12),new b(5,13))),new t(15,Int32Array.from([6,26,48,70]),new M(22,new b(5,87),new b(1,88)),new M(24,new b(5,41),new b(5,42)),new M(30,new b(5,24),new b(7,25)),new M(24,new b(11,12),new b(7,13))),new t(16,Int32Array.from([6,26,50,74]),new M(24,new b(5,98),new b(1,99)),new M(28,new b(7,45),new b(3,46)),new M(24,new b(15,19),new b(2,20)),new M(30,new b(3,15),new b(13,16))),new t(17,Int32Array.from([6,30,54,78]),new M(28,new b(1,107),new b(5,108)),new M(28,new b(10,46),new b(1,47)),new M(28,new b(1,22),new b(15,23)),new M(28,new b(2,14),new b(17,15))),new t(18,Int32Array.from([6,30,56,82]),new M(30,new b(5,120),new b(1,121)),new M(26,new b(9,43),new b(4,44)),new M(28,new b(17,22),new b(1,23)),new M(28,new b(2,14),new b(19,15))),new t(19,Int32Array.from([6,30,58,86]),new M(28,new b(3,113),new b(4,114)),new M(26,new b(3,44),new b(11,45)),new M(26,new b(17,21),new b(4,22)),new M(26,new b(9,13),new b(16,14))),new t(20,Int32Array.from([6,34,62,90]),new M(28,new b(3,107),new b(5,108)),new M(26,new b(3,41),new b(13,42)),new M(30,new b(15,24),new b(5,25)),new M(28,new b(15,15),new b(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new M(28,new b(4,116),new b(4,117)),new M(26,new b(17,42)),new M(28,new b(17,22),new b(6,23)),new M(30,new b(19,16),new b(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new M(28,new b(2,111),new b(7,112)),new M(28,new b(17,46)),new M(30,new b(7,24),new b(16,25)),new M(24,new b(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new M(30,new b(4,121),new b(5,122)),new M(28,new b(4,47),new b(14,48)),new M(30,new b(11,24),new b(14,25)),new M(30,new b(16,15),new b(14,16))
6),new t(24,Int32Array.from([6,28,54,80,106]),new M(30,new b(6,117),new b(4,118)),new M(28,new b(6,45),new b(14,46)),new M(30,new b(11,24),new b(16,25)),new M(30,new b(30,16),new b(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new M(26,new b(8,106),new b(4,107)),new M(28,new b(8,47),new b(13,48)),new M(30,new b(7,24),new b(22,25)),new M(30,new b(22,15),new b(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new M(28,new b(10,114),new b(2,115)),new M(28,new b(19,46),new b(4,47)),new M(28,new b(28,22),new b(6,23)),new M(30,new b(33,16),new b(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new M(30,new b(8,122),new b(4,123)),new M(28,new b(22,45),new b(3,46)),new M(30,new b(8,23),new b(26,24)),new M(30,new b(12,15),new b(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new M(30,new b(3,117),new b(10,118)),new M(28,new b(3,45),new b(23,46)),new M(30,new b(4,24),new b(31,25)),new M(30,new b(11,15),new b(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new M(30,new b(7,116),new b(7,117)),new M(28,new b(21,45),new b(7,46)),new M(30,new b(1,23),new b(37,24)),new M(30,new b(19,15),new b(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new M(30,new b(5,115),new b(10,116)),new M(28,new b(19,47),new b(10,48)),new M(30,new b(15,24),new b(25,25)),new M(30,new b(23,15),new b(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new M(30,new b(13,115),new b(3,116)),new M(28,new b(2,46),new b(29,47)),new M(30,new b(42,24),new b(1,25)),new M(30,new b(23,15),new b(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new M(30,new b(17,115)),new M(28,new b(10,46),new b(23,47)),new M(30,new b(10,24),new b(35,25)),new M(30,new b(19,15),new b(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new M(30,new b(17,115),new b(1,116)),new M(28,new b(14,46),new b(21,47)),new M(30,new b(29,24),new b(19,25)),new M(30,new b(11,15),new b(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new M(30,new b(13,115),new b(6,116)),new M(28,new b(14,46),new b(23,47)),new M(30,new b(44,24),new b(7,25)),new M(30,new b(59,16),new b(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new M(30,new b(12,121),new b(7,122)),new M(28,new b(12,47),new b(26,48)),new M(30,new b(39,24),new b(14,25)),new M(30,new b(22,15),new b(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new M(30,new b(6,121),new b(14,122)),new M(28,new b(6,47),new b(34,48)),new M(30,new b(46,24),new b(10,25)),new M(30,new b(2,15),new b(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new M(30,new b(17,122),new b(4,123)),new M(28,new b(29,46),new b(14,47)),new M(30,new b(49,24),new b(10,25)),new M(30,new b(24,15),new b(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new M(30,new b(4,122),new b(18,123)),new M(28,new b(13,46),new b(32,47)),new M(30,new b(48,24),new b(14,25)),new M(30,new b(42,15),new b(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new M(30,new b(20,117),new b(4,118)),new M(28,new b(40,47),new b(7,48)),new M(30,new b(43,24),new b(22,25)),new M(30,new b(10,15),new b(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new M(30,new b(19,118),new b(6,119)),new M(28,new b(18,47),new b(31,48)),new M(30,new b(34,24),new b(34,25)),new M(30,new b(20,15),new b(61,16)))],t})(),$e;(function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"})($e||($e={}));var za=(function(){function t(e,n){this.value=e,this.isMasked=n}return t.prototype.unmaskBitMatrix=function(e,n){for(var r=0;r<n;r++)for(var i=0;i<n;i++)this.isMasked(r,i)&&e.flip(i,r)},t.values=new Map([[$e.DATA_MASK_000,new t($e.DATA_MASK_000,function(e,n){return(e+n&1)===0})],[$e.DATA_MASK_001,new t($e.DATA_MASK_001,function(e,n){return(e&1)===0})],[$e.DATA_MASK_010,new t($e.DATA_MASK_010,function(e,n){return n%3===0})],[$e.DATA_MASK_011,new t($e.DATA_MASK_011,function(e,n){return(e+n)%3===0})],[$e.DATA_MASK_100,new t($e.DATA_MASK_100,function(e,n){return(Math.floor(e/2)+Math.floor(n/3)&1)===0})],[$e.DATA_MASK_101,new t($e.DATA_MASK_101,function(e,n){return e*n%6===0})],[$e.DATA_MASK_110,new t($e.DATA_MASK_110,function(e,n){return e*n%6<3})],[$e.DATA_MASK_111,new t($e.DATA_MASK_111,function(e,n){return(e+n+e*n%3&1)===0})]]),t})(),bh=(function(){function t(e){var n=e.getHeight();if(n<21||(n&3)!==1)throw new L;this.bitMatrix=e}return t.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;for(var e=0,n=0;n<6;n++)e=this.copyBit(n,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var r=5;r>=0;r--)e=this.copyBit(8,r,e);for(var i=this.bitMatrix.getHeight(),o=0,a=i-7,r=i-1;r>=a;r--)o=this.copyBit(8,r,o);for(var n=i-8;n<i;n++)o=this.copyBit(n,8,o);if(this.parsedFormatInfo=Wl.decodeFormatInformation(e,o),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new L},t.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;var e=this.bitMatrix.getHeight(),n=Math.floor((e-17)/4);if(n<=6)return En.getVersionForNumber(n);for(var r=0,i=e-11,o=5;o>=0;o--)for(var a=e-9;a>=i;a--)r=this.copyBit(a,o,r);var s=En.decodeVersionInformation(r);if(s!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;r=0;for(var a=5;a>=0;a--)for(var o=e-9;o>=i;o--)r=this.copyBit(a,o,r);if(s=En.decodeVersionInformation(r),s!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;throw new L},t.prototype.copyBit=function(e,n,r){var i=this.isMirror?this.bitMatrix.get(n,e):this.bitMatrix.get(e,n);return i?r<<1|1:r<<1},t.prototype.readCodewords=function(){var e=this.readFormatInformation(),n=this.readVersion(),r=za.values.get(e.getDataMask()),i=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,i);for(var o=n.buildFunctionPattern(),a=!0,s=new Uint8Array(n.getTotalCodewords()),l=0,u=0,c=0,f=i-1;f>0;f-=2){f===6&&f--;for(var d=0;d<i;d++)for(var h=a?i-1-d:d,p=0;p<2;p++)o.get(f-p,h)||(c++,u<<=1,this.bitMatrix.get(f-p,h)&&(u|=1),c===8&&(s[l++]=u,c=0,u=0));a=!a}if(l!==n.getTotalCodewords())throw new L;return s},t.prototype.remask=function(){if(this.parsedFormatInfo!==null){var e=za.values[this.parsedFormatInfo.getDataMask()],n=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,n)}},t.prototype.setMirror=function(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e},t.prototype.mirror=function(){for(var e=this.bitMatrix,n=0,r=e.getWidth();n<r;n++)for(var i=n+1,o=e.getHeight();i<o;i++)e.get(n,i)!==e.get(i,n)&&(e.flip(i,n),e.flip(n,i))},t})(),Ga=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
6,Ch=(function(){function t(e,n){this.numDataCodewords=e,this.codewords=n}return t.getDataBlocks=function(e,n,r){var i,o,a,s;if(e.length!==n.getTotalCodewords())throw new G;var l=n.getECBlocksForLevel(r),u=0,c=l.getECBlocks();try{for(var f=Ga(c),d=f.next();!d.done;d=f.next()){var h=d.value;u+=h.getCount()}}catch(Z){i={error:Z}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}var p=new Array(u),m=0;try{for(var y=Ga(c),w=y.next();!w.done;w=y.next())for(var h=w.value,_=0;_<h.getCount();_++){var C=h.getDataCodewords(),E=l.getECCodewordsPerBlock()+C;p[m++]=new t(C,new Uint8Array(E))}}catch(Z){a={error:Z}}finally{try{w&&!w.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}for(var I=p[0].codewords.length,O=p.length-1;O>=0;){var x=p[O].codewords.length;if(x===I)break;O--}O++;for(var R=I-l.getECCodewordsPerBlock(),N=0,_=0;_<R;_++)for(var F=0;F<m;F++)p[F].codewords[_]=e[N++];for(var F=O;F<m;F++)p[F].codewords[R]=e[N++];for(var W=p[0].codewords.length,_=R;_<W;_++)for(var F=0;F<m;F++){var $=F<O?_:_+1;p[F].codewords[$]=e[N++]}return p},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t})(),gt;(function(t){t[t.TERMINATOR=0]="TERMINATOR",t[t.NUMERIC=1]="NUMERIC",t[t.ALPHANUMERIC=2]="ALPHANUMERIC",t[t.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",t[t.BYTE=4]="BYTE",t[t.ECI=5]="ECI",t[t.KANJI=6]="KANJI",t[t.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",t[t.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",t[t.HANZI=9]="HANZI"})(gt||(gt={}));var Se=(function(){function t(e,n,r,i){this.value=e,this.stringValue=n,this.characterCountBitsForVersions=r,this.bits=i,t.FOR_BITS.set(i,this),t.FOR_VALUE.set(e,this)}return t.forBits=function(e){var n=t.FOR_BITS.get(e);if(n===void 0)throw new G;return n},t.prototype.getCharacterCountBits=function(e){var n=e.getVersionNumber(),r;return n<=9?r=0:n<=26?r=1:r=2,this.characterCountBitsForVersions[r]},t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.prototype.toString=function(){return this.stringValue},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.TERMINATOR=new t(gt.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),t.NUMERIC=new t(gt.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),t.ALPHANUMERIC=new t(gt.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),t.STRUCTURED_APPEND=new t(gt.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),t.BYTE=new t(gt.BYTE,"BYTE",Int32Array.from([8,16,16]),4),t.ECI=new t(gt.ECI,"ECI",Int32Array.from([0,0,0]),7),t.KANJI=new t(gt.KANJI,"KANJI",Int32Array.from([8,10,12]),8),t.FNC1_FIRST_POSITION=new t(gt.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),t.FNC1_SECOND_POSITION=new t(gt.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),t.HANZI=new t(gt.HANZI,"HANZI",Int32Array.from([8,10,12]),13),t})(),Ah=(function(){function t(){}return t.decode=function(e,n,r,i){var o=new Hl(e),a=new xe,s=new Array,l=-1,u=-1;try{var c=null,f=!1,d=void 0;do{if(o.available()<4)d=Se.TERMINATOR;else{var h=o.readBits(4);d=Se.forBits(h)}switch(d){case Se.TERMINATOR:break;case Se.FNC1_FIRST_POSITION:case Se.FNC1_SECOND_POSITION:f=!0;break;case Se.STRUCTURED_APPEND:if(o.available()<16)throw new L;l=o.readBits(8),u=o.readBits(8);break;case Se.ECI:var p=t.parseECIValue(o);if(c=Le.getCharacterSetECIByValue(p),c===null)throw new L;break;case Se.HANZI:var m=o.readBits(4),y=o.readBits(d.getCharacterCountBits(n));m===t.GB2312_SUBSET&&t.decodeHanziSegment(o,a,y);break;default:var w=o.readBits(d.getCharacterCountBits(n));switch(d){case Se.NUMERIC:t.decodeNumericSegment(o,a,w);break;case Se.ALPHANUMERIC:t.decodeAlphanumericSegment(o,a,w,f);break;case Se.BYTE:t.decodeByteSegment(o,a,w,c,s,i);break;case Se.KANJI:t.decodeKanjiSegment(o,a,w);break;default:throw new L}break}}while(d!==Se.TERMINATOR)}catch{throw new L}return new Oi(e,a.toString(),s.length===0?null:s,r===null?null:r.toString(),l,u)},t.decodeHanziSegment=function(e,n,r){if(r*13>e.available())throw new L;for(var i=new Uint8Array(2*r),o=0;r>0;){var a=e.readBits(13),s=a/96<<8&4294967295|a%96;s<959?s+=41377:s+=42657,i[o]=s>>8&255,i[o+1]=s&255,o+=2,r--}try{n.append(Lt.decode(i,_e.GB2312))}catch(l){throw new L(l)}},t.decodeKanjiSegment=function(e,n,r){if(r*13>e.available())throw new L;for(var i=new Uint8Array(2*r),o=0;r>0;){var a=e.readBits(13),s=a/192<<8&4294967295|a%192;s<7936?s+=33088:s+=49472,i[o]=s>>8,i[o+1]=s,o+=2,r--}try{n.append(Lt.decode(i,_e.SHIFT_JIS))}catch(l){throw new L(l)}},t.decodeByteSegment=function(e,n,r,i,o,a){if(8*r>e.available())throw new L;for(var s=new Uint8Array(r),l=0;l<r;l++)s[l]=e.readBits(8);var u;
6i===null?u=_e.guessEncoding(s,a):u=i.getName();try{n.append(Lt.decode(s,u))}catch(c){throw new L(c)}o.push(s)},t.toAlphaNumericChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new L;return t.ALPHANUMERIC_CHARS[e]},t.decodeAlphanumericSegment=function(e,n,r,i){for(var o=n.length();r>1;){if(e.available()<11)throw new L;var a=e.readBits(11);n.append(t.toAlphaNumericChar(Math.floor(a/45))),n.append(t.toAlphaNumericChar(a%45)),r-=2}if(r===1){if(e.available()<6)throw new L;n.append(t.toAlphaNumericChar(e.readBits(6)))}if(i)for(var s=o;s<n.length();s++)n.charAt(s)==="%"&&(s<n.length()-1&&n.charAt(s+1)==="%"?n.deleteCharAt(s+1):n.setCharAt(s,"�"))},t.decodeNumericSegment=function(e,n,r){for(;r>=3;){if(e.available()<10)throw new L;var i=e.readBits(10);if(i>=1e3)throw new L;n.append(t.toAlphaNumericChar(Math.floor(i/100))),n.append(t.toAlphaNumericChar(Math.floor(i/10)%10)),n.append(t.toAlphaNumericChar(i%10)),r-=3}if(r===2){if(e.available()<7)throw new L;var o=e.readBits(7);if(o>=100)throw new L;n.append(t.toAlphaNumericChar(Math.floor(o/10))),n.append(t.toAlphaNumericChar(o%10))}else if(r===1){if(e.available()<4)throw new L;var a=e.readBits(4);if(a>=10)throw new L;n.append(t.toAlphaNumericChar(a))}},t.parseECIValue=function(e){var n=e.readBits(8);if((n&128)===0)return n&127;if((n&192)===128){var r=e.readBits(8);return(n&63)<<8&4294967295|r}if((n&224)===192){var i=e.readBits(16);return(n&31)<<16&4294967295|i}throw new L},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.GB2312_SUBSET=1,t})(),zl=(function(){function t(e){this.mirrored=e}return t.prototype.isMirrored=function(){return this.mirrored},t.prototype.applyMirroredCorrection=function(e){if(!(!this.mirrored||e===null||e.length<3)){var n=e[0];e[0]=e[2],e[2]=n}},t})(),Ka=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Eh=(function(){function t(){this.rsDecoder=new Mi(lt.QR_CODE_FIELD_256)}return t.prototype.decodeBooleanArray=function(e,n){return this.decodeBitMatrix(Vt.parseFromBooleanArray(e),n)},t.prototype.decodeBitMatrix=function(e,n){var r=new bh(e),i=null;try{return this.decodeBitMatrixParser(r,n)}catch(a){i=a}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var o=this.decodeBitMatrixParser(r,n);return o.setOther(new zl(!0)),o}catch(a){throw i!==null?i:a}},t.prototype.decodeBitMatrixParser=function(e,n){var r,i,o,a,s=e.readVersion(),l=e.readFormatInformation().getErrorCorrectionLevel(),u=e.readCodewords(),c=Ch.getDataBlocks(u,s,l),f=0;try{for(var d=Ka(c),h=d.next();!h.done;h=d.next()){var p=h.value;f+=p.getNumDataCodewords()}}catch(O){r={error:O}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}var m=new Uint8Array(f),y=0;try{for(var w=Ka(c),_=w.next();!_.done;_=w.next()){var p=_.value,C=p.getCodewords(),E=p.getNumDataCodewords();this.correctErrors(C,E);for(var I=0;I<E;I++)m[y++]=C[I]}}catch(O){o={error:O}}finally{try{_&&!_.done&&(a=w.return)&&a.call(w)}finally{if(o)throw o.error}}return Ah.decode(m,s,l,n)},t.prototype.correctErrors=function(e,n){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-n)}catch{throw new Xe}for(var i=0;i<n;i++)e[i]=r[i]},t})(),Sh=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ih=(function(t){Sh(e,t);function e(n,r,i){var o=t.call(this,n,r)||this;return o.estimatedModuleSize=i,o}return e.prototype.aboutEquals=function(n,r,i){if(Math.abs(r-this.getY())<=n&&Math.abs(i-this.getX())<=n){var o=Math.abs(n-this.estimatedModuleSize);return o<=1||o<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(n,r,i){var o=(this.getX()+r)/2,a=(this.getY()+n)/2,s=(this.estimatedModuleSize+i)/2;return new e(o,a,s)},e})(z),Th=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Oh=(function(){function t(e,n,r,i,o,a,s){this.image=e,this.startX=n,this.startY=r,this.width=i,this.height=o,this.moduleSize=a,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return t.prototype.find=function(){for(var e=this.startX,n=this.height,r=this.width,i=e+r,o=this.startY+n/2,a=new Int32Array(3),s=this.image,l=0;l<n;l++){var u=o+((l&1)===0?Math.floor((l+1)/2):-Math.floor((l+1)/2));a[0]=0,a[1]=0,a[2]=0;for(var c=e;c<i&&!s.get(c,u);)c++;for(var f=0;c<i;){if(s.get(c,u))if(f===1)a[1]++;else if(f===2){if(this.foundPatternCross(a)){var d=this.handlePossibleCenter(a,u,c);if(d!==null)return d}a[0]=a[2],a[1]=1,a[2]=0,f=1}else a[++f]++;else f===1&&f++,a[f]++;c++}if(this.foundPatternCross(a)){var d=this.handlePossibleCenter(a,u,i);if(d!==null)return d}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new k},t.centerFromEnd=function(e,n){return n-e[2]-e[1]/2},t.prototype.foundPatternCross=function(e){for(var n=this.moduleSize,r=n/2,
6i=0;i<3;i++)if(Math.abs(n-e[i])>=r)return!1;return!0},t.prototype.crossCheckVertical=function(e,n,r,i){var o=this.image,a=o.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var l=e;l>=0&&o.get(n,l)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&!o.get(n,l)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=e+1;l<a&&o.get(n,l)&&s[1]<=r;)s[1]++,l++;if(l===a||s[1]>r)return NaN;for(;l<a&&!o.get(n,l)&&s[2]<=r;)s[2]++,l++;if(s[2]>r)return NaN;var u=s[0]+s[1]+s[2];return 5*Math.abs(u-i)>=2*i?NaN:this.foundPatternCross(s)?t.centerFromEnd(s,l):NaN},t.prototype.handlePossibleCenter=function(e,n,r){var i,o,a=e[0]+e[1]+e[2],s=t.centerFromEnd(e,r),l=this.crossCheckVertical(n,s,2*e[1],a);if(!isNaN(l)){var u=(e[0]+e[1]+e[2])/3;try{for(var c=Th(this.possibleCenters),f=c.next();!f.done;f=c.next()){var d=f.value;if(d.aboutEquals(u,l,s))return d.combineEstimate(l,s,u)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}var h=new Ih(s,l,u);this.possibleCenters.push(h),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(h)}return null},t})(),Mh=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Rh=(function(t){Mh(e,t);function e(n,r,i,o){var a=t.call(this,n,r)||this;return a.estimatedModuleSize=i,a.count=o,o===void 0&&(a.count=1),a}return e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(n,r,i){if(Math.abs(r-this.getY())<=n&&Math.abs(i-this.getX())<=n){var o=Math.abs(n-this.estimatedModuleSize);return o<=1||o<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(n,r,i){var o=this.count+1,a=(this.count*this.getX()+r)/o,s=(this.count*this.getY()+n)/o,l=(this.count*this.estimatedModuleSize+i)/o;return new e(a,s,l,o)},e})(z),Dh=(function(){function t(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t})(),ur=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},kh=(function(){function t(e,n){this.image=e,this.resultPointCallback=n,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=n}return t.prototype.getImage=function(){return this.image},t.prototype.getPossibleCenters=function(){return this.possibleCenters},t.prototype.find=function(e){var n=e!=null&&e.get(Me.TRY_HARDER)!==void 0,r=e!=null&&e.get(Me.PURE_BARCODE)!==void 0,i=this.image,o=i.getHeight(),a=i.getWidth(),s=Math.floor(3*o/(4*t.MAX_MODULES));(s<t.MIN_SKIP||n)&&(s=t.MIN_SKIP);for(var l=!1,u=new Int32Array(5),c=s-1;c<o&&!l;c+=s){u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0;for(var f=0,d=0;d<a;d++)if(i.get(d,c))(f&1)===1&&f++,u[f]++;else if((f&1)===0)if(f===4)if(t.foundPatternCross(u)){var h=this.handlePossibleCenter(u,c,d,r);if(h===!0)if(s=2,this.hasSkipped===!0)l=this.haveMultiplyConfirmedCenters();else{var p=this.findRowSkip();p>u[2]&&(c+=p-u[2]-s,d=a-1)}else{u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,f=3;continue}f=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,f=3;else u[++f]++;else u[f]++;if(t.foundPatternCross(u)){var h=this.handlePossibleCenter(u,c,a,r);h===!0&&(s=u[0],this.hasSkipped&&(l=this.haveMultiplyConfirmedCenters()))}}var m=this.selectBestPatterns();return z.orderBestPatterns(m),new Dh(m)},t.centerFromEnd=function(e,n){return n-e[4]-e[3]-e[2]/2},t.foundPatternCross=function(e){for(var n=0,r=0;r<5;r++){var i=e[r];if(i===0)return!1;n+=i}if(n<7)return!1;var o=n/7,a=o/2;return Math.abs(o-e[0])<a&&Math.abs(o-e[1])<a&&Math.abs(3*o-e[2])<3*a&&Math.abs(o-e[3])<a&&Math.abs(o-e[4])<a},t.prototype.getCrossCheckStateCount=function(){var e=this.crossCheckStateCount;return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e},t.prototype.crossCheckDiagonal=function(e,n,r,i){for(var o=this.getCrossCheckStateCount(),a=0,s=this.image;e>=a&&n>=a&&s.get(n-a,e-a);)o[2]++,a++;if(e<a||n<a)return!1;for(;e>=a&&n>=a&&!s.get(n-a,e-a)&&o[1]<=r;)o[1]++,a++;if(e<a||n<a||o[1]>r)return!1;for(;e>=a&&n>=a&&s.get(n-a,e-a)&&o[0]<=r;)o[0]++,a++;if(o[0]>r)return!1;var l=s.getHeight(),u=s.getWidth();for(a=1;e+a<l&&n+a<u&&s.get(n+a,e+a);)o[2]++,a++;if(e+a>=l||n+a>=u)return!1;for(;e+a<l&&n+a<u&&!s.get(n+a,e+a)&&o[3]<r;)o[3]++,a++;if(e+a>=l||n+a>=u||o[3]>=r)return!1;for(;e+a<l&&n+a<u&&s.get(n+a,e+a)&&o[4]<r;)o[4]++,a++;if(o[4]>=r)return!1;var c=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(c-i)<2*i&&t.foundPatternCross(o)},t.prototype.crossCheckVertical=function(e,n,r,i){for(var o=this.image,a=o.getHeight(),s=this.getCrossCheckStateCount(),l=e;l>=0&&o.get(n,l);)s[2]++,l--;if(l<0)return NaN;for(;l>=0&&!o.get(n,l)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&o.get(n,l)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=e+1;l<a&&o.get(n,l);)s[2]++,l++;if(l===a)return NaN;for(;l<a&&!o.get(n,l)&&s[3]<r;)s[3]++,l++;if(l===a||s[3]>=r)return NaN;for(;l<a&&o.get(n,l)&&s[4]<r;)s[4]++,l++;if(s[4]>=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-i)>=2*i?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,l):NaN},t.prototype.crossCheckHorizontal=function(e,n,r,i){for(var o=this.image,a=o.getWidth(),s=this.getCrossCheckStateCount(),l=e;l>=0&&o.get(l,n);)s[2]++,l--;if(l<0)return NaN;for(;l>=0&&!o.get(l,n)&&s[1]<=r;)s[1]++,l--;if(l<0||s[1]>r)return NaN;for(;l>=0&&o.get(l,n)&&s[0]<=r;)s[0]++,l--;if(s[0]>r)return NaN;for(l=e+1;l<a&&o.get(l,n);)s[2]++,l++;if(l===a)return NaN;for(;l<a&&!o.get(l,n)&&s[3]<r;)s[3]++,l++;if(l===a||s[3]>=r)return NaN;for(;l<a&&o.get(l,n)&&s[4]<r;)s[4]++,l++;if(s[4]>=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-i)>=i?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,l):NaN},t.prototype.handlePossibleCenter=function(e,n,r,i){var o=e[0]+e[1]+e[2]+e[3]+e[4],a=t.centerFromEnd(e,r),s=this.crossCheckVertical(n,Math.floor(a),e[2],o);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),e[2],o),!isNaN(a)&&(!i||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),e[2],o)))){for(var l=o/7,u=!1,c=this.possibleCenters,f=0,d=c.length;f<d;f++){var h=c[f];if(h.aboutEquals(l,s,a)){c[f]=h.combineEstimate(s,a,l),u=!0;break}}if(!u){var p=new Rh(a,s,l);c.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},t.prototype.findRowSkip=function(){var e,n,r=this.possibleCenters.length;if(r<=1)return 0;var i=null;try{for(var o=ur(this.possibleCenters),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.getCount()>=t.CENTER_QUORUM)if(i==null)i=s;else return this.hasSkipped=!0,Math.floor((Math.abs(i.getX()-s.getX())-Math.abs(i.getY()-s.getY()))/2)}}catch(l){e={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return 0},t.prototype.haveMultiplyConfirmedCenters=function(){var e,n,r,i,o=0,a=0,s=this.possibleCenters.length;try{for(var l=ur(this.possibleCenters),u=l.next();!u.done;u=l.next()){var c=u.value;c.getCount()>=t.CENTER_QUORUM&&(o++,a+=c.getEstimatedModuleSize())}}catch(m){e={error:m}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}if(o<3)return!1;var f=a/s,d=0;try{for(var h=ur(this.possibleCenters),p=h.next();!p.done;p=h.next()){var c=p.value;d+=Math.abs(c.getEstimatedModuleSize()-f)}}catch(m){r={error:m}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return d<=.05*a},t.prototype.selectBestPatterns=function(){var e,n,r,i,o=this.possibleCenters.length;if(o<3)throw new k;var a=this.possibleCenters,s;if(o>3){var l=0,u=0;try{for(var c=ur(this.possibleCenters),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.getEstimatedModuleSize();l+=h,u+=h*h}}catch(I){e={error:I}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}s=l/o;var p=Math.sqrt(u/o-s*s);a.sort(function(I,O){var x=Math.abs(O.getEstimatedModuleSize()-s),R=Math.abs(I.getEstimatedModuleSize()-s);return x<R?-1:x>R?1:0}
6);for(var m=Math.max(.2*s,p),y=0;y<a.length&&a.length>3;y++){var w=a[y];Math.abs(w.getEstimatedModuleSize()-s)>m&&(a.splice(y,1),y--)}}if(a.length>3){var l=0;try{for(var _=ur(a),C=_.next();!C.done;C=_.next()){var E=C.value;l+=E.getEstimatedModuleSize()}}catch(O){r={error:O}}finally{try{C&&!C.done&&(i=_.return)&&i.call(_)}finally{if(r)throw r.error}}s=l/a.length,a.sort(function(O,x){if(x.getCount()===O.getCount()){var R=Math.abs(x.getEstimatedModuleSize()-s),N=Math.abs(O.getEstimatedModuleSize()-s);return R<N?1:R>N?-1:0}else return x.getCount()-O.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},t.CENTER_QUORUM=2,t.MIN_SKIP=3,t.MAX_MODULES=57,t})(),Ph=(function(){function t(e){this.image=e}return t.prototype.getImage=function(){return this.image},t.prototype.getResultPointCallback=function(){return this.resultPointCallback},t.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(Me.NEED_RESULT_POINT_CALLBACK);var n=new kh(this.image,this.resultPointCallback),r=n.find(e);return this.processFinderPatternInfo(r)},t.prototype.processFinderPatternInfo=function(e){var n=e.getTopLeft(),r=e.getTopRight(),i=e.getBottomLeft(),o=this.calculateModuleSize(n,r,i);if(o<1)throw new k("No pattern found in proccess finder.");var a=t.computeDimension(n,r,i,o),s=En.getProvisionalVersionForDimension(a),l=s.getDimensionForVersion()-7,u=null;if(s.getAlignmentPatternCenters().length>0)for(var c=r.getX()-n.getX()+i.getX(),f=r.getY()-n.getY()+i.getY(),d=1-3/l,h=Math.floor(n.getX()+d*(c-n.getX())),p=Math.floor(n.getY()+d*(f-n.getY())),m=4;m<=16;m<<=1)try{u=this.findAlignmentInRegion(o,h,p,m);break}catch(C){if(!(C instanceof k))throw C}var y=t.createTransform(n,r,i,u,a),w=t.sampleGrid(this.image,y,a),_;return u===null?_=[i,n,r]:_=[i,n,r,u],new zo(w,_)},t.createTransform=function(e,n,r,i,o){var a=o-3.5,s,l,u,c;return i!==null?(s=i.getX(),l=i.getY(),u=a-3,c=u):(s=n.getX()-e.getX()+r.getX(),l=n.getY()-e.getY()+r.getY(),u=a,c=a),Ll.quadrilateralToQuadrilateral(3.5,3.5,a,3.5,u,c,3.5,a,e.getX(),e.getY(),n.getX(),n.getY(),s,l,r.getX(),r.getY())},t.sampleGrid=function(e,n,r){var i=Go.getInstance();return i.sampleGridWithTransform(e,r,r,n)},t.computeDimension=function(e,n,r,i){var o=re.round(z.distance(e,n)/i),a=re.round(z.distance(e,r)/i),s=Math.floor((o+a)/2)+7;switch(s&3){case 0:s++;break;case 2:s--;break;case 3:throw new k("Dimensions could be not found.")}return s},t.prototype.calculateModuleSize=function(e,n,r){return(this.calculateModuleSizeOneWay(e,n)+this.calculateModuleSizeOneWay(e,r))/2},t.prototype.calculateModuleSizeOneWay=function(e,n){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(n.getX()),Math.floor(n.getY())),i=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()),Math.floor(n.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(r)?i/7:isNaN(i)?r/7:(r+i)/14},t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,n,r,i){var o=this.sizeOfBlackWhiteBlackRun(e,n,r,i),a=1,s=e-(r-e);s<0?(a=e/(e-s),s=0):s>=this.image.getWidth()&&(a=(this.image.getWidth()-1-e)/(s-e),s=this.image.getWidth()-1);var l=Math.floor(n-(i-n)*a);return a=1,l<0?(a=n/(n-l),l=0):l>=this.image.getHeight()&&(a=(this.image.getHeight()-1-n)/(l-n),l=this.image.getHeight()-1),s=Math.floor(e+(s-e)*a),o+=this.sizeOfBlackWhiteBlackRun(e,n,s,l),o-1},t.prototype.sizeOfBlackWhiteBlackRun=function(e,n,r,i){var o=Math.abs(i-n)>Math.abs(r-e);if(o){var a=e;e=n,n=a,a=r,r=i,i=a}for(var s=Math.abs(r-e),l=Math.abs(i-n),u=-s/2,c=e<r?1:-1,f=n<i?1:-1,d=0,h=r+c,p=e,m=n;p!==h;p+=c){var y=o?m:p,w=o?p:m;if(d===1===this.image.get(y,w)){if(d===2)return re.distance(p,m,e,n);d++}if(u+=l,u>0){if(m===i)break;m+=f,u-=s}}return d===2?re.distance(r+c,i,e,n):NaN},t.prototype.findAlignmentInRegion=function(e,n,r,i){var o=Math.floor(i*e),a=Math.max(0,n-o),s=Math.min(this.image.getWidth()-1,n+o);if(s-a<e*3)throw new k("Alignment top exceeds estimated module size.");var l=Math.max(0,r-o),u=Math.min(this.image.getHeight()-1,r+o);if(u-l<e*3)throw new k("Alignment bottom exceeds estimated module size.");var c=new Oh(this.image,a,l,s-a,u-l,e,this.resultPointCallback);return c.find()},t})(),mo=(function(){function t(){this.decoder=new Eh}return t.prototype.getDecoder=function(){return this.decoder},t.prototype.decode=function(e,n){var r,i;if(n!=null&&n.get(Me.PURE_BARCODE)!==void 0){var o=t.extractPureBits(e.getBlackMatrix());r=this.decoder.decodeBitMatrix(o,n),i=t.NO_POINTS}else{var a=new Ph(e.getBlackMatrix()).detect(n);r=this.decoder.decodeBitMatrix(a.getBits(),n),i=a.getPoints()}r.getOther()instanceof zl&&r.getOther().applyMirroredCorrection(i);var s=new ht(r.getText(),r.getRawBytes(),void 0,i,X.QR_CODE,void 0),l=r.getByteSegments();l!==null&&s.putMetadata(je.BYTE_SEGMENTS,l);var u=r.getECLevel();return u!==null&&s.putMetadata(je.ERROR_CORRECTION_LEVEL,u),r.hasStru
6cturedAppend()&&(s.putMetadata(je.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),s.putMetadata(je.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),s},t.prototype.reset=function(){},t.extractPureBits=function(e){var n=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(n===null||r===null)throw new k;var i=this.moduleSize(n,e),o=n[1],a=r[1],s=n[0],l=r[0];if(s>=l||o>=a)throw new k;if(a-o!==l-s&&(l=s+(a-o),l>=e.getWidth()))throw new k;var u=Math.round((l-s+1)/i),c=Math.round((a-o+1)/i);if(u<=0||c<=0)throw new k;if(c!==u)throw new k;var f=Math.floor(i/2);o+=f,s+=f;var d=s+Math.floor((u-1)*i)-l;if(d>0){if(d>f)throw new k;s-=d}var h=o+Math.floor((c-1)*i)-a;if(h>0){if(h>f)throw new k;o-=h}for(var p=new Vt(u,c),m=0;m<c;m++)for(var y=o+Math.floor(m*i),w=0;w<u;w++)e.get(s+Math.floor(w*i),y)&&p.set(w,m);return p},t.moduleSize=function(e,n){for(var r=n.getHeight(),i=n.getWidth(),o=e[0],a=e[1],s=!0,l=0;o<i&&a<r;){if(s!==n.get(o,a)){if(++l===5)break;s=!s}o++,a++}if(o===i||a===r)throw new k;return(o-e[0])/7},t.NO_POINTS=new Array,t})(),Nh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},te=(function(){function t(){}return t.prototype.PDF417Common=function(){},t.getBitCountSum=function(e){return re.sum(e)},t.toIntArray=function(e){var n,r;if(e==null||!e.length)return t.EMPTY_INT_ARRAY;var i=new Int32Array(e.length),o=0;try{for(var a=Nh(e),s=a.next();!s.done;s=a.next()){var l=s.value;i[o++]=l}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},t.getCodeword=function(e){var n=ft.binarySearch(t.SYMBOL_TABLE,e&262143);return n<0?-1:(t.CODEWORD_TABLE[n]-1)%t.NUMBER_OF_CODEWORDS},t.NUMBER_OF_CODEWORDS=929,t.MAX_CODEWORDS_IN_BARCODE=t.NUMBER_OF_CODEWORDS-1,t.MIN_ROWS_IN_BARCODE=3,t.MAX_ROWS_IN_BARCODE=90,t.MODULES_IN_CODEWORD=17,t.MODULES_IN_STOP_PATTERN=18,t.BARS_IN_MODULE=8,t.EMPTY_INT_ARRAY=new Int32Array([]),t
vendor: 18,272 bytes, line 6
6.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),
6t
vendor: 12,860 bytes, line 6
6.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700])
6,t})(),Bh=(function(){function t(e,n){this.bits=e,this.points=n}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t})(),Fh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Lh=(function(){function t(){}return t.detectMultiple=function(e,n,r){var i=e.getBlackMatrix(),o=t.detect(r,i);return o.length||(i=i.clone(),i.rotate180(),o=t.detect(r,i)),new Bh(i,o)},t.detect=function(e,n){for(var r,i,o=new Array,a=0,s=0,l=!1;a<n.getHeight();){var u=t.findVertices(n,a,s);if(u[0]==null&&u[3]==null){if(!l)break;l=!1,s=0;try{for(var c=(r=void 0,Fh(o)),f=c.next();!f.done;f=c.next()){var d=f.value;d[1]!=null&&(a=Math.trunc(Math.max(a,d[1].getY()))),d[3]!=null&&(a=Math.max(a,Math.trunc(d[3].getY())))}}catch(h){r={error:h}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}a+=t.ROW_STEP;continue}if(l=!0,o.push(u),!e)break;u[2]!=null?(s=Math.trunc(u[2].getX()),a=Math.trunc(u[2].getY())):(s=Math.trunc(u[4].getX()),a=Math.trunc(u[4].getY()))}return o},t.findVertices=function(e,n,r){var i=e.getHeight(),o=e.getWidth(),a=new Array(8);return t.copyToResult(a,t.findRowsWithPattern(e,i,o,n,r,t.START_PATTERN),t.INDEXES_START_PATTERN),a[4]!=null&&(r=Math.trunc(a[4].getX()),n=Math.trunc(a[4].getY())),t.copyToResult(a,t.findRowsWithPattern(e,i,o,n,r,t.STOP_PATTERN),t.INDEXES_STOP_PATTERN),a},t.copyToResult=function(e,n,r){for(var i=0;i<r.length;i++)e[r[i]]=n[i]},t.findRowsWithPattern=function(e,n,r,i,o,a){for(var s=new Array(4),l=!1,u=new Int32Array(a.length);i<n;i+=t.ROW_STEP){var c=t.findGuardPattern(e,o,i,r,!1,a,u);if(c!=null){for(;i>0;){var f=t.findGuardPattern(e,o,--i,r,!1,a,u);if(f!=null)c=f;else{i++;break}}s[0]=new z(c[0],i),s[1]=new z(c[1],i),l=!0;break}}var d=i+1;if(l){for(var h=0,f=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);d<n;d++){var c=t.findGuardPattern(e,f[0],d,r,!1,a,u);if(c!=null&&Math.abs(f[0]-c[0])<t.MAX_PATTERN_DRIFT&&Math.abs(f[1]-c[1])<t.MAX_PATTERN_DRIFT)f=c,h=0;else{if(h>t.SKIPPED_ROW_COUNT_MAX)break;h++}}d-=h+1,s[2]=new z(f[0],d),s[3]=new z(f[1],d)}return d-i<t.BARCODE_MIN_HEIGHT&&ft.fill(s,null),s},t.findGuardPattern=function(e,n,r,i,o,a,s){ft.fillWithin(s,0,s.length,0);for(var l=n,u=0;e.get(l,r)&&l>0&&u++<t.MAX_PIXEL_DRIFT;)l--;for(var c=l,f=0,d=a.length,h=o;c<i;c++){var p=e.get(c,r);if(p!==h)s[f]++;else{if(f===d-1){if(t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return new Int32Array([l,c]);l+=s[0]+s[1],Ce.arraycopy(s,2,s,0,f-1),s[f-1]=0,s[f]=0,f--}else f++;s[f]=1,h=!h}}return f===d-1&&t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE?new Int32Array([l,c-1]):null},t.patternMatchVariance=function(e,n,r){for(var i=e.length,o=0,a=0,s=0;s<i;s++)o+=e[s],a+=n[s];if(o<a)return 1/0;var l=o/a;r*=l;for(var u=0,c=0;c<i;c++){var f=e[c],d=n[c]*l,h=f>d?f-d:d-f;if(h>r)return 1/0;u+=h}return u/o},t.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),t.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),t.MAX_AVG_VARIANCE=.42,t.MAX_INDIVIDUAL_VARIANCE=.8,t.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),t.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),t.MAX_PIXEL_DRIFT=3,t.MAX_PATTERN_DRIFT=5,t.SKIPPED_ROW_COUNT_MAX=25,t.ROW_STEP=5,t.BARCODE_MIN_HEIGHT=10,t})(),Vh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Cn=(function(){function t(e,n){if(n.length===0)throw new G;this.field=e;var r=n.length;if(r>1&&n[0]===0){for(var i=1;i<r&&n[i]===0;)i++;i===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-i),Ce.arraycopy(n,i,this.coefficients,0,this.coefficients.length))}else this.coefficients=n}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return this.coefficients[0]===0},t.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},t.prototype.evaluateAt=function(e){var n,r;if(e===0)return this.getCoefficient(0);if(e===1){var i=0;try{for(var o=Vh(this.coefficients),a=o.next();!a.done;a=o.next()){var s=a.value;i=this.field.add(i,s)}}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}for(var l=this.coefficients[0],u=this.coefficients.length,c=1;c<u;c++)l=this.field.add(this.field.multiply(e,l),this.coefficients[c]);return l},t.prototype.add=function(e){if(!this.field.equals(e.field))throw new G("ModulusPolys do n
6ot have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;var n=this.coefficients,r=e.coefficients;if(n.length>r.length){var i=n;n=r,r=i}var o=new Int32Array(r.length),a=r.length-n.length;Ce.arraycopy(r,0,o,0,a);for(var s=a;s<r.length;s++)o[s]=this.field.add(n[s-a],r[s]);return new t(this.field,o)},t.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new G("ModulusPolys do not have same ModulusGF field");return e.isZero()?this:this.add(e.negative())},t.prototype.multiply=function(e){return e instanceof t?this.multiplyOther(e):this.multiplyScalar(e)},t.prototype.multiplyOther=function(e){if(!this.field.equals(e.field))throw new G("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new t(this.field,new Int32Array([0]));for(var n=this.coefficients,r=n.length,i=e.coefficients,o=i.length,a=new Int32Array(r+o-1),s=0;s<r;s++)for(var l=n[s],u=0;u<o;u++)a[s+u]=this.field.add(a[s+u],this.field.multiply(l,i[u]));return new t(this.field,a)},t.prototype.negative=function(){for(var e=this.coefficients.length,n=new Int32Array(e),r=0;r<e;r++)n[r]=this.field.subtract(0,this.coefficients[r]);return new t(this.field,n)},t.prototype.multiplyScalar=function(e){if(e===0)return new t(this.field,new Int32Array([0]));if(e===1)return this;for(var n=this.coefficients.length,r=new Int32Array(n),i=0;i<n;i++)r[i]=this.field.multiply(this.coefficients[i],e);return new t(this.field,r)},t.prototype.multiplyByMonomial=function(e,n){if(e<0)throw new G;if(n===0)return new t(this.field,new Int32Array([0]));for(var r=this.coefficients.length,i=new Int32Array(r+e),o=0;o<r;o++)i[o]=this.field.multiply(this.coefficients[o],n);return new t(this.field,i)},t.prototype.toString=function(){for(var e=new xe,n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);r!==0&&(r<0?(e.append(" - "),r=-r):e.length()>0&&e.append(" + "),(n===0||r!==1)&&e.append(r),n!==0&&(n===1?e.append("x"):(e.append("x^"),e.append(n))))}return e.toString()},t})(),Uh=(function(){function t(){}return t.prototype.add=function(e,n){return(e+n)%this.modulus},t.prototype.subtract=function(e,n){return(this.modulus+e-n)%this.modulus},t.prototype.exp=function(e){return this.expTable[e]},t.prototype.log=function(e){if(e===0)throw new G;return this.logTable[e]},t.prototype.inverse=function(e){if(e===0)throw new Fl;return this.expTable[this.modulus-this.logTable[e]-1]},t.prototype.multiply=function(e,n){return e===0||n===0?0:this.expTable[(this.logTable[e]+this.logTable[n])%(this.modulus-1)]},t.prototype.getSize=function(){return this.modulus},t.prototype.equals=function(e){return e===this},t})(),$h=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Hh=(function(t){$h(e,t);function e(n,r){var i=t.call(this)||this;i.modulus=n,i.expTable=new Int32Array(n),i.logTable=new Int32Array(n);for(var o=1,a=0;a<n;a++)i.expTable[a]=o,o=o*r%n;for(var a=0;a<n-1;a++)i.logTable[i.expTable[a]]=a;return i.zero=new Cn(i,new Int32Array([0])),i.one=new Cn(i,new Int32Array([1])),i}return e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(n,r){if(n<0)throw new G;if(r===0)return this.zero;var i=new Int32Array(n+1);return i[0]=r,new Cn(this,i)},e.PDF417_GF=new e(te.NUMBER_OF_CODEWORDS,3),e})(Uh),Wh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zh=(function(){function t(){this.field=Hh.PDF417_GF}return t.prototype.decode=function(e,n,r){for(var i,o,a=new Cn(this.field,e),s=new Int32Array(n),l=!1,u=n;u>0;u--){var c=a.evaluateAt(this.field.exp(u));s[n-u]=c,c!==0&&(l=!0)}if(!l)return 0;var f=this.field.getOne();if(r!=null)try{for(var d=Wh(r),h=d.next();!h.done;h=d.next()){var p=h.value,m=this.field.exp(e.length-1-p),y=new Cn(this.field,new Int32Array([this.field.subtract(0,m),1]));f=f.multiply(y)}}catch(R){i={error:R}}
6finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}for(var w=new Cn(this.field,s),_=this.runEuclideanAlgorithm(this.field.buildMonomial(n,1),w,n),C=_[0],E=_[1],I=this.findErrorLocations(C),O=this.findErrorMagnitudes(E,C,I),u=0;u<I.length;u++){var x=e.length-1-this.field.log(I[u]);if(x<0)throw Xe.getChecksumInstance();e[x]=this.field.subtract(e[x],O[u])}return I.length},t.prototype.runEuclideanAlgorithm=function(e,n,r){if(e.getDegree()<n.getDegree()){var i=e;e=n,n=i}for(var o=e,a=n,s=this.field.getZero(),l=this.field.getOne();a.getDegree()>=Math.round(r/2);){var u=o,c=s;if(o=a,s=l,o.isZero())throw Xe.getChecksumInstance();a=u;for(var f=this.field.getZero(),d=o.getCoefficient(o.getDegree()),h=this.field.inverse(d);a.getDegree()>=o.getDegree()&&!a.isZero();){var p=a.getDegree()-o.getDegree(),m=this.field.multiply(a.getCoefficient(a.getDegree()),h);f=f.add(this.field.buildMonomial(p,m)),a=a.subtract(o.multiplyByMonomial(p,m))}l=f.multiply(s).subtract(c).negative()}var y=l.getCoefficient(0);if(y===0)throw Xe.getChecksumInstance();var w=this.field.inverse(y),_=l.multiply(w),C=a.multiply(w);return[_,C]},t.prototype.findErrorLocations=function(e){for(var n=e.getDegree(),r=new Int32Array(n),i=0,o=1;o<this.field.getSize()&&i<n;o++)e.evaluateAt(o)===0&&(r[i]=this.field.inverse(o),i++);if(i!==n)throw Xe.getChecksumInstance();return r},t.prototype.findErrorMagnitudes=function(e,n,r){for(var i=n.getDegree(),o=new Int32Array(i),a=1;a<=i;a++)o[i-a]=this.field.multiply(a,n.getCoefficient(a));for(var s=new Cn(this.field,o),l=r.length,u=new Int32Array(l),a=0;a<l;a++){var c=this.field.inverse(r[a]),f=this.field.subtract(0,e.evaluateAt(c)),d=this.field.inverse(s.evaluateAt(c));u[a]=this.field.multiply(f,d)}return u},t})(),yo=(function(){function t(e,n,r,i,o){e instanceof t?this.constructor_2(e):this.constructor_1(e,n,r,i,o)}return t.prototype.constructor_1=function(e,n,r,i,o){var a=n==null||r==null,s=i==null||o==null;if(a&&s)throw new k;a?(n=new z(0,i.getY()),r=new z(0,o.getY())):s&&(i=new z(e.getWidth()-1,n.getY()),o=new z(e.getWidth()-1,r.getY())),this.image=e,this.topLeft=n,this.bottomLeft=r,this.topRight=i,this.bottomRight=o,this.minX=Math.trunc(Math.min(n.getX(),r.getX())),this.maxX=Math.trunc(Math.max(i.getX(),o.getX())),this.minY=Math.trunc(Math.min(n.getY(),i.getY())),this.maxY=Math.trunc(Math.max(r.getY(),o.getY()))},t.prototype.constructor_2=function(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()},t.merge=function(e,n){return e==null?n:n==null?e:new t(e.image,e.topLeft,e.bottomLeft,n.topRight,n.bottomRight)},t.prototype.addMissingRows=function(e,n,r){var i=this.topLeft,o=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(e>0){var l=r?this.topLeft:this.topRight,u=Math.trunc(l.getY()-e);u<0&&(u=0);var c=new z(l.getX(),u);r?i=c:a=c}if(n>0){var f=r?this.bottomLeft:this.bottomRight,d=Math.trunc(f.getY()+n);d>=this.image.getHeight()&&(d=this.image.getHeight()-1);var h=new z(f.getX(),d);r?o=h:s=h}return new t(this.image,i,o,a,s)},t.prototype.getMinX=function(){return this.minX},t.prototype.getMaxX=function(){return this.maxX},t.prototype.getMinY=function(){return this.minY},t.prototype.getMaxY=function(){return this.maxY},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getBottomRight=function(){return this.bottomRight},t})(),Gh=(function(){function t(e,n,r,i){this.columnCount=e,this.errorCorrectionLevel=i,this.rowCountUpperPart=n,this.rowCountLowerPart=r,this.rowCount=n+r}return t.prototype.getColumnCount=function(){return this.columnCount},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getRowCount=function(){return this.rowCount},t.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},t.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},t})(),Xo=(function(){function t(){this.buffer=""}return t.form=function(e,n){var r=-1;function i(a,s,l,u,c,f){if(a==="%%")return"%";if(n[++r]!==void 0){a=u?parseInt(u.substr(1)):void 0;var d=c?parseInt(c.substr(1)):void 0,h;switch(f){case"s":h=n[r];break;case"c":h=n[r][0];break;case"f":h=parseFloat(n[r]).toFixed(a);break;case"p":h=parseFloat(n[r]).toPrecision(a);break;case"e":h=parseFloat(n[r]).toExponential(a);break;case"x":h=parseInt(n[r]).toString(d||16);break;case"d":h=parseFloat(parseInt(n[r],d||10).toPrecision(a)).toFixed(0);break}h=typeof h=="object"?JSON.stringify(h):(+h).toString(d);for(var p=parseInt(l),m=l&&l[0]+""=="0"?"0":" ";h.length<p;)h=s!==void 0?h+m:m+h;return h}}var o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(o,i)},t.prototype.format=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.buffer+=t.form(e,n)},t.prototype.toString=function(){return this.buffer},t})(),Kh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Gl=(function(){function t(e){this.boundingBox=new yo(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}return t.prototype.getCodewordNearby=function(e){var n=this.getCodeword(e);if(n!=null)return n;for(var r=1;r<t.MAX_NEARBY_DISTANCE;r++){var i=this.imageRowToCodewordIndex(e)-r;if(i>=0&&(n=this.codewords[i],n!=null)||(i=this.imageRowToCodewordIndex(e)+r,i<this.codewords.length&&(n=this.codewords[i],n!=null)))return n}return null},t.prototype.imageRowToCodewordIndex=function(e){return e-this.boundingBox.getMinY()}
6,t.prototype.setCodeword=function(e,n){this.codewords[this.imageRowToCodewordIndex(e)]=n},t.prototype.getCodeword=function(e){return this.codewords[this.imageRowToCodewordIndex(e)]},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.getCodewords=function(){return this.codewords},t.prototype.toString=function(){var e,n,r=new Xo,i=0;try{for(var o=Kh(this.codewords),a=o.next();!a.done;a=o.next()){var s=a.value;if(s==null){r.format("%3d: | %n",i++);continue}r.format("%3d: %3d|%3d%n",i++,s.getRowNumber(),s.getValue())}}catch(l){e={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r.toString()},t.MAX_NEARBY_DISTANCE=5,t})(),Xh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},jh=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},wr=(function(){function t(){this.values=new Map}return t.prototype.setValue=function(e){e=Math.trunc(e);var n=this.values.get(e);n==null&&(n=0),n++,this.values.set(e,n)},t.prototype.getValue=function(){var e,n,r=-1,i=new Array,o=function(f,d){var h={getKey:function(){return f},getValue:function(){return d}};h.getValue()>r?(r=h.getValue(),i=[],i.push(h.getKey())):h.getValue()===r&&i.push(h.getKey())};try{for(var a=Xh(this.values.entries()),s=a.next();!s.done;s=a.next()){var l=jh(s.value,2),u=l[0],c=l[1];o(u,c)}}catch(f){e={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return te.toIntArray(i)},t.prototype.getConfidence=function(e){return this.values.get(e)},t})(),Yh=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Gi=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Xa=(function(t){Yh(e,t);function e(n,r){var i=t.call(this,n)||this;return i._isLeft=r,i}return e.prototype.setRowNumbers=function(){var n,r;try{for(var i=Gi(this.getCodewords()),o=i.next();!o.done;o=i.next()){var a=o.value;a?.setRowNumberAsRowIndicatorColumn()}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(n){var r=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(r,n);for(var i=this.getBoundingBox(),o=this._isLeft?i.getTopLeft():i.getTopRight(),a=this._isLeft?i.getBottomLeft():i.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(o.getY())),l=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=-1,c=1,f=0,d=s;d<l;d++)if(r[d]!=null){var h=r[d],p=h.getRowNumber()-u;if(p===0)f++;else if(p===1)c=Math.max(c,f),f=1,u=h.getRowNumber();else if(p<0||h.getRowNumber()>=n.getRowCount()||p>d)r[d]=null;else{var m=void 0;c>2?m=(c-2)*p:m=p;for(var y=m>=d,w=1;w<=m&&!y;w++)y=r[d-w]!=null;y?r[d]=null:(u=h.getRowNumber(),f=1)}}},e.prototype.getRowHeights=function(){var n,r,i=this.getBarcodeMetadata();if(i==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(i);var o=new Int32Array(i.getRowCount());try{for(var a=Gi(this.getCodewords()),s=a.next();!s.done;s=a.next()){var l=s.value;if(l!=null){var u=l.getRowNumber();if(u>=o.length)continue;o[u]++}}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(n){for(var r=this.getBoundingBox(),i=this._isLeft?r.getTopLeft():r.getTopRight(),o=this._isLeft?r.getBottomLeft():r.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(i.getY())),s=this.imageRowToCodewordIndex(Math.trunc(o.getY())),l=this.getCodewords(),u=-1,c=a;c<s;c++)if(l[c]!=null){var f=l[c];f.setRowNumberAsRowIndicatorColumn();var d=f.getRowNumber()-u;d===0||(d===1?u=f.getRowNumber():f.getRowNumber()>=n.getRowCount()?l[c]=null:u=f.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var n,r,i=this.getCodewords(),o=new wr,a=new wr,s=new wr,l=new wr;try{for(var u=Gi(i),c=u.next();!c.done;c=u.next()){var f=c.value;if(f!=null){f.setRowNumberAsRowIndicatorColumn();var d=f.getValue()%30,h=f.getRowNumber();switch(this._isLeft||(h+=2),h%3){case 0:a.setValue(d*3+1);break;case 1:l.setValue(d/3),s.setValue(d%3);break;case 2:o.setValue(d+1);break}}}}catch(m){n={error:m}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(o.getValue().length===0||a.getValue().length===0||s.getValue().length===0||l.getValue().length===0||o.getValue()[0]<1||a.getValue()[0]+s.getValue()[0]<te.MIN_ROWS_IN_BARCODE||a.getValue()[0]+s.getValue()[0]>te.MAX_ROWS_IN_BARCODE)return null;var p=new Gh(o.getValue()[0],a.getValue()[0],s.getValue()[0],l.getValue()[0]);return this.removeIncorrectCodewords(i,p),p},e.prototype.removeIncorrectCodewords=function(n,r){for(var i=0;i<n.length;i++){var o=n[i];if(n[i]!=null){var a=o.getValue()%30,s=o.getRowNumber();if(s>r.getRowCount()){n[i]=null;continue}switch(this._isLeft||(s+=2),s%3){case 0:a*3+1!==r.getRowCountUpperPart()&&(n[i]=null);break;case 1:(Math.trunc(a/3)!==r.getErrorCorrectionLevel()||a%3!==r.getRowCountLowerPart())&&(n[i]=null);break;case 2:a+1!==r.getColumnCount()&&(n[i]=null);break}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+` 7`+t.prototype.toString.call(this)},e})(Gl),Zh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},qh=(function(){function t(e,n){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=n,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return t.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e=te.MAX_CODEWORDS_IN_BARCODE,n;do n=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e<n);return this.detectionResultColumns},t.prototype.adjustIndicatorColumnRowNumbers=function(e){e?.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},t.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(e===0)return 0;for(var n=1;n<this.barcodeColumnCount+1;n++)for(var r=this.detectionResultColumns[n].getCodewords(),i=0;i<r.length;i++)r[i]!=null&&(r[i].hasValidRowNumber()||this.adjustRowNumbers(n,i,r));return e},t.prototype.adjustRowNumbersByRow=function(){this.adjustRowNumbersFromBothRI();var e=this.adjustRowNumbersFromLRI();return e+this.adjustRowNumbersFromRRI()},t.prototype.adjustRowNumbersFromBothRI=function(){if(!(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)){for(var e=this.detectionResultColumns[0].getCodewords(),n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<e.length;r++)if(e[r]!=null&&n[r]!=null&&e[r].getRowNumber()===n[r].getRowNumber())for(var i=1;i<=this.barcodeColumnCount;i++){var o=this.detectionResultColumns[i].getCodewords()[r];o!=null&&(o.setRowNumber(e[r].getRowNumber()),o.hasValidRowNumber()||(this.detectionResultColumns[i].getCodewords()[r]=null))}}},t.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;for(var e=0,n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var i=n[r].getRowNumber(),o=0,a=this.barcodeColumnCount+1;a>0&&o<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[r];s!=null&&(o=t.adjustRowNumberIfValid(i,o,s),s.hasValidRowNumber()||e++)}return e},t.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null)return 0;for(var e=0,n=this.detectionResultColumns[0].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var i=n[r].getRowNumber(),o=0,a=1;a<this.barcodeColumnCount+1&&o<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[r];s!=null&&(o=t.adjustRowNumberIfValid(i,o,s),s.hasValidRowNumber()||e++)}return e},t.adjustRowNumberIfValid=function(e,n,r){return r==null||r.hasValidRowNumber()||(r.isValidRowNumber(e)?(r.setRowNumber(e),n=0):++n),n},t.prototype.adjustRowNumbers=function(e,n,r){var i,o;if(this.detectionResultColumns[e-1]!=null){var a=r[n],s=this.detectionResultColumns[e-1].getCodewords(),l=s;this.detectionResultColumns[e+1]!=null&&(l=this.detectionResultColumns[e+1].getCodewords());var u=new Array(14);u[2]=s[n],u[3]=l[n],n>0&&(u[0]=r[n-1],u[4]=s[n-1],u[5]=l[n-1]),n>1&&(u[8]=r[n-2],u[10]=s[n-2],u[11]=l[n-2]),n<r.length-1&&(u[1]=r[n+1],u[6]=s[n+1],u[7]=l[n+1]),n<r.length-2&&(u[9]=r[n+2],u[12]=s[n+2],u[13]=l[n+2]);try{for(var c=Zh(u),f=c.next();!f.done;f=c.next()){var d=f.value;if(t.adjustRowNumber(a,d))return}}catch(h){i={error:h}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}}},t.adjustRowNumber=function(e,n){return n==null?!1:n.hasValidRowNumber()&&n.getBucket()===e.getBucket()?(e.setRowNumber(n.getRowNumber()),!0):!1},t.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},t.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},t.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},t.prototype.setBoundingBox=function(e){this.boundingBox=e},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.setDetectionResultColumn=function(e,n){this.detectionResultColumns[e]=n},t.prototype.getDetectionResultColumn=function(e){return this.detectionResultColumns[e]},t.prototype.toString=function(){var e=this.detectionResultColumns[0];e==null&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var n=new Xo,r=0;r<e.getCodewords().length;r++){n.format("CW %3d:",r);for(var i=0;i<this.barcodeColumnCount+2;i++){if(this.detectionResultColumns[i]==null){n.format(" | ");continue}var o=this.detectionResultColumns[i].getCodewords()[r];if(o==null){n.format(" | ");continue}n.format(" %3d|%3d",o.getRowNumber(),o.getValue())}n.format("%n")}return n.toString()},t})(),Qh=(function(){function t(e,n,r,i){this.rowNumber=t.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(n),this.bucket=Math.trunc(r),this.value=Math.trunc(i)}return t.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},t.prototype.isValidRowNumber=function(e){return e!==t.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3},t.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))},t.prototype.getWidth=function(){return this.endX-this.startX},t.prototype.getStartX=function(){return this.startX},t.prototype.getEndX=function(){return this.endX},t.prototype.getBucket=function(){return this.bucket},t.prototype.getValue=function(){return this.value},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.setRowNumber=function(e){this.rowNumber=e},t.prototype.toString=function(){return this.rowNumber+"|"+this.value},t.BARCODE_ROW_UNKNOWN=-1,t})(),Jh=(function(){function t(){}return t.initialize=function(){for(var e=0;e<te.SYMBOL_TABLE.length;e++)for(var n=te.SYMBOL_TABLE[e],r=n&1,i=0;i<te.BARS_IN_MODULE;i++){for(var o=0;(n&1)===r;)o+=1,n>>=1;r=n&1,t.RATIOS_TABLE[e]||(t.RATIOS_TABLE[e]=new Array(te.BARS_IN_MODULE)),t.RATIOS_TABLE[e][te.BARS_IN_MODULE-i-1]=Math.fround(o/te.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},t.getDecodedValue=function(e){var n=t.getDecodedCodewordValue(t.sampleBitCounts(e));return n!==-1?n:t.getClosestDecodedValue(e)},t.sampleBitCounts=function(e){for(var n=re.sum(e),r=new Int32Array(te.BARS_IN_MODULE),i=0,o=0,a=0;a<te.MODULES_IN_CODEWORD;a++){var s=n/(2*te.MODULES_IN_CODEWORD)+a*n/te.MODULES_IN_CODEWORD;o+e[i]<=s&&(o+=e[i],i++),r[i]++}return r},t.getDecodedCodewordValue=function(e){var n=t.getBitValue(e);return te.getCodeword(n)===-1?-1:n},t.getBitValue=function(e){for(var n=0,r=0;r<e.length;r++)for(var i=0;i<e[r];i++)n=n<<1|(r%2===0?1:0);return Math.trunc(n)},t.getClosestDecodedValue=function(e){var n=re.sum(e),r=new Array(te.BARS_IN_MODULE);if(n>1)for(var i=0;i<r.length;
7i++)r[i]=Math.fround(e[i]/n);var o=fo.MAX_VALUE,a=-1;this.bSymbolTableReady||t.initialize();for(var s=0;s<t.RATIOS_TABLE.length;s++){for(var l=0,u=t.RATIOS_TABLE[s],c=0;c<te.BARS_IN_MODULE;c++){var f=Math.fround(u[c]-r[c]);if(l+=Math.fround(f*f),l>=o)break}l<o&&(o=l,a=te.SYMBOL_TABLE[s])}return a},t.bSymbolTableReady=!1,t.RATIOS_TABLE=new Array(te.SYMBOL_TABLE.length).map(function(e){return new Array(te.BARS_IN_MODULE)}),t})(),e1=(function(){function t(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return t.prototype.getSegmentIndex=function(){return this.segmentIndex},t.prototype.setSegmentIndex=function(e){this.segmentIndex=e},t.prototype.getFileId=function(){return this.fileId},t.prototype.setFileId=function(e){this.fileId=e},t.prototype.getOptionalData=function(){return this.optionalData},t.prototype.setOptionalData=function(e){this.optionalData=e},t.prototype.isLastSegment=function(){return this.lastSegment},t.prototype.setLastSegment=function(e){this.lastSegment=e},t.prototype.getSegmentCount=function(){return this.segmentCount},t.prototype.setSegmentCount=function(e){this.segmentCount=e},t.prototype.getSender=function(){return this.sender||null},t.prototype.setSender=function(e){this.sender=e},t.prototype.getAddressee=function(){return this.addressee||null},t.prototype.setAddressee=function(e){this.addressee=e},t.prototype.getFileName=function(){return this.fileName},t.prototype.setFileName=function(e){this.fileName=e},t.prototype.getFileSize=function(){return this.fileSize},t.prototype.setFileSize=function(e){this.fileSize=e},t.prototype.getChecksum=function(){return this.checksum},t.prototype.setChecksum=function(e){this.checksum=e},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.setTimestamp=function(e){this.timestamp=e},t})(),ja=(function(){function t(){}return t.parseLong=function(e,n){return n===void 0&&(n=void 0),parseInt(e,n)},t})(),t1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),n1=(function(t){t1(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="NullPointerException",e})(ot),r1=(function(){function t(){}return t.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},t.prototype.writeBytesOffset=function(e,n,r){if(e==null)throw new n1;if(n<0||n>e.length||r<0||n+r>e.length||n+r<0)throw new Ho;if(r===0)return;for(var i=0;i<r;i++)this.write(e[n+i])},t.prototype.flush=function(){},t.prototype.close=function(){},t})(),i1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),o1=(function(t){i1(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(ot),a1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),s1=(function(t){a1(e,t);function e(n){n===void 0&&(n=32);var r=t.call(this)||this;if(r.count=0,n<0)throw new G("Negative initial size: "+n);return r.buf=new Uint8Array(n),r}return e.prototype.ensureCapacity=function(n){n-this.buf.length>0&&this.grow(n)},e.prototype.grow=function(n){var r=this.buf.length,i=r<<1;if(i-n<0&&(i=n),i<0){if(n<0)throw new o1;i=J.MAX_VALUE}this.buf=ft.copyOfUint8Array(this.buf,i)},e.prototype.write=function(n){this.ensureCapacity(this.count+1),this.buf[this.count]=n,this.count+=1},e.prototype.writeBytesOffset=function(n,r,i){if(r<0||r>n.length||i<0||r+i-n.length>0)throw new Ho;this.ensureCapacity(this.count+i),Ce.arraycopy(n,r,this.buf,this.count,i),this.count+=i},e.prototype.writeTo=function(n){n.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return ft.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(n){return n?typeof n=="string"?this.toString_string(n):this.toString_number(n):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(n){return new String(this.buf).toString()},e.prototype.toString_number=function(n){return new String(this.buf).toString()},e.prototype.close=function(){},e})(r1),ye;(function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(ye||(ye={}));function Kl(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}var Kr;function Jt(t){if(typeof Kr>"u"&&(Kr=Kl()),Kr===null)throw new Error("BigInt is not supported!");return Kr(t)}function l1(){var t=[];t[0]=Jt(1);var e=Jt(900);t[1]=e;for(var n=2;n<16;n++)t[n]=t[n-1]*e;return t}var u1=(function(){function t(){}return t.decode=function(e,n){var r=new xe(""),i=Le.ISO8859_1;r.enableDecoding(i);for(var o=1,a=e[o++],s=new e1;o<e[0];){switch(a){case t.TEXT_COMPACTION_MODE_LATCH:o=t.textCompaction(e,o,r);break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:o=t.byteCompaction(a,e,i,o,r);break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[o++]);break;case t.NUMERIC_COMPACTION_MODE_LATCH:o=t.numericCompaction(e,o,r);break;case t.ECI_CHARSET:Le.getCharacterSetECIByValue(e[o++]);break;case t.ECI_GENERAL_PURPOSE:o+=2;break;case t.ECI_USER_DEFINED:o++;break;case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:o=t.decodeMacroBlock(e,o,s);break;case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:throw new L;default:o--,o=t.textCompaction(e,o,r);break}if(o<e.length)a=e[o++];else throw L.getFormatInstance()}if(r.length()===0)throw L.getFormatInstance();var l=new Oi(null,r.toString(),null,n);return l.setOther(s),l},t.decodeMacroBlock=function(e,n,r){if(n+t.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw L.getFormatInstance();for(var i=new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS),o=0;o<t.NUMBER_OF_SEQUENCE_CODEWORDS;o++,n++)i[o]=e[n];r.setSegmentIndex(J.parseInt(t.decodeBase900toBase10(i,t.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new xe;n=t.textCompaction(e,n,a),r.setFileId(a.toString());var s=-1;for(e[n]===t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=n+1);n<e[0];)switch(e[n]){case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(n++,e[n]){case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var l=new xe;n=t.textCompaction(e,n+1,l),r.setFileName(l.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var u=new xe;n=t.textCompaction(e,n+1,u),r.setSender(u.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var c=new xe;
7n=t.textCompaction(e,n+1,c),r.setAddressee(c.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var f=new xe;n=t.numericCompaction(e,n+1,f),r.setSegmentCount(J.parseInt(f.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var d=new xe;n=t.numericCompaction(e,n+1,d),r.setTimestamp(ja.parseLong(d.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var h=new xe;n=t.numericCompaction(e,n+1,h),r.setChecksum(J.parseInt(h.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var p=new xe;n=t.numericCompaction(e,n+1,p),r.setFileSize(ja.parseLong(p.toString()));break;default:throw L.getFormatInstance()}break;case t.MACRO_PDF417_TERMINATOR:n++,r.setLastSegment(!0);break;default:throw L.getFormatInstance()}if(s!==-1){var m=n-s;r.isLastSegment()&&m--,r.setOptionalData(ft.copyOfRange(e,s,s+m))}return n},t.textCompaction=function(e,n,r){for(var i=new Int32Array((e[0]-n)*2),o=new Int32Array((e[0]-n)*2),a=0,s=!1;n<e[0]&&!s;){var l=e[n++];if(l<t.TEXT_COMPACTION_MODE_LATCH)i[a]=l/30,i[a+1]=l%30,a+=2;else switch(l){case t.TEXT_COMPACTION_MODE_LATCH:i[a++]=t.TEXT_COMPACTION_MODE_LATCH;break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:n--,s=!0;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[a]=t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,l=e[n++],o[a]=l,a++;break}}return t.decodeTextCompaction(i,o,a,r),n},t.decodeTextCompaction=function(e,n,r,i){for(var o=ye.ALPHA,a=ye.ALPHA,s=0;s<r;){var l=e[s],u="";switch(o){case ye.ALPHA:if(l<26)u=String.fromCharCode(65+l);else switch(l){case 26:u=" ";break;case t.LL:o=ye.LOWER;break;case t.ML:o=ye.MIXED;break;case t.PS:a=o,o=ye.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=ye.ALPHA;break}break;case ye.LOWER:if(l<26)u=String.fromCharCode(97+l);else switch(l){case 26:u=" ";break;case t.AS:a=o,o=ye.ALPHA_SHIFT;break;case t.ML:o=ye.MIXED;break;case t.PS:a=o,o=ye.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=ye.ALPHA;break}break;case ye.MIXED:if(l<t.PL)u=t.MIXED_CHARS[l];else switch(l){case t.PL:o=ye.PUNCT;break;case 26:u=" ";break;case t.LL:o=ye.LOWER;break;case t.AL:o=ye.ALPHA;break;case t.PS:a=o,o=ye.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=ye.ALPHA;break}break;case ye.PUNCT:if(l<t.PAL)u=t.PUNCT_CHARS[l];else switch(l){case t.PAL:o=ye.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=ye.ALPHA;break}break;case ye.ALPHA_SHIFT:if(o=a,l<26)u=String.fromCharCode(65+l);else switch(l){case 26:u=" ";break;case t.TEXT_COMPACTION_MODE_LATCH:o=ye.ALPHA;break}break;case ye.PUNCT_SHIFT:if(o=a,l<t.PAL)u=t.PUNCT_CHARS[l];else switch(l){case t.PAL:o=ye.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=ye.ALPHA;break}break}u!==""&&i.append(u),s++}},t.byteCompaction=function(e,n,r,i,o){var a=new s1,s=0,l=0,u=!1;switch(e){case t.BYTE_COMPACTION_MODE_LATCH:for(var c=new Int32Array(6),f=n[i++];i<n[0]&&!u;)switch(c[s++]=f,l=900*l+f,f=n[i++],f){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:i--,u=!0;break;default:if(s%5===0&&s>0){for(var d=0;d<6;++d)a.write(Number(Jt(l)>>Jt(8*(5-d))));l=0,s=0}break}i===n[0]&&f<t.TEXT_COMPACTION_MODE_LATCH&&(c[s++]=f);for(var h=0;h<s;h++)a.write(c[h]);break;case t.BYTE_COMPACTION_MODE_LATCH_6:for(;i<n[0]&&!u;){var p=n[i++];if(p<t.TEXT_COMPACTION_MODE_LATCH)s++,l=900*l+p;else switch(p){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:i--,u=!0;break}if(s%5===0&&s>0){for(var d=0;d<6;++d)a.write(Number(Jt(l)>>Jt(8*(5-d))));l=0,s=0}}break}return o.append(Lt.decode(a.toByteArray(),r)),i},t.numericCompaction=function(e,n,r){for(var i=0,o=!1,a=new Int32Array(t.MAX_NUMERIC_CODEWORDS);n<e[0]&&!o;){var s=e[n++];if(n===e[0]&&(o=!0),s<t.TEXT_COMPACTION_MODE_LATCH)a[i]=s,i++;else switch(s){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:n--,o=!0;break}(i%t.MAX_NUMERIC_CODEWORDS===0||s===t.NUMERIC_COMPACTION_MODE_LATCH||o)&&i>0&&(r.append(t.decodeBase900toBase10(a,i)),i=0)}return n},t.decodeBase900toBase10=function(e,n){for(var r=Jt(0),i=0;i<n;i++)r+=t.EXP900[n-i-1]*Jt(e[i]);var o=r.toString();if(o.charAt(0)!=="1")throw new L;return o.substring(1)},t.TEXT_COMPACTION_MODE_LATCH=900,t.BYTE_COMPACTION_MODE_LATCH=901,t.NUMERIC_COMPACTION_MODE_LATCH=902,t.BYTE_COMPACTION_MODE_LATCH_6=924,t.ECI_USER_DEFINED=925,t.ECI_GENERAL_PURPOSE=926,t.ECI_CHARSET=927,t.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,t.MACRO_PDF417_TERMINATOR=922,t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,t.MAX_NUMERIC_CODEWORDS=15,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,t.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,t.PL=25,t.LL=27,t.AS=27,t.ML=28,t.AL=28,t.PS=29,t.PAL=29,t.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,: 8-.$/"|*()?{}'`,t.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",t.EXP900=Kl()?l1():[],t.NUMBER_OF_SEQUENCE_CODEWORDS=2,t})(),cr=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},c1=(function(){function t(){}return t.decode=function(e,n,r,i,o,a,s){for(var l=new yo(e,n,r,i,o),u=null,c=null,f,d=!0;;d=!1){if(n!=null&&(u=t.getRowIndicatorColumn(e,l,n,!0,a,s)),i!=null&&(c=t.getRowIndicatorColumn(e,l,i,!1,a,s)),f=t.merge(u,c),f==null)throw k.getNotFoundInstance();var h=f.getBoundingBox();if(d&&h!=null&&(h.getMinY()<l.getMinY()||h.getMaxY()>l.getMaxY()))l=h;else break}f.setBoundingBox(l);var p=f.getBarcodeColumnCount()+1;f.setDetectionResultColumn(0,u),f.setDetectionResultColumn(p,c);for(var m=u!=null,y=1;
8y<=p;y++){var w=m?y:p-y;if(f.getDetectionResultColumn(w)===void 0){var _=void 0;w===0||w===p?_=new Xa(l,w===0):_=new Gl(l),f.setDetectionResultColumn(w,_);for(var C=-1,E=C,I=l.getMinY();I<=l.getMaxY();I++){if(C=t.getStartColumn(f,w,I,m),C<0||C>l.getMaxX()){if(E===-1)continue;C=E}var O=t.detectCodeword(e,l.getMinX(),l.getMaxX(),m,C,I,a,s);O!=null&&(_.setCodeword(I,O),E=C,a=Math.min(a,O.getWidth()),s=Math.max(s,O.getWidth()))}}}return t.createDecoderResult(f)},t.merge=function(e,n){if(e==null&&n==null)return null;var r=t.getBarcodeMetadata(e,n);if(r==null)return null;var i=yo.merge(t.adjustBoundingBox(e),t.adjustBoundingBox(n));return new qh(r,i)},t.adjustBoundingBox=function(e){var n,r;if(e==null)return null;var i=e.getRowHeights();if(i==null)return null;var o=t.getMax(i),a=0;try{for(var s=cr(i),l=s.next();!l.done;l=s.next()){var u=l.value;if(a+=o-u,u>0)break}}catch(h){n={error:h}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var c=e.getCodewords(),f=0;a>0&&c[f]==null;f++)a--;for(var d=0,f=i.length-1;f>=0&&(d+=o-i[f],!(i[f]>0));f--);for(var f=c.length-1;d>0&&c[f]==null;f--)d--;return e.getBoundingBox().addMissingRows(a,d,e.isLeft())},t.getMax=function(e){var n,r,i=-1;try{for(var o=cr(e),a=o.next();!a.done;a=o.next()){var s=a.value;i=Math.max(i,s)}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},t.getBarcodeMetadata=function(e,n){var r;if(e==null||(r=e.getBarcodeMetadata())==null)return n==null?null:n.getBarcodeMetadata();var i;return n==null||(i=n.getBarcodeMetadata())==null?r:r.getColumnCount()!==i.getColumnCount()&&r.getErrorCorrectionLevel()!==i.getErrorCorrectionLevel()&&r.getRowCount()!==i.getRowCount()?null:r},t.getRowIndicatorColumn=function(e,n,r,i,o,a){for(var s=new Xa(n,i),l=0;l<2;l++)for(var u=l===0?1:-1,c=Math.trunc(Math.trunc(r.getX())),f=Math.trunc(Math.trunc(r.getY()));f<=n.getMaxY()&&f>=n.getMinY();f+=u){var d=t.detectCodeword(e,0,e.getWidth(),i,c,f,o,a);d!=null&&(s.setCodeword(f,d),i?c=d.getStartX():c=d.getEndX())}return s},t.adjustCodewordCount=function(e,n){var r=n[0][1],i=r.getValue(),o=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-t.getNumberOfECCodeWords(e.getBarcodeECLevel());if(i.length===0){if(o<1||o>te.MAX_CODEWORDS_IN_BARCODE)throw k.getNotFoundInstance();r.setValue(o)}else i[0]!==o&&r.setValue(o)},t.createDecoderResult=function(e){var n=t.createBarcodeMatrix(e);t.adjustCodewordCount(e,n);for(var r=new Array,i=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),o=[],a=new Array,s=0;s<e.getBarcodeRowCount();s++)for(var l=0;l<e.getBarcodeColumnCount();l++){var u=n[s][l+1].getValue(),c=s*e.getBarcodeColumnCount()+l;u.length===0?r.push(c):u.length===1?i[c]=u[0]:(a.push(c),o.push(u))}for(var f=new Array(o.length),d=0;d<f.length;d++)f[d]=o[d];return t.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),i,te.toIntArray(r),te.toIntArray(a),f)},t.createDecoderResultFromAmbiguousValues=function(e,n,r,i,o){for(var a=new Int32Array(i.length),s=100;s-- >0;){for(var l=0;l<a.length;l++)n[i[l]]=o[l][a[l]];try{return t.decodeCodewords(n,e,r)}catch(c){var u=c instanceof Xe;if(!u)throw c}if(a.length===0)throw Xe.getChecksumInstance();for(var l=0;l<a.length;l++)if(a[l]<o[l].length-1){a[l]++;break}else if(a[l]=0,l===a.length-1)throw Xe.getChecksumInstance()}throw Xe.getChecksumInstance()},t.createBarcodeMatrix=function(e){for(var n,r,i,o,a=Array.from({length:e.getBarcodeRowCount()},function(){return new Array(e.getBarcodeColumnCount()+2)}),s=0;s<a.length;s++)for(var l=0;l<a[s].length;l++)a[s][l]=new wr;var u=0;try{for(var c=cr(e.getDetectionResultColumns()),f=c.next();!f.done;f=c.next()){var d=f.value;if(d!=null)try{for(var h=(i=void 0,cr(d.getCodewords())),p=h.next();!p.done;p=h.next()){var m=p.value;if(m!=null){var y=m.getRowNumber();if(y>=0){if(y>=a.length)continue;a[y][u].setValue(m.getValue())}}}}catch(w){i={error:w}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}u++}}catch(w){n={error:w}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return a},t.isValidBarcodeColumn=function(e,n){return n>=0&&n<=e.getBarcodeColumnCount()+1},t.getStartColumn=function(e,n,r,i){var o,a,s=i?1:-1,l=null;if(t.isValidBarcodeColumn(e,n-s)&&(l=e.getDetectionResultColumn(n-s).getCodeword(r)),l!=null)return i?l.getEndX():l.getStartX();if(l=e.getDetectionResultColumn(n).getCodewordNearby(r),l!=null)return i?l.getStartX():l.getEndX();if(t.isValidBarcodeColumn(e,n-s)&&(l=e.getDetectionResultColumn(n-s).getCodewordNearby(r)),l!=null)return i?l.getEndX():l.getStartX();for(var u=0;t.isValidBarcodeColumn(e,n-s);){n-=s;try{for(var c=(o=void 0,cr(e.getDetectionResultColumn(n).getCodewords())),f=c.next();!f.done;f=c.next()){var d=f.value;if(d!=null)return(i?d.getEndX():d.getStartX())+s*u*(d.getEndX()-d.getStartX())}}catch(h){o={error:h}}finally{try{f&&!f.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}u++}return i?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},t.detectCodeword=function(e,n,r,i,o,a,s,l){o=t.adjustCodewordStartColumn(e,n,r,i,o,a);var u=t.getModuleBitCount(e,n,r,i,o,a);if(u==null)return null;var c,f=re.sum(u);if(i)c=o+f;else{for(var d=0;d<u.length/2;d++){var h=u[d];u[d]=u[u.length-1-d],u[u.length-1-d]=h}c=o,o=c-f}if(!t.checkCodewordSkew(f,s,l))return null;var p=Jh.getDecodedValue(u),m=te.getCodeword(p);return m===-1?null:new Qh(o,c,t.getCodewordBucketNumber(p),m)},t.getModuleBitCount=function(e,n,r,i,o,a){for(var s=o,l=new Int32Array(8),u=0,c=i?1:-1,f=i;(i?s<r:s>=n)&&u<l.length;)e.get(s,a)===f?(l[u]++,s+=c):(u++,f=!f);return u===l.length||s===(i?r:n)&&u===l.length-1?l:null},t.getNumberOfECCodeWords=function(e){return 2<<e},t.adjustCodewordStartColumn=function(e,n,r,i,o,a){for(var s=o,l=i?-1:1,u=0;u<2;u++){for(;(i?s>=n:s<r)&&i===e.get(s,a);){if(Math.abs(o-s)>t.CODEWORD_SKEW_SIZE)return o;s+=l}l=-l,i=!i}return s},t.checkCodewordSkew=function(e,n,r){return n-t.CODEWORD_SKEW_SIZE<=e&&e<=r+t.CODEWORD_SKEW_SIZE},t.decodeCodewords=function(e,n,r){if(e.length===0)throw L.getFormatInstance();var i=1<<n+1,o=t.correctErrors(e,r,i);t.verifyCodewordCount(e,i);var a=u1.decode(e,""+n);return a.setErrorsCorrected(o),a.setErasures(r.length),a},t.correctErrors=function(e,n,r){if(n!=null&&n.length>r/2+t.MAX_ERRORS||r<0||r>t.MAX_EC_CODEWORDS)throw Xe.getChecksumInstance();return t.errorCorrection.decode(e,r,n)},t.verifyCodewordCount=function(e,n){if(e.length<4)throw L.getFormatInstance();var r=e[0];if(r>e.length)throw L.getFormatInstance();if(r===0)if(n<e.length)e[0]=e.length-n;else throw L.getFormatInstance()},t.getBitCountForCodeword=function(e){for(var n=new Int32Array(8),r=0,i=n.length-1;!((e&1)!==r&&(r=e&1,i--,i<0));)n[i]++,e>>=1;return n},t.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},t.getCodewordBucketNumber_number=function(e){return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))},t.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},t.toString=function(e){for(var n=new Xo,r=0;r<e.length;r++){n.format("Row %2d: ",r);for(var i=0;i<e[r].length;i++){var o=e[r][i];o.getValue().length===0?n.format(" ",null):n.format("%4d(%2d)",o.getValue()[0],o.getConfidence(o.getValue()[0]))}n.format("%n")}return n.toString()},t.CODEWORD_SKEW_SIZE=2,t.MAX_ERRORS=3,t.MAX_EC_CODEWORDS=512,t.errorCorrection=new zh,t})(),f1=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xo=(function(){function t(){}
8return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r=t.decode(e,n,!1);if(r==null||r.length===0||r[0]==null)throw k.getNotFoundInstance();return r[0]},t.prototype.decodeMultiple=function(e,n){n===void 0&&(n=null);try{return t.decode(e,n,!0)}catch(r){throw r instanceof L||r instanceof Xe?k.getNotFoundInstance():r}},t.decode=function(e,n,r){var i,o,a=new Array,s=Lh.detectMultiple(e,n,r);try{for(var l=f1(s.getPoints()),u=l.next();!u.done;u=l.next()){var c=u.value,f=c1.decode(s.getBits(),c[4],c[5],c[6],c[7],t.getMinCodewordWidth(c),t.getMaxCodewordWidth(c)),d=new ht(f.getText(),f.getRawBytes(),void 0,c,X.PDF_417);d.putMetadata(je.ERROR_CORRECTION_LEVEL,f.getECLevel());var h=f.getOther();h!=null&&d.putMetadata(je.PDF417_EXTRA_METADATA,h),a.push(d)}}catch(p){i={error:p}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}return a.map(function(p){return p})},t.getMaxWidth=function(e,n){return e==null||n==null?0:Math.trunc(Math.abs(e.getX()-n.getX()))},t.getMinWidth=function(e,n){return e==null||n==null?J.MAX_VALUE:Math.trunc(Math.abs(e.getX()-n.getX()))},t.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0],e[4]),t.getMaxWidth(e[6],e[2])*te.MODULES_IN_CODEWORD/te.MODULES_IN_STOP_PATTERN),Math.max(t.getMaxWidth(e[1],e[5]),t.getMaxWidth(e[7],e[3])*te.MODULES_IN_CODEWORD/te.MODULES_IN_STOP_PATTERN)))},t.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(t.getMinWidth(e[0],e[4]),t.getMinWidth(e[6],e[2])*te.MODULES_IN_CODEWORD/te.MODULES_IN_STOP_PATTERN),Math.min(t.getMinWidth(e[1],e[5]),t.getMinWidth(e[7],e[3])*te.MODULES_IN_CODEWORD/te.MODULES_IN_STOP_PATTERN)))},t.prototype.reset=function(){},t})(),d1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ya=(function(t){d1(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="ReaderException",e})(ot),Za=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},h1=(function(){function t(){}return t.prototype.decode=function(e,n){return this.setHints(n),this.decodeInternal(e)},t.prototype.decodeWithState=function(e){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(e)},t.prototype.setHints=function(e){this.hints=e;var n=e!=null&&e.get(Me.TRY_HARDER)!==void 0,r=e==null?null:e.get(Me.POSSIBLE_FORMATS),i=new Array;if(r!=null){var o=r.some(function(a){return a===X.UPC_A||a===X.UPC_E||a===X.EAN_13||a===X.EAN_8||a===X.CODABAR||a===X.CODE_39||a===X.CODE_93||a===X.CODE_128||a===X.ITF||a===X.RSS_14||a===X.RSS_EXPANDED});o&&!n&&i.push(new xr(e)),r.includes(X.QR_CODE)&&i.push(new mo),r.includes(X.DATA_MATRIX)&&i.push(new vo),r.includes(X.AZTEC)&&i.push(new po),r.includes(X.PDF_417)&&i.push(new xo),o&&n&&i.push(new xr(e))}i.length===0&&(n||i.push(new xr(e)),i.push(new mo),i.push(new vo),i.push(new po),i.push(new xo),n&&i.push(new xr(e))),this.readers=i},t.prototype.reset=function(){var e,n;if(this.readers!==null)try{for(var r=Za(this.readers),i=r.next();!i.done;i=r.next()){var o=i.value;o.reset()}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.decodeInternal=function(e){var n,r;if(this.readers===null)throw new Ya("No readers where selected, nothing can be read.");try{for(var i=Za(this.readers),o=i.next();!o.done;o=i.next()){var a=o.value;try{return a.decode(e,this.hints)}catch(s){if(s instanceof Ya)continue}}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}throw new k("No MultiFormat Readers were able to detect the code.")},t})(),p1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
8e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),g1=(function(t){p1(e,t);function e(n,r){n===void 0&&(n=null),r===void 0&&(r=500);var i=this,o=new h1;return o.setHints(n),i=t.call(this,o,r)||this,i}return e.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)},e})(er),v1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){v1(e,t);function e(n){return n===void 0&&(n=500),t.call(this,new xo,n)||this}return e})(er);var m1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){m1(e,t);function e(n){return n===void 0&&(n=500),t.call(this,new mo,n)||this}return e})(er);var wo;(function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.MIN_SIZE=3]="MIN_SIZE",t[t.MAX_SIZE=4]="MAX_SIZE",t[t.MARGIN=5]="MARGIN",t[t.PDF417_COMPACT=6]="PDF417_COMPACT",t[t.PDF417_COMPACTION=7]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=9]="AZTEC_LAYERS",t[t.QR_VERSION=10]="QR_VERSION"})(wo||(wo={}));const Xr=wo;var Xl=(function(){function t(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new on(e,Int32Array.from([1])))}return t.prototype.buildGenerator=function(e){var n=this.cachedGenerators;if(e>=n.length)for(var r=n[n.length-1],i=this.field,o=n.length;o<=e;o++){var a=r.multiply(new on(i,Int32Array.from([1,i.exp(o-1+i.getGeneratorBase())])));n.push(a),r=a}return n[e]},t.prototype.encode=function(e,n){if(n===0)throw new G("No error correction bytes");var r=e.length-n;if(r<=0)throw new G("No data bytes provided");var i=this.buildGenerator(n),o=new Int32Array(r);Ce.arraycopy(e,0,o,0,r);var a=new on(this.field,o);a=a.multiplyByMonomial(n,1);for(var s=a.divide(i)[1],l=s.getCoefficients(),u=n-l.length,c=0;c<u;c++)e[r+c]=0;Ce.arraycopy(l,0,e,r+u,l.length)},t})(),_r=(function(){function t(){}return t.applyMaskPenaltyRule1=function(e){return t.applyMaskPenaltyRule1Internal(e,!0)+t.applyMaskPenaltyRule1Internal(e,!1)},t.applyMaskPenaltyRule2=function(e){for(var n=0,r=e.getArray(),i=e.getWidth(),o=e.getHeight(),a=0;a<o-1;a++)for(var s=r[a],l=0;l<i-1;l++){var u=s[l];u===s[l+1]&&u===r[a+1][l]&&u===r[a+1][l+1]&&n++}return t.N2*n},t.applyMaskPenaltyRule3=function(e){for(var n=0,r=e.getArray(),i=e.getWidth(),o=e.getHeight(),a=0;a<o;a++)for(var s=0;s<i;s++){var l=r[a];s+6<i&&l[s]===1&&l[s+1]===0&&l[s+2]===1&&l[s+3]===1&&l[s+4]===1&&l[s+5]===0&&l[s+6]===1&&(t.isWhiteHorizontal(l,s-4,s)||t.isWhiteHorizontal(l,s+7,s+11))&&n++,a+6<o&&r[a][s]===1&&r[a+1][s]===0&&r[a+2][s]===1&&r[a+3][s]===1&&r[a+4][s]===1&&r[a+5][s]===0&&r[a+6][s]===1&&(t.isWhiteVertical(r,s,a-4,a)||t.isWhiteVertical(r,s,a+7,a+11))&&n++}return n*t.N3},t.isWhiteHorizontal=function(e,n,r){n=Math.max(n,0),r=Math.min(r,e.length);for(var i=n;i<r;i++)if(e[i]===1)return!1;return!0},t.isWhiteVertical=function(e,n,r,i){r=Math.max(r,0),i=Math.min(i,e.length);for(var o=r;o<i;o++)if(e[o][n]===1)return!1;return!0},t.applyMaskPenaltyRule4=function(e){for(var n=0,r=e.getArray(),i=e.getWidth(),o=e.getHeight(),a=0;a<o;a++)for(var s=r[a],l=0;l<i;l++)s[l]===1&&n++;var u=e.getHeight()*e.getWidth(),c=Math.floor(Math.abs(n*2-u)*10/u);return c*t.N4},t.getDataMaskBit=function(e,n,r){var i,o;switch(e){case 0:i=r+n&1;break;case 1:i=r&1;break;case 2:i=n%3;break;case 3:i=(r+n)%3;break;case 4:i=Math.floor(r/2)+Math.floor(n/3)&1;break;case 5:o=r*n,i=(o&1)+o%3;break;case 6:o=r*n,i=(o&1)+o%3&1;break;case 7:o=r*n,i=o%3+(r+n&1)&1;break;default:throw new G("Invalid mask pattern: "+e)}return i===0}
8,t.applyMaskPenaltyRule1Internal=function(e,n){for(var r=0,i=n?e.getHeight():e.getWidth(),o=n?e.getWidth():e.getHeight(),a=e.getArray(),s=0;s<i;s++){for(var l=0,u=-1,c=0;c<o;c++){var f=n?a[s][c]:a[c][s];f===u?l++:(l>=5&&(r+=t.N1+(l-5)),l=1,u=f)}l>=5&&(r+=t.N1+(l-5))}return r},t.N1=3,t.N2=3,t.N3=40,t.N4=10,t})(),y1=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},x1=(function(){function t(e,n){this.width=e,this.height=n;for(var r=new Array(n),i=0;i!==n;i++)r[i]=new Uint8Array(e);this.bytes=r}return t.prototype.getHeight=function(){return this.height},t.prototype.getWidth=function(){return this.width},t.prototype.get=function(e,n){return this.bytes[n][e]},t.prototype.getArray=function(){return this.bytes},t.prototype.setNumber=function(e,n,r){this.bytes[n][e]=r},t.prototype.setBoolean=function(e,n,r){this.bytes[n][e]=r?1:0},t.prototype.clear=function(e){var n,r;try{for(var i=y1(this.bytes),o=i.next();!o.done;o=i.next()){var a=o.value;ft.fill(a,e)}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;if(this.width!==n.width||this.height!==n.height)return!1;for(var r=0,i=this.height;r<i;++r)for(var o=this.bytes[r],a=n.bytes[r],s=0,l=this.width;s<l;++s)if(o[s]!==a[s])return!1;return!0},t.prototype.toString=function(){for(var e=new xe,n=0,r=this.height;n<r;++n){for(var i=this.bytes[n],o=0,a=this.width;o<a;++o)switch(i[o]){case 0:e.append(" 0");break;case 1:e.append(" 1");break;default:e.append(" ");break}e.append(` 9`)}return e.toString()},t})(),_o=(function(){function t(){this.maskPattern=-1}return t.prototype.getMode=function(){return this.mode},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getVersion=function(){return this.version},t.prototype.getMaskPattern=function(){return this.maskPattern},t.prototype.getMatrix=function(){return this.matrix},t.prototype.toString=function(){var e=new xe;return e.append(`<< 10`),e.append(" mode: "),e.append(this.mode?this.mode.toString():"null"),e.append(` 11 ecLevel: `),e.append(this.ecLevel?this.ecLevel.toString():"null"),e.append(` 12 version: `),e.append(this.version?this.version.toString():"null"),e.append(` 13 maskPattern: `),e.append(this.maskPattern.toString()),this.matrix?(e.append(` 14 matrix: 15`),e.append(this.matrix.toString())):e.append(` 16 matrix: null 17`),e.append(`>> 18`),e.toString()},t.prototype.setMode=function(e){this.mode=e},t.prototype.setECLevel=function(e){this.ecLevel=e},t.prototype.setVersion=function(e){this.version=e},t.prototype.setMaskPattern=function(e){this.maskPattern=e}
18,t.prototype.setMatrix=function(e){this.matrix=e},t.isValidMaskPattern=function(e){return e>=0&&e<t.NUM_MASK_PATTERNS},t.NUM_MASK_PATTERNS=8,t})(),w1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Ee=(function(t){w1(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.kind="WriterException",e})(ot),qa=(function(){function t(){}return t.clearMatrix=function(e){e.clear(255)},t.buildMatrix=function(e,n,r,i,o){t.clearMatrix(o),t.embedBasicPatterns(r,o),t.embedTypeInfo(n,i,o),t.maybeEmbedVersionInfo(r,o),t.embedDataBits(e,i,o)},t.embedBasicPatterns=function(e,n){t.embedPositionDetectionPatternsAndSeparators(n),t.embedDarkDotAtLeftBottomCorner(n),t.maybeEmbedPositionAdjustmentPatterns(e,n),t.embedTimingPatterns(n)},t.embedTypeInfo=function(e,n,r){var i=new Ge;t.makeTypeInfoBits(e,n,i);for(var o=0,a=i.getSize();o<a;++o){var s=i.get(i.getSize()-1-o),l=t.TYPE_INFO_COORDINATES[o],u=l[0],c=l[1];if(r.setBoolean(u,c,s),o<8){var f=r.getWidth()-o-1,d=8;r.setBoolean(f,d,s)}else{var f=8,d=r.getHeight()-7+(o-8);r.setBoolean(f,d,s)}}},t.maybeEmbedVersionInfo=function(e,n){if(!(e.getVersionNumber()<7)){var r=new Ge;t.makeVersionInfoBits(e,r);for(var i=17,o=0;o<6;++o)for(var a=0;a<3;++a){var s=r.get(i);i--,n.setBoolean(o,n.getHeight()-11+a,s),n.setBoolean(n.getHeight()-11+a,o,s)}}},t.embedDataBits=function(e,n,r){for(var i=0,o=-1,a=r.getWidth()-1,s=r.getHeight()-1;a>0;){for(a===6&&(a-=1);s>=0&&s<r.getHeight();){for(var l=0;l<2;++l){var u=a-l;if(t.isEmpty(r.get(u,s))){var c=void 0;i<e.getSize()?(c=e.get(i),++i):c=!1,n!==255&&_r.getDataMaskBit(n,u,s)&&(c=!c),r.setBoolean(u,s,c)}}s+=o}o=-o,s+=o,a-=2}if(i!==e.getSize())throw new Ee("Not all bits consumed: "+i+"/"+e.getSize())},t.findMSBSet=function(e){return 32-J.numberOfLeadingZeros(e)},t.calculateBCHCode=function(e,n){if(n===0)throw new G("0 polynomial");var r=t.findMSBSet(n);for(e<<=r-1;t.findMSBSet(e)>=r;)e^=n<<t.findMSBSet(e)-r;return e},t.makeTypeInfoBits=function(e,n,r){if(!_o.isValidMaskPattern(n))throw new Ee("Invalid mask pattern");var i=e.getBits()<<3|n;r.appendBits(i,5);var o=t.calculateBCHCode(i,t.TYPE_INFO_POLY);r.appendBits(o,10);var a=new Ge;if(a.appendBits(t.TYPE_INFO_MASK_PATTERN,15),r.xor(a),r.getSize()!==15)throw new Ee("should not happen but we got: "+r.getSize())}
18,t.makeVersionInfoBits=function(e,n){n.appendBits(e.getVersionNumber(),6);var r=t.calculateBCHCode(e.getVersionNumber(),t.VERSION_INFO_POLY);if(n.appendBits(r,12),n.getSize()!==18)throw new Ee("should not happen but we got: "+n.getSize())},t.isEmpty=function(e){return e===255},t.embedTimingPatterns=function(e){for(var n=8;n<e.getWidth()-8;++n){var r=(n+1)%2;t.isEmpty(e.get(n,6))&&e.setNumber(n,6,r),t.isEmpty(e.get(6,n))&&e.setNumber(6,n,r)}},t.embedDarkDotAtLeftBottomCorner=function(e){if(e.get(8,e.getHeight()-8)===0)throw new Ee;e.setNumber(8,e.getHeight()-8,1)},t.embedHorizontalSeparationPattern=function(e,n,r){for(var i=0;i<8;++i){if(!t.isEmpty(r.get(e+i,n)))throw new Ee;r.setNumber(e+i,n,0)}},t.embedVerticalSeparationPattern=function(e,n,r){for(var i=0;i<7;++i){if(!t.isEmpty(r.get(e,n+i)))throw new Ee;r.setNumber(e,n+i,0)}},t.embedPositionAdjustmentPattern=function(e,n,r){for(var i=0;i<5;++i)for(var o=t.POSITION_ADJUSTMENT_PATTERN[i],a=0;a<5;++a)r.setNumber(e+a,n+i,o[a])},t.embedPositionDetectionPattern=function(e,n,r){for(var i=0;i<7;++i)for(var o=t.POSITION_DETECTION_PATTERN[i],a=0;a<7;++a)r.setNumber(e+a,n+i,o[a])},t.embedPositionDetectionPatternsAndSeparators=function(e){var n=t.POSITION_DETECTION_PATTERN[0].length;t.embedPositionDetectionPattern(0,0,e),t.embedPositionDetectionPattern(e.getWidth()-n,0,e),t.embedPositionDetectionPattern(0,e.getWidth()-n,e);var r=8;t.embedHorizontalSeparationPattern(0,r-1,e),t.embedHorizontalSeparationPattern(e.getWidth()-r,r-1,e),t.embedHorizontalSeparationPattern(0,e.getWidth()-r,e);var i=7;t.embedVerticalSeparationPattern(i,0,e),t.embedVerticalSeparationPattern(e.getHeight()-i-1,0,e),t.embedVerticalSeparationPattern(i,e.getHeight()-i,e)},t.maybeEmbedPositionAdjustmentPatterns=function(e,n){if(!(e.getVersionNumber()<2))for(var r=e.getVersionNumber()-1,i=t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[r],o=0,a=i.length;o!==a;o++){var s=i[o];if(s>=0)for(var l=0;l!==a;l++){var u=i[l];u>=0&&t.isEmpty(n.get(u,s))&&t.embedPositionAdjustmentPattern(u-2,s-2,n)}}},t.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),t.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),t.VERSION_INFO_POLY=7973,t.TYPE_INFO_POLY=1335,t.TYPE_INFO_MASK_PATTERN=21522,t})(),_1=(function(){function t(e,n){this.dataBytes=e,this.errorCorrectionBytes=n}return t.prototype.getDataBytes=function(){return this.dataBytes},t.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},t})(),Qa=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(){function t(){}
18return t.calculateMaskPenalty=function(e){return _r.applyMaskPenaltyRule1(e)+_r.applyMaskPenaltyRule2(e)+_r.applyMaskPenaltyRule3(e)+_r.applyMaskPenaltyRule4(e)},t.encode=function(e,n,r){r===void 0&&(r=null);var i=t.DEFAULT_BYTE_MODE_ENCODING,o=r!==null&&r.get(Xr.CHARACTER_SET)!==void 0;o&&(i=r.get(Xr.CHARACTER_SET).toString());var a=this.chooseMode(e,i),s=new Ge;if(a===Se.BYTE&&(o||t.DEFAULT_BYTE_MODE_ENCODING!==i)){var l=Le.getCharacterSetECIByName(i);l!==void 0&&this.appendECI(l,s)}this.appendModeInfo(a,s);var u=new Ge;this.appendBytes(e,a,u,i);var c;if(r!==null&&r.get(Xr.QR_VERSION)!==void 0){var f=Number.parseInt(r.get(Xr.QR_VERSION).toString(),10);c=En.getVersionForNumber(f);var d=this.calculateBitsNeeded(a,s,u,c);if(!this.willFit(d,c,n))throw new Ee("Data too big for requested version")}else c=this.recommendVersion(n,a,s,u);var h=new Ge;h.appendBitArray(s);var p=a===Se.BYTE?u.getSizeInBytes():e.length;this.appendLengthInfo(p,c,a,h),h.appendBitArray(u);var m=c.getECBlocksForLevel(n),y=c.getTotalCodewords()-m.getTotalECCodewords();this.terminateBits(y,h);var w=this.interleaveWithECBytes(h,c.getTotalCodewords(),y,m.getNumBlocks()),_=new _o;_.setECLevel(n),_.setMode(a),_.setVersion(c);var C=c.getDimensionForVersion(),E=new x1(C,C),I=this.chooseMaskPattern(w,n,c,E);return _.setMaskPattern(I),qa.buildMatrix(w,n,c,I,E),_.setMatrix(E),_},t.recommendVersion=function(e,n,r,i){var o=this.calculateBitsNeeded(n,r,i,En.getVersionForNumber(1)),a=this.chooseVersion(o,e),s=this.calculateBitsNeeded(n,r,i,a);return this.chooseVersion(s,e)},t.calculateBitsNeeded=function(e,n,r,i){return n.getSize()+e.getCharacterCountBits(i)+r.getSize()},t.getAlphanumericCode=function(e){return e<t.ALPHANUMERIC_TABLE.length?t.ALPHANUMERIC_TABLE[e]:-1},t.chooseMode=function(e,n){if(n===void 0&&(n=null),Le.SJIS.getName()===n&&this.isOnlyDoubleByteKanji(e))return Se.KANJI;for(var r=!1,i=!1,o=0,a=e.length;o<a;++o){var s=e.charAt(o);if(t.isDigit(s))r=!0;else if(this.getAlphanumericCode(s.charCodeAt(0))!==-1)i=!0;else return Se.BYTE}return i?Se.ALPHANUMERIC:r?Se.NUMERIC:Se.BYTE},t.isOnlyDoubleByteKanji=function(e){var n;try{n=Lt.encode(e,Le.SJIS)}catch{return!1}var r=n.length;if(r%2!==0)return!1;for(var i=0;i<r;i+=2){var o=n[i]&255;if((o<129||o>159)&&(o<224||o>235))return!1}return!0},t.chooseMaskPattern=function(e,n,r,i){for(var o=Number.MAX_SAFE_INTEGER,a=-1,s=0;s<_o.NUM_MASK_PATTERNS;s++){qa.buildMatrix(e,n,r,s,i);var l=this.calculateMaskPenalty(i);l<o&&(o=l,a=s)}return a},t.chooseVersion=function(e,n){for(var r=1;r<=40;r++){var i=En.getVersionForNumber(r);if(t.willFit(e,i,n))return i}throw new Ee("Data too big")},t.willFit=function(e,n,r){var i=n.getTotalCodewords(),o=n.getECBlocksForLevel(r),a=o.getTotalECCodewords(),s=i-a,l=(e+7)/8;return s>=l},t.terminateBits=function(e,n){var r=e*8;if(n.getSize()>r)throw new Ee("data bits cannot fit in the QR Code"+n.getSize()+" > "+r);for(var i=0;i<4&&n.getSize()<r;++i)n.appendBit(!1);var o=n.getSize()&7;if(o>0)for(var i=o;i<8;i++)n.appendBit(!1);for(var a=e-n.getSizeInBytes(),i=0;i<a;++i)n.appendBits((i&1)===0?236:17,8);if(n.getSize()!==r)throw new Ee("Bits size does not equal capacity")},t.getNumDataBytesAndNumECBytesForBlockID=function(e,n,r,i,o,a){if(i>=r)throw new Ee("Block ID too large");var s=e%r,l=r-s,u=Math.floor(e/r),c=u+1,f=Math.floor(n/r),d=f+1,h=u-f,p=c-d;if(h!==p)throw new Ee("EC bytes mismatch");if(r!==l+s)throw new Ee("RS blocks mismatch");if(e!==(f+h)*l+(d+p)*s)throw new Ee("Total bytes mismatch");i<l?(o[0]=f,a[0]=h):(o[0]=d,a[0]=p)},t.interleaveWithECBytes=function(e,n,r,i){var o,a,s,l;if(e.getSizeInBytes()!==r)throw new Ee("Number of bits and data bytes does not match");for(var u=0,c=0,f=0,d=new Array,h=0;h<i;++h){var p=new Int32Array(1),m=new Int32Array(1);t.getNumDataBytesAndNumECBytesForBlockID(n,r,i,h,p,m);var y=p[0],w=new Uint8Array(y);e.toBytes(8*u,w,0,y);var _=t.generateECBytes(w,m[0]);d.push(new _1(w,_)),c=Math.max(c,y),f=Math.max(f,_.length),u+=p[0]}if(r!==u)throw new Ee("Data bytes does not match offset");for(var C=new Ge,h=0;h<c;++h)try{for(var E=(o=void 0,Qa(d)),I=E.next();!I.done;I=E.next()){var O=I.value,w=O.getDataBytes();h<w.length&&C.appendBits(w[h],8)}}catch(F){o={error:F}}finally{try{I&&!I.done&&(a=E.return)&&a.call(E)}finally{if(o)throw o.error}}for(var h=0;h<f;++h)try{for(var x=(s=void 0,Qa(d)),R=x.next();!R.done;R=x.next()){var O=R.value,_=O.getErrorCorrectionBytes();h<_.length&&C.appendBits(_[h],8)}}catch(F){s={error:F}}finally{try{R&&!R.done&&(l=x.return)&&l.call(x)}finally{if(s)throw s.error}}if(n!==C.getSizeInBytes())throw new Ee("Interleaving error: "+n+" and "+C.getSizeInBytes()+" differ.");return C},t.generateECBytes=function(e,n){for(var r=e.length,i=new Int32Array(r+n),o=0;o<r;o++)i[o]=e[o]&255;new Xl(lt.QR_CODE_FIELD_256).encode(i,n);for(var a=new Uint8Array(n),o=0;o<n;o++)a[o]=i[r+o];return a}
18,t.appendModeInfo=function(e,n){n.appendBits(e.getBits(),4)},t.appendLengthInfo=function(e,n,r,i){var o=r.getCharacterCountBits(n);if(e>=1<<o)throw new Ee(e+" is bigger than "+((1<<o)-1));i.appendBits(e,o)},t.appendBytes=function(e,n,r,i){switch(n){case Se.NUMERIC:t.appendNumericBytes(e,r);break;case Se.ALPHANUMERIC:t.appendAlphanumericBytes(e,r);break;case Se.BYTE:t.append8BitBytes(e,r,i);break;case Se.KANJI:t.appendKanjiBytes(e,r);break;default:throw new Ee("Invalid mode: "+n)}},t.getDigit=function(e){return e.charCodeAt(0)-48},t.isDigit=function(e){var n=t.getDigit(e);return n>=0&&n<=9},t.appendNumericBytes=function(e,n){for(var r=e.length,i=0;i<r;){var o=t.getDigit(e.charAt(i));if(i+2<r){var a=t.getDigit(e.charAt(i+1)),s=t.getDigit(e.charAt(i+2));n.appendBits(o*100+a*10+s,10),i+=3}else if(i+1<r){var a=t.getDigit(e.charAt(i+1));n.appendBits(o*10+a,7),i+=2}else n.appendBits(o,4),i++}},t.appendAlphanumericBytes=function(e,n){for(var r=e.length,i=0;i<r;){var o=t.getAlphanumericCode(e.charCodeAt(i));if(o===-1)throw new Ee;if(i+1<r){var a=t.getAlphanumericCode(e.charCodeAt(i+1));if(a===-1)throw new Ee;n.appendBits(o*45+a,11),i+=2}else n.appendBits(o,6),i++}},t.append8BitBytes=function(e,n,r){var i;try{i=Lt.encode(e,r)}catch(l){throw new Ee(l)}for(var o=0,a=i.length;o!==a;o++){var s=i[o];n.appendBits(s,8)}},t.appendKanjiBytes=function(e,n){var r;try{r=Lt.encode(e,Le.SJIS)}catch(f){throw new Ee(f)}for(var i=r.length,o=0;o<i;o+=2){var a=r[o]&255,s=r[o+1]&255,l=a<<8&4294967295|s,u=-1;if(l>=33088&&l<=40956?u=l-33088:l>=57408&&l<=60351&&(u=l-49472),u===-1)throw new Ee("Invalid byte sequence");var c=(u>>8)*192+(u&255);n.appendBits(c,13)}}
18,t.appendECI=function(e,n){n.appendBits(Se.ECI.getBits(),4),n.appendBits(e.getValue(),8)},t.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),t.DEFAULT_BYTE_MODE_ENCODING=Le.UTF8.getName(),t})();var b1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){b1(e,t);function e(n,r,i,o,a,s,l,u){var c=t.call(this,s,l)||this;if(c.yuvData=n,c.dataWidth=r,c.dataHeight=i,c.left=o,c.top=a,o+s>r||a+l>i)throw new G("Crop rectangle does not fit within image data.");return u&&c.reverseHorizontal(s,l),c}return e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new G("Requested row is outside the image: "+n);var i=this.getWidth();(r==null||r.length<i)&&(r=new Uint8ClampedArray(i));var o=(n+this.top)*this.dataWidth+this.left;return Ce.arraycopy(this.yuvData,o,r,0,i),r},e.prototype.getMatrix=function(){var n=this.getWidth(),r=this.getHeight();if(n===this.dataWidth&&r===this.dataHeight)return this.yuvData;var i=n*r,o=new Uint8ClampedArray(i),a=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return Ce.arraycopy(this.yuvData,a,o,0,i),o;for(var s=0;s<r;s++){var l=s*n;Ce.arraycopy(this.yuvData,a,o,l,n),a+=this.dataWidth}return o},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,i,o){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+n,this.top+r,i,o,!1)},e.prototype.renderThumbnail=function(){for(var n=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR,i=new Int32Array(n*r),o=this.yuvData,a=this.top*this.dataWidth+this.left,s=0;s<r;s++){for(var l=s*n,u=0;u<n;u++){var c=o[a+u*e.THUMBNAIL_SCALE_FACTOR]&255;i[l+u]=4278190080|c*65793}a+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return i},e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.reverseHorizontal=function(n,r){for(var i=this.yuvData,o=0,a=this.top*this.dataWidth+this.left;o<r;o++,a+=this.dataWidth)for(var s=a+n/2,l=a,u=a+n-1;l<s;l++,u--){var c=i[l];i[l]=i[u],i[u]=c}},e.prototype.invert=function(){return new Wo(this)},e.THUMBNAIL_SCALE_FACTOR=2,e})(Ti);var C1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){C1(e,t);function e(n,r,i,o,a,s,l){var u=t.call(this,r,i)||this;if(u.dataWidth=o,u.dataHeight=a,u.left=s,u.top=l,n.BYTES_PER_ELEMENT===4){for(var c=r*i,f=new Uint8ClampedArray(c),d=0;d<c;d++){var h=n[d],p=h>>16&255,m=h>>7&510,y=h&255;f[d]=(p+m+y)/4&255}u.luminances=f}else u.luminances=n;if(o===void 0&&(u.dataWidth=r),a===void 0&&(u.dataHeight=i),s===void 0&&(u.left=0),l===void 0&&(u.top=0),u.left+r>u.dataWidth||u.top+i>u.dataHeight)throw new G("Crop rectangle does not fit within image data.");return u}return e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new G("Requested row is outside the image: "+n);var i=this.getWidth();(r==null||r.length<i)&&(r=new Uint8ClampedArray(i));var o=(n+this.top)*this.dataWidth+this.left;return Ce.arraycopy(this.luminances,o,r,0,i),r},e.prototype.getMatrix=function(){var n=this.getWidth(),r=this.getHeight();if(n===this.dataWidth&&r===this.dataHeight)return this.luminances;var i=n*r,o=new Uint8ClampedArray(i),a=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return Ce.arraycopy(this.luminances,a,o,0,i),o;for(var s=0;s<r;s++){var l=s*n;Ce.arraycopy(this.luminances,a,o,l,n),a+=this.dataWidth}return o},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,i,o){return new e(this.luminances,i,o,this.dataWidth,this.dataHeight,this.left+n,this.top+r)},e.prototype.invert=function(){return new Wo(this)},e})(Ti);var A1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}
18e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){A1(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.forName=function(n){return this.getCharacterSetECIByName(n)},e})(Le);(function(){function t(){}return t.ISO_8859_1=Le.ISO8859_1,t})();var E1=(function(){function t(){}return t.prototype.isCompact=function(){return this.compact},t.prototype.setCompact=function(e){this.compact=e},t.prototype.getSize=function(){return this.size},t.prototype.setSize=function(e){this.size=e},t.prototype.getLayers=function(){return this.layers},t.prototype.setLayers=function(e){this.layers=e},t.prototype.getCodeWords=function(){return this.codeWords},t.prototype.setCodeWords=function(e){this.codeWords=e},t.prototype.getMatrix=function(){return this.matrix},t.prototype.setMatrix=function(e){this.matrix=e},t})(),Ja=(function(){function t(){}return t.singletonList=function(e){return[e]},t.min=function(e,n){return e.sort(n)[0]},t})(),S1=(function(){function t(e){this.previous=e}return t.prototype.getPrevious=function(){return this.previous},t})(),I1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),jo=(function(t){I1(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.value=r,o.bitCount=i,o}return e.prototype.appendTo=function(n,r){n.appendBits(this.value,this.bitCount)},e.prototype.add=function(n,r){return new e(this,n,r)},e.prototype.addBinaryShift=function(n,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,n,r)},e.prototype.toString=function(){var n=this.value&(1<<this.bitCount)-1;return n|=1<<this.bitCount,"<"+J.toBinaryString(n|1<<this.bitCount).substring(1)+">"},e})(S1),T1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),O1=(function(t){T1(e,t);function e(n,r,i){var o=t.call(this,n,0,0)||this;return o.binaryShiftStart=r,o.binaryShiftByteCount=i,o}return e.prototype.appendTo=function(n,r){for(var i=0;i<this.binaryShiftByteCount;i++)(i===0||i===31&&this.binaryShiftByteCount<=62)&&(n.appendBits(31,5),this.binaryShiftByteCount>62?n.appendBits(this.binaryShiftByteCount-31,16):i===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(r[this.binaryShiftStart+i],8)},e.prototype.addBinaryShift=function(n,r){return new e(this,n,r)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},e})(jo);function M1(t,e,n){return new O1(t,e,n)}function fr(t,e,n){return new jo(t,e,n)}var R1=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],an=0,xi=1,yt=2,jl=3,Nt=4,D1=new jo(null,0,0),Ki=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])],k1=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function P1(t){var e,n;try{for(var r=k1(t),i=r.next();!i.done;i=r.next()){var o=i.value;ft.fill(o,-1)}}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return t[an][Nt]=0,t[xi][Nt]=0,t[xi][an]=28,t[jl][Nt]=0,t[yt][Nt]=0,t[yt][an]=15,t}var Yl=P1(ft.createInt32Array(6,6)),N1=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},B1=(function(){function t(e,n,r,i){this.token=e,this.mode=n,this.binaryShiftByteCount=r,this.bitCount=i}return t.prototype.getMode=function(){return this.mode},t.prototype.getToken=function(){return this.token},t.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},t.prototype.getBitCount=function(){return this.bitCount},t.prototype.latchAndAppend=function(e,n){var r=this.bitCount,i=this.token;if(e!==this.mode){var o=Ki[this.mode][e];i=fr(i,o&65535,o>>16),r+=o>>16}var a=e===yt?4:5;return i=fr(i,n,a),new t(i,e,0,r+a)},t.prototype.shiftAndAppend=function(e,n){var r=this.token,i=this.mode===yt?4:5;return r=fr(r,Yl[this.mode][e],i),r=fr(r,n,5),new t(r,this.mode,0,this.bitCount+i+5)},t.prototype.addBinaryShiftChar=function(e){var n=this.token,r=this.mode,i=this.bitCount;if(this.mode===Nt||this.mode===yt){var o=Ki[r][an];n=fr(n,o&65535,o>>16),i+=o>>16,r=an}var a=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new t(n,r,this.binaryShiftByteCount+1,i+a);return s.binaryShiftByteCount===2078&&(s=s.endBinaryShift(e+1)),s},t.prototype.endBinaryShift=function(e){if(this.binaryShiftByteCount===0)return this;var n=this.token;return n=M1(n,e-this.binaryShiftByteCount,this.binaryShiftByteCount),new t(n,this.mode,0,this.bitCount)}
18,t.prototype.isBetterThanOrEqualTo=function(e){var n=this.bitCount+(Ki[this.mode][e.mode]>>16);return this.binaryShiftByteCount<e.binaryShiftByteCount?n+=t.calculateBinaryShiftCost(e)-t.calculateBinaryShiftCost(this):this.binaryShiftByteCount>e.binaryShiftByteCount&&e.binaryShiftByteCount>0&&(n+=10),n<=e.bitCount},t.prototype.toBitArray=function(e){for(var n,r,i=[],o=this.endBinaryShift(e.length).token;o!==null;o=o.getPrevious())i.unshift(o);var a=new Ge;try{for(var s=N1(i),l=s.next();!l.done;l=s.next()){var u=l.value;u.appendTo(a,e)}}catch(c){n={error:c}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a},t.prototype.toString=function(){return _e.format("%s bits=%d bytes=%d",R1[this.mode],this.bitCount,this.binaryShiftByteCount)},t.calculateBinaryShiftCost=function(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0},t.INITIAL_STATE=new t(D1,an,0,0),t})();function F1(t){var e=_e.getCharCode(" "),n=_e.getCharCode("."),r=_e.getCharCode(",");t[an][e]=1;for(var i=_e.getCharCode("Z"),o=_e.getCharCode("A"),a=o;a<=i;a++)t[an][a]=a-o+2;t[xi][e]=1;for(var s=_e.getCharCode("z"),l=_e.getCharCode("a"),a=l;a<=s;a++)t[xi][a]=a-l+2;t[yt][e]=1;for(var u=_e.getCharCode("9"),c=_e.getCharCode("0"),a=c;a<=u;a++)t[yt][a]=a-c+2;t[yt][r]=12,t[yt][n]=13;for(var f=["\0"," ","�","�","�","�","�","�","\x07","\b"," ",` 19`,"\v","\f","\r","\x1B","�","�","�","�","@","\\","^","_","`","|","~","�"],d=0;d<f.length;d++)t[jl][_e.getCharCode(f[d])]=d;for(var h=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"],d=0;d<h.length;d++)_e.getCharCode(h[d])>0&&(t[Nt][_e.getCharCode(h[d])]=d);return t}var Xi=F1(ft.createInt32Array(5,256)),jr=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},L1=(function(){function t(e){this.text=e}return t.prototype.encode=function(){for(var e=_e.getCharCode(" "),n=_e.getCharCode(` 20`),r=Ja.singletonList(B1.INITIAL_STATE),i=0;i<this.text.length;i++){var o=void 0,a=i+1<this.text.length?this.text[i+1]:0;switch(this.text[i]){case _e.getCharCode("\r"):o=a===n?2:0;break;case _e.getCharCode("."):o=a===e?3:0;break;case _e.getCharCode(","):o=a===e?4:0;break;case _e.getCharCode(":"):o=a===e?5:0;break;default:o=0}o>0?(r=t.updateStateListForPair(r,i,o),i++):r=this.updateStateListForChar(r,i)}var s=Ja.min(r,function(l,u){return l.getBitCount()-u.getBitCount()});return s.toBitArray(this.text)},t.prototype.updateStateListForChar=function(e,n){var r,i,o=[];try{for(var a=jr(e),s=a.next();!s.done;s=a.next()){var l=s.value;this.updateStateForChar(l,n,o)}}catch(u){r={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return t.simplifyStates(o)},t.prototype.updateStateForChar=function(e,n,r){for(var i=this.text[n]&255,o=Xi[e.getMode()][i]>0,a=null,s=0;s<=Nt;s++){var l=Xi[s][i];if(l>0){if(a==null&&(a=e.endBinaryShift(n)),!o||s===e.getMode()||s===yt){var u=a.latchAndAppend(s,l);r.push(u)}if(!o&&Yl[e.getMode()][s]>=0){var c=a.shiftAndAppend(s,l);r.push(c)}}}if(e.getBinaryShiftByteCount()>0||Xi[e.getMode()][i]===0){var f=e.addBinaryShiftChar(n);r.push(f)}},t.updateStateListForPair=function(e,n,r){var i,o,a=[];try{for(var s=jr(e),l=s.next();!l.done;l=s.next()){var u=l.value;this.updateStateForPair(u,n,r,a)}}catch(c){i={error:c}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return this.simplifyStates(a)},t.updateStateForPair=function(e,n,r,i){var o=e.endBinaryShift(n);if(i.push(o.latchAndAppend(Nt,r)),e.getMode()!==Nt&&i.push(o.shiftAndAppend(Nt,r)),r===3||r===4){var a=o.latchAndAppend(yt,16-r).latchAndAppend(yt,1);i.push(a)}if(e.getBinaryShiftByteCount()>0){var s=e.addBinaryShiftChar(n).addBinaryShiftChar(n+1);i.push(s)}},t.simplifyStates=function(e){var n,r,i,o,a=[];try{for(var s=jr(e),l=s.next();!l.done;l=s.next()){var u=l.value,c=!0,f=function(y){if(y.isBetterThanOrEqualTo(u))return c=!1,"break";u.isBetterThanOrEqualTo(y)&&(a=a.filter(function(w){return w!==y}))};try{for(var d=(i=void 0,jr(a)),h=d.next();!h.done;h=d.next()){var p=h.value,m=f(p);if(m==="break")break}}catch(y){i={error:y}}
20finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}c&&a.push(u)}}catch(y){n={error:y}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a},t})(),V1=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(){function t(){}return t.encodeBytes=function(e){return t.encode(e,t.DEFAULT_EC_PERCENT,t.DEFAULT_AZTEC_LAYERS)},t.encode=function(e,n,r){var i=new L1(e).encode(),o=J.truncDivision(i.getSize()*n,100)+11,a=i.getSize()+o,s,l,u,c,f;if(r!==t.DEFAULT_AZTEC_LAYERS){if(s=r<0,l=Math.abs(r),l>(s?t.MAX_NB_BITS_COMPACT:t.MAX_NB_BITS))throw new G(_e.format("Illegal value %s for layers",r));u=t.totalBitsInLayer(l,s),c=t.WORD_SIZE[l];var d=u-u%c;if(f=t.stuffBits(i,c),f.getSize()+o>d)throw new G("Data to large for user specified layer");if(s&&f.getSize()>c*64)throw new G("Data to large for user specified layer")}else{c=0,f=null;for(var h=0;;h++){if(h>t.MAX_NB_BITS)throw new G("Data too large for an Aztec code");if(s=h<=3,l=s?h+1:h,u=t.totalBitsInLayer(l,s),!(a>u)){(f==null||c!==t.WORD_SIZE[l])&&(c=t.WORD_SIZE[l],f=t.stuffBits(i,c));var d=u-u%c;if(!(s&&f.getSize()>c*64)&&f.getSize()+o<=d)break}}}var p=t.generateCheckWords(f,u,c),m=f.getSize()/c,y=t.generateModeMessage(s,l,m),w=(s?11:14)+l*4,_=new Int32Array(w),C;if(s){C=w;for(var h=0;h<_.length;h++)_[h]=h}else{C=w+1+2*J.truncDivision(J.truncDivision(w,2)-1,15);for(var E=J.truncDivision(w,2),I=J.truncDivision(C,2),h=0;h<E;h++){var O=h+J.truncDivision(h,15);_[E-h-1]=I-O-1,_[E+h]=I+O+1}}for(var x=new Vt(C),h=0,R=0;h<l;h++){for(var N=(l-h)*4+(s?9:12),F=0;F<N;F++)for(var W=F*2,$=0;$<2;$++)p.get(R+W+$)&&x.set(_[h*2+$],_[h*2+F]),p.get(R+N*2+W+$)&&x.set(_[h*2+F],_[w-1-h*2-$]),p.get(R+N*4+W+$)&&x.set(_[w-1-h*2-$],_[w-1-h*2-F]),p.get(R+N*6+W+$)&&x.set(_[w-1-h*2-F],_[h*2+$]);R+=N*8}if(t.drawModeMessage(x,s,C,y),s)t.drawBullsEye(x,J.truncDivision(C,2),5);else{t.drawBullsEye(x,J.truncDivision(C,2),7);for(var h=0,F=0;h<J.truncDivision(w,2)-1;h+=15,F+=16)for(var $=J.truncDivision(C,2)&1;$<C;$+=2)x.set(J.truncDivision(C,2)-F,$),x.set(J.truncDivision(C,2)+F,$),x.set($,J.truncDivision(C,2)-F),x.set($,J.truncDivision(C,2)+F)}var Z=new E1;return Z.setCompact(s),Z.setSize(C),Z.setLayers(l),Z.setCodeWords(m),Z.setMatrix(x),Z},t.drawBullsEye=function(e,n,r){for(var i=0;i<r;i+=2)for(var o=n-i;o<=n+i;o++)e.set(o,n-i),e.set(o,n+i),e.set(n-i,o),e.set(n+i,o);e.set(n-r,n-r),e.set(n-r+1,n-r),e.set(n-r,n-r+1),e.set(n+r,n-r),e.set(n+r,n-r+1),e.set(n+r,n+r-1)},t.generateModeMessage=function(e,n,r){var i=new Ge;return e?(i.appendBits(n-1,2),i.appendBits(r-1,6),i=t.generateCheckWords(i,28,4)):(i.appendBits(n-1,5),i.appendBits(r-1,11),i=t.generateCheckWords(i,40,4)),i},t.drawModeMessage=function(e,n,r,i){var o=J.truncDivision(r,2);if(n)for(var a=0;a<7;a++){var s=o-3+a;i.get(a)&&e.set(s,o-5),i.get(a+7)&&e.set(o+5,s),i.get(20-a)&&e.set(s,o+5),i.get(27-a)&&e.set(o-5,s)}else for(var a=0;a<10;a++){var s=o-5+a+J.truncDivision(a,5);i.get(a)&&e.set(s,o-7),i.get(a+10)&&e.set(o+7,s),i.get(29-a)&&e.set(s,o+7),i.get(39-a)&&e.set(o-7,s)}},t.generateCheckWords=function(e,n,r){var i,o,a=e.getSize()/r,s=new Xl(t.getGF(r)),l=J.truncDivision(n,r),u=t.bitsToWords(e,r,l);s.encode(u,l-a);var c=n%r,f=new Ge;f.appendBits(0,c);try{for(var d=V1(Array.from(u)),h=d.next();!h.done;h=d.next()){var p=h.value;f.appendBits(p,r)}}catch(m){i={error:m}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}return f},t.bitsToWords=function(e,n,r){var i=new Int32Array(r),o,a;for(o=0,a=e.getSize()/n;o<a;o++){for(var s=0,l=0;l<n;l++)s|=e.get(o*n+l)?1<<n-l-1:0;i[o]=s}return i},t.getGF=function(e){switch(e){case 4:return lt.AZTEC_PARAM;case 6:return lt.AZTEC_DATA_6;case 8:return lt.AZTEC_DATA_8;case 10:return lt.AZTEC_DATA_10;case 12:return lt.AZTEC_DATA_12;default:throw new G("Unsupported word size "+e)}},t.stuffBits=function(e,n){for(var r=new Ge,i=e.getSize(),o=(1<<n)-2,a=0;a<i;a+=n){for(var s=0,l=0;l<n;l++)(a+l>=i||e.get(a+l))&&(s|=1<<n-1-l);(s&o)===o?(r.appendBits(s&o,n),a--):(s&o)===0?(r.appendBits(s|1,n),a--):r.appendBits(s,n)}return r},t.totalBitsInLayer=function(e,n){return((n?88:112)+16*e)*e},t.DEFAULT_EC_PERCENT=33,t.DEFAULT_AZTEC_LAYERS=0,t.MAX_NB_BITS=32,t.MAX_NB_BITS_COMPACT=4,t.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]),t})();const U1={name:"stream-barcode-reader",data(){return{isLoading:!0,codeReader:new g1,isMediaStreamAPISupported:navigator&&navigator.mediaDevices&&"enumerateDevices"in navigator.mediaDevices}},mounted(){if(!this.isMediaStreamAPISupported)throw new ot("Media Stream API is not supported");this.start(),this.$refs.scanner.oncanplay=t=>{this.isLoading=!1,this.$emit("loaded")}}
20,beforeUnmount(){this.codeReader.reset()},methods:{start(){this.codeReader.decodeFromVideoDevice(void 0,this.$refs.scanner,(t,e)=>{t&&(this.$emit("decode",t.text),this.$emit("result",t))})}}},$1={class:"scanner-container"},H1={poster:"data:image/gif,AAAA",ref:"scanner"};function W1(t,e,n,r,i,o){return S(),B("div",$1,[Wn(V("div",null,[V("video",H1,null,512),e[0]||(e[0]=V("div",{class:"overlay-element"},null,-1)),e[1]||(e[1]=V("div",{class:"laser"},null,-1))],512),[[Rr,!i.isLoading]])])}const z1=me(U1,[["render",W1],["__scopeId","data-v-e16c822a"]]),G1={name:"scan-barcode",emits:["result"],components:{StreamBarcodeReader:z1},created(){},methods:{onDecode(t){console.log(t),this.$emit("result",t)},onError(t){console.log(t)}}};function K1(t,e,n,r,i,o){const a=j("StreamBarcodeReader");return S(),B("div",null,[g(a,{onDecode:o.onDecode,onError:o.onError},null,8,["onDecode","onError"])])}const X1=me(G1,[["render",K1]]),j1={name:"media-edit-component",emits:["error","close"],data(){return{loading:!1,file:null,fileLabel:"",type:"",rowKeys:"",columnKeys:"",accept:"image/*",ErrorMessage:"",isRecording:!1,minutes:0,seconds:0,mediaRecorder:null,timer:"",timeOut:"",audioBlob:null,audioRecorded:!1}},created(){this.columnKeys=this.activeCell.columnKey,this.rowKeys=this.activeCell.rowKey,this.type=this.activeCell.type,this.accept=this.type==="IMAGE"?"image/*":"audio/*",this.fileLabel=this.type==="IMAGE"?this.$t("select_image"):this.$t("select_audio")},watch:{file(t){if(t){let e=t.type.split("/")[1],n=[];switch(this.type){case"AUDIO":n=["opus","flac","webm","weba","wav","ogg","m4a","oga","mid","mp3","aiff","wma","mpeg","au"];break;case"IMAGE":n=["jpg","jpeg","bmp","png","tif","pjp","xbm","jxl","svgz","ico","tiff","gif","svg","jfif","webp","pjpeg","avif"];break}if(n.includes(e))this.hitFirebase(this.tableKey,this.rowKeys,this.columnKeys,t);else{this.ErrorMessage=this.type==="AUDIO"?"Only audio files are allowed":"Only images are allowed";return}}}},methods:{...ve(ae,["addMediaPathInUi"]),recordAudio(){navigator.mediaDevices.getUserMedia({audio:!0}).then(t=>{this.audioRecorded=!1,this.audioBlob=null,this.seconds=0,this.minutes=0,this.timer=0,this.mediaRecorder=new MediaRecorder(t),this.mediaRecorder.start(),this.isRecording=!0,this.timer=setInterval(()=>{this.seconds++,this.seconds>=60&&(this.minutes++,this.seconds=0)},1e3);const e=[];this.mediaRecorder.addEventListener("dataavailable",n=>{e.push(n.data)}),this.mediaRecorder.addEventListener("stop",()=>{this.audioBlob=new Blob(e),this.audioBlob=this.audioBlob.slice(0,this.audioBlob.size,"audio/mp3"),this.audioRecorded=!0}),this.timeOut=setTimeout(()=>{this.stopRecording()},3e4)}).catch(t=>{this.$emit("error")})},playAudio(){if(this.audioBlob){const t=URL.createObjectURL(this.audioBlob);new Audio(t).play()}},saveAudio(){if(this.audioBlob){const t=new File([this.audioBlob],"filename.mp3",{type:this.audioBlob.type,lastModified:new Date().getTime()});this.file=t}},stopRecording(){this.isRecording=!1,this.mediaRecorder?.stream.getAudioTracks().forEach(function(t){t.stop()}),clearInterval(this.timer),clearTimeout(this.timeOut)},hitFirebase(t,e,n,r){this.loading=!0;let i={},o=/(?:\.([^.]+))?$/;const a=Er(He(We,"image")).key,s=o.exec(r.name)?.[1],l=a+"."+s,u=Ft().currentUser?.uid;if(!u){console.log("uid is null");return}let f={contentType:this.type==="IMAGE"?"image/jpg":"audio/mp4",customMetadata:{users:u}};console.log("Updating file newImageKey - "+JSON.stringify(r.name));const d=Bo(Fo,`image/${t}/${l}`),h=`${t}/${l}`,p=`rows/${t}/${e}/values/${n}/`;if(i[p+"image"]=l,i[p+"path"]=`${t}/${l}`,this.type==="IMAGE")Rc(r,{maxSizeMB:2,useWebWorker:!0,maxIteration:10}).then(y=>ya(d,y,f)).then(y=>(console.log(" Uploaded a blob or file!"),y?Dr(He(We),i):null)).then(()=>{this.loading=!1,console.log("Db updated!"),this.addMediaPathInUi({path:h,rowKey:this.rowKeys,colKey:this.columnKeys}),this.$emit("close")});else{if(r.size>1024*1024*10){alert("File too big (> 10MB)");return}ya(d,r,f).then(m=>(console.log("Uploaded a blob or file!"),m?Dr(He(We),i):null)).then(()=>{this.loading=!1,console.log("Db updated!"),this.addMediaPathInUi({path:h,rowKey:this.rowKeys,colKey:this.columnKeys}),this.$emit("close")}).catch(m=>{this.loading=!1,console.log("Error :"+m)})}}},computed:{...K(cn,["activeCell"]),...K(ae,["tableKey"])}},Y1={key:0,class:"text-center"},Z1={key:0},q1={key:1},Q1={class:"timer"},J1={key:2,class:"mt-5"};function e0(t,e,n,r,i,o){return S(),B("div",null,[g(Dc,{variant:"outlined",accept:i.accept,modelValue:i.file,"onUpdate:modelValue":e[0]||(e[0]=a=>i.file=a),"error-messages":i.ErrorMessage,loading:i.loading,"loader-height":"3",label:i.fileLabel},null,8,["accept","modelValue","error-messages","loading","label"]),i.type==="AUDIO"?(S(),B("div",Y1,[e[4]||(e[4]=V("div",{class:"mb-5"},"Or",-1)),i.isRecording?(S(),B("div",q1,[V("span",Q1,T(i.minutes)+":"+T(i.seconds.toString().padStart(2,"0"))+T(" "),1),g(H,{color:"red",size:"42",class:"ml-2",onClick:o.stopRecording},{default:v(()=>e[2]||(e[2]=[A("mdi-stop-circle",-1)])),_:1,__:[2]},8,["onClick"])])):(S(),B("div",Z1,[g(D,{class:"d-inline-block error",onClick:o.recordAudio},{default:v(()=>[g(H,null,{default:v(()=>e[1]||(e[1]=[A("mdi-waveform",-1)])),_:1,__:[1]}),A(" Record "+T(i.audioRecorded?"Again":""),1)]),_:1},8,["onClick"])])),i.audioRecorded?(S(),B("div",J1,[g(D,{class:"mr-5",color:"primary",text:"",onClick:o.playAudio},{default:v(()=>e[3]||(e[3]=[A("Preview",-1)])),_:1,__:[3]},8,["onClick"]),g(D,{onClick:o.saveAudio,color:"primary"},{default:v(()=>[A(T(t.$t("save")),1)]),_:1},8,["onClick"])])):U("",!0)])):U("",!0)])}const t0=me(j1,[["render",e0],["__scopeId","data-v-5e2e0dca"]]),n0={name:"sign",emits:["close","image"],props:{signature:String},data(){return{saving:!1,show:!0,options:{penColor:"#000099"},rowKeys:"",type:"",columnKeys:"",accept:"image/*",signatureData:""}},created(){this.$nextTick(()=>{this.$refs.signaturePad.resizeCanvas()}),this.columnKeys=this.activeCell.columnKey,this.rowKeys=this.activeCell.rowKey,this.type=this.activeCell.type,this.accept=this.type==="DRAW"?"image/*":"audio/*"},computed:{...K(cn,["activeCell"]),...K(ae,["tableKey"])},methods:{...ve(ae,["addMediaPathInUi"]),onClear(){this.$refs.signaturePad.clearSignature(),this.onEnd()}
20,undo(){this.$refs.signaturePad.undoSignature()},onEnd(){const{data:t}=this.$refs.signaturePad.saveSignature();this.signatureData=t},hitFirebase(){this.saving=!0;let t={};const n=Er(He(We,"image")).key+".png",r=Ft().currentUser?.uid;if(!r)return;let o={contentType:this.type==="DRAW"?"image/png":"audio/mp4",customMetadata:{users:r}};console.log("Updating file newImageKey - "+JSON.stringify(this.signatureData));const a=Bo(Fo,`image/${this.tableKey}/${n}`),s=`${this.tableKey}/${n}`,l=`rows/${this.tableKey}/${this.rowKeys}/values/${this.columnKeys}/`;t[l+"image"]=n,t[l+"path"]=s,this.type==="DRAW"&&Xu(a,this.signatureData,"data_url",o).then(u=>(console.log("Uploaded a blob or file!"),u?Dr(He(We),t):null)).then(()=>{console.log("Db updated!"),this.saving=!1,this.addMediaPathInUi({path:s,rowKey:this.rowKeys,colKey:this.columnKeys}),this.$emit("image")}).catch(u=>{this.saving=!1,console.log("Error :"+u)})}}},r0={class:"text-center"},i0={style:{margin:"auto"}};function o0(t,e,n,r,i,o){const a=j("VueSignaturePad");return S(),P(ie,null,{default:v(()=>[g(kl,{dark:"",color:"primary"},{default:v(()=>[g(D,{icon:"",dark:"",onClick:o.onClear},{default:v(()=>[g(H,null,{default:v(()=>e[1]||(e[1]=[A("mdi-delete",-1)])),_:1,__:[1]})]),_:1},8,["onClick"]),g(Bc,null,{default:v(()=>e[2]||(e[2]=[A("Sign pad",-1)])),_:1,__:[2]}),g(q),g(Ui,null,{default:v(()=>[g(D,{icon:"",dark:"",onClick:o.undo},{default:v(()=>[g(H,null,{default:v(()=>e[3]||(e[3]=[A("mdi-undo",-1)])),_:1,__:[3]})]),_:1},8,["onClick"])]),_:1}),g(Ui,null,{default:v(()=>[g(D,{icon:"",dark:"",onClick:o.hitFirebase},{default:v(()=>[g(H,null,{default:v(()=>e[4]||(e[4]=[A("mdi-content-save-outline",-1)])),_:1,__:[4]})]),_:1},8,["onClick"])]),_:1}),g(Ui,null,{default:v(()=>[g(D,{icon:"",dark:"",onClick:e[0]||(e[0]=s=>t.$emit("close"))},{default:v(()=>[g(H,{onClick:o.undo},{default:v(()=>e[5]||(e[5]=[A("mdi-close",-1)])),_:1,__:[5]},8,["onClick"])]),_:1})]),_:1})]),_:1}),i.saving?(S(),P(Lo,{key:0,class:"m-5",indeterminate:"",color:"primary"})):U("",!0),g(a,{style:{margin:"auto"},class:"mt-10",customStyle:{border:"black 3px solid"},width:"300px",height:"225px",ref:"signaturePad",options:{...i.options,onEnd:o.onEnd}},null,8,["options"]),V("div",r0,[V("a",i0,T(t.$t("insert_new_signature")),1)])]),_:1})}const a0=me(n0,[["render",o0]]),s0={name:"EditCell",props:["tableKey","title","expanded"],components:{mapComponent:Rf,scanBarcode:X1,SelectComponent:Pc,MediaEditComponent:t0,signPad:a0,LinkTableComponent:kc},emits:["close","toggle-expand"],computed:{dateTime:{get(){return Number(this.activeCell.cells.raw)},set(t){this.updateCell(this.activeCell,t.toString()),this.$emit("close")}},locale(){const t=localStorage.getItem("language")??"en-us";return t==="ar-u-nu-arab"?"ar":t},...K(cn,["activeCell"]),...K(Bt,["darkMode"]),...K(Pe,["columns"])},data(){return{type:"STRING",showMaps:!1,options:[],mapValue:"",mapSearchRequestId:0,selectValue:[],showSignPad:!1}},watch:{async mapValue(t){const e=++this.mapSearchRequestId;if(t){const n=await Dl(t);e===this.mapSearchRequestId&&(this.options=n)}else this.options=[]}},mounted(){this.type=this.activeCell.type??"STRING"},methods:{getLinkedColumn(){return this.columns?.[this.activeCell.columnKey]?.linkedColumn??""},getLinkedTable(){return this.columns?.[this.activeCell.columnKey]?.linkedTable??""},insertLineBreak(t){const n=(t?.target).selectionStart??0,r=this.activeCell.cells.raw??"",i=r.substring(0,n),o=r.substring(n);this.activeCell.cells.raw=i+` 21`+o},storeSelectValue(t,e){this.selectValue=t,e||this.saveSelectValue()},...ve(ae,["updateCell"]),saveValue(){this.updateCell(this.activeCell,this.activeCell.cells.raw),this.$emit("close")},locationFromMap(t){this.mapValue=t,this.showMaps=!1},saveLinkValue(t){this.updateCell(this.activeCell,t),this.$emit("close")},saveMapValue(){this.updateCell(this.activeCell,this.mapValue),this.$emit("close")},saveBarcodeValue(t){this.updateCell(this.activeCell,t),this.$emit("close")},saveSelectValue(){let t="";t=this.selectValue.join(` 22`),this.updateCell(this.activeCell,t),this.$emit("close")}}},l0={class:"text-truncate"},u0={key:0},c0={key:1},f0={key:2},d0={id:"list-id-map"},h0={key:3},p0={key:4},g0={key:5},v0={key:6},m0={key:7},y0={key:8};function x0(t,e,n,r,i,o){const a=j("scan-barcode"),s=j("select-component"),l=j("media-edit-component"),u=j("VueDatePicker"),c=j("LinkTableComponent"),f=j("map-component"),d=j("sign-pad");return S(),P(ie,{onKeydown:e[21]||(e[21]=Pt(Ue(()=>{},["prevent"]),["tab"]))},{default:v(()=>[g(Te,{class:"d-flex align-center"},{default:v(()=>[V("span",l0,T(n.title),1),g(q),i.type==="STRING"?(S(),P(D,{key:0,icon:"",variant:"text",size:"small",title:n.expanded?t.$t("collapse"):t.$t("expand"),onClick:e[0]||(e[0]=h=>t.$emit("toggle-expand"))},{default:v(()=>[g(H,null,{default:v(()=>
22[A(T(n.expanded?"mdi-arrow-collapse":"mdi-arrow-expand"),1)]),_:1})]),_:1},8,["title"])):U("",!0)]),_:1}),i.type==="STRING"?(S(),B("div",u0,[g(ue,null,{default:v(()=>[g(vi,{autofocus:"",class:"string-cell-textarea",variant:"outlined",modelValue:t.activeCell.cells.raw,"onUpdate:modelValue":e[1]||(e[1]=h=>t.activeCell.cells.raw=h),rows:n.expanded?15:3,onKeyup:Pt(Ue(o.saveValue,["exact"]),["enter"]),onKeydown:[Pt(Ue(o.saveValue,["exact","prevent"]),["enter"]),Pt(Ue(o.insertLineBreak,["alt","prevent"]),["enter"])]},null,8,["modelValue","rows","onKeyup","onKeydown"]),V("div",null,[e[22]||(e[22]=V("strong",null,"Left Alt",-1)),e[23]||(e[23]=A(" + ",-1)),e[24]||(e[24]=V("strong",null,"Enter",-1)),A(" "+T(t.$t("line_break_text[1]")),1)])]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[2]||(e[2]=h=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("close")),1)]),_:1}),g(D,{color:"primary",onClick:o.saveValue,id:"saveBtn"},{default:v(()=>[A(T(t.$t("save")),1)]),_:1},8,["onClick"])]),_:1})])):i.type==="INTEGER"||i.type==="PHONE"?(S(),B("div",c0,[g(ue,null,{default:v(()=>[g(Ne,{autofocus:"",variant:"outlined",modelValue:t.activeCell.cells.raw,"onUpdate:modelValue":e[3]||(e[3]=h=>t.activeCell.cells.raw=h),type:"number",onKeydown:Pt(o.saveValue,["enter"])},null,8,["modelValue","onKeydown"])]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[4]||(e[4]=h=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("close")),1)]),_:1}),g(D,{color:"primary",onClick:o.saveValue,id:"saveBtn"},{default:v(()=>[A(T(t.$t("save")),1)]),_:1},8,["onClick"])]),_:1})])):i.type==="MAP"?(S(),B("div",f0,[g(ue,null,{default:v(()=>[g(Ne,{modelValue:i.mapValue,"onUpdate:modelValue":e[5]||(e[5]=h=>i.mapValue=h),list:"list-id-map",variant:"outlined",autofocus:"",onKeydown:Pt(o.saveMapValue,["enter"])},null,8,["modelValue","onKeydown"]),V("datalist",d0,[(S(!0),B(Y,null,de(i.options,(h,p)=>(S(),B("option",{key:p},T(h),1))),128))]),g(mi,{onClick:e[6]||(e[6]=h=>i.showMaps=!0),class:"mapicon"},{default:v(()=>[g(H,{left:"",color:"red"},{default:v(()=>e[25]||(e[25]=[A(" mdi-google-maps ",-1)])),_:1,__:[25]}),e[26]||(e[26]=A(" Use Map ",-1))]),_:1,__:[26]})]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[7]||(e[7]=h=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("close")),1)]),_:1}),g(D,{color:"primary",onClick:o.saveMapValue,id:"saveBtn"},{default:v(()=>[A(T(t.$t("save")),1)]),_:1},8,["onClick"])]),_:1})])):i.type==="BARCODE"?(S(),B("div",h0,[g(ue,null,{default:v(()=>[g(a,{onResult:o.saveBarcodeValue},null,8,["onResult"])]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[8]||(e[8]=h=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("close")),1)]),_:1})]),_:1})])):i.type==="SELECT"?(S(),B("div",p0,[g(ue,null,{default:v(()=>[g(s,{colKey:t.activeCell.columnKey,onSelect:o.storeSelectValue,existing:i.selectValue},null,8,["colKey","onSelect","existing"])]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[9]||(e[9]=h=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("close")),1)]),_:1}),g(D,{color:"primary",onClick:o.saveSelectValue,id:"saveBtn"},{default:v(()=>[A(T(t.$t("save")),1)]),_:1},8,["onClick"])]),_:1})])):i.type==="IMAGE"||i.type==="AUDIO"?(S(),B("div",g0,[g(ue,null,{default:v(()=>[g(l,{onClose:e[10]||(e[10]=h=>t.$emit("close"))})]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[11]||(e[11]=h=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("close")),1)]),_:1})]),_:1})])):i.type==="DRAW"?(S(),B("div",v0,[g(ue,null,{default:v(()=>[g(D,{icon:"",color:"primary",onClick:e[12]||(e[12]=h=>i.showSignPad=!0)},{default:v(()=>[g(H,null,{default:v(()=>e[27]||(e[27]=[A("mdi-pencil",-1)])),_:1,__:[27]})]),_:1})]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[13]||(e[13]=h=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("close")),1)]),_:1})]),_:1})])):i.type==="DATEONLY"||i.type==="TIME"?(S(),B("div",m0,[g(ue,null,{default:v(()=>[g(u,{modelValue:o.dateTime,"onUpdate:modelValue":e[14]||(e[14]=h=>o.dateTime=h),modelModifiers:{number:!0},"model-type":"timestamp",inline:"","auto-apply":i.type==="DATEONLY",offset:20,timezone:"UTC","time-picker":i.type==="TIME","mode-height":"120","enable-time-picker":i.type==="TIME","is-24":!1,locale:o.locale,dar
22k:t.darkMode},null,8,["modelValue","auto-apply","time-picker","enable-time-picker","locale","dark"])]),_:1})])):i.type==="LINK"?(S(),B("div",y0,[g(ue,null,{default:v(()=>[g(c,{linkedColumn:o.getLinkedColumn(),linkedTable:o.getLinkedTable(),colKey:t.activeCell.columnKey,onClose:e[15]||(e[15]=h=>t.$emit("close")),onSave:o.saveLinkValue},null,8,["linkedColumn","linkedTable","colKey","onSave"])]),_:1})])):U("",!0),g(Q,{modelValue:i.showMaps,"onUpdate:modelValue":e[17]||(e[17]=h=>i.showMaps=h),fullscreen:!0},{default:v(()=>[g(f,{onClose:e[16]||(e[16]=h=>i.showMaps=!1),"temp-value":i.mapValue,onLocation:o.locationFromMap},null,8,["temp-value","onLocation"])]),_:1},8,["modelValue"]),g(Q,{fullscreen:!0,modelValue:i.showSignPad,"onUpdate:modelValue":e[20]||(e[20]=h=>i.showSignPad=h),hideClose:!0},{default:v(()=>[g(d,{onClose:e[18]||(e[18]=h=>i.showSignPad=!1),onImage:e[19]||(e[19]=h=>(i.showSignPad=!1,t.$emit("close")))})]),_:1},8,["modelValue"])]),_:1})}const w0=me(s0,[["render",x0],["__scopeId","data-v-61995ec2"]]),_0=Zn({name:"MainTable",setup(){return{rowStore:ae()}},props:{resetFilter:Number,tableKey:{type:String,required:!0}},emits:["move","type","style","delete","formula","sum","select","graph"],components:{filterItem:Tc,vTr:bf,vTh:Ef,fTd:Ic,EditColumn:Tf,editCell:w0,AudioPlayerComponent:Ol,bottomSheet:Mc},data(){return{resetEditCell:0,rowNumber:0,initiallyScrollled:!1,columnRenameModel:!1,editCell:!1,cellDialogExpanded:!1,showImage:!1,filterQuery:"",rangeMin:0,rangeMax:0,selected:{},showAudio:!1,drawer:!1,filters:!1,tiles:{edit:{icon:"mdi-pencil",title:this.$t("edit")},copy:{icon:"mdi-content-copy",title:this.$t("copy")},paste:{icon:"mdi-content-paste",title:this.$t("paste")},clear:{icon:"mdi-close",title:this.$t("clear")},search:{icon:"mdi-magnify",title:this.$t("open_url")},select_row:{icon:"mdi-select",title:this.$t("select_row")}}}},watch:{resetFilter(t){this.selected={}},editCell(t){t||(this.cellDialogExpanded=!1)}},updated(){console.log("updated")},methods:{getTitle(){return this.columns?.[this.activeCell.columnKey]?.name??""},changeSumType(t){const e=this.columns[t]?.type;(e==="INTEGER"||e==="FORMULA")&&this.access===2&&this.$emit("sum",t)},applyFilter(){this.filters=!1;const t=this.activeColumnHeader;if(this.rangeMin||this.rangeMax){const e={min:String(this.rangeMin),max:String(this.rangeMax)};this.setRangeList({key:t,data:e})}else this.setFilterList({key:t,data:this.selected[t]});this.applyFilterVx(),this.rangeMin=0,this.rangeMax=0,this.filterQuery=""},clearSingleFilter(){this.filters=!1,delete this.selected?.[this.activeColumnHeader],this.clearSingleFilterVx(this.activeColumnHeader)},pushFilterItem(t){const e=this.activeColumnHeader;if(this.selected[e]&&this.selected[e].includes(t)){let n=this.selected[e];n.splice(n.indexOf(t),1),this.selected[e]=n}else if(this.selected[e]){let n=this.selected[e];n.push(t),this.selected[e]=n}else this.selected[e]=[t]},handlePaste(t){const e=Kt.parseDisplayValue(t,this.activeCell.type);console.log(e),this.updateCell(this.activeCell,e)},...ve(ae,["addRow","fetchTableImages","updateCell","clearSort"]),...ve(Pe,["getVisibleColumnKeys"]),validURL(t){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t)},async bottomSheetItemClicked(t){this.drawer=!1;let e=this.activeCell.type;if(this.activeCell)switch(t){case"edit":this.editCell=!0,(e==="IMAGE"||e==="DRAW")&&(this.showImage=!1);break;case"select_row":this.selectRow(this.activeCell.rowKey),(e==="IMAGE"||e==="DRAW")&&(this.showImage=!1);break;case"copy":await navigator.clipboard.writeText(this.activeCell.cells.display);break;case"paste":navigator.clipboard.readText().then(u=>{this.handlePaste(u)}).catch(u=>{console.log(u)});break;case"clear":e==="IMAGE"||e==="DRAW"?(this.clearMediaCell(this.activeCell),this.showImage=!1):this.updateCell(this.activeCell,"",!0);break;case"search":let n=this.activeCell.cells.display,r=this.validURL(n);n=r?n:"https://google.com/search?q="+n,r&&!n.startsWith("https://")&&(n="https://"+n),window.open(n,"_blank");break;case"call":window.open(`tel:${this.activeCell.cells.display}`,"_self");break;case"sms":window.open(`sms://${this.activeCell.cells.display}`,"_self");break;case"whatsapp":window.open(`https://wa.me/${this.activeCell.cells.display}`,"_self");break;case"view":this.activeCell.type==="AUDIO"?this.showAudio=!0:this.showImage=!0;break;case"download":const i=document.createElement("a");let o;try{o=await fetch(this.activeCell.cells.display)}catch(u){console.log(u);break}const a=await o.blob();i.href=URL.createObjectURL(a);let s=this.activeCell.cells.raw,l=s?s.split(".")[1]:"";l||(l=e==="DRAW"||e==="IMAGE"?"jpg":"mp3"),i.setAttribute("download",`${e}.${l}`),document.body.appendChild(i),i.click(),document.body.removeChild(i);break}},restrictedItems(){let t=JSON.parse(JSON.stringify(this.tiles));return this.activeCell?(this.activeCell.type==="FORMULA"&&(delete t.edit,delete t.paste,delete t.clear),this.access!==2&&delete t.select_row,this.activeCell.type==="CHECKBOX"?(delete t.edit,delete t.copy,delete t.paste,delete t.search):this.activeCell.type==="PHONE"?t=Object.assign({call:{icon:"mdi-phone",title:this.$t("call")},sms:{icon:"mdi-message-text",title:this.$t("sms")},whatsapp:{icon:"mdi-whatsapp",title:this.$t("whatsapp")}},t):this.activeCell.type==="LINK"?(delete t.edit,delete t.paste):(this.activeCell.type==="IMAGE"||this.activeCell.type==="DRAW"||this.activeCell.type==="AUDIO")&&(delete t.copy,delete t.paste,this.activeCell.cells.display&&(t=Object.assign({view:{icon:"mdi-eye-arrow-right",title:this.$t("view")}},{download:{icon:"mdi-download",title:this.$t("download")}},t))),t):{}},...ve(ae,["selectRow","setRangeList","setFilterList","applyFilterVx","startLoading","clearSingleFilterVx","setPage","clearMediaCell"]),...ve(cn,["setActiveCell"]),renameColumn(){this.columnRenameModel=!0},cellClicked(t){const e=Ft().currentUser?.uid;if(!e)return;const n=this.activeCell.type,r=this.activeCell.rowKey,i=this.activeCell.columnKey;if(n==="FORMULA")return;let o=!1;const a=this.mainRows[r];if(!a){console.log("row undefined");return}const s=a.cells[i]?.display??"",l=a.cells[i]?.raw??"";if(o=this.columns[i]?.editor?.[e]??!1,this.access===2||this.isEditor&&o||this.isContributor&&a.users===e&&(o||s===""))if(n==="CHECKBOX"){const c=l=="true"?"false":"true";this.updateCell(this.activeCell,c)}else(n==="DRAW"||n==="IMAGE")&&s.length>0&&!t?this.showImage=!0:t||s!==""?this.drawer=!0:this.editCell=!0},cellEditClicked(){this.activeCell.type==="FORMULA"||this.activeCell.type==="CHECKBOX"||(this.drawer=!1,this.showImage=!1,this.editCell=!0)}},computed:{visibleRowKeys(){console.log("visible");const t=(this.page-1)*this.perPage,e=t+this.perPage;return this.sortedRowKeys.slice(t,e)}
22,...K(ae,["rowKeys","sortedRowKeys","search","filterList","rangeList","mainRows","page","perPage","getRowsLength","currentSortColumn","currentSortAscending"]),...K(Bt,["darkMode","cellWidth","tableUiVx"]),...K(Pe,["sortedColumnKeys","hiddenColumns","activeColumnHeader","columns"]),...K(cn,["activeCell"]),...K(ct,["access","uid","isEditor","isContributor"]),visibleColumnKeys(){return this.getVisibleColumnKeys()},columnSpecificData(){if(!this.activeColumnHeader)return[];const t=this.activeColumnHeader,e=this.columns[t]?.type??"STRING",n=this.filterQuery.toLowerCase();let r;this.rangeList[t]||this.filterList[t]?r=this.rowKeys.map(a=>{const s=this.mainRows[a]?.cells[t];return{display:s?.display??"",raw:s?.raw??""}}).filter(({display:a})=>a.toLowerCase().includes(n)):r=this.visibleRowKeys.map(a=>{const s=this.mainRows[a]?.cells[t],l=s?.raw??"",u=s?.display??"";return{display:u===""&&e==="CHECKBOX"?"false":u,raw:l===""&&e==="CHECKBOX"?"false":l}}).filter(({display:a})=>a.toLowerCase().includes(n));const i=[],o=new Set;for(const a of r){const s=a.display;o.has(s)||(i.push(a),o.add(s))}return i}},created(){setTimeout(()=>{let t=this.tableUiVx==="old"?"#head":".scroller";!document.querySelector(t)&&this.access!==-8&&this.startLoading()},1500)}}),b0={key:0,id:"head"},C0={class:"th text-center"},A0=["colspan"],E0={class:"imageActions"},S0={class:"text-h6 ml-5 text-center"},I0={class:"filterButton"};function T0(t,e,n,r,i,o){const a=j("v-th"),s=j("v-tr"),l=j("f-td"),u=j("edit-column"),c=j("edit-cell"),f=j("audio-player-component"),d=j("bottomSheet"),h=j("filterItem");return S(),B(Y,null,[g(Ii,{class:"wrapper",fluid:""},{default:v(()=>[t.currentSortColumn?(S(),P(mi,{key:0,class:Je(["sort-indicator",{dark:t.darkMode}]),closable:"","onClick:close":t.clearSort,color:"primary",variant:"elevated"},{default:v(()=>[g(H,{start:"",size:"small"},{default:v(()=>[A(T(t.currentSortAscending?"mdi-sort-ascending":"mdi-sort-descending"),1)]),_:1}),A(" "+T(t.$t("sorted_by"))+": "+T(t.columns[t.currentSortColumn]?.name??""),1)]),_:1},8,["class","onClick:close"])):U("",!0),V("table",null,[t.rowKeys.length?(S(),B("thead",b0,[V("tr",null,[V("th",{class:Je(["osr",{dark:t.darkMode}])},"Sr",2),(S(!0),B(Y,null,de(t.visibleColumnKeys,p=>(S(),P(a,{key:p,colKey:p,type:t.columns[p]?.type??"STRING",onRename:t.renameColumn,onMove:e[0]||(e[0]=m=>t.$emit("move")),onType:e[1]||(e[1]=m=>t.$emit("type")),onStyle:e[2]||(e[2]=m=>t.$emit("style")),onDelete:e[3]||(e[3]=m=>t.$emit("delete")),onFormula:e[4]||(e[4]=m=>t.$emit("formula")),onGraph:e[5]||(e[5]=m=>t.$emit("graph")),onFilter:e[6]||(e[6]=m=>t.filters=!0),onSelect:e[7]||(e[7]=m=>t.$emit("select"))},null,8,["colKey","type","onRename"]))),128))])])):U("",!0),V("tbody",{class:Je({dark:t.darkMode})},[(S(!0),B(Y,null,de(t.visibleRowKeys,p=>(S(),P(s,{key:p,row:t.mainRows[p],index:t.mainRows[p]?.index??0,"row-key":p,columnKeys:t.visibleColumnKeys,onCellClicked:t.cellClicked,onCellEditClicked:t.cellEditClicked},null,8,["row","index","row-key","columnKeys","onCellClicked","onCellEditClicked"]))),128))],2),t.visibleRowKeys.length>0?(S(),B("tfoot",{key:1,class:Je(["ofooter",{dark:t.darkMode}])},[V("tr",null,[V("th",C0,[g(H,null,{default:v(()=>e[26]||(e[26]=[A("mdi-sigma",-1)])),_:1,__:[26]})]),(S(!0),B(Y,null,de(t.visibleColumnKeys,p=>(S(),P(l,{key:p,"cell-key":p,onSum:t.changeSumType},{default:v(()=>[A(T(t.columns[p]?.name??""),1)]),_:2},1032,["cell-key","onSum"]))),128))]),V("tr",null,[V("th",{class:"th",onClick:e[8]||(e[8]=p=>t.addRow(1))},[g(H,null,{default:v(()=>e[27]||(e[27]=[A("mdi-plus",-1)])),_:1,__:[27]})]),V("th",{colspan:t.visibleColumnKeys.length},null,8,A0)])],2)):U("",!0)])]),_:1}),g(Q,{modelValue:t.columnRenameModel,"onUpdate:modelValue":e[10]||(e[10]=p=>t.columnRenameModel=p),width:"400"},{default:v(()=>[g(u,{columnKey:t.activeColumnHeader,tableKey:t.tableKey,onClose:e[9]||(e[9]=p=>t.columnRenameModel=!1)},null,8,["columnKey","tableKey"])]),_:1},8,["modelValue"]),g(Q,{modelValue:t.editCell,"onUpdate:modelValue":e[13]||(e[13]=p=>t.editCell=p),width:t.cellDialogExpanded?500:300,style:{maxWidth:"96vw"},scrollable:"",id:"myElement"},{default:v(()=>[g(c,{tableKey:t.tableKey,expanded:t.cellDialogExpanded,onToggleExpand:e[11]||(e[11]=p=>t.cellDialogExpanded=!t.cellDialogExpanded),onClose:e[12]||(e[12]=p=>t.editCell=!1),title:t.columns[t.activeCell.columnKey]?.name??""},null,8,["tableKey","expanded","title"])]),_:1}
22,8,["modelValue","width"]),g(Q,{fullscreen:!0,modelValue:t.showImage,"onUpdate:modelValue":e[16]||(e[16]=p=>t.showImage=p)},{default:v(()=>[g(ie,null,{default:v(()=>[g(D,{icon:"",flat:"",class:"A-top A-right absoluteButton",onClick:e[14]||(e[14]=p=>t.showImage=!1)},{default:v(()=>[g(H,null,{default:v(()=>e[28]||(e[28]=[A("mdi-close",-1)])),_:1,__:[28]})]),_:1}),g(yl,{height:"80vh",src:t.activeCell.cells.display,alt:"Fluid image",contain:""},null,8,["src"]),g(oe,null,{default:v(()=>[g(q),V("div",E0,[(S(!0),B(Y,null,de(t.restrictedItems(),(p,m)=>(S(),B(Y,{key:p.title},[m!=="view"?(S(),P(D,{key:0,onClick:y=>t.bottomSheetItemClicked(m)},{default:v(()=>[g(H,null,{default:v(()=>[A(T(p.icon),1)]),_:2},1024),A(T(m==="edit"?t.$t("edit_image"):m==="clear"?t.$t("clear_image"):p.title),1)]),_:2},1032,["onClick"])):U("",!0)],64))),128)),g(D,{onClick:e[15]||(e[15]=p=>t.showImage=!1)},{default:v(()=>[A(T(t.$t("close")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.showAudio,"onUpdate:modelValue":e[18]||(e[18]=p=>t.showAudio=p),title:t.getTitle(),width:"350"},{default:v(()=>[g(f,{url:t.activeCell.cells.display,onClose:e[17]||(e[17]=p=>t.showAudio=!1)},null,8,["url"])]),_:1},8,["modelValue","title"]),g(d,{modelValue:t.drawer,"onUpdate:modelValue":e[19]||(e[19]=p=>t.drawer=p),onClose:e[20]||(e[20]=p=>t.drawer=!1)},{default:v(()=>[V("div",S0,T(t.getTitle()),1),(S(!0),B(Y,null,de(t.restrictedItems(),(p,m)=>(S(),P(Qe,{key:p.title,onClick:y=>t.bottomSheetItemClicked(m)},{prepend:v(()=>[g(H,null,{default:v(()=>[A(T(p.icon),1)]),_:2},1024)]),default:v(()=>[g(gi,null,{default:v(()=>[A(T(p.title),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1},8,["modelValue"]),g(d,{modelValue:t.filters,"onUpdate:modelValue":e[24]||(e[24]=p=>t.filters=p),onClose:e[25]||(e[25]=p=>t.filters=!1)},{default:v(()=>[t.filters?(S(),P(ie,{key:0,height:"400",style:{position:"relative"}},{default:v(()=>[t.columns[t.activeColumnHeader]?.type==="INTEGER"?(S(),P(wt,{key:0,class:"mx-5 pt-2","no-gutters":""},{default:v(()=>[g(ge,null,{default:v(()=>[g(Ne,{type:"number",variant:"outlined","hide-details":"",label:t.$t("range_min"),max:Number.MAX_SAFE_INTEGER,modelValue:t.rangeMin,"onUpdate:modelValue":e[21]||(e[21]=p=>t.rangeMin=p),modelModifiers:{number:!0},dense:""},null,8,["label","max","modelValue"])]),_:1}),g(ge,null,{default:v(()=>[g(Ne,{type:"number",variant:"outlined","hide-details":"",label:t.$t("range_max"),max:Number.MAX_SAFE_INTEGER,modelValue:t.rangeMax,"onUpdate:modelValue":e[22]||(e[22]=p=>t.rangeMax=p),modelModifiers:{number:!0},dense:""},null,8,["label","max","modelValue"])]),_:1})]),_:1})):U("",!0),g(Ne,{placeholder:t.$t("search_filters"),"prepend-inner-icon":"mdi-magnify",variant:"outlined",modelValue:t.filterQuery,"onUpdate:modelValue":e[23]||(e[23]=p=>t.filterQuery=p),"hide-details":!0,class:"mx-5 pt-5",dense:""},null,8,["placeholder","modelValue"]),g(ue,null,{default:v(()=>[g(Vc,{items:t.columnSpecificData,height:"250","item-height":"48"},{default:v(({item:p})=>[g(h,{title:p.display,onSelect:m=>t.pushFilterItem(p?.display??""),"show-tick":t.selected[t.activeColumnHeader]&&t.selected[t.activeColumnHeader].includes(p.raw),style:ze({background:t.selected[t.activeColumnHeader]&&t.selected[t.activeColumnHeader].includes(p.raw)?"#E6F4E7":""})},null,8,["title","onSelect","show-tick","style"])]),_:1},8,["items"])]),_:1}),V("div",I0,[g(D,{icon:"",color:"white",class:"mr-5",onClick:t.clearSingleFilter,style:{background:"red"}},{default:v(()=>[g(H,null,{default:v(()=>e[29]||(e[29]=[A("mdi-delete",-1)])),_:1,__:[29]})]),_:1},8,["onClick"]),g(D,{rounded:"",color:"primary",onClick:t.applyFilter},{default:v(()=>[A(T(t.$t("apply"))+" ("+T(t.selected[t.activeColumnHeader]&&t.selected[t.activeColumnHeader].length)+")",1)]),_:1},8,["onClick"])])]),_:1})):U("",!0)]),_:1},8,["modelValue"])],64)}const O0=me(_0,[["render",T0],["__scopeId","data-v-64218119"]]),M0={name:"StyleCells",emits:{close:null,style:t=>!0,reset:null},props:{title:String,column:{type:Object,required:!1},rowMode:{type:Boolean,required:!0,default:!1}},data(){return{colors:Pl,recent:[],base:"",tab:"",cellText:"",cellBack:"",bold:!1,italic:!1,align:1,changes:{}}},mounted(){const t=localStorage.getItem("recent-style");t&&(this.recent=JSON.parse(t)||[])},methods:{applyStyle(t){this.changes.cellText=t.cellText,this.changes.cellBack=t.cellBack,this.changes.bold=t.bold,this.changes.italic=t.italic,this.changes.align=t.align},getAlign(t){return t===1?"left":t===2?"center":t===3?"right":"left"},clearCellStyles(){this.$emit("reset")},saveStyle(){let t=!1;if(Object.keys(this.changes).length===0)return;this.recent.forEach((n,r)=>{JSON.stringify(n)===JSON.stringify(this.changes)&&(t=!0,this.recent.splice(r,1))}),this.recent.length<3?t?this.recent.unshift(this.changes):this.recent.push(this.changes):(this.recent.pop(),this.recent.unshift(this.changes)),localStorage.setItem("recent-style",JSON.stringify(this.recent));let e={};e.bgColor=this.changes.cellBack,e.textColor=this.changes.cellText,e.bold=this.changes.bold,e.italic=this.changes.italic,this.rowMode||(e.alignment=this.changes.align),this.$emit("style",e)},emitColor(t){this.tab==="one"?t==="clear"?this.cellText="#000000":this.changes.cellText=t:this.tab==="two"&&(t==="clear"?this.cellBack="#DEDEDE":this.changes.cellBack=t)}}},Yo=Symbol.for("vuetify:v-tabs"),Zl=Qn({fixed:Boolean,sliderColor:String,sliderTransition:String,sliderTransitionDuration:[String,Number],hideSlider:Boolean,inset:Boolean,direction:{type:String,default:"horizontal"},...wl(Zu({selectedClass:"v-tab--selected",variant:"text"}),["active","block","flat","location","position","symbol"])},"VTab"),Un=qn()({name:"VTab",props:Zl(),setup(t,e){let{slots:n,attrs:r}=e;const{textColorClasses:i,textColorStyles:o}=ju(()=>t.sliderColor),{backgroundColorClasses:a,backgroundColorStyles:s}=xl(()=>t.sliderColor),l=vt(),u=vt(),c=it(()=>t.direction==="horizontal"),f=it(()=>l.value?.group?.isSelected.value??!1);function d(y,w){return{opacity:[0,1]}}function h(y,w){return t.direction==="vertical"?{transform:["scaleY(0)","scaleY(1)"]}:{transform:["scaleX(0)","scaleX(1)"]}}function p(y,w){const _=w.getBoundingClientRect(),C=y.getBoundingClientRect(),E=c.value?"x":"y",I=c.value?"X":"Y",O=c.value?"right":"bottom",x=c.value?"width":"height",R=_[E],N=C[E],F=R>N?_[O]-C[O]:_[E]-C[E],W=Math.sign(F)>0?c.value?"right":"bottom":Math.sign(F)<0?c.value?"left":"top":"center",Z=(Math.abs(F)+(Math.sign(F)<0?_[x]:C[x]))/M
22ath.max(_[x],C[x])||0,Ae=_[x]/C[x]||0,ee=1.5;return{transform:[`translate${I}(${F}px) scale${I}(${Ae})`,`translate${I}(${F/ee}px) scale${I}(${(Z-1)/ee+1})`,"none"],transformOrigin:Array(3).fill(W)}}function m(y){let{value:w}=y;if(w){const _=l.value?.$el.parentElement?.querySelector(".v-tab--selected .v-tab__slider"),C=u.value;if(!_||!C)return;const E=getComputedStyle(_).color,I={fade:d,grow:h,shift:p}[t.sliderTransition??"shift"]??p,O=Number(t.sliderTransitionDuration)||({fade:400,grow:350,shift:225}[t.sliderTransition??"shift"]??225);qu(C,{backgroundColor:[E,"currentcolor"],...I(C,_)},{duration:O,easing:Qu})}}return Jn(()=>{const y=D.filterProps(t);return g(D,It({symbol:Yo,ref:l,class:["v-tab",t.class,f.value&&t.inset?a.value:[]],style:[t.style,f.value&&t.inset?s.value:[]],tabindex:f.value?0:-1,role:"tab","aria-selected":String(f.value),active:!1},y,r,{block:t.fixed,maxWidth:t.fixed?300:void 0,"onGroup:selected":m}),{...n,default:()=>V(Y,null,[n.default?.()??t.text,!t.hideSlider&&V("div",{ref:u,class:Je(["v-tab__slider",i.value]),style:ze(o.value)},null)])})}),Yu({},l)}}),R0=t=>{const{touchstartX:e,touchendX:n,touchstartY:r,touchendY:i}=t,o=.5,a=16;t.offsetX=n-e,t.offsetY=i-r,Math.abs(t.offsetY)<o*Math.abs(t.offsetX)&&(t.left&&n<e-a&&t.left(t),t.right&&n>e+a&&t.right(t)),Math.abs(t.offsetX)<o*Math.abs(t.offsetY)&&(t.up&&i<r-a&&t.up(t),t.down&&i>r+a&&t.down(t))};function D0(t,e){const n=t.changedTouches[0];e.touchstartX=n.clientX,e.touchstartY=n.clientY,e.start?.({originalEvent:t,...e})}function k0(t,e){const n=t.changedTouches[0];e.touchendX=n.clientX,e.touchendY=n.clientY,e.end?.({originalEvent:t,...e}),R0(e)}function P0(t,e){const n=t.changedTouches[0];e.touchmoveX=n.clientX,e.touchmoveY=n.clientY,e.move?.({originalEvent:t,...e})}function N0(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e={touchstartX:0,touchstartY:0,touchendX:0,touchendY:0,touchmoveX:0,touchmoveY:0,offsetX:0,offsetY:0,left:t.left,right:t.right,up:t.up,down:t.down,start:t.start,move:t.move,end:t.end};return{touchstart:n=>D0(n,e),touchend:n=>k0(n,e),touchmove:n=>P0(n,e)}}function B0(t,e){const n=e.value,r=n?.parent?t.parentElement:t,i=n?.options??{passive:!0},o=e.instance?.$.uid;if(!r||o===void 0)return;const a=N0(e.value);r._touchHandlers=r._touchHandlers??Object.create(null),r._touchHandlers[o]=a,_l(a).forEach(s=>{r.addEventListener(s,a[s],i)})}function F0(t,e){const n=e.value?.parent?t.parentElement:t,r=e.instance?.$.uid;if(!n?._touchHandlers||r===void 0)return;const i=n._touchHandlers[r];_l(i).forEach(o=>{n.removeEventListener(o,i[o])}),delete n._touchHandlers[r]}const bo={mounted:B0,unmounted:F0},ql=Symbol.for("vuetify:v-window"),Ql=Symbol.for("vuetify:v-window-group"),Jl=Qn({continuous:Boolean,nextIcon:{type:[Boolean,String,Function,Object],default:"$next"},prevIcon:{type:[Boolean,String,Function,Object],default:"$prev"},reverse:Boolean,showArrows:{type:[Boolean,String],validator:t=>typeof t=="boolean"||t==="hover"},verticalArrows:[Boolean,String],touch:{type:[Object,Boolean],default:void 0},direction:{type:String,default:"horizontal"},modelValue:null,disabled:Boolean,selectedClass:{type:String,default:"v-window-item--active"},mandatory:{type:[Boolean,String],default:"force"},crossfade:Boolean,transitionDuration:Number,...Al(),...Cl(),...ac()},"VWindow"),Co=qn()({name:"VWindow",directives:{vTouch:bo},props:Jl(),emits:{"update:modelValue":t=>!0},setup(t,e){let{slots:n}=e;const{themeClasses:r}=Ju(t),{isRtl:i}=ec(),{t:o}=tc(),a=nc(t,Ql),s=vt(),l=it(()=>i.value?!t.reverse:t.reverse),u=so(!1),c=it(()=>{if(t.crossfade)return"v-window-crossfade-transition";const E=t.direction==="vertical"?"y":"x",O=(l.value?!u.value:u.value)?"-reverse":"";return`v-window-${E}${O}-transition`}),f=so(0),d=vt(void 0),h=it(()=>a.items.value.findIndex(E=>a.selected.value.includes(E.id)));rc(h,(E,I)=>{let O;const x={left:0,top:0};xa&&I>=0&&(O=ic(s.value),x.left=O?.scrollLeft,x.top=O?.scrollTop);const R=a.items.value.length,N=R-1;R<=2?u.value=E<I:E===N&&I===0?u.value=!1:E===0&&I===N?u.value=!0:u.value=E<I,bl(()=>{if(!xa||!O)return;O.scrollTop!==x.top&&O.scrollTo({...x,behavior:"instant"}),requestAnimationFrame(()=>{if(!O)return;O.scrollTop!==x.top&&O.scrollTo({...x,behavior:"instant"})})})},{flush:"sync"}),sc(ql,{transition:c,isReversed:u,transitionCount:f,transitionHeight:d,rootRef:s});const p=Et(()=>t.continuous||h.value!==0),m=Et(()=>t.continuous||h.value!==a.items.value.length-1);function y(){p.value&&a.prev()}function w(){m.value&&a.next()}const _=it(()=>{const E=[],I={icon:i.value?t.nextIcon:t.prevIcon,class:`v-window__${l.value?"right":"left"}`,onClick:a.prev,"aria-label":o("$vuetify.carousel.prev")};E.push(p.value?n.prev?n.prev({props:I}):g(D,I,null):V("div",null,null));const O={icon:i.value?t.prevIcon:t.nextIcon,class:`v-window__${l.value?"left":"right"}`,onClick:a.next,"aria-label":o("$vuetify.carousel.next")};return E.push(m.value?n.next?n.next({props:O}):g(D,O,null):V("div",null,null)),E}),C=it(()=>t.touch===!1?t.touch:{...{left:()=>{l.value?y():w()},right:()=>{l.value?w():y()},start:I=>{let{originalEvent:O}=I;O.stopPropagation()}},...t.touch===!0?{}:t.touch});return Jn(()=>Wn(g(t.tag,{ref:s,class:Je(["v-window",{"v-window--show-arrows-on-hover":t.showArrows==="hover","v-window--vertical-arrows":!!t.verticalArrows,"v-window--crossfade":!!t.crossfade},r.value,t.class]),style:ze([t.style,{"--v-window-transition-duration":oc()?null:Vn(t.transitionDuration,"ms")}])},{default:()=>[V("div",{class:"v-window__container",style:{height:d.value}},[n.default?.({group:a}),t.showArrows!==!1&&V("div",{class:Je(["v-window__controls",{"v-window__controls--left":t.verticalArrows==="left"||t.verticalArrows===!0},{"v-window__controls--right":t.verticalArrows==="right"}])},[_.value])]),n.additional?.({group:a})]}),[[bo,C.value]])),{group:a}}}),L0=Qn({...wl(Jl(),["continuous","nextIcon","prevIcon","showArrows","touch","mandatory"])},"VTabsWindow"),V0=qn()({name:"VTabsWindow",props:L0(),emits:{"update:modelValue":t=>!0},setup(t,e){let{slots:n}=e;const r=El(Yo,null),i=Sl(t,"modelValue"),o=it({get(){return i.value!=null||!r?i.value:r.
22items.value.find(a=>r.selected.value.includes(a.id))?.value},set(a){i.value=a}});return Jn(()=>{const a=Co.filterProps(t);return g(Co,It({_as:"VTabsWindow"},a,{modelValue:o.value,"onUpdate:modelValue":s=>o.value=s,class:["v-tabs-window",t.class],style:t.style,mandatory:!1,touch:!1}),n)}),{}}}),eu=Qn({reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},...Al(),...dc(),...fc()},"VWindowItem"),Ir=qn()({name:"VWindowItem",directives:{vTouch:bo},props:eu(),emits:{"group:selected":t=>!0},setup(t,e){let{slots:n}=e;const r=El(ql),i=lc(t,Ql),{isBooted:o}=Fc();if(!r||!i)throw new Error("[Vuetify] VWindowItem must be used inside VWindow");const a=so(!1),s=it(()=>o.value&&(r.isReversed.value?t.reverseTransition!==!1:t.transition!==!1));function l(){!a.value||!r||(a.value=!1,r.transitionCount.value>0&&(r.transitionCount.value-=1,r.transitionCount.value===0&&(r.transitionHeight.value=void 0)))}function u(){a.value||!r||(a.value=!0,r.transitionCount.value===0&&(r.transitionHeight.value=Vn(r.rootRef.value?.clientHeight)),r.transitionCount.value+=1)}function c(){l()}function f(p){a.value&&bl(()=>{!s.value||!a.value||!r||(r.transitionHeight.value=Vn(p.clientHeight))})}const d=it(()=>{const p=r.isReversed.value?t.reverseTransition:t.transition;return s.value?{name:typeof p!="string"?r.transition.value:p,onBeforeEnter:u,onAfterEnter:l,onEnterCancelled:c,onBeforeLeave:u,onAfterLeave:l,onLeaveCancelled:c,onEnter:f}:!1}),{hasContent:h}=uc(t,i.isSelected);return Jn(()=>g(cc,{transition:d.value,disabled:!o.value},{default:()=>[Wn(V("div",{class:Je(["v-window-item",i.selectedClass.value,t.class]),style:ze(t.style)},[h.value&&n.default?.()]),[[Rr,i.isSelected.value]])]})),{groupItem:i}}}),U0=Qn({...eu()},"VTabsWindowItem"),$0=qn()({name:"VTabsWindowItem",props:U0(),setup(t,e){let{slots:n}=e;return Jn(()=>{const r=Ir.filterProps(t);return g(Ir,It({_as:"VTabsWindowItem"},r,{class:["v-tabs-window-item",t.class],style:t.style}),n)}),{}}});function H0(t){return t?t.map(e=>yc(e)?e:{text:e,value:e}):[]}const W0=Qn({alignTabs:{type:String,default:"start"},color:String,fixedTabs:Boolean,items:{type:Array,default:()=>[]},stacked:Boolean,bgColor:String,grow:Boolean,height:{type:[Number,String],default:void 0},hideSlider:Boolean,inset:Boolean,insetPadding:[String,Number],insetRadius:[String,Number],sliderColor:String,...mc(Zl(),["spaced","sliderTransition","sliderTransitionDuration"]),...Lc({mandatory:"force",selectedClass:"v-tab-item--selected"}),...vc(),...Cl()},"VTabs"),tu=qn()({name:"VTabs",props:W0(),emits:{"update:modelValue":t=>!0},setup(t,e){let{attrs:n,slots:r}=e;const i=Sl(t,"modelValue"),o=it(()=>H0(t.items)),{densityClasses:a}=hc(t),{backgroundColorClasses:s,backgroundColorStyles:l}=xl(()=>t.bgColor),{scopeId:u}=pc();return gc({VTab:{color:Et(t,"color"),direction:Et(t,"direction"),stacked:Et(t,"stacked"),fixed:Et(t,"fixedTabs"),inset:Et(t,"inset"),sliderColor:Et(t,"sliderColor"),sliderTransition:Et(t,"sliderTransition"),sliderTransitionDuration:Et(t,"sliderTransitionDuration"),hideSlider:Et(t,"hideSlider")}}),Jn(()=>{const c=Aa.filterProps(t),f=!!(r.window||t.items.length>0);return V(Y,null,[g(Aa,It(c,{modelValue:i.value,"onUpdate:modelValue":d=>i.value=d,class:["v-tabs",`v-tabs--${t.direction}`,`v-tabs--align-tabs-${t.alignTabs}`,{"v-tabs--fixed-tabs":t.fixedTabs,"v-tabs--grow":t.grow,"v-tabs--inset":t.inset,"v-tabs--stacked":t.stacked},a.value,s.value,t.class],style:[{"--v-tabs-height":Vn(t.height),"--v-tabs-inset-padding":t.inset?Vn(t.insetPadding):void 0,"--v-tabs-inset-radius":t.inset?Vn(t.insetRadius):void 0},l.value,t.style],role:"tablist",symbol:Yo},u,n),{default:r.default??(()=>o.value.map(d=>r.tab?.({item:d})??g(Un,It(d,{key:d.text,value:d.value,spaced:t.spaced}),{default:r[`tab.${d.value}`]?()=>r[`tab.${d.value}`]?.({item:d}):void 0}))),prev:r.prev,next:r.next}),f&&g(V0,It({modelValue:i.value,"onUpdate:modelValue":d=>i.value=d,key:"tabs-window"},u),{default:()=>[o.value.map(d=>r.item?.({item:d})??g($0,{value:d.value},{default:()=>r[`item.${d.value}`]?.({item:d})})),r.window?.()]})])}),{}}}),z0=["onClick"],G0=["onClick"],K0={key:2,class:"text-caption ml-2 mb-1"},X0=["onClick"];function j0(t,e,n,r,i,o){return S(),P(ie,null,{default:v(()=>[g(Te,null,{default:v(()=>[A(T(n.title),1)]),_:1}),g(ue,null,{default:v(()=>[g(tu,{modelValue:i.tab,"onUpdate:modelValue":e[0]||(e[0]=a=>i.tab=a),class:"mb-5"},{default:v(()=>[g(Un,{value:"one"},{default:v(()=>e[8]||(e[8]=[A("Text",-1)])),_:1,__:[8]}),g(Un,{value:"two"},{default:v(()=>
22e[9]||(e[9]=[A("Background",-1)])),_:1,__:[9]})]),_:1},8,["modelValue"]),i.base?(S(),P(wt,{key:0,dense:"",justify:"center"},{default:v(()=>[g(ge,{cols:"auto"},{default:v(()=>[g(D,{icon:"",text:"",class:"filterPallete",onClick:e[1]||(e[1]=a=>i.base="")},{default:v(()=>[g(H,{color:"primary"},{default:v(()=>e[10]||(e[10]=[A("mdi-arrow-left",-1)])),_:1,__:[10]})]),_:1})]),_:1}),(S(!0),B(Y,null,de(i.colors[i.base],(a,s)=>(S(),P(ge,{key:s,cols:"auto"},{default:v(()=>[V("div",{class:"filterPallete",style:ze({background:a}),onClick:l=>o.emitColor(a)},null,12,z0)]),_:2},1024))),128))]),_:1})):(S(),P(wt,{key:1,dense:"",justify:"center"},{default:v(()=>[(S(!0),B(Y,null,de(i.colors,(a,s)=>(S(),P(ge,{key:s,cols:"auto"},{default:v(()=>[V("div",{class:"filterPallete",style:ze({background:a.base}),onClick:l=>i.base=s},null,12,G0)]),_:2},1024))),128))]),_:1})),i.recent.length>0?(S(),B("div",K0,T(t.$t("recently_used")),1)):U("",!0),(S(!0),B(Y,null,de(i.recent,(a,s)=>(S(),B("td",{onClick:l=>o.applyStyle(a),style:ze({color:a.cellText,backgroundColor:a.cellBack,textAlign:o.getAlign(a.align),fontWeight:a.bold?"bold":"normal",fontStyle:a.italic?"italic":"normal",padding:" 5px",border:"1px solid grey",margin:" 1rem 0",display:"inline-block",width:"100px",cursor:"pointer"})}," Sample "+T(s+1),13,X0))),256)),g(Ml,{class:"my-5"}),g(wt,{dense:""},{default:v(()=>[g(ge,{cols:"auto"},{default:v(()=>[g(D,{icon:"",class:"filterPallete",onClick:e[2]||(e[2]=a=>i.changes.bold=!i.changes.bold),active:i.changes.bold},{default:v(()=>[g(H,null,{default:v(()=>e[11]||(e[11]=[A("mdi-format-bold",-1)])),_:1,__:[11]})]),_:1},8,["active"])]),_:1}),g(ge,{cols:"auto"},{default:v(()=>[g(D,{icon:"",class:"filterPallete",onClick:e[3]||(e[3]=a=>i.changes.italic=!i.changes.italic),active:i.changes.italic},{default:v(()=>[g(H,null,{default:v(()=>e[12]||(e[12]=[A("mdi-format-italic",-1)])),_:1,__:[12]})]),_:1},8,["active"])]),_:1}),n.rowMode?U("",!0):(S(),P(ge,{key:0,cols:"auto"},{default:v(()=>[g(D,{icon:"",class:"filterPallete",onClick:e[4]||(e[4]=a=>i.changes.align=1),active:i.changes.align===1},{default:v(()=>[g(H,null,{default:v(()=>e[13]||(e[13]=[A("mdi-format-align-left",-1)])),_:1,__:[13]})]),_:1},8,["active"])]),_:1})),n.rowMode?U("",!0):(S(),P(ge,{key:1,cols:"auto"},{default:v(()=>[g(D,{icon:"",class:"filterPallete",onClick:e[5]||(e[5]=a=>i.changes.align=2),active:i.changes.align===2},{default:v(()=>[g(H,null,{default:v(()=>e[14]||(e[14]=[A("mdi-format-align-center",-1)])),_:1,__:[14]})]),_:1},8,["active"])]),_:1})),n.rowMode?U("",!0):(S(),P(ge,{key:2,cols:"auto"},{default:v(()=>[g(D,{icon:"",class:"filterPallete",onClick:e[6]||(e[6]=a=>i.changes.align=3),active:i.changes.align===3},{default:v(()=>[g(H,null,{default:v(()=>e[15]||(e[15]=[A("mdi-format-align-right",-1)])),_:1,__:[15]})]),_:1},8,["active"])]),_:1})),g(ge,{cols:"auto"},{default:v(()=>[g(D,{variant:"tonal",class:"filterPallete text-capitalize",onClick:o.clearCellStyles},{default:v(()=>[g(H,null,{default:v(()=>e[16]||(e[16]=[A("mdi-format-clear",-1)])),_:1,__:[16]}),A(" "+T(t.$t("clear")),1)]),_:1},8,["onClick"])]),_:1})]),_:1}),V("td",{style:ze({color:i.changes.cellText,backgroundColor:i.changes.cellBack,textAlign:o.getAlign(i.changes.align),fontWeight:i.changes.bold?"bold":"normal",fontStyle:i.changes.italic?"italic":"normal",padding:" 5px",border:"1px solid grey",margin:" 1rem 0",display:"inline-block",width:"100px"})}," Preview ",4)]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[7]||(e[7]=a=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1}),g(D,{color:"primary",onClick:o.saveStyle},{default:v(()=>[A(T(t.$t("submit")),1)]),_:1},8,["onClick"])]),_:1})]),_:1})}const Y0=me(M0,[["render",j0],["__scopeId","data-v-9947df1a"]]);function Z0(t){return new Worker("/assets/worker-BA2DDaxU.js",{type:"module",name:t?.name})}const Ao=20,Eo=10*Ao,So=1.5*Eo,Io=1.5*So,To=1.5*Io,Oo=1.5*To,q0=1.5*Oo,Q0={name:"ExportPdf",emits:["close"],data(){return{worker:null,allColKeys:[],headerData:["Sr"],alert:!1,makingPdf:!1,showLetterHead:!1,orientationItems:[this.$t("portrait"),this.$t("landscape")],formatItems:["A4","A3","A2","A1","A0"],header:"",pdfProgressColor:"primary",terms:"",letterHead:"",footer:"",columnStyles:{},status:0,imageColumn:[],orientation:this.$t("portrait"),format:"A4",page:"All",bodyData:[],pages:["All"]}},methods:{...ve(Pe,["getVisibleColumnKeys"]),terminatePdf(){this.worker?.terminate(),this.worker=null,this.status=0,this.pdfProgressColor="error",setTimeout(()=>{this.makingPdf=!1},200)},showProgress(){const t=100/this.sortedRowKeys.length;this.status+=t},getOrientation(t){t<Eo?this.orientation=this.$t("portrait"):t>Eo&&t<So?this.orientation=this.$t("landscape"):t>So&&t<Io?(this.orientation=this.$t("landscape"),this.format="A3"):t>Io&&t<To?(this.orientation=this.$t("landscape"),this.format="A2"):t>To&&t<Oo?(this.orientation=this.$t("landscape"),this.format="A1"):t>Oo&&t<q0?(this.orientation=this.$t("landscape"),this.format="A0"):(this.orientation=this.$t("landscape"),this.format="A1")},setColumns(){let t=1;
22this.getVisibleColumnKeys().forEach((n,r)=>{const i=this.columns[n];if(!i)return;const o={key:n,size:i.size,type:i.type,name:i.name};if(this.allColKeys.push(o),"name"in o){let{name:s}=o;this.headerData.push(s)}let a;switch(o.size?a=o.size*Ao:a=Ao,this.columnStyles[r+1]={cellWidth:a},t+=a,o.type){case"DRAW":case"IMAGE":this.imageColumn.push(r+1);break}}),this.getOrientation(t)},async setRows(){let t=this.allColKeys.map(r=>r.type==="INTEGER"||r.type==="FORMULA"||r.type==="AMOUNT"?0:"");t.unshift("Total");let e;if(this.selectedRows.length>0?e=this.sortedRowKeys.filter(r=>this.selectedRows.includes(r)):e=this.sortedRowKeys,this.page!=="All"){const r=(this.page-1)*this.perPage,i=r+this.perPage;e=this.sortedRowKeys.slice(r,i)}const n=[];for(const[r,i]of e.entries()){const o=this.mainRows[i];if(!o)continue;let a=[];a.push(""+(r+1));for(let[s,l]of this.allColKeys.entries()){let u=o.cells[l.key]?.display??"";if(l.type==="INTEGER"||l.type==="AMOUNT"||l.type==="FORMULA"){let c=o.cells[l.key]?.raw??"";t[s+1]+=c?parseFloat(c):0}else if(l.type==="IMAGE"||l.type==="DRAW"){const c=o.cells[l.key]?.path??"",f=o.cells[l.key]?.path??"";if(c.length>0&&f.length===0){const d=new Promise((h,p)=>{xc(Bo(Fo,`image/${c}`)).then(m=>{h({url:m,colIndex:s+1,rowIndex:r})}).catch(m=>{h({url:"",colIndex:s+1,rowIndex:r})})});n.push(d)}}else if(l.type==="SELECT"){let c=u.split(` 23`);c.length>1&&(u="",c.forEach(f=>{u+=`• ${f} 24`}))}u?a.push(u):a.push("")}this.bodyData.push(a)}return t=t.map((r,i)=>r&&Kt.getFormattedCellValueForNumbers(r,this.allColKeys?.[i-1]?.subType)),this.bodyData.push(t),n},async createPdf(){localStorage.setItem("header",this.header||""),localStorage.setItem("footer",this.footer||""),localStorage.setItem("letterHead",this.letterHead||""),localStorage.setItem("terms",this.terms||""),this.worker=new Z0;const t=JSON.parse(JSON.stringify(this.headerData)),e=JSON.parse(JSON.stringify(this.columnStyles)),n=JSON.parse(JSON.stringify(this.imageColumn)),r=JSON.parse(JSON.stringify(this.bodyData));this.worker.postMessage({event:"pdf",data:{title:this.tableName,orientation:this.orientation,format:this.format,columnStyles:e,bodyData:r,headerData:t,imageColumn:n,header:this.header,footer:this.showLetterHead?this.footer:"",letterHead:this.showLetterHead?this.letterHead:"",terms:this.showLetterHead?this.terms:""}}),this.worker.onmessage=i=>{i.data.event==="pdf"?(this.status=100,this.pdfProgressColor="success",setTimeout(()=>{this.status=0,window.open(i.data.data);const o=document.createElement("a");o.href=i.data.data,o.download=`${this.tableName}.pdf`,o.click(),this.makingPdf=!1,this.$emit("close")},500)):i.data.event==="count"&&this.showProgress()},this.alert=!1},async exportpdf(){this.pdfProgressColor="primary",this.makingPdf=!0,this.setColumns();const t=await this.setRows();Promise.all(t).then(e=>{e.forEach(n=>{this.bodyData[n.rowIndex][n.colIndex]=n.url??""}),this.createPdf()})}},mounted(){const t=Math.ceil(this.sortedRowKeys.length/this.perPage);for(let e=0;e<t;e++)this.pages.push(e+1)},computed:{...K(Pe,["columns","hiddenColumns"]),...K(ct,["tableName"]),...K(ae,["mainRows","sortedRowKeys","selectedRows","perPage"]),selectedRowsLength(){return this.selectedRows.length}}},J0={key:0},ep={style:{"font-size":"30px"}};function tp(t,e,n,r,i,o){return i.makingPdf?(S(),B("div",J0,[g(Te,{class:"text-center text-white"},{default:v(()=>[A(T(t.$t("pdf_generate"))+"...",1)]),_:1}),g(ue,{class:"text-center feather-effect pa-0"},{default:v(()=>[g(Lo,{rotate:360,size:200,width:25,"model-value":i.status,color:i.pdfProgressColor},{default:v(()=>[V("span",ep,T(Math.floor(i.status))+"%",1)]),_:1},8,["model-value","color"])]),_:1}),g(oe,{style:ze({visibility:i.worker?"visible":"hidden"})},{default:v(()=>[g(q),g(D,{color:"white",onClick:o.terminatePdf},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1},8,["onClick"]),g(q)]),_:1}
24,8,["style"])])):(S(),P(ie,{key:1},{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("export_as_pdf"))+" - "+T(t.tableName),1)]),_:1}),g(ue,null,{default:v(()=>[g($o,{modelValue:i.alert,"onUpdate:modelValue":e[0]||(e[0]=a=>i.alert=a),density:"compact",variant:"outlined",type:"error",closable:""},{default:v(()=>[A(T(t.$t("pdf_alert")),1)]),_:1},8,["modelValue"]),g($i,{class:"mt-5",items:i.pages,label:t.$t("pages"),modelValue:i.page,"onUpdate:modelValue":e[1]||(e[1]=a=>i.page=a),variant:"outlined"},null,8,["items","label","modelValue"]),g(Nl,{modelValue:i.showLetterHead,"onUpdate:modelValue":e[2]||(e[2]=a=>i.showLetterHead=a),color:"primary",label:t.$t("show_letterHead")},null,8,["modelValue","label"]),g(vi,{modelValue:i.header,"onUpdate:modelValue":e[3]||(e[3]=a=>i.header=a),"auto-grow":"","max-rows":"3",variant:"outlined",rows:"1",label:"To",clearable:""},null,8,["modelValue"]),i.showLetterHead?(S(),P(Ne,{key:0,modelValue:i.letterHead,"onUpdate:modelValue":e[4]||(e[4]=a=>i.letterHead=a),variant:"outlined",label:t.$t("letterHead"),clearable:""},null,8,["modelValue","label"])):U("",!0),i.showLetterHead?(S(),P(Ne,{key:1,modelValue:i.footer,"onUpdate:modelValue":e[5]||(e[5]=a=>i.footer=a),variant:"outlined",label:t.$t("footer"),clearable:""},null,8,["modelValue","label"])):U("",!0),i.showLetterHead?(S(),P(vi,{key:2,rows:"1","auto-grow":"","max-rows":"3",class:"hide-scrollbar",modelValue:i.terms,"onUpdate:modelValue":e[6]||(e[6]=a=>i.terms=a),variant:"outlined",label:t.$t("terms"),clearable:""},null,8,["modelValue","label"])):U("",!0),g(wt,null,{default:v(()=>[g(ge,{cols:"12",sm:"6"},{default:v(()=>[g($i,{value:i.orientation,items:i.orientationItems,label:t.$t("oreintation"),variant:"outlined",solo:"",modelValue:i.orientation,"onUpdate:modelValue":[e[7]||(e[7]=a=>i.orientation=a),e[8]||(e[8]=a=>i.alert=!0)]},null,8,["value","items","label","modelValue"])]),_:1}),g(ge,{class:"d-flex",cols:"12",sm:"6"},{default:v(()=>[g($i,{value:i.format,items:i.formatItems,label:t.$t("format"),variant:"outlined","onUpdate:modelValue":[e[9]||(e[9]=a=>i.alert=!0),e[10]||(e[10]=a=>i.format=a)],solo:"",modelValue:i.format},null,8,["value","items","label","modelValue"])]),_:1})]),_:1})]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[11]||(e[11]=a=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("close")),1)]),_:1}),g(D,{onClick:o.exportpdf},{default:v(()=>[A(T(t.$t("create")),1)]),_:1},8,["onClick"])]),_:1})]),_:1}))}const np=me(Q0,[["render",tp],["__scopeId","data-v-53e80c46"]]),rp={props:["tableKey"],emits:["close"],computed:{...K(ct,["public"])},data(){return{text:"",snackbar:!1,loading:!1,isPublic:null,link:`https://tablenotes.net/public/${this.tableKey}`}},methods:{...ve(ct,["setIsPublic"]),Clipboard(){window.navigator.clipboard.writeText(this.link).then(()=>{this.snackbar=!0,this.text=this.$t("copied_clipboard")})},closeAlert(){this.alert=!1,this.$emit("close")},async publishWebsite(t){this.loading=!0,this.snackbar=!1;const e=localStorage.getItem("language"),n=localStorage.getItem("currency"),r=Il(Tl,"makeTablePublicNew"),i={tableKey:this.tableKey,isPublic:t,language:e,currency:n,dateFormat:"mm-dd-yyyy",timeFormat:"hh:mm",separatorGroup:","};r(i).then(o=>{this.snackbar=!0,this.text=t?this.$t("website_published"):this.$t("website_disabled"),this.isPublic=o.data.isPublic,this.loading=!1,this.setIsPublic(t)}).catch(o=>{o.code,o.message,o.details,this.loading=!1})}},mounted(){this.isPublic=this.public}},ip=["href"],op={class:"ml-2"};function ap(t,e,n,r,i,o){return S(),B("div",null,[i.isPublic?(S(),P(ie,{key:0,"max-width":"300",loading:i.loading},{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("publish_website")),1)]),_:1}),g(kr,null,{default:v(()=>[A(T(t.$t("publish_website_question")),1)]),_:1}),g(ue,null,{default:v(()=>[V("a",{href:i.link},T(i.link),9,ip),V("span",null,[e[6]||(e[6]=A("  ",-1)),g(D,{class:"mb-5",icon:"",onClick:o.Clipboard},{default:v(()=>[g(H,null,{default:v(()=>e[5]||(e[5]=[A("mdi-content-copy",-1)])),_:1,__:[5]})]),_:1},8,["onClick"])])]),_:1}),g(oe,null,{default:v(()=>[g(D,{onClick:e[0]||(e[0]=a=>o.publishWebsite(!1)),loading:i.loading},{default:v(()=>[A(T(t.$t("disable_link")),1)]),_:1},8,["loading"]),g(D,{onClick:e[1]||(e[1]=a=>o.closeAlert())},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1})]),_:1})]),_:1},8,["loading"])):(S(),P(ie,{key:1,"max-width":"300",loading:i.loading},{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("publish_website")),1)]),_:1}),g(kr,null,{default:v(()=>[A(T(t.$t("publish_website_suggestion")),1)]),_:1}),V("div",op,[g(oe,null,{default:v(()=>[g(D,{onClick:e[2]||(e[2]=a=>o.publishWebsite(!0)),loading:i.loading},{default:v(()=>[A(T(t.$t("make_public")),1)]),_:1},8,["loading"]),g(D,{onClick:e[3]||(e[3]=a=>o.closeAlert())},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1})]),_:1})])]),_:1},8,["loading"])),g(Vo,{modelValue:i.snackbar,"onUpdate:modelValue":e[4]||(e[4]=a=>i.snackbar=a),color:"#383838",tile:"",rounded:"",timeout:"2000"},{default:v(()=>[A(T(i.text),1)]),_:1},8,["modelValue"])])}const sp=me(rp,[["render",ap]]),lp={name:"RowMove",emits:["close"],data(){return{rowNumber:1}},methods:{...ve(ae,["updateRowOrder"]),moveRow(t){t<1||t>this.getRowsLength||this.updateRowOrder(t)}},computed:{...K(ae,["selectedRows","mainRows","rowKeys","getRowsLength"])}};function up(t,e,n,r,i,o){return S(),P(ie,null,{default:v(()=>[g(ue,null,{default:v(()=>[g(Ne,{type:"number",modelValue:i.rowNumber,"onUpdate:modelValue":e[0]||(e[0]=a=>i.rowNumber=a),min:"1",max:t.rowKeys.length},null,8,["modelValue","max"])]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{color:"error",onClick:e[1]||(e[1]=a=>o.moveRow(1))},{default:v(()=>[A(T(t.$t("move_top")),1)]),_:1}),g(D,{onClick:e[2]||(e[2]=a=>o.moveRow(t.rowKeys.length))},{default:v(()=>[A(T(t.$t("move_bottom")),1)]),_:1}),g(D,{color:"primary",onClick:e[3]||(e[3]=a=>o.moveRow(i.rowNumber))},{default:v(()=>[A(T(t.$t("move_position",{position:i.rowNumber})),1)]),_:1})]),_:1})]),_:1})}const cp=me(lp,[["render",up]]),fp=Zn({name:"export-rows-component",emits:["close","ok"],props:{currentTableKey:{required:!0,type:String}},data(){return{filter:"",valid:!0,tableNode:[],tagNode:{},loading:!1,activeTableKey:"",alert:!1,newTable:!1,newTableName:""}},computed:{...K(ae,["selectedRows","mainRows","sortedRowKeys","tableKey"]),...K(Pe,["columns","sortedColumnKeys"]),sourceColumns(){return this.sortedColumnKeys.map(t=>{const e=this.columns[t];return{key:t,...e}})}},methods:{...ve(ae,["addExportedRows","clearSelectedRows"]),openTable(){this.$router.push({path:`/table/${this.activeTableKey}`,replace:!0})},async exportToNewTable(){await this.$refs.newTable.validate();const t=Ft().currentUser?.uid;if(!this.valid||!t)return;this.alert=!1,this.loading=!0;let e={};const n=Er(He(We,"tables")).key;if(!n)return;const r=[];this.sourceColumns.forEach(i=>
24{const o=Er(He(We,`tables/${n}/columns`)).key;o&&(r.push(o),e[`tables/${n}/columns/${o}`]=Object.fromEntries(Object.entries(i).filter(([a,s])=>s!==void 0)),delete e[`tables/${n}/columns/${o}`]?.key,delete e[`tables/${n}/columns/${o}`]?.order)}),e[`tables/${n}/name`]=this.newTableName,e[`tables/${n}/users`]={[t]:2},e[`tables/${n}/columnorder`]=r,e[`users/${t}/tables/${n}`]={access:2,name:this.newTableName,recent:Date.now()},await Dr(He(We),e).then(i=>{this.exportRows(n)}).catch(i=>{console.log(i)})},async exportRows(t){this.alert=!1,this.loading=!0;let e={};const n=Ft().currentUser?.uid,r=new Set;if(!n)return;this.activeTableKey=t;let i=[];Sr(_c(He(We),`tables/${t}`)).then(async o=>{let a=o.child("columns").val();const s=t===this.tableKey;o.child("columnorder").forEach(c=>{i.push(c.val())}),o.child("columns").forEach(c=>{i.includes(c.key)||i.push(c.key)});let l=this.sortedRowKeys.filter(c=>this.selectedRows.includes(c)),u=[];if(l.forEach(c=>{const f=this.mainRows[c];let d={users:n,values:{}};const h=i.length<this.sourceColumns.length?i.length:this.sourceColumns.length;let p=0;for(let y=0;y<h;y++){const w=i[y];if(!w)continue;let _=this.sourceColumns[y-p],C=a[w];if(!C||!_){p++;continue}if((_&&_.type==="IMAGE"||_.type==="DRAW"||_.type==="AUDIO")&&C.type===_.type){const E=f?.cells[_.key];if(E?.display){const I=E.path??"",O=I.split("/"),x=O[O.length-1];s?d.values[w]={path:I,image:x??""}:(d.values[w]={path:`${t}/${x}`,image:x??""},r.add(I))}}else _&&f&&f.cells[_.key]?.raw&&_.type!=="IMAGE"&&_.type!=="DRAW"&&_.type!=="AUDIO"&&C.type!=="IMAGE"&&C.type!=="DRAW"&&C.type!=="AUDIO"&&(d.values[w]={values:String(f.cells[_.key]?.raw)})}let m=Er(He(We,`rows/${t}`)).key;m&&(u.push(m),e[`rows/${t}/${m}`]=d)}),!s&&r.size>0){const c=Il(Tl,"copyImages"),f={destinationTableKey:t,imagePaths:[...r]};c(f).then(d=>{console.log(d)})}Dr(He(We),e).then(c=>{this.currentTableKey===t?this.addExportedRows(u):localStorage.removeItem(`${t}-recent`),this.$emit("ok",c)}),this.alert=!0,this.loading=!1,this.clearSelectedRows()})}},created(){const t=Ft().currentUser?.uid;t&&(this.$databaseBind("tableNode",wa(He(We,`users/${t}/tables`),_a("access"),wc(2))),this.$databaseBind("tagNode",wa(He(We,`users/${t}/tags`),_a("order"))))}}),dp={class:"text-center"},hp=["onClick"];function pp(t,e,n,r,i,o){return t.alert?(S(),P(ie,{key:0},{default:v(()=>[g($o,{modelValue:t.alert,"onUpdate:modelValue":e[1]||(e[1]=a=>t.alert=a),dense:"",variant:"text",type:"success",class:"ma-5"},{default:v(()=>[V("a",{onClick:e[0]||(e[0]=(...a)=>t.openTable&&t.openTable(...a)),class:"primary--text",style:{cursor:"pointer"}},T(t.$t("row_export_alert")),1)]),_:1},8,["modelValue"]),g(oe,null,{default:v(()=>[g(q),g(D,{color:"primary",text:"",onClick:e[2]||(e[2]=a=>t.$emit("close")),loading:t.loading,disabled:t.loading},{default:v(()=>[A(T(t.$t("close")),1)]),_:1},8,["loading","disabled"])]),_:1})]),_:1})):(S(),P(ie,{key:1,loading:t.loading},{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("export_rows_msg")),1)]),_:1}),t.newTable?U("",!0):(S(),P(Ne,{key:0,modelValue:t.filter,"onUpdate:modelValue":e[3]||(e[3]=a=>t.filter=a),solo:"","hide-details":"",type:"search",placeholder:t.$t("type_to_search"),class:"mx-5"},null,8,["modelValue","placeholder"])),t.newTable?(S(),P(ue,{key:1,style:{height:"300px"}},{default:v(()=>[g(D,{icon:"",variant:"flat",onClick:e[4]||(e[4]=a=>t.newTable=!1)},{default:v(()=>[g(H,null,{default:v(()=>e[9]||(e[9]=[A("mdi-arrow-left",-1)])),_:1,__:[9]})]),_:1}),g(Uo,{ref:"newTable",modelValue:t.valid,"onUpdate:modelValue":e[6]||(e[6]=a=>t.valid=a),onSubmit:Ue(t.exportToNewTable,["prevent","stop"])},{default:v(()=>[g(Ne,{label:t.$t("enter_table_name"),modelValue:t.newTableName,"onUpdate:modelValue":e[5]||(e[5]=a=>t.newTableName=a),modelModifiers:{trim:!0},rules:[a=>!!a||"Name is required"]},null,8,["label","modelValue","rules"]),V("div",dp,[g(D,{color:"primary",class:"text-capitalize",onClick:t.exportToNewTable},{default:v(()=>[A(T(t.$t("export_to")+" "+t.newTableName),1)]),_:1},8,["onClick"])])]),_:1},8,["modelValue","onSubmit"])]),_:1})):(S(),P(ue,{key:2,style:{height:"300px"}},{default:v(()=>[(S(!0),B(Y,null,de(t.tableNode,a=>(S(),B("div",{key:a.id},[t.filter===""||a.name.toLocaleLowerCase().includes(t.filter.toLocaleLowerCase())?(S(),B("div",{key:0,onClick:s=>t.exportRows(a.id),class:"tableList"},T(a.name),9,hp)):U("",!0)]))),128))]),_:1})),t.newTable?U("",!0):(S(),P(D,{key:3,class:"text-capitalize ma-5",color:"primary",onClick:e[7]||(e[7]=a=>t.newTable=!0)},{default:v(()=>[A(T(t.$t("create_new_table")),1)]),_:1})),g(oe,null,{default:v(()=>[g(q),g(D,{color:"primary",text:"",onClick:e[8]||(e[8]=a=>t.$emit("close")),loading:t.loading,disabled:t.loading},{default:v(()=>e[10]||(e[10]=[A("close",-1)])),_:1,__:[10]},8,["loading","disabled"])]),_:1})]),_:1},8,["loading"]))}const gp=me(fp,[["render",pp],["__scopeId","data-v-efa69aac"]]),vp={name:"AddRowModel",emits:["close","openPremium"],data(){return{rowNumber:1}},computed:{...K(ae,["rowKeys"]),...K(Bt,["isPremium"]),...K(ct,["isTablePremium","tablePremiumTier"])},methods:{...ve(ae,["addRow"]),...ve(ct,["setPaywallMessage"]),addRows(){const t=this.rowKeys.length+Number(this.rowNumber);if(en.canAccessFeature(mr.ADD_ROWS,this.isTablePremium,this.tablePremiumTier,t))this.addRow(this.rowNumber),this.$emit("close");else{const e=en.getRowLimitMessage(this.tablePremiumTier);this.setPaywallMessage(e),this.$emit("openPremium");return}}}};function mp(t,e,n,r,i,o){return S(),P(ie,null,{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("add_row_title")),1)]),_:1}),g(ue,null,{default:v(()=>[g(Ne,{min:"1",max:"99",type:"number",modelValue:i.rowNumber,"onUpdate:modelValue":e[0]||(e[0]=a=>i.rowNumber=a),variant:"outlined",rules:[a=>!!a||t.$t("required"),a=>a>=1&&a<=100||t.$t("max_row")]},null,8,["modelValue","rules"])]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[1]||(e[1]=a=>t.$emit("close")),text:"",color:"primary"},{default:v(()=>[A(T(t.$t("close")),1)]),_:1}),g(D,{color:"primary",onClick:o.addRows,disabled:i.rowNumber<1||i.rowNumber>99},{default:v(()=>[A(T(t.$t("add")),1)]),_:1},8,["onClick","disabled"])]),_:1})]),_:1})}const yp=me(vp,[["render",mp]]),xp={name:"AddColumnModel",emits:["close","openPremium"],data(){return{columnNumber:1}},computed:{...K(Pe,["sortedColumnKeys"]),...K(Bt,[])},methods:{...ve(Pe,["addColumn"]),addColumns(){if(this.sortedColumnKeys.length+Number(this.columnNumber)>=15&&!en.hasUserPremium){this.$emit("openPremium");return}this.addColumn({postfix:this.$t("column"),columnNumber:this.columnNumber}),this.$emit("close")}}};function wp(t,e,n,r,i,o){return S(),P(ie,null,{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("add_column_title")),1)]),_:1}),g(ue,null,{default:v(()=>[g(Ne,{min:"1",max:"9",type:"number",modelValue:i.columnNumber,"onUpdate:modelValue":e[0]||(e[0]=a=>i.columnNumber=a),rules:[a=>!!a||t.$t("required"),a=>a>=1&&a<=9||t.$t("max_column")],variant:"outlined"},null,8,["modelValue","rules"])]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[1]||(e[1]=a=>t.$emit("close")),text:"",color:"primary"},{default:v(()=>[A(T(t.$t("close")),1)]),_:1}),g(D,{color:"primary",onClick:o.addColumns,disabled:i.columnNumber<1||i.columnNumber>9},{default:v(()=>[A(T(t.$t("add")),1)]),_:1},8,["onClick","disabled"])]),_:1})]),_:1})}const _p=me(xp,[["render",wp]]);var mt="INUMBER",tr="IOP1",nr="IOP2",rr="IOP3",Xt="IVAR",In="IVARNAME",Gn="IFUNCALL",Ri="IFUNDEF",dt="IEXPR",Zo="IEXPREVAL",On="IMEMBER",Di="IENDSTATEMENT",Kn="IARRAY";function ne(t,e){this.type=t,this.value=e??0}ne.prototype.toString=function(){switch(this.type){case mt:case tr:case nr:case rr:case Xt:case In:case Di:return this.value;case Gn:return"CALL "+this.value;case Ri:return"DEF "+this.value;case Kn:return"ARRAY "+this.value;case On:return"."+this.value;default:return"Invalid Instruction"}};function ki(t){return new ne(tr,t)}function Yt(t){return new ne(nr,t)}function nu(t){return new ne(rr,t)}function Mo(t,e,n,r,i){for(var o=[],a=[],s,l,u,c,f=0;f<t.length;f++){var d=t[f],h=d.type;if(h===mt||h===In)Array.isArray(d.value)?o.push.apply(o,Mo(d.value.map(function(p){return new ne(mt,p)}).concat(new ne(Kn,d.value.length)),e,n,r,i)):o.push(d);else if(h===Xt&&i.hasOwnProperty(d.value))d=new ne(mt,i[d.value]),o.push(d);else if(h===nr&&o.length>1)l=o.pop(),s=o.pop(),c=n[d.value],d=new ne(mt,c(s.value,l.value)),o.push(d);else if(h===rr&&o.length>2)u=o.pop(),l=o.pop(),s=o.pop(),d.value==="?"?o.push(s.value?l.value:u.value):(c=r[d.value],d=new ne(mt,c(s.value,l.value,u.value)),o.push(d));else if(h===tr&&o.length>0)s=o.pop(),c=e[d.value],d=new ne(mt,c(s.value)),o.push(d);else if(h===dt){for(;o.length>0;)a.push(o.shift());a.push(new ne(dt,Mo(d.value,e,n,r,i)))}else if(h===On&&o.length>0)s=o.pop(),o.push(new ne(mt,s.value[d.value]));else{for(;o.length>0;)a.push(o.shift());a.push(d)}}for(;o.length>0;)a.push(o.shift());return a}function ru(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=t[i],a=o.type;if(a===Xt&&o.value===e)for(var s=0;s<n.tokens.length;s++){var l=n.tokens[s],u;l.type===tr?u=ki(l.value):l.type===nr?u=Yt(l.value):l.type===rr?u=nu(l.value):u=new ne(l.type,l.value),r.push(u)}else a===dt?r.push(new ne(dt,ru(o.value,e,n))):r.push(o)}return r}function bn(t,e,n){var r=[],i,o,a,s,l,u;if(qo(t))return $t(t,n);for(var c=t.length,f=0;f<c;f++){var d=t[f],h=d.type;if(h===mt||h===In)r.push(d.value);else if(h===nr)o=r.pop(),i=r.pop(),d.value==="and"?r.push(i?!!bn(o,e,n):!1):d.value==="or"?r.push(i?!0:!!bn(o,e,n)):d.value==="="?(s=e.binaryOps[d.value],r.push(s(i,bn(o,e,n),n))):(s=e.binaryOps[d.value],r.push(s($t(i,n),$t(o,n))));else if(h===rr)a=r.pop(),o=r.pop(),i=r.pop(),d.value==="?"?r.push(bn(i?o:a,e,n)):(s=e.ternaryOps[d.value],r.push(s($t(i,n),$t(o,n),$t(a,n))));else if(h===Xt)if(d.value in e.functions)r.push(e.functions[d.value]);else if(d.value in e.unaryOps&&e.parser.isOperatorEnabled(d.value))r.push(e.unaryOps[d.value]);else{var p=n[d.value];if(p!==void 0)r.push(p);else throw new Error("undefined variable: "+d.value)}else if(h===tr)i=r.pop(),s=e.unaryOps[d.value],r.push(s($t(i,n)));else if(h===Gn){for(u=d.value,l=[];u-- >0;)l.unshift($t(r.pop(),n));if(s=r.pop(),s.apply&&s.call)r.push(s.apply(void 0,l));else throw new Error(s+" is not a function")}else if(h===Ri)r.push((function(){for(var m=r.pop(),y=[],w=d.value;w-- >0;)y.unshift(r.pop());var _=r.pop(),C=function(){for(var E=Object.assign({},n),I=0,O=y.length;I<O;I++)E[y[I]]=arguments[I];
24return bn(m,e,E)};return Object.defineProperty(C,"name",{value:_,writable:!1}),n[_]=C,C})());else if(h===dt)r.push(bp(d,e));else if(h===Zo)r.push(d);else if(h===On)i=r.pop(),r.push(i[d.value]);else if(h===Di)r.pop();else if(h===Kn){for(u=d.value,l=[];u-- >0;)l.unshift(r.pop());r.push(l)}else throw new Error("invalid Expression")}if(r.length>1)throw new Error("invalid Expression (parity)");return r[0]===0?0:$t(r[0],n)}function bp(t,e,n){return qo(t)?t:{type:Zo,value:function(r){return bn(t.value,e,r)}}}function qo(t){return t&&t.type===Zo}function $t(t,e){return qo(t)?t.value(e):t}function Qo(t,e){for(var n=[],r,i,o,a,s,l,u=0;u<t.length;u++){var c=t[u],f=c.type;if(f===mt)typeof c.value=="number"&&c.value<0?n.push("("+c.value+")"):Array.isArray(c.value)?n.push("["+c.value.map(es).join(", ")+"]"):n.push(es(c.value));else if(f===nr)i=n.pop(),r=n.pop(),a=c.value,e?a==="^"?n.push("Math.pow("+r+", "+i+")"):a==="and"?n.push("(!!"+r+" && !!"+i+")"):a==="or"?n.push("(!!"+r+" || !!"+i+")"):a==="||"?n.push("(function(a,b){ return Array.isArray(a) && Array.isArray(b) ? a.concat(b) : String(a) + String(b); }(("+r+"),("+i+")))"):a==="=="?n.push("("+r+" === "+i+")"):a==="!="?n.push("("+r+" !== "+i+")"):a==="["?n.push(r+"[("+i+") | 0]"):n.push("("+r+" "+a+" "+i+")"):a==="["?n.push(r+"["+i+"]"):n.push("("+r+" "+a+" "+i+")");else if(f===rr)if(o=n.pop(),i=n.pop(),r=n.pop(),a=c.value,a==="?")n.push("("+r+" ? "+i+" : "+o+")");else throw new Error("invalid Expression");else if(f===Xt||f===In)n.push(c.value);else if(f===tr)r=n.pop(),a=c.value,a==="-"||a==="+"?n.push("("+a+r+")"):e?a==="not"?n.push("(!"+r+")"):a==="!"?n.push("fac("+r+")"):n.push(a+"("+r+")"):a==="!"?n.push("("+r+"!)"):n.push("("+a+" "+r+")");else if(f===Gn){for(l=c.value,s=[];l-- >0;)s.unshift(n.pop());a=n.pop(),n.push(a+"("+s.join(", ")+")")}else if(f===Ri){for(i=n.pop(),l=c.value,s=[];l-- >0;)s.unshift(n.pop());r=n.pop(),e?n.push("("+r+" = function("+s.join(", ")+") { return "+i+" })"):n.push("("+r+"("+s.join(", ")+") = "+i+")")}else if(f===On)r=n.pop(),n.push(r+"."+c.value);else if(f===Kn){for(l=c.value,s=[];l-- >0;)s.unshift(n.pop());n.push("["+s.join(", ")+"]")}else if(f===dt)n.push("("+Qo(c.value,e)+")");else if(f!==Di)throw new Error("invalid Expression")}return n.length>1&&(e?n=[n.join(",")]:n=[n.join(";")]),String(n[0])}function es(t){return typeof t=="string"?JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"):t}function Fn(t,e){for(var n=0;n<t.length;n++)if(t[n]===e)return!0;return!1}function Jo(t,e,n){n=n||{};for(var r=!!n.withMembers,i=null,o=0;o<t.length;o++){var a=t[o];a.type===Xt||a.type===In?!r&&!Fn(e,a.value)?e.push(a.value):(i!==null&&(Fn(e,i)||e.push(i)),i=a.value):a.type===On&&r&&i!==null?i+="."+a.value:a.type===dt?Jo(a.value,e,n):i!==null&&(Fn(e,i)||e.push(i),i=null)}i!==null&&!Fn(e,i)&&e.push(i)}function Mt(t,e){this.tokens=t,this.parser=e,this.unaryOps=e.unaryOps,this.binaryOps=e.binaryOps,this.ternaryOps=e.ternaryOps,this.functions=e.functions}Mt.prototype.simplify=function(t){return t=t||{},new Mt(Mo(this.tokens,this.unaryOps,this.binaryOps,this.ternaryOps,t),this.parser)};Mt.prototype.substitute=function(t,e){return e instanceof Mt||(e=this.parser.parse(String(e))),new Mt(ru(this.tokens,t,e),this.parser)};Mt.prototype.evaluate=function(t){return t=t||{},bn(this.tokens,this,t)};Mt.prototype.toString=function(){return Qo(this.tokens,!1)};Mt.prototype.symbols=function(t){t=t||{};var e=[];return Jo(this.tokens,e,t),e};Mt.prototype.variables=function(t){t=t||{};var e=[];Jo(this.tokens,e,t);var n=this.functions;return e.filter(function(r){return!(r in n)})};Mt.prototype.toJSFunction=function(t,e){var n=this,r=new Function(t,"with(this.functions) with (this.ternaryOps) with (this.binaryOps) with (this.unaryOps) { return "+Qo(this.simplify(e).tokens,!0)+"; }");return function(){return r.apply(n,arguments)}};var Pr="TEOF",be="TOP",Pi="TNUMBER",iu="TSTRING",jt="TPAREN",Xn="TBRACKET",Ni="TCOMMA",ea="TNAME",ta="TSEMICOLON";function ou(t,e,n){this.type=t,this.value=e,this.index=n}ou.prototype.toString=function(){return this.type+": "+this.value};function Re(t,e){this.pos=0,this.current=null,this.unaryOps=t.unaryOps,this.binaryOps=t.binaryOps,this.ternaryOps=t.ternaryOps,this.consts=t.consts,this.expression=e,this.savedPosition=0,this.savedCurrent=null,this.options=t.options,this.parser=t}Re.prototype.newToken=function(t,e,n){return new ou(t,e,n??this.pos)};Re.prototype.save=function(){this.savedPosition=this.pos,this.savedCurrent=this.current};Re.prototype.restore=function(){this.pos=this.savedPosition,this.current=this.savedCurrent};Re.prototype.next=function(){if(this.pos>=this.expression.length)return this.newToken(Pr,"EOF");if(this.isWhitespace()||this.isComment())return this.next();if(this.isRadixInteger()||this.isNumber()||this.isOperator()||this.isString()||this.isParen()||this.isBracket()||this.isComma()||this.isSemicolon()||this.isNamedOp()||this.isConst(
24)||this.isName())return this.current;this.parseError('Unknown character "'+this.expression.charAt(this.pos)+'"')};Re.prototype.isString=function(){var t=!1,e=this.pos,n=this.expression.charAt(e);if(n==="'"||n==='"')for(var r=this.expression.indexOf(n,e+1);r>=0&&this.pos<this.expression.length;){if(this.pos=r+1,this.expression.charAt(r-1)!=="\\"){var i=this.expression.substring(e+1,r);this.current=this.newToken(iu,this.unescape(i),e),t=!0;break}r=this.expression.indexOf(n,r+1)}return t};Re.prototype.isParen=function(){var t=this.expression.charAt(this.pos);return t==="("||t===")"?(this.current=this.newToken(jt,t),this.pos++,!0):!1};Re.prototype.isBracket=function(){var t=this.expression.charAt(this.pos);return(t==="["||t==="]")&&this.isOperatorEnabled("[")?(this.current=this.newToken(Xn,t),this.pos++,!0):!1};Re.prototype.isComma=function(){var t=this.expression.charAt(this.pos);return t===","?(this.current=this.newToken(Ni,","),this.pos++,!0):!1};Re.prototype.isSemicolon=function(){var t=this.expression.charAt(this.pos);return t===";"?(this.current=this.newToken(ta,";"),this.pos++,!0):!1};Re.prototype.isConst=function(){for(var t=this.pos,e=t;e<this.expression.length;e++){var n=this.expression.charAt(e);if(n.toUpperCase()===n.toLowerCase()&&(e===this.pos||n!=="_"&&n!=="."&&(n<"0"||n>"9")))break}if(e>t){var r=this.expression.substring(t,e);if(r in this.consts)return this.current=this.newToken(Pi,this.consts[r]),this.pos+=r.length,!0}return!1};Re.prototype.isNamedOp=function(){for(var t=this.pos,e=t;e<this.expression.length;e++){var n=this.expression.charAt(e);if(n.toUpperCase()===n.toLowerCase()&&(e===this.pos||n!=="_"&&(n<"0"||n>"9")))break}if(e>t){var r=this.expression.substring(t,e);if(this.isOperatorEnabled(r)&&(r in this.binaryOps||r in this.unaryOps||r in this.ternaryOps))return this.current=this.newToken(be,r),this.pos+=r.length,!0}return!1};Re.prototype.isName=function(){for(var t=this.pos,e=t,n=!1;e<this.expression.length;e++){var r=this.expression.charAt(e);if(r.toUpperCase()===r.toLowerCase()){if(e===this.pos&&(r==="$"||r==="_")){r==="_"&&(n=!0);continue}else if(e===this.pos||!n||r!=="_"&&(r<"0"||r>"9"))break}else n=!0}if(n){var i=this.expression.substring(t,e);return this.current=this.newToken(ea,i),this.pos+=i.length,!0}return!1};Re.prototype.isWhitespace=function(){for(var t=!1,e=this.expression.charAt(this.pos);(e===" "||e===" "||e===` 25`||e==="\r")&&(t=!0,this.pos++,!(this.pos>=this.expression.length));)e=this.expression.charAt(this.pos);return t};var Cp=/^[0-9a-f]{4}$/i;Re.prototype.unescape=function(t){var e=t.indexOf("\\");if(e<0)return t;for(var n=t.substring(0,e);e>=0;){var r=t.charAt(++e);switch(r){case"'":n+="'";break;case'"':n+='"';break;case"\\":n+="\\";break;case"/":n+="/";break;case"b":n+="\b";break;case"f":n+="\f";break;case"n":n+=` 26`;break;case"r":n+="\r";break;case"t":n+=" ";break;case"u":var i=t.substring(e+1,e+5);Cp.test(i)||this.parseError("Illegal escape sequence: \\u"+i),n+=String.fromCharCode(parseInt(i,16)),e+=4;break;default:throw this.parseError('Illegal escape sequence: "\\'+r+'"')}++e;var o=t.indexOf("\\",e);n+=t.substring(e,o<0?t.length:o),e=o}return n};Re.prototype.isComment=function(){var t=this.expression.charAt(this.pos);return t==="/"&&this.expression.charAt(this.pos+1)==="*"?(this.pos=this.expression.indexOf("*/",this.pos)+2,this.pos===1&&(this.pos=this.expression.length),!0):!1};Re.prototype.isRadixInteger=function(){var t=this.pos;if(t>=this.expression.length-2||this.expression.charAt(t)!=="0")return!1;++t;var e,n;if(this.expression.charAt(t)==="x")e=16,n=/^[0-9a-f]$/i,++t;else if(this.expression.charAt(t)==="b")e=2,n=/^[01]$/i,++t;else return!1;for(var r=!1,i=t;t<this.expression.length;){var o=this.expression.charAt(t);if(n.test(o))t++,r=!0;else break}return r&&(this.current=this.newToken(Pi,parseInt(this.expression.substring(i,t),e)),this.pos=t),r};Re.prototype.isNumber=function(){for(var t=!1,e=this.pos,n=e,r=e,i=!1,o=!1,a;e<this.expression.length&&(a=this.expression.charAt(e),a>="0"&&a<="9"||!i&&a===".");)a==="."?i=!0:o=!0,e++,t=o;if(t&&(r=e),a==="e"||a==="E"){e++;for(var s=!0,l=!1;e<this.expression.length;){if(a=this.expression.charAt(e),s&&(a==="+"||a==="-"))s=!1;else if(a>="0"&&a<="9")l=!0,s=!1;else break;e++}l||(e=r)}return t?(this.current=this.newToken(Pi,parseFloat(this.expression.substring(n,e))),this.pos=e):this.pos=r,t};Re.prototype.isOperator=function(){var t=this.pos,e=this.expression.charAt(this.pos);if(e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="^"||e==="?"||e===":"||e===".")this.current=this.newToken(be,e);else if(e==="∙"||e==="•")this.current=this.newToken(be,"*");else if(e===">")this.expression.charAt(this.pos+1)==="="?(this.current=this.newToken(be,">="),this.pos++):this.current=this.newToken(be,">");else if(e==="<")this.expression.charAt(this.pos+1)==="="?(this.current=this.newToken(be,"<="),this.pos++):this.current=this.newToken(be,"<");else if(e==="|")if(this.expression.charAt(this.pos+1)==="|")this.current=this.newToken(be,"||"),this.pos++;else return!1;else if(e==="=")this.expression.charAt(this.pos+1)==="="?(this.current=this.newToken(be,"=="),this.pos++):this.current=this.newToken(be,e);else if(e==="!")this.expression.charAt(this.pos+1)==="="?(this.current=this.newToken(be,"!="),this.pos++):this.current=this.newToken(be,e);else return!1;return this.pos++,this.isOperatorEnabled(this.current.value)?!0:(this.pos=t,!1)};Re.prototype.isOperatorEnabled=function(t){return this.parser.isOperatorEnabled(t)};Re.prototype.getCoordinates=function(){var t=0,e,n=-1;do t++,e=this.pos-n,n=this.expression.indexOf(` 27`,n+1);while(n>=0&&n<this.pos);return{line:t,column:e}};Re.prototype.parseError=function(t){var e=this.getCoordinates();throw new Error("parse error ["+e.line+":"+e.column+"]: "+t)};function Oe(t,e,n){this.parser=t,this.tokens=e,this.current=null,this.nextToken=null,this.next(),this.savedCurrent=null,this.savedNextToken=null,this.allowMemberAccess=n.allowMemberAccess!==!1}Oe.prototype.next=function(){return this.current=this.nextToken,this.nextToken=this.tokens.next()};Oe.prototype.tokenMatches=function(t,e){return typeof e>"u"?!0:Array.isArray(e)?Fn(e,t.value):typeof e=="function"?e(t):t.value===e};Oe.prototype.save=function(){this.savedCurrent=this.current,this.savedNextToken=this.nextToken,this.tokens.save()};
27Oe.prototype.restore=function(){this.tokens.restore(),this.current=this.savedCurrent,this.nextToken=this.savedNextToken};Oe.prototype.accept=function(t,e){return this.nextToken.type===t&&this.tokenMatches(this.nextToken,e)?(this.next(),!0):!1};Oe.prototype.expect=function(t,e){if(!this.accept(t,e)){var n=this.tokens.getCoordinates();throw new Error("parse error ["+n.line+":"+n.column+"]: Expected "+(e||t))}};Oe.prototype.parseAtom=function(t){var e=this.tokens.unaryOps;function n(i){return i.value in e}if(this.accept(ea)||this.accept(be,n))t.push(new ne(Xt,this.current.value));else if(this.accept(Pi))t.push(new ne(mt,this.current.value));else if(this.accept(iu))t.push(new ne(mt,this.current.value));else if(this.accept(jt,"("))this.parseExpression(t),this.expect(jt,")");else if(this.accept(Xn,"["))if(this.accept(Xn,"]"))t.push(new ne(Kn,0));else{var r=this.parseArrayList(t);t.push(new ne(Kn,r))}else throw new Error("unexpected "+this.nextToken)};Oe.prototype.parseExpression=function(t){var e=[];this.parseUntilEndStatement(t,e)||(this.parseVariableAssignmentExpression(e),!this.parseUntilEndStatement(t,e)&&this.pushExpression(t,e))};Oe.prototype.pushExpression=function(t,e){for(var n=0,r=e.length;n<r;n++)t.push(e[n])};Oe.prototype.parseUntilEndStatement=function(t,e){return this.accept(ta)?(this.nextToken&&this.nextToken.type!==Pr&&!(this.nextToken.type===jt&&this.nextToken.value===")")&&e.push(new ne(Di)),this.nextToken.type!==Pr&&this.parseExpression(e),t.push(new ne(dt,e)),!0):!1};Oe.prototype.parseArrayList=function(t){for(var e=0;!this.accept(Xn,"]");)for(this.parseExpression(t),++e;this.accept(Ni);)this.parseExpression(t),++e;return e};Oe.prototype.parseVariableAssignmentExpression=function(t){for(this.parseConditionalExpression(t);this.accept(be,"=");){var e=t.pop(),n=[],r=t.length-1;if(e.type===Gn){if(!this.tokens.isOperatorEnabled("()="))throw new Error("function definition is not permitted");for(var i=0,o=e.value+1;i<o;i++){var a=r-i;t[a].type===Xt&&(t[a]=new ne(In,t[a].value))}this.parseVariableAssignmentExpression(n),t.push(new ne(dt,n)),t.push(new ne(Ri,e.value));continue}if(e.type!==Xt&&e.type!==On)throw new Error("expected variable for assignment");this.parseVariableAssignmentExpression(n),t.push(new ne(In,e.value)),t.push(new ne(dt,n)),t.push(Yt("="))}};Oe.prototype.parseConditionalExpression=function(t){for(this.parseOrExpression(t);this.accept(be,"?");){var e=[],n=[];this.parseConditionalExpression(e),this.expect(be,":"),this.parseConditionalExpression(n),t.push(new ne(dt,e)),t.push(new ne(dt,n)),t.push(nu("?"))}};Oe.prototype.parseOrExpression=function(t){for(this.parseAndExpression(t);this.accept(be,"or");){var e=[];this.parseAndExpression(e),t.push(new ne(dt,e)),t.push(Yt("or"))}};Oe.prototype.parseAndExpression=function(t){for(this.parseComparison(t);this.accept(be,"and");){var e=[];this.parseComparison(e),t.push(new ne(dt,e)),t.push(Yt("and"))}};var Ap=["==","!=","<","<=",">=",">","in"];Oe.prototype.parseComparison=function(t){for(this.parseAddSub(t);this.accept(be,Ap);){var e=this.current;this.parseAddSub(t),t.push(Yt(e.value))}};var Ep=["+","-","||"];Oe.prototype.parseAddSub=function(t){for(this.parseTerm(t);this.accept(be,Ep);){var e=this.current;this.parseTerm(t),t.push(Yt(e.value))}};var Sp=["*","/","%"];Oe.prototype.parseTerm=function(t){for(this.parseFactor(t);this.accept(be,Sp);){var e=this.current;this.parseFactor(t),t.push(Yt(e.value))}};Oe.prototype.parseFactor=function(t){var e=this.tokens.unaryOps;function n(i){return i.value in e}if(this.save(),this.accept(be,n)){if(this.current.value!=="-"&&this.current.value!=="+"){if(this.nextToken.type===jt&&this.nextToken.value==="("){this.restore(),this.parseExponential(t);return}else if(this.nextToken.type===ta||this.nextToken.type===Ni||this.nextToken.type===Pr||this.nextToken.type===jt&&this.nextToken.value===")"){this.restore(),this.parseAtom(t);return}}var r=this.current;this.parseFactor(t),t.push(ki(r.value))}else this.parseExponential(t)};Oe.prototype.parseExponential=function(t){for(this.parsePostfixExpression(t);this.accept(be,"^");)this.parseFactor(t),t.push(Yt("^"))};Oe.prototype.parsePostfixExpression=function(t){for(this.parseFunctionCall(t);this.accept(be,"!");)t.push(ki("!"))};Oe.prototype.parseFunctionCall=function(t){var e=this.tokens.unaryOps;function n(o){return o.value in e}if(this.accept(be,n)){var r=this.current;this.parseAtom(t),t.push(ki(r.value))}
27else for(this.parseMemberExpression(t);this.accept(jt,"(");)if(this.accept(jt,")"))t.push(new ne(Gn,0));else{var i=this.parseArgumentList(t);t.push(new ne(Gn,i))}};Oe.prototype.parseArgumentList=function(t){for(var e=0;!this.accept(jt,")");)for(this.parseExpression(t),++e;this.accept(Ni);)this.parseExpression(t),++e;return e};Oe.prototype.parseMemberExpression=function(t){for(this.parseAtom(t);this.accept(be,".")||this.accept(Xn,"[");){var e=this.current;if(e.value==="."){if(!this.allowMemberAccess)throw new Error('unexpected ".", member access is not permitted');this.expect(ea),t.push(new ne(On,this.current.value))}else if(e.value==="["){if(!this.tokens.isOperatorEnabled("["))throw new Error('unexpected "[]", arrays are disabled');this.parseExpression(t),this.expect(Xn,"]"),t.push(Yt("["))}else throw new Error("unexpected symbol: "+e.value)}};function Ip(t,e){return Number(t)+Number(e)}function Tp(t,e){return t-e}function Op(t,e){return t*e}function Mp(t,e){return t/e}function Rp(t,e){return t%e}function Dp(t,e){return Array.isArray(t)&&Array.isArray(e)?t.concat(e):""+t+e}function kp(t,e){return t===e}function Pp(t,e){return t!==e}function Np(t,e){return t>e}function Bp(t,e){return t<e}function Fp(t,e){return t>=e}function Lp(t,e){return t<=e}function Vp(t,e){return!!(t&&e)}function Up(t,e){return!!(t||e)}function $p(t,e){return Fn(e,t)}function Hp(t){return(Math.exp(t)-Math.exp(-t))/2}function Wp(t){return(Math.exp(t)+Math.exp(-t))/2}function zp(t){return t===1/0?1:t===-1/0?-1:(Math.exp(t)-Math.exp(-t))/(Math.exp(t)+Math.exp(-t))}function Gp(t){return t===-1/0?t:Math.log(t+Math.sqrt(t*t+1))}function Kp(t){return Math.log(t+Math.sqrt(t*t-1))}function Xp(t){return Math.log((1+t)/(1-t))/2}function ts(t){return Math.log(t)*Math.LOG10E}function jp(t){return-t}function Yp(t){return!t}function Zp(t){return t<0?Math.ceil(t):Math.floor(t)}function qp(t){return Math.random()*(t||1)}function ns(t){return na(t+1)}function Qp(t){return isFinite(t)&&t===Math.round(t)}var Jp=4.7421875,ji=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function na(t){var e,n;if(Qp(t)){if(t<=0)return isFinite(t)?1/0:NaN;if(t>171)return 1/0;for(var r=t-2,i=t-1;r>1;)i*=r,r--;return i===0&&(i=1),i}if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*na(1-t));if(t>=171.35)return 1/0;if(t>85){var o=t*t,a=o*t,s=a*t,l=s*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*o)-139/(51840*a)-571/(2488320*s)+163879/(209018880*l)+5246819/(75246796800*l*t))}--t,n=ji[0];for(var u=1;u<ji.length;++u)n+=ji[u]/(t+u);return e=t+Jp+.5,Math.sqrt(2*Math.PI)*Math.pow(e,t+.5)*Math.exp(-e)*n}function eg(t){return Array.isArray(t)?t.length:String(t).length}function rs(){for(var t=0,e=0,n=0;n<arguments.length;n++){var r=Math.abs(arguments[n]),i;e<r?(i=e/r,t=t*i*i+1,e=r):r>0?(i=r/e,t+=i*i):t+=r}return e===1/0?1/0:e*Math.sqrt(t)}function is(t,e,n){return t?e:n}function tg(t,e){return typeof e>"u"||+e==0?Math.round(t):(t=+t,e=-+e,isNaN(t)||!(typeof e=="number"&&e%1===0)?NaN:(t=t.toString().split("e"),t=Math.round(+(t[0]+"e"+(t[1]?+t[1]-e:-e))),t=t.toString().split("e"),+(t[0]+"e"+(t[1]?+t[1]+e:e))))}function ng(t,e,n){return n&&(n[t]=e),e}function rg(t,e){return t[e|0]}function ig(t){return arguments.length===1&&Array.isArray(t)?Math.max.apply(Math,t):Math.max.apply(Math,arguments)}function og(t){return arguments.length===1&&Array.isArray(t)?Math.min.apply(Math,t):Math.min.apply(Math,arguments)}function ag(t,e){if(typeof t!="function")throw new Error("First argument to map is not a function");if(!Array.isArray(e))throw new Error("Second argument to map is not an array");return e.map(function(n,r){return t(n,r)})}function sg(t,e,n){if(typeof t!="function")throw new Error("First argument to fold is not a function");if(!Array.isArray(n))throw new Error("Second argument to fold is not an array");return n.reduce(function(r,i,o){return t(r,i,o)},e)}function lg(t,e){if(typeof t!="function")throw new Error("First argument to filter is not a function");if(!Array.isArray(e))throw new Error("Second argument to filter is not an array");return e.filter(function(n,r){return t(n,r)})}function ug(t,e){if(!(Array.isArray(e)||typeof e=="string"))throw new Error("Second argument to indexOf is not a string or array");return e.indexOf(t)}function cg(t,e){if(!Array.isArray(e))throw new Error("Second argument to join is not an array");return e.join(t)}function fg(t){return(t>0)-(t<0)||+t}var os=1/3;function dg(t){return t<0?-Math.pow(-t,os):Math.pow(t,os)}function hg(t){return Math.exp(t)-1}function pg(t){return Math.log(1+t)}function gg(t){return Math.log(t)/Math.LN2}function Mn(t){this.options=t||{},this.unaryOps={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,sinh:Math.sinh||Hp,cosh:Math.cosh||Wp,tanh:Math.tanh||zp,asinh:Math.asinh||Gp,acosh:Math.acosh||Kp,atanh:Math.atanh||Xp,sqrt:Math.sqrt,cbrt:Math.cbrt||dg,log:Math.log,log2:Math.log2||gg,ln:Math.log,lg:Math.log10||ts,log10:Math.log10||ts,expm1:Math.expm1||hg,log1p:Math.log1p||pg,abs:Math.abs,ceil:Math.ceil,floor:Math.floor,round:Math.round,trunc:Math.trunc||Zp,"-":jp,"+":Number,exp:Math.exp,not:Yp,length:eg,"!":ns,sign:Math.sign||fg},this.binaryOps={"+":Ip,"-":Tp,"*":Op,"/":Mp,"%":Rp,"^":Math.pow,"||":Dp,"==":kp,"!=":Pp,">":Np,"<":Bp,">=":Fp,"<=":Lp,and:Vp,or:Up,in:$p,"=":ng,"[":rg},this.ternaryOps={"?":is},this.functions={random:qp,fac:ns,min:og,max:ig,hypot:Math.hypot||rs,pyt:Math.hypot||rs,pow:Math.pow,atan2:Math.atan2,if:is,gamma:na,roundTo:tg,map:ag,fold:sg,filter:lg,indexOf:ug,join:cg},this.consts={E:Math.E,PI:Math.PI,true:!0,false:!1}}Mn.prototype.parse=function(t){var e=[],n=new Oe(this,new Re(this,t),{allowMemberAccess:this.options.allowMemberAccess});return n.parseExpression(e),n.expect(Pr,"EOF"),new Mt(e,this)};Mn.prototype.evaluate=function(t,e){return this.parse(t).evaluate(e)};var au=new Mn;Mn.parse=function(t){return au.parse(t)};Mn.evaluate=function(t,e){return au.parse(t).evaluate(e)};var as={"+":"add","-":"subtract","*":"multiply","/":"divide","%":"remainder","^":"power","!":"factorial","<":"comparison",">":"comparison","<=":"comparison",">=":"comparison","==":"comparison","!=":"comparison","||":"concatenate",and:"logical",or:"logical",not:"logical","?":"conditional",":":"conditional","=":"assignment","[":"array","()=":"fndef"};function vg(t){return as.hasOwnProperty(t)?as[t]:t}Mn.prototype.isOperatorEnabled=function(t){var e=vg(t),n=this.options.operators||{};return!(e in n)||!!n[e]};const mg={name:"CreateFormula",emits:["close"],data(){return{formula:[],variables:["+","-","*","/","(",")"],visibleValue:"",errorMessage:"",error:!1,percentActive:!1,percentType:""}},mounted(){const t=this.columns[this.activeColumnHeader];t?.formula&&(this.formula=JSON.parse(JSON.stringify(t.formula)))},watch:{formula:{handler(t){t&&(this.visibleValue=this.getFieldName(t).join(""))},deep:!0}},computed:{formulaFields(){return Object.entries(this.columns).map(([t,e])=>({key:t,name:e.name,type:e.type})).filter(t=>t.type==="INTEGER"||t.type==="DATEONLY"||t.type==="TIME")},...K(Pe,["columns","activeColumnHeader"])},methods:{...ve(Pe,["setColumnFormula"]),getFieldName(t){let e=JSON.parse(JSON.stringify(t));return this.formulaFields.forEach(n=>{e.forEach((r,i)=>{typeof r=="string"&&r.includes(n.key)&&e[i]&&(e[i]=e[i].replace(n.key,n.name))})}),e},handleVariables(t){this.percentActive?(this.formula.push("*"),this.formula.push("("),this.formula.push("1"),this.formula.push(this.percentType),this.formula.push(t),this.formula.push("/"),this.formula.push("100"),this.formula.push(")"),this.percentActive=!1):this.formula.push(t)},addFormula(){const t=new Mn;let e=this.formula.join("");try{t.parse(e),this.error=!1,this.errorMessage="",this.formula=this.formula.map(n=>n.toString()),console.log(this.formula),this.setColumnFormula(this.formula),this.$emit("close")}catch(n){this.error=!0,this.errorMessage=n.message}}}},yg={key:0},xg={key:1},wg={class:"variables"};function _g(t,e,n,r,i,o){return S(),P(ie,null,{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("set_formula")),1)]),_:1}),g(ue,null,{default:v(()=>[g(vi,{modelValue:i.visibleValue,"onUpdate:modelValue":e[0]||(e[0]=a=>i.visibleValue=a),error:i.error,"error-messages":i.errorMessage,onKeydown:e[1]||(e[1]=Pt(Ue(a=>i.formula.pop(),["prevent"]),["backspace"])),rows:"1","auto-grow":"","no-resize":"",variant:"outlined"},null,8,["modelValue","error","error-messages"]),i.percentActive?(S(),B("p",{key:0,class:Je(["text-caption",{customColor:i.percentActive}])},[i.percentType==="+"?(S(),B("span",yg,T(t.$t("add_percent_comment")),1)):(S(),B("span",xg,T(t.$t("subtract_percent_comment")),1))],2)):U("",!0),V("div",wg,[g(wt,{dense:"",justify:"start"},{default:v(()=>[(S(!0),B(Y,null,de(o.formulaFields,a=>(S(),P(ge,{key:a.key,cols:"auto"},{default:v(()=>[g(D,{onClick:s=>o.handleVariables(a.key),class:"text-capitalize text-truncate",color:i.percentActive?"primary":""},{default:v(()=>[A(T(a.name),1)]),_:2},1032,["onClick","color"])]),_:2},1024))),128)),g(ge,null,{default:v(()=>[g(D,{onClick:e[2]||(e[2]=a=>(i.percentActive=!0,i.percentType="+")),disabled:i.percentActive},{default:v(()=>[A("% "+T(t.$t("add")),1)]),_:1},8,["disabled"])]),_:1}),g(ge,null,{default:v(()=>[g(D,{onClick:e[3]||(e[3]=a=>(i.percentActive=!0,i.percentType="-")),disabled:i.percentActive},{default:v(()=>[A("% "+T(t.$t("minus")),1)]),_:1},8,["disabled"])]),_:1}),(S(!0),B(Y,null,de(i.variables,a=>(S(),P(ge,{key:a,cols:"4"},{default:v(()=>[g(D,{onClick:s=>i.formula.push(a),disabled:i.percentActive},{default:v(()=>[A(T(a),1)]),_:2},1032,["onClick","disabled"])]),_:2},1024))),128)),(S(),B(Y,null,de(10,a=>g(ge,{key:a,cols:"4"},{default:v(()=>[g(D,{onClick:s=>i.formula.push(`${a-1}`),disabled:i.percentActive},{default:v(()=>[A(T(a-1),1)]),_:2},1032,["onClick","disabled"])]),_:2},1024)),64)),g(ge,null,{default:v(()=>[g(D,{onClick:e[4]||(e[4]=a=>i.formula.pop())},{default:v(()=>[g(H,null,{default:v(()=>e[6]||(e[6]=[A("mdi-backspace-outline",-1)])),_:1,__:[6]})]),_:1})]),_:1})]),_:1})]),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[5]||(e[5]=a=>t.$emit("close"))},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1}),g(D,{onClick:o.addFormula},{default:v(()=>[A(T(t.$t("Submit")),1)]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})}const bg=me(mg,[["render",_g]]),Cg={name:"FilterComponent",emits:["close"],data(){return{colors:Pl,newFilter:!1,newFilterName:"",newFilterColor:"",baseFilterColor:0,filterTobDeleted:"",savingFilter:!1}},methods:{useUserFilterUi(t){this.useUserFilter(t)},...ve(ae,["createNewFilterVx","deleteFilter","useUserFilter"]),async createNewFilter(){this.savingFilter=!0,await this.createNewFilterVx({name:this.newFilterName,color:this.newFilterColor}),this.savingFilter=!1,this.$emit("close")}},computed:{...K(ae,["filterList","rangeList","userFilters"])}},Ag={class:"mt-5"},Eg={class:"mx-1"},Sg=["onClick"],Ig=["onClick"];function Tg(t,e,n,r,i,o){return S(),P(ie,{width:"350",style:{"max-height":"400px"}},{default:v(()=>[g(Te,null,{default:v(()=>e[6]||(e[6]=[A("filters",-1)])),_:1,__:[6]}),i.newFilter?U("",!0):(S(),P(wt,{key:0,class:"mx-4"},{default:v(()=>[Object.keys(t.filterList).length>0||Object.keys(t.rangeList).length>0?(S(),P(ge,{key:0,class:"text-center"},{default:v(()=>[g(D,{class:"primary--text",onClick:e[0]||(e[0]=a=>i.newFilter=!0),variant:"outlined",block:""},{default:v(()=>[A(T(t.$t("save_applied_filter")),1)]),_:1})]),_:1})):(S(),P(ge,{key:1},{default:v(()=>[g($o,{dense:"",type:"info",class:"mb-0"},{default:v(()=>[A(T(t.$t("set_filter_first")),1)]),_:1})]),_:1}))]),_:1})),i.newFilter?(S(),P(ue,{key:2,height:"400"},{default:v(()=>[V("div",null,[g(Vi,null,{default:v(()=>[Wn(V("div",Ag,[g(Ne,{modelValue:i.newFilterName,"onUpdate:modelValue":e[2]||(e[2]=a=>i.newFilterName=a),modelModifiers:{trim:!0},variant:"outlined",label:t.$t("filter_name"),rules:[a=>a&&a.length>=3||t.$t("min_3_char")]},null,8,["modelValue","label","rules"])],512),[[Rr,i.newFilter]])]),_:1}),g(Vi,null,{default:v(()=>[Wn(V("div",Eg,[i.baseFilterColor?(S(),P(wt,{key:0,dense:"",justify:"center"},{default:v(()=>[g(ge,{cols:"auto"},{default:v(()=>[g(D,{icon:"",text:"",size:"large",class:"filterPallete",onClick:e[3]||(e[3]=a=>(i.baseFilterColor=0,i.newFilterColor=""))},{default:v(()=>[g(H,{color:"primary"},{default:v(()=>e[8]||(e[8]=[A("mdi-arrow-left",-1)])),_:1,__:[8]})]),_:1})]),_:1}),(S(!0),B(Y,null,de(i.colors[i.baseFilterColor],(a,s)=>(S(),P(ge,{key:s,cols:"auto"},{default:v(()=>[V("div",{class:"filterPallete",style:ze({background:a}),onClick:l=>i.newFilterColor=a},null,12,Sg)]),_:2},1024))),128))]),_:1})):(S(),P(wt,{key:1,dense:"",justify:"center"},{default:v(()=>[(S(!0),B(Y,null,de(i.colors,(a,s)=>(S(),P(ge,{key:s,cols:"auto"},{default:v(()=>[V("div",{class:"filterPallete",style:ze({background:a.base}),onClick:l=>i.baseFilterColor=s},null,12,Ig)]),_:2},1024))),128))]),_:1}))],512),[[Rr,i.newFilterName.length>2]])]),_:1})])]),_:1})):(S(),P(ue,{key:1,style:{"max-height":"400px"},class:"mt-2"},{default:v(()=>[t.userFilters&&Object.keys(t.userFilters).length>0?(S(),P(rn,{key:0,variant:"outlined"},{default:v(()=>[(S(!0),B(Y,null,de(t.userFilters,(a,s)=>(S(),P(Qe,{key:s,onClick:Ue(l=>o.useUserFilterUi(s),["stop"]),color:a.color,class:"pa-0"},{default:v(()=>[g(mi,{color:a.color,variant:"flat"},{default:v(()=>[A(T(a.name),1)]),_:2},1032,["color"]),g(Vi,null,{default:v(()=>[i.filterTobDeleted===s?(S(),P(Bl,{key:0,class:"ml-5"},{default:v(()=>[g(q),g(D,{onClick:e[1]||(e[1]=Ue(l=>i.filterTobDeleted="",["stop"])),variant:"text"},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1}),g(D,{color:"primary",variant:"text",onClick:Ue(l=>t.deleteFilter(s),["stop"])},{default:v(()=>[A(T(t.$t("confirm")),1)]),_:2},1032,["onClick"])]),_:2},1024)):U("",!0)]),_:2},1024)]),append:v(()=>[g(D,{icon:"",color:"red",variant:"text",onClick:Ue(l=>i.filterTobDeleted=s,["stop"])},{default:v(()=>[g(H,null,{default:v(()=>
27e[7]||(e[7]=[A("mdi-delete-outline",-1)])),_:1,__:[7]})]),_:2},1032,["onClick"])]),_:2},1032,["onClick","color"]))),128))]),_:1})):U("",!0)]),_:1})),i.newFilter?(S(),P(oe,{key:3},{default:v(()=>[i.newFilterName.length>2?(S(),P(mi,{key:0,color:i.newFilterColor,variant:"flat",label:""},{default:v(()=>[A(T(i.newFilterName),1)]),_:1},8,["color"])):U("",!0),g(q),g(D,{onClick:e[4]||(e[4]=a=>i.newFilter=!1),text:"",disabled:i.savingFilter},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1},8,["disabled"]),i.newFilterName.length>2&&i.newFilterColor?(S(),P(D,{key:1,color:"primary",text:"",onClick:o.createNewFilter,loading:i.savingFilter},{default:v(()=>[A(T(t.$t("create")),1)]),_:1},8,["onClick","loading"])):U("",!0)]),_:1})):U("",!0),i.newFilter?U("",!0):(S(),P(oe,{key:4},{default:v(()=>[g(q),g(D,{onClick:e[5]||(e[5]=a=>t.$emit("close")),text:"",color:"primary"},{default:v(()=>[A(T(t.$t("close")),1)]),_:1})]),_:1}))]),_:1})}const Og=me(Cg,[["render",Tg],["__scopeId","data-v-a1f54ba5"]]);var Mg="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z";const Rg=Zn({name:"select-import-component",emits:["close","selectedList"],props:{column:{type:Object,required:!1}},data(){return{filter:"",uid:Ft().currentUser?.uid,selectedTable:"",selectedColumn:"",tableNode:[],loading:!1,tagNode:{}
27,columns:[],mdiArrowLeft:Mg}},watch:{selectedTable(t){this.loading=!0,this.columns=[],Sr(He(We,`tables/${t}/columns`)).then(e=>{if(e.exists()){const n=e.val();Object.entries(n).forEach(([r,i])=>{this.columns.push({key:r,...i})})}this.loading=!1})},selectedColumn(t){this.loading=!0,Sr(He(We,`rows/${this.selectedTable}`)).then(e=>{let n=new Set;e.forEach(r=>{let i=r.val();if(i?.values?.[t]?.values){let o=i.values[t].values;switch(t.type){case"DATEONLY":o=Kt.getFormattedCellValueForDate(o);break;case"TIME":o=Kt.getFormattedCellValueForTime(o);break}n.add(o)}}),this.loading=!1,this.$emit("selectedList",Array.from(n))})}},methods:{},created(){Sr(He(We,`users/${this.uid}/tables`)).then(t=>{if(t.exists()){const e=t.val();Object.entries(e).forEach(([n,r])=>{this.tableNode.push({key:n,...r})})}})}}),Dg={class:"ml-5"},kg={key:1},Pg={key:2},Ng={key:0},Bg={key:1};function Fg(t,e,n,r,i,o){return S(),P(ie,{height:"500"},{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("import_select_column_msg",{name:t.column?.name??""})),1)]),_:1}),g(Ne,{solo:"","hide-details":"","single-line":"",debounce:"300",type:"search",modelValue:t.filter,"onUpdate:modelValue":e[0]||(e[0]=a=>t.filter=a),placeholder:t.$t("type_to_search"),class:"mx-5 mb-5"},null,8,["modelValue","placeholder"]),V("div",Dg,[t.selectedTable?(S(),P(D,{key:0,icon:"",variant:"flat",onClick:e[1]||(e[1]=a=>t.selectedTable="")},{default:v(()=>[g(H,null,{default:v(()=>e[3]||(e[3]=[A("mdi-arrow-left",-1)])),_:1,__:[3]})]),_:1})):U("",!0),t.selectedTable?(S(),B("a",Pg,[V("b",null,T(t.$t("select_column")),1)])):(S(),B("a",kg,[V("b",null,T(t.$t("select_table")),1)]))]),g(ue,{style:{height:"500px"}},{default:v(()=>[t.selectedTable?(S(),B("div",Bg,[(S(!0),B(Y,null,de(t.columns,(a,s)=>(S(),B("div",{key:s},[a.type!=="CHECKBOX"&&a.type!=="FORMULA"&&a.type!=="IMAGE"&&a.type!=="DRAW"&&a.type!=="AUDIO"?(S(),P(Qe,{key:0,onClick:l=>t.selectedColumn=a.key,dense:""},{default:v(()=>[A(T(a.name),1)]),_:2},1032,["onClick"])):U("",!0)]))),128))])):(S(),B("div",Ng,[(S(!0),B(Y,null,de(t.tableNode,a=>(S(),B("div",{key:a.key},[t.filter===""||a.name.toLocaleLowerCase().includes(t.filter.toLocaleLowerCase())?(S(),P(Qe,{key:0,onClick:s=>t.selectedTable=a.key,dense:""},{default:v(()=>[A(T(a.name),1)]),_:2},1032,["onClick"])):U("",!0)]))),128))]))]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{text:"",color:"primary",onClick:e[2]||(e[2]=a=>t.$emit("close")),loading:t.loading},{default:v(()=>[A(T(t.$t("close")),1)]),_:1},8,["loading"])]),_:1})]),_:1})}const Lg=me(Rg,[["render",Fg]]);/*! 28 * @kurkle/color v0.3.4 29 * https://github.com/kurkle/color#readme 30 * (c) 2024 Jukka Kurkela 31 * Released under the MIT License 32 */function $r(t){return t+.5|0}const tn=(t,e,n)=>Math.max(Math.min(t,n),e);function br(t){return tn($r(t*2.55),0,255)}function sn(t){return tn($r(t*255),0,255)}function Gt(t){return tn($r(t/2.55)/100,0,1)}function ss(t){return tn($r(t*100),0,100)}const pt={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},Ro=[..."0123456789ABCDEF"],Vg=t=>Ro[t&15],Ug=t=>Ro[(t&240)>>4]+Ro[t&15],Yr=t=>(t&240)>>4===(t&15),$g=t=>Yr(t.r)&&Yr(t.g)&&Yr(t.b)&&Yr(t.a);function Hg(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&pt[t[1]]*17,g:255&pt[t[2]]*17,b:255&pt[t[3]]*17,a:e===5?pt[t[4]]*17:255}:(e===7||e===9)&&(n={r:pt[t[1]]<<4|pt[t[2]],g:pt[t[3]]<<4|pt[t[4]],b:pt[t[5]]<<4|pt[t[6]],a:e===9?pt[t[7]]<<4|pt[t[8]]:255})),n}const Wg=(t,e)=>t<255?e(t):"";function zg(t){var e=$g(t)?Vg:Ug;return t?"#"+e(t.r)+e(t.g)+e(t.b)+Wg(t.a,e):void 0}const Gg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function su(t,e,n){const r=e*Math.min(n,1-n),i=(o,a=(o+t/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[i(0),i(8),i(4)]}function Kg(t,e,n){const r=(i,o=(i+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function Xg(t,e,n){const r=su(t,1,.5);let i;for(e+n>1&&(i=1/(e+n),e*=i,n*=i),i=0;i<3;i++)r[i]*=1-e-n,r[i]+=e;return r}function jg(t,e,n,r,i){return t===i?(e-n)/r+(e<n?6:0):e===i?(n-t)/r+2:(t-e)/r+4}function ra(t){const n=t.r/255,r=t.g/255,i=t.b/255,o=Math.max(n,r,i),a=Math.min(n,r,i),s=(o+a)/2;let l,u,c;return o!==a&&(c=o-a,u=s>.5?c/(2-o-a):c/(o+a),l=jg(n,r,i,c,o),l=l*60+.5),[l|0,u||0,s]}function ia(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(sn)}function oa(t,e,n){return ia(su,t,e,n)}function Yg(t,e,n){return ia(Xg,t,e,n)}function Zg(t,e,n){return ia(Kg,t,e,n)}function lu(t){return(t%360+360)%360}function qg(t){const e=Gg.exec(t);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?br(+e[5]):sn(+e[5]));const i=lu(+e[2]),o=+e[3]/100,a=+e[4]/100;return e[1]==="hwb"?r=Yg(i,o,a):e[1]==="hsv"?r=Zg(i,o,a):r=oa(i,o,a),{r:r[0],g:r[1],b:r[2],a:n}}function Qg(t,e){var n=ra(t);n[0]=lu(n[0]+e),n=oa(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Jg(t){if(!t)return;const e=ra(t),n=e[0],r=ss(e[1]),i=ss(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${i}%, ${Gt(t.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const ls={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"},us={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",K
32ocTate:"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 ev(){const t={},e=Object.keys(us),n=Object.keys(ls);let r,i,o,a,s;for(r=0;r<e.length;r++){for(a=s=e[r],i=0;i<n.length;i++)o=n[i],s=s.replace(o,ls[o]);o=parseInt(us[a],16),t[s]=[o>>16&255,o>>8&255,o&255]}return t}let Zr;function tv(t){Zr||(Zr=ev(),Zr.transparent=[0,0,0,0]);const e=Zr[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const nv=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rv(t){const e=nv.exec(t);let n=255,r,i,o;if(e){if(e[7]!==r){const a=+e[7];n=e[8]?br(a):tn(a*255,0,255)}return r=+e[1],i=+e[3],o=+e[5],r=255&(e[2]?br(r):tn(r,0,255)),i=255&(e[4]?br(i):tn(i,0,255)),o=255&(e[6]?br(o):tn(o,0,255)),{r,g:i,b:o,a:n}}}function iv(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Gt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Yi=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Pn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function ov(t,e,n){const r=Pn(Gt(t.r)),i=Pn(Gt(t.g)),o=Pn(Gt(t.b));return{r:sn(Yi(r+n*(Pn(Gt(e.r))-r))),g:sn(Yi(i+n*(Pn(Gt(e.g))-i))),b:sn(Yi(o+n*(Pn(Gt(e.b))-o))),a:t.a+n*(e.a-t.a)}}function qr(t,e,n){if(t){let r=ra(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,e===0?360:1)),r=oa(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function uu(t,e){return t&&Object.assign(e||{},t)}function cs(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=sn(t[3]))):(e=uu(t,{r:0,g:0,b:0,a:1}),e.a=sn(e.a)),e}function av(t){return t.charAt(0)==="r"?rv(t):qg(t)}class Nr{constructor(e){if(e instanceof Nr)return e;const n=typeof e;let r;n==="object"?r=cs(e):n==="string"&&(r=Hg(e)||tv(e)||av(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=uu(this._rgb);return e&&(e.a=Gt(e.a)),e}set rgb(e){this._rgb=cs(e)}rgbString(){return this._valid?iv(this._rgb):void 0}hexString(){return this._valid?zg(this._rgb):void 0}hslString(){return this._valid?Jg(this._rgb):void 0}mix(e,n){if(e){const r=this.rgb,i=e.rgb;let o;const a=n===o?.5:n,s=2*a-1,l=r.a-i.a,u=((s*l===-1?s:(s+l)/(1+s*l))+1)/2;o=1-u,r.r=255&u*r.r+o*i.r+.5,r.g=255&u*r.g+o*i.g+.5,r.b=255&u*r.b+o*i.b+.5,r.a=a*r.a+(1-a)*i.a,this.rgb=r}return this}interpolate(e,n){return e&&(this._rgb=ov(this._rgb,e._rgb,n)),this}clone(){return new Nr(this.rgb)}alpha(e){return this._rgb.a=sn(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=$r(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return qr(this._rgb,2,e),this}darken(e){return qr(this._rgb,2,-e),this}saturate(e){return qr(this._rgb,1,e),this}desaturate(e){return qr(this._rgb,1,-e),this}rotate(e){return Qg(this._rgb,e),this}}/*! 33 * Chart.js v4.5.0 34 * https://www.chartjs.org 35 * (c) 2025 Chart.js Contributors 36 * Released under the MIT License 37 */function Ht(){}const sv=(()=>{let t=0;return()=>t++})();function we(t){return t==null}function Ve(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);
37return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function se(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function _t(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Rt(t,e){return _t(t)?t:e}function ce(t,e){return typeof t>"u"?e:t}const lv=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Ie(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function pe(t,e,n,r){let i,o,a;if(Ve(t))for(o=t.length,i=0;i<o;i++)e.call(n,t[i],i);else if(se(t))for(a=Object.keys(t),o=a.length,i=0;i<o;i++)e.call(n,t[a[i]],a[i])}function wi(t,e){let n,r,i,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(i=t[n],o=e[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function _i(t){if(Ve(t))return t.map(_i);if(se(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let i=0;for(;i<r;++i)e[n[i]]=_i(t[n[i]]);return e}return t}function cu(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function uv(t,e,n,r){if(!cu(t))return;const i=e[t],o=n[t];se(i)&&se(o)?Br(i,o,r):e[t]=_i(o)}function Br(t,e,n){const r=Ve(e)?e:[e],i=r.length;if(!se(t))return t;n=n||{};const o=n.merger||uv;let a;for(let s=0;s<i;++s){if(a=r[s],!se(a))continue;const l=Object.keys(a);for(let u=0,c=l.length;u<c;++u)o(l[u],t,a,n)}return t}function Tr(t,e){return Br(t,e,{merger:cv})}function cv(t,e,n){if(!cu(t))return;const r=e[t],i=n[t];se(r)&&se(i)?Tr(r,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=_i(i))}const fs={"":t=>t,x:t=>t.x,y:t=>t.y};function fv(t){const e=t.split("."),n=[];let r="";for(const i of e)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function dv(t){const e=fv(t);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function jn(t,e){return(fs[e]||(fs[e]=dv(e)))(t)}function aa(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Fr=t=>typeof t<"u",fn=t=>typeof t=="function",ds=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function hv(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const tt=Math.PI,ln=2*tt,bi=Number.POSITIVE_INFINITY,pv=tt/180,Tt=tt/2,vn=tt/4,hs=tt*2/3,fu=Math.log10,un=Math.sign;function di(t,e,n){return Math.abs(t-e)<n}function ps(t){const e=Math.round(t);t=di(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(fu(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function gv(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r===0&&(e.push(r),e.push(t/r));return n===(n|0)&&e.push(n),e.sort((i,o)=>i-o).pop(),e}function vv(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Ci(t){return!vv(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function mv(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function yv(t,e,n){let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function An(t){return t*(tt/180)}function xv(t){return t*(180/tt)}function gs(t){if(!_t(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function wv(t,e){const n=e.x-t.x,r=e.y-t.y,i=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*tt&&(o+=ln),{angle:o,distance:i}}function _v(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function mn(t){return(t%ln+ln)%ln}function bv(t,e,n,r){const i=mn(t),o=mn(e),a=mn(n),s=mn(o-i),l=mn(a-i),u=mn(i-o),c=mn(i-a);return i===o||i===a||r||s>l&&u<c}function Ot(t,e,n){return Math.max(e,Math.min(n,t))}function Cv(t){return Ot(t,-32768,32767)}function Ln(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function sa(t,e,n){n=n||(a=>t[a]<e);let r=t.length-1,i=0,o;for(;r-i>1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const Do=(t,e,n,r)=>sa(t,n,r?i=>{const o=t[i][e];return o<n||o===n&&t[i+1][e]===n}:i=>t[i][e]<n),Av=(t,e,n)=>sa(t,n,r=>t[r][e]>=n);function Ev(t,e,n){let r=0,i=t.length;for(;r<i&&t[r]<e;)r++;for(;i>r&&t[i-1]>n;)i--;return r>0||i<t.length?t.slice(r,i):t}const du=["push","pop","shift","splice","unshift"];function Sv(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),du.forEach(n=>{const r="_onData"+aa(n),i=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...o){const a=i.apply(this,o);
37return t._chartjs.listeners.forEach(s=>{typeof s[r]=="function"&&s[r](...o)}),a}})})}function vs(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(e);i!==-1&&r.splice(i,1),!(r.length>0)&&(du.forEach(o=>{delete t[o]}),delete t._chartjs)}function hu(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const pu=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function gu(t,e){let n=[],r=!1;return function(...i){n=i,r||(r=!0,pu.call(window,()=>{r=!1,t.apply(e,n)}))}}function Iv(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const la=t=>t==="start"?"left":t==="end"?"right":"center",qe=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,Tv=(t,e,n,r)=>t===(r?"left":"right")?n:t==="center"?(e+n)/2:e,Qr=t=>t===0||t===1,ms=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*ln/n)),ys=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*ln/n)+1,Or={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Tt)+1,easeOutSine:t=>Math.sin(t*Tt),easeInOutSine:t=>-.5*(Math.cos(tt*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Qr(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Qr(t)?t:ms(t,.075,.3),easeOutElastic:t=>Qr(t)?t:ys(t,.075,.3),easeInOutElastic(t){return Qr(t)?t:t<.5?.5*ms(t*2,.1125,.45):.5+.5*ys(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Or.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Or.easeInBounce(t*2)*.5:Or.easeOutBounce(t*2-1)*.5+.5};function vu(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function xs(t){return vu(t)?t:new Nr(t)}function Zi(t){return vu(t)?t:new Nr(t).saturate(.5).darken(.1).hexString()}const Ov=["x","y","borderWidth","radius","tension"],Mv=["color","borderColor","backgroundColor"];function Rv(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:Mv},numbers:{type:"number",properties:Ov}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function Dv(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ws=new Map;function kv(t,e){e=e||{};const n=t+JSON.stringify(e);let r=ws.get(n);return r||(r=new Intl.NumberFormat(t,e),ws.set(n,r)),r}function mu(t,e,n){return kv(e,n).format(t)}const Pv={values(t){return Ve(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const r=this.chart.options.locale;let i,o=t;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(i="scientific"),o=Nv(t,n)}const a=fu(Math.abs(o)),s=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),mu(t,r,l)}};function Nv(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var yu={formatters:Pv};function Bv(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:yu.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}
vendor: 1,082 bytes, line 37
37const Tn=Object.create(null),ko=Object.create(null);function Mr(t,e){if(!e)return t;const n=e.split(".");for(let r=0,i=n.length;r<i;++r){const o=n[r];t=t[o]||(t[o]=Object.create(null))}return t}function qi(t,e,n){return typeof e=="string"?Br(Mr(t,e),n):Br(Mr(t,""),e)}class Fv{constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.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=(r,i)=>Zi(i.backgroundColor),this.hoverBorderColor=(r,i)=>Zi(i.borderColor),this.hoverColor=(r,i)=>Zi(i.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={}
37,this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return qi(this,e,n)}get(e){return Mr(this,e)}describe(e,n){return qi(ko,e,n)}override(e,n){return qi(Tn,e,n)}route(e,n,r,i){const o=Mr(this,e),a=Mr(this,r),s="_"+n;Object.defineProperties(o,{[s]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[s],u=a[i];return se(l)?Object.assign({},u,l):ce(l,u)},set(l){this[s]=l}}})}apply(e){e.forEach(n=>n(this))}}var ke=new Fv({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Rv,Dv,Bv]);function Lv(t){return!t||we(t.size)||we(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function _s(t,e,n,r,i){let o=e[i];return o||(o=e[i]=t.measureText(i).width,n.push(i)),o>r&&(r=o),r}function yn(t,e,n){const r=t.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((e-i)*r)/r+i}function bs(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Cs(t,e,n,r){xu(t,e,n,r,null)}function xu(t,e,n,r,i){let o,a,s,l,u,c,f,d;const h=e.pointStyle,p=e.rotation,m=e.radius;let y=(p||0)*pv;if(h&&typeof h=="object"&&(o=h.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){t.save(),t.translate(n,r),t.rotate(y),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!(isNaN(m)||m<=0)){switch(t.beginPath(),h){default:i?t.ellipse(n,r,i/2,m,0,0,ln):t.arc(n,r,m,0,ln),t.closePath();break;case"triangle":c=i?i/2:m,t.moveTo(n+Math.sin(y)*c,r-Math.cos(y)*m),y+=hs,t.lineTo(n+Math.sin(y)*c,r-Math.cos(y)*m),y+=hs,t.lineTo(n+Math.sin(y)*c,r-Math.cos(y)*m),t.closePath();break;case"rectRounded":u=m*.516,l=m-u,a=Math.cos(y+vn)*l,f=Math.cos(y+vn)*(i?i/2-u:l),s=Math.sin(y+vn)*l,d=Math.sin(y+vn)*(i?i/2-u:l),t.arc(n-f,r-s,u,y-tt,y-Tt),t.arc(n+d,r-a,u,y-Tt,y),t.arc(n+f,r+s,u,y,y+Tt),t.arc(n-d,r+a,u,y+Tt,y+tt),t.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,c=i?i/2:l,t.rect(n-c,r-l,2*c,2*l);break}y+=vn;case"rectRot":f=Math.cos(y)*(i?i/2:m),a=Math.cos(y)*m,s=Math.sin(y)*m,d=Math.sin(y)*(i?i/2:m),t.moveTo(n-f,r-s),t.lineTo(n+d,r-a),t.lineTo(n+f,r+s),t.lineTo(n-d,r+a),t.closePath();break;case"crossRot":y+=vn;case"cross":f=Math.cos(y)*(i?i/2:m),a=Math.cos(y)*m,s=Math.sin(y)*m,d=Math.sin(y)*(i?i/2:m),t.moveTo(n-f,r-s),t.lineTo(n+f,r+s),t.moveTo(n+d,r-a),t.lineTo(n-d,r+a);break;case"star":f=Math.cos(y)*(i?i/2:m),a=Math.cos(y)*m,s=Math.sin(y)*m,d=Math.sin(y)*(i?i/2:m),t.moveTo(n-f,r-s),t.lineTo(n+f,r+s),t.moveTo(n+d,r-a),t.lineTo(n-d,r+a),y+=vn,f=Math.cos(y)*(i?i/2:m),a=Math.cos(y)*m,s=Math.sin(y)*m,d=Math.sin(y)*(i?i/2:m),t.moveTo(n-f,r-s),t.lineTo(n+f,r+s),t.moveTo(n+d,r-a),t.lineTo(n-d,r+a);break;case"line":a=i?i/2:Math.cos(y)*m,s=Math.sin(y)*m,t.moveTo(n-a,r-s),t.lineTo(n+a,r+s);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(y)*(i?i/2:m),r+Math.sin(y)*m);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function wu(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function ua(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function ca(t){t.restore()}function Vv(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),we(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function Uv(t,e,n,r,i){if(i.strikethrough||i.underline){const o=t.measureText(r),a=e-o.actualBoundingBoxLeft,s=e+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,u=n+o.actualBoundingBoxDescent,c=i.strikethrough?(l+u)/2:u;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=i.decorationWidth||2,t.moveTo(a,c),t.lineTo(s,c),t.stroke()}}function $v(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function Lr(t,e,n,r,i,o={}){const a=Ve(e)?e:[e],s=o.strokeWidth>0&&o.strokeColor!=="";let l,u;for(t.save(),t.font=i.string,Vv(t,o),l=0;l<a.length;++l)u=a[l],o.backdrop&&$v(t,o.backdrop),s&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),we(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(u,n,r,o.maxWidth)),t.fillText(u,n,r,o.maxWidth),Uv(t,n,r,u,o),r+=Number(i.lineHeight);
37t.restore()}function Ai(t,e){const{x:n,y:r,w:i,h:o,radius:a}=e;t.arc(n+a.topLeft,r+a.topLeft,a.topLeft,1.5*tt,tt,!0),t.lineTo(n,r+o-a.bottomLeft),t.arc(n+a.bottomLeft,r+o-a.bottomLeft,a.bottomLeft,tt,Tt,!0),t.lineTo(n+i-a.bottomRight,r+o),t.arc(n+i-a.bottomRight,r+o-a.bottomRight,a.bottomRight,Tt,0,!0),t.lineTo(n+i,r+a.topRight),t.arc(n+i-a.topRight,r+a.topRight,a.topRight,0,-Tt,!0),t.lineTo(n+a.topLeft,r)}const Hv=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Wv=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function zv(t,e){const n=(""+t).match(Hv);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const Gv=t=>+t||0;function _u(t,e){const n={},r=se(e),i=r?Object.keys(e):e,o=se(t)?r?a=>ce(t[a],t[e[a]]):a=>t[a]:()=>t;for(const a of i)n[a]=Gv(o(a));return n}function bu(t){return _u(t,{top:"y",right:"x",bottom:"y",left:"x"})}function $n(t){return _u(t,["topLeft","topRight","bottomLeft","bottomRight"])}function bt(t){const e=bu(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function et(t,e){t=t||{},e=e||ke.font;let n=ce(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let r=ce(t.style,e.style);r&&!(""+r).match(Wv)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:ce(t.family,e.family),lineHeight:zv(ce(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:ce(t.weight,e.weight),string:""};return i.string=Lv(i),i}function Jr(t,e,n,r){let i,o,a;for(i=0,o=t.length;i<o;++i)if(a=t[i],a!==void 0&&a!==void 0)return a}function Kv(t,e,n){const{min:r,max:i}=t,o=lv(e,(i-r)/2),a=(s,l)=>n&&s===0?0:s+l;return{min:a(r,-Math.abs(o)),max:a(i,o)}}function ir(t,e){return Object.assign(Object.create(t),e)}function fa(t,e=[""],n,r,i=()=>t[0]){const o=n||t;typeof r>"u"&&(r=Su("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:r,_getTarget:i,override:s=>fa([s,...t],e,o,r)};return new Proxy(a,{deleteProperty(s,l){return delete s[l],delete s._keys,delete t[0][l],!0},get(s,l){return Au(s,l,()=>em(l,e,t,s))},getOwnPropertyDescriptor(s,l){return Reflect.getOwnPropertyDescriptor(s._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(s,l){return Es(s).includes(l)},ownKeys(s){return Es(s)},set(s,l,u){const c=s._storage||(s._storage=i());return s[l]=c[l]=u,delete s._keys,!0}})}function Yn(t,e,n,r){const i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Cu(t,r),setContext:o=>Yn(t,o,n,r),override:o=>Yn(t.override(o),e,n,r)};return new Proxy(i,{deleteProperty(o,a){return delete o[a],delete t[a],!0},get(o,a,s){return Au(o,a,()=>jv(o,a,s))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(t,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,a)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(o,a){return Reflect.has(t,a)},ownKeys(){return Reflect.ownKeys(t)},set(o,a,s){return t[a]=s,delete o[a],!0}})}function Cu(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:i=e.allKeys}=t;return{allKeys:i,scriptable:n,indexable:r,isScriptable:fn(n)?n:()=>n,isIndexable:fn(r)?r:()=>r}}const Xv=(t,e)=>t?t+aa(e):e,da=(t,e)=>se(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Au(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const r=n();return t[e]=r,r}function jv(t,e,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:a}=t;let s=r[e];return fn(s)&&a.isScriptable(e)&&(s=Yv(e,s,t,n)),Ve(s)&&s.length&&(s=Zv(e,s,t,a.isIndexable)),da(e,s)&&(s=Yn(s,i,o&&o[e],a)),s}function Yv(t,e,n,r){const{_proxy:i,_context:o,_subProxy:a,_stack:s}=n;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t);let l=e(o,a||r);return s.delete(t),da(t,l)&&(l=ha(i._scopes,i,t,l)),l}function Zv(t,e,n,r){const{_proxy:i,_context:o,_subProxy:a,_descriptors:s}=n;if(typeof o.index<"u"&&r(t))return e[o.index%e.length];if(se(e[0])){const l=e,u=i._scopes.filter(c=>c!==l);e=[];for(const c of l){const f=ha(u,i,t,c);e.push(Yn(f,o,a&&a[t],s))}}return e}function Eu(t,e,n){return fn(t)?t(e,n):t}const qv=(t,e)=>t===!0?e:typeof t=="string"?jn(e,t):void 0;function Qv(t,e,n,r,i){for(const o of e){const a=qv(n,o);if(a){t.add(a);const s=Eu(a._fallback,n,i);if(typeof s<"u"&&s!==n&&s!==r)return s}else if(a===!1&&typeof r<"u"&&n!==r)return null}return!1}function ha(t,e,n,r){const i=e._rootScopes,o=Eu(e._fallback,n,r),a=[...t,...i],s=new Set;s.add(r);let l=As(s,a,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=As(s,a,o,l,r),l===null)?!1:fa(Array.from(s),[""],i,o,()=>Jv(e,n,r))}function As(t,e,n,r,i){for(;n;)n=Qv(t,e,n,r,i);return n}function Jv(t,e,n){const r=t._getTarget();e in r||(r[e]={});const i=r[e];return Ve(i)&&se(n)?n:i||{}}function em(t,e,n,r){let i;for(const o of e)if(i=Su(Xv(o,t),n),typeof i<"u")return da(t,i)?ha(n,r,t,i):i}function Su(t,e){for(const n of e){if(!n)continue;const r=n[t];if(typeof r<"u")return r}}function Es(t){let e=t._keys;return e||(e=t._keys=tm(t._scopes)),e}function tm(t){const e=new Set;for(const n of t)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))e.add(r);return Array.from(e)}function pa(){return typeof window<"u"&&typeof document<"u"}function ga(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Ei(t,e,n){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*e.parentNode[n])):r=t,r}const Bi=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function nm(t,e){return Bi(t).getPropertyValue(e)}const rm=["top","right","bottom","left"];function Sn(t,e,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=rm[i];
37r[o]=parseFloat(t[e+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const im=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function om(t,e){const n=t.touches,r=n&&n.length?n[0]:t,{offsetX:i,offsetY:o}=r;let a=!1,s,l;if(im(i,o,t.target))s=i,l=o;else{const u=e.getBoundingClientRect();s=r.clientX-u.left,l=r.clientY-u.top,a=!0}return{x:s,y:l,box:a}}function _n(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:r}=e,i=Bi(n),o=i.boxSizing==="border-box",a=Sn(i,"padding"),s=Sn(i,"border","width"),{x:l,y:u,box:c}=om(t,n),f=a.left+(c&&s.left),d=a.top+(c&&s.top);let{width:h,height:p}=e;return o&&(h-=a.width+s.width,p-=a.height+s.height),{x:Math.round((l-f)/h*n.width/r),y:Math.round((u-d)/p*n.height/r)}}function am(t,e,n){let r,i;if(e===void 0||n===void 0){const o=t&&ga(t);if(!o)e=t.clientWidth,n=t.clientHeight;else{const a=o.getBoundingClientRect(),s=Bi(o),l=Sn(s,"border","width"),u=Sn(s,"padding");e=a.width-u.width-l.width,n=a.height-u.height-l.height,r=Ei(s.maxWidth,o,"clientWidth"),i=Ei(s.maxHeight,o,"clientHeight")}}return{width:e,height:n,maxWidth:r||bi,maxHeight:i||bi}}const ei=t=>Math.round(t*10)/10;function sm(t,e,n,r){const i=Bi(t),o=Sn(i,"margin"),a=Ei(i.maxWidth,t,"clientWidth")||bi,s=Ei(i.maxHeight,t,"clientHeight")||bi,l=am(t,e,n);let{width:u,height:c}=l;if(i.boxSizing==="content-box"){const d=Sn(i,"border","width"),h=Sn(i,"padding");u-=h.width+d.width,c-=h.height+d.height}return u=Math.max(0,u-o.width),c=Math.max(0,r?u/r:c-o.height),u=ei(Math.min(u,a,l.maxWidth)),c=ei(Math.min(c,s,l.maxHeight)),u&&!c&&(c=ei(u/2)),(e!==void 0||n!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=ei(Math.floor(c*r))),{width:u,height:c}}function Ss(t,e,n){const r=e||1,i=Math.floor(t.height*r),o=Math.floor(t.width*r);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||a.height!==i||a.width!==o?(t.currentDevicePixelRatio=r,a.height=i,a.width=o,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const lm=(function(){let t=!1;try{const e={get passive(){return t=!0,!1}};pa()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t})();function Is(t,e){const n=nm(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const um=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},cm=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Hn(t,e,n){return t?um(e,n):cm()}function Iu(t,e){let n,r;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function Tu(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function ti(t,e,n){return t.options.clip?t[n]:e[n]}function fm(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:ti(n,e,"left"),right:ti(n,e,"right"),top:ti(r,e,"top"),bottom:ti(r,e,"bottom")}:e}function dm(t,e){const n=e._clip;if(n.disabled)return!1;const r=fm(e,t.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*! 38 * Chart.js v4.5.0 39 * https://www.chartjs.org 40 * (c) 2025 Chart.js Contributors 41 * Released under the MIT License 42 */class hm{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,i){const o=n.listeners[i],a=n.duration;o.forEach(s=>s({chart:e,initial:n.initial,numSteps:a,currentStep:Math.min(r-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=pu.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;
42this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let a=o.length-1,s=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(e),s=!0):(o[a]=o[o.length-1],o.pop());s&&(i.draw(),this._notify(i,r,e,"progress")),o.length||(r.running=!1,this._notify(i,r,e,"complete"),r.initial=!1),n+=o.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Wt=new hm;const Ts="transparent",pm={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=xs(t||Ts),i=r.valid&&xs(e||Ts);return i&&i.valid?i.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class gm{constructor(e,n,r,i){const o=n[r];i=Jr([e.to,i,o,e.from]);const a=Jr([e.from,o,i]);this._active=!0,this._fn=e.fn||pm[e.type||typeof a],this._easing=Or[e.easing]||Or.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=a,this._to=i,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,a=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=Jr([e.to,n,i,e.from]),this._from=Jr([e.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,i=this._prop,o=this._from,a=this._loop,s=this._to;let l;if(this._active=o!==s&&(a||n<r),!this._active){this._target[i]=s,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,s,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class Ou{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!se(e))return;const n=Object.keys(ke.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const o=e[i];if(!se(o))return;const a={};for(const s of n)a[s]=o[s];(Ve(o.properties)&&o.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,a)})})}_animateOptions(e,n){const r=n.options,i=mm(e,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&vm(e.options.$animations,r).then(()=>{e.options=r},()=>{}),o}_createAnimations(e,n){const r=this._properties,i=[],o=e.$animations||(e.$animations={}),a=Object.keys(n),s=Date.now();let l;for(l=a.length-1;l>=0;--l){const u=a[l];if(u.charAt(0)==="$")continue;if(u==="options"){i.push(...this._animateOptions(e,n));continue}const c=n[u];let f=o[u];const d=r.get(u);if(f)if(d&&f.active()){f.update(d,c,s);continue}else f.cancel();if(!d||!d.duration){e[u]=c;continue}o[u]=f=new gm(d,e,u,c),i.push(f)}return i}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return Wt.add(this._chart,r),!0}}function vm(t,e){const n=[],r=Object.keys(e);for(let i=0;i<r.length;i++){const o=t[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function mm(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Os(t,e){const n=t&&t.options||{},r=n.reverse,i=n.min===void 0?e:0,o=n.max===void 0?e:0;return{start:r?o:i,end:r?i:o}}function ym(t,e,n){if(n===!1)return!1;const r=Os(t,n),i=Os(e,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function xm(t){let e,n,r,i;return se(t)?(e=t.top,n=t.right,r=t.bottom,i=t.left):e=n=r=i=t,{top:e,right:n,bottom:r,left:i,disabled:t===!1}}function Mu(t,e){const n=[],r=t._getSortedDatasetMetas(e);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function Ms(t,e,n,r={}){const i=t.keys,o=r.mode==="single";let a,s,l,u;if(e===null)return;let c=!1;for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===n){if(c=!0,r.all)continue;break}u=t.values[l],_t(u)&&(o||e===0||un(e)===un(u))&&(e+=u)}return!c&&!r.all?0:e}function wm(t,e){const{iScale:n,vScale:r}=e,i=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",a=Object.keys(t),s=new Array(a.length);let l,u,c;for(l=0,u=a.length;l<u;++l)c=a[l],s[l]={[i]:c,[o]:t[c]};return s}function Qi(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function _m(t,e,n){return`${t.id}
42.${e.id}.${n.stack||n.type}`}function bm(t){const{min:e,max:n,minDefined:r,maxDefined:i}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function Cm(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function Rs(t,e,n,r){for(const i of e.getMatchingVisibleMetas(r).reverse()){const o=t[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function Ds(t,e){const{chart:n,_cachedMeta:r}=t,i=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=r,l=o.axis,u=a.axis,c=_m(o,a,r),f=e.length;let d;for(let h=0;h<f;++h){const p=e[h],{[l]:m,[u]:y}=p,w=p._stacks||(p._stacks={});d=w[u]=Cm(i,c,m),d[s]=y,d._top=Rs(d,a,!0,r.type),d._bottom=Rs(d,a,!1,r.type);const _=d._visualValues||(d._visualValues={});_[s]=y}}function Ji(t,e){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function Am(t,e){return ir(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Em(t,e,n){return ir(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function dr(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const i of e){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const eo=t=>t==="reset"||t==="none",ks=(t,e)=>e?t:Object.assign({},t),Sm=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Mu(n,!0),values:null};class Ru{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Qi(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&dr(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,d,h,p)=>f==="x"?d:f==="r"?p:h,o=n.xAxisID=ce(r.xAxisID,Ji(e,"x")),a=n.yAxisID=ce(r.yAxisID,Ji(e,"y")),s=n.rAxisID=ce(r.rAxisID,Ji(e,"r")),l=n.indexAxis,u=n.iAxisID=i(l,o,a,s),c=n.vAxisID=i(l,a,o,s);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(s),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&vs(this._data,this),e._stacked&&dr(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(se(n)){const i=this._cachedMeta;this._data=wm(n,i)}else if(r!==n){if(r){vs(r,this);const i=this._cachedMeta;dr(i),i._parsed=[]}n&&Object.isExtensible(n)&&Sv(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=Qi(n.vScale,n),n.stack!==r.stack&&(i=!0,dr(n),n.stack=r.stack),this._resyncElements(e),(i||o!==n._stacked)&&(Ds(this,n._parsed),n._stacked=Qi(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:a}=r,s=o.axis;let l=e===0&&n===i.length?!0:r._sorted,u=e>0&&r._parsed[e-1],c,f,d;
42if(this._parsing===!1)r._parsed=i,r._sorted=!0,d=i;else{Ve(i[e])?d=this.parseArrayData(r,i,e,n):se(i[e])?d=this.parseObjectData(r,i,e,n):d=this.parsePrimitiveData(r,i,e,n);const h=()=>f[s]===null||u&&f[s]<u[s];for(c=0;c<n;++c)r._parsed[c+e]=f=d[c],l&&(h()&&(l=!1),u=f);r._sorted=l}a&&Ds(this,d)}parsePrimitiveData(e,n,r,i){const{iScale:o,vScale:a}=e,s=o.axis,l=a.axis,u=o.getLabels(),c=o===a,f=new Array(i);let d,h,p;for(d=0,h=i;d<h;++d)p=d+r,f[d]={[s]:c||o.parse(u[p],p),[l]:a.parse(n[p],p)};return f}parseArrayData(e,n,r,i){const{xScale:o,yScale:a}=e,s=new Array(i);let l,u,c,f;for(l=0,u=i;l<u;++l)c=l+r,f=n[c],s[l]={x:o.parse(f[0],c),y:a.parse(f[1],c)};return s}parseObjectData(e,n,r,i){const{xScale:o,yScale:a}=e,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=new Array(i);let c,f,d,h;for(c=0,f=i;c<f;++c)d=c+r,h=n[d],u[c]={x:o.parse(jn(h,s),d),y:a.parse(jn(h,l),d)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const i=this.chart,o=this._cachedMeta,a=n[e.axis],s={keys:Mu(i,!0),values:n._stacks[e.axis]._visualValues};return Ms(s,a,o.index,{mode:r})}updateRangeFromParsed(e,n,r,i){const o=r[n.axis];let a=o===null?NaN:o;const s=i&&r._stacks[n.axis];i&&s&&(i.values=s,a=Ms(i,o,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&e===r.iScale,a=i.length,s=this._getOtherScale(e),l=Sm(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:f}=bm(s);let d,h;function p(){h=i[d];const m=h[s.axis];return!_t(h[e.axis])||c>m||f<m}for(d=0;d<a&&!(!p()&&(this.updateRangeFromParsed(u,e,h,l),o));++d);if(o){for(d=a-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(u,e,h,l);break}}return u}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let i,o,a;for(i=0,o=n.length;i<o;++i)a=n[i][e.axis],_t(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(e);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=xm(ce(this.options.clip,ym(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,a=[],s=this._drawStart||0,l=this._drawCount||i.length-s,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(e,o,s,l),c=s;c<s+l;++c){const f=i[c];f.hidden||(f.active&&u?a.push(f):f.draw(e,o))}for(c=0;c<a.length;++c)a[c].draw(e,o)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const i=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const a=this._cachedMeta.data[e];o=a.$context||(a.$context=Em(this.getContext(),e,a)),o.parsed=this.getParsed(e),o.raw=i.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=Am(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const i=n==="active",o=this._cachedDataOpts,a=e+"-"+n,s=o[a],l=this.enableOptionSharing&&Fr(r);if(s)return ks(s,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,e),f=i?[`${e}Hover`,"hover",e,""]:[e,""],d=u.getOptionScopes(this.getDataset(),c),h=Object.keys(ke.elements[e]),p=()=>this.getContext(r,i,n),m=u.resolveNamedOptions(d,h,p,f);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(ks(m,l))),m}_resolveAnimations(e,n,r){const i=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,s=o[a];if(s)return s;let l;if(i.options.animation!==!1){const c=this.chart.config,f=c.datasetAnimationScopeKeys(this._type,n),d=c.getOptionScopes(this.getDataset(),f);l=c.createResolver(d,this.getContext(e,r,n))}const u=new Ou(i,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||eo(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),i=this._sharedOptions,o=this.getSharedOptions(r),a=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:a}}updateElement(e,n,r,i){eo(i)?Object.assign(e,r):this._resolveAnimations(n,i).update(e,r)}updateSharedOptions(e,n,r){e&&!eo(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,i){e.active=i;const o=this.getStyle(n,i);
42this._resolveAnimations(n,r,i).update(e,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,r=this._cachedMeta.data;for(const[s,l,u]of this._syncList)this[s](l,u);this._syncList=[];const i=r.length,o=n.length,a=Math.min(o,i);a&&this.parse(0,a),o>i?this._insertElements(i,o-i,e):o<i&&this._removeElements(o,i-o)}_insertElements(e,n,r=!0){const i=this._cachedMeta,o=i.data,a=e+n;let s;const l=u=>{for(u.length+=n,s=u.length-1;s>=a;s--)u[s]=u[s-n]};for(l(o),s=e;s<a;++s)o[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(e,n),r&&this.updateElements(o,e,n,"reset")}updateElements(e,n,r,i){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(e,n);r._stacked&&dr(r,i)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,i]=e;this[n](r,i)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Im(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(t));t._cache.$bar=hu(r.sort((i,o)=>i-o))}return t._cache.$bar}function Tm(t){const e=t.iScale,n=Im(e,t.type);let r=e._length,i,o,a,s;const l=()=>{a===32767||a===-32768||(Fr(s)&&(r=Math.min(r,Math.abs(a-s)||r)),s=a)};for(i=0,o=n.length;i<o;++i)a=e.getPixelForValue(n[i]),l();for(s=void 0,i=0,o=e.ticks.length;i<o;++i)a=e.getPixelForTick(i),l();return r}function Om(t,e,n,r){const i=n.barThickness;let o,a;return we(i)?(o=e.min*n.categoryPercentage,a=n.barPercentage):(o=i*r,a=1),{chunk:o/r,ratio:a,start:e.pixels[t]-o/2}}function Mm(t,e,n,r){const i=e.pixels,o=i[t];let a=t>0?i[t-1]:null,s=t<i.length-1?i[t+1]:null;const l=n.categoryPercentage;a===null&&(a=o-(s===null?e.end-e.start:s-o)),s===null&&(s=o+o-a);const u=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:u}}function Rm(t,e,n,r){const i=n.parse(t[0],r),o=n.parse(t[1],r),a=Math.min(i,o),s=Math.max(i,o);let l=a,u=s;Math.abs(a)>Math.abs(s)&&(l=s,u=a),e[n.axis]=u,e._custom={barStart:l,barEnd:u,start:i,end:o,min:a,max:s}}function Du(t,e,n,r){return Ve(t)?Rm(t,e,n,r):e[n.axis]=n.parse(t,r),e}function Ps(t,e,n,r){const i=t.iScale,o=t.vScale,a=i.getLabels(),s=i===o,l=[];let u,c,f,d;for(u=n,c=n+r;u<c;++u)d=e[u],f={},f[i.axis]=s||i.parse(a[u],u),l.push(Du(d,f,o,u));return l}function to(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Dm(t,e,n){return t!==0?un(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function km(t){let e,n,r,i,o;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:e,top:i,bottom:o}}function Pm(t,e,n,r){let i=e.borderSkipped;const o={};if(!i){t.borderSkipped=o;return}if(i===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:s,reverse:l,top:u,bottom:c}=km(t);i==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?i=u:(n._bottom||0)===r?i=c:(o[Ns(c,a,s,l)]=!0,i=u)),o[Ns(i,a,s,l)]=!0,t.borderSkipped=o}function Ns(t,e,n,r){return r?(t=Nm(t,e,n),t=Bs(t,n,e)):t=Bs(t,e,n),t}function Nm(t,e,n){return t===e?n:t===n?e:t}function Bs(t,e,n){return t==="start"?e:t==="end"?n:t}function Bm(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class Fm extends Ru{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,n,r,i){return Ps(e,n,r,i)}parseArrayData(e,n,r,i){return Ps(e,n,r,i)}parseObjectData(e,n,r,i){const{iScale:o,vScale:a}=e,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,u=o.axis==="x"?s:l,c=a.axis==="x"?s:l,f=[];let d,h,p,m;for(d=r,h=r+i;d<h;++d)m=n[d],p={},p[o.axis]=o.parse(jn(m,u),d),f.push(Du(jn(m,c),p,a,d));return f}updateRangeFromParsed(e,n,r,i){super.updateRangeFromParsed(e,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(e),a=o._custom,s=to(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,r,i){const o=i==="reset",{index:a,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),u=s.isHorizontal(),c=this._getRuler(),{sharedOptions:f,includeOptions:d}=this._getSharedOptions(n,i);for(let h=n;h<n+r;h++){const p=this.getParsed(h),m=o||we(p[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,c),w=(p._stacks||{})[s.axis],_={horizontal:u,base:m.base,enableBorderRadius:!w||to(p._custom)||a===w._top||a===w._bottom,x:u?m.head:y.center,y:u?y.center:m.head,height:u?y.size:Math.abs(m.size),width:u?Math.abs(m.size):y.size};d&&(_.options=f||this.resolveDataElementOptions(h,e[h].active?"active":i));const C=_.options||e[h].options;Pm(_,C,w,a),Bm(_,C,c.ratio),this.updateElement(e[h],h,_,i)}}_getStacks(e,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),o=r.options.stacked,a=[],s=this._cachedMeta.controller.getParsed(n),l=s&&s[r.axis],u=c=>{const f=c._parsed.find(h=>
42h[r.axis]===l),d=f&&f[c.vScale.axis];if(we(d)||isNaN(d))return!0};for(const c of i)if(!(n!==void 0&&u(c))&&((o===!1||a.indexOf(c.stack)===-1||o===void 0&&c.stack===void 0)&&a.push(c.stack),c.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(r=>e[r].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)e[ce(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,r){const i=this._getStacks(e,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const e=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,a;for(o=0,a=n.data.length;o<a;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const s=e.barThickness;return{min:s||Tm(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:e.grouped,ratio:s?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:a}}=this,s=o||0,l=this.getParsed(e),u=l._custom,c=to(u);let f=l[n.axis],d=0,h=r?this.applyStack(n,l,r):f,p,m;h!==f&&(d=h-f,h=f),c&&(f=u.barStart,h=u.barEnd-u.barStart,f!==0&&un(f)!==un(u.barEnd)&&(d=0),d+=f);const y=!we(o)&&!c?o:d;let w=n.getPixelForValue(y);if(this.chart.getDataVisibility(e)?p=n.getPixelForValue(d+h):p=w,m=p-w,Math.abs(m)<a){m=Dm(m,n,s)*a,f===s&&(w-=m/2);const _=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),E=Math.min(_,C),I=Math.max(_,C);w=Math.max(Math.min(w,I),E),p=w+m,r&&!c&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(p)-n.getValueForPixel(w))}if(w===n.getPixelForValue(s)){const _=un(m)*n.getLineWidthForValue(s)/2;w+=_,m-=_}return{size:m,base:w,head:p,center:p+m/2}}_calculateBarIndexPixels(e,n){const r=n.scale,i=this.options,o=i.skipNull,a=ce(i.maxBarThickness,1/0);let s,l;const u=this._getAxisCount();if(n.grouped){const c=o?this._getStackCount(e):n.stackCount,f=i.barThickness==="flex"?Mm(e,n,i,c*u):Om(e,n,i,c*u),d=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(ce(d,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0)+h;s=f.start+f.chunk*p+f.chunk/2,l=Math.min(a,f.chunk*f.ratio)}else s=r.getPixelForValue(this.getParsed(e)[r.axis],e),l=Math.min(a,n.min*n.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const e=this._cachedMeta,n=e.vScale,r=e.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}function xn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class va{static override(e){Object.assign(va.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return xn()}parse(){return xn()}format(){return xn()}add(){return xn()}diff(){return xn()}startOf(){return xn()}endOf(){return xn()}}var Lm={_date:va};function Vm(t,e,n,r){const{controller:i,data:o,_sorted:a}=t,s=i._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(s&&e===s.axis&&e!=="r"&&a&&o.length){const u=s._reversePixels?Av:Do;if(r){if(i._sharedOptions){const c=o[0],f=typeof c.getRange=="function"&&c.getRange(e);if(f){const d=u(o,e,n-f),h=u(o,e,n+f);return{lo:d.lo,hi:h.hi}}}}else{const c=u(o,e,n);if(l){const{vScale:f}=i._cachedMeta,{_parsed:d}=t,h=d.slice(0,c.lo+1).reverse().findIndex(m=>!we(m[f.axis]));c.lo-=Math.max(0,h);const p=d.slice(c.hi).findIndex(m=>!we(m[f.axis]));c.hi+=Math.max(0,p)}return c}}return{lo:0,hi:o.length-1}}function Fi(t,e,n,r,i){const o=t.getSortedVisibleDatasetMetas(),a=n[e];for(let s=0,l=o.length;s<l;++s){const{index:u,data:c}=o[s],{lo:f,hi:d}=Vm(o[s],e,a,i);for(let h=f;h<=d;++h){const p=c[h];p.skip||r(p,u,h)}}}function Um(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,i){const o=e?Math.abs(r.x-i.x):0,a=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function no(t,e,n,r,i){const o=[];return!i&&!t.isPointInArea(e)||Fi(t,n,e,function(s,l,u){!i&&!wu(s,t.chartArea,0)||s.inRange(e.x,e.y,r)&&o.push({element:s,datasetIndex:l,index:u})},!0),o}function $m(t,e,n,r){let i=[];function o(a,s,l){const{startAngle:u,endAngle:c}=a.getProps(["startAngle","endAngle"],r),{angle:f}=wv(a,{x:e.x,y:e.y});bv(f,u,c)&&i.push({element:a,datasetIndex:s,index:l})}return Fi(t,n,e,o),i}function Hm(t,e,n,r,i,o){let a=[];const s=Um(n);let l=Number.POSITIVE_INFINITY;function u(c,f,d){const h=c.inRange(e.x,e.y,i);if(r&&!h)return;const p=c.getCenterPoint(i);if(!(!!o||t.isPointInArea(p))&&!h)return;const y=s(e,p);y<l?(a=[{element:c,datasetIndex:f,index:d}],l=y):y===l&&a.push({element:c,datasetIndex:f,index:d})}return Fi(t,n,e,u),a}function ro(t,e,n,r,i,o){return!o&&!t.isPointInArea(e)?[]:n==="r"&&!r?$m(t,e,n,i):Hm(t,e,n,r,i,o)}function Fs(t,e,n,r,i){const o=[],a=n==="x"?"inXRange":"inYRange";let s=!1;return Fi(t,n,e,(l,u,c)=>
42{l[a]&&l[a](e[n],i)&&(o.push({element:l,datasetIndex:u,index:c}),s=s||l.inRange(e.x,e.y,i))}),r&&!s?[]:o}var Wm={modes:{index(t,e,n,r){const i=_n(e,t),o=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?no(t,i,o,r,a):ro(t,i,o,!1,r,a),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach(u=>{const c=s[0].index,f=u.data[c];f&&!f.skip&&l.push({element:f,datasetIndex:u.index,index:c})}),l):[]},dataset(t,e,n,r){const i=_n(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?no(t,i,o,r,a):ro(t,i,o,!1,r,a);if(s.length>0){const l=s[0].datasetIndex,u=t.getDatasetMeta(l).data;s=[];for(let c=0;c<u.length;++c)s.push({element:u[c],datasetIndex:l,index:c})}return s},point(t,e,n,r){const i=_n(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;return no(t,i,o,r,a)},nearest(t,e,n,r){const i=_n(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;return ro(t,i,o,n.intersect,r,a)},x(t,e,n,r){const i=_n(e,t);return Fs(t,i,"x",n.intersect,r)},y(t,e,n,r){const i=_n(e,t);return Fs(t,i,"y",n.intersect,r)}}};const ku=["left","top","right","bottom"];function hr(t,e){return t.filter(n=>n.pos===e)}function Ls(t,e){return t.filter(n=>ku.indexOf(n.pos)===-1&&n.box.axis===e)}function pr(t,e){return t.sort((n,r)=>{const i=e?r:n,o=e?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function zm(t){const e=[];let n,r,i,o,a,s;for(n=0,r=(t||[]).length;n<r;++n)i=t[n],{position:o,options:{stack:a,stackWeight:s=1}}=i,e.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&o+a,stackWeight:s});return e}function Gm(t){const e={};for(const n of t){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!ku.includes(i))continue;const a=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return e}function Km(t,e){const n=Gm(t),{vBoxMaxWidth:r,hBoxMaxHeight:i}=e;let o,a,s;for(o=0,a=t.length;o<a;++o){s=t[o];const{fullSize:l}=s.box,u=n[s.stack],c=u&&s.stackWeight/u.weight;s.horizontal?(s.width=c?c*r:l&&e.availableWidth,s.height=i):(s.width=r,s.height=c?c*i:l&&e.availableHeight)}return n}function Xm(t){const e=zm(t),n=pr(e.filter(u=>u.box.fullSize),!0),r=pr(hr(e,"left"),!0),i=pr(hr(e,"right")),o=pr(hr(e,"top"),!0),a=pr(hr(e,"bottom")),s=Ls(e,"x"),l=Ls(e,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:hr(e,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(a).concat(s)}}function Vs(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function Pu(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function jm(t,e,n,r){const{pos:i,box:o}=n,a=t.maxPadding;if(!se(i)){n.size&&(t[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,t[i]+=n.size}o.getPadding&&Pu(a,o.getPadding());const s=Math.max(0,e.outerWidth-Vs(a,t,"left","right")),l=Math.max(0,e.outerHeight-Vs(a,t,"top","bottom")),u=s!==t.w,c=l!==t.h;return t.w=s,t.h=l,n.horizontal?{same:u,other:c}:{same:c,other:u}}function Ym(t){const e=t.maxPadding;function n(r){const i=Math.max(e[r]-t[r],0);return t[r]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Zm(t,e){const n=e.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(a=>{o[a]=Math.max(e[a],n[a])}),o}return r(t?["left","right"]:["top","bottom"])}function Cr(t,e,n,r){const i=[];let o,a,s,l,u,c;for(o=0,a=t.length,u=0;o<a;++o){s=t[o],l=s.box,l.update(s.width||e.w,s.height||e.h,Zm(s.horizontal,e));const{same:f,other:d}=jm(e,n,s,r);u|=f&&i.length,c=c||d,l.fullSize||i.push(s)}return u&&Cr(i,e,n,r)||c}function ni(t,e,n,r,i){t.top=n,t.left=e,t.right=e+r,t.bottom=n+i,t.width=r,t.height=i}function Us(t,e,n,r){const i=n.padding;let{x:o,y:a}=e;for(const s of t){const l=s.box,u=r[s.stack]||{placed:0,weight:1},c=s.stackWeight/u.weight||1;if(s.horizontal){const f=e.w*c,d=u.size||l.height;Fr(u.start)&&(a=u.start),l.fullSize?ni(l,i.left,a,n.outerWidth-i.right-i.left,d):ni(l,e.left+u.placed,a,f,d),u.start=a,u.placed+=f,a=l.bottom}else{const f=e.h*c,d=u.size||l.width;Fr(u.start)&&(o=u.start),l.fullSize?ni(l,o,i.top,d,n.outerHeight-i.bottom-i.top):ni(l,o,e.top+u.placed,d,f),u.start=o,u.placed+=f,o=l.right}}e.x=o,e.y=a}
42var xt={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const i=bt(t.options.layout.padding),o=Math.max(e-i.width,0),a=Math.max(n-i.height,0),s=Xm(t.boxes),l=s.vertical,u=s.horizontal;pe(t.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const c=l.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),d=Object.assign({},i);Pu(d,bt(r));const h=Object.assign({maxPadding:d,w:o,h:a,x:i.left,y:i.top},i),p=Km(l.concat(u),f);Cr(s.fullSize,h,f,p),Cr(l,h,f,p),Cr(u,h,f,p)&&Cr(l,h,f,p),Ym(h),Us(s.leftAndTop,h,f,p),h.x+=h.w,h.y+=h.h,Us(s.rightAndBottom,h,f,p),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},pe(s.chartArea,m=>{const y=m.box;Object.assign(y,t.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Nu{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,i){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(e){return!0}updateConfig(e){}}class qm extends Nu{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const hi="$chartjs",Qm={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$s=t=>t===null||t==="";function Jm(t,e){const n=t.style,r=t.getAttribute("height"),i=t.getAttribute("width");if(t[hi]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",$s(i)){const o=Is(t,"width");o!==void 0&&(t.width=o)}if($s(r))if(t.style.height==="")t.height=t.width/(e||2);else{const o=Is(t,"height");o!==void 0&&(t.height=o)}return t}const Bu=lm?{passive:!0}:!1;function e2(t,e,n){t&&t.addEventListener(e,n,Bu)}function t2(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,Bu)}function n2(t,e){const n=Qm[t.type]||t.type,{x:r,y:i}=_n(t,e);return{type:n,chart:e,native:t,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Si(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function r2(t,e,n){const r=t.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||Si(s.addedNodes,r),a=a&&!Si(s.removedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function i2(t,e,n){const r=t.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||Si(s.removedNodes,r),a=a&&!Si(s.addedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Vr=new Map;let Hs=0;function Fu(){const t=window.devicePixelRatio;t!==Hs&&(Hs=t,Vr.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function o2(t,e){Vr.size||window.addEventListener("resize",Fu),Vr.set(t,e)}function a2(t){Vr.delete(t),Vr.size||window.removeEventListener("resize",Fu)}function s2(t,e,n){const r=t.canvas,i=r&&ga(r);if(!i)return;const o=gu((s,l)=>{const u=i.clientWidth;n(s,l),u<i.clientWidth&&n()},window),a=new ResizeObserver(s=>{const l=s[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||o(u,c)});return a.observe(i),o2(t,o),a}function io(t,e,n){n&&n.disconnect(),e==="resize"&&a2(t)}function l2(t,e,n){const r=t.canvas,i=gu(o=>{t.ctx!==null&&n(n2(o,t))},t);return e2(r,e,i),i}class u2 extends Nu{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(Jm(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[hi])return!1;const r=n[hi].initial;["height","width"].forEach(o=>{const a=r[o];we(a)?n.removeAttribute(o):n.setAttribute(o,a)});const i=r.style||{};
42return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[hi],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const i=e.$proxies||(e.$proxies={}),a={attach:r2,detach:i2,resize:s2}[n]||l2;i[n]=a(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),i=r[n];if(!i)return;({attach:io,detach:io,resize:io}[n]||t2)(e,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,i){return sm(e,n,r,i)}isAttached(e){const n=e&&ga(e);return!!(n&&n.isConnected)}}function c2(t){return!pa()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?qm:u2}class or{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return Ci(this.x)&&Ci(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const i={};return e.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}}function f2(t,e){const n=t.options.ticks,r=d2(t),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?p2(e):[],a=o.length,s=o[0],l=o[a-1],u=[];if(a>i)return g2(e,u,o,a/i),u;const c=h2(o,e,i);if(a>0){let f,d;const h=a>1?Math.round((l-s)/(a-1)):null;for(ri(e,u,c,we(h)?0:s-h,s),f=0,d=a-1;f<d;f++)ri(e,u,c,o[f],o[f+1]);return ri(e,u,c,l,we(h)?e.length:l+h),u}return ri(e,u,c),u}function d2(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),i=t._maxLength/n;return Math.floor(Math.min(r,i))}function h2(t,e,n){const r=v2(t),i=e.length/n;if(!r)return Math.max(i,1);const o=gv(r);for(let a=0,s=o.length-1;a<s;a++){const l=o[a];if(l>i)return l}return Math.max(i,1)}function p2(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}function g2(t,e,n,r){let i=0,o=n[0],a;for(r=Math.ceil(r),a=0;a<t.length;a++)a===o&&(e.push(t[a]),i++,o=n[i*r])}function ri(t,e,n,r,i){const o=ce(r,0),a=Math.min(ce(i,t.length),t.length);let s=0,l,u,c;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),c=o;c<0;)s++,c=Math.round(o+s*n);for(u=Math.max(o,0);u<a;u++)u===c&&(e.push(t[u]),s++,c=Math.round(o+s*n))}function v2(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}const m2=t=>t==="left"?"right":t==="right"?"left":t,Ws=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,zs=(t,e)=>Math.min(e||t,t);function Gs(t,e){const n=[],r=t.length/e,i=t.length;let o=0;for(;o<i;o+=r)n.push(t[Math.floor(o)]);return n}function y2(t,e,n){const r=t.ticks.length,i=Math.min(e,r-1),o=t._startPixel,a=t._endPixel,s=1e-6;let l=t.getPixelForTick(i),u;if(!(n&&(r===1?u=Math.max(l-o,a-l):e===0?u=(t.getPixelForTick(1)-l)/2:u=(l-t.getPixelForTick(i-1))/2,l+=i<e?u:-u,l<o-s||l>a+s)))return l}function x2(t,e){pe(t,n=>{const r=n.gc,i=r.length/2;let o;if(i>e){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function gr(t){return t.drawTicks?t.tickLength:0}function Ks(t,e){if(!t.display)return 0;const n=et(t.font,e),r=bt(t.padding);return(Ve(t.text)?t.text.length:1)*n.lineHeight+r.height}function w2(t,e){return ir(t,{scale:e,type:"scale"})}function _2(t,e,n){return ir(t,{tick:n,index:e,type:"tick"})}function b2(t,e,n){let r=la(t);return(n&&e!=="right"||!n&&e==="right")&&(r=m2(r)),r}function C2(t,e,n,r){const{top:i,left:o,bottom:a,right:s,chart:l}=t,{chartArea:u,scales:c}=l;let f=0,d,h,p;const m=a-i,y=s-o;if(t.isHorizontal()){if(h=qe(r,o,s),se(n)){const w=Object.keys(n)[0],_=n[w];p=c[w].getPixelForValue(_)+m-e}else n==="center"?p=(u.bottom+u.top)/2+m-e:p=Ws(t,n,e);d=s-o}else{if(se(n)){const w=Object.keys(n)[0],_=n[w];h=c[w].getPixelForValue(_)-y+e}else n==="center"?h=(u.left+u.right)/2-y+e:h=Ws(t,n,e);p=qe(r,a,i),f=n==="left"?-Tt:Tt}return{titleX:h,titleY:p,maxWidth:d,rotation:f}}class ar extends or{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return e=Rt(e,Number.POSITIVE_INFINITY),n=Rt(n,Number.NEGATIVE_INFINITY),r=Rt(r,Number.POSITIVE_INFINITY),i=Rt(i,Number.NEGATIVE_INFINITY),{min:Rt(e,r),max:Rt(n,i),minDefined:_t(e),maxDefined:_t(n)}}getMinMax(e){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),a;if(i&&o)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,u=s.length;l<u;++l)a=s[l].controller.getMinMax(this,e),i||(n=Math.min(n,a.min)),o||(r=Math.max(r,a.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Rt(n,Rt(r,n)),max:Rt(r,Rt(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}
vendor: 4,637 bytes, line 42
42getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ie(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:i,grace:o,ticks:a}=this.options,s=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Kv(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?Gs(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=f2(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ie(this.options.afterUpdate,[this])}beforeSetDimensions(){Ie(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Ie(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Ie(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ie(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,i,o;for(r=0,i=e.length;r<i;r++)o=e[r],o.label=Ie(n.callback,[o.value,r,e],this)}afterTickToLabelConversion(){Ie(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ie(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=zs(this.ticks.length,e.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let a=i,s,l,u;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const c=this._getLabelSizes(),f=c.widest.width,d=c.highest.height,h=Ot(this.chart.width-f,0,this.maxWidth);s=e.offset?this.maxWidth/r:h/(r-1),f+6>s&&(s=h/(r-(e.offset?.5:1)),l=this.maxHeight-gr(e.grid)-n.padding-Ks(e.title,this.chart.options.font),u=Math.sqrt(f*f+d*d),a=xv(Math.min(Math.asin(Ot((c.highest.height+6)/s,-1,1)),Math.asin(Ot(l/u,-1,1))-Math.asin(Ot(d/u,-1,1)))),a=Math.max(i,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){Ie(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ie(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){const l=Ks(i,n.options.font);if(s?(e.width=this.maxWidth,e.height=gr(o)+l):(e.height=this.maxHeight,e.width=gr(o)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:f,highest:d}=this._getLabelSizes(),h=r.padding*2,p=An(this.labelRotation),m=Math.cos(p),y=Math.sin(p);if(s){const w=r.mirror?0:y*f.width+m*d.height;e.height=Math.min(this.maxHeight,e.height+w+h)}else{const w=r.mirror?0:m*f.width+y*d.height;e.width=Math.min(this.maxWidth,e.width+w+h)}this._calculatePadding(u,c,y,m)}}this._handleMargins(),s?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,r,i){const{ticks:{align:o,padding:a},position:s}=this.options,l=this.labelRotation!==0,u=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;
42l?u?(d=i*e.width,h=r*n.height):(d=r*e.height,h=i*n.width):o==="start"?h=n.width:o==="end"?d=e.width:o!=="inner"&&(d=e.width/2,h=n.width/2),this.paddingLeft=Math.max((d-c+a)*this.width/(this.width-c),0),this.paddingRight=Math.max((h-f+a)*this.width/(this.width-f),0)}else{let c=n.height/2,f=e.height/2;o==="start"?(c=0,f=e.height):o==="end"&&(c=n.height,f=0),this.paddingTop=c+a,this.paddingBottom=f+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Ie(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,r;for(n=0,r=e.length;n<r;n++)we(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Gs(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:i,_longestTextCache:o}=this,a=[],s=[],l=Math.floor(n/zs(n,r));let u=0,c=0,f,d,h,p,m,y,w,_,C,E,I;for(f=0;f<n;f+=l){if(p=e[f].label,m=this._resolveTickFontOptions(f),i.font=y=m.string,w=o[y]=o[y]||{data:{},gc:[]},_=m.lineHeight,C=E=0,!we(p)&&!Ve(p))C=_s(i,w.data,w.gc,C,p),E=_;else if(Ve(p))for(d=0,h=p.length;d<h;++d)I=p[d],!we(I)&&!Ve(I)&&(C=_s(i,w.data,w.gc,C,I),E+=_);a.push(C),s.push(E),u=Math.max(C,u),c=Math.max(E,c)}x2(o,n);const O=a.indexOf(u),x=s.indexOf(c),R=N=>({width:a[N]||0,height:s[N]||0});return{first:R(0),last:R(n-1),widest:R(O),highest:R(x),widths:a,heights:s}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return Cv(this._alignToPixels?yn(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const r=n[e];return r.$context||(r.$context=_2(this.getContext(),e,r))}return this.$context||(this.$context=w2(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=An(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=e.autoSkipPadding||0,s=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*r>s*i?s/r:l/i:l*i<s*r?l/r:s/i}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:a,border:s}=i,l=o.offset,u=this.isHorizontal(),f=this.ticks.length+(l?1:0),d=gr(o),h=[],p=s.setContext(this.getContext()),m=p.display?p.width:0,y=m/2,w=function(De){return yn(r,De,m)};let _,C,E,I,O,x,R,N,F,W,$,Z;if(a==="top")_=w(this.bottom),x=this.bottom-d,N=_-y,W=w(e.top)+y,Z=e.bottom;else if(a==="bottom")_=w(this.top),W=e.top,Z=w(e.bottom)-y,x=_+y,N=this.top+d;else if(a==="left")_=w(this.right),O=this.right-d,R=_-y,F=w(e.left)+y,$=e.right;else if(a==="right")_=w(this.left),F=e.left,$=w(e.right)-y,O=_+y,R=this.left+d;else if(n==="x"){if(a==="center")_=w((e.top+e.bottom)/2+.5);else if(se(a)){const De=Object.keys(a)[0],Ze=a[De];_=w(this.chart.scales[De].getPixelForValue(Ze))}W=e.top,Z=e.bottom,x=_+y,N=x+d}else if(n==="y"){if(a==="center")_=w((e.left+e.right)/2);else if(se(a)){const De=Object.keys(a)[0],Ze=a[De];_=w(this.chart.scales[De].getPixelForValue(Ze))}O=_-y,R=O-d,F=e.left,$=e.right}const Ae=ce(i.ticks.maxTicksLimit,f),ee=Math.max(1,Math.ceil(f/Ae));for(C=0;C<f;C+=ee){const De=this.getContext(C),Ze=o.setContext(De),Zt=s.setContext(De),Hr=Ze.lineWidth,Rn=Ze.color,Wr=Zt.dash||[],Dn=Zt.dashOffset,sr=Ze.tickWidth,dn=Ze.tickColor,lr=Ze.tickBorderDash||[],hn=Ze.tickBorderDashOffset;E=y2(this,C,l),E!==void 0&&(I=yn(r,E,Hr),u?O=R=F=$=I:x=N=W=Z=I,h.push({tx1:O,ty1:x,tx2:R,ty2:N,x1:F,y1:W,x2:$,y2:Z,width:Hr,color:Rn,borderDash:Wr,borderDashOffset:Dn,tickWidth:sr,tickColor:dn,tickBorderDash:lr,tickBorderDashOffset:hn}))}return this._ticksLength=f,this._borderValue=_,h}_computeLabelItems(e){const n=this.axis,r=this.options,{position:i,ticks:o}=r,a=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:u,padding:c,mirror:f}=o,d=gr(r.grid),h=d+c,p=f?-c:h,m=-An(this.labelRotation),y=[];let w,_,C,E,I,O,x,R,N,F,W,$,Z="middle";if(i==="top")O=this.bottom-p,x=this._getXAxisLabelAlignment();else if(i==="bottom")O=this.top+p,x=this._getXAxisLabelAlignment();else if(i==="left"){const ee=this._getYAxisLabelAlignment(d);x=ee.textAlign,I=ee.x}else if(i==="right"){const ee=this._getYAxisLabelAlignment(d);x=ee.textAlign,I=ee.x}else if(n==="x"){if(i==="center")O=(e.top+e.bottom)/2+h;else if(se(i)){const ee=Object.keys(i)[0],De=i[ee];O=this.chart.scales[ee].getPixelForValue(De)+h}x=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")I=(e.left+e.right)/2-h;else if(se(i)){const ee=Object.keys(i)[0],De=i[ee];I=this.chart.scales[ee].getPixelForValue(De)}x=this._getYAxisLabelAlignment(d).textAlign}n==="y"&&(l==="start"?Z="top":l==="end"&&(Z="bottom"));const Ae=this._getLabelSizes();for(w=0,_=s.length;w<_;++w){C=s[w],E=C.label;const ee=o.setContext(this.getContext(w));R=this.getPixelForTick(w)+o.labelOffset,N=this._resolveTickFontOptions(w),F=N.lineHeight,W=Ve(E)?E.length:1;const De=W/2,Ze=ee.color,Zt=ee.textStrokeColor,Hr=ee.textStrokeWidth;let Rn=x;
42a?(I=R,x==="inner"&&(w===_-1?Rn=this.options.reverse?"left":"right":w===0?Rn=this.options.reverse?"right":"left":Rn="center"),i==="top"?u==="near"||m!==0?$=-W*F+F/2:u==="center"?$=-Ae.highest.height/2-De*F+F:$=-Ae.highest.height+F/2:u==="near"||m!==0?$=F/2:u==="center"?$=Ae.highest.height/2-De*F:$=Ae.highest.height-W*F,f&&($*=-1),m!==0&&!ee.showLabelBackdrop&&(I+=F/2*Math.sin(m))):(O=R,$=(1-W)*F/2);let Wr;if(ee.showLabelBackdrop){const Dn=bt(ee.backdropPadding),sr=Ae.heights[w],dn=Ae.widths[w];let lr=$-Dn.top,hn=0-Dn.left;switch(Z){case"middle":lr-=sr/2;break;case"bottom":lr-=sr;break}switch(x){case"center":hn-=dn/2;break;case"right":hn-=dn;break;case"inner":w===_-1?hn-=dn:w>0&&(hn-=dn/2);break}Wr={left:hn,top:lr,width:dn+Dn.width,height:sr+Dn.height,color:ee.backdropColor}}y.push({label:E,font:N,textOffset:$,options:{rotation:m,color:Ze,strokeColor:Zt,strokeWidth:Hr,textAlign:Rn,textBaseline:Z,translation:[I,O],backdrop:Wr}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-An(this.labelRotation))return e==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,a=this._getLabelSizes(),s=e+o,l=a.widest.width;let u,c;return n==="left"?i?(c=this.right+o,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-s,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):n==="right"?i?(c=this.left+o,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+s,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};
42if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:r,top:i,width:o,height:a}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,i,o,a),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===e);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,a;const s=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(o=0,a=i.length;o<a;++o){const l=i[o];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),a=r.display?o.width:0;if(!a)return;const s=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,f,d;this.isHorizontal()?(u=yn(e,this.left,a)-a/2,c=yn(e,this.right,s)+s/2,f=d=l):(f=yn(e,this.top,a)-a/2,d=yn(e,this.bottom,s)+s/2,u=c=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(u,f),n.lineTo(c,d),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&ua(r,i);const o=this.getLabelItems(e);for(const a of o){const s=a.options,l=a.font,u=a.label,c=a.textOffset;Lr(r,u,0,c,l,s)}i&&ca(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=et(r.font),a=bt(r.padding),s=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||se(n)?(l+=a.bottom,Ve(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=a.top;const{titleX:u,titleY:c,maxWidth:f,rotation:d}=C2(this,l,n,s);Lr(e,r.text,0,0,o,{color:r.color,maxWidth:f,rotation:d,textAlign:b2(s,n,i),textBaseline:"middle",translation:[u,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,r=ce(e.grid&&e.grid.z,-1),i=ce(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==ar.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,a;for(o=0,a=n.length;o<a;++o){const s=n[o];s[r]===this.id&&(!e||s.type===e)&&i.push(s)}return i}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return et(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ii{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let r;S2(n)&&(r=this.register(n));const i=this.items,o=e.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in i||(i[o]=e,A2(e,a,r),this.override&&ke.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,i=this.scope;r in n&&delete n[r],i&&r in ke[i]&&(delete ke[i][r],this.override&&delete Tn[r])}}function A2(t,e,n){const r=Br(Object.create(null),[n?ke.get(n):{},ke.get(e),t.defaults]);ke.set(e,r),t.defaultRoutes&&E2(e,t.defaultRoutes),t.descriptors&&ke.describe(e,t.descriptors)}function E2(t,e){Object.keys(e).forEach(n=>{const r=n.split("."),i=r.pop(),o=[t].concat(r).join("."),a=e[n].split("."),s=a.pop(),l=a.join(".");ke.route(o,i,l,s)})}function S2(t){return"id"in t&&"defaults"in t}
42class I2{constructor(){this.controllers=new ii(Ru,"datasets",!0),this.elements=new ii(or,"elements"),this.plugins=new ii(Object,"plugins"),this.scales=new ii(ar,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(e,o,i):pe(i,a=>{const s=r||this._getRegistryForType(a);this._exec(e,s,a)})})}_exec(e,n,r){const i=aa(e);Ie(r["before"+i],[],r),n[e](r),Ie(r["after"+i],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const i=n.get(e);if(i===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return i}}var kt=new I2;class T2{constructor(){this._init=[]}notify(e,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=i?this._descriptors(e).filter(i):this._descriptors(e),a=this._notify(o,e,n,r);return n==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,n,r,i){i=i||{};for(const o of e){const a=o.plugin,s=a[r],l=[n,i,o.options];if(Ie(s,l,a)===!1&&i.cancelable)return!1}return!0}invalidate(){we(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const r=e&&e.config,i=ce(r.options&&r.options.plugins,{}),o=O2(r);return i===!1&&!n?[]:R2(e,o,i,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,i=(o,a)=>o.filter(s=>!a.some(l=>s.plugin.id===l.plugin.id));this._notify(i(n,r),e,"stop"),this._notify(i(r,n),e,"start")}}function O2(t){const e={},n=[],r=Object.keys(kt.plugins.items);for(let o=0;o<r.length;o++)n.push(kt.getPlugin(r[o]));const i=t.plugins||[];for(let o=0;o<i.length;o++){const a=i[o];n.indexOf(a)===-1&&(n.push(a),e[a.id]=!0)}return{plugins:n,localIds:e}}function M2(t,e){return!e&&t===!1?null:t===!0?{}:t}function R2(t,{plugins:e,localIds:n},r,i){const o=[],a=t.getContext();for(const s of e){const l=s.id,u=M2(r[l],i);u!==null&&o.push({plugin:s,options:D2(t.config,{plugin:s,local:n[l]},u,a)})}return o}function D2(t,{plugin:e,local:n},r,i){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(r,o);return n&&e.defaults&&a.push(e.defaults),t.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Po(t,e){const n=ke.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function k2(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function P2(t,e){return t===e?"_index_":"_value_"}function Xs(t){if(t==="x"||t==="y"||t==="r")return t}function N2(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function No(t,...e){if(Xs(t))return t;for(const n of e){const r=n.axis||N2(n.position)||t.length>1&&Xs(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function js(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function B2(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return js(t,"x",n[0])||js(t,"y",n[0])}return{}}function F2(t,e){const n=Tn[t.type]||{scales:{}},r=e.scales||{},i=Po(t.type,e),o=Object.create(null);return Object.keys(r).forEach(a=>{const s=r[a];if(!se(s))return console.error(`Invalid scale configuration for scale: ${a}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=No(a,s,B2(a,t),ke.scales[s.type]),u=P2(l,i),c=n.scales||{};o[a]=Tr(Object.create(null),[{axis:l},s,c[l],c[u]])}
42),t.data.datasets.forEach(a=>{const s=a.type||t.type,l=a.indexAxis||Po(s,e),c=(Tn[s]||{}).scales||{};Object.keys(c).forEach(f=>{const d=k2(f,l),h=a[d+"AxisID"]||d;o[h]=o[h]||Object.create(null),Tr(o[h],[{axis:d},r[h],c[f]])})}),Object.keys(o).forEach(a=>{const s=o[a];Tr(s,[ke.scales[s.type],ke.scale])}),o}function Lu(t){const e=t.options||(t.options={});e.plugins=ce(e.plugins,{}),e.scales=F2(t,e)}function Vu(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function L2(t){return t=t||{},t.data=Vu(t.data),Lu(t),t}const Ys=new Map,Uu=new Set;function oi(t,e){let n=Ys.get(t);return n||(n=e(),Ys.set(t,n),Uu.add(n)),n}const vr=(t,e,n)=>{const r=jn(e,n);r!==void 0&&t.add(r)};class V2{constructor(e){this._config=L2(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Vu(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Lu(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return oi(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return oi(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return oi(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return oi(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let i=r.get(e);return(!i||n)&&(i=new Map,r.set(e,i)),i}getOptionScopes(e,n,r){const{options:i,type:o}=this,a=this._cachedScopes(e,r),s=a.get(n);if(s)return s;const l=new Set;n.forEach(c=>{e&&(l.add(e),c.forEach(f=>vr(l,e,f))),c.forEach(f=>vr(l,i,f)),c.forEach(f=>vr(l,Tn[o]||{},f)),c.forEach(f=>vr(l,ke,f)),c.forEach(f=>vr(l,ko,f))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),Uu.has(n)&&a.set(n,u),u}chartOptionScopes(){const{options:e,type:n}=this;return[e,Tn[n]||{},ke.datasets[n]||{},{type:n},ke,ko]}resolveNamedOptions(e,n,r,i=[""]){const o={$shared:!0},{resolver:a,subPrefixes:s}=Zs(this._resolverCache,e,i);let l=a;if($2(a,n)){o.$shared=!1,r=fn(r)?r():r;const u=this.createResolver(e,r,s);l=Yn(a,r,u)}for(const u of n)o[u]=l[u];return o}createResolver(e,n,r=[""],i){const{resolver:o}=Zs(this._resolverCache,e,r);return se(n)?Yn(o,n,void 0,i):o}}function Zs(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const i=n.join();let o=r.get(i);return o||(o={resolver:fa(e,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,o)),o}const U2=t=>se(t)&&Object.getOwnPropertyNames(t).some(e=>fn(t[e]));function $2(t,e){const{isScriptable:n,isIndexable:r}=Cu(t);for(const i of e){const o=n(i),a=r(i),s=(a||o)&&t[i];if(o&&(fn(s)||U2(s))||a&&Ve(s))return!0}return!1}var H2="4.5.0";const W2=["top","bottom","left","right","chartArea"];function qs(t,e){return t==="top"||t==="bottom"||W2.indexOf(t)===-1&&e==="x"}function Qs(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function Js(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Ie(n&&n.onComplete,[t],e)}function z2(t){const e=t.chart,n=e.options.animation;Ie(n&&n.onProgress,[t],e)}function $u(t){return pa()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const pi={},el=t=>{const e=$u(t);return Object.values(pi).filter(n=>n.canvas===e).pop()};function G2(t,e,n){const r=Object.keys(t);for(const i of r){const o=+i;if(o>=e){const a=t[i];delete t[i],(n>0||o>e)&&(t[o+n]=a)}}}function K2(t,e,n,r){return!n||t.type==="mouseout"?null:r?e:t}class ma{static defaults=ke;static instances=pi;static overrides=Tn;static registry=kt;static version=H2;static getChart=el;static register(...e){kt.add(...e),tl()}static unregister(...e){kt.remove(...e),tl()}constructor(e,n){const r=this.config=new V2(n),i=$u(e),o=el(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||c2(i)),this.platform.updateConfig(r);const s=this.platform.acquireContext(i,a.aspectRatio),l=s&&s.canvas,u=l&&l.height,c=l&&l.width;if(this.id=sv(),this.ctx=s,this.canvas=l,this.width=c,this.height=u,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new T2,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Iv(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],pi[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Wt.listen(this,"complete",Js),Wt.listen(this,"progress",z2),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return we(e)?n&&o?o:i?r/i:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return kt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ss(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return bs(this.canvas,this.ctx),this}stop(){return Wt.stop(this),this}resize(e,n){Wt.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(i,e,n,o),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Ss(this,s,!0)&&(this.notifyPlugins("resize",{size:a}),Ie(r.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};pe(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,i=Object.keys(r).reduce((a,s)=>(a[s]=!1,a),{});let o=[];
42n&&(o=o.concat(Object.keys(n).map(a=>{const s=n[a],l=No(a,s),u=l==="r",c=l==="x";return{options:s,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),pe(o,a=>{const s=a.options,l=s.id,u=No(l,s),c=ce(s.type,a.dtype);(s.position===void 0||qs(s.position,u)!==qs(a.dposition))&&(s.position=a.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===c)f=r[l];else{const d=kt.getScale(c);f=new d({id:l,type:c,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(s,e)}),pe(i,(a,s)=>{a||delete r[s]}),pe(r,a=>{xt.configure(this,a,a.options),xt.addBox(this,a)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(Qs("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let a=this.getDatasetMeta(r);const s=o.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=s,a.indexAxis=o.indexAxis||Po(s,this.options),a.order=o.order||0,a.index=r,a.label=""+o.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{const l=kt.getController(s),{datasetElementType:u,dataElementType:c}=ke.datasets[s];Object.assign(l,{dataElementType:kt.getElement(c),datasetElementType:u&&kt.getElement(u)}),a.controller=new l(this,r),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){pe(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:f}=this.getDatasetMeta(u),d=!i&&o.indexOf(f)===-1;f.buildOrUpdateElements(d),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),i||pe(o,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Qs("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){pe(this.scales,e=>{xt.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!ds(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const a=r==="_removeElements"?-o:o;G2(e,i,a)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(e.filter(a=>a[0]===o).map((a,s)=>s+","+a.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!ds(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xt.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],pe(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,fn(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),i={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Wt.has(this)?this.attached&&!Wt.running(this)&&Wt.start(this):(this.draw(),Js({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const a=n[i];(!e||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,r={meta:e,index:e.index,cancelable:!0},i=dm(this,e);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&ua(n,i),e.controller.draw(),i&&ca(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return wu(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,i){const o=Wm.modes[n];return typeof o=="function"?o(this,e,r,i):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();
42return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=ir(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(e),a=o.controller._resolveAnimations(void 0,i);Fr(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),a.update(o,{visible:r}),this.update(s=>s.datasetIndex===e?i:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Wt.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),bs(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete pi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,r=(o,a)=>{n.addEventListener(this,o,a),e[o]=a},i=(o,a,s)=>{o.offsetX=a,o.offsetY=s,this._eventHandler(o)};pe(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),e[l]=u},i=(l,u)=>{e[l]&&(n.removeEventListener(this,l,u),delete e[l])},o=(l,u)=>{this.canvas&&this.resize(l,u)};let a;const s=()=>{i("attach",s),this.attached=!0,this.resize(),r("resize",o),r("detach",a)};a=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():a()}unbindEvents(){pe(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},pe(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const i=r?"set":"remove";let o,a,s,l;for(n==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=e.length;s<l;++s){a=e[s];const u=a&&this.getDatasetMeta(a.datasetIndex).controller;u&&u[i+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:o,index:a})=>{const s=this.getDatasetMeta(o);if(!s)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:s.data[a],index:a}});!wi(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const i=this.options.hover,o=(l,u)=>l.filter(c=>!u.some(f=>c.datasetIndex===f.datasetIndex&&c.index===f.index)),a=o(n,e),s=r?e:o(e,n);a.length&&this.updateHoverStyle(a,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},i=a=>(a.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:i=[],options:o}=this,a=n,s=this._getActiveElements(e,i,r,a),l=hv(e),u=K2(e,this._lastEvent,r,l);r&&(this._lastEvent=null,Ie(o.onHover,[e,s,this],this),l&&Ie(o.onClick,[e,s,this],this));const c=!wi(s,i);return(c||n)&&(this._active=s,this._updateHoverStyles(s,i,n)),this._lastEvent=u,c}_getActiveElements(e,n,r,i){if(e.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,i)}}function tl(){return pe(ma.instances,t=>t._plugins.invalidate())}
42function Hu(t,e){const{x:n,y:r,base:i,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let s,l,u,c,f;return t.horizontal?(f=a/2,s=Math.min(n,i),l=Math.max(n,i),u=r-f,c=r+f):(f=o/2,s=n-f,l=n+f,u=Math.min(r,i),c=Math.max(r,i)),{left:s,top:u,right:l,bottom:c}}function nn(t,e,n,r){return t?0:Ot(e,n,r)}function X2(t,e,n){const r=t.options.borderWidth,i=t.borderSkipped,o=bu(r);return{t:nn(i.top,o.top,0,n),r:nn(i.right,o.right,0,e),b:nn(i.bottom,o.bottom,0,n),l:nn(i.left,o.left,0,e)}}function j2(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),i=t.options.borderRadius,o=$n(i),a=Math.min(e,n),s=t.borderSkipped,l=r||se(i);return{topLeft:nn(!l||s.top||s.left,o.topLeft,0,a),topRight:nn(!l||s.top||s.right,o.topRight,0,a),bottomLeft:nn(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:nn(!l||s.bottom||s.right,o.bottomRight,0,a)}}function Y2(t){const e=Hu(t),n=e.right-e.left,r=e.bottom-e.top,i=X2(t,n/2,r/2),o=j2(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:o},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function oo(t,e,n,r){const i=e===null,o=n===null,s=t&&!(i&&o)&&Hu(t,r);return s&&(i||Ln(e,s.left,s.right))&&(o||Ln(n,s.top,s.bottom))}function Z2(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function q2(t,e){t.rect(e.x,e.y,e.w,e.h)}function ao(t,e,n={}){const r=t.x!==n.x?-e:0,i=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-r,a=(t.y+t.h!==n.y+n.h?e:0)-i;return{x:t.x+r,y:t.y+i,w:t.w+o,h:t.h+a,radius:t.radius}}class Q2 extends or{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:a}=Y2(this),s=Z2(a.radius)?Ai:q2;e.save(),(a.w!==o.w||a.h!==o.h)&&(e.beginPath(),s(e,ao(a,n,o)),e.clip(),s(e,ao(o,-n,a)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),s(e,ao(o,n)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,n,r){return oo(this,e,n,r)}inXRange(e,n){return oo(this,e,null,n)}inYRange(e,n){return oo(this,null,e,n)}getCenterPoint(e){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}const nl=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},J2=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class rl extends or{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,r){this.maxWidth=e,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=Ie(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(r=>e.filter(r,this.chart.data))),e.sort&&(n=n.sort((r,i)=>e.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const r=e.labels,i=et(r.font),o=i.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=nl(r,o);let u,c;n.font=i.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(a,o,s,l)+10):(c=this.maxHeight,u=this._fitCols(a,i,s,l)+10),this.width=Math.min(u,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,n,r,i){const{ctx:o,maxWidth:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=i+s;let f=e;o.textAlign="left",o.textBaseline="middle";let d=-1,h=-c;
42return this.legendItems.forEach((p,m)=>{const y=r+n/2+o.measureText(p.text).width;(m===0||u[u.length-1]+y+2*s>a)&&(f+=c,u[u.length-(m>0?0:1)]=0,h+=c,d++),l[m]={left:0,top:h,row:d,width:y,height:i},u[u.length-1]+=y+s}),f}_fitCols(e,n,r,i){const{ctx:o,maxHeight:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=a-e;let f=s,d=0,h=0,p=0,m=0;return this.legendItems.forEach((y,w)=>{const{itemWidth:_,itemHeight:C}=ey(r,n,o,y,i);w>0&&h+C+2*s>c&&(f+=d+s,u.push({width:d,height:h}),p+=d+s,m++,d=h=0),l[w]={left:p,top:h,col:m,width:_,height:C},d=Math.max(d,_),h+=C+s}),f+=d,u.push({width:d,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,a=Hn(o,this.left,this.width);if(this.isHorizontal()){let s=0,l=qe(r,this.left+i,this.right-this.lineWidths[s]);for(const u of n)s!==u.row&&(s=u.row,l=qe(r,this.left+i,this.right-this.lineWidths[s])),u.top+=this.top+e+i,u.left=a.leftForLtr(a.x(l),u.width),l+=u.width+i}else{let s=0,l=qe(r,this.top+e+i,this.bottom-this.columnSizes[s].height);for(const u of n)u.col!==s&&(s=u.col,l=qe(r,this.top+e+i,this.bottom-this.columnSizes[s].height)),u.top=l,u.left+=this.left+i,u.left=a.leftForLtr(a.x(u.left),u.width),l+=u.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;ua(e,this),this._draw(),ca(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:a}=e,s=ke.color,l=Hn(e.rtl,this.left,this.width),u=et(a.font),{padding:c}=a,f=u.size,d=f/2;let h;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:p,boxHeight:m,itemHeight:y}=nl(a,f),w=function(O,x,R){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;i.save();const N=ce(R.lineWidth,1);if(i.fillStyle=ce(R.fillStyle,s),i.lineCap=ce(R.lineCap,"butt"),i.lineDashOffset=ce(R.lineDashOffset,0),i.lineJoin=ce(R.lineJoin,"miter"),i.lineWidth=N,i.strokeStyle=ce(R.strokeStyle,s),i.setLineDash(ce(R.lineDash,[])),a.usePointStyle){const F={radius:m*Math.SQRT2/2,pointStyle:R.pointStyle,rotation:R.rotation,borderWidth:N},W=l.xPlus(O,p/2),$=x+d;xu(i,F,W,$,a.pointStyleWidth&&p)}else{const F=x+Math.max((f-m)/2,0),W=l.leftForLtr(O,p),$=$n(R.borderRadius);i.beginPath(),Object.values($).some(Z=>Z!==0)?Ai(i,{x:W,y:F,w:p,h:m,radius:$}):i.rect(W,F,p,m),i.fill(),N!==0&&i.stroke()}i.restore()},_=function(O,x,R){Lr(i,R.text,O,x+y/2,u,{strikethrough:R.hidden,textAlign:l.textAlign(R.textAlign)})},C=this.isHorizontal(),E=this._computeTitleHeight();C?h={x:qe(o,this.left+c,this.right-r[0]),y:this.top+c+E,line:0}:h={x:this.left+c,y:qe(o,this.top+E+c,this.bottom-n[0].height),line:0},Iu(this.ctx,e.textDirection);const I=y+c;this.legendItems.forEach((O,x)=>{i.strokeStyle=O.fontColor,i.fillStyle=O.fontColor;const R=i.measureText(O.text).width,N=l.textAlign(O.textAlign||(O.textAlign=a.textAlign)),F=p+d+R;let W=h.x,$=h.y;l.setWidth(this.width),C?x>0&&W+F+c>this.right&&($=h.y+=I,h.line++,W=h.x=qe(o,this.left+c,this.right-r[h.line])):x>0&&$+I>this.bottom&&(W=h.x=W+n[h.line].width+c,h.line++,$=h.y=qe(o,this.top+E+c,this.bottom-n[h.line].height));const Z=l.x(W);if(w(Z,$,O),W=Tv(N,W+p+d,C?W+F:this.right,e.rtl),_(l.x(W),$,O),C)h.x+=F+c;else if(typeof O.text!="string"){const Ae=u.lineHeight;h.y+=Wu(O,Ae)+c}else h.y+=I}),Tu(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,r=et(n.font),i=bt(n.padding);if(!n.display)return;const o=Hn(e.rtl,this.left,this.width),a=this.ctx,s=n.position,l=r.size/2,u=i.top+l;let c,f=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+u,f=qe(e.align,f,this.right-d);else{const p=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);c=u+qe(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const h=qe(s,f,f+d);a.textAlign=o.textAlign(la(s)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=r.string,Lr(a,n.text,h,c,r)}_computeTitleHeight(){const e=this.options.title,n=et(e.font),r=bt(e.padding);return e.display?n.lineHeight+r.height:0}_getLegendItemAt(e,n){let r,i,o;if(Ln(e,this.left,this.right)&&Ln(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],Ln(e,i.left,i.left+i.width)&&Ln(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(e){const n=this.options;if(!ry(e.type,n))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const i=this._hoveredItem,o=J2(i,r);i&&!o&&Ie(n.onLeave,[e,i,this],this),this._hoveredItem=r,r&&!o&&Ie(n.onHover,[e,r,this],this)}else r&&Ie(n.onClick,[e,r,this],this)}}function ey(t,e,n,r,i){const o=ty(r,t,e,n),a=ny(i,r,e.lineHeight);return{itemWidth:o,itemHeight:a}}function ty(t,e,n,r){let i=t.text;
42return i&&typeof i!="string"&&(i=i.reduce((o,a)=>o.length>a.length?o:a)),e+n.size/2+r.measureText(i).width}function ny(t,e,n){let r=t;return typeof e.text!="string"&&(r=Wu(e,n)),r}function Wu(t,e){const n=t.text?t.text.length:0;return e*n}function ry(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var iy={id:"legend",_element:rl,start(t,e,n){const r=t.legend=new rl({ctx:t.ctx,options:n,chart:t});xt.configure(t,r,n),xt.addBox(t,r)},stop(t){xt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;xt.configure(t,r,n),r.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const r=e.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),e.hidden=!0):(i.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:a,borderRadius:s}}=t.legend.options;
42return t._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),c=bt(u.borderWidth);return{text:e[l.index].label,fillStyle:u.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:i||u.textAlign,borderRadius:a&&(s||u.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class zu extends or{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const i=Ve(r.text)?r.text.length:1;this._padding=bt(r.padding);const o=i*et(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:r,bottom:i,right:o,options:a}=this,s=a.align;let l=0,u,c,f;return this.isHorizontal()?(c=qe(s,r,o),f=n+e,u=o-r):(a.position==="left"?(c=r+e,f=qe(s,i,n),l=tt*-.5):(c=o-e,f=qe(s,n,i),l=tt*.5),u=i-n),{titleX:c,titleY:f,maxWidth:u,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const r=et(n.font),o=r.lineHeight/2+this._padding.top,{titleX:a,titleY:s,maxWidth:l,rotation:u}=this._drawArgs(o);Lr(e,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:la(n.align),textBaseline:"middle",translation:[a,s]})}}function oy(t,e){const n=new zu({ctx:t.ctx,options:e,chart:t});xt.configure(t,n,e),xt.addBox(t,n),t.titleBlock=n}var ay={id:"title",_element:zu,start(t,e,n){oy(t,n)},stop(t){const e=t.titleBlock;xt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;xt.configure(t,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ar={average(t){if(!t.length)return!1;let e,n,r=new Set,i=0,o=0;for(e=0,n=t.length;e<n;++e){const s=t[e].element;if(s&&s.hasValue()){const l=s.tooltipPosition();r.add(l.x),i+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((s,l)=>s+l)/r.size,y:i/o}},nearest(t,e){if(!t.length)return!1;let n=e.x,r=e.y,i=Number.POSITIVE_INFINITY,o,a,s;for(o=0,a=t.length;o<a;++o){const l=t[o].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=_v(e,u);c<i&&(i=c,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Dt(t,e){return e&&(Ve(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function zt(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(` 43`)>-1?t.split(` 44`):t}function sy(t,e){const{element:n,datasetIndex:r,index:i}=e,o=t.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:t,label:a,parsed:o.getParsed(i),raw:t.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function il(t,e){const n=t.chart.ctx,{body:r,footer:i,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=et(e.bodyFont),u=et(e.titleFont),c=et(e.footerFont),f=o.length,d=i.length,h=r.length,p=bt(e.padding);let m=p.height,y=0,w=r.reduce((E,I)=>E+I.before.length+I.lines.length+I.after.length,0);if(w+=t.beforeBody.length+t.afterBody.length,f&&(m+=f*u.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),w){const E=e.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=h*E+(w-h)*l.lineHeight+(w-1)*e.bodySpacing}d&&(m+=e.footerMarginTop+d*c.lineHeight+(d-1)*e.footerSpacing);let _=0;const C=function(E){y=Math.max(y,n.measureText(E).width+_)};return n.save(),n.font=u.string,pe(t.title,C),n.font=l.string,pe(t.beforeBody.concat(t.afterBody),C),_=e.displayColors?a+2+e.boxPadding:0,pe(r,E=>{pe(E.before,C),pe(E.lines,C),pe(E.after,C)}
44),_=0,n.font=c.string,pe(t.footer,C),n.restore(),y+=p.width,{width:y,height:m}}function ly(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function uy(t,e,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;if(t==="left"&&i+o+a>e.width||t==="right"&&i-o-a<0)return!0}function cy(t,e,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=t;let u="center";return r==="center"?u=i<=(s+l)/2?"left":"right":i<=o/2?u="left":i>=a-o/2&&(u="right"),uy(u,t,e,n)&&(u="center"),u}function ol(t,e,n){const r=n.yAlign||e.yAlign||ly(t,n);return{xAlign:n.xAlign||e.xAlign||cy(t,e,n,r),yAlign:r}}function fy(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function dy(t,e,n){let{y:r,height:i}=t;return e==="top"?r+=n:e==="bottom"?r-=i+n:r-=i/2,r}function al(t,e,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=n,u=i+o,{topLeft:c,topRight:f,bottomLeft:d,bottomRight:h}=$n(a);let p=fy(e,s);const m=dy(e,l,u);return l==="center"?s==="left"?p+=u:s==="right"&&(p-=u):s==="left"?p-=Math.max(c,d)+i:s==="right"&&(p+=Math.max(f,h)+i),{x:Ot(p,0,r.width-e.width),y:Ot(m,0,r.height-e.height)}}function ai(t,e,n){const r=bt(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function sl(t){return Dt([],zt(t))}function hy(t,e,n){return ir(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function ll(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const Gu={beforeTitle:Ht,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:Ht,beforeBody:Ht,beforeLabel:Ht,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return we(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Ht,afterBody:Ht,beforeFooter:Ht,footer:Ht,afterFooter:Ht};function st(t,e,n,r){const i=t[e].call(n,r);return typeof i>"u"?Gu[e].call(n,r):i}class ul extends or{static positioners=Ar;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new Ou(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=hy(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,i=st(r,"beforeTitle",this,e),o=st(r,"title",this,e),a=st(r,"afterTitle",this,e);let s=[];return s=Dt(s,zt(i)),s=Dt(s,zt(o)),s=Dt(s,zt(a)),s}getBeforeBody(e,n){return sl(st(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,i=[];return pe(e,o=>{const a={before:[],lines:[],after:[]},s=ll(r,o);Dt(a.before,zt(st(s,"beforeLabel",this,o))),Dt(a.lines,st(s,"label",this,o)),Dt(a.after,zt(st(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(e,n){return sl(st(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,i=st(r,"beforeFooter",this,e),o=st(r,"footer",this,e),a=st(r,"afterFooter",this,e);let s=[];return s=Dt(s,zt(i)),s=Dt(s,zt(o)),s=Dt(s,zt(a)),s}_createItems(e){const n=this._active,r=this.chart.data,i=[],o=[],a=[];let s=[],l,u;for(l=0,u=n.length;l<u;++l)s.push(sy(this.chart,n[l]));return e.filter&&(s=s.filter((c,f,d)=>e.filter(c,f,d,r))),e.itemSort&&(s=s.sort((c,f)=>e.itemSort(c,f,r))),pe(s,c=>{const f=ll(e.callbacks,c);i.push(st(f,"labelColor",this,c)),o.push(st(f,"labelPointStyle",this,c)),a.push(st(f,"labelTextColor",this,c))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(e,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0}
vendor: 5,383 bytes, line 44
44);else{const s=Ar[r.position].call(this,i,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=il(this,r),u=Object.assign({},s,l),c=ol(this.chart,r,u),f=al(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,i){const o=this.getCaretPosition(e,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(e,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:f}=$n(s),{x:d,y:h}=e,{width:p,height:m}=n;let y,w,_,C,E,I;return o==="center"?(E=h+m/2,i==="left"?(y=d,w=y-a,C=E+a,I=E-a):(y=d+p,w=y+a,C=E-a,I=E+a),_=y):(i==="left"?w=d+Math.max(l,c)+a:i==="right"?w=d+p-Math.max(u,f)-a:w=this.caretX,o==="top"?(C=h,E=C-a,y=w-a,_=w+a):(C=h+m,E=C+a,y=w+a,_=w-a),I=C),{x1:y,x2:w,x3:_,y1:C,y2:E,y3:I}}drawTitle(e,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const u=Hn(r.rtl,this.x,this.width);for(e.x=ai(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",a=et(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(i[l],u.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+s,l+1===o&&(e.y+=r.titleMarginBottom-s)}}_drawColorBox(e,n,r,i,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=o,c=et(o.bodyFont),f=ai(this,"left",o),d=i.x(f),h=l<c.lineHeight?(c.lineHeight-l)/2:0,p=n.y+h;if(o.usePointStyle){const m={radius:Math.min(u,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},y=i.leftForLtr(d,u)+u/2,w=p+l/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,Cs(e,m,y,w),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,Cs(e,m,y,w)}else{e.lineWidth=se(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const m=i.leftForLtr(d,u),y=i.leftForLtr(i.xPlus(d,1),u-2),w=$n(a.borderRadius);Object.values(w).some(_=>_!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,Ai(e,{x:m,y:p,w:u,h:l,radius:w}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),Ai(e,{x:y,y:p+1,w:u-2,h:l-2,radius:w}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(m,p,u,l),e.strokeRect(m,p,u,l),e.fillStyle=a.backgroundColor,e.fillRect(y,p+1,u-2,l-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:u,boxPadding:c}=r,f=et(r.bodyFont);let d=f.lineHeight,h=0;const p=Hn(r.rtl,this.x,this.width),m=function(R){n.fillText(R,p.x(e.x+h),e.y+d/2),e.y+=d+o},y=p.textAlign(a);let w,_,C,E,I,O,x;for(n.textAlign=a,n.textBaseline="middle",n.font=f.string,e.x=ai(this,y,r),n.fillStyle=r.bodyColor,pe(this.beforeBody,m),h=s&&y!=="right"?a==="center"?u/2+c:u+2+c:0,E=0,O=i.length;E<O;++E){for(w=i[E],_=this.labelTextColors[E],n.fillStyle=_,pe(w.before,m),C=w.lines,s&&C.length&&(this._drawColorBox(n,e,E,p,r),d=Math.max(f.lineHeight,l)),I=0,x=C.length;I<x;++I)m(C[I]),d=f.lineHeight;pe(w.after,m)}h=0,d=f.lineHeight,pe(this.afterBody,m),e.y-=o}drawFooter(e,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=Hn(r.rtl,this.x,this.width);for(e.x=ai(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=et(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<o;++s)n.fillText(i[s],l.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+r.footerSpacing}}drawBackground(e,n,r,i){const{xAlign:o,yAlign:a}=this,{x:s,y:l}=e,{width:u,height:c}=r,{topLeft:f,topRight:d,bottomLeft:h,bottomRight:p}=$n(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+f,l),a==="top"&&this.drawCaret(e,n,r,i),n.lineTo(s+u-d,l),n.quadraticCurveTo(s+u,l,s+u,l+d),a==="center"&&o==="right"&&this.drawCaret(e,n,r,i),n.lineTo(s+u,l+c-p),n.quadraticCurveTo(s+u,l+c,s+u-p,l+c),a==="bottom"&&this.drawCaret(e,n,r,i),n.lineTo(s+h,l+c),n.quadraticCurveTo(s,l+c,s,l+c-h),a==="center"&&o==="left"&&this.drawCaret(e,n,r,i),n.lineTo(s,l+f),n.quadraticCurveTo(s,l,s+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const a=Ar[e.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=il(this,e),l=Object.assign({},a,this._size),u=ol(n,e,l),c=al(e,l,u,n);(i._to!==c.x||o._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=bt(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;
44n.enabled&&s&&(e.save(),e.globalAlpha=r,this.drawBackground(o,e,i,n),Iu(e,n.textDirection),o.y+=a.top,this.drawTitle(o,e,n),this.drawBody(o,e,n),this.drawFooter(o,e,n),Tu(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,i=e.map(({datasetIndex:s,index:l})=>{const u=this.chart.getDatasetMeta(s);if(!u)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:u.data[l],index:l}}),o=!wi(r,i),a=this._positionChanged(i,n);(o||a)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(e,o,n,r),s=this._positionChanged(a,e),l=n||!wi(a,o)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,r,i){const o=this.options;if(e.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(e,n){const{caretX:r,caretY:i,options:o}=this,a=Ar[o.position].call(this,e,n);return a!==!1&&(r!==a.x||i!==a.y)}}var py={id:"tooltip",_element:ul,positioners:Ar,afterInit(t,e,n){n&&(t.tooltip=new ul({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Gu},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const gy=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function vy(t,e,n,r){const i=t.indexOf(e);if(i===-1)return gy(t,e,n,r);const o=t.lastIndexOf(e);return i!==o?n:i}const my=(t,e)=>t===null?null:Ot(Math.round(t),0,e);function cl(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class yy extends ar{static id="category";static defaults={ticks:{callback:cl}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(we(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:vy(r,e,ce(n,e),this._addedLabels),my(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=e===0&&n===o.length-1?o:o.slice(e,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=e;a<=n;a++)i.push({value:a});return i}getLabelForValue(e){return cl.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function xy(t,e){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:u,maxTicks:c,maxDigits:f,includeBounds:d}=t,h=o||1,p=c-1,{min:m,max:y}=e,w=!we(a),_=!we(s),C=!we(u),E=(y-m)/(f+1);let I=ps((y-m)/p/h)*h,O,x,R,N;if(I<1e-14&&!w&&!_)return[{value:m},{value:y}];N=Math.ceil(y/I)-Math.floor(m/I),N>
44p&&(I=ps(N*I/p/h)*h),we(l)||(O=Math.pow(10,l),I=Math.ceil(I*O)/O),i==="ticks"?(x=Math.floor(m/I)*I,R=Math.ceil(y/I)*I):(x=m,R=y),w&&_&&o&&mv((s-a)/o,I/1e3)?(N=Math.round(Math.min((s-a)/I,c)),I=(s-a)/N,x=a,R=s):C?(x=w?a:x,R=_?s:R,N=u-1,I=(R-x)/N):(N=(R-x)/I,di(N,Math.round(N),I/1e3)?N=Math.round(N):N=Math.ceil(N));const F=Math.max(gs(I),gs(x));O=Math.pow(10,we(l)?F:l),x=Math.round(x*O)/O,R=Math.round(R*O)/O;let W=0;for(w&&(d&&x!==a?(n.push({value:a}),x<a&&W++,di(Math.round((x+W*I)*O)/O,a,fl(a,E,t))&&W++):x<a&&W++);W<N;++W){const $=Math.round((x+W*I)*O)/O;if(_&&$>s)break;n.push({value:$})}return _&&d&&R!==s?n.length&&di(n[n.length-1].value,s,fl(s,E,t))?n[n.length-1].value=s:n.push({value:s}):(!_||R===s)&&n.push({value:R}),n}function fl(t,e,{horizontal:n,minRotation:r}){const i=An(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class wy extends ar{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return we(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const a=l=>i=n?i:l,s=l=>o=r?o:l;if(e){const l=un(i),u=un(o);l<0&&u<0?s(0):l>0&&u>0&&a(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);s(o+l),e||a(i-l)}this.min=i,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=xy(i,o);return e.bounds==="ticks"&&yv(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const i=(r-n)/Math.max(e.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return mu(e,this.chart.options.locale,this.options.ticks.format)}}class _y extends wy{static id="linear";static defaults={ticks:{callback:yu.formatters.numeric}};determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=_t(e)?e:0,this.max=_t(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=An(this.options.ticks.minRotation),i=(e?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const Li={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}},ut=Object.keys(Li);function dl(t,e){return t-e}function hl(t,e){if(we(e))return null;const n=t._adapter,{parser:r,round:i,isoWeekday:o}=t._parseOpts;let a=e;return typeof r=="function"&&(a=r(a)),_t(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(Ci(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function pl(t,e,n,r){const i=ut.length;for(let o=ut.indexOf(t);o<i-1;++o){const a=Li[ut[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-e)/(s*a.size))<=r)return ut[o]}return ut[i-1]}function by(t,e,n,r,i){for(let o=ut.length-1;o>=ut.indexOf(n);o--){const a=ut[o];if(Li[a].common&&t._adapter.diff(i,r,a)>=e-1)return a}return ut[n?ut.indexOf(n):0]}function Cy(t){for(let e=ut.indexOf(t)+1,n=ut.length;e<n;++e)if(Li[ut[e]].common)return ut[e]}function gl(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:i}=sa(n,e),o=n[r]>=e?n[r]:n[i];t[o]=!0}}function Ay(t,e,n,r){const i=t._adapter,o=+i.startOf(e[0].value,r),a=e[e.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(e[l].major=!0);return e}function vl(t,e,n){const r=[],i={},o=e.length;let a,s;for(a=0;a<o;++a)s=e[a],i[s]=a,r.push({value:s,major:!1});return o===0||!n?r:Ay(t,r,i,n)}class ml extends ar{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const r=e.time||(e.time={}),i=this._adapter=new Lm._date(e.adapters.date);i.init(n),Tr(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:hl(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function l(u){!a&&!isNaN(u.min)&&(i=Math.min(i,u.min)),!s&&!isNaN(u.max)&&(o=Math.max(o,u.max))}(!a||!s)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=_t(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=_t(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();
44e.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,s=Ev(i,o,a);return this._unit=n.unit||(r.autoSkip?pl(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):by(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Cy(this._unit),this.initOffsets(i),e.reverse&&s.reverse(),vl(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,i,o;this.options.offset&&e.length&&(i=this.getDecimalForValue(e[0]),e.length===1?n=1-i:n=(this.getDecimalForValue(e[1])-i)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?r=o:r=(o-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;n=Ot(n,0,a),r=Ot(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,a=o.unit||pl(o.minUnit,n,r,this._getLabelCapacity(n)),s=ce(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,u=Ci(l)||l===!0,c={};let f=n,d,h;if(u&&(f=+e.startOf(f,"isoWeek",l)),f=+e.startOf(f,u?"day":a),e.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const p=i.ticks.source==="data"&&this.getDataTimestamps();for(d=f,h=0;d<r;d=+e.add(d,s,a),h++)gl(c,d,p);return(d===r||i.bounds==="ticks"||h===1)&&gl(c,d,p),Object.keys(c).sort(dl).map(m=>+m)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const i=this.options.time.displayFormats,o=this._unit,a=n||i[o];return this._adapter.format(e,a)}_tickFormatFunction(e,n,r,i){const o=this.options,a=o.ticks.callback;if(a)return Ie(a,[e,n,r],this);const s=o.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&s[l],f=u&&s[u],d=r[n],h=u&&f&&d&&d.major;return this._adapter.format(e,i||(h?f:c))}generateTickLabels(e){let n,r,i;for(n=0,r=e.length;n<r;++n)i=e[n],i.label=this._tickFormatFunction(i.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,i=An(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(e,0,vl(this,[e],this._majorUnit),i),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)e=e.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)e.push(hl(this,i[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return hu(e.sort(dl))}}function si(t,e,n){let r=0,i=t.length-1,o,a,s,l;n?(e>=t[r].pos&&e<=t[i].pos&&({lo:r,hi:i}=Do(t,"pos",e)),{pos:o,time:s}=t[r],{pos:a,time:l}=t[i]):(e>=t[r].time&&e<=t[i].time&&({lo:r,hi:i}=Do(t,"time",e)),{time:o,pos:s}=t[r],{time:a,pos:l}=t[i]);const u=a-o;return u?s+(l-s)*(e-o)/u:s}class vx extends ml{static id="timeseries";static defaults=ml.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=si(n,this.min),this._tableRange=si(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,i=[],o=[];let a,s,l,u,c;for(a=0,s=e.length;a<s;++a)u=e[a],u>=n&&u<=r&&i.push(u);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=i.length;a<s;++a)c=i[a+1],l=i[a-1],u=i[a],Math.round((c+l)/2)!==u&&o.push({time:u,pos:a/(s-1)});return o}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(si(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return si(this._table,r*this._tableRange+this._minPos,!0)}}ma.register(ay,py,iy,Q2,yy,_y,Fm);const Ey={name:"GraphComponent",emits:["close"],data(){return{tab:1,selectPivotColumn:!1,pivotCreated:!1,RowWiseCreated:!1,OccurenceCreated:!1,pivotColumn:"",sampleC
44olors:["rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(54, 162, 235)","rgb(153, 102, 255)","rgb(201, 203, 207)"]}},watch:{tab(t){switch(t){case 1:this.createOccurence();break;case 2:this.$nextTick(()=>{this.createRowWise()});break;case 3:this.$nextTick(()=>{this.createPivotTable()});break}}},computed:{isNumber(){return this.column?.type==="INTEGER"||this.column?.type==="FORMULA"},...K(ae,["getChartData","getRowWiseData","getPivotData"]),...K(Pe,{column:"getActiveColumn",sortedColumnKeys:"sortedColumnKeys",columns:"columns"})},methods:{changeCategory(){const t=document.getElementById("chart3");if(!t)return;t.remove();const e=document.getElementById("chartaxis3");if(!e)return;e.remove();const n=document.createElement("canvas");n.id="chart3";const r=document.createElement("canvas");r.height=300,r.width=0,r.style.position="fixed",r.style.left="0",r.style.top="64px",r.style.pointerEvents="none",r.id="chartaxis3";const i=document.getElementsByClassName("cc3")[0];if(!i)return;i.appendChild(n);const o=document.getElementsByClassName("cw3")[0];o&&(o.appendChild(r),this.$nextTick(()=>{this.pivotCreated=!1,this.pivotColumn="",this.selectPivotColumn=!0}))},...ve(ae,["setPivotColumn"]),createChart(t,e){const n=this.column?.type??"STRING",r=this.column?.subType??{};let i;switch(n){case"INTEGER":i=Object.entries(t).map(([c,f])=>{if(this.tab===1)return[Kt.getFormattedCellValueForNumbers(c,r),f];if(this.tab===2)return[c,f];if(this.tab===3){const d=this.sortedColumnKeys.find(p=>p===this.pivotColumn);switch(d?this.columns?.[d]?.type:"STRING"){case"INTEGER":return[parseFloat(c),f];case"DATEONLY":return[Kt.getFormattedCellValueForDate(c),f];case"TIME":return[Kt.getFormattedCellValueForTime(c),f];case"CHECKBOX":return[c==="true",f];default:return[c,f]}}return null}),t=Object.fromEntries(i);break;case"DATEONLY":i=Object.entries(t).map(([c,f])=>c==="blank"?[this.$t("blank"),f]:[Kt.getFormattedCellValueForDate(c),f]),t=Object.fromEntries(i);break;case"TIME":i=Object.entries(t).map(([c,f])=>c==="blank"?[this.$t("blank"),f]:[Kt.getFormattedCellValueForTime(c),f]),t=Object.fromEntries(i);break;case"CHECKBOX":i=Object.entries(t).map(([c,f])=>c==="blank"?[!1,f]:[!0,f]),t=Object.fromEntries(i);break}let o=!1;if(Object.keys(t).length<1){console.log("khali");return}const a={datasets:[{label:this.column?.name??"",data:t,borderWidth:1,backgroundColor:Object.keys(t).map(()=>{const c=this.sampleColors.shift();if(c)return this.sampleColors.push(c),c})}]},s=document.getElementById(`chart${this.tab}`);if(!s)return;const l=`chartaxis${this.tab}`,u=new ma(s,{type:"bar",data:a,options:{animation:{onProgress:function(){if(o===!0){var c=u.scales.y.width,f=u.scales.y.height+u.scales.y.top+10,d=u.canvas.getContext("2d");d.clearRect(0,0,c,f)}},onComplete(){if(!o){var c=window.devicePixelRatio,f=u.canvas,d=u.scales.y.width-10,h=u.scales.y.height+u.scales.y.top+10;console.log(l);const m=document.getElementById(l);if(!(m instanceof HTMLCanvasElement))return;const y=m.getContext("2d");if(!y)return;y.scale(c,c),y.canvas.width=d*c,y.canvas.height=h*c,y.canvas.style.width=`${d}px`,y.canvas.style.height=`${h}px`,y.drawImage(f,0,0,d*c,h*c,0,0,d*c,h*c);var p=f.getContext("2d");p.clearRect(0,0,d,h),o=!0}}},responsive:!0,maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,title:{display:!0,text:e,font:{family:"Roboto"}}}}}});if(s.parentElement?.parentElement){const c=s.parentElement.parentElement.clientWidth,f=Math.max(u.data.labels.length*30,c);s.parentElement.style.width=f+"px"}},createOccurence(){if(this.OccurenceCreated)return;let t=this.getChartData;const e=this.$t("occurences");t=this.createChart(t,e),this.OccurenceCreated=!0},createRowWise(){if(this.RowWiseCreated)return;let t=this.getRowWiseData;const e=this.column?.name??"";t=this.createChart(t,e),this.RowWiseCreated=!0},createPivotTable(){if(console.log(this.pivotColumn),!this.pivotColumn){this.selectPivotColumn=!0;return}if(this.pivotCreated)return;this.setPivotColumn(this.pivotColumn);let t=this.getPivotData;const e=this.column?.name??"",n=this.$t("total_of",{name:e});t=this.createChart(t,n),this.pivotCreated=!0}},mounted(){this.isNumber?(this.tab=2,this.$nextTick(()=>{this.createRowWise()})):this.createOccurence()}};function Sy(t,e,n,r,i,o){return S(),P(ie,null,{default:v(()=>[g(kl,null,{default:v(()=>[g(tu,{modelValue:i.tab,"onUpdate:modelValue":e[0]||(e[0]=a=>i.tab=a)},{default:v(()=>[g(Un,{value:1},{default:v(()=>[A(T(t.$t("occurences")),1)]),_:1}),o.isNumber?(S(),P(Un,{key:0,value:2},{default:v(()=>[A(T(t.$t("row_wise")),1)]),_:1})):U("",!0),o.isNumber?(S(),P(Un,{key:1,value:3},{default:v(()=>[A(T(t.$t("pivot_table")),1)]),_:1})):U("",!0)]),_:1},8,["modelValue"]),g(q),g(D,{icon:"",variant:"text",them:"light",onClick:e[1]||(e[1]=a=>t.$emit("close"))},{default:v(()=>[g(H,null,{default:v(()=>e[3]||(e[3]=[A("mdi-close",-1)])),_:1,__:[3]})]),_:1})]),_:1}),g(Co,{modelValue:i.tab,"onUpdate:modelValue":e[2]||(e[2]=a=>i.tab=a),touch:!1},{default:v(()=>[g(Ir,{value:1},{default:v(()=>e[4]||(e[4]=[V("div",{class:"chartWrapper"},[V("div",{class:"chartContainer"},[V("canvas",{id:"chart1"})]),V("canvas",{id:"chartaxis1",height:"300",width:"0"})],-1)])),_:1,__:[4]}),o.isNumber?(S(),P(Ir,{key:0,value:2},{default:v(()=>e[5]||(e[5]=[V("div",{class:"chartWrapper"},[V("div",{class:"chartContainer"},[V("canvas",{id:"chart2"})]),V("canvas",{id:"chartaxis2",height:"300",width:"0"})],-1)])),_:1,__:[5]})):U("",!0),o.isNumber?(S(),P(Ir,{key:1,value:3},{default:v(()=>[i.selectPivotColumn?(S(),P(Ii,{key:0},{default:v(()=>[V("div",null,[V("h3",null,T(t.$t("select_pivot_column")),1),g(rn,{style:{height:"300px"}},{default:v(()=>[(S(!0),B(Y,null,de(t.sortedColumnKeys,a=>(S(),P(Qe,{key:a,title:t.columns[a]?.name??"",onClick:s=>(i.pivotColumn=a,i.selectPivotColumn=!1,o.createPivotTable())},null,8,["title","onClick"]))),128))]),_:1})])]),_:1})):U("",!0),e[6]||(e[6]=V("div",{class:"window3"},[V("div",{class:"chartWrapper cw3"},[V("div",{class:"chartContainer pivot cc3"},[V("canvas",{id:"chart3"})]),V("canvas",{id:"chartaxis3",height:"300",width:"0"})])],-1)),i.selectPivotColumn?U("",!0):(S(),P(D,{key:1,class:"ma-5",onClick:o.changeCategory,variant:"text"},{default:v(()=>[A(T(t.$t("change_category")),1)]),_:1},8,["onClick"]))]),_:1,__:[6]})):U("",!0)]),_:1},8,["modelValue"])]),_:1})}const Iy=me(Ey,[["render",Sy],["__scopeId","data-v-832ee32d"]]),Ty={key:1,class:"collaborators-list"},Oy={key:0,class:"outlined-section mb-4"},My={class:"section-title"}
44,Ry={key:1,class:"outlined-section"},Dy={class:"section-title"},ky=Zn({__name:"SetTableOwner",props:{tableKey:{},modelValue:{type:Boolean,default:!1}},emits:["dismiss","update:modelValue"],setup(t,{emit:e}){const n=t,r=e,{t:i}=bc(),o=ct(),a=it({get:()=>n.modelValue,set:x=>r("update:modelValue",x)}),s=vt(""),l=vt(!0),u=vt([]),c=vt(null),f=vt(!1),d=vt(!1),h=vt(""),p=vt("success"),m=Ft().currentUser?.uid,y=it(()=>s.value?u.value.filter(x=>x.email.toLowerCase().includes(s.value.toLowerCase())):u.value),w=it(()=>y.value.filter(x=>x.access===2)),_=it(()=>y.value.filter(x=>x.access!==2&&x.access!==-6&&x.access!==-8)),C=x=>{switch(x){case 2:return i("administrator");case-2:return i("viewer_editor");case-4:return i("viewer");default:return i("collaborator")}},E=async()=>{try{l.value=!0;const x=He(We,`tables/${n.tableKey}/collaborate`),R=await Sr(x);if(R.exists()){const N=R.val();u.value=Object.entries(N).map(([F,W])=>({uid:F,email:W.email||"",access:W.access||0})).filter(F=>F.uid!=m)}}catch(x){console.error("Error fetching collaborators:",x),O(i("please_try_again"),"error")}finally{l.value=!1}},I=async()=>{if(c.value)try{f.value=!0,o.updateTableOwner(c.value,n.tableKey,x=>{x&&r("dismiss"),f.value=!1})}catch(x){console.error("Error setting owner:",x),O(i("please_try_again"),"error")}},O=(x,R)=>{h.value=x,p.value=R,d.value=!0};return Cc(()=>{E()}),(x,R)=>(S(),P(Q,{modelValue:a.value,"onUpdate:modelValue":R[4]||(R[4]=N=>a.value=N),"max-width":"400",persistent:""},{default:v(()=>[g(ie,null,{default:v(()=>[g(Te,{class:"d-flex align-center"},{default:v(()=>[V("span",null,T(x.$t("set_owner")),1),g(q),g(D,{icon:"",variant:"text",onClick:R[0]||(R[0]=N=>x.$emit("dismiss"))},{default:v(()=>[g(H,null,{default:v(()=>R[5]||(R[5]=[A("mdi-close",-1)])),_:1,__:[5]})]),_:1})]),_:1}),g(kr,null,{default:v(()=>[A(T(x.$t("set_owner_description")),1)]),_:1}),g(ue,null,{default:v(()=>[g(Ne,{modelValue:s.value,"onUpdate:modelValue":R[1]||(R[1]=N=>s.value=N),placeholder:x.$t("search_users"),"prepend-inner-icon":"mdi-magnify",variant:"outlined",density:"comfortable","hide-details":"",class:"mb-4"},null,8,["modelValue","placeholder"]),l.value?(S(),P(Ac,{key:0,indeterminate:""})):(S(),B("div",Ty,[g(zc,{modelValue:c.value,"onUpdate:modelValue":R[2]||(R[2]=N=>c.value=N),"hide-details":""},{default:v(()=>[w.value.length>0?(S(),B("fieldset",Oy,[V("legend",My,T(x.$t("admins")),1),g(rn,{class:"pa-0"},{default:v(()=>[(S(!0),B(Y,null,de(w.value,N=>(S(),P(Qe,{key:N.uid,class:"px-2"},{prepend:v(()=>[g(Ea,{value:N.uid},null,8,["value"])]),default:v(()=>[g(gi,null,{default:v(()=>[A(T(N.email),1)]),_:2},1024),g(ba,null,{default:v(()=>[A(T(C(N.access)),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})])):U("",!0),_.value.length>0?(S(),B("fieldset",Ry,[V("legend",Dy,T(x.$t("other_collaborators")),1),g(rn,{class:"pa-0"},{default:v(()=>[(S(!0),B(Y,null,de(_.value,N=>(S(),P(Qe,{key:N.uid,class:"px-2"},{prepend:v(()=>[g(Ea,{value:N.uid},null,8,["value"])]),default:v(()=>[g(gi,null,{default:v(()=>[A(T(N.email),1)]),_:2},1024),g(ba,null,{default:v(()=>[A(T(C(N.access)),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})])):U("",!0)]),_:1},8,["modelValue"])]))]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{color:"primary",disabled:!c.value||f.value,loading:f.value,onClick:I},{default:v(()=>[A(T(x.$t("set_as_owner")),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),g(Vo,{modelValue:d.value,"onUpdate:modelValue":R[3]||(R[3]=N=>d.value=N),color:p.value,timeout:"3000"},{default:v(()=>[A(T(h.value),1)]),_:1},8,["modelValue","color"])]),_:1},8,["modelValue"]))}}),Py=me(ky,[["__scopeId","data-v-4b969927"]]),Ny=Zn({name:"TablePage",components:{PremiumPaywall:Hc,mainTable:O0,CardView:Zc,draggable:Uc,StyleCells:Y0,ExportExcel:$c,ExportPdf:np,RowMove:cp,PublishWebsite:sp,SelectImport:Lg,ExportRowsComponent:gp,AddRowModal:yp,AddColumnModel:_p,CreateFormula:bg,FilterComponent:Og,graphComponent:Iy,SetTableOwner:Py},watch:{showPremiumDialog(t){t&&(this.premiumModel=!0)},premiumModel(t){t||this.setPaywallMessage(null)},sortedColumnKeys(t){this.draggableColumnKeys=t},cardView(t){this.setCardView(t)},access(){this.isEditor?(this.accessType=this.$t("editor"),this.accessNote[0]=this.$t("editor_note_1"),this.accessNote[1]=this.$t("editor_note_2")):this.isContributor&&this.isAllViewContributor?(this.accessType=this.$t("contributor"),this.accessNote[0]=this.$t("contributor_note_1"),this.accessNote[1]=this.$t("contributor_note_2")):this.isContributor&&this.isSelfViewContributor&&(this.accessType=this.$t("contributor"),this.accessNote[0]=this.$t("contributor_note_3"),this.accessNote[1]=this.$t("contributor_note_2"))},searchQuery(t){this.searchInTable(t)}},data(){return{premiumModel:!1,showGraph:!1,showSetOwner:!1,valid:!0,columnNameRules:[t=>!!t||this.$t("name_is_required")],rowDuplicateModel:!1,insertRowsDialog:!1,insertRowsPosition:"below",insertRowCount:1,importSelectDialog:!1,activeFooterCellKey:"",footerSumDialog:!1,resetFilter:0,perPageItems:[500,200,100,50],showTable:!0,tableKey:this.$route.params.id,cardView:!1,show
44Filters:!1,accessType:"",accessNote:[],showZoom:!1,isEditingTableName:!1,editedTableName:"",fabAdd:!1,rowMoveModel:!1,showSearch:!1,setFormula:!1,exportRowsModel:!1,confirmDeletingRows:!1,showAccessRights:!1,showAddColumnModal:!1,showAddRowModal:!1,publishWebsite:!1,exportExcel:!1,exportPdf:!1,changeType:!1,columnManageModel:!1,columnDeleteModel:!1,styleModel:!1,styleRowsModel:!1,columnProperties:{},newColumnName:"",postColumntypeChange:!1,importSelect:!1,searchQuery:"",draggableColumnKeys:[],exportSnackbar:!1,exportSnackbarMessage:"",tableMenu:[{name:"manage",title:this.$t("arrange_hide_column")},{name:"export",title:this.$t("export_pdf")},{name:"rights",title:this.$t("access_rights")},{name:"export_xl",title:this.$t("export_excel")},{name:"publish",title:this.$t("publish_website")},{name:"filters",title:this.$t("filters")},{name:"people",title:this.$t("add_people")},{name:"set_owner",title:this.$t("set_owner")},{name:"zoom",title:this.$t("zoom")}],ColumnFunctions:[{type:"STRING",name:"text_column_name",color:"grey",icon:"mdi-format-text",subType:null},{type:"LINK",name:"text_column_link",color:"red",icon:"mdi-link",subType:null},{type:"INTEGER",name:"number_column_name",color:"indigo",icon:"mdi-numeric",subType:null},{type:"INTEGER",name:"amount_column_name",color:"green",icon:"mdi-currency-usd",subType:{decimals:3,prefix:1,separator:1}},{type:"FORMULA",name:"formula_column_name",color:"blue",icon:" mdi-function",subType:null},{type:"DATEONLY",name:"date_column_name",color:"red",icon:"mdi-calendar",subType:null},{type:"TIME",name:"time_column_name",color:"indigo",icon:"mdi-clock",subType:null},{type:"SELECT",name:"select_column_name",color:"green",icon:"mdi-view-list",subType:null},{type:"CHECKBOX",name:"checkbox_column_name",color:"green",icon:"mdi-checkbox-marked",subType:null},{type:"IMAGE",name:"image_column_name",color:"blue",icon:"mdi-image",subType:null},{type:"DRAW",name:"draw_column_name",color:"blue",icon:"mdi-pen",subType:null},{type:"AUDIO",name:"audio_column_name",color:"blue",icon:"mdi-music-note",subType:null},{type:"MAP",name:"location_column_name",color:"green",icon:"mdi-map",subType:null},{type:"PHONE",name:"contact_column_name",color:"green",icon:"mdi-phone-classic",subType:null},{type:"BARCODE",name:"barcode_column_name",color:this.getDarkMode?"white":"black",icon:"mdi-barcode-scan",subType:null}]}},unmounted(){ae().$reset(),Pe().$reset(),cn().$reset(),ct().$reset()},async created(){this.cardView=this.cardViewVx,this.checkForTablePremium(this.tableKey),this.fetchTableName(this.tableKey),this.fetchTableAccess(this.tableKey,!1)},computed:{isSmallScreen(){return this.$vuetify.display.xs},...K(ae,["getRowsLength"]),selectedRowsLength(){return this.selectedRows.length},showAppBar(){return this.selectedRows.length<1},canInsertRows(){if(this.selectedRowsLength<1)return!1;if(this.selectedRows.length<=1)return!0;const t=this.selectedRows.map(e=>this.sortedRowKeys.indexOf(e)).filter(e=>e!==-1).sort((e,n)=>e-n);for(let e=1;e<t.length;e++)if(t[e]!==t[e-1]+1)return!1;return!0},dragOptions(){return{animation:150,group:"description",disabled:!1,ghostClass:"ghost"}},...K(Bt,["getDarkMode"]),...K(ae,["isFilterApplied","getSelectedRow"]),...K(ae,["loading","page","perPage","selectedRows","sortedRowKeys","rowKeys"]),...K(ct,["isEditor","isAllViewContributor","isContributor","isSelfViewContributor","tableName","access","uid","allowExport","premiumAdminWarning","isTablePremium","tablePremiumTier","showPremiumDialog","isTableOwner","ownerEmail","paywallMessage","closeTable"]),...K(Bt,["fontSize","tableUiVx","cardViewVx"]),...K(Pe,["sortedColumnKeys","columns","hiddenColumns","activeColumnHeader"])},methods:{handleExportRowsClick(){this.selectedRowsLength>500?(this.exportSnackbarMessage=this.$t("export_rows_limit_warning"),this.exportSnackbar=!0):this.exportRowsModel=!0},getEditorKeys(){const t=Ft().currentUser?.uid;return t?this.sortedColumnKeys.filter(n=>this.columns[n]?.editor?.[t]):[]},duplicateViaForm(){const t=this.getSelectedRow;if(!t){console.error("No row selected for duplication.");return}this.setTransitionState(t),this.$router.push({name:"form-page",params:{id:this.tableKey},query:{mode:"duplicate"}})},duplicateRowUI(){this.duplicateRow(),this.rowDuplicateModel=!1},saveSelectValuesUI(t){this.importSelectDialog=!1,this.saveSelectValues(t,void 0)},changeFooter(t){this.setColumnFooterSum({key:this.activeFooterCellKey,value:t}),this.footerSumDialog=!1},changeSumType(t){this.footerSumDialog=!0,this.activeFooterCellKey=t},clearFiltersUi(){this.clearAllFilters(),this.resetFilter+=1},async refreshTablePage(){this.startLoading(),this.fetchTableAccess(this.tableKey,!0)},setTableName(){this.editedTableName&&(this.setTableNameVx(this.editedTableName),this.isEditingTableName=!1)},showEditTableName(){this.access===2&&(this.isEditingTableName=!0,this.editedTableName=this.tableName)},deleteRows(){this.selectedRowsLength>=this.getRowsLength||(this.deleteRowsVx(),this.confirmDeletingRows=!1)},openInsertRowsDialog(t){this.insertRowsPosition=t,this.insertRowCount=1,this.insertRowsDialog=!0},insertRowsUI(){const t=this.rowKeys.length+Number(this.insertRowCount);if(en.canAccessFeature(mr.ADD_ROWS,this.isTablePremium,this.tablePremiumTier,t))this.addRowsAtPosition(this.insertRowCount,this.insertRowsPosition),this.insertRowsDialog=!1;else{const e=en.getRowLimitMessage(this.tablePremiumTier);this.setPaywallMessage(e),this.insertRowsDialog=!1,this.premiumModel=!0}},showTableMenu(t){return(t==="people"||t==="publish"||t==="filters")&&this.access!==2||t==="rights"&&this.access===2||(t==="export_xl"||t==="export")&&!this.allowExport?!1:t==="set_owner"?this.isTableOwner:!0},deleteColumn(){this.deleteColumnVx(),this.columnDeleteModel=!1},changePage(t){this.setPage(t)},saveColumnStyle(t){this.styleModel=!1,this.saveColumnStyleVx(t),this.saveCellStyles(t)},resetColumnStyle(){this.styleModel=!1,this.resetColumnStyleVx(),this.resetCellStylesVx()},resetRowStyle(){this.styleRowsModel=!1,this.resetRowStylesVx()},saveRowStyle(t){this.saveRowStyles(t),this.styleRowsModel=!1},async changeColumnProperty(){await this.$refs.columnForm.validate(),this.valid&&(this.changeColumnProperties({...this.columnProperties,name:this.newColumnName}),this.processSingleColumnRows(this.activeColumnHeader),this.importSelect&&this.importSelectValues(),this.postColumntypeChange=!1)},isColumnFunctionSelected(t){const e=this.columns[this.activeColumnHeader];if(!e||e.type!==t.type)return!1;if(t.type!=="INTEGER")return!0;const n=e.subType?.prefix===1,r=t.subType?.prefix===1;return n===r},changeIndividualColumnType(t,e){this.columnProperties={name:e?.name??"",type:t.type,subType:t.subType},this.changeType=!1;let n=e?.name??"";if(n.toLowerCase().match(/column/g)){let r=this.$t(t.name).split("");r[0]&&(r[0]=r[0].toUpperCase()),n=r.join("")}this.newColumnName=n,this.postColumntypeChange=!0}
44,ManageColumns(t){this.toggleHiddenColumn(t)},dragEnd(){const t=this.draggableColumnKeys;this.updateColumnOrder(t)},isHidden(t){return!!this.hiddenColumns.includes(t)},draggableColumnName(t){return this.columns?.[t]?.name},tableMenuClicked(t){switch(t){case"manage":this.columnManageModel=!0;break;case"export_xl":en.canAccessFeature(mr.GENERAL,this.isTablePremium)?this.exportExcel=!0:this.premiumModel=!0;break;case"export":en.canAccessFeature(mr.GENERAL,this.isTablePremium)?this.exportPdf=!0:this.premiumModel=!0;break;case"publish":en.canAccessFeature(mr.GENERAL,this.isTablePremium)?this.publishWebsite=!0:this.premiumModel=!0;break;case"zoom":this.showZoom=!0;break;case"people":this.$router.push({name:"people",params:{id:this.tableKey}});break;case"filters":this.showFilters=!0;break;case"rights":this.showAccessRights=!0;break;case"set_owner":this.showSetOwner=!0;break}},searchInTable:Rl.debounce(async function(t){this.setSearch(t),this.fetchTableImages()},500),...ve(ae,["setDefaultPerPage","startLoading","saveCellStyles","saveRowStyles","deleteRowsVx","fetchUserFilters","duplicateRow","addRowsAtPosition","fetchTableImages","resetCellStylesVx","resetRowStylesVx","processSingleColumnRows"]),...ve(ct,["fetchTableAccess","fetchIsPublic","fetchTableName","setTableNameVx","setTableRecent","checkAdminPremium","checkForTablePremium","setPaywallMessage"]),...ve(Pe,["saveSelectValues","setColumnFooterSum","fetchHiddenColumns","toggleHiddenColumn","updateColumnOrder","changeColumnProperties","importSelectValues","saveColumnStyleVx","deleteColumnVx","resetColumnStyleVx"]),...ve(ae,["setSearch","setPerPage","setPage","clearSelectedRows","selectAllRows","setTableDimensions","clearAllFilters","removeFilterHeaders","setTableKey"]),...ve(Bt,["setFontSize","setCardView","setTransitionState"]),...ve(ct,["setUserId"])}}),By={key:0},Fy={class:"caption text-center"};function Ly(t,e,n,r,i,o){const a=j("card-view"),s=j("main-table"),l=j("draggable"),u=j("style-cells"),c=j("export-excel"),f=j("export-pdf"),d=j("publish-website"),h=j("row-move"),p=j("export-rows-component"),m=j("add-row-modal"),y=j("add-column-model"),w=j("create-formula"),_=j("filter-component"),C=j("SelectImport"),E=j("graph-component"),I=j("PremiumPaywall"),O=j("SetTableOwner");return S(),B("div",{class:Je({hideBlur:t.premiumAdminWarning})},[g(Kc,{style:ze({fontSize:t.fontSize+"rem"})},{default:v(()=>[t.showAppBar?(S(),P(Sa,{key:0,color:"primary"},{prepend:v(()=>[g(Ia,{icon:"mdi-arrow-left",onClick:e[0]||(e[0]=x=>t.$router.go(-1))})]),default:v(()=>[g(Ca,null,{default:v(()=>[t.isEditingTableName?(S(),P(Ne,{key:1,autofocus:"","hide-details":"",density:"comfortable",variant:"solo",rules:t.columnNameRules,modelValue:t.editedTableName,"onUpdate:modelValue":e[3]||(e[3]=x=>t.editedTableName=x),modelModifiers:{trim:!0},onBlur:t.setTableName,onKeyup:Pt(t.setTableName,["enter"]),onKeydown:Pt(t.setTableName,["esc"])},{"append-inner":v(()=>[g(H,{onClick:e[2]||(e[2]=x=>t.isEditingTableName=!1)},{default:v(()=>e[88]||(e[88]=[A(" mdi-close ",-1)])),_:1,__:[88]})]),_:1},8,["rules","modelValue","onBlur","onKeyup","onKeydown"])):(S(),B("span",{key:0,onClick:e[1]||(e[1]=(...x)=>t.showEditTableName&&t.showEditTableName(...x))},T(t.tableName),1))]),_:1}),t.showSearch?(S(),P(Ne,{key:0,variant:"solo",autofocus:"","hide-details":"",density:"comfortable",modelValue:t.searchQuery,"onUpdate:modelValue":e[5]||(e[5]=x=>t.searchQuery=x),placeholder:t.$t("search_string"),onKeydown:e[6]||(e[6]=Pt(x=>t.showSearch=!1,["esc"]))},{"append-inner":v(()=>[g(H,{onClick:e[4]||(e[4]=x=>t.searchQuery?t.searchQuery="":t.showSearch=!1)},{default:v(()=>e[89]||(e[89]=[A(" mdi-close ",-1)])),_:1,__:[89]})]),_:1},8,["modelValue","placeholder"])):U("",!0),g(q),g(D,{icon:"",onClick:t.refreshTablePage},{default:v(()=>[g(H,{class:Je({sync:t.loading})},{default:v(()=>e[90]||(e[90]=[A("mdi-sync",-1)])),_:1,__:[90]},8,["class"])]),_:1},8,["onClick"]),t.isFilterApplied?(S(),P(D,{key:1,icon:"",class:"white--text",onClick:t.clearFiltersUi},{default:v(()=>[g(H,null,{default:v(()=>e[91]||(e[91]=[A("mdi-filter-remove",-1)])),_:1,__:[91]})]),_:1},8,["onClick"])):U("",!0),g(D,{icon:"",onClick:e[7]||(e[7]=x=>t.showSearch=!0)},{default:v(()=>[g(H,null,{default:v(()=>e[92]||(e[92]=[A("mdi-magnify",-1)])),_:1,__:[92]})]),_:1}),g(li,{scrim:"transparent",width:"200"},{activator:v(({props:x})=>[g(D,It({icon:""},x),{default:v(()=>[g(H,null,{default:v(()=>e[93]||(e[93]=[A("mdi-dots-vertical",-1)])),_:1,__:[93]})]),_:2},1040)]),default:v(()=>[g(rn,null,{default:v(()=>[(S(!0),B(Y,null,de(t.tableMenu,x=>(S(),B(Y,{key:x.name},[t.showTableMenu(x.name)?(S(),P(Qe,{key:0,title:x.title,onClick:R=>t.tableMenuClicked(x.name)},null,8,["title","onClick"])):U("",!0)],64))),128)),g(Qe,{onClick:e[8]||(e[8]=x=>t.cardView=!t.cardView)},{default:v(()=>[A(T(t.cardView?t.$t("table_view"):t.$t("card_view")),1)]),_:1})]),_:1})]),_:1})]),_:1})):(S(),P(Sa,{key:1,color:"secondary"},{prepend:v(()=>[g(Ia,{icon:"mdi-close",onClick:t.clearSelectedRows},null,8,["onClick"])]),default:v(()=>[g(Ca,null,{default:v(()=>[A(T(t.$t("items_selected",{number:t.selectedRowsLength})),1)]),_:1}),g(q),t.canInsertRows?(S(),P(D,{key:0,icon:"",class:"white--text",onClick:e[9]||(e[9]=x=>t.openInsertRowsDialog("above"))},{default:v(()=>[g(H,{class:"white--text"},{default:v(()=>e[94]||(e[94]=[A("mdi-table-row-plus-before",-1)])),_:1,__:[94]}),g(Ut,{activator:"parent",location:"bottom"},{default:v(()=>[A(T(t.$t("insert_rows_above")),1)]),_:1})]),_:1})):U("",!0),t.canInsertRows?(S(),P(D,{key:1,icon:"",class:"white--text",onClick:e[10]||(e[10]=x=>t.openInsertRowsDialog("below"))},{default:v(()=>[g(H,{class:"white--text"},{default:v(()=>
44e[95]||(e[95]=[A("mdi-table-row-plus-after",-1)])),_:1,__:[95]}),g(Ut,{activator:"parent",location:"bottom"},{default:v(()=>[A(T(t.$t("insert_rows_below")),1)]),_:1})]),_:1})):U("",!0),t.selectedRowsLength===1&&(t.access===2||t.access===-8||t.access===-6)?(S(),P(D,{key:2,icon:"",class:"white--text",onClick:e[11]||(e[11]=x=>t.rowDuplicateModel=!0)},{default:v(()=>[g(H,{class:"white--text"},{default:v(()=>e[96]||(e[96]=[A("mdi-content-duplicate",-1)])),_:1,__:[96]}),g(Ut,{activator:"parent",location:"bottom"},{default:v(()=>[A(T(t.$t("duplicate_row")),1)]),_:1})]),_:1})):U("",!0),g(D,{icon:"",class:"white--text",onClick:e[12]||(e[12]=x=>t.exportPdf=!0)},{default:v(()=>[g(H,{class:"white--text"},{default:v(()=>e[97]||(e[97]=[A("mdi-file-pdf-box",-1)])),_:1,__:[97]}),g(Ut,{activator:"parent",location:"bottom"},{default:v(()=>[A(T(t.$t("export_pdf")),1)]),_:1})]),_:1}),g(D,{icon:"",class:"white--text",onClick:t.selectAllRows},{default:v(()=>[g(H,{class:"white--text"},{default:v(()=>e[98]||(e[98]=[A("mdi-select-all",-1)])),_:1,__:[98]}),g(Ut,{activator:"parent",location:"bottom"},{default:v(()=>[A(T(t.$t("select_all_rows")),1)]),_:1})]),_:1},8,["onClick"]),g(D,{icon:"",class:"white--text",onClick:e[13]||(e[13]=x=>t.styleRowsModel=!0)},{default:v(()=>[g(H,{class:"white--text"},{default:v(()=>e[99]||(e[99]=[A("mdi-format-color-fill",-1)])),_:1,__:[99]}),g(Ut,{activator:"parent",location:"bottom"},{default:v(()=>[A(T(t.$t("style_rows")),1)]),_:1})]),_:1}),t.selectedRowsLength===1?(S(),P(D,{key:3,icon:"",class:"white--text",onClick:e[14]||(e[14]=x=>t.rowMoveModel=!0)},{default:v(()=>[g(H,{class:"white--text"},{default:v(()=>e[100]||(e[100]=[A("mdi-swap-vertical-bold",-1)])),_:1,__:[100]}),g(Ut,{activator:"parent",location:"bottom"},{default:v(()=>[A(T(t.$t("move_rows")),1)]),_:1})]),_:1})):U("",!0),g(D,{icon:"",class:"white--text",onClick:t.handleExportRowsClick},{default:v(()=>[g(H,{class:"white--text"},{default:v(()=>e[101]||(e[101]=[A("mdi-export",-1)])),_:1,__:[101]}),g(Ut,{activator:"parent",location:"bottom"},{default:v(()=>[A(T(t.$t("export_rows")),1)]),_:1})]),_:1},8,["onClick"]),g(D,{icon:"",class:"white--text",onClick:e[15]||(e[15]=x=>t.confirmDeletingRows=!0)},{default:v(()=>[g(H,{class:"white--text"},{default:v(()=>e[102]||(e[102]=[A("mdi-delete",-1)])),_:1,__:[102]}),g(Ut,{activator:"parent",location:"bottom"},{default:v(()=>[A(T(t.$t("delete_rows")),1)]),_:1})]),_:1})]),_:1})),g(Gc,null,{default:v(()=>[t.showTable?(S(),B("div",By,[t.cardView?(S(),P(a,{key:0})):(S(),P(s,{key:1,tableKey:t.tableKey,resetFilter:t.resetFilter,onMove:e[16]||(e[16]=x=>t.columnManageModel=!0),onType:e[17]||(e[17]=x=>t.changeType=!0),onStyle:e[18]||(e[18]=x=>t.styleModel=!0),onDelete:e[19]||(e[19]=x=>t.columnDeleteModel=!0),onFormula:e[20]||(e[20]=x=>t.setFormula=!0),onGraph:e[21]||(e[21]=x=>t.showGraph=!0),onSum:t.changeSumType,onSelect:e[22]||(e[22]=x=>t.importSelectDialog=!0)},null,8,["tableKey","resetFilter","onSum"])),t.tableUiVx==="old"&&!t.cardView||t.cardView&&!t.isSmallScreen?(S(),P(Oc,{key:2,class:"absoluteButton A-bottom A-left A-right",rounded:"0",density:"compact",variant:"tonal","model-value":t.page,"onUpdate:modelValue":t.changePage,length:Math.ceil(t.getRowsLength/t.perPage),"total-visible":6},null,8,["model-value","onUpdate:modelValue","length"])):U("",!0)])):U("",!0)]),_:1})]),_:1},8,["style"]),g(Vo,{modelValue:t.exportSnackbar,"onUpdate:modelValue":e[24]||(e[24]=x=>t.exportSnackbar=x),timeout:2e3,color:"warning"},{actions:v(()=>[g(D,{variant:"text",onClick:e[23]||(e[23]=x=>t.exportSnackbar=!1)},{default:v(()=>[A(T(t.$t("close")),1)]),_:1})]),default:v(()=>[A(T(t.exportSnackbarMessage)+" ",1)]),_:1},8,["modelValue"]),g(Ec,{modelValue:t.loading,"onUpdate:modelValue":e[25]||(e[25]=x=>t.loading=x),class:"align-center justify-center"},{default:v(()=>[g(Lo,{indeterminate:"",size:"100",width:8,color:"primary"})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.columnManageModel,"onUpdate:modelValue":e[28]||(e[28]=x=>t.columnManageModel=x),width:"400",scrollable:""},{default:v(()=>[g(ie,{style:{"max-height":"600px"}},{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("arrange_hide_column")),1)]),_:1}),g(ue,null,{default:v(()=>[g(rn,null,{default:v(()=>[g(l,It({modelValue:t.draggableColumnKeys,"onUpdate:modelValue":e[26]||(e[26]=x=>t.draggableColumnKeys=x),"item-key":"key",onEnd:t.dragEnd},t.dragOptions,{handle:".handle"}),{item:v(({element:x})=>
44[g(Qe,{style:{"border-bottom":"grey solid 1px"},class:"list-item"},{append:v(()=>[g(D,{icon:"",onClick:Ue(R=>t.ManageColumns(x),["stop"]),variant:"text"},{default:v(()=>[t.isHidden(x)?(S(),P(H,{key:0},{default:v(()=>e[104]||(e[104]=[A("mdi-eye-off-outline",-1)])),_:1,__:[104]})):(S(),P(H,{key:1},{default:v(()=>e[105]||(e[105]=[A("mdi-eye",-1)])),_:1,__:[105]}))]),_:2},1032,["onClick"])]),default:v(()=>[g(gi,null,{default:v(()=>[t.access===2?(S(),P(H,{key:0,class:"mr-5 handle",medium:""},{default:v(()=>e[103]||(e[103]=[A("mdi-drag",-1)])),_:1,__:[103]})):U("",!0),A(T(t.draggableColumnName(x)),1)]),_:2},1024),g(Bl)]),_:2},1024)]),_:1},16,["modelValue","onEnd"])]),_:1})]),_:1}),g(oe,{class:"pt-5"},{default:v(()=>[g(q),g(D,{text:"",color:"primary",onClick:e[27]||(e[27]=x=>t.columnManageModel=!1)},{default:v(()=>[A(T(t.$t("close")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.changeType,"onUpdate:modelValue":e[30]||(e[30]=x=>t.changeType=x),width:"auto","max-width":"500"},{default:v(()=>[g(ie,{class:"py-5"},{default:v(()=>[g(Te,{class:"text-center"},{default:v(()=>[A(T(t.$t("type_of_column")),1)]),_:1}),g(Ml),g(Ii,{fluid:""},{default:v(()=>[g(wt,{justify:"start",dense:""},{default:v(()=>[(S(!0),B(Y,null,de(t.ColumnFunctions,x=>(S(),P(ge,{style:ze([{"text-align":"center"},{background:t.isColumnFunctionSelected(x)?"lightgrey":""}]),cols:"4",md:"4",key:x.name},{default:v(()=>[g(H,{style:{cursor:"pointer"},color:x.color,onClick:R=>t.changeIndividualColumnType(x,t.columns[t.activeColumnHeader])},{default:v(()=>[A(T(x.icon),1)]),_:2},1032,["color","onClick"]),V("div",Fy,T(t.$t(`${x.name}`)),1)]),_:2},1032,["style"]))),128))]),_:1})]),_:1}),g(oe,{class:"justify-center"},{default:v(()=>[g(D,{text:"",onClick:e[29]||(e[29]=x=>t.changeType=!1),elevation:"2"},{default:v(()=>[A(T(t.$t("ok")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(Q,{scrollable:"",modelValue:t.postColumntypeChange,"onUpdate:modelValue":e[35]||(e[35]=x=>t.postColumntypeChange=x),width:"300",persistent:""},{default:v(()=>[g(ie,{height:"300"},{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("column_properties")),1)]),_:1}),g(ue,null,{default:v(()=>[g(Uo,{modelValue:t.valid,"onUpdate:modelValue":e[33]||(e[33]=x=>t.valid=x),ref:"columnForm"},{default:v(()=>[g(Ne,{label:t.$t("rename_column"),modelValue:t.newColumnName,"onUpdate:modelValue":e[31]||(e[31]=x=>t.newColumnName=x),modelModifiers:{trim:!0},rules:t.columnNameRules,variant:"outlined",dense:"",class:"mt-2 mb-5"},null,8,["label","modelValue","rules"]),t.columnProperties?.type==="SELECT"?(S(),P(Nl,{key:0,label:t.$t("import_select_items"),class:"check",modelValue:t.importSelect,"onUpdate:modelValue":e[32]||(e[32]=x=>t.importSelect=x),"hide-details":""},null,8,["label","modelValue"])):U("",!0)]),_:1},8,["modelValue"])]),_:1}),g(oe,null,{default:v(()=>[g(D,{color:"primary",onClick:t.changeColumnProperty},{default:v(()=>[A(T(t.$t("submit")),1)]),_:1},8,["onClick"]),g(D,{color:"primary",onClick:e[34]||(e[34]=x=>t.postColumntypeChange=!1),variant:"outlined"},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),t.access===2&&t.selectedRowsLength===0?(S(),P(Q,{key:0,modelValue:t.styleModel,"onUpdate:modelValue":e[37]||(e[37]=x=>t.styleModel=x),"max-width":"500"},{default:v(()=>[g(u,{title:t.columns[t.activeColumnHeader]?.name??"",onStyle:t.saveColumnStyle,onReset:t.resetColumnStyle,onClose:e[36]||(e[36]=x=>t.styleModel=!1),column:t.columns[t.activeColumnHeader],rowMode:!1},null,8,["title","onStyle","onReset","column"])]),_:1},8,["modelValue"])):U("",!0),g(Q,{modelValue:t.styleRowsModel,"onUpdate:modelValue":e[39]||(e[39]=x=>t.styleRowsModel=x),"max-width":"500"},{default:v(()=>[g(u,{title:`Rows Selected : ${t.selectedRowsLength}`,onStyle:t.saveRowStyle,onReset:t.resetRowStyle,onClose:e[38]||(e[38]=x=>t.styleRowsModel=!1),rowMode:!0},null,8,["title","onStyle","onReset"])]),_:1},8,["modelValue"]),g(Q,{modelValue:t.columnDeleteModel,"onUpdate:modelValue":e[41]||(e[41]=x=>t.columnDeleteModel=x),width:"400"},{default:v(()=>[g(ie,null,{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.columns[t.activeColumnHeader]?.name),1)]),_:1}),g(kr,null,{default:v(()=>[A(T(t.$t("delete_column_msg")),1)]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{color:"primary",text:"",onClick:e[40]||(e[40]=x=>t.columnDeleteModel=!1)},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1}),g(D,{color:"primary",onClick:t.deleteColumn},{default:v(()=>[A(T(t.$t("ok")),1)]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.exportExcel,"onUpdate:modelValue":e[43]||(e[43]=x=>t.exportExcel=x),persistent:"","max-width":"350"},{default:v(()=>[g(c,{"table-key":t.tableKey,"hidden-columns":t.hiddenColumns,name:t.tableName,onClose:e[42]||(e[42]=x=>t.exportExcel=!1)},null,8,["table-key","hidden-columns","name"])]),_:1},8,["modelValue"]),g(Q,{modelValue:t.exportPdf,"onUpdate:modelValue":e[45]||(e[45]=x=>t.exportPdf=x),width:"auto",persistent:"","no-click-animation":""},{default:v(()=>[g(f,{onClose:e[44]||(e[44]=x=>t.exportPdf=!1)})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.publishWebsite,"onUpdate:modelValue":e[47]||(e[47]=x=>t.publishWebsite=x),persistent:"","max-width":"300"},{default:v(()=>[g(d,{onClose:e[46]||(e[46]=x=>t.publishWebsite=!1),"table-key":t.tableKey},null,8,["table-key"])]),_:1},8,["modelValue"]),g(Q,{modelValue:t.showZoom,"onUpdate:modelValue":e[50]||(e[50]=x=>t.showZoom=x),width:"200"},{default:v(()=>[g(ie,{style:{"border-radius":"50px"},class:"py-2"},{default:v(()=>
44[g(wt,{"no-gutters":""},{default:v(()=>[g(ge,{class:"text-center"},{default:v(()=>[g(D,{icon:"",class:"d-inline",onClick:e[48]||(e[48]=x=>t.setFontSize(!1)),size:"large",variant:"text"},{default:v(()=>[g(H,null,{default:v(()=>e[106]||(e[106]=[A("mdi-magnify-minus",-1)])),_:1,__:[106]})]),_:1})]),_:1}),g(ge,{class:"text-center"},{default:v(()=>[g(D,{icon:"",class:"d-inline",onClick:e[49]||(e[49]=x=>t.setFontSize(!0)),size:"large",variant:"text"},{default:v(()=>[g(H,null,{default:v(()=>e[107]||(e[107]=[A("mdi-magnify-plus",-1)])),_:1,__:[107]})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),t.tableUiVx==="old"&&!t.cardView||t.cardView&&!t.isSmallScreen?(S(),P(li,{key:1,transition:"scale-transition",scrim:"transparent"},{activator:v(({props:x})=>[g(D,It({dark:"",class:"speedDial speedDialLeft text-white",color:"#495074",icon:"",size:"small"},x),{default:v(()=>[A(T(t.perPage),1)]),_:2},1040)]),default:v(()=>[(S(!0),B(Y,null,de(t.perPageItems,x=>(S(),P(D,{key:x,icon:"",size:"small",onClick:R=>t.setPerPage(x),color:"#495074",class:"text-white mb-2"},{default:v(()=>[A(T(x),1)]),_:2},1032,["onClick"]))),128))]),_:1})):U("",!0),g(li,{transition:"scale-transition",scrim:"transparent"},{activator:v(({props:x})=>[t.access===2||t.access===-8||t.access===-6?(S(),P(D,It({key:0,modelValue:t.fabAdd,"onUpdate:modelValue":e[51]||(e[51]=R=>t.fabAdd=R),class:"speedDial text-white",color:"primary",icon:"",size:"small"},x),{default:v(()=>[t.fabAdd?(S(),P(H,{key:0},{default:v(()=>e[108]||(e[108]=[A("mdi-close",-1)])),_:1,__:[108]})):(S(),P(H,{key:1},{default:v(()=>e[109]||(e[109]=[A("mdi-plus",-1)])),_:1,__:[109]}))]),_:2},1040,["modelValue"])):U("",!0)]),default:v(()=>[t.access===2?(S(),P(D,{key:0,onClick:e[52]||(e[52]=x=>t.showAddColumnModal=!0),icon:"",color:"blue",class:"mb-2",size:"small"},{default:v(()=>[g(H,{dark:""},{default:v(()=>e[110]||(e[110]=[A(" mdi-table-column-plus-after ",-1)])),_:1,__:[110]})]),_:1})):U("",!0),g(D,{onClick:e[53]||(e[53]=x=>t.showAddRowModal=!0),icon:"",color:"yellow",class:"mb-2",size:"small"},{default:v(()=>[g(H,{dark:""},{default:v(()=>e[111]||(e[111]=[A(" mdi-table-row-plus-after ",-1)])),_:1,__:[111]})]),_:1}),g(D,{icon:"",color:"green",class:"mb-2",size:"small",onClick:e[54]||(e[54]=x=>t.$router.push({name:"form-page",params:{id:t.tableKey}}))},{default:v(()=>[g(H,{dark:""},{default:v(()=>e[112]||(e[112]=[A(" mdi-form-select ",-1)])),_:1,__:[112]})]),_:1})]),_:1}),g(Q,{modelValue:t.rowMoveModel,"onUpdate:modelValue":e[55]||(e[55]=x=>t.rowMoveModel=x),"max-width":"400"},{default:v(()=>[g(h)]),_:1},8,["modelValue"]),g(Q,{modelValue:t.exportRowsModel,"onUpdate:modelValue":e[57]||(e[57]=x=>t.exportRowsModel=x),width:"400",persistent:"",title:t.$t("export_rows_msg"),scrollable:""},{default:v(()=>[g(p,{"current-table-key":t.tableKey,onClose:e[56]||(e[56]=x=>t.exportRowsModel=!1)},null,8,["current-table-key"])]),_:1},8,["modelValue","title"]),g(Q,{modelValue:t.confirmDeletingRows,"onUpdate:modelValue":e[59]||(e[59]=x=>t.confirmDeletingRows=x),width:"300"},{default:v(()=>[g(ie,null,{default:v(()=>[g(Te,null,{default:v(()=>[A("Delete "+T(t.selectedRowsLength)+" Rows ?",1)]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{color:"primary",text:"",onClick:e[58]||(e[58]=x=>t.confirmDeletingRows=!1)},{default:v(()=>[A(T(t.$t("cancel")),1)]),_:1}),g(D,{color:"primary",onClick:t.deleteRows},{default:v(()=>[A(T(t.$t("ok")),1)]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.showAddRowModal,"onUpdate:modelValue":e[62]||(e[62]=x=>t.showAddRowModal=x),width:"400"},{default:v(()=>[g(m,{onClose:e[60]||(e[60]=x=>t.showAddRowModal=!1),onOpenPremium:e[61]||(e[61]=x=>(t.showAddRowModal=!1,t.premiumModel=!0))})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.showAddColumnModal,"onUpdate:modelValue":e[65]||(e[65]=x=>t.showAddColumnModal=x),width:"400"},{default:v(()=>[g(y,{onClose:e[63]||(e[63]=x=>t.showAddColumnModal=!1),onOpenPremium:e[64]||(e[64]=x=>(t.showAddColumnModal=!1,t.premiumModel=!0))})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.setFormula,"onUpdate:modelValue":e[67]||(e[67]=x=>t.setFormula=x),width:"350"},{default:v(()=>[g(w,{onClose:e[66]||(e[66]=x=>t.setFormula=!1)})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.showFilters,"onUpdate:modelValue":e[69]||(e[69]=x=>t.showFilters=x),width:"350",scrollable:""},{default:v(()=>[g(_,{onClose:e[68]||(e[68]=x=>t.showFilters=!1)})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.showAccessRights,"onUpdate:modelValue":e[70]||(e[70]=x=>t.showAccessRights=x),width:"300",scrollable:""},{default:v(()=>[g(ie,{width:"300",height:"auto","max-height":"400"},{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.getEditorKeys()?.length>=1?t.accessType:t.$t("viewer")),1)]),_:1}),g(kr,{class:"mt-3"},{default:v(()=>[A(T(t.getEditorKeys()?.length>=1?t.accessNote[0]:t.$t("viewer_note")),1)]),_:1}),t.getEditorKeys()?.length>=1?(S(),P(ue,{key:0,class:"px-2"},{default:v(()=>[g(Qe,null,{default:v(()=>[A(T(t.accessNote[1]),1)]),_:1}),(S(!0),B(Y,null,de(t.getEditorKeys(),x=>(S(),P(Qe,{key:x},{default:v(()=>[A(T(t.columns[x]?.name??""),1)]),_:2},1024))),128))]),_:1})):U("",!0),g(ue)]),_:1})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.footerSumDialog,"onUpdate:modelValue":e[74]||(e[74]=x=>t.footerSumDialog=x),width:"300"},{default:v(()=>[g(Wc,null,{default:v(()=>[g(rn,null,{default:v(()=>[g(Qe,{onClick:e[71]||(e[71]=x=>t.changeFooter(0))},{default:v(()=>[A(T(t.$t("full_sum")),1)]),_:1}),g(Qe,{onClick:e[72]||(e[72]=x=>t.changeFooter(1))},{default:v(()=>[A(T(t.$t("average")),1)]),_:1}),g(Qe,{onClick:e[73]||(e[73]=x=>t.changeFooter(-1))},{default:v(()=>[A(T(t.$t("hide")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.importSelectDialog,"onUpdate:modelValue":e[76]||(e[76]=x=>t.importSelectDialog=x),width:"350",scrollable:""},{default:v(()=>[g(C,{column:t.columns?.[t.activeColumnHeader],onSelectedList:t.saveSelectValuesUI,onClose:e[75]||(e[75]=x=>t.importSelectDialog=!1)},null,8,["column","onSelectedList"])]),_:1},8,["modelValue"]),g(Q,{modelValue:t.premiumAdminWarning,"onUpdate:modelValue":e[77]||(e[77]=x=>t.premiumAdminWarning=x),width:"300",persistent:"","no-click-animation":""},{default:v(()=>[g(ie,null,{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.$t("public_premium_title")),1)]),_:1}),g(ue,null,{default:v(()=>[A(T(t.$t("public_premium_body")),1)]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.rowDuplicateModel,"onUpdate:modelValue":e[78]||(e[78]=x=>t.rowDuplicateModel=x),width:"350"},{default:v(()=>[g(ie,null,{default:v(()=>[g(Te,null,{default:v(()=>
44[A(T(t.$t("duplicate_row")),1)]),_:1}),g(oe,null,{default:v(()=>[g(D,{color:"primary",onClick:t.duplicateRowUI},{default:v(()=>[A(T(t.$t("duplicate_direct")),1)]),_:1},8,["onClick"]),g(D,{color:"success",onClick:t.duplicateViaForm},{default:v(()=>[A(T(t.$t("duplicate_form")),1)]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.insertRowsDialog,"onUpdate:modelValue":e[81]||(e[81]=x=>t.insertRowsDialog=x),width:"400"},{default:v(()=>[g(ie,null,{default:v(()=>[g(Te,null,{default:v(()=>[A(T(t.insertRowsPosition==="above"?t.$t("insert_rows_above"):t.$t("insert_rows_below")),1)]),_:1}),g(ue,null,{default:v(()=>[g(Ne,{min:"1",max:"99",type:"number",modelValue:t.insertRowCount,"onUpdate:modelValue":e[79]||(e[79]=x=>t.insertRowCount=x),variant:"outlined",label:t.$t("add_row_title"),rules:[x=>!!x||t.$t("required"),x=>x>=1&&x<=100||t.$t("max_row")]},null,8,["modelValue","label","rules"])]),_:1}),g(oe,null,{default:v(()=>[g(q),g(D,{onClick:e[80]||(e[80]=x=>t.insertRowsDialog=!1),text:"",color:"primary"},{default:v(()=>[A(T(t.$t("close")),1)]),_:1}),g(D,{color:"primary",onClick:t.insertRowsUI,disabled:t.insertRowCount<1||t.insertRowCount>99},{default:v(()=>[A(T(t.$t("add")),1)]),_:1},8,["onClick","disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.showGraph,"onUpdate:modelValue":e[83]||(e[83]=x=>t.showGraph=x),fullscreen:""},{default:v(()=>[g(E,{onClose:e[82]||(e[82]=x=>t.showGraph=!1)})]),_:1},8,["modelValue"]),g(Q,{modelValue:t.premiumModel,"onUpdate:modelValue":e[85]||(e[85]=x=>t.premiumModel=x),width:"350",persistent:"","no-click-animation":""},{default:v(()=>[g(I,{"owner-paywall":!t.isTableOwner,"owner-email":t.ownerEmail,"sub-title":t.paywallMessage,onDismiss:e[84]||(e[84]=x=>{t.closeTable?t.$router.back():t.premiumModel=!1})},null,8,["owner-paywall","owner-email","sub-title"])]),_:1},8,["modelValue"]),g(O,{modelValue:t.showSetOwner,"onUpdate:modelValue":e[86]||(e[86]=x=>t.showSetOwner=x),"table-key":t.tableKey,onDismiss:e[87]||(e[87]=x=>t.showSetOwner=!1)},null,8,["modelValue","table-key"])],2)}const mx=me(Ny,[["render",Ly],["__scopeId","data-v-622bc2fe"]]);export{mx as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.