/g,">")}function tc(t){return Object.keys(t||{}).reduce((e,i)=>e+"".concat(i,": ").concat(t[i].trim(),";"),"")}function tu(t){return t.size!==to.size||t.x!==to.x||t.y!==to.y||t.rotate!==to.rotate||t.flipX||t.flipY}function td(){let t=tn.cssPrefix,e=tn.replacementClass,i=':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n transform: scale(var(--fa-counter-scale, 0.25));\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(-1 * var(--fa-li-width, 2em));\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n animation-name: fa-beat;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n animation-name: fa-bounce;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n animation-name: fa-fade;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n animation-name: fa-beat-fade;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n animation-name: fa-flip;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n animation-name: fa-shake;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n animation-name: fa-spin;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 2s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n animation-name: fa-spin;\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n animation-delay: -1ms;\n animation-duration: 1ms;\n animation-iteration-count: 1;\n transition-delay: 0s;\n transition-duration: 0s;\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n transform: scale(1);\n }\n 45% {\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-bounce {\n 0% {\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-flip {\n 50% {\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-shake {\n 0% {\n transform: rotate(-15deg);\n }\n 4% {\n transform: rotate(15deg);\n }\n 8%, 24% {\n transform: rotate(-18deg);\n }\n 12%, 28% {\n transform: rotate(18deg);\n }\n 16% {\n transform: rotate(-22deg);\n }\n 20% {\n transform: rotate(22deg);\n }\n 32% {\n transform: rotate(-12deg);\n }\n 36% {\n transform: rotate(12deg);\n }\n 40%, 100% {\n transform: rotate(0deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n transform: rotate(var(--fa-rotate-angle, 0));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}';if("fa"!==t||e!==R){let n=RegExp("\\.".concat("fa","\\-"),"g"),s=RegExp("\\--".concat("fa","\\-"),"g"),o=RegExp("\\.".concat(R),"g");i=i.replace(n,".".concat(t,"-")).replace(s,"--".concat(t,"-")).replace(o,".".concat(e))}return i}let tm=!1;function tp(){tn.autoAddCss&&!tm&&(!function(t){if(!t||!g)return;let e=m.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=t;let i=m.head.childNodes,n=null;for(let t=i.length-1;t>-1;t--){let e=i[t];["STYLE","LINK"].indexOf((e.tagName||"").toUpperCase())>-1&&(n=e)}m.head.insertBefore(e,n)}(td()),tm=!0)}const tf=d||{};tf[M]||(tf[M]={}),tf[M].styles||(tf[M].styles={}),tf[M].hooks||(tf[M].hooks={}),tf[M].shims||(tf[M].shims=[]);var tg=tf[M];const tb=[],tv=function(){m.removeEventListener("DOMContentLoaded",tv),ty=1,tb.map(t=>t())};let ty=!1;function tw(t){let{tag:e,attributes:i={},children:n=[]}=t;return"string"==typeof t?th(t):"<".concat(e," ").concat(Object.keys(i||{}).reduce((t,e)=>t+"".concat(e,'="').concat(th(i[e]),'" '),"").trim(),">").concat(n.map(tw).join(""),"").concat(e,">")}function t_(t,e,i){if(t&&t[e]&&t[e][i])return{prefix:e,iconName:i,icon:t[e][i]}}!g||(ty=(m.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(m.readyState))||m.addEventListener("DOMContentLoaded",tv);var tC=function(t,e,i,n){var s,o,r,a=Object.keys(t),l=a.length,h=void 0!==n?function(t,i,s,o){return e.call(n,t,i,s,o)}:e;for(void 0===i?(s=1,r=t[a[0]]):(s=0,r=i);s=55296&&s<=56319&&i{let n=t[i];return n.icon?e[n.iconName]=n.icon:e[i]=n,e},{})}function tT(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{skipHooks:n=!1}=i,s=tx(e);"function"!=typeof tg.hooks.addPack||n?tg.styles[t]={...tg.styles[t]||{},...s}:tg.hooks.addPack(t,tx(e)),"fas"===t&&tT("fa",e)}const{styles:tk,shims:tS}=tg,tL={[v]:Object.values(G[v]),[w]:Object.values(G[w]),[_]:Object.values(G[_])};let tM=null,tR={},tP={},tO={},tz={},tD={};const tA={[v]:Object.keys(j[v]),[w]:Object.keys(j[w]),[_]:Object.keys(j[_])},tI=()=>{let t=t=>tC(tk,(e,i,n)=>(e[n]=tC(i,t,{}),e),{});tR=t((t,e,i)=>(e[3]&&(t[e[3]]=i),e[2]&&e[2].filter(t=>"number"==typeof t).forEach(e=>{t[e.toString(16)]=i}),t)),tP=t((t,e,i)=>(t[i]=i,e[2]&&e[2].filter(t=>"string"==typeof t).forEach(e=>{t[e]=i}),t)),tD=t((t,e,i)=>{let n=e[2];return t[i]=i,n.forEach(e=>{t[e]=i}),t});let e="far"in tk||tn.autoFetchSvg,i=tC(tS,(t,i)=>{let n=i[0],s=i[1],o=i[2];return"far"!==s||e||(s="fas"),"string"==typeof n&&(t.names[n]={prefix:s,iconName:o}),"number"==typeof n&&(t.unicodes[n.toString(16)]={prefix:s,iconName:o}),t},{names:{},unicodes:{}});tO=i.names,tz=i.unicodes,tM=tj(tn.styleDefault,{family:tn.familyDefault})};function tF(t,e){return(tR[t]||{})[e]}function tN(t,e){return(tD[t]||{})[e]}function tH(t){return tO[t]||{prefix:null,iconName:null}}s4=t=>{tM=tj(t.styleDefault,{family:tn.familyDefault})},ts.push(s4),tI();const tB=()=>({prefix:null,iconName:null,rest:[]});function tj(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{family:i=v}=e,n=j[i][t],s=W[i][t]||W[i][n],o=t in tg.styles?t:null;return s||o||null}const tV={[v]:Object.keys(G[v]),[w]:Object.keys(G[w]),[_]:Object.keys(G[_])};function tW(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{skipLookups:i=!1}=e,n={[v]:"".concat(tn.cssPrefix,"-").concat(v),[w]:"".concat(tn.cssPrefix,"-").concat(w),[_]:"".concat(tn.cssPrefix,"-").concat(_)},s=null,o=v,r=C.filter(t=>t!==y);r.forEach(e=>{(t.includes(n[e])||t.some(t=>tV[e].includes(t)))&&(o=e)});let a=t.reduce((t,e)=>{let a=function(t,e){let i=e.split("-"),n=i[0],s=i.slice(1).join("-");return n!==t||""===s||~Q.indexOf(s)?null:s}(tn.cssPrefix,e);if(tk[e]?(s=e=tL[o].includes(e)?q[o][e]:e,t.prefix=e):tA[o].indexOf(e)>-1?(s=e,t.prefix=tj(e,{family:o})):a?t.iconName=a:e===tn.replacementClass||r.some(t=>e===n[t])||t.rest.push(e),!i&&t.prefix&&t.iconName){let e="fa"===s?tH(t.iconName):{},i=tN(t.prefix,t.iconName);e.prefix&&(s=null),t.iconName=e.iconName||i||t.iconName,t.prefix=e.prefix||t.prefix,"far"!==t.prefix||tk.far||!tk.fas||tn.autoFetchSvg||(t.prefix="fas")}return t},tB());return(t.includes("fa-brands")||t.includes("fab"))&&(a.prefix="fab"),(t.includes("fa-duotone")||t.includes("fad"))&&(a.prefix="fad"),!a.prefix&&o===w&&(tk.fass||tn.autoFetchSvg)&&(a.prefix="fass",a.iconName=tN(a.prefix,a.iconName)||a.iconName),!a.prefix&&o===_&&(tk.fasds||tn.autoFetchSvg)&&(a.prefix="fasds",a.iconName=tN(a.prefix,a.iconName)||a.iconName),("fa"===a.prefix||"fa"===s)&&(a.prefix=tM||"fas"),a}let tZ=[],tG={};const tU={},tq=Object.keys(tU);function tK(t,e){for(var i=arguments.length,n=Array(i>2?i-2:0),s=2;s{e=t.apply(null,[e,...n])}),e}function tY(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n{t.apply(null,i)})}function t$(){let t=arguments[0],e=Array.prototype.slice.call(arguments,1);return tU[t]?tU[t].apply(null,e):void 0}function tJ(t){"fa"===t.prefix&&(t.prefix="fas");let{iconName:e}=t,i=t.prefix||tM;if(e)return e=tN(i,e)||e,t_(tX.definitions,i,e)||t_(tg.styles,i,e)}const tX=new class{constructor(){this.definitions={}}add(){for(var t=arguments.length,e=Array(t),i=0;i{this.definitions[t]={...this.definitions[t]||{},...n[t]},tT(t,n[t]);let e=G[v][t];e&&tT(e,n[t]),tI()})}reset(){this.definitions={}}_pullDefinitions(t,e){let i=e.prefix&&e.iconName&&e.icon?{0:e}:e;return Object.keys(i).map(e=>{let{prefix:n,iconName:s,icon:o}=i[e],r=o[2];t[n]||(t[n]={}),r.length>0&&r.forEach(e=>{"string"==typeof e&&(t[n][e]=o)}),t[n][s]=o}),t}},tQ={noAuto:()=>{tn.autoReplaceSvg=!1,tn.observeMutations=!1,tY("noAuto")},config:tn,dom:{i2svg:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return g?(tY("beforeI2svg",t),t$("pseudoElements2svg",t),t$("i2svg",t)):Promise.reject(Error("Operation requires a DOM of some kind."))},watch:function(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{autoReplaceSvgRoot:i}=e;!1===tn.autoReplaceSvg&&(tn.autoReplaceSvg=!0),tn.observeMutations=!0,t=()=>{t0({autoReplaceSvgRoot:i}),tY("watch",e)},g&&(ty?setTimeout(t,0):tb.push(t))}},parse:{icon:t=>{if(null===t)return null;if("object"==typeof t&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:tN(t.prefix,t.iconName)||t.iconName};if(Array.isArray(t)&&2===t.length){let e=0===t[1].indexOf("fa-")?t[1].slice(3):t[1],i=tj(t[0]);return{prefix:i,iconName:tN(i,e)||e}}if("string"==typeof t&&(t.indexOf("".concat(tn.cssPrefix,"-"))>-1||t.match(K))){let e=tW(t.split(" "),{skipLookups:!0});return{prefix:e.prefix||tM,iconName:tN(e.prefix,e.iconName)||e.iconName}}if("string"==typeof t){let e=tM;return{prefix:e,iconName:tN(e,t)||t}}}},library:tX,findIconDefinition:tJ,toHtml:tw},t0=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{autoReplaceSvgRoot:e=m}=t;(Object.keys(tg.styles).length>0||tn.autoFetchSvg)&&g&&tn.autoReplaceSvg&&tQ.dom.i2svg({node:e})};function t1(t,e){return Object.defineProperty(t,"abstract",{get:e}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(t=>tw(t))}}),Object.defineProperty(t,"node",{get:function(){if(!g)return;let e=m.createElement("div");return e.innerHTML=t.html,e.children}}),t}function t2(t){let{icons:{main:e,mask:i},prefix:n,iconName:s,transform:o,symbol:r,title:a,maskId:l,titleId:h,extra:c,watchable:u=!1}=t,{width:d,height:m}=i.found?i:e,p="fak"===n,f=[tn.replacementClass,s?"".concat(tn.cssPrefix,"-").concat(s):""].filter(t=>-1===c.classes.indexOf(t)).filter(t=>""!==t||!!t).concat(c.classes).join(" "),g={children:[],attributes:{...c.attributes,"data-prefix":n,"data-icon":s,class:f,role:c.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(d," ").concat(m)}},b=p&&!~c.classes.indexOf("fa-fw")?{width:"".concat(d/m*1,"em")}:{};u&&(g.attributes[P]=""),a&&(g.children.push({tag:"title",attributes:{id:g.attributes["aria-labelledby"]||"title-".concat(h||tr())},children:[a]}),delete g.attributes.title);let v={...g,prefix:n,iconName:s,main:e,mask:i,maskId:l,transform:o,symbol:r,styles:{...b,...c.styles}},{children:y,attributes:w}=i.found&&e.found?t$("generateAbstractMask",v)||{children:[],attributes:{}}:t$("generateAbstractIcon",v)||{children:[],attributes:{}};return(v.children=y,v.attributes=w,r)?function(t){let{prefix:e,iconName:i,children:n,attributes:s,symbol:o}=t,r=!0===o?"".concat(e,"-").concat(tn.cssPrefix,"-").concat(i):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...s,id:r},children:n}]}]}(v):function(t){let{children:e,main:i,mask:n,attributes:s,styles:o,transform:r}=t;if(tu(r)&&i.found&&!n.found){let{width:t,height:e}=i,n={x:t/e/2,y:.5};s.style=tc({...o,"transform-origin":"".concat(n.x+r.x/16,"em ").concat(n.y+r.y/16,"em")})}return[{tag:"svg",attributes:s,children:e}]}(v)}function t3(t){let{content:e,width:i,height:n,transform:s,title:o,extra:r,watchable:a=!1}=t,l={...r.attributes,...o?{title:o}:{},class:r.classes.join(" ")};a&&(l[P]="");let h={...r.styles};tu(s)&&(h.transform=function(t){let{transform:e,width:i=16,height:n=16,startCentered:s=!1}=t,o="";return s&&b?o+="translate(".concat(e.x/16-i/2,"em, ").concat(e.y/16-n/2,"em) "):s?o+="translate(calc(-50% + ".concat(e.x/16,"em), calc(-50% + ").concat(e.y/16,"em)) "):o+="translate(".concat(e.x/16,"em, ").concat(e.y/16,"em) "),o+="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") ")+"rotate(".concat(e.rotate,"deg) ")}({transform:s,startCentered:!0,width:i,height:n}),h["-webkit-transform"]=h.transform);let c=tc(h);c.length>0&&(l.style=c);let u=[];return u.push({tag:"span",attributes:l,children:[e]}),o&&u.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),u}const{styles:t4}=tg;function t6(t){let e=t[0],i=t[1],[n]=t.slice(4);return{found:!0,width:e,height:i,icon:Array.isArray(n)?{tag:"g",attributes:{class:"".concat(tn.cssPrefix,"-").concat(k.GROUP)},children:[{tag:"path",attributes:{class:"".concat(tn.cssPrefix,"-").concat(k.SECONDARY),fill:"currentColor",d:n[0]}},{tag:"path",attributes:{class:"".concat(tn.cssPrefix,"-").concat(k.PRIMARY),fill:"currentColor",d:n[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:n}}}}const t5={found:!1,width:512,height:512};function t9(t,e){let i=e;return"fa"===e&&null!==tn.styleDefault&&(e=tM),new Promise((n,s)=>{var o,r;if("fa"===i){let i=tH(t)||{};t=i.iconName||t,e=i.prefix||e}if(t&&e&&t4[e]&&t4[e][t])return n(t6(t4[e][t]));o=t,r=e,F||tn.showMissingIcons||!o||console.error('Icon with name "'.concat(o,'" and prefix "').concat(r,'" is missing.')),n({...t5,icon:tn.showMissingIcons&&t&&t$("missingIconAbstract")||{}})})}const t7=()=>{},t8=tn.measurePerformance&&f&&f.mark&&f.measure?f:{mark:t7,measure:t7},et='FA "6.6.0"',ee=t=>{t8.mark("".concat(et," ").concat(t," ends")),t8.measure("".concat(et," ").concat(t),"".concat(et," ").concat(t," begins"),"".concat(et," ").concat(t," ends"))};var ei={begin:t=>(t8.mark("".concat(et," ").concat(t," begins")),()=>ee(t))};const en=()=>{};function es(t){return"string"==typeof(t.getAttribute?t.getAttribute(P):null)}function eo(t){return m.createElementNS("http://www.w3.org/2000/svg",t)}function er(t){return m.createElement(t)}const ea={replace:function(t){let e=t[0];if(e.parentNode){if(t[1].forEach(t=>{e.parentNode.insertBefore(function t(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{ceFn:n="svg"===e.tag?eo:er}=i;if("string"==typeof e)return m.createTextNode(e);let s=n(e.tag);return Object.keys(e.attributes||[]).forEach(function(t){s.setAttribute(t,e.attributes[t])}),(e.children||[]).forEach(function(e){s.appendChild(t(e,{ceFn:n}))}),s}(t),e)}),null===e.getAttribute(P)&&tn.keepOriginalSource){let t;let i=m.createComment((t=" ".concat(e.outerHTML," "),t="".concat(t,"Font Awesome fontawesome.com ")));e.parentNode.replaceChild(i,e)}else e.remove()}},nest:function(t){let e=t[0],i=t[1];if(~tl(e).indexOf(tn.replacementClass))return ea.replace(t);let n=new RegExp("".concat(tn.cssPrefix,"-.*"));if(delete i[0].attributes.id,i[0].attributes.class){let t=i[0].attributes.class.split(" ").reduce((t,e)=>(e===tn.replacementClass||e.match(n)?t.toSvg.push(e):t.toNode.push(e),t),{toNode:[],toSvg:[]});i[0].attributes.class=t.toSvg.join(" "),0===t.toNode.length?e.removeAttribute("class"):e.setAttribute("class",t.toNode.join(" "))}let s=i.map(t=>tw(t)).join("\n");e.setAttribute(P,""),e.innerHTML=s}};function el(t){t()}function eh(t,e){let i="function"==typeof e?e:en;if(0===t.length)i();else{let e=el;"async"===tn.mutateApproach&&(e=d.requestAnimationFrame||el),e(()=>{let e=!0===tn.autoReplaceSvg?ea.replace:ea[tn.autoReplaceSvg]||ea.replace,n=ei.begin("mutate");t.map(e),n(),i()})}}let ec=!1,eu=null;function ed(t){if(!p||!tn.observeMutations)return;let{treeCallback:e=en,nodeCallback:i=en,pseudoElementsCallback:n=en,observeMutationsRoot:s=m}=t;eu=new p(t=>{if(ec)return;let s=tM;ta(t).forEach(t=>{if("childList"===t.type&&t.addedNodes.length>0&&!es(t.addedNodes[0])&&(tn.searchPseudoElements&&n(t.target),e(t.target)),"attributes"===t.type&&t.target.parentNode&&tn.searchPseudoElements&&n(t.target.parentNode),"attributes"===t.type&&es(t.target)&&~J.indexOf(t.attributeName)){if("class"===t.attributeName&&function(t){let e=t.getAttribute?t.getAttribute(z):null,i=t.getAttribute?t.getAttribute(D):null;return e&&i}(t.target)){let{prefix:e,iconName:i}=tW(tl(t.target));t.target.setAttribute(z,e||s),i&&t.target.setAttribute(D,i)}else{var o;(o=t.target)&&o.classList&&o.classList.contains&&o.classList.contains(tn.replacementClass)&&i(t.target)}}})}),g&&eu.observe(s,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function em(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0},{iconName:i,prefix:n,rest:s}=function(t){let e=t.getAttribute("data-prefix"),i=t.getAttribute("data-icon"),n=void 0!==t.innerText?t.innerText.trim():"",s=tW(tl(t));if(s.prefix||(s.prefix=tM),e&&i&&(s.prefix=e,s.iconName=i),s.iconName&&s.prefix)return s;if(s.prefix&&n.length>0){var o,r;s.iconName=(o=s.prefix,r=t.innerText,(tP[o]||{})[r]||tF(s.prefix,tE(t.innerText)))}return!s.iconName&&tn.autoFetchSvg&&t.firstChild&&t.firstChild.nodeType===Node.TEXT_NODE&&(s.iconName=t.firstChild.data),s}(t),o=function(t){let e=ta(t.attributes).reduce((t,e)=>("class"!==t.name&&"style"!==t.name&&(t[e.name]=e.value),t),{}),i=t.getAttribute("title"),n=t.getAttribute("data-fa-title-id");return tn.autoA11y&&(i?e["aria-labelledby"]="".concat(tn.replacementClass,"-title-").concat(n||tr()):(e["aria-hidden"]="true",e.focusable="false")),e}(t),r=tK("parseNodeAttributes",{},t),a=e.styleParser?function(t){let e=t.getAttribute("style"),i=[];return e&&(i=e.split(";").reduce((t,e)=>{let i=e.split(":"),n=i[0],s=i.slice(1);return n&&s.length>0&&(t[n]=s.join(":").trim()),t},{})),i}(t):[];return{iconName:i,title:t.getAttribute("title"),titleId:t.getAttribute("data-fa-title-id"),prefix:n,transform:to,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:s,styles:a,attributes:o},...r}}const{styles:ep}=tg;function ef(t){let e="nest"===tn.autoReplaceSvg?em(t,{styleParser:!1}):em(t);return~e.extra.classes.indexOf(Y)?t$("generateLayersText",t,e):t$("generateSvgReplacementMutation",t,e)}let eg=new Set;function eb(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!g)return Promise.resolve();let i=m.documentElement.classList,n=t=>i.add("".concat(A,"-").concat(t)),s=t=>i.remove("".concat(A,"-").concat(t)),o=tn.autoFetchSvg?eg:N.map(t=>"fa-".concat(t)).concat(Object.keys(ep));o.includes("fa")||o.push("fa");let r=[".".concat(Y,":not([").concat(P,"])")].concat(o.map(t=>".".concat(t,":not([").concat(P,"])"))).join(", ");if(0===r.length)return Promise.resolve();let a=[];try{a=ta(t.querySelectorAll(r))}catch(t){}if(!(a.length>0))return Promise.resolve();n("pending"),s("complete");let l=ei.begin("onTree"),h=a.reduce((t,e)=>{try{let i=ef(e);i&&t.push(i)}catch(t){F||"MissingIcon"!==t.name||console.error(t)}return t},[]);return new Promise((t,i)=>{Promise.all(h).then(i=>{eh(i,()=>{n("active"),n("complete"),s("pending"),"function"==typeof e&&e(),l(),t()})}).catch(t=>{l(),i(t)})})}function ev(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;ef(t).then(t=>{t&&eh([t],e)})}N.map(t=>{eg.add("fa-".concat(t))}),Object.keys(j[v]).map(eg.add.bind(eg)),Object.keys(j[w]).map(eg.add.bind(eg)),Object.keys(j[_]).map(eg.add.bind(eg)),eg=[...eg];const ey=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{transform:i=to,symbol:n=!1,mask:s=null,maskId:o=null,title:r=null,titleId:a=null,classes:l=[],attributes:h={},styles:c={}}=e;if(!t)return;let{prefix:u,iconName:d,icon:m}=t;return t1({type:"icon",...t},()=>(tY("beforeDOMElementCreation",{iconDefinition:t,params:e}),tn.autoA11y&&(r?h["aria-labelledby"]="".concat(tn.replacementClass,"-title-").concat(a||tr()):(h["aria-hidden"]="true",h.focusable="false")),t2({icons:{main:t6(m),mask:s?t6(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:u,iconName:d,transform:{...to,...i},symbol:n,title:r,maskId:o,titleId:a,extra:{attributes:h,styles:c,classes:l}})))},ew=RegExp('"',"ug"),e_={FontAwesome:{normal:"fas",400:"fas"},"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"},"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"},"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},eC=Object.keys(e_).reduce((t,e)=>(t[e.toLowerCase()]=e_[e],t),{}),eE=Object.keys(eC).reduce((t,e)=>{let i=eC[e];return t[e]=i[900]||[...Object.entries(i)][0][1],t},{});function ex(t,e){let i="".concat("data-fa-pseudo-element-pending").concat(e.replace(":","-"));return new Promise((n,s)=>{if(null!==t.getAttribute(i))return n();let o=ta(t.children).filter(t=>t.getAttribute(O)===e)[0],r=d.getComputedStyle(t,e),a=r.getPropertyValue("font-family"),l=a.match($),h=r.getPropertyValue("font-weight"),c=r.getPropertyValue("content");if(o&&!l)return t.removeChild(o),n();if(l&&"none"!==c&&""!==c){let c=r.getPropertyValue("content"),u=function(t,e){let i=t.replace(/^['"]|['"]$/g,"").toLowerCase(),n=parseInt(e),s=isNaN(n)?"normal":n;return(eC[i]||{})[s]||eE[i]}(a,h),{value:d,isSecondary:p}=function(t){let e=t.replace(ew,""),i=function(t,e){let i;let n=t.length,s=t.charCodeAt(0);return s>=55296&&s<=56319&&n>1&&(i=t.charCodeAt(1))>=56320&&i<=57343?(s-55296)*1024+i-56320+65536:s}(e,0),n=2===e.length&&e[0]===e[1];return{value:n?tE(e[0]):tE(e),isSecondary:i>=1105920&&i<=1112319||n}}(c),f=l[0].startsWith("FontAwesome"),g=tF(u,d),b=g;if(f){let t=function(t){let e=tz[t],i=tF("fas",t);return e||(i?{prefix:"fas",iconName:i}:null)||{prefix:null,iconName:null}}(d);t.iconName&&t.prefix&&(g=t.iconName,u=t.prefix)}if(!g||p||o&&o.getAttribute(z)===u&&o.getAttribute(D)===b)n();else{t.setAttribute(i,b),o&&t.removeChild(o);let r={iconName:null,title:null,titleId:null,prefix:null,transform:to,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},{extra:a}=r;a.attributes[O]=e,t9(g,u).then(s=>{let o=t2({...r,icons:{main:s,mask:tB()},prefix:u,iconName:b,extra:a,watchable:!0}),l=m.createElementNS("http://www.w3.org/2000/svg","svg");"::before"===e?t.insertBefore(l,t.firstChild):t.appendChild(l),l.outerHTML=o.map(t=>tw(t)).join("\n"),t.removeAttribute(i),n()}).catch(s)}}else n()})}function eT(t){return Promise.all([ex(t,"::before"),ex(t,"::after")])}function ek(t){return t.parentNode!==document.head&&!~I.indexOf(t.tagName.toUpperCase())&&!t.getAttribute(O)&&(!t.parentNode||"svg"!==t.parentNode.tagName)}function eS(t){if(g)return new Promise((e,i)=>{let n=ta(t.querySelectorAll("*")).filter(ek).map(eT),s=ei.begin("searchPseudoElements");ec=!0,Promise.all(n).then(()=>{s(),ec=!1,e()}).catch(()=>{s(),ec=!1,i()})})}let eL=!1;const eM=t=>t.toLowerCase().split(" ").reduce((t,e)=>{let i=e.toLowerCase().split("-"),n=i[0],s=i.slice(1).join("-");if(n&&"h"===s)return t.flipX=!0,t;if(n&&"v"===s)return t.flipY=!0,t;if(isNaN(s=parseFloat(s)))return t;switch(n){case"grow":t.size=t.size+s;break;case"shrink":t.size=t.size-s;break;case"left":t.x=t.x-s;break;case"right":t.x=t.x+s;break;case"up":t.y=t.y-s;break;case"down":t.y=t.y+s;break;case"rotate":t.rotate=t.rotate+s}return t},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0}),eR={x:0,y:0,width:"100%",height:"100%"};function eP(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return t.attributes&&(t.attributes.fill||e)&&(t.attributes.fill="black"),t}!function(t,e){let{mixoutsTo:i}=e;tZ=t,tG={},Object.keys(tU).forEach(t=>{-1===tq.indexOf(t)&&delete tU[t]}),tZ.forEach(t=>{let e=t.mixout?t.mixout():{};if(Object.keys(e).forEach(t=>{"function"==typeof e[t]&&(i[t]=e[t]),"object"==typeof e[t]&&Object.keys(e[t]).forEach(n=>{i[t]||(i[t]={}),i[t][n]=e[t][n]})}),t.hooks){let e=t.hooks();Object.keys(e).forEach(t=>{tG[t]||(tG[t]=[]),tG[t].push(e[t])})}t.provides&&t.provides(tU)})}([{mixout:()=>({dom:{css:td,insertCss:tp}}),hooks:()=>({beforeDOMElementCreation(){tp()},beforeI2svg(){tp()}})},{mixout:()=>({icon:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(t||{}).icon?t:tJ(t||{}),{mask:n}=e;return n&&(n=(n||{}).icon?n:tJ(n||{})),ey(i,{...e,mask:n})}}),hooks:()=>({mutationObserverCallbacks:t=>(t.treeCallback=eb,t.nodeCallback=ev,t)}),provides(t){t.i2svg=function(t){let{node:e=m,callback:i=()=>{}}=t;return eb(e,i)},t.generateSvgReplacementMutation=function(t,e){let{iconName:i,title:n,titleId:s,prefix:o,transform:r,symbol:a,mask:l,maskId:h,extra:c}=e;return new Promise((e,u)=>{Promise.all([t9(i,o),l.iconName?t9(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(l=>{let[u,d]=l;e([t,t2({icons:{main:u,mask:d},prefix:o,iconName:i,transform:r,symbol:a,maskId:h,title:n,titleId:s,extra:c,watchable:!0})])}).catch(u)})},t.generateAbstractIcon=function(t){let e,{children:i,attributes:n,main:s,transform:o,styles:r}=t,a=tc(r);return a.length>0&&(n.style=a),tu(o)&&(e=t$("generateAbstractTransformGrouping",{main:s,transform:o,containerWidth:s.width,iconWidth:s.width})),i.push(e||s.icon),{children:i,attributes:n}}}},{mixout:()=>({layer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{classes:i=[]}=e;return t1({type:"layer"},()=>{tY("beforeDOMElementCreation",{assembler:t,params:e});let n=[];return t(t=>{Array.isArray(t)?t.map(t=>{n=n.concat(t.abstract)}):n=n.concat(t.abstract)}),[{tag:"span",attributes:{class:["".concat(tn.cssPrefix,"-layers"),...i].join(" ")},children:n}]})}})},{mixout:()=>({counter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{title:i=null,classes:n=[],attributes:s={},styles:o={}}=e;return t1({type:"counter",content:t},()=>(tY("beforeDOMElementCreation",{content:t,params:e}),function(t){let{content:e,title:i,extra:n}=t,s={...n.attributes,...i?{title:i}:{},class:n.classes.join(" ")},o=tc(n.styles);o.length>0&&(s.style=o);let r=[];return r.push({tag:"span",attributes:s,children:[e]}),i&&r.push({tag:"span",attributes:{class:"sr-only"},children:[i]}),r}({content:t.toString(),title:i,extra:{attributes:s,styles:o,classes:["".concat(tn.cssPrefix,"-layers-counter"),...n]}})))}})},{mixout:()=>({text(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{transform:i=to,title:n=null,classes:s=[],attributes:o={},styles:r={}}=e;return t1({type:"text",content:t},()=>(tY("beforeDOMElementCreation",{content:t,params:e}),t3({content:t,transform:{...to,...i},title:n,extra:{attributes:o,styles:r,classes:["".concat(tn.cssPrefix,"-layers-text"),...s]}})))}}),provides(t){t.generateLayersText=function(t,e){let{title:i,transform:n,extra:s}=e,o=null,r=null;if(b){let e=parseInt(getComputedStyle(t).fontSize,10),i=t.getBoundingClientRect();o=i.width/e,r=i.height/e}return tn.autoA11y&&!i&&(s.attributes["aria-hidden"]="true"),Promise.resolve([t,t3({content:t.innerHTML,width:o,height:r,transform:n,title:i,extra:s,watchable:!0})])}}},{hooks:()=>({mutationObserverCallbacks:t=>(t.pseudoElementsCallback=eS,t)}),provides(t){t.pseudoElements2svg=function(t){let{node:e=m}=t;tn.searchPseudoElements&&eS(e)}}},{mixout:()=>({dom:{unwatch(){ec=!0,eL=!0}}}),hooks:()=>({bootstrap(){ed(tK("mutationObserverCallbacks",{}))},noAuto(){eu&&eu.disconnect()},watch(t){let{observeMutationsRoot:e}=t;eL?ec=!1:ed(tK("mutationObserverCallbacks",{observeMutationsRoot:e}))}})},{mixout:()=>({parse:{transform:t=>eM(t)}}),hooks:()=>({parseNodeAttributes(t,e){let i=e.getAttribute("data-fa-transform");return i&&(t.transform=eM(i)),t}}),provides(t){t.generateAbstractTransformGrouping=function(t){let{main:e,transform:i,containerWidth:n,iconWidth:s}=t,o="translate(".concat(32*i.x,", ").concat(32*i.y,") "),r="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),a="rotate(".concat(i.rotate," 0 0)"),l={transform:"".concat(o," ").concat(r," ").concat(a)},h={outer:{transform:"translate(".concat(n/2," 256)")},inner:l,path:{transform:"translate(".concat(-(s/2*1)," -256)")}};return{tag:"g",attributes:{...h.outer},children:[{tag:"g",attributes:{...h.inner},children:[{tag:e.icon.tag,children:e.icon.children,attributes:{...e.icon.attributes,...h.path}}]}]}}}},{hooks:()=>({parseNodeAttributes(t,e){let i=e.getAttribute("data-fa-mask"),n=i?tW(i.split(" ").map(t=>t.trim())):tB();return n.prefix||(n.prefix=tM),t.mask=n,t.maskId=e.getAttribute("data-fa-mask-id"),t}}),provides(t){t.generateAbstractMask=function(t){let{children:e,attributes:i,main:n,mask:s,maskId:o,transform:r}=t,{width:a,icon:l}=n,{width:h,icon:c}=s,u=function(t){let{transform:e,containerWidth:i,iconWidth:n}=t,s="translate(".concat(32*e.x,", ").concat(32*e.y,") "),o="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),r="rotate(".concat(e.rotate," 0 0)"),a={transform:"".concat(s," ").concat(o," ").concat(r)};return{outer:{transform:"translate(".concat(i/2," 256)")},inner:a,path:{transform:"translate(".concat(-(n/2*1)," -256)")}}}({transform:r,containerWidth:h,iconWidth:a}),d={tag:"rect",attributes:{...eR,fill:"white"}},m=l.children?{children:l.children.map(eP)}:{},p={tag:"g",attributes:{...u.inner},children:[eP({tag:l.tag,attributes:{...l.attributes,...u.path},...m})]},f={tag:"g",attributes:{...u.outer},children:[p]},g="mask-".concat(o||tr()),b="clip-".concat(o||tr()),v={tag:"mask",attributes:{...eR,id:g,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[d,f]},y={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:"g"===c.tag?c.children:[c]},v]};return e.push(y,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(g,")"),...eR}}),{children:e,attributes:i}}}},{provides(t){let e=!1;d.matchMedia&&(e=d.matchMedia("(prefers-reduced-motion: reduce)").matches),t.missingIconAbstract=function(){let t=[],i={fill:"currentColor"},n={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};t.push({tag:"path",attributes:{...i,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});let s={...n,attributeName:"opacity"},o={tag:"circle",attributes:{...i,cx:"256",cy:"364",r:"28"},children:[]};return e||o.children.push({tag:"animate",attributes:{...n,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...s,values:"1;0;1;1;0;1;"}}),t.push(o),t.push({tag:"path",attributes:{...i,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:e?[]:[{tag:"animate",attributes:{...s,values:"1;0;0;0;0;1;"}}]}),e||t.push({tag:"path",attributes:{...i,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...s,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:t}}}},{hooks:()=>({parseNodeAttributes(t,e){let i=e.getAttribute("data-fa-symbol");return t.symbol=null!==i&&(""===i||i),t}})}],{mixoutsTo:tQ}),tQ.noAuto,tQ.config;const eO=tQ.library,ez=tQ.dom;tQ.parse,tQ.findIconDefinition,tQ.toHtml,tQ.icon,tQ.layer,tQ.text,tQ.counter;const eD={prefix:"far",iconName:"square",icon:[448,512,[9632,9723,9724,61590],"f0c8","M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"]},eA={prefix:"far",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm169.8-90.7c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},eI={prefix:"far",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c-9.4 9.4-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0z"]},eF={prefix:"fas",iconName:"table",icon:[512,512,[],"f0ce","M64 256l0-96 160 0 0 96L64 256zm0 64l160 0 0 96L64 416l0-96zm224 96l0-96 160 0 0 96-160 0zM448 256l-160 0 0-96 160 0 0 96zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"]},eN={prefix:"fas",iconName:"square-check",icon:[448,512,[9745,9989,61510,"check-square"],"f14a","M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]},eH={prefix:"fas",iconName:"chevron-up",icon:[512,512,[],"f077","M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]},eB={prefix:"fas",iconName:"arrow-right",icon:[448,512,[8594],"f061","M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]},ej={prefix:"fas",iconName:"up-right-from-square",icon:[512,512,["external-link-alt"],"f35d","M352 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9L370.7 96 201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 141.3l41.4 41.4c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-128c0-17.7-14.3-32-32-32L352 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]},eV={prefix:"fas",iconName:"sliders",icon:[512,512,["sliders-h"],"f1de","M0 416c0 17.7 14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384c-17.7 0-32 14.3-32 32zm128 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32-80c-32.8 0-61 19.7-73.3 48L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48zM192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm73.3-64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64z"]},eW={prefix:"fas",iconName:"earth-americas",icon:[512,512,[127758,"earth","earth-america","globe-americas"],"f57d","M57.7 193l9.4 16.4c8.3 14.5 21.9 25.2 38 29.8L163 255.7c17.2 4.9 29 20.6 29 38.5l0 39.9c0 11 6.2 21 16 25.9s16 14.9 16 25.9l0 39c0 15.6 14.9 26.9 29.9 22.6c16.1-4.6 28.6-17.5 32.7-33.8l2.8-11.2c4.2-16.9 15.2-31.4 30.3-40l8.1-4.6c15-8.5 24.2-24.5 24.2-41.7l0-8.3c0-12.7-5.1-24.9-14.1-33.9l-3.9-3.9c-9-9-21.2-14.1-33.9-14.1L257 256c-11.1 0-22.1-2.9-31.8-8.4l-34.5-19.7c-4.3-2.5-7.6-6.5-9.2-11.2c-3.2-9.6 1.1-20 10.2-24.5l5.9-3c6.6-3.3 14.3-3.9 21.3-1.5l23.2 7.7c8.2 2.7 17.2-.4 21.9-7.5c4.7-7 4.2-16.3-1.2-22.8l-13.6-16.3c-10-12-9.9-29.5 .3-41.3l15.7-18.3c8.8-10.3 10.2-25 3.5-36.7l-2.4-4.2c-3.5-.2-6.9-.3-10.4-.3C163.1 48 84.4 108.9 57.7 193zM464 256c0-36.8-9.6-71.4-26.4-101.5L412 164.8c-15.7 6.3-23.8 23.8-18.5 39.8l16.9 50.7c3.5 10.4 12 18.3 22.6 20.9l29.1 7.3c1.2-9 1.8-18.2 1.8-27.5zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z"]},eZ={prefix:"fas",iconName:"magnifying-glass",icon:[512,512,[128269,"search"],"f002","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]},eG={prefix:"fas",iconName:"chevron-down",icon:[512,512,[],"f078","M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]};var eU={};!function(t){function e(t){var e,i,n,s;for(i=1,n=arguments.length;i0?Math.floor(t):Math.ceil(t)};function V(t,e,i){return t instanceof B?t:k(t)?new B(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new B(t.x,t.y):new B(t,e,i)}function W(t,e){if(t)for(var i=e?[t,e]:t,n=0,s=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=Z(t);var e=this.min,i=this.max,n=t.min,s=t.max,o=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return o&&r},overlaps:function(t){t=Z(t);var e=this.min,i=this.max,n=t.min,s=t.max,o=s.x>e.x&&n.xe.y&&n.y=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=U(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),o=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return o&&r},overlaps:function(t){t=U(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),o=s.lat>e.lat&&n.late.lng&&n.lng1,tR=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",v,e),window.removeEventListener("testPassiveEventSupport",v,e)}catch(t){}return t}(),tP=!!document.createElement("canvas").getContext,tO=!!(document.createElementNS&&ti("svg").createSVGRect),tz=!!tO&&((c=document.createElement("div")).innerHTML="","http://www.w3.org/2000/svg"===(c.firstChild&&c.firstChild.namespaceURI)),tD=!tO&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}();function tA(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var tI={ie:to,ielt9:tr,edge:ta,webkit:tl,android:th,android23:tc,androidStock:td,opera:tm,chrome:tp,gecko:tf,safari:tg,phantom:tb,opera12:tv,win:ty,ie3d:tw,webkit3d:t_,gecko3d:tC,any3d:tE,mobile:tx,mobileWebkit:tx&&tl,mobileWebkit3d:tx&&t_,msPointer:tT,pointer:tk,touch:tL,touchNative:tS,mobileOpera:tx&&tm,mobileGecko:tx&&tf,retina:tM,passiveEvents:tR,canvas:tP,svg:tO,vml:tD,inlineSvg:tz,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},tF=tI.msPointer?"MSPointerDown":"pointerdown",tN=tI.msPointer?"MSPointerMove":"pointermove",tH=tI.msPointer?"MSPointerUp":"pointerup",tB=tI.msPointer?"MSPointerCancel":"pointercancel",tj={touchstart:tF,touchmove:tN,touchend:tH,touchcancel:tB},tV={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&eC(e),tK(t,e)},touchmove:tK,touchend:tK,touchcancel:tK},tW={},tZ=!1;function tG(t){tW[t.pointerId]=t}function tU(t){tW[t.pointerId]&&(tW[t.pointerId]=t)}function tq(t){delete tW[t.pointerId]}function tK(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],tW)e.touches.push(tW[i]);e.changedTouches=[e],t(e)}}var tY=ee(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),t$=ee(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),tJ="webkitTransition"===t$||"OTransition"===t$?t$+"End":"transitionend";function tX(t){return"string"==typeof t?document.getElementById(t):t}function tQ(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function t0(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function t1(t){var e=t.parentNode;e&&e.removeChild(t)}function t2(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function t3(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function t4(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function t6(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=t8(t);return i.length>0&&RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function t5(t,e){if(void 0!==t.classList)for(var i=_(e),n=0,s=i.length;n0?2*window.devicePixelRatio:1;function eS(t){return tI.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/ek:t.deltaY&&1===t.deltaMode?-(20*t.deltaY):t.deltaY&&2===t.deltaMode?-(60*t.deltaY):t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&32765>Math.abs(t.detail)?-(20*t.detail):t.detail?-(60*(t.detail/32765)):0}function eL(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var eM=H.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=es(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=A(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;ethis.options.maxZoom))?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,U(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=V((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=V(e.paddingBottomRight||e.padding||[0,0]),s=this.project(this.getCenter()),o=this.project(t),r=this.getPixelBounds(),a=Z([r.min.add(i),r.max.subtract(n)]),l=a.getSize();if(!a.contains(o)){this._enforcingBounds=!0;var h=o.subtract(a.getCenter()),c=a.extend(o).getSize().subtract(l);s.x+=h.x<0?-c.x:c.x,s.y+=h.y<0?-c.y:c.y,this.panTo(this.unproject(s),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var i=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),s=i.divideBy(2).round(),o=n.divideBy(2).round(),r=s.subtract(o);return r.x||r.y?(t.animate&&t.pan?this.panBy(r):(t.pan&&this._rawPanBy(r),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(m(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var i=m(this._handleGeolocationResponse,this),n=m(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(i,n,t):navigator.geolocation.getCurrentPosition(i,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new q(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var s=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(s,n.maxZoom):s)}var o={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(o[r]=t.coords[r]);this.fire("locationfound",o)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){var t;if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),t1(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(I(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)t1(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=t0("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return(this._checkIfLoaded(),this._lastCenter&&!this._moved())?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new G(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=U(t),i=V(i||[0,0]);var n=this.getZoom()||0,s=this.getMinZoom(),o=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=Z(this.project(a,n),this.project(r,n)).getSize(),c=tI.any3d?this.options.zoomSnap:1,u=l.x/h.x,d=l.y/h.y,m=e?Math.max(u,d):Math.min(u,d);return n=this.getScaleZoom(m,n),c&&(n=c/100*Math.round(n/(c/100)),n=e?Math.ceil(n/c)*c:Math.floor(n/c)*c),Math.max(s,Math.min(o,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new B(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new W(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(K(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(V(t),e)},layerPointToLatLng:function(t){var e=V(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(K(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(K(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(U(t))},distance:function(t,e){return this.options.crs.distance(K(t),K(e))},containerPointToLayerPoint:function(t){return V(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return V(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(V(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(K(t)))},mouseEventToContainerPoint:function(t){return eT(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=tX(t);if(e){if(e._leaflet_id)throw Error("Map container is already initialized.")}else throw Error("Map container not found.");ed(e,"scroll",this._onScroll,this),this._containerId=f(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&tI.any3d,t5(t,"leaflet-container"+(tI.touch?" leaflet-touch":"")+(tI.retina?" leaflet-retina":"")+(tI.ielt9?" leaflet-oldie":"")+(tI.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=tQ(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),en(this._mapPane,new B(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(t5(t.markerPane,"leaflet-zoom-hide"),t5(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){en(this._mapPane,new B(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var s=this._zoom!==e;this._moveStart(s,i)._move(t,e)._moveEnd(s),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var s=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((s||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return I(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){en(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[f(this._container)]=this;var e=t?ep:ed;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),tI.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){I(this._resizeRequest),this._resizeRequest=A(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],s="mouseout"===e||"mouseover"===e,o=t.target||t.srcElement,r=!1;o;){if((i=this._targets[f(o)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)&&(s&&!eL(o,t)||(n.push(i),s))||o===this._container)break;o=o.parentNode}return!n.length&&!r&&!s&&this.listens(e,!0)&&(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var i=t.type;"mousedown"===i&&el(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,n){if("click"===t.type){var s=e({},t);s.type="preclick",this._fireDOMEvent(s,s.type,n)}var o=this._findEventTargets(t,i);if(n){for(var r=[],a=0;a=Math.abs(r.x)&&1>=Math.abs(r.y)?t:this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new W(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=Z(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),s=n.min.subtract(t.min),o=n.max.subtract(t.max);return new B(this._rebound(s.x,-o.x),this._rebound(s.y,-o.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=tI.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){t9(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!!(!0===(e&&e.animate)||this.getSize().contains(i))&&(this.panBy(i,e),!0)},_createAnimProxy:function(){var t=this._proxy=t0("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=this._proxy.style[tY];ei(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),e===this._proxy.style[tY]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){t1(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();ei(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),s=this._getCenterOffset(t)._divideBy(1-1/n);return!!(!0===i.animate||this.getSize().contains(s))&&(A(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,t5(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(m(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&t9(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}}),eP=F.extend({options:{position:"topright"},initialize:function(t){C(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return t5(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(t1(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),eO=function(t){return new eP(t)};eR.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=t0("div",e+"control-container",this._container);function n(n,s){t[n+s]=t0("div",e+n+" "+e+s,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)t1(this._controlCorners[t]);t1(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ez=eP.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(f(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i=document.createElement("div");return i.innerHTML='",i.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+f(this),n),this._layerControlInputs.push(e),e.layerId=f(t.layer),ed(e,"click",this._onInputClick,this);var s=document.createElement("span");s.innerHTML=" "+t.name;var o=document.createElement("span");return i.appendChild(o),o.appendChild(e),o.appendChild(s),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],s=[];this._handlingClick=!0;for(var o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||s.push(e);for(o=0;o=0;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&ne.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,ed(t,"click",eC),this.expand();var e=this;setTimeout(function(){ep(t,"click",eC),e._preventClick=!1})}}),eD=eP.extend({options:{position:"topleft",zoomInText:'+',zoomInTitle:"Zoom in",zoomOutText:'−',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=t0("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,s){var o=t0("a",i,n);return o.innerHTML=t,o.href="#",o.title=e,o.setAttribute("role","button"),o.setAttribute("aria-label",e),e_(o),ed(o,"click",eE),ed(o,"click",s,this),ed(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";t9(this._zoomInButton,e),t9(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(t5(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(t5(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});eR.mergeOptions({zoomControl:!0}),eR.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new eD,this.addControl(this.zoomControl))});var eA=eP.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=t0("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=t0("div",e,i)),t.imperial&&(this._iScale=t0("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,n,s=3.2808399*t;s>5280?(e=s/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(s),this._updateScale(this._iScale,n+" ft",n/s))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),eI=eP.extend({options:{position:"bottomright",prefix:''+(tI.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){C(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=t0("div","leaflet-control-attribution"),e_(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' | ')}}});eR.mergeOptions({attributionControl:!0}),eR.addInitHook(function(){this.options.attributionControl&&new eI().addTo(this)}),eP.Layers=ez,eP.Zoom=eD,eP.Scale=eA,eP.Attribution=eI,eO.layers=function(t,e,i){return new ez(t,e,i)},eO.zoom=function(t){return new eD(t)},eO.scale=function(t){return new eA(t)},eO.attribution=function(t){return new eI(t)};var eF=F.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});eF.addTo=function(t,e){return t.addHandler(e,this),this};var eN=tI.touch?"touchstart mousedown":"mousedown",eH=H.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){C(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(ed(this._dragStartTarget,eN,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(eH._dragging===this&&this.finishDrag(!0),ep(this._dragStartTarget,eN,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!(!this._enabled||(this._moved=!1,t6(this._element,"leaflet-zoom-anim")))){if(t.touches&&1!==t.touches.length){eH._dragging===this&&this.finishDrag();return}if(!eH._dragging&&!t.shiftKey&&(1===t.which||1===t.button||t.touches)&&(eH._dragging=this,this._preventOutline&&el(this._element),er(),i(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,n=ec(this._element);this._startPoint=new B(e.clientX,e.clientY),this._startPos=es(this._element),this._parentScale=eu(n);var s="mousedown"===t.type;ed(document,s?"mousemove":"touchmove",this._onMove,this),ed(document,s?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new B(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)h&&(r=a,h=l);h>n&&(i[r]=1,t(e,i,n,s,r),t(e,i,n,r,o))}(t,n,e,0,i-1);var s,o=[];for(s=0;se&&(i.push(t[n]),s=n);return se.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function eK(t,e,i,n){var s,o=e.x,r=e.y,a=i.x-o,l=i.y-r,h=a*a+l*l;return h>0&&((s=((t.x-o)*a+(t.y-r)*l)/h)>1?(o=i.x,r=i.y):s>0&&(o+=a*s,r+=l*s)),a=t.x-o,l=t.y-r,n?a*a+l*l:new B(o,r)}function eY(t){return!k(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function e$(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),eY(t)}function eJ(t,e){if(!t||0===t.length)throw Error("latlngs not passed");eY(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var i,n,s,o,r,a,l,h,c=K([0,0]),u=U(t);u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(c=eV(t));var d=t.length,m=[];for(i=0;in){l=(o-n)/s,h=[a.x-l*(a.x-r.x),a.y-l*(a.y-r.y)];break}var f=e.unproject(V(h));return K([f.lat+c.lat,f.lng+c.lng])}var eX={project:function(t){return new B(t.lng,t.lat)},unproject:function(t){return new q(t.y,t.x)},bounds:new W([-180,-90],[180,90])},eQ={R:6378137,R_MINOR:6356752.314245179,bounds:new W([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,s=this.R_MINOR/i,o=Math.sqrt(1-s*s),r=o*Math.sin(n);return n=-i*Math.log(Math.max(Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),o/2),1e-10)),new B(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,s=this.R_MINOR/n,o=Math.sqrt(1-s*s),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)h=Math.PI/2-2*Math.atan(r*(e=Math.pow((1-(e=o*Math.sin(a)))/(1+e),o/2)))-a,a+=h;return new q(a*i,t.x*i/n)}},e0=e({},$,{code:"EPSG:3395",projection:eQ,transformation:Q(u=.5/(Math.PI*eQ.R),.5,-u,.5)}),e1=e({},$,{code:"EPSG:4326",projection:eX,transformation:Q(1/180,1,-1/180,.5)}),e2=e({},Y,{projection:eX,transformation:Q(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});Y.Earth=$,Y.EPSG3395=e0,Y.EPSG3857=tt,Y.EPSG900913=te,Y.EPSG4326=e1,Y.Simple=e2;var e3=H.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[f(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[f(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});eR.include({addLayer:function(t){if(!t._layerAdd)throw Error("The provided object is not a Layer.");var e=f(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=f(t);return this._layers[e]&&(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return f(t) in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){t=t?k(t)?t:[t]:[];for(var e=0,i=t.length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof q&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){is.prototype._setLatLngs.call(this,t),eY(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return eY(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new B(e,e);if(t=new W(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t)){if(this.options.noClip){this._parts=this._rings;return}for(var n,s=0,o=this._rings.length;st.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||is.prototype._containsPoint.call(this,t,!0)}}),ir=e6.extend({initialize:function(t,e){C(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=k(t)?t:t.features;if(s){for(e=0,i=s.length;e0&&s.push(s[0].slice()),s}function im(t,i){return t.feature?e({},t.feature,{geometry:i}):ip(i)}function ip(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var ig={toGeoJSON:function(t){return im(this,{type:"Point",coordinates:iu(this.getLatLng(),t)})}};function ib(t,e){return new ir(t,e)}e8.include(ig),ii.include(ig),ie.include(ig),is.include({toGeoJSON:function(t){var e=!eY(this._latlngs),i=id(this._latlngs,e?1:0,!1,t);return im(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),io.include({toGeoJSON:function(t){var e=!eY(this._latlngs),i=e&&!eY(this._latlngs[0]),n=id(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),im(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),e4.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),im(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return(this.eachLayer(function(e){if(e.toGeoJSON){var s=e.toGeoJSON(t);if(i)n.push(s.geometry);else{var o=ip(s);"FeatureCollection"===o.type?n.push.apply(n,o.features):n.push(o)}}}),i)?im(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var iv=e3.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=U(e),C(this,i)},onAdd:function(){!this._image&&(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(t5(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){t1(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&t3(this._image),this},bringToBack:function(){return this._map&&t4(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=U(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:t0("img");if(t5(e,"leaflet-image-layer"),this._zoomAnimated&&t5(e,"leaflet-zoom-animated"),this.options.className&&t5(e,this.options.className),e.onselectstart=v,e.onmousemove=v,e.onload=m(this.fire,this,"load"),e.onerror=m(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;ei(this._image,i,e)},_reset:function(){var t=this._image,e=new W(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();en(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){et(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),iy=iv.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:t0("video");if(t5(e,"leaflet-image-layer"),this._zoomAnimated&&t5(e,"leaflet-zoom-animated"),this.options.className&&t5(e,this.options.className),e.onselectstart=v,e.onmousemove=v,e.onloadeddata=m(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],s=0;s0?n:[e.src];return}k(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var o=0;o×',ed(n,"click",function(t){eC(t),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.max(i=Math.min(i,this.options.maxWidth),this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,s=this.options.maxHeight,o="leaflet-popup-scrolled";s&&n>s?(e.height=s+"px",t5(t,o)):t9(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();en(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(tQ(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,s=new B(this._containerLeft,-i-this._containerBottom);s._add(es(this._container));var o=t.layerPointToContainerPoint(s),r=V(this.options.autoPanPadding),a=V(this.options.autoPanPaddingTopLeft||r),l=V(this.options.autoPanPaddingBottomRight||r),h=t.getSize(),c=0,u=0;o.x+n+l.x>h.x&&(c=o.x+n-h.x+l.x),o.x-c-a.x<0&&(c=o.x-a.x),o.y+i+l.y>h.y&&(u=o.y+i-h.y+l.y),o.y-u-a.y<0&&(u=o.y-a.y),(c||u)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([c,u]))}},_getAnchor:function(){return V(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});eR.mergeOptions({closePopupOnClick:!0}),eR.include({openPopup:function(t,e,i){return this._initOverlay(iC,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),e3.include({bindPopup:function(t,e){return this._popup=this._initOverlay(iC,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof e6||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){eE(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof it)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var iE=i_.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){i_.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){i_.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=i_.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=t0("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+f(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,s=this._container,o=n.latLngToContainerPoint(n.getCenter()),r=n.layerPointToContainerPoint(t),a=this.options.direction,l=s.offsetWidth,h=s.offsetHeight,c=V(this.options.offset),u=this._getAnchor();"top"===a?(e=l/2,i=h):"bottom"===a?(e=l/2,i=0):("center"===a?e=l/2:"right"===a?e=0:"left"===a?e=l:r.xthis.options.maxZoom||in&&this._retainParent(s,o,r,n))},_retainChildren:function(t,e,i,n){for(var s=2*t;s<2*t+2;s++)for(var o=2*e;o<2*e+2;o++){var r=new B(s,o);r.z=i+1;var a=this._tileCoordsToKey(r),l=this._tiles[a];if(l&&l.active){l.retain=!0;continue}l&&l.loaded&&(l.retain=!0),i+1this.options.maxZoom||void 0!==this.options.minZoom&&s1){this._setView(t,i);return}for(var u=s.min.y;u<=s.max.y;u++)for(var d=s.min.x;d<=s.max.x;d++){var m=new B(d,u);if(m.z=this._tileZoom,this._isValidTile(m)){var p=this._tiles[this._tileCoordsToKey(m)];p?p.current=!0:r.push(m)}}if(r.sort(function(t,e){return t.distanceTo(o)-e.distanceTo(o)}),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(d=0;di.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return U(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),s=n.add(i);return[e.unproject(n,t.z),e.unproject(s,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new G(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new B(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(t1(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){t5(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=v,t.onmousemove=v,tI.ielt9&&this.options.opacity<1&&et(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),m(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&A(m(this._tileReady,this,t,null,s)),en(s,i),this._tiles[n]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(et(i.el,0),I(this._fadeFrame),this._fadeFrame=A(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(t5(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),tI.ielt9||!this._map._fadeAnimated?A(this._pruneTiles,this):setTimeout(m(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new B(this._wrapX?b(t.x,this._wrapX):t.x,this._wrapY?b(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new W(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),ik=iT.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=C(this,e)).detectRetina&&tI.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return ed(i,"load",m(this._tileOnLoad,this,e,i)),ed(i,"error",m(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var i={r:tI.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(i.y=n),i["-y"]=n}return T(this._url,e(i,this.options))},_tileOnLoad:function(t,e){tI.ielt9?setTimeout(m(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,i=this.options.zoomReverse,n=this.options.zoomOffset;return i&&(t=e-t),t+n},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=v,e.onerror=v,!e.complete)){e.src=M;var i=this._tiles[t].coords;t1(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",M),iT.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==M))return iT.prototype._tileReady.call(this,t,e,i)}});function iS(t,e){return new ik(t,e)}var iL=ik.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,i){this._url=t;var n=e({},this.defaultWmsParams);for(var s in i)s in this.options||(n[s]=i[s]);var o=(i=C(this,i)).detectRetina&&tI.retina?2:1,r=this.getTileSize();n.width=r.x*o,n.height=r.y*o,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,ik.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=Z(i.project(e[0]),i.project(e[1])),s=n.min,o=n.max,r=(this._wmsVersion>=1.3&&this._crs===e1?[s.y,s.x,o.y,o.x]:[s.x,s.y,o.x,o.y]).join(","),a=ik.prototype.getTileUrl.call(this,t);return a+E(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,i){return e(this.wmsParams,t),i||this.redraw(),this}});ik.WMS=iL,iS.wms=function(t,e){return new iL(t,e)};var iM=e3.extend({options:{padding:.1},initialize:function(t){C(this,t),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),t5(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),o=n.multiplyBy(-i).add(s).subtract(this._map._getNewPixelOrigin(t,e));tI.any3d?ei(this._container,o,i):en(this._container,o)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new W(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),iR=iM.extend({options:{tolerance:0},getEvents:function(){var t=iM.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){iM.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");ed(t,"mousemove",this._onMouseMove,this),ed(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ed(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){I(this._redrawRequest),delete this._ctx,t1(this._container),ep(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){iM.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=tI.retina?2:1;en(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",tI.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){iM.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[f(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[f(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),s=[];for(i=0;i')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),iz=tI.vml?iO:ti,iD=iM.extend({_initContainer:function(){this._container=iz("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=iz("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){t1(this._container),ep(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){iM.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),en(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=iz("path");t.options.className&&t5(e,t.options.className),t.options.interactive&&t5(e,"leaflet-interactive"),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){t1(t._path),t.removeInteractiveTarget(t._path),delete this._layers[f(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,tn(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n=Math.max(Math.round(t._radiusY),1)||i,s="a"+i+","+n+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+s+2*i+",0 "+s+-(2*i)+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){t3(t._path)},_bringToBack:function(t){t4(t._path)}});function iA(t){return tI.svg||tI.vml?new iD(t):null}tI.vml&&iD.include({_initContainer:function(){this._container=t0("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(iM.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=iO("shape");t5(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=iO("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;t1(e),t.removeInteractiveTarget(e),delete this._layers[f(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,s=t._container;s.stroked=!!n.stroke,s.filled=!!n.fill,n.stroke?(e||(e=t._stroke=iO("stroke")),s.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=k(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(s.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=iO("fill")),s.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(s.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){t3(t._container)},_bringToBack:function(t){t4(t._container)}}),eR.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&iP(t)||iA(t)}});var iI=io.extend({initialize:function(t,e){io.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=U(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});iD.create=iz,iD.pointsToPath=tn,ir.geometryToLayer=ia,ir.coordsToLatLng=ih,ir.coordsToLatLngs=ic,ir.latLngToCoords=iu,ir.latLngsToCoords=id,ir.getFeature=im,ir.asFeature=ip,eR.mergeOptions({boxZoom:!0});var iF=eF.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){ed(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ep(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){t1(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),i(),er(),this._startPoint=this._map.mouseEventToContainerPoint(t),ed(document,{contextmenu:eE,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=t0("div","leaflet-zoom-box",this._container),t5(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new W(this._point,this._startPoint),i=e.getSize();en(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(t1(this._box),t9(this._container,"leaflet-crosshair")),n(),ea(),ep(document,{contextmenu:eE,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(m(this._resetState,this),0);var e=new G(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});eR.addInitHook("addHandler","boxZoom",iF),eR.mergeOptions({doubleClickZoom:!0});var iN=eF.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,s=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(s):e.setZoomAround(t.containerPoint,s)}});eR.addInitHook("addHandler","doubleClickZoom",iN),eR.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var iH=eF.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new eH(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}t5(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){t9(this._map._container,"leaflet-grab"),t9(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=U(this._map.options.maxBounds);this._offsetLimit=Z(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,s=(n-e+i)%t+e-i,o=(n+e+i)%t-e-i,r=Math.abs(s+i)0?s:-s))-e;this._delta=0,this._startTime=null,o&&("center"===t.options.scrollWheelZoom?t.setZoom(e+o):t.setZoomAround(this._lastMousePos,e+o))}});eR.addInitHook("addHandler","scrollWheelZoom",ij),eR.mergeOptions({tapHold:tI.touchNative&&tI.safari&&tI.mobile,tapTolerance:15});var iV=eF.extend({addHooks:function(){ed(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ep(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new B(e.clientX,e.clientY),this._holdTimeout=setTimeout(m(function(){this._cancel(),this._isTapValid()&&(ed(document,"touchend",eC),ed(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),ed(document,"touchend touchcancel contextmenu",this._cancel,this),ed(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){ep(document,"touchend",eC),ep(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),ep(document,"touchend touchcancel contextmenu",this._cancel,this),ep(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new B(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});eR.addInitHook("addHandler","tapHold",iV),eR.mergeOptions({touchZoom:tI.touch,bounceAtZoomLimits:!0});var iW=eF.extend({addHooks:function(){t5(this._map._container,"leaflet-touch-zoom"),ed(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){t9(this._map._container,"leaflet-touch-zoom"),ep(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),ed(document,"touchmove",this._onTouchMove,this),ed(document,"touchend touchcancel",this._onTouchEnd,this),eC(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),s=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(s,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&s>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var o=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===o.x&&0===o.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(o),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),I(this._animRequest);var r=m(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=A(r,this,!0),eC(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,I(this._animRequest),ep(document,"touchmove",this._onTouchMove,this),ep(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});eR.addInitHook("addHandler","touchZoom",iW),eR.BoxZoom=iF,eR.DoubleClickZoom=iN,eR.Drag=iH,eR.Keyboard=iB,eR.ScrollWheelZoom=ij,eR.TapHold=iV,eR.TouchZoom=iW,t.Bounds=W,t.Browser=tI,t.CRS=Y,t.Canvas=iR,t.Circle=ii,t.CircleMarker=ie,t.Class=F,t.Control=eP,t.DivIcon=ix,t.DivOverlay=i_,t.DomEvent={__proto__:null,on:ed,off:ep,stopPropagation:ey,disableScrollPropagation:ew,disableClickPropagation:e_,preventDefault:eC,stop:eE,getPropagationPath:ex,getMousePosition:eT,getWheelDelta:eS,isExternalTarget:eL,addListener:ed,removeListener:ep},t.DomUtil={__proto__:null,TRANSFORM:tY,TRANSITION:t$,TRANSITION_END:tJ,get:tX,getStyle:tQ,create:t0,remove:t1,empty:t2,toFront:t3,toBack:t4,hasClass:t6,addClass:t5,removeClass:t9,setClass:t7,getClass:t8,setOpacity:et,testProp:ee,setTransform:ei,setPosition:en,getPosition:es,get disableTextSelection(){return i},get enableTextSelection(){return n},disableImageDrag:er,enableImageDrag:ea,preventOutline:el,restoreOutline:eh,getSizedParentNode:ec,getScale:eu},t.Draggable=eH,t.Evented=H,t.FeatureGroup=e6,t.GeoJSON=ir,t.GridLayer=iT,t.Handler=eF,t.Icon=e5,t.ImageOverlay=iv,t.LatLng=q,t.LatLngBounds=G,t.Layer=e3,t.LayerGroup=e4,t.LineUtil={__proto__:null,simplify:eW,pointToSegmentDistance:eZ,closestPointOnSegment:function(t,e,i){return eK(t,e,i)},clipSegment:eG,_getEdgeIntersection:eU,_getBitCode:eq,_sqClosestPointOnSegment:eK,isFlat:eY,_flat:e$,polylineCenter:eJ},t.Map=eR,t.Marker=e8,t.Mixin={Events:N},t.Path=it,t.Point=B,t.PolyUtil={__proto__:null,clipPolygon:eB,polygonCenter:ej,centroid:eV},t.Polygon=io,t.Polyline=is,t.Popup=iC,t.PosAnimation=eM,t.Projection={__proto__:null,LonLat:eX,Mercator:eQ,SphericalMercator:J},t.Rectangle=iI,t.Renderer=iM,t.SVG=iD,t.SVGOverlay=iw,t.TileLayer=ik,t.Tooltip=iE,t.Transformation=X,t.Util={__proto__:null,extend:e,create:d,bind:m,get lastId(){return p},stamp:f,throttle:g,wrapNum:b,falseFn:v,formatNum:y,trim:w,splitWords:_,setOptions:C,getParamString:E,template:T,isArray:k,indexOf:S,emptyImageUrl:M,requestFn:z,cancelFn:D,requestAnimFrame:A,cancelAnimFrame:I},t.VideoOverlay=iy,t.bind=m,t.bounds=Z,t.canvas=iP,t.circle=function(t,e,i){return new ii(t,e,i)},t.circleMarker=function(t,e){return new ie(t,e)},t.control=eO,t.divIcon=function(t){return new ix(t)},t.extend=e,t.featureGroup=function(t,e){return new e6(t,e)},t.geoJSON=ib,t.geoJson=ib,t.gridLayer=function(t){return new iT(t)},t.icon=function(t){return new e5(t)},t.imageOverlay=function(t,e,i){return new iv(t,e,i)},t.latLng=K,t.latLngBounds=U,t.layerGroup=function(t,e){return new e4(t,e)},t.map=function(t,e){return new eR(t,e)},t.marker=function(t,e){return new e8(t,e)},t.point=V,t.polygon=function(t,e){return new io(t,e)},t.polyline=function(t,e){return new is(t,e)},t.popup=function(t,e){return new iC(t,e)},t.rectangle=function(t,e){return new iI(t,e)},t.setOptions=C,t.stamp=f,t.svg=iA,t.svgOverlay=function(t,e,i){return new iw(t,e,i)},t.tileLayer=iS,t.tooltip=function(t,e){return new iE(t,e)},t.transformation=Q,t.version="1.9.4",t.videoOverlay=function(t,e,i){return new iy(t,e,i)};var iZ=window.L;t.noConflict=function(){return window.L=iZ,this},window.L=t}(eU);const eq="noMandatesMarkers",eK=new eU.TileLayer("https://tiles.stadiamaps.com/tiles/stamen_toner_lite/{z}/{x}/{y}{r}.png",{attribution:`© OpenStreetMap © OpenMapTiles © Stadia Maps © Stamen Design`,subdomains:"abcd",minZoom:3,maxZoom:10}),eY={weight:1,color:"white",fillColor:"#d7191c",fillOpacity:1,pane:eq},e$={weight:1,color:"white",fillColor:"#fdae61",fillOpacity:1};function eJ(t){let{zoom:e,isPrimary:i}=t,n=Math.round(2.37*e-2.29);return i?n+2:n}function eX(t,e,i,n){for(let s of t)e.has(s)||i[s].removeFrom(n);for(let s of e)t.has(s)||i[s].addTo(n)}var eQ={};window,eQ=function(){var t,e,i={282:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.clearChoices=e.activateChoices=e.filterChoices=e.addChoice=void 0;var n=i(883);e.addChoice=function(t){var e=t.value,i=t.label,s=t.id,o=t.groupId,r=t.disabled,a=t.elementId,l=t.customProperties,h=t.placeholder,c=t.keyCode;return{type:n.ACTION_TYPES.ADD_CHOICE,value:e,label:i,id:s,groupId:o,disabled:r,elementId:a,customProperties:l,placeholder:h,keyCode:c}},e.filterChoices=function(t){return{type:n.ACTION_TYPES.FILTER_CHOICES,results:t}},e.activateChoices=function(t){return void 0===t&&(t=!0),{type:n.ACTION_TYPES.ACTIVATE_CHOICES,active:t}},e.clearChoices=function(){return{type:n.ACTION_TYPES.CLEAR_CHOICES}}},783:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.addGroup=void 0;var n=i(883);e.addGroup=function(t){var e=t.value,i=t.id,s=t.active,o=t.disabled;return{type:n.ACTION_TYPES.ADD_GROUP,value:e,id:i,active:s,disabled:o}}},464:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.highlightItem=e.removeItem=e.addItem=void 0;var n=i(883);e.addItem=function(t){var e=t.value,i=t.label,s=t.id,o=t.choiceId,r=t.groupId,a=t.customProperties,l=t.placeholder,h=t.keyCode;return{type:n.ACTION_TYPES.ADD_ITEM,value:e,label:i,id:s,choiceId:o,groupId:r,customProperties:a,placeholder:l,keyCode:h}},e.removeItem=function(t,e){return{type:n.ACTION_TYPES.REMOVE_ITEM,id:t,choiceId:e}},e.highlightItem=function(t,e){return{type:n.ACTION_TYPES.HIGHLIGHT_ITEM,id:t,highlighted:e}}},137:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.setIsLoading=e.resetTo=e.clearAll=void 0;var n=i(883);e.clearAll=function(){return{type:n.ACTION_TYPES.CLEAR_ALL}},e.resetTo=function(t){return{type:n.ACTION_TYPES.RESET_TO,state:t}},e.setIsLoading=function(t){return{type:n.ACTION_TYPES.SET_IS_LOADING,isLoading:t}}},373:function(t,e,i){var n=this&&this.__spreadArray||function(t,e,i){if(i||2==arguments.length)for(var n,s=0,o=e.length;s=0?this._store.getGroupById(s):null;return this._store.dispatch((0,h.highlightItem)(i,!0)),e&&this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:i,value:void 0===o?"":o,label:void 0===r?"":r,groupValue:a&&a.value?a.value:null}),this},t.prototype.unhighlightItem=function(t){if(!t||!t.id)return this;var e=t.id,i=t.groupId,n=void 0===i?-1:i,s=t.value,o=t.label,r=n>=0?this._store.getGroupById(n):null;return this._store.dispatch((0,h.highlightItem)(e,!1)),this.passedElement.triggerEvent(d.EVENTS.highlightItem,{id:e,value:void 0===s?"":s,label:void 0===o?"":o,groupValue:r&&r.value?r.value:null}),this},t.prototype.highlightAll=function(){var t=this;return this._store.items.forEach(function(e){return t.highlightItem(e)}),this},t.prototype.unhighlightAll=function(){var t=this;return this._store.items.forEach(function(e){return t.unhighlightItem(e)}),this},t.prototype.removeActiveItemsByValue=function(t){var e=this;return this._store.activeItems.filter(function(e){return e.value===t}).forEach(function(t){return e._removeItem(t)}),this},t.prototype.removeActiveItems=function(t){var e=this;return this._store.activeItems.filter(function(e){return e.id!==t}).forEach(function(t){return e._removeItem(t)}),this},t.prototype.removeHighlightedItems=function(t){var e=this;return void 0===t&&(t=!1),this._store.highlightedActiveItems.forEach(function(i){e._removeItem(i),t&&e._triggerChange(i.value)}),this},t.prototype.showDropdown=function(t){var e=this;return this.dropdown.isActive||requestAnimationFrame(function(){e.dropdown.show(),e.containerOuter.open(e.dropdown.distanceFromTopWindow),!t&&e._canSearch&&e.input.focus(),e.passedElement.triggerEvent(d.EVENTS.showDropdown,{})}),this},t.prototype.hideDropdown=function(t){var e=this;return this.dropdown.isActive&&requestAnimationFrame(function(){e.dropdown.hide(),e.containerOuter.close(),!t&&e._canSearch&&(e.input.removeActiveDescendant(),e.input.blur()),e.passedElement.triggerEvent(d.EVENTS.hideDropdown,{})}),this},t.prototype.getValue=function(t){void 0===t&&(t=!1);var e=this._store.activeItems.reduce(function(e,i){var n=t?i.value:i;return e.push(n),e},[]);return this._isSelectOneElement?e[0]:e},t.prototype.setValue=function(t){var e=this;return this.initialised&&t.forEach(function(t){return e._setChoiceOrItem(t)}),this},t.prototype.setChoiceByValue=function(t){var e=this;return!this.initialised||this._isTextElement||(Array.isArray(t)?t:[t]).forEach(function(t){return e._findAndSelectChoiceByValue(t)}),this},t.prototype.setChoices=function(t,e,i,n){var s=this;if(void 0===t&&(t=[]),void 0===e&&(e="value"),void 0===i&&(i="label"),void 0===n&&(n=!1),!this.initialised)throw ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof e||!e)throw TypeError("value parameter must be a name of 'value' field in passed objects");if(n&&this.clearChoices(),"function"==typeof t){var o=t(this);if("function"==typeof Promise&&o instanceof Promise)return new Promise(function(t){return requestAnimationFrame(t)}).then(function(){return s._handleLoadingState(!0)}).then(function(){return o}).then(function(t){return s.setChoices(t,e,i,n)}).catch(function(t){s.config.silent||console.error(t)}).then(function(){return s._handleLoadingState(!1)}).then(function(){return s});if(!Array.isArray(o))throw TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof o));return this.setChoices(o,e,i,!1)}if(!Array.isArray(t))throw TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),t.forEach(function(t){t.choices?s._addGroup({id:t.id?parseInt("".concat(t.id),10):null,group:t,valueKey:e,labelKey:i}):s._addChoice({value:t[e],label:t[i],isSelected:!!t.selected,isDisabled:!!t.disabled,placeholder:!!t.placeholder,customProperties:t.customProperties})}),this._stopLoading(),this},t.prototype.clearChoices=function(){return this._store.dispatch((0,a.clearChoices)()),this},t.prototype.clearStore=function(){return this._store.dispatch((0,c.clearAll)()),this},t.prototype.clearInput=function(){var t=!this._isSelectOneElement;return this.input.clear(t),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))),this},t.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var t=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,e=this._isSelectElement,i=this._currentState.items!==this._prevState.items;t&&(e&&this._renderChoices(),i&&this._renderItems(),this._prevState=this._currentState)}},t.prototype._renderChoices=function(){var t=this,e=this._store,i=e.activeGroups,n=e.activeChoices,s=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame(function(){return t.choiceList.scrollToTop()}),i.length>=1&&!this._isSearching){var o=n.filter(function(t){return!0===t.placeholder&&-1===t.groupId});o.length>=1&&(s=this._createChoicesFragment(o,s)),s=this._createGroupsFragment(i,n,s)}else n.length>=1&&(s=this._createChoicesFragment(n,s));if(s.childNodes&&s.childNodes.length>0){var r=this._store.activeItems,a=this._canAddItem(r,this.input.value);if(a.response)this.choiceList.append(s),this._highlightChoice();else{var l=this._getTemplate("notice",a.notice);this.choiceList.append(l)}}else{var h=void 0,l=void 0;this._isSearching?(l="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,h=this._getTemplate("notice",l,"no-results")):(l="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,h=this._getTemplate("notice",l,"no-choices")),this.choiceList.append(h)}},t.prototype._renderItems=function(){var t=this._store.activeItems||[];this.itemList.clear();var e=this._createItemsFragment(t);e.childNodes&&this.itemList.append(e)},t.prototype._createGroupsFragment=function(t,e,i){var n=this;return void 0===i&&(i=document.createDocumentFragment()),this.config.shouldSort&&t.sort(this.config.sorter),t.forEach(function(t){var s=e.filter(function(e){return n._isSelectOneElement?e.groupId===t.id:e.groupId===t.id&&("always"===n.config.renderSelectedChoices||!e.selected)});if(s.length>=1){var o=n._getTemplate("choiceGroup",t);i.appendChild(o),n._createChoicesFragment(s,i,!0)}}),i},t.prototype._createChoicesFragment=function(t,e,i){var s=this;void 0===e&&(e=document.createDocumentFragment()),void 0===i&&(i=!1);var o=this.config,r=o.renderSelectedChoices,a=o.searchResultLimit,l=o.renderChoiceLimit,h=this._isSearching?p.sortByScore:this.config.sorter,c=t;"auto"!==r||this._isSelectOneElement||(c=t.filter(function(t){return!t.selected}));var u=c.reduce(function(t,e){return e.placeholder?t.placeholderChoices.push(e):t.normalChoices.push(e),t},{placeholderChoices:[],normalChoices:[]}),d=u.placeholderChoices,m=u.normalChoices;(this.config.shouldSort||this._isSearching)&&m.sort(h);var f=c.length,g=this._isSelectOneElement?n(n([],d,!0),m,!0):m;this._isSearching?f=a:l&&l>0&&!i&&(f=l);for(var b=0;b=n){var r=s?this._searchChoices(t):0;this.passedElement.triggerEvent(d.EVENTS.search,{value:t,resultCount:r})}else o&&(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0)))}},t.prototype._canAddItem=function(t,e){var i=!0,n="function"==typeof this.config.addItemText?this.config.addItemText(e):this.config.addItemText;if(!this._isSelectOneElement){var s=(0,p.existsInArray)(t,e);this.config.maxItemCount>0&&this.config.maxItemCount<=t.length&&(i=!1,n="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&s&&i&&(i=!1,n="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(e):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&i&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(e)&&(i=!1,n="function"==typeof this.config.customAddItemText?this.config.customAddItemText(e):this.config.customAddItemText)}return{response:i,notice:n}},t.prototype._searchChoices=function(t){var e="string"==typeof t?t.trim():t,i="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(e.length<1&&e==="".concat(i," "))return 0;var s=this._store.searchableChoices,o=Object.assign(this.config.fuseOptions,{keys:n([],this.config.searchFields,!0),includeMatches:!0}),l=new r.default(s,o).search(e);return this._currentValue=e,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,a.filterChoices)(l)),l.length},t.prototype._addEventListeners=function(){var t=document.documentElement;t.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),t.addEventListener("click",this._onClick,{passive:!0}),t.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},t.prototype._removeEventListeners=function(){var t=document.documentElement;t.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),t.removeEventListener("click",this._onClick),t.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},t.prototype._onKeyDown=function(t){var e=t.keyCode,i=this._store.activeItems,n=this.input.isFocussed,s=this.dropdown.isActive,o=this.itemList.hasChildren(),r=String.fromCharCode(e),a=/[^\x00-\x1F]/.test(r),l=d.KEY_CODES.BACK_KEY,h=d.KEY_CODES.DELETE_KEY,c=d.KEY_CODES.ENTER_KEY,u=d.KEY_CODES.A_KEY,m=d.KEY_CODES.ESC_KEY,p=d.KEY_CODES.UP_KEY,f=d.KEY_CODES.DOWN_KEY,g=d.KEY_CODES.PAGE_UP_KEY,b=d.KEY_CODES.PAGE_DOWN_KEY;switch(this._isTextElement||s||!a||(this.showDropdown(),this.input.isFocussed||(this.input.value+=t.key.toLowerCase())),e){case u:return this._onSelectKey(t,o);case c:return this._onEnterKey(t,i,s);case m:return this._onEscapeKey(s);case p:case g:case f:case b:return this._onDirectionKey(t,s);case h:case l:return this._onDeleteKey(t,i,n)}},t.prototype._onKeyUp=function(t){var e=t.target,i=t.keyCode,n=this.input.value,s=this._store.activeItems,o=this._canAddItem(s,n),r=d.KEY_CODES.BACK_KEY,l=d.KEY_CODES.DELETE_KEY;if(this._isTextElement){if(o.notice&&n){var h=this._getTemplate("notice",o.notice);this.dropdown.element.innerHTML=h.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0)}else{var c=(i===r||i===l)&&e&&!e.value,u=!this._isTextElement&&this._isSearching,m=this._canSearch&&o.response;c&&u?(this._isSearching=!1,this._store.dispatch((0,a.activateChoices)(!0))):m&&this._handleSearch(this.input.rawValue)}this._canSearch=this.config.searchEnabled},t.prototype._onSelectKey=function(t,e){var i=t.ctrlKey,n=t.metaKey;(i||n)&&e&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},t.prototype._onEnterKey=function(t,e,i){var n=t.target,s=d.KEY_CODES.ENTER_KEY,o=n&&n.hasAttribute("data-button");if(this._isTextElement&&n&&n.value){var r=this.input.value;this._canAddItem(e,r).response&&(this.hideDropdown(!0),this._addItem({value:r}),this._triggerChange(r),this.clearInput())}if(o&&(this._handleButtonAction(e,n),t.preventDefault()),i){var a=this.dropdown.getChild(".".concat(this.config.classNames.highlightedState));a&&(e[0]&&(e[0].keyCode=s),this._handleChoiceAction(e,a)),t.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),t.preventDefault())},t.prototype._onEscapeKey=function(t){t&&(this.hideDropdown(!0),this.containerOuter.focus())},t.prototype._onDirectionKey=function(t,e){var i=t.keyCode,n=t.metaKey,s=d.KEY_CODES.DOWN_KEY,o=d.KEY_CODES.PAGE_UP_KEY,r=d.KEY_CODES.PAGE_DOWN_KEY;if(e||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var a=i===s||i===r?1:-1,l="[data-choice-selectable]",h=void 0;if(n||i===r||i===o)h=a>0?this.dropdown.element.querySelector("".concat(l,":last-of-type")):this.dropdown.element.querySelector(l);else{var c=this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState));h=c?(0,p.getAdjacentEl)(c,l,a):this.dropdown.element.querySelector(l)}h&&((0,p.isScrolledIntoView)(h,this.choiceList.element,a)||this.choiceList.scrollToChildElement(h,a),this._highlightChoice(h)),t.preventDefault()}},t.prototype._onDeleteKey=function(t,e,i){var n=t.target;this._isSelectOneElement||n.value||!i||(this._handleBackspace(e),t.preventDefault())},t.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},t.prototype._onTouchEnd=function(t){var e=(t||t.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(e)&&((e===this.containerOuter.element||e===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),t.stopPropagation()),this._wasTap=!0},t.prototype._onMouseDown=function(t){var e=t.target;if(e instanceof HTMLElement){if(v&&this.choiceList.element.contains(e)){var i=this.choiceList.element.firstElementChild,n="ltr"===this._direction?t.offsetX>=i.offsetWidth:t.offsetX0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},t.prototype._onFocus=function(t){var e,i=this,n=t.target;n&&this.containerOuter.element.contains(n)&&((e={})[d.TEXT_TYPE]=function(){n===i.input.element&&i.containerOuter.addFocusState()},e[d.SELECT_ONE_TYPE]=function(){i.containerOuter.addFocusState(),n===i.input.element&&i.showDropdown(!0)},e[d.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.showDropdown(!0),i.containerOuter.addFocusState())},e)[this.passedElement.element.type]()},t.prototype._onBlur=function(t){var e,i=this,n=t.target;if(n&&this.containerOuter.element.contains(n)&&!this._isScrollingOnIe){var s=this._store.activeItems.some(function(t){return t.highlighted});((e={})[d.TEXT_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),s&&i.unhighlightAll(),i.hideDropdown(!0))},e[d.SELECT_ONE_TYPE]=function(){i.containerOuter.removeFocusState(),n!==i.input.element&&(n!==i.containerOuter.element||i._canSearch)||i.hideDropdown(!0)},e[d.SELECT_MULTIPLE_TYPE]=function(){n===i.input.element&&(i.containerOuter.removeFocusState(),i.hideDropdown(!0),s&&i.unhighlightAll())},e)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},t.prototype._onFormReset=function(){this._store.dispatch((0,c.resetTo)(this._initialState))},t.prototype._highlightChoice=function(t){var e=this;void 0===t&&(t=null);var i=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(i.length){var n=t;Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState))).forEach(function(t){t.classList.remove(e.config.classNames.highlightedState),t.setAttribute("aria-selected","false")}),n?this._highlightPosition=i.indexOf(n):(n=i.length>this._highlightPosition?i[this._highlightPosition]:i[i.length-1])||(n=i[0]),n.classList.add(this.config.classNames.highlightedState),n.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(d.EVENTS.highlightChoice,{el:n}),this.dropdown.isActive&&(this.input.setActiveDescendant(n.id),this.containerOuter.setActiveDescendant(n.id))}},t.prototype._addItem=function(t){var e=t.value,i=t.label,n=t.choiceId,s=t.groupId,o=void 0===s?-1:s,r=t.customProperties,a=void 0===r?{}:r,l=t.placeholder,c=t.keyCode,u=void 0===c?-1:c,m="string"==typeof e?e.trim():e,p=this._store.items,f=(void 0===i?null:i)||m,g=o>=0?this._store.getGroupById(o):null,b=p?p.length+1:1;this.config.prependValue&&(m=this.config.prependValue+m.toString()),this.config.appendValue&&(m+=this.config.appendValue.toString()),this._store.dispatch((0,h.addItem)({value:m,label:f,id:b,choiceId:(void 0===n?-1:n)||-1,groupId:o,customProperties:a,placeholder:void 0!==l&&l,keyCode:u})),this._isSelectOneElement&&this.removeActiveItems(b),this.passedElement.triggerEvent(d.EVENTS.addItem,{id:b,value:m,label:f,customProperties:a,groupValue:g&&g.value?g.value:null,keyCode:u})},t.prototype._removeItem=function(t){var e=t.id,i=t.value,n=t.label,s=t.customProperties,o=t.choiceId,r=t.groupId,a=r&&r>=0?this._store.getGroupById(r):null;e&&o&&(this._store.dispatch((0,h.removeItem)(e,o)),this.passedElement.triggerEvent(d.EVENTS.removeItem,{id:e,value:i,label:n,customProperties:s,groupValue:a&&a.value?a.value:null}))},t.prototype._addChoice=function(t){var e=t.value,i=t.label,n=t.isSelected,s=t.isDisabled,o=t.groupId,r=t.customProperties,l=void 0===r?{}:r,h=t.placeholder,c=void 0!==h&&h,u=t.keyCode,d=void 0===u?-1:u;if(null!=e){var m=this._store.choices,p=(void 0===i?null:i)||e,f=m?m.length+1:1,g="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(f);this._store.dispatch((0,a.addChoice)({id:f,groupId:void 0===o?-1:o,elementId:g,value:e,label:p,disabled:void 0!==s&&s,customProperties:l,placeholder:c,keyCode:d})),void 0!==n&&n&&this._addItem({value:e,label:p,choiceId:f,customProperties:l,placeholder:c,keyCode:d})}},t.prototype._addGroup=function(t){var e=this,i=t.group,n=t.id,s=t.valueKey,o=void 0===s?"value":s,r=t.labelKey,a=void 0===r?"label":r,h=(0,p.isType)("Object",i)?i.choices:Array.from(i.getElementsByTagName("OPTION")),c=n||Math.floor(new Date().valueOf()*Math.random()),u=!!i.disabled&&i.disabled;h?(this._store.dispatch((0,l.addGroup)({value:i.label,id:c,active:!0,disabled:u})),h.forEach(function(t){var i=t.disabled||t.parentNode&&t.parentNode.disabled;e._addChoice({value:t[o],label:(0,p.isType)("Object",t)?t[a]:t.innerHTML,isSelected:t.selected,isDisabled:i,groupId:c,customProperties:t.customProperties,placeholder:t.placeholder})})):this._store.dispatch((0,l.addGroup)({value:i.label,id:i.id,active:!1,disabled:i.disabled}))},t.prototype._getTemplate=function(t){for(var e,i=[],s=1;s0?this.element.scrollTop+r-s:t.offsetTop;requestAnimationFrame(function(){i._animateScroll(a,e)})}},t.prototype._scrollDown=function(t,e,i){var n=(i-t)/e;this.element.scrollTop=t+(n>1?n:1)},t.prototype._scrollUp=function(t,e,i){var n=(t-i)/e;this.element.scrollTop=t-(n>1?n:1)},t.prototype._animateScroll=function(t,e){var i=this,s=n.SCROLLING_SPEED,o=this.element.scrollTop,r=!1;e>0?(this._scrollDown(o,s,t),ot&&(r=!0)),r&&requestAnimationFrame(function(){i._animateScroll(t,e)})},t}();e.default=s},730:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(799),s=function(){function t(t){var e=t.element,i=t.classNames;if(this.element=e,this.classNames=i,!(e instanceof HTMLInputElement)&&!(e instanceof HTMLSelectElement))throw TypeError("Invalid element passed");this.isDisabled=!1}return Object.defineProperty(t.prototype,"isActive",{get:function(){return"active"===this.element.dataset.choice},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.element.value},set:function(t){this.element.value=t},enumerable:!1,configurable:!0}),t.prototype.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var t=this.element.getAttribute("style");t&&this.element.setAttribute("data-choice-orig-style",t),this.element.setAttribute("data-choice","active")},t.prototype.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var t=this.element.getAttribute("data-choice-orig-style");t?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",t)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},t.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},t.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},t.prototype.triggerEvent=function(t,e){(0,n.dispatchEvent)(this.element,t,e)},t}();e.default=s},541:function(t,e,i){var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var i=e.element,n=e.classNames,s=e.delimiter,o=t.call(this,{element:i,classNames:n})||this;return o.delimiter=s,o}return s(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.element.value},set:function(t){this.element.setAttribute("value",t),this.element.value=t},enumerable:!1,configurable:!0}),e}(o(i(730)).default);e.default=r},982:function(t,e,i){var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var i=e.element,n=e.classNames,s=e.template,o=t.call(this,{element:i,classNames:n})||this;return o.template=s,o}return s(e,t),Object.defineProperty(e.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return Array.from(this.element.options)},set:function(t){var e=this,i=document.createDocumentFragment(),n=function(t){var n=e.template(t);i.appendChild(n)};t.forEach(function(t){return n(t)}),this.appendDocFragment(i)},enumerable:!1,configurable:!0}),e.prototype.appendDocFragment=function(t){this.element.innerHTML="",this.element.appendChild(t)},e}(o(i(730)).default);e.default=r},883:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.SCROLLING_SPEED=e.SELECT_MULTIPLE_TYPE=e.SELECT_ONE_TYPE=e.TEXT_TYPE=e.KEY_CODES=e.ACTION_TYPES=e.EVENTS=void 0,e.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},e.ACTION_TYPES={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL",RESET_TO:"RESET_TO",SET_IS_LOADING:"SET_IS_LOADING"},e.KEY_CODES={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},e.TEXT_TYPE="text",e.SELECT_ONE_TYPE="select-one",e.SELECT_MULTIPLE_TYPE="select-multiple",e.SCROLLING_SPEED=4},789:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_CONFIG=e.DEFAULT_CLASSNAMES=void 0;var n=i(799);e.DEFAULT_CLASSNAMES={containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"},e.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,allowHTML:!0,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:n.sortByAlpha,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(t){return'Press Enter to add "'.concat((0,n.sanitise)(t),'"')},maxItemText:function(t){return"Only ".concat(t," values can be added")},valueComparer:function(t,e){return t===e},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:e.DEFAULT_CLASSNAMES}},18:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},978:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},948:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},359:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},285:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},533:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},187:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,n,s)}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(18),e),s(i(978),e),s(i(948),e),s(i(359),e),s(i(285),e),s(i(533),e),s(i(287),e),s(i(132),e),s(i(837),e),s(i(598),e),s(i(369),e),s(i(37),e),s(i(47),e),s(i(923),e),s(i(876),e)},287:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},132:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},837:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},598:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},37:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},369:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},47:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},923:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},876:function(t,e){Object.defineProperty(e,"__esModule",{value:!0})},799:function(t,e){var i;Object.defineProperty(e,"__esModule",{value:!0}),e.parseCustomProperties=e.diff=e.cloneObject=e.existsInArray=e.dispatchEvent=e.sortByScore=e.sortByAlpha=e.strToEl=e.sanitise=e.isScrolledIntoView=e.getAdjacentEl=e.wrap=e.isType=e.getType=e.generateId=e.generateChars=e.getRandomNumber=void 0,e.getRandomNumber=function(t,e){return Math.floor(Math.random()*(e-t)+t)},e.generateChars=function(t){return Array.from({length:t},function(){return(0,e.getRandomNumber)(0,36).toString(36)}).join("")},e.generateId=function(t,i){var n=t.id||t.name&&"".concat(t.name,"-").concat((0,e.generateChars)(2))||(0,e.generateChars)(4);return n=n.replace(/(:|\.|\[|\]|,)/g,""),n="".concat(i,"-").concat(n)},e.getType=function(t){return Object.prototype.toString.call(t).slice(8,-1)},e.isType=function(t,i){return null!=i&&(0,e.getType)(i)===t},e.wrap=function(t,e){return void 0===e&&(e=document.createElement("div")),t.parentNode&&(t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e)),e.appendChild(t)},e.getAdjacentEl=function(t,e,i){void 0===i&&(i=1);for(var n="".concat(i>0?"next":"previous","ElementSibling"),s=t[n];s&&!s.matches(e);)s=s[n];return s},e.isScrolledIntoView=function(t,e,i){return void 0===i&&(i=1),!!t&&(i>0?e.scrollTop+e.offsetHeight>=t.offsetTop+t.offsetHeight:t.offsetTop>=e.scrollTop)},e.sanitise=function(t){return"string"!=typeof t?t:t.replace(/&/g,"&").replace(/>/g,">").replace(/n.indexOf(t)})},e.parseCustomProperties=function(t){if(void 0!==t)try{return JSON.parse(t)}catch(e){return t}return{}}},273:function(t,e){var i=this&&this.__spreadArray||function(t,e,i){if(i||2==arguments.length)for(var n,s=0,o=e.length;s-1)return t.map(function(t){return t.id===parseInt("".concat(r.choiceId),10)&&(t.selected=!0),t});return t;case"REMOVE_ITEM":var a=n;if(a.choiceId&&a.choiceId>-1)return t.map(function(t){return t.id===parseInt("".concat(a.choiceId),10)&&(t.selected=!1),t});return t;case"FILTER_CHOICES":var l=n;return t.map(function(t){return t.active=l.results.some(function(e){var i=e.item,n=e.score;return i.id===t.id&&(t.score=n,!0)}),t});case"ACTIVATE_CHOICES":var h=n;return t.map(function(t){return t.active=h.active,t});case"CLEAR_CHOICES":return e.defaultState;default:return t}}},871:function(t,e){var i=this&&this.__spreadArray||function(t,e,i){if(i||2==arguments.length)for(var n,s=0,o=e.length;s0?"treeitem":"option"),Object.assign(w.dataset,{choice:"",id:d,value:m,selectText:i}),b?(w.classList.add(c),w.dataset.choiceDisabled="",w.setAttribute("aria-disabled","true")):(w.classList.add(l),w.dataset.choiceSelectable=""),w},input:function(t,e){var i=t.classNames,n=i.input,s=i.inputCloned,o=Object.assign(document.createElement("input"),{type:"search",name:"search_terms",className:"".concat(n," ").concat(s),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return o.setAttribute("role","textbox"),o.setAttribute("aria-autocomplete","list"),o.setAttribute("aria-label",e),o},dropdown:function(t){var e=t.classNames,i=e.list,n=e.listDropdown,s=document.createElement("div");return s.classList.add(i,n),s.setAttribute("aria-expanded","false"),s},notice:function(t,e,i){var n,s=t.allowHTML,o=t.classNames,r=o.item,a=o.itemChoice,l=o.noResults,h=o.noChoices;void 0===i&&(i="");var c=[r,a];return"no-choices"===i?c.push(h):"no-results"===i&&c.push(l),Object.assign(document.createElement("div"),((n={})[s?"innerHTML":"innerText"]=e,n.className=c.join(" "),n))},option:function(t){var e=t.label,i=t.value,n=t.customProperties,s=t.active,o=t.disabled,r=new Option(e,i,!1,s);return n&&(r.dataset.customProperties="".concat(n)),r.disabled=!!o,r}}},996:function(t){var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function s(t,e,i){return t.concat(e).map(function(t){return n(t,i)})}function o(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return t.propertyIsEnumerable(e)}):[])}function r(t,e){try{return e in t}catch(t){return!1}}function a(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||s,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=n;var h,c,u=Array.isArray(i);return u!==Array.isArray(t)?n(i,l):u?l.arrayMerge(t,i,l):(c={},(h=l).isMergeableObject(t)&&o(t).forEach(function(e){c[e]=n(t[e],h)}),o(i).forEach(function(e){r(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))||(r(t,e)&&h.isMergeableObject(i[e])?c[e]=(function(t,e){if(!e.customMerge)return a;var i=e.customMerge(t);return"function"==typeof i?i:a})(e,h)(t[e],i[e],h):c[e]=n(i[e],h))}),c)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return a(t,i,e)},{})},t.exports=a},221:function(t,e,i){function n(t){return Array.isArray?Array.isArray(t):"[object Array]"===c(t)}i.r(e),i.d(e,{default:function(){return U}});let s=1/0;function o(t){return"string"==typeof t}function r(t){return"number"==typeof t}function a(t){return"object"==typeof t}function l(t){return null!=t}function h(t){return!t.trim().length}function c(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}let u=t=>`Invalid value for key ${t}`,d=t=>`Pattern length exceeds max of ${t}.`,m=t=>`Missing ${t} property in key`,p=t=>`Property 'weight' in key '${t}' must be a positive integer`,f=Object.prototype.hasOwnProperty;class g{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(t=>{let i=b(t);e+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,e+=i.weight}),this._keys.forEach(t=>{t.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function b(t){let e=null,i=null,s=null,r=1,a=null;if(o(t)||n(t))s=t,e=v(t),i=y(t);else{if(!f.call(t,"name"))throw Error(m("name"));let n=t.name;if(s=n,f.call(t,"weight")&&(r=t.weight)<=0)throw Error(p(n));e=v(n),i=y(n),a=t.getFn}return{path:e,id:i,weight:r,src:s,getFn:a}}function v(t){return n(t)?t:t.split(".")}function y(t){return n(t)?t.join("."):t}var w={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx{if(l(t)){if(e[d]){var m,p;let f=t[e[d]];if(l(f)){if(d===e.length-1&&(o(f)||r(f)||!0===(m=f)||!1===m||a(p=m)&&null!==p&&"[object Boolean]"==c(m)))i.push(null==f?"":function(t){if("string"==typeof t)return t;let e=t+"";return"0"==e&&1/t==-s?"-0":e}(f));else if(n(f)){h=!0;for(let t=0,i=f.length;t{this._keysMap[t.id]=e})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,o(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){let e=this.size();o(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,i=this.size();e{let r=e.getFn?e.getFn(t):this.getFn(t,e.path);if(l(r)){if(n(r)){let t=[],e=[{nestedArrIndex:-1,value:r}];for(;e.length;){let{nestedArrIndex:i,value:s}=e.pop();if(l(s)){if(o(s)&&!h(s)){let e={v:s,i:i,n:this.norm.get(s)};t.push(e)}else n(s)&&s.forEach((t,i)=>{e.push({nestedArrIndex:i,value:t})})}}i.$[s]=t}else if(o(r)&&!h(r)){let t={v:r,n:this.norm.get(r)};i.$[s]=t}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function E(t,e,{getFn:i=w.getFn,fieldNormWeight:n=w.fieldNormWeight}={}){let s=new C({getFn:i,fieldNormWeight:n});return s.setKeys(t.map(b)),s.setSources(e),s.create(),s}function x(t,{errors:e=0,currentLocation:i=0,expectedLocation:n=0,distance:s=w.distance,ignoreLocation:o=w.ignoreLocation}={}){let r=e/t.length;if(o)return r;let a=Math.abs(n-i);return s?r+a/s:a?1:r}class T{constructor(t,{location:e=w.location,threshold:i=w.threshold,distance:n=w.distance,includeMatches:s=w.includeMatches,findAllMatches:o=w.findAllMatches,minMatchCharLength:r=w.minMatchCharLength,isCaseSensitive:a=w.isCaseSensitive,ignoreLocation:l=w.ignoreLocation}={}){if(this.options={location:e,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:r,isCaseSensitive:a,ignoreLocation:l},this.pattern=a?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;let h=(t,e)=>{this.chunks.push({pattern:t,alphabet:function(t){let e={};for(let i=0,n=t.length;i32){let t=0,e=c%32,i=c-e;for(;t{let{isMatch:f,score:g,indices:b}=function(t,e,i,{location:n=w.location,distance:s=w.distance,threshold:o=w.threshold,findAllMatches:r=w.findAllMatches,minMatchCharLength:a=w.minMatchCharLength,includeMatches:l=w.includeMatches,ignoreLocation:h=w.ignoreLocation}={}){let c;if(e.length>32)throw Error(d(32));let u=e.length,m=t.length,p=Math.max(0,Math.min(n,m)),f=o,g=p,b=a>1||l,v=b?Array(m):[];for(;(c=t.indexOf(e,g))>-1;)if(f=Math.min(x(e,{currentLocation:c,expectedLocation:p,distance:s,ignoreLocation:h}),f),g=c+u,b){let t=0;for(;t=l;o-=1){let r=o-1,a=i[t.charAt(r)];if(b&&(v[r]=+!!a),d[o]=(d[o+1]<<1|1)&a,n&&(d[o]|=(y[o+1]|y[o])<<1|1|y[o+1]),d[o]&E&&(_=x(e,{errors:n,currentLocation:r,expectedLocation:p,distance:s,ignoreLocation:h}))<=f){if(f=_,(g=r)<=p)break;l=Math.max(1,2*p-g)}}if(x(e,{errors:n+1,currentLocation:p,expectedLocation:p,distance:s,ignoreLocation:h})>f)break;y=d}let T={isMatch:g>=0,score:Math.max(.001,_)};if(b){let t=function(t=[],e=w.minMatchCharLength){let i=[],n=-1,s=-1,o=0;for(let r=t.length;o=e&&i.push([n,s]),n=-1)}return t[o-1]&&o-n>=e&&i.push([n,o-1]),i}(v,a);t.length?l&&(T.indices=t):T.isMatch=!1}return T}(t,e,m,{location:n+p,distance:s,threshold:o,findAllMatches:r,minMatchCharLength:a,includeMatches:i,ignoreLocation:l});f&&(u=!0),c+=g,f&&b&&(h=[...h,...b])});let m={isMatch:u,score:u?c/this.chunks.length:1};return u&&i&&(m.indices=h),m}}class k{constructor(t){this.pattern=t}static isMultiMatch(t){return S(t,this.multiRegex)}static isSingleMatch(t){return S(t,this.singleRegex)}search(){}}function S(t,e){let i=t.match(e);return i?i[1]:null}class M extends k{constructor(t,{location:e=w.location,threshold:i=w.threshold,distance:n=w.distance,includeMatches:s=w.includeMatches,findAllMatches:o=w.findAllMatches,minMatchCharLength:r=w.minMatchCharLength,isCaseSensitive:a=w.isCaseSensitive,ignoreLocation:l=w.ignoreLocation}={}){super(t),this._bitapSearch=new T(t,{location:e,threshold:i,distance:n,includeMatches:s,findAllMatches:o,minMatchCharLength:r,isCaseSensitive:a,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class R extends k{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,i=0,n=[],s=this.pattern.length;for(;(e=t.indexOf(this.pattern,i))>-1;)i=e+s,n.push([e,i-1]);let o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}}let P=[class extends k{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){let e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},R,class extends k{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){let e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends k{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){let e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends k{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){let e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends k{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){let e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends k{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){let e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},M],O=P.length,z=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,D=new Set([M.type,R.type]),A=[];function I(t,e){for(let i=0,n=A.length;i!!(t[F.AND]||t[F.OR]),B=t=>!!t[N.PATH],j=t=>!n(t)&&a(t)&&!H(t),V=t=>({[F.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function W(t,e,{auto:i=!0}={}){let s=t=>{let r=Object.keys(t),a=B(t);if(!a&&r.length>1&&!H(t))return s(V(t));if(j(t)){let n=a?t[N.PATH]:r[0],s=a?t[N.PATTERN]:t[n];if(!o(s))throw Error(u(n));let l={keyId:y(n),pattern:s};return i&&(l.searcher=I(s,e)),l}let l={children:[],operator:r[0]};return r.forEach(e=>{let i=t[e];n(i)&&i.forEach(t=>{l.children.push(s(t))})}),l};return H(t)||(t=V(t)),s(t)}function Z(t,e){let i=t.matches;e.matches=[],l(i)&&i.forEach(t=>{if(!l(t.indices)||!t.indices.length)return;let{indices:i,value:n}=t,s={indices:i,value:n};t.key&&(s.key=t.key.src),t.idx>-1&&(s.refIndex=t.idx),e.matches.push(s)})}function G(t,e){e.score=t.score}class U{constructor(t,e={},i){this.options={...w,...e},this.options.useExtendedSearch,this._keyStore=new g(this.options.keys),this.setCollection(t,i)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof C))throw Error("Incorrect 'index' type");this._myIndex=e||E(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){l(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){let e=[];for(let i=0,n=this._docs.length;i{let i=1;t.matches.forEach(({key:t,norm:n,score:s})=>{let o=t?t.weight:null;i*=Math.pow(0===s&&o?Number.EPSILON:s,(o||1)*(e?1:n))}),t.score=i})}(h,{ignoreFieldNorm:l}),s&&h.sort(a),r(e)&&e>-1&&(h=h.slice(0,e)),function(t,e,{includeMatches:i=w.includeMatches,includeScore:n=w.includeScore}={}){let s=[];return i&&s.push(Z),n&&s.push(G),t.map(t=>{let{idx:i}=t,n={item:e[i],refIndex:i};return s.length&&s.forEach(e=>{e(t,n)}),n})}(h,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(t){let e=I(t,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:t,i:i,n:s})=>{if(!l(t))return;let{isMatch:o,score:r,indices:a}=e.searchIn(t);o&&n.push({item:t,idx:i,matches:[{score:r,value:t,norm:s,indices:a}]})}),n}_searchLogical(t){let e=W(t,this.options),i=(t,e,n)=>{if(!t.children){let{keyId:i,searcher:s}=t,o=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(e,i),searcher:s});return o&&o.length?[{idx:n,item:e,matches:o}]:[]}let s=[];for(let o=0,r=t.children.length;o{if(l(t)){let r=i(e,t,n);r.length&&(s[n]||(s[n]={idx:n,item:t,matches:[]},o.push(s[n])),r.forEach(({matches:t})=>{s[n].matches.push(...t)}))}}),o}_searchObjectList(t){let e=I(t,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach(({$:t,i:n})=>{if(!l(t))return;let o=[];i.forEach((i,n)=>{o.push(...this._findMatches({key:i,value:t[n],searcher:e}))}),o.length&&s.push({idx:n,item:t,matches:o})}),s}_findMatches({key:t,value:e,searcher:i}){if(!l(e))return[];let s=[];if(n(e))e.forEach(({v:e,i:n,n:o})=>{if(!l(e))return;let{isMatch:r,score:a,indices:h}=i.searchIn(e);r&&s.push({score:a,key:t,value:e,idx:n,norm:o,indices:h})});else{let{v:n,n:o}=e,{isMatch:r,score:a,indices:l}=i.searchIn(n);r&&s.push({score:a,key:t,value:n,norm:o,indices:l})}return s}}U.version="6.6.2",U.createIndex=E,U.parseIndex=function(t,{getFn:e=w.getFn,fieldNormWeight:i=w.fieldNormWeight}={}){let{keys:n,records:s}=t,o=new C({getFn:e,fieldNormWeight:i});return o.setKeys(n),o.setIndexRecords(s),o},U.config=w,U.parseQuery=W,function(...t){A.push(...t)}(class{constructor(t,{isCaseSensitive:e=w.isCaseSensitive,includeMatches:i=w.includeMatches,minMatchCharLength:n=w.minMatchCharLength,ignoreLocation:s=w.ignoreLocation,findAllMatches:o=w.findAllMatches,location:r=w.location,threshold:a=w.threshold,distance:l=w.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:i,minMatchCharLength:n,findAllMatches:o,ignoreLocation:s,location:r,threshold:a,distance:l},this.pattern=e?t:t.toLowerCase(),this.query=function(t,e={}){return t.split("|").map(t=>{let i=t.trim().split(z).filter(t=>t&&!!t.trim()),n=[];for(let t=0,s=i.length;t{t(this.value)})}}function e1(t){let e=document.querySelector("#search-popup"),i=document.querySelector(".header-search-icon-container");e&&i&&(e.hidden=!t,i.ariaExpanded=t.toString())}function e2(t){let e=document.querySelector(".about-popup"),i=document.querySelector(".header-about-icon-container");e&&i&&(e.hidden=!t,i.setAttribute("aria-expanded",t.toString()))}function e3(t){let e=document.querySelector("#scorecard-container");if(e)switch(t.type){case"hidden":e.hidden=!0;break;case"visible":e.innerHTML=function(t,e){let i=t.unifiedPolicy.date?`Reformed ${t.unifiedPolicy.date.preposition()} ${t.unifiedPolicy.date.format()}`:"";return` ${e} Details and citations ${i} ${t.place.pop.toLocaleString()} residents ${t.unifiedPolicy.summary} `}(t.entry,t.placeId),e.hidden=!1}}var e4=s("2mpFt"),e6=e4.default.Symbol,e5=function(t,e){for(var i=-1,n=null==t?0:t.length,s=Array(n);++is?0:s+e),(i=i>s?s:i)<0&&(i+=s),s=e>i?0:i-e>>>0,e>>>=0;for(var o=Array(s);++n=n?t:im(t,e,i)},ig=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),ib=function(t){return ig.test(t)},iv="\ud800-\udfff",iy="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",iw="\ud83c[\udffb-\udfff]",i_="[^"+iv+"]",iC="(?:\ud83c[\udde6-\uddff]){2}",iE="[\ud800-\udbff][\udc00-\udfff]",ix="(?:"+iy+"|"+iw+")?",iT="[\\ufe0e\\ufe0f]?",ik="(?:\\u200d(?:"+[i_,iC,iE].join("|")+")"+iT+ix+")*",iS=RegExp(iw+"(?="+iw+")|(?:"+[i_+iy+"?",iy,iC,iE,"["+iv+"]"].join("|")+")"+(iT+ix+ik),"g"),iL=function(t){var e,i=ib(t=id(t))?ib(e=t)?e.match(iS)||[]:e.split(""):void 0,n=i?i[0]:t.charAt(0),s=i?ip(i,1).join(""):t.slice(1);return n.toUpperCase()+s},iM=function(t){return iL(id(t).toLowerCase())},iR=function(t,e){return t===e||t!=t&&e!=e},iP=function(t,e){for(var i=t.length;i--;)if(iR(t[i][0],e))return i;return -1},iO=Array.prototype.splice;function iz(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e-1},iz.prototype.set=function(t,e){var i=this.__data__,n=iP(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};var iD=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},iA=function(t){if(!iD(t))return!1;var e=ir(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},e4=s("2mpFt"),iI=e4.default["__core-js_shared__"],iF=(s6=/[^.]+$/.exec(iI&&iI.keys&&iI.keys.IE_PROTO||""))?"Symbol(src)_1."+s6:"",iN=Function.prototype.toString,iH=function(t){if(null!=t){try{return iN.call(t)}catch(t){}try{return t+""}catch(t){}}return""},iB=/^\[object .+?Constructor\]$/,ij=Object.prototype,iV=Function.prototype.toString,iW=ij.hasOwnProperty,iZ=RegExp("^"+iV.call(iW).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),iG=function(t,e){var i,n=null==t?void 0:t[e];return iD(i=n)&&(!iF||!(iF in i))&&(iA(i)?iZ:iB).test(iH(i))?n:void 0},e4=s("2mpFt"),iU=iG(e4.default,"Map"),iq=iG(Object,"create"),iK=Object.prototype.hasOwnProperty,iY=Object.prototype.hasOwnProperty;function i$(t){var e=-1,i=null==t?0:t.length;for(this.clear();++ea))return!1;var h=o.get(t),c=o.get(e);if(h&&c)return h==e&&c==t;var u=-1,d=!0,m=2&i?new i1:void 0;for(o.set(t,e),o.set(e,t);++u-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},ng={};ng["[object Float32Array]"]=ng["[object Float64Array]"]=ng["[object Int8Array]"]=ng["[object Int16Array]"]=ng["[object Int32Array]"]=ng["[object Uint8Array]"]=ng["[object Uint8ClampedArray]"]=ng["[object Uint16Array]"]=ng["[object Uint32Array]"]=!0,ng["[object Arguments]"]=ng["[object Array]"]=ng["[object ArrayBuffer]"]=ng["[object Boolean]"]=ng["[object DataView]"]=ng["[object Date]"]=ng["[object Error]"]=ng["[object Function]"]=ng["[object Map]"]=ng["[object Number]"]=ng["[object Object]"]=ng["[object RegExp]"]=ng["[object Set]"]=ng["[object String]"]=ng["[object WeakMap]"]=!1;var nb=s("lFXqE"),nv=nb.default&&nb.default.isTypedArray,ny=nv?function(t){return nv(t)}:function(t){return ia(t)&&nf(t.length)&&!!ng[ir(t)]},nw=Object.prototype.hasOwnProperty,n_=function(t,e){var i=e9(t),n=!i&&nu(t),s=!i&&!n&&(0,nd.default)(t),o=!i&&!n&&!s&&ny(t),r=i||n||s||o,a=r?nr(t.length,String):[],l=a.length;for(var h in t)(e||nw.call(t,h))&&!(r&&("length"==h||s&&("offset"==h||"parent"==h)||o&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||np(h,l)))&&a.push(h);return a},nC=Object.prototype,nE=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||nC)},nx=(s5=Object.keys,s9=Object,function(t){return s5(s9(t))}),nT=Object.prototype.hasOwnProperty,nk=function(t){if(!nE(t))return nx(t);var e=[];for(var i in Object(t))nT.call(t,i)&&"constructor"!=i&&e.push(i);return e},nS=function(t){return null!=t&&nf(t.length)&&!iA(t)?n_(t):nk(t)},nL=function(t){return ne(t,nS,no)},nM=Object.prototype.hasOwnProperty,nR=function(t,e,i,n,s,o){var r=1&i,a=nL(t),l=a.length;if(l!=nL(e).length&&!r)return!1;for(var h=l;h--;){var c=a[h];if(!(r?c in e:nM.call(e,c)))return!1}var u=o.get(t),d=o.get(e);if(u&&d)return u==e&&d==t;var m=!0;o.set(t,e),o.set(e,t);for(var p=r;++h=0||(s[i]=t[i]);return s}function n8(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(nQ,"__esModule",{value:!0});var se=function(t){function e(){return t.apply(this,arguments)||this}return n3(e,t),e}(n9(Error)),si=function(t){function e(e){return t.call(this,"Invalid DateTime: "+e.toMessage())||this}return n3(e,t),e}(se),sn=function(t){function e(e){return t.call(this,"Invalid Interval: "+e.toMessage())||this}return n3(e,t),e}(se),ss=function(t){function e(e){return t.call(this,"Invalid Duration: "+e.toMessage())||this}return n3(e,t),e}(se),so=function(t){function e(){return t.apply(this,arguments)||this}return n3(e,t),e}(se),sr=function(t){function e(e){return t.call(this,"Invalid unit "+e)||this}return n3(e,t),e}(se),sa=function(t){function e(){return t.apply(this,arguments)||this}return n3(e,t),e}(se),sl=function(t){function e(){return t.call(this,"Zone is an abstract class")||this}return n3(e,t),e}(se),sh="numeric",sc="short",su="long",sd={year:sh,month:sh,day:sh},sm={year:sh,month:sc,day:sh},sp={year:sh,month:sc,day:sh,weekday:sc},sf={year:sh,month:su,day:sh},sg={year:sh,month:su,day:sh,weekday:su},sb={hour:sh,minute:sh},sv={hour:sh,minute:sh,second:sh},sy={hour:sh,minute:sh,second:sh,timeZoneName:sc},sw={hour:sh,minute:sh,second:sh,timeZoneName:su},s_={hour:sh,minute:sh,hourCycle:"h23"},sC={hour:sh,minute:sh,second:sh,hourCycle:"h23"},sE={hour:sh,minute:sh,second:sh,hourCycle:"h23",timeZoneName:sc},sx={hour:sh,minute:sh,second:sh,hourCycle:"h23",timeZoneName:su},sT={year:sh,month:sh,day:sh,hour:sh,minute:sh},sk={year:sh,month:sh,day:sh,hour:sh,minute:sh,second:sh},sS={year:sh,month:sc,day:sh,hour:sh,minute:sh},sL={year:sh,month:sc,day:sh,hour:sh,minute:sh,second:sh},sM={year:sh,month:sc,day:sh,weekday:sc,hour:sh,minute:sh},sR={year:sh,month:su,day:sh,hour:sh,minute:sh,timeZoneName:sc},sP={year:sh,month:su,day:sh,hour:sh,minute:sh,second:sh,timeZoneName:sc},sO={year:sh,month:su,day:sh,weekday:su,hour:sh,minute:sh,timeZoneName:su},sz={year:sh,month:su,day:sh,weekday:su,hour:sh,minute:sh,second:sh,timeZoneName:su},sD=function(){function t(){}var e=t.prototype;return e.offsetName=function(t,e){throw new sl},e.formatOffset=function(t,e){throw new sl},e.offset=function(t){throw new sl},e.equals=function(t){throw new sl},n1(t,[{key:"type",get:function(){throw new sl}},{key:"name",get:function(){throw new sl}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new sl}},{key:"isValid",get:function(){throw new sl}}]),t}(),sA=null,sI=function(t){function e(){return t.apply(this,arguments)||this}n3(e,t);var i=e.prototype;return i.offsetName=function(t,e){return ox(t,e.format,e.locale)},i.formatOffset=function(t,e){return oL(this.offset(t),e)},i.offset=function(t){return-new Date(t).getTimezoneOffset()},i.equals=function(t){return"system"===t.type},n1(e,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===sA&&(sA=new e),sA}}]),e}(sD),sF={},sN={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6},sH={},sB=function(t){function e(i){var n;return(n=t.call(this)||this).zoneName=i,n.valid=e.isValidZone(i),n}n3(e,t),e.create=function(t){return sH[t]||(sH[t]=new e(t)),sH[t]},e.resetCache=function(){sH={},sF={}},e.isValidSpecifier=function(t){return this.isValidZone(t)},e.isValidZone=function(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(t){return!1}};var i=e.prototype;return i.offsetName=function(t,e){return ox(t,e.format,e.locale,this.name)},i.formatOffset=function(t,e){return oL(this.offset(t),e)},i.offset=function(t){var e,i,n,s,o,r=new Date(t);if(isNaN(r))return NaN;var a=(sF[e=this.name]||(sF[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),sF[e]),l=a.formatToParts?function(t,e){for(var i=t.formatToParts(e),n=[],s=0;s=0?v:1e3+v))/6e4},i.equals=function(t){return"iana"===t.type&&t.name===this.name},n1(e,[{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),e}(sD),sj=["base"],sV=["padTo","floor"],sW={},sZ={};function sG(t,e){void 0===e&&(e={});var i=JSON.stringify([t,e]),n=sZ[i];return n||(n=new Intl.DateTimeFormat(t,e),sZ[i]=n),n}var sU={},sq={},sK=null;function sY(t,e,i,n){var s=t.listingMode();return"error"===s?null:"en"===s?i(e):n(e)}var s$=function(){function t(t,e,i){this.padTo=i.padTo||0,this.floor=i.floor||!1,i.padTo,i.floor;var n=n7(i,sV);if(!e||Object.keys(n).length>0){var s,o,r,a=n2({useGrouping:!1},i);i.padTo>0&&(a.minimumIntegerDigits=i.padTo),this.inf=(void 0===(s=a)&&(s={}),(r=sU[o=JSON.stringify([t,s])])||(r=new Intl.NumberFormat(t,s),sU[o]=r),r)}}return t.prototype.format=function(t){if(!this.inf)return om(this.floor?Math.floor(t):ob(t,3),this.padTo);var e=this.floor?Math.floor(t):t;return this.inf.format(e)},t}(),sJ=function(){function t(t,e,i){this.opts=i,this.originalZone=void 0;var n=void 0;if(this.opts.timeZone)this.dt=t;else if("fixed"===t.zone.type){var s=-1*(t.offset/60),o=s>=0?"Etc/GMT+"+s:"Etc/GMT"+s;0!==t.offset&&sB.create(o).valid?(n=o,this.dt=t):(n="UTC",this.dt=0===t.offset?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else"system"===t.zone.type?this.dt=t:"iana"===t.zone.type?(this.dt=t,n=t.zone.name):(n="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);var r=n2({},this.opts);r.timeZone=r.timeZone||n,this.dtf=sG(e,r)}var e=t.prototype;return e.format=function(){return this.originalZone?this.formatToParts().map(function(t){return t.value}).join(""):this.dtf.format(this.dt.toJSDate())},e.formatToParts=function(){var t=this,e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(function(e){if("timeZoneName"!==e.type)return e;var i=t.originalZone.offsetName(t.dt.ts,{locale:t.dt.locale,format:t.opts.timeZoneName});return n2({},e,{value:i})}):e},e.resolvedOptions=function(){return this.dtf.resolvedOptions()},t}(),sX=function(){function t(t,e,i){if(this.opts=n2({style:"long"},i),!e&&oh()){var n,s,o,r;this.rtf=(void 0===(n=i)&&(n={}),(s=n).base,(r=sq[o=JSON.stringify([t,n7(s,sj)])])||(r=new Intl.RelativeTimeFormat(t,n),sq[o]=r),r)}}var e=t.prototype;return e.format=function(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i,n){void 0===i&&(i="always"),void 0===n&&(n=!1);var s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===i&&o){var r="days"===t;switch(e){case 1:return r?"tomorrow":"next "+s[t][0];case -1:return r?"yesterday":"last "+s[t][0];case 0:return r?"today":"this "+s[t][0]}}var a=Object.is(e,-0)||e<0,l=Math.abs(e),h=1===l,c=s[t],u=n?h?c[1]:c[2]||c[1]:h?s[t][0]:t;return a?l+" "+u+" ago":"in "+l+" "+u}(e,t,this.opts.numeric,"long"!==this.opts.style)},e.formatToParts=function(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]},t}(),sQ=function(){function t(t,e,i,n){var s,o,r,a=function(t){var e=t.indexOf("-x-");-1!==e&&(t=t.substring(0,e));var i=t.indexOf("-u-");if(-1===i)return[t];try{n=sG(t).resolvedOptions(),s=t}catch(e){var n,s,o=t.substring(0,i);n=sG(o).resolvedOptions(),s=o}var r=n;return[s,r.numberingSystem,r.calendar]}(t),l=a[0],h=a[1],c=a[2];this.locale=l,this.numberingSystem=e||h||null,this.outputCalendar=i||c||null,this.intl=(s=this.locale,o=this.numberingSystem,((r=this.outputCalendar)||o)&&(s.includes("-u-")||(s+="-u"),r&&(s+="-ca-"+r),o&&(s+="-nu-"+o)),s),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}t.fromOpts=function(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)},t.create=function(e,i,n,s){void 0===s&&(s=!1);var o=e||oo.defaultLocale;return new t(o||(s?"en-US":sK||(sK=new Intl.DateTimeFormat().resolvedOptions().locale)),i||oo.defaultNumberingSystem,n||oo.defaultOutputCalendar,o)},t.resetCache=function(){sK=null,sZ={},sU={},sq={}},t.fromObject=function(e){var i=void 0===e?{}:e,n=i.locale,s=i.numberingSystem,o=i.outputCalendar;return t.create(n,s,o)};var e=t.prototype;return e.listingMode=function(){var t=this.isEnglish(),e=(null===this.numberingSystem||"latn"===this.numberingSystem)&&(null===this.outputCalendar||"gregory"===this.outputCalendar);return t&&e?"en":"intl"},e.clone=function(e){return e&&0!==Object.getOwnPropertyNames(e).length?t.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this},e.redefaultToEN=function(t){return void 0===t&&(t={}),this.clone(n2({},t,{defaultToEN:!0}))},e.redefaultToSystem=function(t){return void 0===t&&(t={}),this.clone(n2({},t,{defaultToEN:!1}))},e.months=function(t,e){var i=this;return void 0===e&&(e=!1),sY(this,t,oz,function(){var n=e?{month:t,day:"numeric"}:{month:t},s=e?"format":"standalone";return i.monthsCache[s][t]||(i.monthsCache[s][t]=function(t){for(var e=[],i=1;i<=12;i++){var n=aC.utc(2009,i,1);e.push(t(n))}return e}(function(t){return i.extract(t,n,"month")})),i.monthsCache[s][t]})},e.weekdays=function(t,e){var i=this;return void 0===e&&(e=!1),sY(this,t,oF,function(){var n=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},s=e?"format":"standalone";return i.weekdaysCache[s][t]||(i.weekdaysCache[s][t]=function(t){for(var e=[],i=1;i<=7;i++){var n=aC.utc(2016,11,13+i);e.push(t(n))}return e}(function(t){return i.extract(t,n,"weekday")})),i.weekdaysCache[s][t]})},e.meridiems=function(){var t=this;return sY(this,void 0,function(){return oN},function(){if(!t.meridiemCache){var e={hour:"numeric",hourCycle:"h12"};t.meridiemCache=[aC.utc(2016,11,13,9),aC.utc(2016,11,13,19)].map(function(i){return t.extract(i,e,"dayperiod")})}return t.meridiemCache})},e.eras=function(t){var e=this;return sY(this,t,oV,function(){var i={era:t};return e.eraCache[t]||(e.eraCache[t]=[aC.utc(-40,1,1),aC.utc(2017,1,1)].map(function(t){return e.extract(t,i,"era")})),e.eraCache[t]})},e.extract=function(t,e,i){var n=this.dtFormatter(t,e).formatToParts().find(function(t){return t.type.toLowerCase()===i});return n?n.value:null},e.numberFormatter=function(t){return void 0===t&&(t={}),new s$(this.intl,t.forceSimple||this.fastNumbers,t)},e.dtFormatter=function(t,e){return void 0===e&&(e={}),new sJ(t,this.intl,e)},e.relFormatter=function(t){return void 0===t&&(t={}),new sX(this.intl,this.isEnglish(),t)},e.listFormatter=function(t){var e,i,n,s;return void 0===t&&(t={}),e=this.intl,void 0===(i=t)&&(i={}),(s=sW[n=JSON.stringify([e,i])])||(s=new Intl.ListFormat(e,i),sW[n]=s),s},e.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},e.equals=function(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar},n1(t,[{key:"fastNumbers",get:function(){return null==this.fastNumbersCached&&(this.fastNumbersCached=(!this.numberingSystem||"latn"===this.numberingSystem)&&("latn"===this.numberingSystem||!this.locale||this.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(this.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),t}(),s0=null,s1=function(t){function e(e){var i;return(i=t.call(this)||this).fixed=e,i}n3(e,t),e.instance=function(t){return 0===t?e.utcInstance:new e(t)},e.parseSpecifier=function(t){if(t){var i=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new e(oT(i[1],i[2]))}return null};var i=e.prototype;return i.offsetName=function(){return this.name},i.formatOffset=function(t,e){return oL(this.fixed,e)},i.offset=function(){return this.fixed},i.equals=function(t){return"fixed"===t.type&&t.fixed===this.fixed},n1(e,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+oL(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+oL(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===s0&&(s0=new e(0)),s0}}]),e}(sD),s2=function(t){function e(e){var i;return(i=t.call(this)||this).zoneName=e,i}n3(e,t);var i=e.prototype;return i.offsetName=function(){return null},i.formatOffset=function(){return""},i.offset=function(){return NaN},i.equals=function(){return!1},n1(e,[{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),e}(sD);function s3(t,e){if(or(t)||null===t)return e;if(t instanceof sD)return t;if("string"==typeof t){var i=t.toLowerCase();return"default"===i?e:"local"===i||"system"===i?sI.instance:"utc"===i||"gmt"===i?s1.utcInstance:s1.parseSpecifier(i)||sB.create(t)}return oa(t)?s1.instance(t):"object"==typeof t&&"offset"in t&&"function"==typeof t.offset?t:new s2(t)}var s4,s6,s5,s9,s7,s8=function(){return Date.now()},ot="system",oe=null,oi=null,on=null,os=60,oo=function(){function t(){}return t.resetCaches=function(){sQ.resetCache(),sB.resetCache()},n1(t,null,[{key:"now",get:function(){return s8},set:function(t){s8=t}},{key:"defaultZone",get:function(){return s3(ot,sI.instance)},set:function(t){ot=t}},{key:"defaultLocale",get:function(){return oe},set:function(t){oe=t}},{key:"defaultNumberingSystem",get:function(){return oi},set:function(t){oi=t}},{key:"defaultOutputCalendar",get:function(){return on},set:function(t){on=t}},{key:"twoDigitCutoffYear",get:function(){return os},set:function(t){os=t%100}},{key:"throwOnInvalid",get:function(){return s7},set:function(t){s7=t}}]),t}();function or(t){return void 0===t}function oa(t){return"number"==typeof t}function ol(t){return"number"==typeof t&&t%1==0}function oh(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function oc(t,e,i){if(0!==t.length)return t.reduce(function(t,n){var s=[e(n),n];return t&&i(t[0],s[0])===t[0]?t:s},null)[1]}function ou(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function od(t,e,i){return ol(t)&&t>=e&&t<=i}function om(t,e){return void 0===e&&(e=2),t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0")}function op(t){if(!or(t)&&null!==t&&""!==t)return parseInt(t,10)}function of(t){if(!or(t)&&null!==t&&""!==t)return parseFloat(t)}function og(t){if(!or(t)&&null!==t&&""!==t)return Math.floor(1e3*parseFloat("0."+t))}function ob(t,e,i){void 0===i&&(i=!1);var n=Math.pow(10,e);return(i?Math.trunc:Math.round)(t*n)/n}function ov(t){return t%4==0&&(t%100!=0||t%400==0)}function oy(t){return ov(t)?366:365}function ow(t,e){var i,n=(i=e-1)-12*Math.floor(i/12)+1;return 2===n?ov(t+(e-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function o_(t){var e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e)).setUTCFullYear(t.year,t.month-1,t.day),+e}function oC(t){var e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,n=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return 4===e||3===n?53:52}function oE(t){return t>99?t:t>oo.twoDigitCutoffYear?1900+t:2e3+t}function ox(t,e,i,n){void 0===n&&(n=null);var s=new Date(t),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(o.timeZone=n);var r=n2({timeZoneName:e},o),a=new Intl.DateTimeFormat(i,r).formatToParts(s).find(function(t){return"timezonename"===t.type.toLowerCase()});return a?a.value:null}function oT(t,e){var i=parseInt(t,10);Number.isNaN(i)&&(i=0);var n=parseInt(e,10)||0,s=i<0||Object.is(i,-0)?-n:n;return 60*i+s}function ok(t){var e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new sa("Invalid unit value "+t);return e}function oS(t,e){var i={};for(var n in t)if(ou(t,n)){var s=t[n];if(null==s)continue;i[e(n)]=ok(s)}return i}function oL(t,e){var i=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),s=t>=0?"+":"-";switch(e){case"short":return""+s+om(i,2)+":"+om(n,2);case"narrow":return""+s+i+(n>0?":"+n:"");case"techie":return""+s+om(i,2)+om(n,2);default:throw RangeError("Value format "+e+" is out of range for property format")}}function oM(t){return["hour","minute","second","millisecond"].reduce(function(e,i){return e[i]=t[i],e},{})}var oR=["January","February","March","April","May","June","July","August","September","October","November","December"],oP=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],oO=["J","F","M","A","M","J","J","A","S","O","N","D"];function oz(t){switch(t){case"narrow":return[].concat(oO);case"short":return[].concat(oP);case"long":return[].concat(oR);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var oD=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],oA=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],oI=["M","T","W","T","F","S","S"];function oF(t){switch(t){case"narrow":return[].concat(oI);case"short":return[].concat(oA);case"long":return[].concat(oD);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var oN=["AM","PM"],oH=["Before Christ","Anno Domini"],oB=["BC","AD"],oj=["B","A"];function oV(t){switch(t){case"narrow":return[].concat(oj);case"short":return[].concat(oB);case"long":return[].concat(oH);default:return null}}function oW(t,e){for(var i,n="",s=st(t);!(i=s()).done;){var o=i.value;o.literal?n+=o.val:n+=e(o.val)}return n}var oZ={D:sd,DD:sm,DDD:sf,DDDD:sg,t:sb,tt:sv,ttt:sy,tttt:sw,T:s_,TT:sC,TTT:sE,TTTT:sx,f:sT,ff:sS,fff:sR,ffff:sO,F:sk,FF:sL,FFF:sP,FFFF:sz},oG=function(){function t(t,e){this.opts=e,this.loc=t,this.systemLoc=null}t.create=function(e,i){return void 0===i&&(i={}),new t(e,i)},t.parseFormat=function(t){for(var e=null,i="",n=!1,s=[],o=0;o0&&s.push({literal:n||/^\s+$/.test(i),val:i}),e=null,i="",n=!n):n?i+=r:r===e?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,e=r)}return i.length>0&&s.push({literal:n||/^\s+$/.test(i),val:i}),s},t.macroTokenToFormatOpts=function(t){return oZ[t]};var e=t.prototype;return e.formatWithSystemDefault=function(t,e){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,n2({},this.opts,e)).format()},e.dtFormatter=function(t,e){return void 0===e&&(e={}),this.loc.dtFormatter(t,n2({},this.opts,e))},e.formatDateTime=function(t,e){return this.dtFormatter(t,e).format()},e.formatDateTimeParts=function(t,e){return this.dtFormatter(t,e).formatToParts()},e.formatInterval=function(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())},e.resolvedOptions=function(t,e){return this.dtFormatter(t,e).resolvedOptions()},e.num=function(t,e){if(void 0===e&&(e=0),this.opts.forceSimple)return om(t,e);var i=n2({},this.opts);return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)},e.formatDateTimeFromString=function(e,i){var n=this,s="en"===this.loc.listingMode(),o=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,r=function(t,i){return n.loc.extract(e,t,i)},a=function(t){return e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):""},l=function(t,i){return s?oz(t)[e.month-1]:r(i?{month:t}:{month:t,day:"numeric"},"month")},h=function(t,i){return s?oF(t)[e.weekday-1]:r(i?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday")},c=function(i){var s=t.macroTokenToFormatOpts(i);return s?n.formatWithSystemDefault(e,s):i},u=function(t){return s?oV(t)[e.year<0?0:1]:r({era:t},"era")};return oW(t.parseFormat(i),function(t){switch(t){case"S":return n.num(e.millisecond);case"u":case"SSS":return n.num(e.millisecond,3);case"s":return n.num(e.second);case"ss":return n.num(e.second,2);case"uu":return n.num(Math.floor(e.millisecond/10),2);case"uuu":return n.num(Math.floor(e.millisecond/100));case"m":return n.num(e.minute);case"mm":return n.num(e.minute,2);case"h":return n.num(e.hour%12==0?12:e.hour%12);case"hh":return n.num(e.hour%12==0?12:e.hour%12,2);case"H":return n.num(e.hour);case"HH":return n.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:n.opts.allowZ});case"ZZ":return a({format:"short",allowZ:n.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:n.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:n.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:n.loc.locale});case"z":return e.zoneName;case"a":return s?oN[e.hour<12?0:1]:r({hour:"numeric",hourCycle:"h12"},"dayperiod");case"d":return o?r({day:"numeric"},"day"):n.num(e.day);case"dd":return o?r({day:"2-digit"},"day"):n.num(e.day,2);case"c":case"E":return n.num(e.weekday);case"ccc":return h("short",!0);case"cccc":return h("long",!0);case"ccccc":return h("narrow",!0);case"EEE":return h("short",!1);case"EEEE":return h("long",!1);case"EEEEE":return h("narrow",!1);case"L":return o?r({month:"numeric",day:"numeric"},"month"):n.num(e.month);case"LL":return o?r({month:"2-digit",day:"numeric"},"month"):n.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return o?r({month:"numeric"},"month"):n.num(e.month);case"MM":return o?r({month:"2-digit"},"month"):n.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return o?r({year:"numeric"},"year"):n.num(e.year);case"yy":return o?r({year:"2-digit"},"year"):n.num(e.year.toString().slice(-2),2);case"yyyy":return o?r({year:"numeric"},"year"):n.num(e.year,4);case"yyyyyy":return o?r({year:"numeric"},"year"):n.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return n.num(e.weekYear.toString().slice(-2),2);case"kkkk":return n.num(e.weekYear,4);case"W":return n.num(e.weekNumber);case"WW":return n.num(e.weekNumber,2);case"o":return n.num(e.ordinal);case"ooo":return n.num(e.ordinal,3);case"q":return n.num(e.quarter);case"qq":return n.num(e.quarter,2);case"X":return n.num(Math.floor(e.ts/1e3));case"x":return n.num(e.ts);default:return c(t)}})},e.formatDurationFromString=function(e,i){var n,s=this,o=function(t){switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=t.parseFormat(i),a=r.reduce(function(t,e){var i=e.literal,n=e.val;return i?t:t.concat(n)},[]);return oW(r,(n=e.shiftTo.apply(e,a.map(o).filter(function(t){return t})),function(t){var e=o(t);return e?s.num(n.get(e),t.length):t}))},t}(),oU=function(){function t(t,e){this.reason=t,this.explanation=e}return t.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},t}(),oq=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function oK(){for(var t=arguments.length,e=Array(t),i=0;i1?e-1:0),n=1;n3?oD.indexOf(t)+1:oA.indexOf(t)+1),a}var ro=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function rr(t){var e=t[1],i=t[2],n=t[3],s=t[4],o=t[5],r=t[6],a=t[7],l=t[8],h=t[9],c=t[10],u=t[11];return[rs(e,s,n,i,o,r,a),new s1(l?rn[l]:h?0:oT(c,u))]}var ra=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rl=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,rh=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function rc(t){var e=t[1],i=t[2],n=t[3];return[rs(e,t[4],n,i,t[5],t[6],t[7]),s1.utcInstance]}function ru(t){var e=t[1],i=t[2],n=t[3],s=t[4],o=t[5],r=t[6];return[rs(e,t[7],i,n,s,o,r),s1.utcInstance]}var rd=oK(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,o1),rm=oK(/(\d{4})-?W(\d\d)(?:-?(\d))?/,o1),rp=oK(/(\d{4})-?(\d{3})/,o1),rf=oK(o0),rg=oY(function(t,e){return[{year:o5(t,e),month:o5(t,e+1,1),day:o5(t,e+2,1)},null,e+3]},o9,o7,o8),rb=oY(o2,o9,o7,o8),rv=oY(o3,o9,o7,o8),ry=oY(o9,o7,o8),rw=oY(o9),r_=oK(/(\d{4})-(\d\d)-(\d\d)/,o6),rC=oK(o4),rE=oY(o9,o7,o8),rx={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},rT=n2({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},rx),rk=n2({years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:31556952,milliseconds:31556952e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:7889238,milliseconds:7889238e3},months:{weeks:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},rx),rS=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],rL=rS.slice(0).reverse();function rM(t,e,i){return void 0===i&&(i=!1),new rO({values:i?e.values:n2({},t.values,e.values||{}),loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix})}function rR(t){return Math.trunc(1e3*t)/1e3}function rP(t,e,i,n,s){var o=t[s][i],r=Math.floor(e[i]/o);n[s]=rR(n[s]+r),e[i]=rR(e[i]-r*o)}var rO=function(){function t(t){var e="longterm"===t.conversionAccuracy,i=e?rk:rT;t.matrix&&(i=t.matrix),this.values=t.values,this.loc=t.loc||sQ.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=i,this.isLuxonDuration=!0}t.fromMillis=function(e,i){return t.fromObject({milliseconds:e},i)},t.fromObject=function(e,i){if(void 0===i&&(i={}),null==e||"object"!=typeof e)throw new sa("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new t({values:oS(e,t.normalizeUnit),loc:sQ.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})},t.fromDurationLike=function(e){if(oa(e))return t.fromMillis(e);if(t.isDuration(e))return e;if("object"==typeof e)return t.fromObject(e);throw new sa("Unknown duration argument "+e+" of type "+typeof e)},t.fromISO=function(e,i){var n=o$(e,[re,ri])[0];return n?t.fromObject(n,i):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.fromISOTime=function(e,i){var n=o$(e,[rt,rw])[0];return n?t.fromObject(n,i):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.invalid=function(e,i){if(void 0===i&&(i=null),!e)throw new sa("need to specify a reason the Duration is invalid");var n=e instanceof oU?e:new oU(e,i);if(!oo.throwOnInvalid)return new t({invalid:n});throw new ss(n)},t.normalizeUnit=function(t){var e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t?t.toLowerCase():t];if(!e)throw new sr(t);return e},t.isDuration=function(t){return t&&t.isLuxonDuration||!1};var e=t.prototype;return e.toFormat=function(t,e){void 0===e&&(e={});var i=n2({},e,{floor:!1!==e.round&&!1!==e.floor});return this.isValid?oG.create(this.loc,i).formatDurationFromString(this,t):"Invalid Duration"},e.toHuman=function(t){var e=this;void 0===t&&(t={});var i=rS.map(function(i){var n=e.values[i];return or(n)?null:e.loc.numberFormatter(n2({style:"unit",unitDisplay:"long"},t,{unit:i.slice(0,-1)})).format(n)}).filter(function(t){return t});return this.loc.listFormatter(n2({type:"conjunction",style:t.listStyle||"narrow"},t)).format(i)},e.toObject=function(){return this.isValid?n2({},this.values):{}},e.toISO=function(){if(!this.isValid)return null;var t="P";return 0!==this.years&&(t+=this.years+"Y"),(0!==this.months||0!==this.quarters)&&(t+=this.months+3*this.quarters+"M"),0!==this.weeks&&(t+=this.weeks+"W"),0!==this.days&&(t+=this.days+"D"),(0!==this.hours||0!==this.minutes||0!==this.seconds||0!==this.milliseconds)&&(t+="T"),0!==this.hours&&(t+=this.hours+"H"),0!==this.minutes&&(t+=this.minutes+"M"),(0!==this.seconds||0!==this.milliseconds)&&(t+=ob(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t},e.toISOTime=function(t){if(void 0===t&&(t={}),!this.isValid)return null;var e=this.toMillis();return e<0||e>=864e5?null:(t=n2({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},t,{includeOffset:!1}),aC.fromMillis(e,{zone:"UTC"}).toISOTime(t))},e.toJSON=function(){return this.toISO()},e.toString=function(){return this.toISO()},e.toMillis=function(){for(var t,e,i=null!=(t=this.values.milliseconds)?t:0,n=st(rL.slice(1));!(e=n()).done;){var s,o=e.value;null!=(s=this.values)&&s[o]&&(i+=this.values[o]*this.matrix[o].milliseconds)}return i},e.valueOf=function(){return this.toMillis()},e.plus=function(e){if(!this.isValid)return this;for(var i=t.fromDurationLike(e),n={},s=0;s=0?(t=this.matrix,rL.reduce(function(i,n){return or(e[n])?i:(i&&rP(t,e,i,e,n),n)},null),rM(this,{values:e},!0)):this.negate().normalize().negate()},e.rescale=function(){return this.isValid?rM(this,{values:function(t){for(var e={},i=0,n=Object.entries(t);i=0){e=h;var c=0;for(var u in r)c+=this.matrix[u][h]*r[u],r[u]=0;oa(a[h])&&(c+=a[h]);var d=Math.trunc(c);for(var m in o[h]=d,r[h]=(1e3*c-1e3*d)/1e3,a)rS.indexOf(m)>rS.indexOf(h)&&rP(this.matrix,a,m,o,h)}else oa(a[h])&&(r[h]=a[h])}for(var p in r)0!==r[p]&&(o[e]+=p===e?r[p]:r[p]/this.matrix[e][p]);return rM(this,{values:o},!0).normalize()},e.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},e.negate=function(){if(!this.isValid)return this;for(var t={},e=0,i=Object.keys(this.values);et},e.isBefore=function(t){return!!this.isValid&&this.e<=t},e.contains=function(t){return!!this.isValid&&this.s<=t&&this.e>t},e.set=function(e){var i=void 0===e?{}:e,n=i.start,s=i.end;return this.isValid?t.fromDateTimes(n||this.s,s||this.e):this},e.splitAt=function(){var e=this;if(!this.isValid)return[];for(var i=arguments.length,n=Array(i),s=0;s+this.e?this.e:h;r.push(t.fromDateTimes(a,c)),a=c,l+=1}return r},e.splitBy=function(e){var i=rO.fromDurationLike(e);if(!this.isValid||!i.isValid||0===i.as("milliseconds"))return[];for(var n,s=this.s,o=1,r=[];s+this.e?this.e:a,r.push(t.fromDateTimes(s,n)),s=n,o+=1}return r},e.divideEqually=function(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]},e.overlaps=function(t){return this.e>t.s&&this.s=t.e},e.equals=function(t){return!!this.isValid&&!!t.isValid&&this.s.equals(t.s)&&this.e.equals(t.e)},e.intersection=function(e){if(!this.isValid)return this;var i=this.s>e.s?this.s:e.s,n=this.e=n?null:t.fromDateTimes(i,n)},e.union=function(e){if(!this.isValid)return this;var i=this.se.e?this.e:e.e;return t.fromDateTimes(i,n)},t.merge=function(t){var e=t.sort(function(t,e){return t.s-e.s}).reduce(function(t,e){var i=t[0],n=t[1];return n?n.overlaps(e)||n.abutsStart(e)?[i,n.union(e)]:[i.concat([n]),e]:[i,e]},[[],null]),i=e[0],n=e[1];return n&&i.push(n),i},t.xor=function(e){for(var i,n,s=null,o=0,r=[],a=e.map(function(t){return[{time:t.s,type:"s"},{time:t.e,type:"e"}]}),l=(i=Array.prototype).concat.apply(i,a).sort(function(t,e){return t.time-e.time}),h=st(l);!(n=h()).done;){var c=n.value;1===(o+="s"===c.type?1:-1)?s=c.time:(s&&+s!=+c.time&&r.push(t.fromDateTimes(s,c.time)),s=null)}return t.merge(r)},e.difference=function(){for(var e=this,i=arguments.length,n=Array(i),s=0;s=r&&n<=a&&(e+=n-r)}}return parseInt(e,10)}(i))}}}var rV="[ "+String.fromCharCode(160)+"]",rW=RegExp(rV,"g");function rZ(t){return t.replace(/\./g,"\\.?").replace(rW,rV)}function rG(t){return t.replace(/\./g,"").replace(rW," ").toLowerCase()}function rU(t,e){return null===t?null:{regex:RegExp(t.map(rZ).join("|")),deser:function(i){var n=i[0];return t.findIndex(function(t){return rG(n)===rG(t)})+e}}}function rq(t,e){return{regex:t,deser:function(t){return oT(t[1],t[2])},groups:e}}function rK(t){return{regex:t,deser:function(t){return t[0]}}}var rY={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}},r$=null;function rJ(t,e){var i;return(i=Array.prototype).concat.apply(i,t.map(function(t){return function(t,e){if(t.literal)return t;var i=rQ(oG.macroTokenToFormatOpts(t.val),e);return null==i||i.includes(void 0)?t:i}(t,e)}))}function rX(t,e,i){var n,s,o,r=rJ(oG.parseFormat(i),t),a=r.map(function(e){var i,n,s,o,r,a,l,h,c,u,d,m,p;return i=rB(t),n=rB(t,"{2}"),s=rB(t,"{3}"),o=rB(t,"{4}"),r=rB(t,"{6}"),a=rB(t,"{1,2}"),l=rB(t,"{1,3}"),h=rB(t,"{1,6}"),c=rB(t,"{1,9}"),u=rB(t,"{2,4}"),d=rB(t,"{4,6}"),m=function(t){return{regex:RegExp(t.val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")),deser:function(t){return t[0]},literal:!0}},(p=function(p){if(e.literal)return m(p);switch(p.val){case"G":return rU(t.eras("short"),0);case"GG":return rU(t.eras("long"),0);case"y":return rj(h);case"yy":case"kk":return rj(u,oE);case"yyyy":case"kkkk":return rj(o);case"yyyyy":return rj(d);case"yyyyyy":return rj(r);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return rj(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return rj(n);case"MMM":return rU(t.months("short",!0),1);case"MMMM":return rU(t.months("long",!0),1);case"LLL":return rU(t.months("short",!1),1);case"LLLL":return rU(t.months("long",!1),1);case"o":case"S":return rj(l);case"ooo":case"SSS":return rj(s);case"u":return rK(c);case"uu":return rK(a);case"uuu":case"E":case"c":return rj(i);case"a":return rU(t.meridiems(),0);case"EEE":return rU(t.weekdays("short",!1),1);case"EEEE":return rU(t.weekdays("long",!1),1);case"ccc":return rU(t.weekdays("short",!0),1);case"cccc":return rU(t.weekdays("long",!0),1);case"Z":case"ZZ":return rq(RegExp("([+-]"+a.source+")(?::("+n.source+"))?"),2);case"ZZZ":return rq(RegExp("([+-]"+a.source+")("+n.source+")?"),2);case"z":return rK(/[a-z_+-/]{1,256}?/i);case" ":return rK(/[^\S\n\r]/);default:return m(p)}}(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"}).token=e,p}),l=a.find(function(t){return t.invalidReason});if(l)return{input:e,tokens:r,invalidReason:l.invalidReason};var h=["^"+a.map(function(t){return t.regex}).reduce(function(t,e){return t+"("+e.source+")"},"")+"$",a],c=h[0],u=h[1],d=RegExp(c,"i"),m=function(t,e,i){var n=t.match(e);if(!n)return[n,{}];var s={},o=1;for(var r in i)if(ou(i,r)){var a=i[r],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(s[a.token.val[0]]=a.deser(n.slice(o,o+l))),o+=l}return[n,s]}(e,d,u),p=m[0],f=m[1],g=f?(s=function(t){switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},o=null,or(f.z)||(o=sB.create(f.z)),or(f.Z)||(o||(o=new s1(f.Z)),n=f.Z),or(f.q)||(f.M=(f.q-1)*3+1),or(f.h)||(f.h<12&&1===f.a?f.h+=12:12!==f.h||0!==f.a||(f.h=0)),0===f.G&&f.y&&(f.y=-f.y),or(f.u)||(f.S=og(f.u)),[Object.keys(f).reduce(function(t,e){var i=s(e);return i&&(t[i]=f[e]),t},{}),o,n]):[null,null,void 0],b=g[0],v=g[1],y=g[2];if(ou(f,"a")&&ou(f,"H"))throw new so("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:d,rawMatches:p,matches:f,result:b,zone:v,specificOffset:y}}function rQ(t,e){if(!t)return null;var i=oG.create(e,t).dtFormatter((r$||(r$=aC.fromMillis(1555555555555)),r$)),n=i.formatToParts(),s=i.resolvedOptions();return n.map(function(e){return function(t,e,i){var n=t.type,s=t.value;if("literal"===n){var o=/^\s+$/.test(s);return{literal:!o,val:o?" ":s}}var r=e[n],a=n;"hour"===n&&(a=null!=e.hour12?e.hour12?"hour12":"hour24":null!=e.hourCycle?"h11"===e.hourCycle||"h12"===e.hourCycle?"hour12":"hour24":i.hour12?"hour12":"hour24");var l=rY[a];if("object"==typeof l&&(l=l[r]),l)return{literal:!1,val:l}}(e,t,s)})}var r0=[0,31,59,90,120,151,181,212,243,273,304,334],r1=[0,31,60,91,121,152,182,213,244,274,305,335];function r2(t,e){return new oU("unit out of range","you specified "+e+" (of type "+typeof e+") as a "+t+", which is invalid")}function r3(t,e,i){var n=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);var s=n.getUTCDay();return 0===s?7:s}function r4(t,e){var i=ov(t)?r1:r0,n=i.findIndex(function(t){return toC(i)?(e=i+1,a=1):e=i,n2({weekYear:e,weekNumber:a,weekday:r},oM(t))}function r5(t){var e,i=t.weekYear,n=t.weekNumber,s=t.weekday,o=r3(i,1,4),r=oy(i),a=7*n+s-o-3;a<1?a+=oy(e=i-1):a>r?(e=i+1,a-=oy(i)):e=i;var l=r4(e,a),h=l.month,c=l.day;return n2({year:e,month:h,day:c},oM(t))}function r9(t){var e=t.year,i=t.month,n=t.day+(ov(e)?r1:r0)[i-1];return n2({year:e,ordinal:n},oM(t))}function r7(t){var e=t.year,i=r4(e,t.ordinal),n=i.month,s=i.day;return n2({year:e,month:n,day:s},oM(t))}function r8(t){var e=ol(t.year),i=od(t.month,1,12),n=od(t.day,1,ow(t.year,t.month));return e?i?!n&&r2("day",t.day):r2("month",t.month):r2("year",t.year)}function at(t){var e=t.hour,i=t.minute,n=t.second,s=t.millisecond,o=od(e,0,23)||24===e&&0===i&&0===n&&0===s,r=od(i,0,59),a=od(n,0,59),l=od(s,0,999);return o?r?a?!l&&r2("millisecond",s):r2("second",n):r2("minute",i):r2("hour",e)}var ae="Invalid DateTime";function ai(t){return new oU("unsupported zone",'the zone "'+t.name+'" is not supported')}function an(t){return null===t.weekData&&(t.weekData=r6(t.c)),t.weekData}function as(t,e){var i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new aC(n2({},i,e,{old:i}))}function ao(t,e,i){var n=t-6e4*e,s=i.offset(n);if(e===s)return[n,e];n-=(s-e)*6e4;var o=i.offset(n);return s===o?[n,s]:[t-6e4*Math.min(s,o),Math.max(s,o)]}function ar(t,e){var i=new Date(t+=6e4*e);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function aa(t,e){var i=t.o,n=t.c.year+Math.trunc(e.years),s=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),o=n2({},t.c,{year:n,month:s,day:Math.min(t.c.day,ow(n,s))+Math.trunc(e.days)+7*Math.trunc(e.weeks)}),r=rO.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=ao(o_(o),i,t.zone),l=a[0],h=a[1];return 0!==r&&(l+=r,h=t.zone.offset(l)),{ts:l,o:h}}function al(t,e,i,n,s,o){var r=i.setZone,a=i.zone;if((!t||0===Object.keys(t).length)&&!e)return aC.invalid(new oU("unparsable",'the input "'+s+"\" can't be parsed as "+n));var l=aC.fromObject(t,n2({},i,{zone:e||a,specificOffset:o}));return r?l:l.setZone(a)}function ah(t,e,i){return void 0===i&&(i=!0),t.isValid?oG.create(sQ.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function ac(t,e){var i=t.c.year>9999||t.c.year<0,n="";return i&&t.c.year>=0&&(n+="+"),n+=om(t.c.year,i?6:4),e?n+="-"+om(t.c.month)+"-"+om(t.c.day):n+=om(t.c.month)+om(t.c.day),n}function au(t,e,i,n,s,o){var r=om(t.c.hour);return e?(r+=":"+om(t.c.minute),0===t.c.millisecond&&0===t.c.second&&i||(r+=":")):r+=om(t.c.minute),0===t.c.millisecond&&0===t.c.second&&i||(r+=om(t.c.second),0===t.c.millisecond&&n||(r+="."+om(t.c.millisecond,3))),s&&(t.isOffsetFixed&&0===t.offset&&!o?r+="Z":t.o<0?r+="-"+om(Math.trunc(-t.o/60))+":"+om(Math.trunc(-t.o%60)):r+="+"+om(Math.trunc(t.o/60))+":"+om(Math.trunc(t.o%60))),o&&(r+="["+t.zone.ianaName+"]"),r}var ad={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},am={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ap={ordinal:1,hour:0,minute:0,second:0,millisecond:0},af=["year","month","day","hour","minute","second","millisecond"],ag=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ab=["year","ordinal","hour","minute","second","millisecond"];function av(t){var e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new sr(t);return e}function ay(t,e){var i,n,s=s3(e.zone,oo.defaultZone),o=sQ.fromObject(e),r=oo.now();if(or(t.year))i=r;else{for(var a=0;a=1)return s(h,l)}return s(t>e?-0:0,i.units[i.units.length-1])}function a_(t){var e,i={};return t.length>0&&"object"==typeof t[t.length-1]?(i=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[i,e]}var aC=function(){function t(t){var e=t.zone||oo.defaultZone,i=t.invalid||(Number.isNaN(t.ts)?new oU("invalid input"):null)||(e.isValid?null:ai(e));this.ts=or(t.ts)?oo.now():t.ts;var n=null,s=null;if(!i){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e)){var o=[t.old.c,t.old.o];n=o[0],s=o[1]}else{var r=e.offset(this.ts);n=(i=Number.isNaN((n=ar(this.ts,r)).year)?new oU("invalid input"):null)?null:n,s=i?null:r}}this._zone=e,this.loc=t.loc||sQ.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=s,this.isLuxonDateTime=!0}t.now=function(){return new t({})},t.local=function(){var t=a_(arguments),e=t[0],i=t[1];return ay({year:i[0],month:i[1],day:i[2],hour:i[3],minute:i[4],second:i[5],millisecond:i[6]},e)},t.utc=function(){var t=a_(arguments),e=t[0],i=t[1],n=i[0],s=i[1],o=i[2],r=i[3],a=i[4],l=i[5],h=i[6];return e.zone=s1.utcInstance,ay({year:n,month:s,day:o,hour:r,minute:a,second:l,millisecond:h},e)},t.fromJSDate=function(e,i){void 0===i&&(i={});var n="[object Date]"===Object.prototype.toString.call(e)?e.valueOf():NaN;if(Number.isNaN(n))return t.invalid("invalid input");var s=s3(i.zone,oo.defaultZone);return s.isValid?new t({ts:n,zone:s,loc:sQ.fromObject(i)}):t.invalid(ai(s))},t.fromMillis=function(e,i){if(void 0===i&&(i={}),oa(e))return e<-864e13||e>864e13?t.invalid("Timestamp out of range"):new t({ts:e,zone:s3(i.zone,oo.defaultZone),loc:sQ.fromObject(i)});throw new sa("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},t.fromSeconds=function(e,i){if(void 0===i&&(i={}),oa(e))return new t({ts:1e3*e,zone:s3(i.zone,oo.defaultZone),loc:sQ.fromObject(i)});throw new sa("fromSeconds requires a numerical input")},t.fromObject=function(e,i){void 0===i&&(i={}),e=e||{};var n,s,o,r,a,l=s3(i.zone,oo.defaultZone);if(!l.isValid)return t.invalid(ai(l));var h=oo.now(),c=or(i.specificOffset)?l.offset(h):i.specificOffset,u=oS(e,av),d=!or(u.ordinal),m=!or(u.year),p=!or(u.month)||!or(u.day),f=m||p,g=u.weekYear||u.weekNumber,b=sQ.fromObject(i);if((f||d)&&g)throw new so("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&d)throw new so("Can't mix ordinal dates with month/day");var v,y,w=g||u.weekday&&!f,_=ar(h,c);w?(v=ag,y=am,_=r6(_)):d?(v=ab,y=ap,_=r9(_)):(v=af,y=ad);for(var C,E=!1,x=st(v);!(C=x()).done;){var T=C.value;or(u[T])?E?u[T]=y[T]:u[T]=_[T]:E=!0}var k=(w?(n=ol(u.weekYear),s=od(u.weekNumber,1,oC(u.weekYear)),o=od(u.weekday,1,7),n?s?!o&&r2("weekday",u.weekday):r2("week",u.week):r2("weekYear",u.weekYear)):d?(r=ol(u.year),a=od(u.ordinal,1,oy(u.year)),r?!a&&r2("ordinal",u.ordinal):r2("year",u.year)):r8(u))||at(u);if(k)return t.invalid(k);var S=ao(o_(w?r5(u):d?r7(u):u),c,l),M=new t({ts:S[0],zone:l,o:S[1],loc:b});return u.weekday&&f&&e.weekday!==M.weekday?t.invalid("mismatched weekday","you can't specify both a weekday of "+u.weekday+" and a date of "+M.toISO()):M},t.fromISO=function(t,e){void 0===e&&(e={});var i=o$(t,[rd,rg],[rm,rb],[rp,rv],[rf,ry]);return al(i[0],i[1],e,"ISO 8601",t)},t.fromRFC2822=function(t,e){void 0===e&&(e={});var i=o$(t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim(),[ro,rr]);return al(i[0],i[1],e,"RFC 2822",t)},t.fromHTTP=function(t,e){void 0===e&&(e={});var i=o$(t,[ra,rc],[rl,rc],[rh,ru]);return al(i[0],i[1],e,"HTTP",e)},t.fromFormat=function(e,i,n){if(void 0===n&&(n={}),or(e)||or(i))throw new sa("fromFormat requires an input string and a format");var s,o=n,r=o.locale,a=o.numberingSystem,l=[(s=rX(sQ.fromOpts({locale:void 0===r?null:r,numberingSystem:void 0===a?null:a,defaultToEN:!0}),e,i)).result,s.zone,s.specificOffset,s.invalidReason],h=l[0],c=l[1],u=l[2],d=l[3];return d?t.invalid(d):al(h,c,n,"format "+i,e,u)},t.fromString=function(e,i,n){return void 0===n&&(n={}),t.fromFormat(e,i,n)},t.fromSQL=function(t,e){void 0===e&&(e={});var i=o$(t,[r_,rg],[rC,rE]);return al(i[0],i[1],e,"SQL",t)},t.invalid=function(e,i){if(void 0===i&&(i=null),!e)throw new sa("need to specify a reason the DateTime is invalid");var n=e instanceof oU?e:new oU(e,i);if(!oo.throwOnInvalid)return new t({invalid:n});throw new si(n)},t.isDateTime=function(t){return t&&t.isLuxonDateTime||!1},t.parseFormatForOpts=function(t,e){void 0===e&&(e={});var i=rQ(t,sQ.fromObject(e));return i?i.map(function(t){return t?t.val:null}).join(""):null},t.expandFormat=function(t,e){return void 0===e&&(e={}),rJ(oG.parseFormat(t),sQ.fromObject(e)).map(function(t){return t.val}).join("")};var e=t.prototype;return e.get=function(t){return this[t]},e.getPossibleOffsets=function(){if(!this.isValid||this.isOffsetFixed)return[this];var t=o_(this.c),e=this.zone.offset(t-864e5),i=this.zone.offset(t+864e5),n=this.zone.offset(t-6e4*e),s=this.zone.offset(t-6e4*i);if(n===s)return[this];var o=t-6e4*n,r=t-6e4*s,a=ar(o,n),l=ar(r,s);return a.hour===l.hour&&a.minute===l.minute&&a.second===l.second&&a.millisecond===l.millisecond?[as(this,{ts:o}),as(this,{ts:r})]:[this]},e.resolvedLocaleOptions=function(t){void 0===t&&(t={});var e=oG.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e.locale,numberingSystem:e.numberingSystem,outputCalendar:e.calendar}},e.toUTC=function(t,e){return void 0===t&&(t=0),void 0===e&&(e={}),this.setZone(s1.instance(t),e)},e.toLocal=function(){return this.setZone(oo.defaultZone)},e.setZone=function(e,i){var n=void 0===i?{}:i,s=n.keepLocalTime,o=n.keepCalendarTime;if((e=s3(e,oo.defaultZone)).equals(this.zone))return this;if(!e.isValid)return t.invalid(ai(e));var r=this.ts;if(void 0!==s&&s||void 0!==o&&o){var a,l,h=e.offset(this.ts);r=(a=this.toObject(),l=e,ao(o_(a),h,l))[0]}return as(this,{ts:r,zone:e})},e.reconfigure=function(t){var e=void 0===t?{}:t,i=e.locale,n=e.numberingSystem,s=e.outputCalendar;return as(this,{loc:this.loc.clone({locale:i,numberingSystem:n,outputCalendar:s})})},e.setLocale=function(t){return this.reconfigure({locale:t})},e.set=function(t){if(!this.isValid)return this;var e,i,n,s,o=oS(t,av),r=!or(o.weekYear)||!or(o.weekNumber)||!or(o.weekday),a=!or(o.ordinal),l=!or(o.year),h=!or(o.month)||!or(o.day),c=o.weekYear||o.weekNumber;if((l||h||a)&&c)throw new so("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&a)throw new so("Can't mix ordinal dates with month/day");r?s=r5(n2({},r6(this.c),o)):or(o.ordinal)?(s=n2({},this.toObject(),o),or(o.day)&&(s.day=Math.min(ow(s.year,s.month),s.day))):s=r7(n2({},r9(this.c),o));var u=(e=s,i=this.o,n=this.zone,ao(o_(e),i,n));return as(this,{ts:u[0],o:u[1]})},e.plus=function(t){return this.isValid?as(this,aa(this,rO.fromDurationLike(t))):this},e.minus=function(t){return this.isValid?as(this,aa(this,rO.fromDurationLike(t).negate())):this},e.startOf=function(t){if(!this.isValid)return this;var e={},i=rO.normalizeUnit(t);switch(i){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0}if("weeks"===i&&(e.weekday=1),"quarters"===i){var n=Math.ceil(this.month/3);e.month=(n-1)*3+1}return this.set(e)},e.endOf=function(t){var e;return this.isValid?this.plus(((e={})[t]=1,e)).startOf(t).minus(1):this},e.toFormat=function(t,e){return void 0===e&&(e={}),this.isValid?oG.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):ae},e.toLocaleString=function(t,e){return void 0===t&&(t=sd),void 0===e&&(e={}),this.isValid?oG.create(this.loc.clone(e),t).formatDateTime(this):ae},e.toLocaleParts=function(t){return void 0===t&&(t={}),this.isValid?oG.create(this.loc.clone(t),t).formatDateTimeParts(this):[]},e.toISO=function(t){var e=void 0===t?{}:t,i=e.format,n=e.suppressSeconds,s=e.suppressMilliseconds,o=e.includeOffset,r=e.extendedZone;if(!this.isValid)return null;var a="extended"===(void 0===i?"extended":i);return ac(this,a)+"T"+au(this,a,void 0!==n&&n,void 0!==s&&s,void 0===o||o,void 0!==r&&r)},e.toISODate=function(t){var e=(void 0===t?{}:t).format;return this.isValid?ac(this,"extended"===(void 0===e?"extended":e)):null},e.toISOWeekDate=function(){return ah(this,"kkkk-'W'WW-c")},e.toISOTime=function(t){var e=void 0===t?{}:t,i=e.suppressMilliseconds,n=e.suppressSeconds,s=e.includeOffset,o=e.includePrefix,r=e.extendedZone,a=e.format;return this.isValid?(void 0!==o&&o?"T":"")+au(this,"extended"===(void 0===a?"extended":a),void 0!==n&&n,void 0!==i&&i,void 0===s||s,void 0!==r&&r):null},e.toRFC2822=function(){return ah(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},e.toHTTP=function(){return ah(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},e.toSQLDate=function(){return this.isValid?ac(this,!0):null},e.toSQLTime=function(t){var e=void 0===t?{}:t,i=e.includeOffset,n=void 0===i||i,s=e.includeZone,o=void 0!==s&&s,r=e.includeOffsetSpace,a="HH:mm:ss.SSS";return(o||n)&&((void 0===r||r)&&(a+=" "),o?a+="z":n&&(a+="ZZ")),ah(this,a,!0)},e.toSQL=function(t){return(void 0===t&&(t={}),this.isValid)?this.toSQLDate()+" "+this.toSQLTime(t):null},e.toString=function(){return this.isValid?this.toISO():ae},e.valueOf=function(){return this.toMillis()},e.toMillis=function(){return this.isValid?this.ts:NaN},e.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},e.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},e.toJSON=function(){return this.toISO()},e.toBSON=function(){return this.toJSDate()},e.toObject=function(t){if(void 0===t&&(t={}),!this.isValid)return{};var e=n2({},this.c);return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e},e.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},e.diff=function(t,e,i){if(void 0===e&&(e="milliseconds"),void 0===i&&(i={}),!this.isValid||!t.isValid)return rO.invalid("created by diffing an invalid DateTime");var n,s,o,r,a,l,h,c,u,d,m,p=n2({locale:this.locale,numberingSystem:this.numberingSystem},i),f=(Array.isArray(n=e)?n:[n]).map(rO.normalizeUnit),g=t.valueOf()>this.valueOf(),b=g?this:t,v=g?t:this,y=(a=(r=function(t,e,i){for(var n,s,o=[["years",function(t,e){return e.year-t.year}],["quarters",function(t,e){return e.quarter-t.quarter+(e.year-t.year)*4}],["months",function(t,e){return e.month-t.month+(e.year-t.year)*12}],["weeks",function(t,e){var i=rI(t,e);return(i-i%7)/7}],["days",rI]],r={},a=t,l=0;l=0&&(n=c,r[c]=u(t,e),(s=a.plus(r))>e?(r[c]--,(t=a.plus(r))>e&&(s=t,r[c]--,t=a.plus(r))):t=s)}return[t,r,s,n]}(b,v,f))[0],l=r[1],h=r[2],c=r[3],u=v-a,0===(d=f.filter(function(t){return["hours","minutes","seconds","milliseconds"].indexOf(t)>=0})).length&&(h0?(o=rO.fromMillis(u,p)).shiftTo.apply(o,d).plus(m):m);return g?y.negate():y},e.diffNow=function(e,i){return void 0===e&&(e="milliseconds"),void 0===i&&(i={}),this.diff(t.now(),e,i)},e.until=function(t){return this.isValid?rD.fromDateTimes(this,t):this},e.hasSame=function(t,e){if(!this.isValid)return!1;var i=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e)<=i&&i<=n.endOf(e)},e.equals=function(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)},e.toRelative=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var i=e.base||t.fromObject({},{zone:this.zone}),n=e.padding?thisthis.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return ov(this.year)}},{key:"daysInMonth",get:function(){return ow(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?oy(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?oC(this.weekYear):NaN}}],[{key:"DATE_SHORT",get:function(){return sd}},{key:"DATE_MED",get:function(){return sm}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return sp}},{key:"DATE_FULL",get:function(){return sf}},{key:"DATE_HUGE",get:function(){return sg}},{key:"TIME_SIMPLE",get:function(){return sb}},{key:"TIME_WITH_SECONDS",get:function(){return sv}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return sy}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return sw}},{key:"TIME_24_SIMPLE",get:function(){return s_}},{key:"TIME_24_WITH_SECONDS",get:function(){return sC}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return sE}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return sx}},{key:"DATETIME_SHORT",get:function(){return sT}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return sk}},{key:"DATETIME_MED",get:function(){return sS}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return sL}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return sM}},{key:"DATETIME_FULL",get:function(){return sR}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return sP}},{key:"DATETIME_HUGE",get:function(){return sO}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return sz}}]),t}();function aE(t){if(aC.isDateTime(t))return t;if(t&&t.valueOf&&oa(t.valueOf()))return aC.fromJSDate(t);if(t&&"object"==typeof t)return aC.fromObject(t);throw new sa("Unknown datetime argument: "+t+", of type "+typeof t)}nQ.DateTime=aC,nQ.Duration=rO,nQ.FixedOffsetZone=s1,nQ.IANAZone=sB,nQ.Info=rA,nQ.Interval=rD,nQ.InvalidZone=s2,nQ.Settings=oo,nQ.SystemZone=sI,nQ.VERSION="3.4.0",nQ.Zone=sD;class ax{constructor(t){this.raw=t;let e=(0,nQ.DateTime).fromISO(t);if(!e.isValid)throw Error(`Invalid date string: ${t}`);this.parsed=e}static fromNullable(t){return t?new this(t):null}format(){return 4===this.raw.length?this.raw:7===this.raw.length?this.parsed.toFormat("LLL yyyy"):this.parsed.toFormat("LLL d, yyyy")}preposition(){return 10===this.raw.length?"on":"in"}}const aT={AU:"Australia",AT:"Austria",BR:"Brazil",CA:"Canada",CH:"Switzerland",CK:"Cook Islands",CN:"China",DE:"Germany",FR:"France",IE:"Ireland",IL:"Israel",MX:"Mexico",NZ:"New Zealand",SE:"Sweden",SG:"Singapore",UK:"United Kingdom",US:"United States",ZA:"South Africa"};function ak(t){return{...t,date:ax.fromNullable(t.date)}}async function aS(t){return Object.fromEntries(Object.entries(await s("55rID")).map(([e,i])=>[e,function(t,e,i){var n;let s;if(e.legacy)s={...e.legacy,date:ax.fromNullable(e.legacy.date)};else{let i,n;let o=(e.add_max?.length??0)+(e.reduce_min?.length??0)+(e.rm_min?.length??0);if(o>1)throw Error(`${t} has ${o} new-style policy records, but is missing a legacy reform. It must either have exactly one new-style policy record or set a legacy reform`);if(e.add_max)i=e.add_max[0],n="add parking maximums";else if(e.reduce_min)i=e.reduce_min[0],n="reduce parking minimums";else if(e.rm_min)i=e.rm_min[0],n="remove parking minimums";else throw Error(`${t} has no policies set (new-style or legacy).`);s={...ak(i),policy:[n]}}let o={place:{...n=e.place,country:aT[n.country]??n.country,url:`https://parkingreform.org/mandates-map/city_detail/${t.replace(/ /g,"").replace(",","_")}.html`},unifiedPolicy:s};return i.includeMultipleReforms&&(e.add_max&&(o.add_max=e.add_max.map(ak)),e.reduce_min&&(o.reduce_min=e.reduce_min.map(ak)),e.rm_min&&(o.rm_min=e.rm_min.map(ak))),o}(e,i,t)]))}function aL(t,e){return t.reduce((t,i,n)=>(e(i)&&t.push(n),t),[])}const aM="Unknown",aR=[["100",100],["5k",5e3],["25k",25e3],["50k",5e4],["100k",1e5],["500k",5e5],["1M",1e6],["50M",5e7]];class aP{constructor(t,e){this.cache=null,this.entries=t,this.state=new e0("FilterState",e)}get totalNumPlaces(){return Object.keys(this.entries).length}get matchedPlaces(){return this.ensureCache().matchedPlaces}get numMatchedPolicyRecords(){return this.ensureCache().numMatchedPolicyRecordsForSinglePolicy}get placeIds(){return new Set(Object.keys(this.matchedPlaces))}get matchedCountries(){return this.ensureCache().matchedCountries}get matchedPolicyTypes(){return this.ensureCache().matchedPolicyTypesForAnyPolicy}getState(){return this.state.getValue()}update(t){let e=this.state.getValue();this.state.setValue({...e,...t})}subscribe(t,e){this.state.subscribe(e,t)}initialize(){this.state.initialize()}ensureCache(){let t=this.state.getValue();if(this.cache&&nX(t,this.cache.state))return this.cache;let e={},i=new Set,n=new Set,s=0;for(let t in this.entries){let o=this.getPlaceMatch(t);o&&(e[t]=o,i.add(this.entries[t].place.country),"single policy"===o.type&&(s+=o.matchingIndexes.length),"any"===o.type&&(o.hasAddMax&&n.add("add parking maximums"),o.hasReduceMin&&n.add("reduce parking minimums"),o.hasRmMin&&n.add("remove parking minimums")))}return this.cache={state:t,matchedPlaces:e,matchedCountries:i,matchedPolicyTypesForAnyPolicy:n,numMatchedPolicyRecordsForSinglePolicy:s},this.cache}matchesPlace(t){let e=this.state.getValue();if(!e.country.has(t.country)||!(!e.allMinimumsRemovedToggle||"reduce parking minimums"===e.policyTypeFilter||t.repeal))return!1;let[i,n]=e.populationSliderIndexes;return t.pop>=aR[i][1]&&t.pop<=aR[n][1]}matchesPolicyRecord(t){let e=this.state.getValue();return!!(e.status.has(t.status)&&e.year.has(t.date?.parsed.year.toString()||aM)&&t.scope.some(t=>e.scope.has(t)))&&t.land.some(t=>e.landUse.has(t))}getPlaceMatch(t){let e=this.state.getValue(),i=this.entries[t];if(e.searchInput)return e.searchInput===t?{type:"search"}:null;if(!this.matchesPlace(i.place))return null;if("legacy reform"===e.policyTypeFilter)return i.unifiedPolicy.policy.some(t=>e.includedPolicyChanges.has(t))&&this.matchesPolicyRecord(i.unifiedPolicy)?{type:"legacy"}:null;if("any parking reform"===e.policyTypeFilter){let t=function(t){let e=[];return t.add_max?.length&&e.push("add parking maximums"),t.reduce_min?.length&&e.push("reduce parking minimums"),t.rm_min?.length&&e.push("remove parking minimums"),e}(i);return t.some(t=>e.includedPolicyChanges.has(t))?{type:"any",hasAddMax:t.includes("add parking maximums"),hasReduceMin:t.includes("reduce parking minimums"),hasRmMin:t.includes("remove parking minimums")}:null}if("add parking maximums"===e.policyTypeFilter){let t=aL(i.add_max??[],t=>this.matchesPolicyRecord(t));return t.length?{type:"single policy",policyType:"add parking maximums",matchingIndexes:t}:null}if("reduce parking minimums"===e.policyTypeFilter){let t=aL(i.reduce_min??[],t=>this.matchesPolicyRecord(t));return t.length?{type:"single policy",policyType:"reduce parking minimums",matchingIndexes:t}:null}if("remove parking minimums"===e.policyTypeFilter){let t=aL(i.rm_min??[],t=>this.matchesPolicyRecord(t));return t.length?{type:"single policy",policyType:"remove parking minimums",matchingIndexes:t}:null}throw Error("Unreachable code")}}const aO={includedPolicyChanges:new Set,scope:new Set,landUse:new Set,status:new Set(["planned","proposed","repealed","unverified"]),country:new Set,year:new Set};class az{constructor(t){let e=new Set,i=new Set,n=new Set,s=new Set,o=new Set,r=new Set;t.forEach(t=>{s.add(t.unifiedPolicy.status),o.add(t.place.country),r.add(t.unifiedPolicy.date?.parsed.year.toString()||aM),t.unifiedPolicy.policy.forEach(t=>e.add(t)),t.unifiedPolicy.scope.forEach(t=>i.add(t)),t.unifiedPolicy.land.forEach(t=>n.add(t))}),this.options={includedPolicyChanges:Array.from(e).sort(),scope:Array.from(i).sort(),landUse:Array.from(n).sort(),status:Array.from(s).sort(),country:Array.from(o).sort(),year:Array.from(r).sort((t,e)=>e.localeCompare(t))}}default(t){return new Set(this.options[t].filter(e=>!aO[t].has(e)))}all(t){return this.options[t]}}function aD(t){let e=t.querySelectorAll('input[type="checkbox"]'),i=e.length,n=Array.from(e).filter(t=>t.checked).length;return` (${n}/${i})`}function aA(t,e,i){t.outerContainer.hidden=i.hidden,t.accordionTitle.textContent=`${e}${i.supplementalTitle??""}`;let n=t.accordionButton.querySelector(".fa-chevron-up"),s=t.accordionButton.querySelector(".fa-chevron-down");n&&s&&(t.accordionButton.setAttribute("aria-expanded",i.expanded.toString()),t.contentContainer.hidden=!i.expanded,n.style.display=i.expanded?"block":"none",s.style.display=i.expanded?"none":"block")}function aI(t,e,i,n){let s=document.createElement("label");s.className="filter-checkbox",s.htmlFor=t;let o=document.createElement("input");o.type="checkbox",o.name=e,o.id=t,o.checked=i;let r=document.createElement("i");r.className="fa-regular fa-square",r.ariaHidden="true";let a=document.createElement("i");a.className="fa-solid fa-square-check",a.ariaHidden="true";let l=document.createElement("span");return l.textContent=n,s.appendChild(o),s.appendChild(r),s.appendChild(a),s.appendChild(l),[s,o]}function aF(t){let e=document.createElement("div");e.className="filter-accordion";let i=`filter-accordion-toggle-${t}`,n=`filter-accordion-content-${t}`,s=`filter-accordion-title-${t}`,o=document.createElement("button");o.type="button",o.id=i,o.className="filter-accordion-toggle",o.ariaExpanded="false",o.setAttribute("aria-controls",n);let r=document.createElement("span");r.id=s,r.className="filter-accordion-title",o.appendChild(r);let a=document.createElement("div");a.className="filter-accordion-icon-container",a.ariaHidden="true";let l=document.createElement("i");l.className="fa-solid fa-chevron-down",l.title="expand option checkboxes";let h=document.createElement("i");h.className="fa-solid fa-chevron-up",h.title="collapse option checkboxes",a.appendChild(l),a.appendChild(h),o.appendChild(a),e.appendChild(o);let c=document.createElement("div");return c.id=n,c.className="filter-accordion-content",c.setAttribute("aria-describedby",s),e.appendChild(c),{outerContainer:e,accordionTitle:r,accordionButton:o,contentContainer:c}}function aN(t,e){let i=t.getValue();t.setValue({...i,supplementalTitle:aD(e)})}function aH(t,e,i,n){let[s,o]=function(t,e){let i=aF(t.htmlName),n=document.createElement("fieldset");n.className=`filter-${t.htmlName}`,i.contentContainer.appendChild(n);let s=document.createElement("div");s.className="filter-group-selectors-container",n.appendChild(s);let o=document.createElement("button");o.type="button",o.textContent="Check all",o.id=`filter-${t.htmlName}-check-all`,s.appendChild(o);let r=document.createElement("button");r.type="button",r.textContent="Uncheck all",r.id=`filter-${t.htmlName}-uncheck-all`,s.appendChild(r);let a=document.createElement("div");a.className="filter-checkbox-options-container",t.useTwoColumns&&(a.className="filter-checkbox-options-two-columns"),n.appendChild(a),e.all(t.filterStateKey).forEach((e,i)=>{let n=`filter-${t.htmlName}-option-${i}`,s=!aO[t.filterStateKey].has(e),o=t.preserveCapitalization?e:iM(e),[r]=aI(n,t.htmlName,s,o);a.appendChild(r)});let l={...i,fieldSet:n,checkAllButton:o,uncheckAllButton:r},h=aD(n),c=new e0(`filter accordion ${t.htmlName}`,{hidden:!1,expanded:!1,supplementalTitle:h});return c.subscribe(e=>aA(l,t.legend,e)),i.accordionButton.addEventListener("click",()=>{let t=c.getValue();c.setValue({...t,expanded:!t.expanded})}),c.initialize(),[l,c]}(n,e);i.appendChild(s.outerContainer),s.fieldSet.addEventListener("change",()=>{aN(o,s.fieldSet);let e=Array.from(s.fieldSet.querySelectorAll('input[type="checkbox"]:checked')).map(t=>{let e=t.parentElement?.textContent?.trim();return n.preserveCapitalization?e:e?.toLowerCase()}).filter(t=>void 0!==t);t.update({[n.filterStateKey]:new Set(e)})});let r=Array.from(s.fieldSet.querySelectorAll('input[type="checkbox"]'));s.checkAllButton.addEventListener("click",()=>{r.forEach(t=>t.checked=!0),aN(o,s.fieldSet),t.update({[n.filterStateKey]:new Set(e.all(n.filterStateKey))})}),s.uncheckAllButton.addEventListener("click",()=>{r.forEach(t=>t.checked=!1),aN(o,s.fieldSet),t.update({[n.filterStateKey]:new Set})}),t.subscribe(`possibly hide ${n.htmlName} in filter`,t=>{let e=o.getValue(),i=!!n.hide&&n.hide(t);o.setValue({...e,hidden:i})})}const aB=aR.length-1;function aj(t){let[e,i]=t,n=aR[e][0],s=aR[i][0];return` (${n}-${s})`}function aV(t,e){let[i,n]=t;e.left.value=i.toString(),e.right.value=n.toString(),e.left.setAttribute("value",i.toString()),e.right.setAttribute("value",n.toString());let s=(n-i)/2,o=i+s,r=n-s;e.left.setAttribute("max",o.toString()),e.right.setAttribute("min",r.toString());let a=Math.round((e.controls.offsetWidth+12)/aR.length),l=o*a,h=(aB-r)*a;e.left.style.width=`${l+12}px`,e.right.style.width=`${h+12}px`,e.right.style.left=`${l+24}px`;let c=aR[i][0],u=aR[n][0];e.label.innerHTML=`${c} - ${u} residents`}function aW(t){let e=document.querySelector(".filter-popup"),i=document.querySelector(".header-filter-icon-container");e&&i&&(e.hidden=!t,i.ariaExpanded=t.toString())}function aZ(t,e,i,n,s,o){if(!i)return"No places selected — use the filter or search icons";if(e.searchInput)return`Showing ${e.searchInput} from search \u{2014} reset`;let r=1===o.size?Array.from(o)[0]:`${o.size} countries`;("United States"===r||"United Kingdom"===r)&&(r=`the ${r}`);let a=1===n?"record":"records",l="table"===t&&i!==n,h="because some places have multiple records",c=`Showing ${i} ${1===i?"place":"places"} in ${r} with`;if("legacy reform"===e.policyTypeFilter){let t=e.allMinimumsRemovedToggle?"all parking minimums removed":"parking reforms";return`${c} ${t}`}if("any parking reform"===e.policyTypeFilter){let t;if(e.allMinimumsRemovedToggle)t=nX(e.includedPolicyChanges,new Set(["add parking maximums"]))?"both all parking minimums removed and parking maximums added":"all parking minimums removed";else{let i={"add parking maximums":"parking maximums added","reduce parking minimums":"parking minimums reduced","remove parking minimums":"parking minimums removed"},n=Array.from(e.includedPolicyChanges).filter(t=>s.has(t)).map(t=>i[t]).sort().reverse();if(!n.length)throw Error(`Expected state.includedPolicyChanges to be set: ${JSON.stringify(e)}`);if(n.length<=2)t=n.join(" or ");else{let e=n.pop();t=`${n.join(", ")}, or ${e}`}}return`${c} ${t}`}if("reduce parking minimums"===e.policyTypeFilter){let t=`${c} parking minimums reduced`;return l?`${t}. Matched ${n} total policy ${a} ${h}.`:t}if("add parking maximums"===e.policyTypeFilter){let t,i;e.allMinimumsRemovedToggle?(t="both all parking minimums removed and parking maximums added",i=`Matched ${n} total parking maximum policy ${a} ${h}`):(t="parking maximums added",i=`Matched ${n} total policy ${a} ${h}`);let s=`${c} ${t}`;return l?`${s}. ${i}.`:s}if("remove parking minimums"===e.policyTypeFilter){if(e.allMinimumsRemovedToggle)return`${c} all parking minimums removed`;let t=`${c} parking minimums removed`;return l?`${t}. Matched ${n} total policy ${a} ${h}.`:t}throw Error("unreachable")}function aG(t,e){t.addEventListener("click",t=>{t.target instanceof Element&&t.target.matches(".counter-search-reset")&&e.update({searchInput:null})})}class aU{constructor(t){this.table=t}reloadData(t,e,i){return this.table.dataLoader.load(t,void 0,void 0,void 0,e,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(t){return this.table.modules.layout.layout(t)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(t){return this.table.eventBus.subscribed(t)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(t){return this.table.externalEvents.subscribed(t)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(t){return this.table.options[t]}setOption(t,e){return void 0!==e&&(this.table.options[t]=e),this.table.options[t]}deprecationCheck(t,e,i){return this.table.deprecationAdvisor.check(t,e,i)}deprecationCheckMsg(t,e){return this.table.deprecationAdvisor.checkMsg(t,e)}deprecationMsg(t){return this.table.deprecationAdvisor.msg(t)}module(t){return this.table.module(t)}}class aq{static elVisible(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)}static elOffset(t){var e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset-document.documentElement.clientTop,left:e.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(t,e,i){var n,s=t?e.split(t):[e],o=s.length;for(let t=0;tt.subject===r))>-1?e[o]=i[a].copy:(l=Object.assign(Array.isArray(r)?[]:{},r),i.unshift({subject:r,copy:l}),e[o]=this.deepClone(r,l,i)))}return e}}let aK=class t extends aU{constructor(t,e,i){super(t),this.element=e,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var t=this.table.options.popupContainer;return"string"==typeof t?(t=document.querySelector(t))||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)"):!0===t&&(t=this.table.element),t&&!this._checkContainerIsParent(t)&&(t=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),t||(t=document.body),t}_checkContainerIsParent(t,e=this.table.element){return t===e||!!e.parentNode&&this._checkContainerIsParent(t,e.parentNode)}renderCallback(t){this.renderedCallback=t}containerEventCoords(t){var e=!(t instanceof MouseEvent),i=e?t.touches[0].pageX:t.pageX,n=e?t.touches[0].pageY:t.pageY;if(this.container!==document.body){let t=aq.elOffset(this.container);i-=t.left,n-=t.top}return{x:i,y:n}}elementPositionCoords(t,e="right"){var i,n,s,o=aq.elOffset(t);switch(this.container!==document.body&&(i=aq.elOffset(this.container),o.left-=i.left,o.top-=i.top),e){case"right":n=o.left+t.offsetWidth,s=o.top-1;break;case"bottom":n=o.left,s=o.top+t.offsetHeight;break;case"left":n=o.left,s=o.top-1;break;case"top":n=o.left,s=o.top;break;case"center":n=o.left+t.offsetWidth/2,s=o.top+t.offsetHeight/2}return{x:n,y:s,offset:o}}show(t,e){var i,n,s,o,r;return this.destroyed||this.table.destroyed||(t instanceof HTMLElement?(s=t,o=(r=this.elementPositionCoords(t,e)).offset,i=r.x,n=r.y):"number"==typeof t?(o={top:0,left:0},i=t,n=e):(i=(r=this.containerEventCoords(t)).x,n=r.y,this.reversedX=!1),this.element.style.top=n+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,n,s,o,e),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",t=>{t.stopPropagation()})),this}_fitToScreen(t,e,i,n,s){var o=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(t+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-n.left+"px":this.element.style.right=this.container.offsetWidth-t+"px",this.reversedX=!0);let r=Math.max(this.container.offsetHeight,o?this.container.scrollHeight:0);e+this.element.offsetHeight>r&&(i?"bottom"===s?this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px":this.element.style.height=r+"px")}isVisible(){return this.visible}hideOnBlur(t){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=t),this}_escapeCheck(t){27==t.keyCode&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(t=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!t&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new t(this.table,e,this),this.childPopup}};class aY extends aU{constructor(t,e){super(t),this._handler=null}initialize(){}registerTableOption(t,e){this.table.optionsList.register(t,e)}registerColumnOption(t,e){this.table.columnManager.optionsList.register(t,e)}registerTableFunction(t,e){void 0===this.table[t]?this.table[t]=(...i)=>(this.table.initGuard(t),e(...i)):console.warn("Unable to bind table function, name already in use",t)}registerComponentFunction(t,e,i){return this.table.componentFunctionBinder.bind(t,e,i)}registerDataHandler(t,e){this.table.rowManager.registerDataPipelineHandler(t,e),this._handler=t}registerDisplayHandler(t,e){this.table.rowManager.registerDisplayPipelineHandler(t,e),this._handler=t}displayRows(t){var e,i=this.table.rowManager.displayRows.length-1;if(this._handler&&(e=this.table.rowManager.displayPipeline.findIndex(t=>t.handler===this._handler))>-1&&(i=e),t&&(i+=t),this._handler)return i>-1?this.table.rowManager.getDisplayRows(i):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(t,e){e||(e=this._handler),e&&this.table.rowManager.refreshActiveData(e,!1,t)}footerAppend(t){return this.table.footerManager.append(t)}footerPrepend(t){return this.table.footerManager.prepend(t)}footerRemove(t){return this.table.footerManager.remove(t)}popup(t,e){return new aK(this.table,t,e)}alert(t,e){return this.table.alertManager.alert(t,e)}clearAlert(){return this.table.alertManager.clear()}}var a$={rownum:function(t,e,i,n,s,o){return o.getPosition()}};class aJ extends aY{static moduleName="accessor";static accessors=a$;constructor(t){super(t),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(t){var e=!1,i={};this.allowedTypes.forEach(n=>{var s,o="accessor"+(n.charAt(0).toUpperCase()+n.slice(1));t.definition[o]&&(s=this.lookupAccessor(t.definition[o]))&&(e=!0,i[o]={accessor:s,params:t.definition[o+"Params"]||{}})}),e&&(t.modules.accessor=i)}lookupAccessor(t){var e=!1;switch(typeof t){case"string":aJ.accessors[t]?e=aJ.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":e=t}return e}transformRow(t,e){var i="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),n=t.getComponent(),s=aq.deepClone(t.data||{});return this.table.columnManager.traverse(function(t){var o,r,a,l;t.modules.accessor&&(r=t.modules.accessor[i]||t.modules.accessor.accessor||!1)&&"undefined"!=(o=t.getFieldValue(s))&&(l=t.getComponent(),a="function"==typeof r.params?r.params(o,s,e,l,n):r.params,t.setFieldValue(s,r.accessor(o,s,e,a,l,n)))}),s}}var aX={method:"GET"};function aQ(t,e,i){if(t&&i&&Object.keys(i).length&&(!e.method||"get"==e.method.toLowerCase())){var n,s;e.method="get",t+=(t.includes("?")?"&":"?")+(n=function t(e,i){var n=[];if(i=i||"",Array.isArray(e))e.forEach((e,s)=>{n=n.concat(t(e,i?i+"["+s+"]":s))});else if("object"==typeof e)for(var s in e)n=n.concat(t(e[s],i?i+"["+s+"]":s));else n.push({key:i,value:e});return n}(i),s=[],n.forEach(function(t){s.push(encodeURIComponent(t.key)+"="+encodeURIComponent(t.value))}),s.join("&"))}return t}function a0(t,e,i){var n;return new Promise((s,o)=>{if(t=this.urlGenerator.call(this.table,t,e,i),"GET"!=e.method.toUpperCase()){if(n="object"==typeof this.table.options.ajaxContentType?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType]){for(var r in n.headers)e.headers||(e.headers={}),void 0===e.headers[r]&&(e.headers[r]=n.headers[r]);e.body=n.body.call(this,t,e,i)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType)}t?(void 0===e.headers&&(e.headers={}),void 0===e.headers.Accept&&(e.headers.Accept="application/json"),void 0===e.headers["X-Requested-With"]&&(e.headers["X-Requested-With"]="XMLHttpRequest"),void 0===e.mode&&(e.mode="cors"),"cors"==e.mode?(void 0===e.headers.Origin&&(e.headers.Origin=window.location.origin),void 0===e.credentials&&(e.credentials="same-origin")):void 0===e.credentials&&(e.credentials="include"),fetch(t,e).then(t=>{t.ok?t.json().then(t=>{s(t)}).catch(t=>{o(t),console.warn("Ajax Load Error - Invalid JSON returned",t)}):(console.error("Ajax Load Error - Connection Error: "+t.status,t.statusText),o(t))}).catch(t=>{console.error("Ajax Load Error - Connection Error: ",t),o(t)})):(console.warn("Ajax Load Error - No URL Set"),s([]))})}var a1={json:{headers:{"Content-Type":"application/json"},body:function(t,e,i){return JSON.stringify(i)}},form:{headers:{},body:function(t,e,i){var n=function t(e,i){var n=[];if(i=i||"",Array.isArray(e))e.forEach((e,s)=>{n=n.concat(t(e,i?i+"["+s+"]":s))});else if("object"==typeof e)for(var s in e)n=n.concat(t(e[s],i?i+"["+s+"]":s));else n.push({key:i,value:e});return n}(i),s=new FormData;return n.forEach(function(t){s.append(t.key,t.value)}),s}}};class a2 extends aY{static moduleName="ajax";static defaultConfig=aX;static defaultURLGenerator=aQ;static defaultLoaderPromise=a0;static contentTypeFormatters=a1;constructor(t){super(t),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=a2.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||a2.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||a2.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(t,e,i,n){var s=this.table.options.ajaxParams;return s&&("function"==typeof s&&(s=s.call(this.table)),n=Object.assign(Object.assign({},s),n)),n}requestDataCheck(t,e,i,n){return!!(!t&&this.url||"string"==typeof t)}requestData(t,e,i,n,s){var o;return!s&&this.requestDataCheck(t)?(t&&this.setUrl(t),o=this.generateConfig(i),this.sendRequest(this.url,e,o)):s}setDefaultConfig(t={}){this.config=Object.assign({},a2.defaultConfig),"string"==typeof t?this.config.method=t:Object.assign(this.config,t)}generateConfig(t={}){var e=Object.assign({},this.config);return"string"==typeof t?e.method=t:Object.assign(e,t),e}setUrl(t){this.url=t}getUrl(){return this.url}sendRequest(t,e,i){return!1!==this.table.options.ajaxRequesting.call(this.table,t,e)?this.loaderPromise(t,i,e).then(i=>(this.table.options.ajaxResponse&&(i=this.table.options.ajaxResponse.call(this.table,t,e,i)),i)):Promise.reject()}}var a3={replace:function(t){return this.table.setData(t)},update:function(t){return this.table.updateOrAddData(t)},insert:function(t){return this.table.addData(t)}},a4={table:function(t){var e=[],i=!0,n=this.table.columnManager.columns,s=[],o=[];return(t=t.split("\n")).forEach(function(t){e.push(t.split(" "))}),!!e.length&&!(1===e.length&&e[0].length<2)&&(e[0].forEach(function(t){var e=n.find(function(e){return t&&e.definition.title&&t.trim()&&e.definition.title.trim()===t.trim()});e?s.push(e):i=!1}),i||(i=!0,s=[],e[0].forEach(function(t){var e=n.find(function(e){return t&&e.field&&t.trim()&&e.field.trim()===t.trim()});e?s.push(e):i=!1}),i||(s=this.table.columnManager.columnsByIndex)),i&&e.shift(),e.forEach(function(t){var e={};t.forEach(function(t,i){s[i]&&(e[s[i].field]=t)}),o.push(e)}),o)}},a6={keybindings:{bindings:{copyToClipboard:["ctrl + 67","meta + 67"]},actions:{copyToClipboard:function(t){!this.table.modules.edit.currentCell&&this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}}}};class a5 extends aY{static moduleName="clipboard";static moduleExtensions=a6;static pasteActions=a3;static pasteParsers=a4;constructor(t){super(t),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,(!0===this.mode||"copy"===this.mode)&&this.table.element.addEventListener("copy",t=>{var e,i,n;this.blocked||(t.preventDefault(),this.customSelection?(e=this.customSelection,this.table.options.clipboardCopyFormatter&&(e=this.table.options.clipboardCopyFormatter("plain",e))):(n=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),e=(i=this.table.modules.export.generateHTMLTable(n))?this.generatePlainContent(n):"",this.table.options.clipboardCopyFormatter&&(e=this.table.options.clipboardCopyFormatter("plain",e),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",e):t.clipboardData&&t.clipboardData.setData?(t.clipboardData.setData("text/plain",e),i&&t.clipboardData.setData("text/html",i)):t.originalEvent&&t.originalEvent.clipboardData.setData&&(t.originalEvent.clipboardData.setData("text/plain",e),i&&t.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",e,i),this.reset())}),(!0===this.mode||"paste"===this.mode)&&this.table.element.addEventListener("paste",t=>{this.paste(t)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(t){var e=[];return t.forEach(t=>{var i=[];t.columns.forEach(e=>{var n="";if(e){if("group"===t.type&&(e.value=e.component.getKey()),null===e.value)n="";else switch(typeof e.value){case"object":n=JSON.stringify(e.value);break;case"undefined":n="";break;default:n=e.value}}i.push(n)}),e.push(i.join(" "))}),e.join("\n")}copy(t,e){var i,n;this.blocked=!1,this.customSelection=!1,(!0===this.mode||"copy"===this.mode)&&(this.rowRange=t||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((t=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&e&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(t)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((n=document.body.createTextRange()).moveToElementText(this.table.element),n.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(t){switch(typeof t){case"string":this.pasteAction=a5.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t}}setPasteParser(t){switch(typeof t){case"string":this.pasteParser=a5.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}}paste(t){var e,i,n;this.checkPasteOrigin(t)&&(e=this.getPasteData(t),(i=this.pasteParser.call(this,e))?(t.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),n=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",e,i,n)):this.dispatchExternal("clipboardPasteError",e))}mutateData(t){var e=[];return Array.isArray(t)?t.forEach(t=>{e.push(this.table.modules.mutator.transformRow(t,"clipboard"))}):e=t,e}checkPasteOrigin(t){var e=!0;return(this.confirm("clipboard-paste",[t])||!["DIV","SPAN"].includes(t.target.tagName))&&(e=!1),e}getPasteData(t){var e;return window.clipboardData&&window.clipboardData.getData?e=window.clipboardData.getData("Text"):t.clipboardData&&t.clipboardData.getData?e=t.clipboardData.getData("text/plain"):t.originalEvent&&t.originalEvent.clipboardData.getData&&(e=t.originalEvent.clipboardData.getData("text/plain")),e}}class a9{constructor(t){return this._row=t,new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._row.table.componentFunctionBinder.handle("row",t._row,e)}})}getData(t){return this._row.getData(t)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var t=[];return this._row.getCells().forEach(function(e){t.push(e.getComponent())}),t}getCell(t){var e=this._row.getCell(t);return!!e&&e.getComponent()}_getSelf(){return this._row}}class a7{constructor(t){return this._cell=t,new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._cell.table.componentFunctionBinder.handle("cell",t._cell,e)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(t){return this._cell.row.getData(t)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(t,e){void 0===e&&(e=!0),this._cell.setValue(t,e)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class a8 extends aU{constructor(t,e){super(t.table),this.table=t.table,this.column=t,this.row=e,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader&&this.element.classList.add("tabulator-row-header")}_configureCell(){var t=this.element,e=this.column.getField();t.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(t.style.display="inline-flex",t.style.alignItems=({top:"flex-start",bottom:"flex-end",middle:"center"})[this.column.vertAlign]||"",this.column.hozAlign&&(t.style.justifyContent=({left:"flex-start",right:"flex-end",center:"center"})[this.column.hozAlign]||"")),e&&t.setAttribute("tabulator-field",e),this.column.definition.cssClass&&this.column.definition.cssClass.split(" ").forEach(e=>{t.classList.add(e)}),this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var t;switch(typeof(t=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value))){case"object":if(t instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else this.element.innerHTML="",null!=t&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=t}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(t){return this.loaded||(this.loaded=!0,t||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(t,e,i){this.setValueProcessData(t,e,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(t,e,i){var n=!1;return(this.value!==t||i)&&(n=!0,e&&(t=this.chain("cell-value-changing",[this,t],null,t))),this.setValueActual(t),n&&this.dispatch("cell-value-changed",this),n}setValueActual(t){this.oldValue=this.value,this.value=t,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,t),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new a7(this)),this.component}}class lt{constructor(t){return this._column=t,this.type="ColumnComponent",new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._column.table.componentFunctionBinder.handle("column",t._column,e)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var t=[];return this._column.cells.forEach(function(e){t.push(e.getComponent())}),t}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach(function(t){t.show()}):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach(function(t){t.hide()}):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var t=[];return this._column.columns.length&&this._column.columns.forEach(function(e){t.push(e.getComponent())}),t}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(t,e){return this._column.table.columnManager.scrollToColumn(this._column,t,e)}getTable(){return this._column.table}move(t,e){var i=this._column.table.columnManager.findColumn(t);i?this._column.table.columnManager.moveColumn(this._column,i,e):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var t=this._column.nextColumn();return!!t&&t.getComponent()}getPrevColumn(){var t=this._column.prevColumn();return!!t&&t.getComponent()}updateDefinition(t){return this._column.updateDefinition(t)}getWidth(){return this._column.getWidth()}setWidth(t){var e;return e=!0===t?this._column.reinitializeWidth(!0):this._column.setWidth(t),this._column.table.columnManager.rerenderColumns(!0),e}}var le={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};class li extends aU{static defaultOptionList=le;constructor(t,e,i){super(e.table),this.definition=t,this.parent=e,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=i,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach((t,e)=>{var i=new li(t,this);this.attachColumn(i)}),this.checkColumnVisibility()):e.registerColumnField(this),this._initialize()}createElement(){var t=document.createElement("div");switch(t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),this.isRowHeader&&t.classList.add("tabulator-row-header"),this.table.options.columnHeaderVertAlign){case"middle":t.style.justifyContent="center";break;case"bottom":t.style.justifyContent="flex-end"}return t}createGroupElement(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t}mapDefinitions(){var t=this.table.options.columnDefaults;if(t)for(let e in t)void 0===this.definition[e]&&(this.definition[e]=t[e]);this.definition=this.table.columnManager.optionsList.generate(li.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach(t=>{-1===li.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",t)})}setField(t){this.field=t,this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(t){this.parent.registerColumnPosition(t)}registerColumnField(t){this.parent.registerColumnField(t)}reRegisterPosition(){this.isGroup?this.columns.forEach(function(t){t.reRegisterPosition()}):this.registerColumnPosition(this)}_initialize(){for(var t=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);t.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===t.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var t=this.definition;this.dispatch("column-layout",this),void 0!==t.visible&&(t.visible?this.show(!0):this.hide(!0)),t.cssClass&&t.cssClass.split(" ").forEach(t=>{this.element.classList.add(t)}),t.field&&this.element.setAttribute("tabulator-field",t.field),this.setMinWidth(parseInt(t.minWidth)),t.maxInitialWidth&&(this.maxInitialWidth=parseInt(t.maxInitialWidth)),t.maxWidth&&this.setMaxWidth(parseInt(t.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var t=document.createElement("div");return t.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),t.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),t}_buildColumnHeaderTitle(){var t=this.definition,e=document.createElement("div");if(e.classList.add("tabulator-col-title"),t.headerWordWrap&&e.classList.add("tabulator-col-title-wrap"),t.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",t=>{t.stopPropagation(),i.focus()}),i.addEventListener("mousedown",t=>{t.stopPropagation()}),i.addEventListener("change",()=>{t.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),e.appendChild(i),t.field?this.langBind("columns|"+t.field,e=>{i.value=e||t.title||" "}):i.value=t.title||" "}else t.field?this.langBind("columns|"+t.field,i=>{this._formatColumnHeaderTitle(e,i||t.title||" ")}):this._formatColumnHeaderTitle(e,t.title||" ");return e}_formatColumnHeaderTitle(t,e){var i=this.chain("column-format",[this,e,t],null,()=>e);switch(typeof i){case"object":i instanceof Node?t.appendChild(i):(t.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":t.innerHTML="";break;default:t.innerHTML=i}}_buildGroupHeader(){this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass&&this.definition.cssClass.split(" ").forEach(t=>{this.element.classList.add(t)}),this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(t){return t[this.field]}_getNestedData(t){var e,i=t,n=this.fieldStructure,s=n.length;for(let t=0;t{e.push(t),e=e.concat(t.getColumns(!0))}):e=this.columns,e}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(t){var e=[];return this.isGroup&&t&&(this.columns.forEach(function(t){e.push(t.getDefinition(!0))}),this.definition.columns=e),this.definition}checkColumnVisibility(){var t=!1;this.columns.forEach(function(e){e.visible&&(t=!0)}),t?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(t,e){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(t){t.show()}),this.isGroup||null!==this.width||this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,e),t||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(t,e){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(t){t.hide()}),this.dispatch("column-hide",this,e),t||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var t=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(e){e.visible&&(t+=e.getWidth())}),this.contentElement.style.maxWidth=t-1+"px",this.table.initialized&&(this.element.style.width=t+"px"),this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(t){var e=this.columns.indexOf(t);e>-1&&this.columns.splice(e,1),this.columns.length||this.delete()}setWidth(t){this.widthFixed=!0,this.setWidthActual(t)}setWidthActual(t){isNaN(t)&&(t=Math.floor(this.table.element.clientWidth/100*parseInt(t))),t=Math.max(this.minWidth,t),this.maxWidth&&(t=Math.min(this.maxWidth,t)),this.width=t,this.widthStyled=t?t+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(t){t.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this),this.subscribedExternal("columnWidth")&&this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var t=[];this.cells.forEach(function(e){e.row.heightInitialized&&(null!==e.row.getElement().offsetParent?(t.push(e.row),e.row.clearCellHeight()):e.row.heightInitialized=!1)}),t.forEach(function(t){t.calcHeight()}),t.forEach(function(t){t.setCellHeight()})}getWidth(){var t=0;return this.isGroup?this.columns.forEach(function(e){e.visible&&(t+=e.getWidth())}):t=this.width,t}getLeftOffset(){var t=this.element.offsetLeft;return this.parent.isGroup&&(t+=this.parent.getLeftOffset()),t}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(t){this.maxWidth&&t>this.maxWidth&&console.warn("the minWidth ("+(t=this.maxWidth)+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")"),this.minWidth=t,this.minWidthStyled=t?t+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})}setMaxWidth(t){this.minWidth&&t{this.isGroup&&this.columns.forEach(function(t){t.delete()}),this.dispatch("column-delete",this);var i=this.cells.length;for(let t=0;t-1&&this._nextVisibleColumn(t+1)}_nextVisibleColumn(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._nextVisibleColumn(t+1)}prevColumn(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this._prevVisibleColumn(t-1)}_prevVisibleColumn(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._prevVisibleColumn(t-1)}reinitializeWidth(t){this.widthFixed=!1,void 0===this.definition.width||t||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(t),this.dispatch("column-width-fit-after",this)}fitToData(t){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach(t=>{t.clearWidth()}));var e=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach(t=>{var i=t.getWidth();i>e&&(e=i)}),e)){var i=e+1;this.maxInitialWidth&&!t&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(t){var e;return this.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(e=Object.assign(e=Object.assign({},this.getDefinition()),t),this.table.columnManager.addColumn(e,!1,this).then(t=>(e.field==this.field&&(this.field=!1),this.delete().then(()=>t.getComponent()))))}deleteCell(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)}getComponent(){return this.component||(this.component=new lt(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof li&&this.parent.getComponent()}}class ln{constructor(t){return this._row=t,new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._row.table.componentFunctionBinder.handle("row",t._row,e)}})}getData(t){return this._row.getData(t)}getElement(){return this._row.getElement()}getCells(){var t=[];return this._row.getCells().forEach(function(e){t.push(e.getComponent())}),t}getCell(t){var e=this._row.getCell(t);return!!e&&e.getComponent()}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(t){return this._row.watchPosition(t)}delete(){return this._row.delete()}scrollTo(t,e){return this._row.table.rowManager.scrollToRow(this._row,t,e)}move(t,e){this._row.moveToRow(t,e)}update(t){return this._row.updateData(t)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var t=this._row.nextRow();return t?t.getComponent():t}getPrevRow(){var t=this._row.prevRow();return t?t.getComponent():t}}class ls extends aU{constructor(t,e,i="row"){super(e.table),this.parent=e,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(t)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var t=document.createElement("div");t.classList.add("tabulator-row"),t.setAttribute("role","row"),this.element=t}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(t,e){if(this.create(),!this.initialized||t){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,e),t&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,e)}rendered(){this.cells.forEach(t=>{t.cellRendered()})}reinitializeHeight(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(t){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(t){var e=0,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(i=this.calcMinHeight(),e=this.calcMaxHeight(),t?this.height=Math.max(e,i):this.height=this.manualHeight?this.height:Math.max(e,i)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var t=0;return this.cells.forEach(function(e){var i=e.getHeight();i>t&&(t=i)}),t}setCellHeight(){this.cells.forEach(function(t){t.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(t){t.clearHeight()})}normalizeHeight(t){t&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(t),this.setCellHeight()}setHeight(t,e){(this.height!=t||e)&&(this.manualHeight=!0,this.height=t,this.heightStyled=t?t+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight")&&this.dispatchExternal("rowHeight",this.getComponent()))}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)}setData(t){this.data=this.chain("row-data-init-before",[this,t],void 0,t),this.dispatch("row-data-init-after",this)}updateData(t){var e,i=this.element&&aq.elVisible(this.element),n={};return new Promise((s,o)=>{for(let i in"string"==typeof t&&(t=JSON.parse(t)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(n=Object.assign(n=Object.assign(n,this.data),t)),e=this.chain("row-data-changing",[this,n,t],null,t))this.data[i]=e[i];for(let n in this.dispatch("row-data-save-after",this),t)this.table.columnManager.getColumnsByFieldRoot(n).forEach(t=>{let n=this.getCell(t.getField());if(n){let s=t.getFieldValue(e);n.getValue()!==s&&(n.setValueProcessData(s),i&&n.cellRendered())}});i?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,i,t),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s()})}getData(t){return t?this.chain("row-data-retrieve",[this,t],null,this.data):this.data}getCell(t){return t=this.table.columnManager.findColumn(t),this.initialized||0!==this.cells.length||this.generateCells(),this.cells.find(function(e){return e.column===t})}getCellIndex(t){return this.cells.findIndex(function(e){return e===t})}findCell(t){return this.cells.find(e=>e.element===t)}getCells(){return this.initialized||0!==this.cells.length||this.generateCells(),this.cells}nextRow(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}prevRow(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}moveToRow(t,e){var i=this.table.rowManager.findRow(t);i?(this.table.rowManager.moveRowActual(this,i,!e),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",t)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(t){this.detachModules(),this.table.rowManager.deleteRow(this,t),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var t=this.cells.length;for(let e=0;e{t(this.position)}))}watchPosition(t){this.positionWatchers.push(t),t(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new ln(this)),this.component}}var lo={avg:function(t,e,i){var n=0,s=void 0!==i.precision?i.precision:2;return t.length&&(n=t.reduce(function(t,e){return Number(t)+Number(e)})/t.length,n=!1!==s?n.toFixed(s):n),parseFloat(n).toString()},max:function(t,e,i){var n=null,s=void 0!==i.precision&&i.precision;return t.forEach(function(t){((t=Number(t))>n||null===n)&&(n=t)}),null!==n?!1!==s?n.toFixed(s):n:""},min:function(t,e,i){var n=null,s=void 0!==i.precision&&i.precision;return t.forEach(function(t){((t=Number(t))(t||0===e)&&t.indexOf(e)===i).length}};class lr extends aY{static moduleName="columnCalcs";static calculations=lo;constructor(t){super(t),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var t=document.createElement("div");return t.classList.add("tabulator-calcs-holder"),t}initialize(){this.genColumn=new li({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(t){this.recalc(this.table.rowManager.activeRows),t&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(t,e){return this.topRow&&e.unshift(this.topRow),this.botRow&&e.push(this.botRow),e}rowsUpdated(t){this.table.options.groupBy?this.recalcRowGroup(t):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(t){(t.column.definition.topCalc||t.column.definition.bottomCalc)&&(this.table.options.groupBy?(("table"==this.table.options.columnCalcs||"both"==this.table.options.columnCalcs)&&this.recalcActiveRows(),"table"!=this.table.options.columnCalcs&&this.recalcRowGroup(t.row)):this.recalcActiveRows())}initializeColumnCheck(t){(t.definition.topCalc||t.definition.bottomCalc)&&this.initializeColumn(t)}initializeColumn(t){var e=t.definition,i={topCalcParams:e.topCalcParams||{},botCalcParams:e.bottomCalcParams||{}};if(e.topCalc){switch(typeof e.topCalc){case"string":lr.calculations[e.topCalc]?i.topCalc=lr.calculations[e.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.topCalc);break;case"function":i.topCalc=e.topCalc}i.topCalc&&(t.modules.columnCalcs=i,this.topCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(e.bottomCalc){switch(typeof e.bottomCalc){case"string":lr.calculations[e.bottomCalc]?i.botCalc=lr.calculations[e.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.bottomCalc);break;case"function":i.botCalc=e.bottomCalc}i.botCalc&&(t.modules.columnCalcs=i,this.botCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var t=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),t=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),t=!0),t&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){var t=document.createDocumentFragment();this.topInitialized||(t.appendChild(document.createElement("br")),t.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(t,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(t){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=t)}recalc(t){var e,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(e=this.rowsToData(t),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",e),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",e),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))}recalcAll(){(this.topCalcs.length||this.botCalcs.length)&&("group"!==this.table.options.columnCalcs&&this.recalcActiveRows(),this.table.options.groupBy&&"table"!==this.table.options.columnCalcs&&this.table.modules.groupRows.getChildGroups().forEach(t=>{this.recalcGroup(t)}))}recalcGroup(t){var e,i;!this.blockCheck()&&t&&t.calcs&&(t.calcs.bottom&&(e=this.rowsToData(t.rows),i=this.generateRowData("bottom",e),t.calcs.bottom.updateData(i),t.calcs.bottom.reinitialize()),t.calcs.top&&(e=this.rowsToData(t.rows),i=this.generateRowData("top",e),t.calcs.top.updateData(i),t.calcs.top.reinitialize()))}generateTopRow(t){return this.generateRow("top",this.rowsToData(t))}generateBottomRow(t){return this.generateRow("bottom",this.rowsToData(t))}rowsToData(t){var e=[],i=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,n=this.table.modules.dataTree;return t.forEach(t=>{e.push(t.getData()),i&&t.modules.dataTree?.open&&this.rowsToData(n.getFilteredTreeChildren(t)).forEach(i=>{e.push(t)})}),e}generateRow(t,e){var i,n=this.generateRowData(t,e);return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),i=new ls(n,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),i.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),i.component=!1,i.getComponent=()=>(i.component||(i.component=new a9(i)),i.component),i.generateCells=()=>{var e=[];this.table.columnManager.columnsByIndex.forEach(n=>{this.genColumn.setField(n.getField()),this.genColumn.hozAlign=n.hozAlign,n.definition[t+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(n.definition[t+"CalcFormatter"]),params:n.definition[t+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=n.definition.cssClass;var s=new a8(this.genColumn,i);s.getElement(),s.column=n,s.setWidth(),n.cells.push(s),e.push(s),n.visible||s.hide()}),i.cells=e},i}generateRowData(t,e){var i,n,s={},o="top"==t?this.topCalcs:this.botCalcs,r="top"==t?"topCalc":"botCalc";return o.forEach(function(t){var o=[];t.modules.columnCalcs&&t.modules.columnCalcs[r]&&(e.forEach(function(e){o.push(t.getFieldValue(e))}),n=r+"Params",i="function"==typeof t.modules.columnCalcs[n]?t.modules.columnCalcs[n](o,e):t.modules.columnCalcs[n],t.setFieldValue(s,t.modules.columnCalcs[r](o,e,i)))}),s}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var t={};return this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.getGroups(!0).forEach(e=>{t[e.getKey()]=this.getGroupResults(e)}):t={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},t}getGroupResults(t){var e=t._getSelf(),i=t.getSubGroups(),n={};return i.forEach(t=>{n[t.getKey()]=this.getGroupResults(t)}),{top:e.calcs.top?e.calcs.top.getData():{},bottom:e.calcs.bottom?e.calcs.bottom.getData():{},groups:n}}adjustForScrollbar(t){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=t+"px":this.botElement.style.paddingRight=t+"px")}}class la extends aY{static moduleName="dataTree";constructor(t){super(t),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var t=null,e=this.table.options;switch(this.field=e.dataTreeChildField,this.indent=e.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),e.dataTreeBranchElement?!0===e.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof e.dataTreeBranchElement?((t=document.createElement("div")).innerHTML=e.dataTreeBranchElement,this.branchEl=t.firstChild):this.branchEl=e.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),e.dataTreeCollapseElement?"string"==typeof e.dataTreeCollapseElement?((t=document.createElement("div")).innerHTML=e.dataTreeCollapseElement,this.collapseEl=t.firstChild):this.collapseEl=e.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML=""),e.dataTreeExpandElement?"string"==typeof e.dataTreeExpandElement?((t=document.createElement("div")).innerHTML=e.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=e.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML=""),typeof e.dataTreeStartExpanded){case"boolean":this.startOpen=function(t,i){return e.dataTreeStartExpanded};break;case"function":this.startOpen=e.dataTreeStartExpanded;break;default:this.startOpen=function(t,i){return e.dataTreeStartExpanded[i]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(t){t&&this.table.rowManager.getRows().forEach(t=>{this.reinitializeRowChildren(t)})}initializeElementField(){var t=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!t&&t.field}getRowChildren(t){return this.getTreeChildren(t,!0)}columnMoving(){var t=[];return this.table.rowManager.rows.forEach(e=>{t=t.concat(this.getTreeChildren(e,!1,!0))}),t}rowDataChanged(t,e,i){this.redrawNeeded(i)&&(this.initializeRow(t),e&&(this.layoutRow(t),this.refreshData(!0)))}cellValueChanged(t){t.column.getField()===this.elementField&&this.layoutRow(t.row)}initializeRow(t){var e=t.getData()[this.field],i=Array.isArray(e),n=i||!i&&"object"==typeof e&&null!==e;!n&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!n&&t.modules.dataTree&&t.modules.dataTree.controlEl&&t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl),t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:!!n&&(t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0)),controlEl:!!t.modules.dataTree&&!!n&&t.modules.dataTree.controlEl,branchEl:!!t.modules.dataTree&&!!n&&t.modules.dataTree.branchEl,parent:!!t.modules.dataTree&&t.modules.dataTree.parent,children:n}}reinitializeRowChildren(t){this.getTreeChildren(t,!1,!0).forEach(function(t){t.reinitialize(!0)})}layoutRow(t){var e=(this.elementField?t.getCell(this.elementField):t.getCells()[0]).getElement(),i=t.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(t,e),t.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),e.insertBefore(i.branchEl,e.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?e.style.paddingRight=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":e.style.paddingLeft=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}generateControlElement(t,e){var i=t.modules.dataTree,n=i.controlEl;e=e||t.getCells()[0].getElement(),!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",e=>{e.stopPropagation(),this.collapseRow(t)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",e=>{e.stopPropagation(),this.expandRow(t)})),i.controlEl.addEventListener("mousedown",t=>{t.stopPropagation()}),n&&n.parentNode===e?n.parentNode.replaceChild(i.controlEl,n):e.insertBefore(i.controlEl,e.firstChild))}getRows(t){var e=[];return t.forEach((t,i)=>{var n;e.push(t),t instanceof ls&&(t.create(),(n=t.modules.dataTree).index||!1===n.children||this.getChildren(t,!1,!0).forEach(t=>{t.create(),e.push(t)}))}),e}getChildren(t,e,i){var n=t.modules.dataTree,s=[],o=[];return!1!==n.children&&(n.open||e)&&(Array.isArray(n.children)||(n.children=this.generateChildren(t)),s=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(n.children):n.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(s,i),s.forEach(t=>{o.push(t),this.getChildren(t,!1,!0).forEach(t=>{o.push(t)})})),o}generateChildren(t){var e=[],i=t.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(i=>{var n=new ls(i||{},this.table.rowManager);n.create(),n.modules.dataTree.index=t.modules.dataTree.index+1,n.modules.dataTree.parent=t,n.modules.dataTree.children&&(n.modules.dataTree.open=this.startOpen(n.getComponent(),n.modules.dataTree.index)),e.push(n)}),e}expandRow(t,e){var i=t.modules.dataTree;!1!==i.children&&(i.open=!0,t.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",t.getComponent(),t.modules.dataTree.index))}collapseRow(t){var e=t.modules.dataTree;!1!==e.children&&(e.open=!1,t.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",t.getComponent(),t.modules.dataTree.index))}toggleRow(t){var e=t.modules.dataTree;!1!==e.children&&(e.open?this.collapseRow(t):this.expandRow(t))}isRowExpanded(t){return t.modules.dataTree.open}getTreeParent(t){return!!t.modules.dataTree.parent&&t.modules.dataTree.parent.getComponent()}getTreeParentRoot(t){return t.modules.dataTree&&t.modules.dataTree.parent?this.getTreeParentRoot(t.modules.dataTree.parent):t}getFilteredTreeChildren(t){var e=t.modules.dataTree,i=[];return e.children&&(Array.isArray(e.children)||(e.children=this.generateChildren(t)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(e.children):e.children).forEach(t=>{t instanceof ls&&i.push(t)})),i}rowDelete(t){var e,i=t.modules.dataTree.parent;i&&(!1!==(e=this.findChildIndex(t,i))&&i.data[this.field].splice(e,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}addTreeChildRow(t,e,i,n){var s=!1;"string"==typeof e&&(e=JSON.parse(e)),Array.isArray(t.data[this.field])||(t.data[this.field]=[],t.modules.dataTree.open=this.startOpen(t.getComponent(),t.modules.dataTree.index)),void 0!==n&&!1!==(s=this.findChildIndex(n,t))&&t.data[this.field].splice(i?s:s+1,0,e),!1===s&&(i?t.data[this.field].unshift(e):t.data[this.field].push(e)),this.initializeRow(t),this.layoutRow(t),this.refreshData(!0)}findChildIndex(t,e){var i=!1;return"object"==typeof t?t instanceof ls?i=t.data:t instanceof ln?i=t._getSelf().data:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?e.modules.dataTree&&(i=e.modules.dataTree.children.find(e=>e instanceof ls&&e.element===t))&&(i=i.data):null===t&&(i=!1):i=void 0!==t&&e.data[this.field].find(e=>e.data[this.table.options.index]==t),i&&(Array.isArray(e.data[this.field])&&(i=e.data[this.field].indexOf(i)),-1==i&&(i=!1)),i}getTreeChildren(t,e,i){var n=t.modules.dataTree,s=[];return n&&n.children&&(Array.isArray(n.children)||(n.children=this.generateChildren(t)),n.children.forEach(t=>{t instanceof ls&&(s.push(e?t.getComponent():t),i&&this.getTreeChildren(t,e,i).forEach(t=>{s.push(t)}))})),s}getChildField(){return this.field}redrawNeeded(t){return!!this.field&&void 0!==t[this.field]||!!this.elementField&&void 0!==t[this.elementField]}}var ll={csv:function(t,e={},i){var n=e.delimiter?e.delimiter:",",s=[],o=[];t.forEach(t=>{var e=[];switch(t.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":t.columns.forEach((t,e)=>{t&&1===t.depth&&(o[e]=void 0===t.value||null===t.value?"":'"'+String(t.value).split('"').join('""')+'"')});break;case"row":t.columns.forEach(t=>{if(t){switch(typeof t.value){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}e.push('"'+String(t.value).split('"').join('""')+'"')}}),s.push(e.join(n))}}),o.length&&s.unshift(o.join(n)),s=s.join("\n"),e.bom&&(s="\uFEFF"+s),i(s,"text/csv")},json:function(t,e,i){var n=[];t.forEach(t=>{var e={};switch(t.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":t.columns.forEach(t=>{t&&(e[t.component.getTitleDownload()||t.component.getField()]=t.value)}),n.push(e)}}),i(n=JSON.stringify(n,null," "),"application/json")},jsonLines:function(t,e,i){let n=[];t.forEach(t=>{let e={};switch(t.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":t.columns.forEach(t=>{t&&(e[t.component.getTitleDownload()||t.component.getField()]=t.value)}),n.push(JSON.stringify(e))}}),i(n.join("\n"),"application/x-ndjson")},pdf:function(t,e={},i){var n=[],s=[],o={},r=e.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},a=e.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},l=e.jsPDF||{},h=e.title?e.title:"";function c(t,e){var i=[];return t.columns.forEach(t=>{var n;if(t){switch(typeof t.value){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}n={content:t.value,colSpan:t.width,rowSpan:t.height},e&&(n.styles=e),i.push(n)}}),i}l.orientation||(l.orientation=e.orientation||"landscape"),l.unit||(l.unit="pt"),t.forEach(t=>{switch(t.type){case"header":n.push(c(t));break;case"group":s.push(c(t,r));break;case"calc":s.push(c(t,a));break;case"row":s.push(c(t))}});var u=new jspdf.jsPDF(l);e.autoTable&&(o="function"==typeof e.autoTable?e.autoTable(u)||{}:e.autoTable),h&&(o.didDrawPage=function(t){u.text(h,40,30)}),o.head=n,o.body=s,u.autoTable(o),e.documentProcessing&&e.documentProcessing(u),i(u.output("arraybuffer"),"application/pdf")},xlsx:function(t,e,i){var n=e.sheetName||"Sheet1",s=XLSX.utils.book_new(),o=new aU(this),r=!("compress"in e)||e.compress,a=e.writeOptions||{bookType:"xlsx",bookSST:!0,compression:r};function l(){var e=[],i=[],n={},s={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce((t,e)=>t+(e&&e.width?e.width:1),0):0,r:t.length}};return t.forEach((t,n)=>{var s=[];t.columns.forEach(function(t,e){t?(s.push(t.value instanceof Date||"object"!=typeof t.value?t.value:JSON.stringify(t.value)),(t.width>1||t.height>-1)&&(t.height>1||t.width>1)&&i.push({s:{r:n,c:e},e:{r:n+t.height-1,c:e+t.width-1}})):s.push("")}),e.push(s)}),XLSX.utils.sheet_add_aoa(n,e),n["!ref"]=XLSX.utils.encode_range(s),i.length&&(n["!merges"]=i),n}if(a.type="binary",s.SheetNames=[],s.Sheets={},e.sheetOnly){i(l());return}if(e.sheets)for(var h in e.sheets)!0===e.sheets[h]?(s.SheetNames.push(h),s.Sheets[h]=l()):(s.SheetNames.push(h),o.commsSend(e.sheets[h],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(t){s.Sheets[h]=t}}));else s.SheetNames.push(n),s.Sheets[n]=l();e.documentProcessing&&(s=e.documentProcessing(s)),i(function(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),n=0;n!=t.length;++n)i[n]=255&t.charCodeAt(n);return e}(XLSX.write(s,a)),"application/octet-stream")},html:function(t,e,i){this.modExists("export",!0)&&i(this.modules.export.generateHTMLTable(t),"text/html")}};class lh extends aY{static moduleName="download";static downloaders=ll;constructor(t){super(t),this.registerTableOption("downloadEncoder",function(t,e){return new Blob([t],{type:e})}),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}deprecatedOptionsCheck(){}downloadToTab(t,e,i,n){this.download(t,e,i,n,!0)}download(t,e,i,n,s){var o=!1;if("function"==typeof t?o=t:lh.downloaders[t]?o=lh.downloaders[t]:console.warn("Download Error - No such download type found: ",t),o){var r=this.generateExportList(n);o.call(this.table,r,i||{},(function(i,n){s?!0===s?this.triggerDownload(i,n,t,e,!0):s(i):this.triggerDownload(i,n,t,e)}).bind(this))}}generateExportList(t){var e=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,t||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),e.forEach(t=>{var e;"group"===t.type&&(e=t.columns[0],i&&i[t.indent]&&(e.value=i[t.indent](e.value,t.component._group.getRowCount(),t.component._group.getData(),t.component)))}),e}triggerDownload(t,e,i,n,s){var o=document.createElement("a"),r=this.table.options.downloadEncoder(t,e);r&&(s?window.open(window.URL.createObjectURL(r)):(n=n||"Tabulator."+("function"==typeof i?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,n):(o.setAttribute("href",window.URL.createObjectURL(r)),o.setAttribute("download",n),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o))),this.dispatchExternal("downloadComplete"))}commsReceived(t,e,i){"intercept"===e&&this.download(i.type,"",i.options,i.active,i.intercept)}}function lc(t,e){var i=e.mask,n=void 0!==e.maskLetterChar?e.maskLetterChar:"A",s=void 0!==e.maskNumberChar?e.maskNumberChar:"9",o=void 0!==e.maskWildcardChar?e.maskWildcardChar:"*";function r(e){var a=i[e];void 0!==a&&a!==o&&a!==n&&a!==s&&(t.value=t.value+""+a,r(e+1))}t.addEventListener("keydown",e=>{var r=t.value.length,a=e.key;if(e.keyCode>46&&!e.ctrlKey&&!e.metaKey){if(r>=i.length)return e.preventDefault(),e.stopPropagation(),!1;switch(i[r]){case n:if(a.toUpperCase()==a.toLowerCase())return e.preventDefault(),e.stopPropagation(),!1;break;case s:if(isNaN(a))return e.preventDefault(),e.stopPropagation(),!1;break;case o:break;default:if(a!==i[r])return e.preventDefault(),e.stopPropagation(),!1}}}),t.addEventListener("keyup",i=>{i.keyCode>46&&e.maskAutoFill&&r(t.value.length)}),t.placeholder||(t.placeholder=i),e.maskAutoFill&&r(t.value.length)}let lu=class{constructor(t,e,i,n,s,o){this.edit=t,this.table=t.table,this.cell=e,this.params=this._initializeParams(o),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter="header"===e.getType(),this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.filterTerm="",this.blurable=!0,this.actions={success:n,cancel:s},this._deprecatedOptionsCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecatedOptionsCheck(){}_initializeValue(){var t=this.cell.getValue();void 0===t&&void 0!==this.params.defaultValue&&(t=this.params.defaultValue),this.initialValues=this.params.multiselect?t:[t],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}_onRendered(){var t=this.cell.getElement();function e(t){t.stopPropagation()}this.isFilter||(this.input.style.height="100%",this.input.focus({preventScroll:!0})),t.addEventListener("click",e),setTimeout(()=>{t.removeEventListener("click",e)},1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var t=document.createElement("div");return t.classList.add("tabulator-edit-list"),t.addEventListener("mousedown",this._preventBlur.bind(this)),t.addEventListener("keydown",this._inputKeyDown.bind(this)),t}_setListWidth(){var t=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=t.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=t.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var t=this.params.elementAttributes,e=document.createElement("input");if(e.setAttribute("type",this.params.clearable?"search":"text"),e.style.padding="4px",e.style.width="100%",e.style.boxSizing="border-box",this.params.autocomplete||(e.style.cursor="default",e.style.caretColor="transparent"),t&&"object"==typeof t)for(let i in t)"+"==i.charAt(0)?(i=i.slice(1),e.setAttribute(i,e.getAttribute(i)+t["+"+i])):e.setAttribute(i,t[i]);return this.params.mask&&lc(e,this.params),this._bindInputEvents(e),e}_initializeParams(t){var e,i=["values","valuesURL","valuesLookup"];return(t=Object.assign({},t)).verticalNavigation=t.verticalNavigation||"editor",t.placeholderLoading=void 0===t.placeholderLoading?"Searching ...":t.placeholderLoading,t.placeholderEmpty=void 0===t.placeholderEmpty?"No Results Found":t.placeholderEmpty,t.filterDelay=void 0===t.filterDelay?300:t.filterDelay,t.emptyValue=Object.keys(t).includes("emptyValue")?t.emptyValue:"",(e=Object.keys(t).filter(t=>i.includes(t)).length)?e>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),t.autocomplete?t.multiselect&&(t.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(t.freetext&&(t.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),t.filterFunc&&(t.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),t.filterRemote&&(t.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),t.mask&&(t.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),t.allowEmpty&&(t.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),t.listOnEmpty&&(t.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),t.filterRemote&&!("function"==typeof t.valuesLookup||t.valuesURL)&&(t.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),t}_bindInputEvents(t){t.addEventListener("focus",this._inputFocus.bind(this)),t.addEventListener("click",this._inputClick.bind(this)),t.addEventListener("blur",this._inputBlur.bind(this)),t.addEventListener("keydown",this._inputKeyDown.bind(this)),t.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&t.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(t){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(()=>{this.rebuildOptionsList()},this.params.filterDelay)):this._filterList()}_inputClick(t){t.stopPropagation()}_inputBlur(t){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}_inputSearch(){this._clearChoices()}_inputKeyDown(t){switch(t.keyCode){case 38:this._keyUp(t);break;case 40:this._keyDown(t);break;case 37:case 39:this._keySide(t);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(t);break;case 9:this._keyTab(t);break;default:this._keySelectLetter(t)}}_inputKeyUp(t){switch(t.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(t)}}_preventPopupBlur(){this.popup&&this.popup.blockHide(),setTimeout(()=>{this.popup&&this.popup.restoreHide()},10)}_preventBlur(){this.blurable=!1,setTimeout(()=>{this.blurable=!0},10)}_keyTab(t){this.params.autocomplete&&"typing"===this.lastAction?this._resolveValue(!0):this.focusedItem&&this._chooseItem(this.focusedItem,!0)}_keyUp(t){var e=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&e)&&(t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault(),e>0&&this._focusItem(this.displayItems[e-1]))}_keyDown(t){var e=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&e=38&&t.keyCode<=90&&this._scrollToValue(t.keyCode))}_keyAutoCompLetter(t){this._filter(),this.lastAction="typing",this.typing=!0}_scrollToValue(t){clearTimeout(this.filterTimeout);var e=String.fromCharCode(t).toLowerCase();this.filterTerm+=e.toLowerCase();var i=this.displayItems.find(t=>void 0!==t.label&&t.label.toLowerCase().startsWith(this.filterTerm));i&&this._focusItem(i),this.filterTimeout=setTimeout(()=>{this.filterTerm=""},800)}_focusItem(t){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=t,t&&t.element&&(t.element.classList.add("focused"),t.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch(t=>{Number.isInteger(t)||console.error("List generation error",t)})}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(t){var e=[],i=++this.listIteration;return(this.filtered=!1,this.params.values?e=this.params.values:this.params.valuesURL?e=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?e=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(e=this._uniqueColumnValues(this.params.valuesLookupField)),e instanceof Promise)?(t||this._addPlaceholder(this.params.placeholderLoading),e.then().then(t=>this.listIteration===i?this._parseList(t):Promise.reject(i))):Promise.resolve(this._parseList(e))}_addPlaceholder(t){var e=document.createElement("div");"function"==typeof t&&(t=t(this.cell.getComponent(),this.listEl)),t&&(this._clearList(),t instanceof HTMLElement?e=t:(e.classList.add("tabulator-edit-list-placeholder"),e.innerHTML=t),this.listEl.appendChild(e),this._showList())}_ajaxRequest(t,e){var i=this.params.filterRemote?{term:e}:{};return fetch(t=aQ(t,{},i)).then(t=>t.ok?t.json().catch(t=>(console.warn("List Ajax Load Error - Invalid JSON returned",t),Promise.reject(t))):(console.error("List Ajax Load Error - Connection Error: "+t.status,t.statusText),Promise.reject(t))).catch(t=>(console.error("List Ajax Load Error - Connection Error: ",t),Promise.reject(t)))}_uniqueColumnValues(t){var e,i={},n=this.table.getData(this.params.valuesLookup);return(e=t?this.table.columnManager.getColumnByField(t):this.cell.getColumn()._getSelf())?n.forEach(t=>{var n=e.getFieldValue(t);null!=n&&""!==n&&(i[n]=!0)}):(console.warn("unable to find matching column to create select lookup list:",t),i=[]),Object.keys(i)}_parseList(t){var e=[];return Array.isArray(t)||(t=Object.entries(t).map(([t,e])=>({label:e,value:t}))),t.forEach(t=>{"object"!=typeof t&&(t={label:t,value:t}),this._parseListItem(t,e,0)}),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=e,e}_parseListItem(t,e,i){var n={};t.options?n=this._parseListGroup(t,i+1):(n={label:t.label,value:t.value,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:t},this.initialValues&&this.initialValues.indexOf(t.value)>-1&&this._chooseItem(n,!0)),e.push(n)}_parseListGroup(t,e){var i={label:t.label,group:!0,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:!1,visible:!0,level:e,options:[],original:t};return t.options.forEach(t=>{this._parseListItem(t,i.options,e)}),i}_sortOptions(t){var e;return this.params.sort&&(e="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(e,t)),t}_sortGroup(t,e){e.sort((e,i)=>t(e.label,i.label,e.value,i.value,e.original,i.original)),e.forEach(e=>{e.group&&this._sortGroup(t,e.options)})}_defaultSortFunction(t,e){var i,n,s,o,r,a=0,l=/(\d+)|(\D+)/g,h=/\d/,c=0;if("desc"===this.params.sort&&([t,e]=[e,t]),t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if((i=String(t).toLowerCase())===(n=String(e).toLowerCase()))return 0;if(!(h.test(i)&&h.test(n)))return i>n?1:-1;for(i=i.match(l),n=n.match(l),r=i.length>n.length?n.length:i.length;ao?1:-1}return i.length>n.length}c=1}else c=e||0===e?-1:0;return c}_filterOptions(){var t=this.params.filterFunc||this._defaultFilterFunc,e=this.input.value;return e?(this.filtered=!0,this.data.forEach(i=>{this._filterItem(t,e,i)})):this.filtered=!1,this.data}_filterItem(t,e,i){var n=!1;return i.group?(i.options.forEach(i=>{this._filterItem(t,e,i)&&(n=!0)}),i.visible=n):i.visible=t(e,i.label,i.value,i.original),i.visible}_defaultFilterFunc(t,e,i,n){return t=String(t).toLowerCase(),!!(null!=e&&(String(e).toLowerCase().indexOf(t)>-1||String(i).toLowerCase().indexOf(t)>-1))}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(t){this._clearList(),t.forEach(t=>{this._buildItem(t)}),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(t){var e,i=t.element;if(!this.filtered||t.visible){if(!i){if((i=document.createElement("div")).tabIndex=0,(e=this.params.itemFormatter?this.params.itemFormatter(t.label,t.value,t.original,i):t.label)instanceof HTMLElement?i.appendChild(e):i.innerHTML=e,t.group?i.classList.add("tabulator-edit-list-group"):i.classList.add("tabulator-edit-list-item"),i.classList.add("tabulator-edit-list-group-level-"+t.level),t.elementAttributes&&"object"==typeof t.elementAttributes)for(let e in t.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),i.setAttribute(e,this.input.getAttribute(e)+t.elementAttributes["+"+e])):i.setAttribute(e,t.elementAttributes[e]);t.group?i.addEventListener("click",this._groupClick.bind(this,t)):i.addEventListener("click",this._itemClick.bind(this,t)),i.addEventListener("mousedown",this._preventBlur.bind(this)),t.element=i}this._styleItem(t),this.listEl.appendChild(i),t.group?t.options.forEach(t=>{this._buildItem(t)}):this.displayItems.push(t)}}_showList(){var t=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty){this.popup&&this.popup.hide(!0);return}this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),t||setTimeout(()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,!0))},10)}}_styleItem(t){t&&t.element&&(t.selected?t.element.classList.add("active"):t.element.classList.remove("active"))}_itemClick(t,e){e.stopPropagation(),this._chooseItem(t)}_groupClick(t,e){e.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach(t=>{t.selected=!1,this._styleItem(t)}),this.currentItems=[],this.focusedItem=null}_chooseItem(t,e){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(t))>-1?(this.currentItems.splice(i,1),t.selected=!1):(this.currentItems.push(t),t.selected=!0),this.input.value=this.currentItems.map(t=>t.label).join(","),this._styleItem(t)):(this.currentItems=[t],t.selected=!0,this.input.value=t.label,this._styleItem(t),e||this._resolveValue()),this._focusItem(t)}_resolveValue(t){var e,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)e=this.currentItems.map(t=>t.value);else if(t&&this.params.autocomplete&&this.typing){if(this.params.freetext||this.params.allowEmpty&&""===this.input.value)e=this.input.value;else{this.actions.cancel();return}}else e=this.currentItems[0]?this.currentItems[0].value:null==(i=Array.isArray(this.initialValues)?this.initialValues[0]:this.initialValues)||""===i?i:this.params.emptyValue;""===e&&(e=this.params.emptyValue),this.actions.success(e),this.isFilter&&(this.initialValues=e&&!Array.isArray(e)?[e]:e,this.currentItems=[])}};var ld={input:function(t,e,i,n,s){var o=t.getValue(),r=document.createElement("input");if(r.setAttribute("type",s.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",s.elementAttributes&&"object"==typeof s.elementAttributes)for(let t in s.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),r.setAttribute(t,r.getAttribute(t)+s.elementAttributes["+"+t])):r.setAttribute(t,s.elementAttributes[t]);function a(t){null==o&&""!==r.value||r.value!==o?i(r.value)&&(o=r.value):n()}return r.value=void 0!==o?o:"",e(function(){"cell"===t.getType()&&(r.focus({preventScroll:!0}),r.style.height="100%",s.selectContents&&r.select())}),r.addEventListener("change",a),r.addEventListener("blur",a),r.addEventListener("keydown",function(t){switch(t.keyCode){case 13:a();break;case 27:n();break;case 35:case 36:t.stopPropagation()}}),s.mask&&lc(r,s),r},textarea:function(t,e,i,n,s){var o=t.getValue(),r=s.verticalNavigation||"hybrid",a=String(null!=o?o:""),l=document.createElement("textarea"),h=0;if(l.style.display="block",l.style.padding="2px",l.style.height="100%",l.style.width="100%",l.style.boxSizing="border-box",l.style.whiteSpace="pre-wrap",l.style.resize="none",s.elementAttributes&&"object"==typeof s.elementAttributes)for(let t in s.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),l.setAttribute(t,l.getAttribute(t)+s.elementAttributes["+"+t])):l.setAttribute(t,s.elementAttributes[t]);function c(e){null==o&&""!==l.value||l.value!==o?(i(l.value)&&(o=l.value),setTimeout(function(){t.getRow().normalizeHeight()},300)):n()}return l.value=a,e(function(){"cell"===t.getType()&&(l.focus({preventScroll:!0}),l.style.height="100%",l.scrollHeight,l.style.height=l.scrollHeight+"px",t.getRow().normalizeHeight(),s.selectContents&&l.select())}),l.addEventListener("change",c),l.addEventListener("blur",c),l.addEventListener("keyup",function(){l.style.height="";var e=l.scrollHeight;l.style.height=e+"px",e!=h&&(h=e,t.getRow().normalizeHeight())}),l.addEventListener("keydown",function(t){switch(t.keyCode){case 13:t.shiftKey&&s.shiftEnterSubmit&&c();break;case 27:n();break;case 38:("editor"==r||"hybrid"==r&&l.selectionStart)&&(t.stopImmediatePropagation(),t.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&l.selectionStart!==l.value.length)&&(t.stopImmediatePropagation(),t.stopPropagation());break;case 35:case 36:t.stopPropagation()}}),s.mask&&lc(l,s),l},number:function(t,e,i,n,s){var o=t.getValue(),r=s.verticalNavigation||"editor",a=document.createElement("input");if(a.setAttribute("type","number"),void 0!==s.max&&a.setAttribute("max",s.max),void 0!==s.min&&a.setAttribute("min",s.min),void 0!==s.step&&a.setAttribute("step",s.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",s.elementAttributes&&"object"==typeof s.elementAttributes)for(let t in s.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),a.setAttribute(t,a.getAttribute(t)+s.elementAttributes["+"+t])):a.setAttribute(t,s.elementAttributes[t]);a.value=o;var l=function(t){h()};function h(){var t=a.value;isNaN(t)||""===t||(t=Number(t)),t!==o?i(t)&&(o=t):n()}return e(function(){"cell"===t.getType()&&(a.removeEventListener("blur",l),a.focus({preventScroll:!0}),a.style.height="100%",a.addEventListener("blur",l),s.selectContents&&a.select())}),a.addEventListener("keydown",function(t){switch(t.keyCode){case 13:h();break;case 27:n();break;case 38:case 40:"editor"==r&&(t.stopImmediatePropagation(),t.stopPropagation());break;case 35:case 36:t.stopPropagation()}}),s.mask&&lc(a,s),a},range:function(t,e,i,n,s){var o=t.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==s.max&&r.setAttribute("max",s.max),void 0!==s.min&&r.setAttribute("min",s.min),void 0!==s.step&&r.setAttribute("step",s.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",s.elementAttributes&&"object"==typeof s.elementAttributes)for(let t in s.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),r.setAttribute(t,r.getAttribute(t)+s.elementAttributes["+"+t])):r.setAttribute(t,s.elementAttributes[t]);function a(){var t=r.value;isNaN(t)||""===t||(t=Number(t)),t!=o?i(t)&&(o=t):n()}return r.value=o,e(function(){"cell"===t.getType()&&(r.focus({preventScroll:!0}),r.style.height="100%")}),r.addEventListener("blur",function(t){a()}),r.addEventListener("keydown",function(t){switch(t.keyCode){case 13:a();break;case 27:n()}}),r},date:function(t,e,i,n,s){var o=s.format,r=s.verticalNavigation||"editor",a=o?window.DateTime||luxon.DateTime:null,l=t.getValue(),h=document.createElement("input");function c(t){return(a.isDateTime(t)?t:"iso"===o?a.fromISO(String(t)):a.fromFormat(String(t),o)).toFormat("yyyy-MM-dd")}if(h.type="date",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",s.max&&h.setAttribute("max",o?c(s.max):s.max),s.min&&h.setAttribute("min",o?c(s.min):s.min),s.elementAttributes&&"object"==typeof s.elementAttributes)for(let t in s.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),h.setAttribute(t,h.getAttribute(t)+s.elementAttributes["+"+t])):h.setAttribute(t,s.elementAttributes[t]);function u(){var t,e=h.value;if(null==l&&""!==e||e!==l){if(e&&o)switch(t=a.fromFormat(String(e),"yyyy-MM-dd"),o){case!0:e=t;break;case"iso":e=t.toISO();break;default:e=t.toFormat(o)}i(e)&&(l=h.value)}else n()}return l=void 0!==l?l:"",o&&(a?l=c(l):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),h.value=l,e(function(){"cell"===t.getType()&&(h.focus({preventScroll:!0}),h.style.height="100%",s.selectContents&&h.select())}),h.addEventListener("blur",function(t){(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==h)&&u()}),h.addEventListener("keydown",function(t){switch(t.keyCode){case 13:u();break;case 27:n();break;case 35:case 36:t.stopPropagation();break;case 38:case 40:"editor"==r&&(t.stopImmediatePropagation(),t.stopPropagation())}}),h},time:function(t,e,i,n,s){var o=s.format,r=s.verticalNavigation||"editor",a=o?window.DateTime||luxon.DateTime:null,l=t.getValue(),h=document.createElement("input");if(h.type="time",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",s.elementAttributes&&"object"==typeof s.elementAttributes)for(let t in s.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),h.setAttribute(t,h.getAttribute(t)+s.elementAttributes["+"+t])):h.setAttribute(t,s.elementAttributes[t]);function c(){var t,e=h.value;if(null==l&&""!==e||e!==l){if(e&&o)switch(t=a.fromFormat(String(e),"hh:mm"),o){case!0:e=t;break;case"iso":e=t.toISO();break;default:e=t.toFormat(o)}i(e)&&(l=h.value)}else n()}return l=void 0!==l?l:"",o&&(a?l=(a.isDateTime(l)?l:"iso"===o?a.fromISO(String(l)):a.fromFormat(String(l),o)).toFormat("HH:mm"):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),h.value=l,e(function(){"cell"==t.getType()&&(h.focus({preventScroll:!0}),h.style.height="100%",s.selectContents&&h.select())}),h.addEventListener("blur",function(t){(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==h)&&c()}),h.addEventListener("keydown",function(t){switch(t.keyCode){case 13:c();break;case 27:n();break;case 35:case 36:t.stopPropagation();break;case 38:case 40:"editor"==r&&(t.stopImmediatePropagation(),t.stopPropagation())}}),h},datetime:function(t,e,i,n,s){var o,r=s.format,a=s.verticalNavigation||"editor",l=r?window.DateTime||luxon.DateTime:null,h=t.getValue(),c=document.createElement("input");if(c.type="datetime-local",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",s.elementAttributes&&"object"==typeof s.elementAttributes)for(let t in s.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),c.setAttribute(t,c.getAttribute(t)+s.elementAttributes["+"+t])):c.setAttribute(t,s.elementAttributes[t]);function u(){var t,e=c.value;if(null==h&&""!==e||e!==h){if(e&&r)switch(t=l.fromISO(String(e)),r){case!0:e=t;break;case"iso":e=t.toISO();break;default:e=t.toFormat(r)}i(e)&&(h=c.value)}else n()}return h=void 0!==h?h:"",r&&(l?h=(o=l.isDateTime(h)?h:"iso"===r?l.fromISO(String(h)):l.fromFormat(String(h),r)).toFormat("yyyy-MM-dd")+"T"+o.toFormat("HH:mm"):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),c.value=h,e(function(){"cell"===t.getType()&&(c.focus({preventScroll:!0}),c.style.height="100%",s.selectContents&&c.select())}),c.addEventListener("blur",function(t){(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==c)&&u()}),c.addEventListener("keydown",function(t){switch(t.keyCode){case 13:u();break;case 27:n();break;case 35:case 36:t.stopPropagation();break;case 38:case 40:"editor"==a&&(t.stopImmediatePropagation(),t.stopPropagation())}}),c},list:function(t,e,i,n,s){return new lu(this,t,e,i,n,s).input},star:function(t,e,i,n,s){var o=this,r=t.getElement(),a=t.getValue(),l=r.getElementsByTagName("svg").length||5,h=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,c=[],u=document.createElement("div"),d=document.createElementNS("http://www.w3.org/2000/svg","svg");function m(t){c.forEach(function(e,i){i'):("ie"==o.table.browser?e.setAttribute("class","tabulator-star-inactive"):e.classList.replace("tabulator-star-active","tabulator-star-inactive"),e.innerHTML='')})}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",u.style.verticalAlign="middle",u.style.display="inline-block",u.style.padding="4px",d.setAttribute("width",h),d.setAttribute("height",h),d.setAttribute("viewBox","0 0 512 512"),d.setAttribute("xml:space","preserve"),d.style.padding="0 1px",s.elementAttributes&&"object"==typeof s.elementAttributes)for(let t in s.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),u.setAttribute(t,u.getAttribute(t)+s.elementAttributes["+"+t])):u.setAttribute(t,s.elementAttributes[t]);for(var p=1;p<=l;p++)!function(t){var e=document.createElement("span"),n=d.cloneNode(!0);c.push(n),e.addEventListener("mouseenter",function(e){e.stopPropagation(),e.stopImmediatePropagation(),m(t)}),e.addEventListener("mousemove",function(t){t.stopPropagation(),t.stopImmediatePropagation()}),e.addEventListener("click",function(e){e.stopPropagation(),e.stopImmediatePropagation(),i(t),r.blur()}),e.appendChild(n),u.appendChild(e)}(p);return m(a=Math.min(parseInt(a),l)),u.addEventListener("mousemove",function(t){m(0)}),u.addEventListener("click",function(t){i(0)}),r.addEventListener("blur",function(t){n()}),r.addEventListener("keydown",function(t){var e,s;switch(t.keyCode){case 39:a=e=a+1,m(e);break;case 37:a=s=a-1,m(s);break;case 13:i(a);break;case 27:n()}}),u},progress:function(t,e,i,n,s){var o,r,a=t.getElement(),l=void 0===s.max?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("max")||100:s.max,h=void 0===s.min?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("min")||0:s.min,c=(l-h)/100,u=t.getValue()||0,d=document.createElement("div"),m=document.createElement("div");function p(){var t=window.getComputedStyle(a,null),e=c*Math.round(m.offsetWidth/((a.clientWidth-parseInt(t.getPropertyValue("padding-left"))-parseInt(t.getPropertyValue("padding-right")))/100))+h;i(e),a.setAttribute("aria-valuenow",e),a.setAttribute("aria-label",u)}if(d.style.position="absolute",d.style.right="0",d.style.top="0",d.style.bottom="0",d.style.width="5px",d.classList.add("tabulator-progress-handle"),m.style.display="inline-block",m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",s.elementAttributes&&"object"==typeof s.elementAttributes)for(let t in s.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),m.setAttribute(t,m.getAttribute(t)+s.elementAttributes["+"+t])):m.setAttribute(t,s.elementAttributes[t]);return a.style.padding="4px 4px",u=Math.round(((u=Math.max(parseFloat(u=Math.min(parseFloat(u),l)),h))-h)/c),m.style.width=u+"%",a.setAttribute("aria-valuemin",h),a.setAttribute("aria-valuemax",l),m.appendChild(d),d.addEventListener("mousedown",function(t){o=t.screenX,r=m.offsetWidth}),d.addEventListener("mouseover",function(){d.style.cursor="ew-resize"}),a.addEventListener("mousemove",function(t){o&&(m.style.width=r+t.screenX-o+"px")}),a.addEventListener("mouseup",function(t){o&&(t.stopPropagation(),t.stopImmediatePropagation(),o=!1,r=!1,p())}),a.addEventListener("keydown",function(t){switch(t.keyCode){case 39:t.preventDefault(),m.style.width=m.clientWidth+a.clientWidth/100+"px";break;case 37:t.preventDefault(),m.style.width=m.clientWidth-a.clientWidth/100+"px";break;case 9:case 13:p();break;case 27:n()}}),a.addEventListener("blur",function(){n()}),m},tickCross:function(t,e,i,n,s){var o=t.getValue(),r=document.createElement("input"),a=s.tristate,l=void 0===s.indeterminateValue?null:s.indeterminateValue,h=!1,c=Object.keys(s).includes("trueValue"),u=Object.keys(s).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",s.elementAttributes&&"object"==typeof s.elementAttributes)for(let t in s.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),r.setAttribute(t,r.getAttribute(t)+s.elementAttributes["+"+t])):r.setAttribute(t,s.elementAttributes[t]);function d(t){var e=r.checked;return(c&&e?e=s.trueValue:u&&!e&&(e=s.falseValue),a)?t?h?l:e:r.checked&&!h?(r.checked=!1,r.indeterminate=!0,h=!0,l):(h=!1,e):e}return r.value=o,a&&(void 0===o||o===l||""===o)&&(h=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&"safari"!=this.table.browser&&e(function(){"cell"===t.getType()&&r.focus({preventScroll:!0})}),r.checked=c?o===s.trueValue:!0===o||"true"===o||"True"===o||1===o,r.addEventListener("change",function(t){i(d())}),r.addEventListener("blur",function(t){i(d(!0))}),r.addEventListener("keydown",function(t){13==t.keyCode&&i(d()),27==t.keyCode&&n()}),r}};class lm extends aY{static moduleName="edit";static editors=ld;constructor(t){super(t),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.convertEmptyValues=!1,this.editors=lm.editors,this.registerTableOption("editTriggerEvent","focus"),this.registerTableOption("editorEmptyValue"),this.registerTableOption("editorEmptyValueFunc",this.emptyValueCheck.bind(this)),this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("editorEmptyValue"),this.registerColumnOption("editorEmptyValueFunc"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellIsEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("row-layout",this.rowEditableCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("clipboard-paste",this.pasteBlocker.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0)),Object.keys(this.table.options).includes("editorEmptyValue")&&(this.convertEmptyValues=!0)}pasteBlocker(t){if(this.currentCell)return!0}keybindingNavigateNext(t){var e=this.currentCell,i=this.options("tabEndNewRow");e&&!this.navigateNext(e,t)&&i&&(e.getElement().firstChild.blur(),this.invalidEdit||(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(e.row.getComponent())):this.table.addRow(Object.assign({},i))).then(()=>{setTimeout(()=>{e.getComponent().navigateNext()})}))}cellIsEdited(t){return!!t.modules.edit&&t.modules.edit.edited}cellCancelEdit(t){t===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}updateCellClass(t){this.allowEdit(t)?t.getElement().classList.add("tabulator-editable"):t.getElement().classList.remove("tabulator-editable")}clearCellEdited(t){t||(t=this.table.modules.edit.getEditedCells()),Array.isArray(t)||(t=[t]),t.forEach(t=>{this.table.modules.edit.clearEdited(t._getSelf())})}navigatePrev(t=this.currentCell,e){var i,n;if(t){if(e&&e.preventDefault(),i=this.navigateLeft())return!0;if((n=this.table.rowManager.prevDisplayRow(t.row,!0))&&(i=this.findPrevEditableCell(n,n.cells.length)))return i.getComponent().edit(),!0}return!1}navigateNext(t=this.currentCell,e){var i,n;if(t){if(e&&e.preventDefault(),i=this.navigateRight())return!0;if((n=this.table.rowManager.nextDisplayRow(t.row,!0))&&(i=this.findNextEditableCell(n,-1)))return i.getComponent().edit(),!0}return!1}navigateLeft(t=this.currentCell,e){var i,n;return!!(t&&(e&&e.preventDefault(),i=t.getIndex(),n=this.findPrevEditableCell(t.row,i)))&&(n.getComponent().edit(),!0)}navigateRight(t=this.currentCell,e){var i,n;return!!(t&&(e&&e.preventDefault(),i=t.getIndex(),n=this.findNextEditableCell(t.row,i)))&&(n.getComponent().edit(),!0)}navigateUp(t=this.currentCell,e){var i,n;return!!(t&&(e&&e.preventDefault(),i=t.getIndex(),n=this.table.rowManager.prevDisplayRow(t.row,!0)))&&(n.cells[i].getComponent().edit(),!0)}navigateDown(t=this.currentCell,e){var i,n;return!!(t&&(e&&e.preventDefault(),i=t.getIndex(),n=this.table.rowManager.nextDisplayRow(t.row,!0)))&&(n.cells[i].getComponent().edit(),!0)}findNextEditableCell(t,e){var i=!1;if(e0)for(var n=e-1;n>=0;n--){let e=t.cells[n];if(e.column.modules.edit&&aq.elVisible(e.getElement())&&this.allowEdit(e)){i=e;break}}return i}initializeColumnCheck(t){void 0!==t.definition.editor&&this.initializeColumn(t)}columnDeleteCheck(t){this.currentCell&&this.currentCell.column===t&&this.cancelEdit()}rowDeleteCheck(t){this.currentCell&&this.currentCell.row===t&&this.cancelEdit()}rowEditableCheck(t){t.getCells().forEach(t=>{t.column.modules.edit&&"function"==typeof t.column.modules.edit.check&&this.updateCellClass(t)})}initializeColumn(t){var e=Object.keys(t.definition).includes("editorEmptyValue"),i={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{},convertEmptyValues:e,editorEmptyValue:t.definition.editorEmptyValue,editorEmptyValueFunc:t.definition.editorEmptyValueFunc};switch(typeof t.definition.editor){case"string":this.editors[t.definition.editor]?i.editor=this.editors[t.definition.editor]:console.warn("Editor Error - No such editor found: ",t.definition.editor);break;case"function":i.editor=t.definition.editor;break;case"boolean":!0===t.definition.editor&&("function"!=typeof t.definition.formatter?this.editors[t.definition.formatter]?i.editor=this.editors[t.definition.formatter]:i.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter))}i.editor&&(t.modules.edit=i)}getCurrentCell(){return!!this.currentCell&&this.currentCell.getComponent()}clearEditor(t){var e,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,e=i.getElement(),this.dispatch("edit-editor-clear",i,t),e.classList.remove("tabulator-editing");e.firstChild;)e.removeChild(e.firstChild);i.row.getElement().classList.remove("tabulator-editing"),i.table.element.classList.remove("tabulator-editing")}}cancelEdit(){if(this.currentCell){var t=this.currentCell,e=this.currentCell.getComponent();this.clearEditor(!0),t.setValueActual(t.getValue()),t.cellRendered(),("textarea"==t.column.definition.editor||t.column.definition.variableHeight)&&t.row.normalizeHeight(!0),t.column.definition.cellEditCancelled&&t.column.definition.cellEditCancelled.call(this.table,e),this.dispatch("edit-cancelled",t),this.dispatchExternal("cellEditCancelled",e)}}bindEditor(t){if(t.column.modules.edit){var e=this,i=t.getElement(!0);this.updateCellClass(t),i.setAttribute("tabindex",0),i.addEventListener("mousedown",function(t){2===t.button?t.preventDefault():e.mouseClick=!0}),"dblclick"===this.options("editTriggerEvent")&&i.addEventListener("dblclick",function(n){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),e.edit(t,n,!1))}),("focus"===this.options("editTriggerEvent")||"click"===this.options("editTriggerEvent"))&&i.addEventListener("click",function(n){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),e.edit(t,n,!1))}),"focus"===this.options("editTriggerEvent")&&i.addEventListener("focus",function(i){e.recursionBlock||e.edit(t,i,!1)})}}focusCellNoEvent(t,e){this.recursionBlock=!0,e&&"ie"===this.table.browser||t.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(t,e){this.focusCellNoEvent(t),this.edit(t,!1,e)}focusScrollAdjust(t){if("virtual"==this.table.rowManager.getRenderMode()){var e=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,n=t.row.getElement();n.offsetTopi&&(this.table.rowManager.element.scrollTop+=n.offsetTop+n.offsetHeight-i);var s=this.table.rowManager.element.scrollLeft,o=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,r=t.getElement();this.table.modExists("frozenColumns")&&(s+=parseInt(this.table.modules.frozenColumns.leftMargin||0),o-=parseInt(this.table.modules.frozenColumns.rightMargin||0)),"virtual"===this.table.options.renderHorizontal&&(s-=parseInt(this.table.columnManager.renderer.vDomPadLeft),o-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),r.offsetLefto&&(this.table.rowManager.element.scrollLeft+=r.offsetLeft+r.offsetWidth-o)}}allowEdit(t){var e=!!t.column.modules.edit;if(t.column.modules.edit)switch(typeof t.column.modules.edit.check){case"function":t.row.initialized&&(e=t.column.modules.edit.check(t.getComponent()));break;case"string":e=!!t.row.data[t.column.modules.edit.check];break;case"boolean":e=t.column.modules.edit.check}return e}edit(t,e,i){var n,s,o,r=this,a=function(){},l=t.getElement(),h=!1;if(this.currentCell){this.invalidEdit||this.currentCell===t||this.cancelEdit();return}if(t.column.modules.edit.blocked||(e&&e.stopPropagation(),!this.allowEdit(t)&&!i))return this.mouseClick=!1,this.blur(l),!1;if(r.cancelEdit(),r.currentCell=t,this.focusScrollAdjust(t),s=t.getComponent(),this.mouseClick&&(this.mouseClick=!1,t.column.definition.cellClick&&t.column.definition.cellClick.call(this.table,e,s)),t.column.definition.cellEditing&&t.column.definition.cellEditing.call(this.table,s),this.dispatch("cell-editing",t),this.dispatchExternal("cellEditing",s),o="function"==typeof t.column.modules.edit.params?t.column.modules.edit.params(s):t.column.modules.edit.params,n=t.column.modules.edit.editor.call(r,s,function(t){a=t},function(e){if(r.currentCell===t&&!h){var i=r.chain("edit-success",[t,e],!0,!0);return!0===i||"highlight"===r.table.options.validationMode?(h=!0,r.clearEditor(),t.modules.edit||(t.modules.edit={}),t.modules.edit.edited=!0,-1==r.editedCells.indexOf(t)&&r.editedCells.push(t),e=r.transformEmptyValues(e,t),t.setValue(e,!0),!0===i):(h=!0,r.invalidEdit=!0,r.focusCellNoEvent(t,!0),a(),setTimeout(()=>{h=!1},10),!1)}},function(){r.currentCell!==t||h||r.cancelEdit()},o),!this.currentCell||!1===n)return this.blur(l),!1;if(!(n instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",n),this.blur(l),!1;for(l.classList.add("tabulator-editing"),t.row.getElement().classList.add("tabulator-editing"),t.table.element.classList.add("tabulator-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(n),a();for(var c=l.children,u=0;u{t.push(e.getComponent())}),t}clearEdited(t){var e;t.modules.edit&&t.modules.edit.edited&&(t.modules.edit.edited=!1,this.dispatch("edit-edited-clear",t)),(e=this.editedCells.indexOf(t))>-1&&this.editedCells.splice(e,1)}}class lp{constructor(t,e,i,n){this.type=t,this.columns=e,this.component=i||!1,this.indent=n||0}}class lf{constructor(t,e,i,n,s){this.value=t,this.component=e||!1,this.width=i,this.height=n,this.depth=s}}var lg={},lb={visible:function(){return this.rowManager.getVisibleRows(!1,!0)},all:function(){return this.rowManager.rows},selected:function(){return this.modules.selectRow.selectedRows},active:function(){return this.options.pagination?this.rowManager.getDisplayRows(this.rowManager.displayRows.length-2):this.rowManager.getDisplayRows()}};class lv extends aY{static moduleName="export";static columnLookups=lg;static rowLookups=lb;constructor(t){super(t),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.colVisPropAttach="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(t,e,i,n){var s,o,r,a;return this.cloneTableStyle=e,this.config=t||{},this.colVisProp=n,this.colVisPropAttach=this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1),(a=lv.columnLookups[i])&&(r=(r=a.call(this.table)).filter(t=>this.columnVisCheck(t))),s=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders(r)):[],r&&(r=r.map(t=>t.getComponent())),o=this.bodyToExportRows(this.rowLookup(i),r),s.concat(o)}generateTable(t,e,i,n){var s=this.generateExportList(t,e,i,n);return this.generateTableElement(s)}rowLookup(t){var e=[];return"function"==typeof t?t.call(this.table).forEach(t=>{(t=this.table.rowManager.findRow(t))&&e.push(t)}):e=(lv.rowLookups[t]||lv.rowLookups.active).call(this.table),Object.assign([],e)}generateColumnGroupHeaders(t){var e=[];return t||(t=!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex),t.forEach(t=>{var i=this.processColumnGroup(t);i&&e.push(i)}),e}processColumnGroup(t){var e=t.columns,i=0,n={title:t.definition["title"+this.colVisPropAttach]||t.definition.title,column:t,depth:1};if(e.length){if(n.subGroups=[],n.width=0,e.forEach(t=>{var e=this.processColumnGroup(t);e&&(n.width+=e.width,n.subGroups.push(e),e.depth>i&&(i=e.depth))}),n.depth+=i,!n.width)return!1}else{if(!this.columnVisCheck(t))return!1;n.width=1}return n}columnVisCheck(t){var e=t.definition[this.colVisProp];return(!1!==this.config.rowHeaders||!t.isRowHeader)&&(("function"==typeof e&&(e=e.call(this.table,t.getComponent())),!1===e||!0===e)?e:t.visible&&t.field)}headersToExportRows(t){var e=[],i=0,n=[];return t.forEach(function(t){t.depth>i&&(i=t.depth)}),t.forEach(function(t){!function t(n,s){var o=i-s;if(void 0===e[s]&&(e[s]=[]),n.height=n.subGroups?1:o-n.depth+1,e[s].push(n),n.height>1)for(let t=1;t1)for(let t=1;t{var e=[];t.forEach(t=>{if(t){let i=void 0===t.title?"":t.title;e.push(new lf(i,t.column.getComponent(),t.width,t.height,t.depth))}else e.push(null)}),n.push(new lp("header",e))}),n}bodyToExportRows(t,e=[]){var i=[];return 0===e.length&&this.table.columnManager.columnsByIndex.forEach(t=>{this.columnVisCheck(t)&&e.push(t.getComponent())}),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&t.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&t.push(this.table.modules.columnCalcs.botRow)),(t=t.filter(t=>{switch(t.type){case"group":return!1!==this.config.rowGroups;case"calc":return!1!==this.config.columnCalcs;case"row":return!(this.table.options.dataTree&&!1===this.config.dataTree&&t.modules.dataTree.parent)}return!0})).forEach((t,n)=>{var s=t.getData(this.colVisProp),o=[],r=0;switch(t.type){case"group":r=t.level,o.push(new lf(t.key,t.getComponent(),e.length,1));break;case"calc":case"row":e.forEach(t=>{o.push(new lf(t._column.getFieldValue(s),t,1,1))}),this.table.options.dataTree&&!1!==this.config.dataTree&&(r=t.modules.dataTree.index)}i.push(new lp(t.type,o,t.getComponent(),r))}),i}generateTableElement(t){var e=document.createElement("table"),i=document.createElement("thead"),n=document.createElement("tbody"),s=this.lookupTableStyles(),o=this.table.options["rowFormatter"+this.colVisPropAttach],r={};return r.rowFormatter=null!==o?o:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+this.colVisPropAttach],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),e.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),t.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),t.forEach((t,e)=>{let o;switch(t.type){case"header":i.appendChild(this.generateHeaderElement(t,r,s));break;case"group":n.appendChild(this.generateGroupElement(t,r,s));break;case"calc":n.appendChild(this.generateCalcElement(t,r,s));break;case"row":o=this.generateRowElement(t,r,s),this.mapElementStyles(e%2&&s.evenRow?s.evenRow:s.oddRow,o,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n.appendChild(o)}}),i.innerHTML&&e.appendChild(i),e.appendChild(n),this.mapElementStyles(this.table.element,e,["border-top","border-left","border-right","border-bottom"]),e}lookupTableStyles(){var t={};return this.cloneTableStyle&&window.getComputedStyle&&(t.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),t.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),t.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),t.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),t.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],t.firstRow&&(t.styleCells=t.firstRow.getElementsByClassName("tabulator-cell"),t.styleRowHeader=t.firstRow.getElementsByClassName("tabulator-row-header")[0],t.firstCell=t.styleCells[0],t.lastCell=t.styleCells[t.styleCells.length-1])),t}generateHeaderElement(t,e,i){var n=document.createElement("tr");return t.columns.forEach(t=>{if(t){var e=document.createElement("th"),i=t.component._column.definition.cssClass?t.component._column.definition.cssClass.split(" "):[];e.colSpan=t.width,e.rowSpan=t.height,e.innerHTML=t.value,this.cloneTableStyle&&(e.style.boxSizing="border-box"),i.forEach(function(t){e.classList.add(t)}),this.mapElementStyles(t.component.getElement(),e,["text-align","border-left","border-right","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(t.component._column.contentElement,e,["padding-top","padding-left","padding-right","padding-bottom"]),t.component._column.visible?this.mapElementStyles(t.component.getElement(),e,["width"]):t.component._column.definition.width&&(e.style.width=t.component._column.definition.width+"px"),t.component._column.parent&&t.component._column.parent.isGroup?this.mapElementStyles(t.component._column.parent.groupElement,e,["border-top"]):this.mapElementStyles(t.component.getElement(),e,["border-top"]),t.component._column.isGroup?this.mapElementStyles(t.component.getElement(),e,["border-bottom"]):this.mapElementStyles(this.table.columnManager.getElement(),e,["border-bottom"]),n.appendChild(e)}}),n}generateGroupElement(t,e,i){var n=document.createElement("tr"),s=document.createElement("td"),o=t.columns[0];return n.classList.add("tabulator-print-table-row"),e.groupHeader&&e.groupHeader[t.indent]?o.value=e.groupHeader[t.indent](o.value,t.component._group.getRowCount(),t.component._group.getData(),t.component):!1!==e.groupHeader&&(o.value=t.component._group.generator(o.value,t.component._group.getRowCount(),t.component._group.getData(),t.component)),s.colSpan=o.width,s.innerHTML=o.value,n.classList.add("tabulator-print-table-group"),n.classList.add("tabulator-group-level-"+t.indent),o.component.isVisible()&&n.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,s,["padding-top","padding-left","padding-right","padding-bottom"]),n.appendChild(s),n}generateCalcElement(t,e,i){var n=this.generateRowElement(t,e,i);return n.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n}generateRowElement(t,e,i){var n=document.createElement("tr");return n.classList.add("tabulator-print-table-row"),t.columns.forEach((s,o)=>{if(s){var r,a,l=document.createElement("td"),h=s.component._column,c=this.table,u=c.columnManager.findColumnIndex(h),d=s.value,m={modules:{},getValue:function(){return d},getField:function(){return h.definition.field},getElement:function(){return l},getType:function(){return"cell"},getColumn:function(){return h.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getTable:function(){return c},getComponent:function(){return m},column:h};if((h.definition.cssClass?h.definition.cssClass.split(" "):[]).forEach(function(t){l.classList.add(t)}),this.table.modExists("format")&&!1!==this.config.formatCells)d=this.table.modules.format.formatExportValue(m,this.colVisProp);else switch(typeof d){case"object":d=null!==d?JSON.stringify(d):"";break;case"undefined":d=""}d instanceof Node?l.appendChild(d):l.innerHTML=d,a=["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"],h.isRowHeader?(r=i.styleRowHeader,a.push("background-color")):r=i.styleCells&&i.styleCells[u]?i.styleCells[u]:i.firstCell,r&&(this.mapElementStyles(r,l,a),h.definition.align&&(l.style.textAlign=h.definition.align)),this.table.options.dataTree&&!1!==this.config.dataTree&&(e.treeElementField&&e.treeElementField==h.field||!e.treeElementField&&0==o)&&(t.component._row.modules.dataTree.controlEl&&l.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),l.firstChild),t.component._row.modules.dataTree.branchEl&&l.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),l.firstChild)),n.appendChild(l),m.modules.format&&m.modules.format.renderedCallback&&m.modules.format.renderedCallback()}}),e.rowFormatter&&"row"===t.type&&!1!==this.config.formatCells&&(Object.assign(t.component).getElement=function(){return n},e.rowFormatter(t.component)),n}generateHTMLTable(t){var e=document.createElement("div");return e.appendChild(this.generateTableElement(t)),e.innerHTML}getHtml(t,e,i,n){var s=this.generateExportList(i||this.table.options.htmlOutputConfig,e,t,n||"htmlOutput");return this.generateHTMLTable(s)}mapElementStyles(t,e,i){if(this.cloneTableStyle&&t&&e){var n={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var s=window.getComputedStyle(t);i.forEach(function(t){e.style[n[t]]||(e.style[n[t]]=s.getPropertyValue(t))})}}}}var ly={"=":function(t,e,i,n){return e==t},"<":function(t,e,i,n){return e":function(t,e,i,n){return e>t},">=":function(t,e,i,n){return e>=t},"!=":function(t,e,i,n){return e!=t},regex:function(t,e,i,n){return"string"==typeof t&&(t=new RegExp(t)),t.test(e)},like:function(t,e,i,n){return null==t?e===t:null!=e&&String(e).toLowerCase().indexOf(t.toLowerCase())>-1},keywords:function(t,e,i,n){var s=t.toLowerCase().split(void 0===n.separator?" ":n.separator),o=String(null==e?"":e).toLowerCase(),r=[];return s.forEach(t=>{o.includes(t)&&r.push(!0)}),n.matchAll?r.length===s.length:!!r.length},starts:function(t,e,i,n){return null==t?e===t:null!=e&&String(e).toLowerCase().startsWith(t.toLowerCase())},ends:function(t,e,i,n){return null==t?e===t:null!=e&&String(e).toLowerCase().endsWith(t.toLowerCase())},in:function(t,e,i,n){return Array.isArray(t)?!t.length||t.indexOf(e)>-1:(console.warn("Filter Error - filter value is not an array:",t),!1)}};class lw extends aY{static moduleName="filter";static filters=ly;constructor(t){super(t),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerTableOption("placeholderHeaderFilter",!1),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.subscribe("placeholder",this.generatePlaceholder.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach(t=>{var e=this.table.columnManager.findColumn(t.field);if(!e)return console.warn("Column Filter Error - No matching column found:",t.field),!1;this.setHeaderFilterValue(e,t.value)}),this.tableInitialized=!0}remoteFilterParams(t,e,i,n){return n.filter=this.getFilters(!0,!0),n}generatePlaceholder(t){if(this.table.options.placeholderHeaderFilter&&Object.keys(this.headerFilters).length)return this.table.options.placeholderHeaderFilter}userSetFilter(t,e,i,n){this.setFilter(t,e,i,n),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(t,e,i,n){this.addFilter(t,e,i,n),this.refreshFilter()}userSetHeaderFilterFocus(t){var e=this.table.columnManager.findColumn(t);if(!e)return console.warn("Column Filter Focus Error - No matching column found:",t),!1;this.setHeaderFilterFocus(e)}userGetHeaderFilterValue(t){var e=this.table.columnManager.findColumn(t);if(e)return this.getHeaderFilterValue(e);console.warn("Column Filter Error - No matching column found:",t)}userSetHeaderFilterValue(t,e){var i=this.table.columnManager.findColumn(t);if(!i)return console.warn("Column Filter Error - No matching column found:",t),!1;this.setHeaderFilterValue(i,e)}userRemoveFilter(t,e,i){this.removeFilter(t,e,i),this.refreshFilter()}userClearFilter(t){this.clearFilter(t),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(t,e,i){return this.search("rows",t,e,i)}searchData(t,e,i){return this.search("data",t,e,i)}initializeColumnHeaderFilter(t){t.definition.headerFilter&&this.initializeColumn(t)}initializeColumn(t,e){var i=this,n=t.getField();t.modules.filter={success:function(e){var s,o="input"==t.modules.filter.tagType&&"text"==t.modules.filter.attrType||"textarea"==t.modules.filter.tagType?"partial":"match",r="",a="";if(void 0===t.modules.filter.prevSuccess||t.modules.filter.prevSuccess!==e){if(t.modules.filter.prevSuccess=e,t.modules.filter.emptyFunc(e))delete i.headerFilters[n];else{switch(t.modules.filter.value=e,typeof t.definition.headerFilterFunc){case"string":lw.filters[t.definition.headerFilterFunc]?(r=t.definition.headerFilterFunc,s=function(i){var n=t.definition.headerFilterFuncParams||{},s=t.getFieldValue(i);return n="function"==typeof n?n(e,s,i):n,lw.filters[t.definition.headerFilterFunc](e,s,i,n)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":r=s=function(i){var n=t.definition.headerFilterFuncParams||{},s=t.getFieldValue(i);return n="function"==typeof n?n(e,s,i):n,t.definition.headerFilterFunc(e,s,i,n)}}s||("partial"===o?(s=function(i){var n=t.getFieldValue(i);return null!=n&&String(n).toLowerCase().indexOf(String(e).toLowerCase())>-1},r="like"):(s=function(i){return t.getFieldValue(i)==e},r="=")),i.headerFilters[n]={value:e,func:s,type:r}}t.modules.filter.value=e,a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.trackChanges(),i.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)}generateHeaderFilterElement(t,e,i){var n,s,o,r,a,l,h,c,u=this,d=t.modules.filter.success,m=t.getField();if(t.modules.filter.value=e,t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode&&t.contentElement.removeChild(t.modules.filter.headerElement.parentNode),m){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(t){return!t&&0!==t},(n=document.createElement("div")).classList.add("tabulator-header-filter"),typeof t.definition.headerFilter){case"string":u.table.modules.edit.editors[t.definition.headerFilter]?(s=u.table.modules.edit.editors[t.definition.headerFilter],"tick"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(t){return!0!==t&&!1!==t})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":s=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?s=t.modules.edit.editor:t.definition.formatter&&u.table.modules.edit.editors[t.definition.formatter]?(s=u.table.modules.edit.editors[t.definition.formatter],"tick"!==t.definition.formatter&&"tickCross"!==t.definition.formatter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(t){return!0!==t&&!1!==t})):s=u.table.modules.edit.editors.input}if(s){if(r={getValue:function(){return void 0!==e?e:""},getField:function(){return t.definition.field},getElement:function(){return n},getColumn:function(){return t.getComponent()},getTable:()=>this.table,getType:()=>"header",getRow:function(){return{normalizeHeight:function(){}}}},h="function"==typeof(h=t.definition.headerFilterParams||{})?h.call(u.table,r):h,!(o=s.call(this.table.modules.edit,r,function(t){c=t},d,function(){},h))){console.warn("Filter Error - Cannot add filter to "+m+" column, editor returned a value of false");return}if(!(o instanceof Node)){console.warn("Filter Error - Cannot add filter to "+m+" column, editor should return an instance of Node, the editor returned:",o);return}u.langBind("headerFilters|columns|"+t.definition.field,function(e){o.setAttribute("placeholder",void 0!==e&&e?e:t.definition.headerFilterPlaceholder||u.langText("headerFilters|default"))}),o.addEventListener("click",function(t){t.stopPropagation(),o.focus()}),o.addEventListener("focus",t=>{var e=this.table.columnManager.contentsElement.scrollLeft;e!==this.table.rowManager.element.scrollLeft&&(this.table.rowManager.scrollHorizontal(e),this.table.columnManager.scrollHorizontal(e))}),a=!1,l=function(t){a&&clearTimeout(a),a=setTimeout(function(){d(o.value)},u.table.options.headerFilterLiveFilterDelay)},t.modules.filter.headerElement=o,t.modules.filter.attrType=o.hasAttribute("type")?o.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=o.tagName.toLowerCase(),!1!==t.definition.headerFilterLiveFilter&&("autocomplete"===t.definition.headerFilter||"tickCross"===t.definition.headerFilter||("autocomplete"===t.definition.editor||"tickCross"===t.definition.editor)&&!0===t.definition.headerFilter||(o.addEventListener("keyup",l),o.addEventListener("search",l),"number"==t.modules.filter.attrType&&o.addEventListener("change",function(t){d(o.value)}),"text"==t.modules.filter.attrType&&"ie"!==this.table.browser&&o.setAttribute("type","search")),("input"==t.modules.filter.tagType||"select"==t.modules.filter.tagType||"textarea"==t.modules.filter.tagType)&&o.addEventListener("mousedown",function(t){t.stopPropagation()})),n.appendChild(o),t.contentElement.appendChild(n),i||u.headerFilterColumns.push(t),c&&c()}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach(function(t){t.modules.filter&&t.modules.filter.headerElement&&(t.modules.filter.headerElement.style.display="none")})}showHeaderFilterElements(){this.headerFilterColumns.forEach(function(t){t.modules.filter&&t.modules.filter.headerElement&&(t.modules.filter.headerElement.style.display="")})}setHeaderFilterFocus(t){t.modules.filter&&t.modules.filter.headerElement?t.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",t.getField())}getHeaderFilterValue(t){if(t.modules.filter&&t.modules.filter.headerElement)return t.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",t.getField())}setHeaderFilterValue(t,e){t&&(t.modules.filter&&t.modules.filter.headerElement?(this.generateHeaderFilterElement(t,e,!0),t.modules.filter.success(e)):console.warn("Column Filter Error - No header filter set on column:",t.getField()))}reloadHeaderFilter(t){t&&(t.modules.filter&&t.modules.filter.headerElement?this.generateHeaderFilterElement(t,t.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",t.getField()))}refreshFilter(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var t=this.changed;return this.changed=!1,t}setFilter(t,e,i,n){this.filterList=[],Array.isArray(t)||(t=[{field:t,type:e,value:i,params:n}]),this.addFilter(t)}addFilter(t,e,i,n){var s=!1;Array.isArray(t)||(t=[{field:t,type:e,value:i,params:n}]),t.forEach(t=>{(t=this.findFilter(t))&&(this.filterList.push(t),s=!0)}),s&&this.trackChanges()}findFilter(t){if(Array.isArray(t))return this.findSubFilters(t);var e,i=!1;return"function"==typeof t.field?i=function(e){return t.field(e,t.type||{})}:lw.filters[t.type]?i=(e=this.table.columnManager.getColumnByField(t.field))?function(i){return lw.filters[t.type](t.value,e.getFieldValue(i),i,t.params||{})}:function(e){return lw.filters[t.type](t.value,e[t.field],e,t.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",t.type),t.func=i,!!t.func&&t}findSubFilters(t){var e=[];return t.forEach(t=>{(t=this.findFilter(t))&&e.push(t)}),!!e.length&&e}getFilters(t,e){var i=[];return t&&(i=this.getHeaderFilters()),e&&i.forEach(function(t){"function"==typeof t.type&&(t.type="function")}),i=i.concat(this.filtersToArray(this.filterList,e))}filtersToArray(t,e){var i=[];return t.forEach(t=>{var n;Array.isArray(t)?i.push(this.filtersToArray(t,e)):(n={field:t.field,type:t.type,value:t.value},e&&"function"==typeof n.type&&(n.type="function"),i.push(n))}),i}getHeaderFilters(){var t=[];for(var e in this.headerFilters)t.push({field:e,type:this.headerFilters[e].type,value:this.headerFilters[e].value});return t}removeFilter(t,e,i){Array.isArray(t)||(t=[{field:t,type:e,value:i}]),t.forEach(t=>{var e=-1;(e="object"==typeof t.field?this.filterList.findIndex(e=>t===e):this.filterList.findIndex(e=>t.field===e.field&&t.type===e.type&&t.value===e.value))>-1?this.filterList.splice(e,1):console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)}),this.trackChanges()}clearFilter(t){this.filterList=[],t&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(t=>{void 0!==t.modules.filter.value&&delete t.modules.filter.value,t.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(t)}),this.trackChanges()}search(t,e,i,n){var s=[],o=[];return Array.isArray(e)||(e=[{field:e,type:i,value:n}]),e.forEach(t=>{(t=this.findFilter(t))&&o.push(t)}),this.table.rowManager.rows.forEach(e=>{var i=!0;o.forEach(t=>{this.filterRecurse(t,e.getData())||(i=!1)}),i&&s.push("data"===t?e.getData("data"):e.getComponent())}),s}filter(t,e){var i=[],n=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?t.forEach(t=>{this.filterRow(t)&&i.push(t)}):i=t.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach(t=>{n.push(t.getComponent())}),this.dispatchExternal("dataFiltered",this.getFilters(!0),n)),i}filterRow(t,e){var i=!0,n=t.getData();for(var s in this.filterList.forEach(t=>{this.filterRecurse(t,n)||(i=!1)}),this.headerFilters)this.headerFilters[s].func(n)||(i=!1);return i}filterRecurse(t,e){var i=!1;return Array.isArray(t)?t.forEach(t=>{this.filterRecurse(t,e)&&(i=!0)}):i=t.func(e),i}}var l_={plaintext:function(t,e,i){return this.emptyToSpace(this.sanitizeHTML(t.getValue()))},html:function(t,e,i){return t.getValue()},textarea:function(t,e,i){return t.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(t.getValue()))},money:function(t,e,i){var n,s,o,r,a,l=parseFloat(t.getValue()),h="",c=e.decimal||".",u=e.thousand||",",d=e.negativeSign||"-",m=e.symbol||"",p=!!e.symbolAfter,f=void 0!==e.precision?e.precision:2;if(isNaN(l))return this.emptyToSpace(this.sanitizeHTML(t.getValue()));if(l<0&&(l=Math.abs(l),h=d),s=(n=String(n=!1!==f?l.toFixed(f):l).split("."))[0],o=n.length>1?c+n[1]:"",!1!==e.thousand)for(r=/(\d+)(\d{3})/;r.test(s);)s=s.replace(r,"$1"+u+"$2");return(a=s+o,!0===h)?(a="("+a+")",p?a+m:m+a):p?h+a+m:h+m+a},link:function(t,e,i){var n,s=t.getValue(),o=e.urlPrefix||"",r=e.download,a=s,l=document.createElement("a");if(e.labelField&&(n=t.getData(),a=function t(e,i){var n=i[e.shift()];return e.length&&"object"==typeof n?t(e,n):n}(e.labelField.split(this.table.options.nestedFieldSeparator),n)),e.label)switch(typeof e.label){case"string":a=e.label;break;case"function":a=e.label(t)}if(!a)return" ";if(e.urlField&&(n=t.getData(),s=aq.retrieveNestedData(this.table.options.nestedFieldSeparator,e.urlField,n)),e.url)switch(typeof e.url){case"string":s=e.url;break;case"function":s=e.url(t)}return l.setAttribute("href",o+s),e.target&&l.setAttribute("target",e.target),e.download&&(r="function"==typeof r?r(t):!0===r?"":r,l.setAttribute("download",r)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(a)),l},image:function(t,e,i){var n=document.createElement("img"),s=t.getValue();switch(e.urlPrefix&&(s=e.urlPrefix+t.getValue()),e.urlSuffix&&(s+=e.urlSuffix),n.setAttribute("src",s),typeof e.height){case"number":n.style.height=e.height+"px";break;case"string":n.style.height=e.height}switch(typeof e.width){case"number":n.style.width=e.width+"px";break;case"string":n.style.width=e.width}return n.addEventListener("load",function(){t.getRow().normalizeHeight()}),n},tickCross:function(t,e,i){var n=t.getValue(),s=t.getElement(),o=e.allowEmpty,r=e.allowTruthy,a=Object.keys(e).includes("trueValue"),l=void 0!==e.tickElement?e.tickElement:'',h=void 0!==e.crossElement?e.crossElement:'';return a&&n===e.trueValue||!a&&(r&&n||!0===n||"true"===n||"True"===n||1===n||"1"===n)?(s.setAttribute("aria-checked",!0),l||""):o&&("null"===n||""===n||null==n)?(s.setAttribute("aria-checked","mixed"),""):(s.setAttribute("aria-checked",!1),h||"")},datetime:function(t,e,i){var n,s=window.DateTime||luxon.DateTime,o=e.inputFormat||"yyyy-MM-dd HH:mm:ss",r=e.outputFormat||"dd/MM/yyyy HH:mm:ss",a=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",l=t.getValue();if(void 0!==s)return(n=s.isDateTime(l)?l:"iso"===o?s.fromISO(String(l)):s.fromFormat(String(l),o)).isValid?(e.timezone&&(n=n.setZone(e.timezone)),n.toFormat(r)):!0!==a&&l?"function"==typeof a?a(l):a:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(t,e,i){var n,s=window.DateTime||luxon.DateTime,o=e.inputFormat||"yyyy-MM-dd HH:mm:ss",r=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",a=void 0!==e.suffix&&e.suffix,l=void 0!==e.unit?e.unit:"days",h=void 0!==e.humanize&&e.humanize,c=void 0!==e.date?e.date:s.now(),u=t.getValue();if(void 0!==s)return(n=s.isDateTime(u)?u:"iso"===o?s.fromISO(String(u)):s.fromFormat(String(u),o)).isValid?h?n.diff(c,l).toHuman()+(a?" "+a:""):parseInt(n.diff(c,l)[l])+(a?" "+a:""):!0===r?u:"function"==typeof r?r(u):r;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(t,e,i){var n=t.getValue();return void 0===e[n]?(console.warn("Missing display value for "+n),n):e[n]},star:function(t,e,i){var n=t.getValue(),s=t.getElement(),o=e&&e.stars?e.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.style.padding="0 1px",n=Math.max(0,Math.min(n=n&&!isNaN(n)?parseInt(n):0,o));for(var l=1;l<=o;l++){var h=a.cloneNode(!0);h.innerHTML=l<=n?'':'',r.appendChild(h)}return s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",s.setAttribute("aria-label",n),r},traffic:function(t,e,i){var n,s,o=this.sanitizeHTML(t.getValue())||0,r=document.createElement("span"),a=e&&e.max?e.max:100,l=e&&e.min?e.min:0,h=e&&void 0!==e.color?e.color:["red","orange","green"],c="#666666";if(!isNaN(o)&&void 0!==t.getValue()){switch(r.classList.add("tabulator-traffic-light"),s=parseFloat(s=parseFloat(o)<=a?parseFloat(o):a)>=l?parseFloat(s):l,n=(a-l)/100,s=Math.round((s-l)/n),typeof h){case"string":c=h;break;case"function":c=h(o);break;case"object":if(Array.isArray(h)){var u=Math.floor(s/(100/h.length));u=Math.max(u=Math.min(u,h.length-1),0),c=h[u]}}return r.style.backgroundColor=c,r}},progress:function(t,e={},i){var n,s,o,r,a,l=this.sanitizeHTML(t.getValue())||0,h=t.getElement(),c=e.max?e.max:100,u=e.min?e.min:0,d=e.legendAlign?e.legendAlign:"center";switch(s=parseFloat(s=parseFloat(l)<=c?parseFloat(l):c)>=u?parseFloat(s):u,n=(c-u)/100,s=Math.round((s-u)/n),typeof e.color){case"string":o=e.color;break;case"function":o=e.color(l);break;case"object":if(Array.isArray(e.color)){let t=Math.floor(s/(100/e.color.length));t=Math.max(t=Math.min(t,e.color.length-1),0),o=e.color[t];break}default:o="#2DC214"}switch(typeof e.legend){case"string":r=e.legend;break;case"function":r=e.legend(l);break;case"boolean":r=l;break;default:r=!1}switch(typeof e.legendColor){case"string":a=e.legendColor;break;case"function":a=e.legendColor(l);break;case"object":if(Array.isArray(e.legendColor)){let t=Math.floor(s/(100/e.legendColor.length));t=Math.max(t=Math.min(t,e.legendColor.length-1),0),a=e.legendColor[t]}break;default:a="#000"}h.style.minWidth="30px",h.style.position="relative",h.setAttribute("aria-label",s);var m=document.createElement("div");m.style.display="inline-block",m.style.width=s+"%",m.style.backgroundColor=o,m.style.height="100%",m.setAttribute("data-max",c),m.setAttribute("data-min",u);var p=document.createElement("div");if(p.style.position="relative",p.style.width="100%",p.style.height="100%",r){var f=document.createElement("div");f.style.position="absolute",f.style.top=0,f.style.left=0,f.style.textAlign=d,f.style.width="100%",f.style.color=a,f.innerHTML=r}return i(function(){if(!(t instanceof a7)){var e=document.createElement("div");e.style.position="absolute",e.style.top="4px",e.style.bottom="4px",e.style.left="4px",e.style.right="4px",h.appendChild(e),h=e}h.appendChild(p),p.appendChild(m),r&&p.appendChild(f)}),""},color:function(t,e,i){return t.getElement().style.backgroundColor=this.sanitizeHTML(t.getValue()),""},buttonTick:function(t,e,i){return''},buttonCross:function(t,e,i){return''},toggle:function(t,e,i){var n,s,o=t.getValue(),r=e.size||15,a=r+"px",l=!e.hasOwnProperty("onValue")||e.onValue,h=!!e.hasOwnProperty("offValue")&&e.offValue,c=e.onTruthy?o:o===l;return(n=document.createElement("div")).classList.add("tabulator-toggle"),c?(n.classList.add("tabulator-toggle-on"),n.style.flexDirection="row-reverse",e.onColor&&(n.style.background=e.onColor)):e.offColor&&(n.style.background=e.offColor),n.style.width=2.5*r+"px",n.style.borderRadius=a,e.clickable&&n.addEventListener("click",e=>{t.setValue(c?h:l)}),(s=document.createElement("div")).classList.add("tabulator-toggle-switch"),s.style.height=a,s.style.width=a,s.style.borderRadius=a,n.appendChild(s),n},rownum:function(t,e,i){var n=document.createElement("span"),s=t.getRow(),o=t.getTable();return s.watchPosition(t=>{e.relativeToPage&&(t+=o.modules.page.getPageSize()*(o.modules.page.getPage()-1)),n.innerText=t}),n},handle:function(t,e,i){return t.getElement().classList.add("tabulator-row-handle"),""}};class lC extends aY{static moduleName="format";static formatters=l_;constructor(t){super(t),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(t){t.modules.format=this.lookupFormatter(t,""),void 0!==t.definition.formatterPrint&&(t.modules.format.print=this.lookupFormatter(t,"Print")),void 0!==t.definition.formatterClipboard&&(t.modules.format.clipboard=this.lookupFormatter(t,"Clipboard")),void 0!==t.definition.formatterHtmlOutput&&(t.modules.format.htmlOutput=this.lookupFormatter(t,"HtmlOutput"))}lookupFormatter(t,e){var i={params:t.definition["formatter"+e+"Params"]||{}},n=t.definition["formatter"+e];switch(typeof n){case"string":lC.formatters[n]?i.formatter=lC.formatters[n]:(console.warn("Formatter Error - No such formatter found: ",n),i.formatter=lC.formatters.plaintext);break;case"function":i.formatter=n;break;default:i.formatter=lC.formatters.plaintext}return i}cellRendered(t){t.modules.format&&t.modules.format.renderedCallback&&!t.modules.format.rendered&&(t.modules.format.renderedCallback(),t.modules.format.rendered=!0)}formatHeader(t,e,i){var n,s,o,r;return t.definition.titleFormatter?(n=this.getFormatter(t.definition.titleFormatter),o=e=>{t.titleFormatterRendered=e},r={getValue:function(){return e},getElement:function(){return i},getType:function(){return"header"},getColumn:function(){return t.getComponent()},getTable:()=>this.table},s="function"==typeof(s=t.definition.titleFormatterParams||{})?s():s,n.call(this,r,s,o)):e}formatValue(t){var e=t.getComponent(),i="function"==typeof t.column.modules.format.params?t.column.modules.format.params(e):t.column.modules.format.params;return t.column.modules.format.formatter.call(this,e,i,function(e){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=e,t.modules.format.rendered=!1})}formatExportValue(t,e){var i,n=t.column.modules.format[e];return n?(i="function"==typeof n.params?n.params(t.getComponent()):n.params,n.formatter.call(this,t.getComponent(),i,function(e){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=e,t.modules.format.rendered=!1})):this.formatValue(t)}sanitizeHTML(t){if(!t)return t;var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=/]/g,function(t){return e[t]})}emptyToSpace(t){return null==t||""===t?" ":t}getFormatter(t){switch(typeof t){case"string":lC.formatters[t]?t=lC.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=lC.formatters.plaintext);break;case"function":break;default:t=lC.formatters.plaintext}return t}}class lE extends aY{static moduleName="frozenColumns";constructor(t){super(t),this.leftColumns=[],this.rightColumns=[],this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-deleted",this.reinitializeColumns.bind(this)),this.subscribe("column-hide",this.reinitializeColumns.bind(this)),this.subscribe("column-show",this.reinitializeColumns.bind(this)),this.subscribe("columns-loaded",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(t){this.layoutElement(t.element,t.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach(t=>{this.initializeColumn(t)}),this.layout()}initializeColumn(t){var e={margin:0,edge:!1};t.isGroup||(this.frozenCheck(t)?(e.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(t):this.rightColumns.unshift(t),this.active=!0,t.modules.frozen=e):this.initializationMode="right")}frozenCheck(t){return(t.parent.isGroup&&t.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),t.parent.isGroup)?this.frozenCheck(t.parent):t.definition.frozen}layoutCalcRows(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(t){t.forEach(t=>{t.calcs.top&&this.layoutRow(t.calcs.top),t.calcs.bottom&&this.layoutRow(t.calcs.bottom),t.groupList&&t.groupList.length&&this.layoutGroupCalcs(t.groupList)})}layoutColumnPosition(t){var e=[],i=0,n=0;this.leftColumns.forEach((n,s)=>{if(n.modules.frozen.marginValue=i,n.modules.frozen.margin=n.modules.frozen.marginValue+"px",n.visible&&(i+=n.getWidth()),s==this.leftColumns.length-1?n.modules.frozen.edge=!0:n.modules.frozen.edge=!1,n.parent.isGroup){var o=this.getColGroupParentElement(n);e.includes(o)||(this.layoutElement(o,n),e.push(o)),o.classList.toggle("tabulator-frozen-left",n.modules.frozen.edge&&"left"===n.modules.frozen.position),o.classList.toggle("tabulator-frozen-right",n.modules.frozen.edge&&"right"===n.modules.frozen.position)}else this.layoutElement(n.getElement(),n);t&&n.cells.forEach(t=>{this.layoutElement(t.getElement(!0),n)})}),this.rightColumns.forEach((e,i)=>{e.modules.frozen.marginValue=n,e.modules.frozen.margin=e.modules.frozen.marginValue+"px",e.visible&&(n+=e.getWidth()),i==this.rightColumns.length-1?e.modules.frozen.edge=!0:e.modules.frozen.edge=!1,e.parent.isGroup?this.layoutElement(this.getColGroupParentElement(e),e):this.layoutElement(e.getElement(),e),t&&e.cells.forEach(t=>{this.layoutElement(t.getElement(!0),e)})})}getColGroupParentElement(t){return t.parent.isGroup?this.getColGroupParentElement(t.parent):t.getElement()}layout(){this.active&&!this.blocked&&(this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var t=this.table.rowManager.getVisibleRows(!0);this.table.rowManager.getRows().filter(e=>!t.includes(e)).forEach(t=>{t.deinitialize()}),t.forEach(t=>{"row"===t.type&&this.layoutRow(t)})}layoutRow(t){"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach(e=>{var i=t.getCell(e);i&&this.layoutElement(i.getElement(!0),e)}),this.rightColumns.forEach(e=>{var i=t.getCell(e);i&&this.layoutElement(i.getElement(!0),e)})}layoutElement(t,e){var i;e.modules.frozen&&t&&(t.style.position="sticky",i=this.table.rtl?"left"===e.modules.frozen.position?"right":"left":e.modules.frozen.position,t.style[i]=e.modules.frozen.margin,t.classList.add("tabulator-frozen"),t.classList.toggle("tabulator-frozen-left",e.modules.frozen.edge&&"left"===e.modules.frozen.position),t.classList.toggle("tabulator-frozen-right",e.modules.frozen.edge&&"right"===e.modules.frozen.position))}adjustForScrollbar(t){this.rightColumns.length&&(this.table.columnManager.getContentsElement().style.width="calc(100% - "+t+"px)")}getFrozenColumns(){return this.leftColumns.concat(this.rightColumns)}_calcSpace(t,e){var i=0;for(let n=0;n{this.initializeRow(t)})}initializeRow(t){var e=this.table.options.frozenRows,i=typeof e;"number"===i?t.getPosition()&&t.getPosition()+this.rows.length<=e&&this.freezeRow(t):"function"===i?e.call(this.table,t.getComponent())&&this.freezeRow(t):Array.isArray(e)&&e.includes(t.data[this.options("frozenRowsField")])&&this.freezeRow(t)}isRowFrozen(t){return this.rows.indexOf(t)>-1}isFrozen(){return!!this.rows.length}visibleRows(t,e){return this.rows.forEach(t=>{e.push(t)}),e}getRows(t){var e=t.slice(0);return this.rows.forEach(function(t){var i=e.indexOf(t);i>-1&&e.splice(i,1)}),e}freezeRow(t){t.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(t.modules.frozen=!0,this.topElement.appendChild(t.getElement()),t.initialize(),t.normalizeHeight(),this.rows.push(t),this.refreshData(!1,"display"),this.table.rowManager.adjustTableSize(),this.styleRows())}unfreezeRow(t){t.modules.frozen?(t.modules.frozen=!1,this.detachRow(t),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(t){var e=this.rows.indexOf(t);if(e>-1){var i=t.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(e,1)}}styleRows(t){this.rows.forEach((t,e)=>{this.table.rowManager.styleRow(t,e)})}}class lT{constructor(t){return this._group=t,this.type="GroupComponent",new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._group.groupManager.table.componentFunctionBinder.handle("group",t._group,e)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return!!this._group.parent&&this._group.parent.getComponent()}isVisible(){return this._group.visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}scrollTo(t,e){return this._group.groupManager.table.rowManager.scrollToRow(this._group,t,e)}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class lk{constructor(t,e,i,n,s,o,r){this.groupManager=t,this.parent=e,this.key=n,this.level=i,this.field=s,this.hasSubGroups=i{t.modules&&delete t.modules.group})),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var t=document.createElement("div");t.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(t),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var t=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]&&this.groupManager.allowedValues[t].forEach(e=>{this._createGroup(e,t)})}addBindings(){this.groupManager.table.options.groupToggleElement&&("arrow"==this.groupManager.table.options.groupToggleElement?this.arrowElement:this.element).addEventListener("click",t=>{"arrow"===this.groupManager.table.options.groupToggleElement&&(t.stopPropagation(),t.stopImmediatePropagation()),setTimeout(()=>{this.toggleVisibility()})})}_createGroup(t,e){var i=e+"_"+t,n=new lk(this.groupManager,this,e,t,this.groupManager.groupIDLookups[e].field,this.groupManager.headerGenerator[e]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[i]);this.groups[i]=n,this.groupList.push(n)}_addRowToGroup(t){var e=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[e].func(t.getData()),n=e+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]?this.groups[n]&&this.groups[n].addRow(t):(this.groups[n]||this._createGroup(i,e),this.groups[n].addRow(t))}}_addRow(t){this.rows.push(t),t.modules.group=this}insertRow(t,e,i){var n=this.conformRowData({});t.updateData(n);var s=this.rows.indexOf(e);s>-1?i?this.rows.splice(s+1,0,t):this.rows.splice(s,0,t):i?this.rows.push(t):this.rows.unshift(t),t.modules.group=this,this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(t){this.arrowElement&&(this.arrowElement.style.marginLeft=t,this.groupList.forEach(function(e){e.scrollHeader(t)}))}getRowIndex(t){}conformRowData(t){return this.field?t[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(t=this.parent.conformRowData(t)),t}removeRow(t){var e=this.rows.indexOf(t),i=t.getElement();e>-1&&this.rows.splice(e,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),!this.groupManager.blockRedraw&&(this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this))):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}removeGroup(t){var e,i=t.level+"_"+t.key;this.groups[i]&&(delete this.groups[i],(e=this.groupList.indexOf(t))>-1&&this.groupList.splice(e,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(){var t=[];return t.push(this),this._visSet(),this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.visible?this.groupList.length?this.groupList.forEach(function(e){t=t.concat(e.getHeadersAndRows())}):("table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):!this.groupList.length&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&(this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))),t}getData(t,e){var i=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach(t=>{i.push(t.getData(e||"data"))}),i}getRowCount(){var t=0;return this.groupList.length?this.groupList.forEach(e=>{t+=e.getRowCount()}):t=this.rows.length,t}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination||(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(t=>{t.getHeadersAndRows().forEach(t=>{t.detachElement()})}):this.rows.forEach(t=>{var e=t.getElement();e.parentNode.removeChild(e)})),this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var t=this.generateElement();this.groupList.length?this.groupList.forEach(e=>{e.getHeadersAndRows().forEach(e=>{var i=e.getElement();t.parentNode.insertBefore(i,t.nextSibling),e.initialize(),t=i})}):this.rows.forEach(e=>{var i=e.getElement();t.parentNode.insertBefore(i,t.nextSibling),e.initialize(),t=i}),this.groupManager.updateGroupRows(!0)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){var t=[];"function"==typeof this.visible&&(this.rows.forEach(function(e){t.push(e.getData())}),this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent()))}getRowGroup(t){var e=!1;return this.groupList.length?this.groupList.forEach(function(i){var n=i.getRowGroup(t);n&&(e=n)}):this.rows.find(function(e){return e===t})&&(e=this),e}getSubGroups(t){var e=[];return this.groupList.forEach(function(i){e.push(t?i.getComponent():i)}),e}getRows(t,e){var i=[];return e&&this.groupList.length?this.groupList.forEach(n=>{i=i.concat(n.getRows(t,e))}):this.rows.forEach(function(e){i.push(t?e.getComponent():e)}),i}generateGroupHeaderContents(){var t=[];for(this.getRows(!1,!0).forEach(function(e){t.push(e.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(t=[]){return t.unshift(this.key),this.parent&&this.parent.getPath(t),t}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var t=0;ti.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",(t,e)=>{this.headerGenerator[0]=(i,n,s)=>(void 0===i?"":i)+"("+n+" "+(1===n?t:e.groups.items)+")"}),this.groupIDLookups=[],t?this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs():this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs&&this.table.columnManager.getRealColumns().forEach(t=>{t.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()}),Array.isArray(t)||(t=[t]),t.forEach((t,e)=>{var i,n;i="function"==typeof t?t:(n=this.table.columnManager.getColumnByField(t))?function(t){return n.getFieldValue(t)}:function(e){return e[t]},this.groupIDLookups.push({field:"function"!=typeof t&&t,func:i,values:!!this.allowedValues&&this.allowedValues[e]})}),e&&(Array.isArray(e)||(e=[e]),e.forEach(t=>{}),this.startOpen=e),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}else this.groupList=[],this.groups={}}rowSample(t,e){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];e.push(i.getRows(!1)[0])}return e}virtualRenderFill(){var t=this.table.rowManager.tableElement,e=this.table.rowManager.getVisibleRows();if(!this.table.options.groupBy)return e;e=e.filter(t=>"group"!==t.type),t.style.minWidth=e.length?"":this.table.columnManager.getWidth()+"px"}rowAddingIndex(t,e,i){if(this.table.options.groupBy){this.assignRowToGroup(t);var n=t.modules.group.rows;return n.length>1&&(!e||e&&-1==n.indexOf(e)?i?n[0]!==t&&(e=n[0],this.table.rowManager.moveRowInArray(t.modules.group.rows,t,e,!i)):n[n.length-1]!==t&&(e=n[n.length-1],this.table.rowManager.moveRowInArray(t.modules.group.rows,t,e,!i)):this.table.rowManager.moveRowInArray(t.modules.group.rows,t,e,!i)),e}}trackChanges(){this.dispatch("group-changed")}setGroupBy(t){this.table.options.groupBy=t,this.initialized||this.initialize(),this.configureGroupSetup(),!t&&this.table.modExists("columnCalcs")&&!0===this.table.options.columnCalcs&&this.table.modules.columnCalcs.reinitializeCalcs(),this.refreshData(),this.trackChanges()}setGroupValues(t){this.table.options.groupValues=t,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(t){this.table.options.groupStartOpen=t,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(t){this.table.options.groupHeader=t,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(t){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(t){return!!t.modules.group&&t.modules.group.getComponent()}rowMoving(t,e,i){if(this.table.options.groupBy){!i&&e instanceof lk&&(e=this.table.rowManager.prevDisplayRow(t)||e);var n=e instanceof lk?e:e.modules.group,s=t instanceof lk?t:t.modules.group;n===s?this.table.rowManager.moveRowInArray(n.rows,t,e,i):(s&&s.removeRow(t),n.insertRow(t,e,i))}}rowDeleting(t){this.table.options.groupBy&&t.modules.group&&t.modules.group.removeRow(t)}rowsUpdated(t){this.table.options.groupBy&&this.updateGroupRows(!0)}cellUpdated(t){this.table.options.groupBy&&this.reassignRowToGroup(t.row)}getRows(t){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(t),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):t.slice(0)}getGroups(t){var e=[];return this.groupList.forEach(function(i){e.push(t?i.getComponent():i)}),e}getChildGroups(t){var e=[];return t||(t=this),t.groupList.forEach(t=>{t.groupList.length?e=e.concat(this.getChildGroups(t)):e.push(t)}),e}wipe(){this.table.options.groupBy&&(this.groupList.forEach(function(t){t.wipe()}),this.groupList=[],this.groups={})}pullGroupListData(t){var e=[];return t.forEach(t=>{var i={};i.level=0,i.rowCount=0,i.headerContent="";var n=[];t.hasSubGroups?(n=this.pullGroupListData(t.groupList),i.level=t.level,i.rowCount=n.length-t.groupList.length,i.headerContent=t.generator(t.key,i.rowCount,t.rows,t),e.push(i),e=e.concat(n)):(i.level=t.level,i.headerContent=t.generator(t.key,t.rows.length,t.rows,t),i.rowCount=t.getRows().length,e.push(i),t.getRows().forEach(t=>{e.push(t.getData("data"))}))}),e}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(t){var e=!1;return this.options("dataTree")&&(t=this.table.modules.dataTree.getTreeParentRoot(t)),this.groupList.forEach(i=>{var n=i.getRowGroup(t);n&&(e=n)}),e}countGroups(){return this.groupList.length}generateGroups(t){var e=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(t=>{this.createGroup(t,0,e)}),t.forEach(t=>{this.assignRowToExistingGroup(t,e)})):t.forEach(t=>{this.assignRowToGroup(t,e)}),Object.values(e).forEach(t=>{t.wipe(!0)})}createGroup(t,e,i){var n,s=e+"_"+t;i=i||[],n=new lk(this,!1,e,t,this.groupIDLookups[0].field,this.headerGenerator[0],i[s]),this.groups[s]=n,this.groupList.push(n)}assignRowToExistingGroup(t,e){var i="0_"+this.groupIDLookups[0].func(t.getData());this.groups[i]&&this.groups[i].addRow(t)}assignRowToGroup(t,e){var i=this.groupIDLookups[0].func(t.getData()),n=!this.groups["0_"+i];return n&&this.createGroup(i,0,e),this.groups["0_"+i].addRow(t),!n}reassignRowToGroup(t){if("row"===t.type){var e=t.modules.group,i=e.getPath(),n=this.getExpectedPath(t);i.length==n.length&&i.every((t,e)=>t===n[e])||(e.removeRow(t),this.assignRowToGroup(t,this.groups),this.refreshData(!0))}}getExpectedPath(t){var e=[],i=t.getData();return this.groupIDLookups.forEach(t=>{e.push(t.func(i))}),e}updateGroupRows(t){var e=[];return!this.blockRedraw&&(this.groupList.forEach(t=>{e=e.concat(t.getHeadersAndRows())}),t&&this.refreshData(!0)),e}scrollHeaders(t){this.table.options.groupBy&&("virtual"===this.table.options.renderHorizontal&&(t-=this.table.columnManager.renderer.vDomPadLeft),t+="px",this.groupList.forEach(e=>{e.scrollHeader(t)}))}removeGroup(t){var e,i=t.level+"_"+t.key;this.groups[i]&&(delete this.groups[i],(e=this.groupList.indexOf(t))>-1&&this.groupList.splice(e,1))}checkBasicModeGroupHeaderWidth(){var t=this.table.rowManager.tableElement,e=!0;this.table.rowManager.getDisplayRows().forEach((i,n)=>{this.table.rowManager.styleRow(i,n),t.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(e=!1)}),e?t.style.minWidth=this.table.columnManager.getWidth()+"px":t.style.minWidth=""}}var lL={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue),t.component.cellRendered()},rowAdd:function(t){t.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowDelete:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,e),this.table.rowManager.checkPlaceholder()},rowMove:function(t){var e=t.data.posFrom-t.data.posTo>0;this.table.rowManager.moveRowActual(t.component,this.table.rowManager.getRowFromPosition(t.data.posFrom),e),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},lM={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue),t.component.cellRendered()},rowAdd:function(t){var e=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(t.component,e),this.table.rowManager.checkPlaceholder()},rowDelete:function(t){t.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.getRowFromPosition(t.data.posTo),t.data.after),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},lR={keybindings:{bindings:{undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"]},actions:{undo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&!this.table.modules.edit.currentCell&&(t.preventDefault(),this.table.modules.history.undo())},redo:function(t){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&!this.table.modules.edit.currentCell&&(t.preventDefault(),this.table.modules.history.redo())}}}};class lP extends aY{static moduleName="history";static moduleExtensions=lR;static undoers=lL;static redoers=lM;constructor(t){super(t),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(t,e,i){this.action("rowMove",t,{posFrom:t.getPosition(),posTo:e.getPosition(),to:e,after:i})}rowAdded(t,e,i,n){this.action("rowAdd",t,{data:e,pos:i,index:n})}rowDeleted(t){var e,i;this.table.options.groupBy?(e=(i=t.getComponent().getGroup()._getSelf().rows).indexOf(t))&&(e=i[e-1]):(e=t.table.rowManager.getRowIndex(t))&&(e=t.table.rowManager.rows[e-1]),this.action("rowDelete",t,{data:t.getData(),pos:!e,index:e})}cellUpdated(t){this.action("cellEdit",t,{oldValue:t.oldValue,newValue:t.value})}clear(){this.history=[],this.index=-1}action(t,e,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:e,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(t){var e=this.history.findIndex(function(e){return e.component===t});e>-1&&(this.history.splice(e,1),e<=this.index&&this.index--,this.clearComponentHistory(t))}undo(){if(!(this.index>-1))return console.warn(this.options("history")?"History Undo Error - No more history to undo":"History module not enabled"),!1;{let t=this.history[this.index];return lP.undoers[t.type].call(this,t),this.index--,this.dispatchExternal("historyUndo",t.type,t.component.getComponent(),t.data),!0}}redo(){if(!(this.history.length-1>this.index))return console.warn(this.options("history")?"History Redo Error - No more history to redo":"History module not enabled"),!1;{this.index++;let t=this.history[this.index];return lP.redoers[t.type].call(this,t),this.dispatchExternal("historyRedo",t.type,t.component.getComponent(),t.data),!0}}_rebindRow(t,e){this.history.forEach(function(i){if(i.component instanceof ls)i.component===t&&(i.component=e);else if(i.component instanceof a8&&i.component.row===t){var n=i.component.column.getField();n&&(i.component=e.getCell(n))}})}}class lO extends aY{static moduleName="htmlTableImport";constructor(t){super(t),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var t=this.table.originalElement,e=this.table.options,i=t.getElementsByTagName("th"),n=t.getElementsByTagName("tbody")[0],s=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),n=n?n.getElementsByTagName("tr"):[],this._extractOptions(t,e),i.length?this._extractHeaders(i,n):this._generateBlankHeaders(i,n);for(var o=0;o{o[t.toLowerCase()]=t}),n){var a,l=n[r];l&&"object"==typeof l&&l.name&&0===l.name.indexOf("tabulator-")&&void 0!==o[a=l.name.replace("tabulator-","")]&&(e[o[a]]=this._attribValue(l.value))}}_attribValue(t){return"true"===t||"false"!==t&&t}_findCol(t){return this.table.options.columns.find(e=>e.title===t)||!1}_extractHeaders(t,e){for(var i=0;i(console.error("Import Error:",t||"Unable to import data"),Promise.reject(t)))}lookupImporter(t){var e;return t||(t=this.table.options.importFormat),(e="string"==typeof t?lD.importers[t]:t)||console.error("Import Error - Importer not found:",t),e}importFromFile(t,e,i){var n=this.lookupImporter(t);if(n)return this.pickFile(e,i).then(this.importData.bind(this,n)).then(this.structureData.bind(this)).then(this.setData.bind(this)).catch(t=>(this.dispatch("import-error",t),this.dispatchExternal("importError",t),console.error("Import Error:",t||"Unable to import file"),Promise.reject(t)))}pickFile(t,e){return new Promise((i,n)=>{var s=document.createElement("input");s.type="file",s.accept=t,s.addEventListener("change",t=>{var o=s.files[0],r=new FileReader;switch(this.dispatch("import-importing",s.files),this.dispatchExternal("importImporting",s.files),e||this.table.options.importReader){case"buffer":r.readAsArrayBuffer(o);break;case"binary":r.readAsBinaryString(o);break;case"url":r.readAsDataURL(o);break;default:r.readAsText(o)}r.onload=t=>{i(r.result)},r.onerror=t=>{console.warn("File Load Error - Unable to read file"),n()}}),this.dispatch("import-choose"),this.dispatchExternal("importChoose"),s.click()})}importData(t,e){var i=t.call(this.table,e);return i instanceof Promise?i:i?Promise.resolve(i):Promise.reject()}structureData(t){return Array.isArray(t)&&t.length&&Array.isArray(t[0])?this.table.options.autoColumns?this.structureArrayToObject(t):this.structureArrayToColumns(t):t}structureArrayToObject(t){var e=t.shift();return t.map(t=>{var i={};return e.forEach((e,n)=>{i[e]=t[n]}),i})}structureArrayToColumns(t){var e=[],i=this.table.getColumns();return i[0]&&t[0][0]&&i[0].getDefinition().title===t[0][0]&&t.shift(),t.forEach(t=>{var n={};t.forEach((t,e)=>{var s=i[e];s&&(n[s.getField()]=t)}),e.push(n)}),e}setData(t){return this.dispatch("import-imported",t),this.dispatchExternal("importImported",t),this.table.setData(t)}}class lA extends aY{static moduleName="interaction";constructor(t){super(t),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowMouseDown:"row-mousedown",rowMouseUp:"row-mouseup",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellMouseDown:"cell-mousedown",cellMouseUp:"cell-mouseup",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerMouseDown:"column-mousedown",headerMouseUp:"column-mouseup",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupMouseDown:"group-mousedown",groupMouseUp:"group-mouseup",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerMouseDown"),this.registerColumnOption("headerMouseUp"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellMouseDown"),this.registerColumnOption("cellMouseUp"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this)),this.subscribe("scroll-horizontal",this.clearTouchWatchers.bind(this)),this.subscribe("scroll-vertical",this.clearTouchWatchers.bind(this))}clearTouchWatchers(){Object.values(this.touchWatchers).forEach(t=>{for(let e in t)t[e]=null})}cellContentsSelectionFixer(t,e){var i;if(!this.table.modExists("edit")||this.table.modules.edit.currentCell!==e){t.preventDefault();try{document.selection?((i=document.body.createTextRange()).moveToElementText(e.getElement()),i.select()):window.getSelection&&((i=document.createRange()).selectNode(e.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(i))}catch(t){}}}initializeExternalEvents(){for(let t in this.eventMap)this.subscriptionChangeExternal(t,this.subscriptionChanged.bind(this,t))}subscriptionChanged(t,e){e?this.subscribers[t]||(this.eventMap[t].includes("-")?(this.subscribers[t]=this.handle.bind(this,t),this.subscribe(this.eventMap[t],this.subscribers[t])):this.subscribeTouchEvents(t)):this.eventMap[t].includes("-")?!this.subscribers[t]||this.columnSubscribers[t]||this.subscribedExternal(t)||(this.unsubscribe(this.eventMap[t],this.subscribers[t]),delete this.subscribers[t]):this.unsubscribeTouchEvents(t)}subscribeTouchEvents(t){var e=this.eventMap[t];this.touchSubscribers[e+"-touchstart"]||(this.touchSubscribers[e+"-touchstart"]=this.handleTouch.bind(this,e,"start"),this.touchSubscribers[e+"-touchend"]=this.handleTouch.bind(this,e,"end"),this.subscribe(e+"-touchstart",this.touchSubscribers[e+"-touchstart"]),this.subscribe(e+"-touchend",this.touchSubscribers[e+"-touchend"])),this.subscribers[t]=!0}unsubscribeTouchEvents(t){var e=!0,i=this.eventMap[t];if(this.subscribers[t]&&!this.subscribedExternal(t)){for(let n in delete this.subscribers[t],this.eventMap)this.eventMap[n]===i&&this.subscribers[n]&&(e=!1);e&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(t){var e=t.definition;for(let i in this.eventMap)e[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(t))}handle(t,e,i){this.dispatchEvent(t,e,i)}handleTouch(t,e,i,n){var s=this.touchWatchers[t];switch("column"===t&&(t="header"),e){case"start":s.tap=!0,clearTimeout(s.tapHold),s.tapHold=setTimeout(()=>{clearTimeout(s.tapHold),s.tapHold=null,s.tap=null,clearTimeout(s.tapDbl),s.tapDbl=null,this.dispatchEvent(t+"TapHold",i,n)},1e3);break;case"end":s.tap&&(s.tap=null,this.dispatchEvent(t+"Tap",i,n)),s.tapDbl?(clearTimeout(s.tapDbl),s.tapDbl=null,this.dispatchEvent(t+"DblTap",i,n)):s.tapDbl=setTimeout(()=>{clearTimeout(s.tapDbl),s.tapDbl=null},300),clearTimeout(s.tapHold),s.tapHold=null}}dispatchEvent(t,e,i){var n,s=i.getComponent();this.columnSubscribers[t]&&(i instanceof a8?n=i.column.definition[t]:i instanceof li&&(n=i.definition[t]),n&&n(e,s)),this.dispatchExternal(t,e,s)}}var lI={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,navLeft:37,navRight:39,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35},lF={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,i=e.scrollTop-e.element.clientHeight;t.preventDefault(),e.displayRowsCount&&(i>=0?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,i=e.scrollTop+e.element.clientHeight,n=e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(i<=n?e.element.scrollTop=i:e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(t){var e=this.table.rowManager;t.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(t){this.dispatch("keybinding-nav-prev",t)},navNext:function(t){this.dispatch("keybinding-nav-next",t)},navLeft:function(t){this.dispatch("keybinding-nav-left",t)},navRight:function(t){this.dispatch("keybinding-nav-right",t)},navUp:function(t){this.dispatch("keybinding-nav-up",t)},navDown:function(t){this.dispatch("keybinding-nav-down",t)}};class lN extends aY{static moduleName="keybindings";static bindings=lI;static actions=lF;constructor(t){super(t),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var t=this.table.options.keybindings,e={};this.watchKeys={},this.pressedKeys=[],!1!==t&&(Object.assign(e,lN.bindings),Object.assign(e,t),this.mapBindings(e),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(t){for(let e in t)lN.actions[e]?t[e]&&("object"!=typeof t[e]&&(t[e]=[t[e]]),t[e].forEach(t=>{(Array.isArray(t)?t:[t]).forEach(t=>{this.mapBinding(e,t)})})):console.warn("Key Binding Error - no such action:",e)}mapBinding(t,e){var i={action:lN.actions[t],keys:[],ctrl:!1,shift:!1,meta:!1};e.toString().toLowerCase().split(" ").join("").split("+").forEach(t=>{switch(t){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:t=isNaN(t)?t.toUpperCase().charCodeAt(0):parseInt(t),i.keys.push(t),this.watchKeys[t]||(this.watchKeys[t]=[]),this.watchKeys[t].push(i)}})}bindEvents(){var t=this;this.keyupBinding=function(e){var i=e.keyCode,n=t.watchKeys[i];n&&(t.pressedKeys.push(i),n.forEach(function(i){t.checkBinding(e,i)}))},this.keydownBinding=function(e){var i=e.keyCode;if(t.watchKeys[i]){var n=t.pressedKeys.indexOf(i);n>-1&&t.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(t,e){var i=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&t.metaKey==e.meta&&(e.keys.forEach(t=>{-1==this.pressedKeys.indexOf(t)&&(i=!1)}),i&&e.action.call(this,t),!0)}}class lH extends aY{static moduleName="menu";constructor(t){super(t),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("rowDblClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerTableOption("groupDblClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerDblClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu"),this.registerColumnOption("dblClickMenu")}initialize(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu)),this.table.options.rowDblClickMenu&&this.subscribe("row-dblclick",this.loadMenuEvent.bind(this,this.table.options.rowDblClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu)),this.table.options.groupDblClickMenu&&this.subscribe("group-dblclick",this.loadMenuEvent.bind(this,this.table.options.groupDblClickMenu))}initializeColumn(t){var e=t.definition;e.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),e.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),e.headerDblClickMenu&&!this.columnSubscribers.headerDblClickMenu&&(this.columnSubscribers.headerDblClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerDblClickMenu"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickMenu)),e.headerMenu&&this.initializeColumnHeaderMenu(t),e.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),e.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu)),e.dblClickMenu&&!this.columnSubscribers.dblClickMenu&&(this.columnSubscribers.dblClickMenu=this.loadMenuTableCellEvent.bind(this,"dblClickMenu"),this.subscribe("cell-dblclick",this.columnSubscribers.dblClickMenu))}initializeColumnHeaderMenu(t){var e,i=t.definition.headerMenuIcon;(e=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(t.getComponent())),i instanceof HTMLElement?e.appendChild(i):e.innerHTML=i):e.innerHTML="⋮",e.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),this.loadMenuEvent(t.definition.headerMenu,e,t)}),t.titleElement.insertBefore(e,t.titleElement.firstChild)}loadMenuTableCellEvent(t,e,i){i._cell&&(i=i._cell),i.column.definition[t]&&this.loadMenuEvent(i.column.definition[t],e,i)}loadMenuTableColumnEvent(t,e,i){i._column&&(i=i._column),i.definition[t]&&this.loadMenuEvent(i.definition[t],e,i)}loadMenuEvent(t,e,i){i._group?i=i._group:i._row&&(i=i._row),t="function"==typeof t?t.call(this.table,e,i.getComponent()):t,this.loadMenu(e,i,t)}loadMenu(t,e,i,n,s){var o,r=!(t instanceof MouseEvent),a=document.createElement("div");if(a.classList.add("tabulator-menu"),r||t.preventDefault(),i&&i.length){if(n)o=s.child(a);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout(()=>{this.nestedMenuBlock=!1},100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=o=this.popup(a)}i.forEach(t=>{var i=document.createElement("div"),n=t.label,s=t.disabled;t.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n.call(this.table,e.getComponent())),n instanceof Node?i.appendChild(n):i.innerHTML=n,"function"==typeof s&&(s=s.call(this.table,e.getComponent())),s?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",t=>{t.stopPropagation()})):t.menu&&t.menu.length?i.addEventListener("click",n=>{n.stopPropagation(),this.loadMenu(n,e,t.menu,i,o)}):t.action&&i.addEventListener("click",i=>{t.action(i,e.getComponent())}),t.menu&&t.menu.length&&i.classList.add("tabulator-menu-item-submenu")),a.appendChild(i)}),a.addEventListener("click",t=>{this.rootPopup&&this.rootPopup.hide()}),o.show(n||t),o===this.rootPopup&&(this.rootPopup.hideOnBlur(()=>{this.rootPopup=null,this.currentComponent&&(this.dispatch("menu-closed",i,o),this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)}),this.currentComponent=e,this.dispatch("menu-opened",i,o),this.dispatchExternal("menuOpened",e.getComponent()))}}}class lB extends aY{static moduleName="moveColumn";constructor(t){super(t),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.classList.add("tabulator-col-placeholder"),t}initialize(){this.table.options.movableColumns&&(this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("alert-show",this.abortMove.bind(this)))}abortMove(){clearTimeout(this.checkTimeout)}initializeColumn(t){var e,i=this,n={};t.modules.frozen||t.isGroup||t.isRowHeader||(e=t.getElement(),n.mousemove=(function(n){t.parent===i.moving.parent&&((i.touchMove?n.touches[0].pageX:n.pageX)-aq.elOffset(e).left+i.table.columnManager.contentsElement.scrollLeft>t.getWidth()/2?i.toCol===t&&i.toColAfter||(e.parentNode.insertBefore(i.placeholderElement,e.nextSibling),i.moveColumn(t,!0)):(i.toCol!==t||i.toColAfter)&&(e.parentNode.insertBefore(i.placeholderElement,e),i.moveColumn(t,!1)))}).bind(i),e.addEventListener("mousedown",function(e){i.touchMove=!1,1===e.which&&(i.checkTimeout=setTimeout(function(){i.startMove(e,t)},i.checkPeriod))}),e.addEventListener("mouseup",function(t){1===t.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)}),i.bindTouchEvents(t)),t.modules.moveColumn=n}bindTouchEvents(t){var e,i,n,s,o,r,a=t.getElement(),l=!1;a.addEventListener("touchstart",a=>{this.checkTimeout=setTimeout(()=>{this.touchMove=!0,n=(e=t.nextColumn())?e.getWidth()/2:0,s=(i=t.prevColumn())?i.getWidth()/2:0,o=0,r=0,l=!1,this.startMove(a,t)},this.checkPeriod)},{passive:!0}),a.addEventListener("touchmove",a=>{var h,c;this.moving&&(this.moveHover(a),l||(l=a.touches[0].pageX),(h=a.touches[0].pageX-l)>0?e&&h-o>n&&(c=e)!==t&&(l=a.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveColumn(c,!0)):i&&-h-r>s&&(c=i)!==t&&(l=a.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveColumn(c,!1)),c&&(e=c.nextColumn(),o=n,n=e?e.getWidth()/2:0,i=c.prevColumn(),r=s,s=i?i.getWidth()/2:0))},{passive:!0}),a.addEventListener("touchend",t=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(t)})}startMove(t,e){var i=e.getElement(),n=this.table.columnManager.getContentsElement(),s=this.table.columnManager.getHeadersElement();this.table.modules.selectRange&&this.table.modules.selectRange.columnSelection&&this.table.modules.selectRange.mousedown&&"column"===this.table.modules.selectRange.selecting||(this.moving=e,this.startX=(this.touchMove?t.touches[0].pageX:t.pageX)-aq.elOffset(i).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),n.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=n.clientHeight-s.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(t),this.dispatch("column-moving",t,this.moving))}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().addEventListener("mousemove",t.modules.moveColumn.mousemove)})}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach(function(t){t.modules.moveColumn.mousemove&&t.getElement().removeEventListener("mousemove",t.modules.moveColumn.mousemove)})}moveColumn(t,e){var i=this.moving.getCells();this.toCol=t,this.toColAfter=e,e?t.getCells().forEach(function(t,e){var n=t.getElement(!0);n.parentNode&&i[e]&&n.parentNode.insertBefore(i[e].getElement(),n.nextSibling)}):t.getCells().forEach(function(t,e){var n=t.getElement(!0);n.parentNode&&i[e]&&n.parentNode.insertBefore(i[e].getElement(),n)})}endMove(t){(1===t.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}moveHover(t){var e,i=this.table.columnManager.getContentsElement(),n=i.scrollLeft,s=(this.touchMove?t.touches[0].pageX:t.pageX)-aq.elOffset(i).left+n;this.hoverElement.style.left=s-this.startX+"px",s-n{e=Math.max(0,n-5),this.table.rowManager.getElement().scrollLeft=e,this.autoScrollTimeout=!1},1)),n+i.clientWidth-s{e=Math.min(i.clientWidth,n+5),this.table.rowManager.getElement().scrollLeft=e,this.autoScrollTimeout=!1},1))}}var lj={delete:function(t,e,i){t.delete()}},lV={insert:function(t,e,i){return this.table.addRow(t.getData(),void 0,e),!0},add:function(t,e,i){return this.table.addRow(t.getData()),!0},update:function(t,e,i){return!!e&&(e.update(t.getData()),!0)},replace:function(t,e,i){return!!e&&(this.table.addRow(t.getData(),void 0,e),e.delete(),!0)}};class lW extends aY{static moduleName="moveRow";static senders=lj;static receivers=lV;constructor(t){super(t),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t.classList.add("tabulator-row-placeholder"),t}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(t){var e=this,i={};i.mouseup=(function(i){e.tableRowDrop(i,t)}).bind(e),i.mousemove=(function(i){var n;i.pageY-aq.elOffset(t.element).top+e.table.rowManager.element.scrollTop>t.getHeight()/2?e.toRow===t&&e.toRowAfter||((n=t.getElement()).parentNode.insertBefore(e.placeholderElement,n.nextSibling),e.moveRow(t,!0)):(e.toRow!==t||e.toRowAfter)&&(n=t.getElement()).previousSibling&&(n.parentNode.insertBefore(e.placeholderElement,n),e.moveRow(t,!1))}).bind(e),t.modules.moveRow=i}initializeRow(t){var e,i=this,n={};n.mouseup=(function(e){i.tableRowDrop(e,t)}).bind(i),n.mousemove=(function(e){var n=t.getElement();e.pageY-aq.elOffset(n).top+i.table.rowManager.element.scrollTop>t.getHeight()/2?i.toRow===t&&i.toRowAfter||(n.parentNode.insertBefore(i.placeholderElement,n.nextSibling),i.moveRow(t,!0)):(i.toRow!==t||i.toRowAfter)&&(n.parentNode.insertBefore(i.placeholderElement,n),i.moveRow(t,!1))}).bind(i),this.hasHandle||((e=t.getElement()).addEventListener("mousedown",function(e){1===e.which&&(i.checkTimeout=setTimeout(function(){i.startMove(e,t)},i.checkPeriod))}),e.addEventListener("mouseup",function(t){1===t.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)}),this.bindTouchEvents(t,t.getElement())),t.modules.moveRow=n}initializeColumn(t){t.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}initializeCell(t){if(t.column.definition.rowHandle&&!1!==this.table.options.movableRows){var e=this,i=t.getElement(!0);i.addEventListener("mousedown",function(i){1===i.which&&(e.checkTimeout=setTimeout(function(){e.startMove(i,t.row)},e.checkPeriod))}),i.addEventListener("mouseup",function(t){1===t.which&&e.checkTimeout&&clearTimeout(e.checkTimeout)}),this.bindTouchEvents(t.row,i)}}bindTouchEvents(t,e){var i,n,s,o,r,a,l=!1;e.addEventListener("touchstart",e=>{this.checkTimeout=setTimeout(()=>{this.touchMove=!0,s=(i=t.nextRow())?i.getHeight()/2:0,o=(n=t.prevRow())?n.getHeight()/2:0,r=0,a=0,l=!1,this.startMove(e,t)},this.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,e.addEventListener("touchmove",e=>{var h,c;this.moving&&(e.preventDefault(),this.moveHover(e),l||(l=e.touches[0].pageY),(h=e.touches[0].pageY-l)>0?i&&h-r>s&&(c=i)!==t&&(l=e.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveRow(c,!0)):n&&-h-a>o&&(c=n)!==t&&(l=e.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveRow(c,!1)),c&&(i=c.nextRow(),r=s,s=i?i.getHeight()/2:0,n=c.prevRow(),a=o,o=n?n.getHeight()/2:0))}),e.addEventListener("touchend",t=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(t),this.touchMove=!1)})}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach(t=>{("row"===t.type||"group"===t.type)&&t.modules.moveRow&&t.modules.moveRow.mousemove&&t.getElement().addEventListener("mousemove",t.modules.moveRow.mousemove)})}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach(t=>{("row"===t.type||"group"===t.type)&&t.modules.moveRow&&t.modules.moveRow.mousemove&&t.getElement().removeEventListener("mousemove",t.modules.moveRow.mousemove)})}startMove(t,e){var i=e.getElement();this.setStartPosition(t,e),this.moving=e,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(e)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",e.getComponent()),this.moveHover(t)}setStartPosition(t,e){var i,n,s=this.touchMove?t.touches[0].pageX:t.pageX,o=this.touchMove?t.touches[0].pageY:t.pageY;i=e.getElement(),this.connection?(n=i.getBoundingClientRect(),this.startX=n.left-s+window.pageXOffset,this.startY=n.top-o+window.pageYOffset):this.startY=o-i.getBoundingClientRect().top}endMove(t){(!t||1===t.which||this.touchMove)&&(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}moveRow(t,e){this.toRow=t,this.toRowAfter=e}moveHover(t){this.connection?this.moveHoverConnections.call(this,t):this.moveHoverTable.call(this,t)}moveHoverTable(t){var e=this.table.rowManager.getElement(),i=e.scrollTop,n=(this.touchMove?t.touches[0].pageY:t.pageY)-e.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(n-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}moveHoverConnections(t){this.hoverElement.style.left=this.startX+(this.touchMove?t.touches[0].pageX:t.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?t.touches[0].pageY:t.pageY)+"px"}elementRowDrop(t,e,i){this.dispatchExternal("movableRowsElementDrop",t,e,!!i&&i.getComponent())}connectToTables(t){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",e),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:t})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(t=>{"string"==typeof t?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(t))):this.connectionElements.push(t)}),this.connectionElements.forEach(t=>{var e=e=>{this.elementRowDrop(e,t,this.moving)};t.addEventListener("mouseup",e),t.tabulatorElementDropEvent=e,t.classList.add("tabulator-movingrow-receiving")}))}disconnectFromTables(){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",t),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(t=>{t.classList.remove("tabulator-movingrow-receiving"),t.removeEventListener("mouseup",t.tabulatorElementDropEvent),delete t.tabulatorElementDropEvent})}connect(t,e){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=t,this.connectedRow=e,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(t=>{"row"===t.type&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().addEventListener("mouseup",t.modules.moveRow.mouseup)}),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",e,t),!0)}disconnect(t){t===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(t=>{"row"===t.type&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().removeEventListener("mouseup",t.modules.moveRow.mouseup)}),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",t)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(t,e,i){var n=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":n=lW.senders[this.table.options.movableRowsSender];break;case"function":n=this.table.options.movableRowsSender}n?n.call(this,this.moving?this.moving.getComponent():void 0,e?e.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),e?e.getComponent():void 0,t)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),e?e.getComponent():void 0,t);this.endMove()}tableRowDrop(t,e){var i=!1,n=!1;switch(t.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=lW.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver}i?n=i.call(this,this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),n?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),e?e.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:e,success:n})}commsReceived(t,e,i){switch(e){case"connect":return this.connect(t,i.row);case"disconnect":return this.disconnect(t);case"dropcomplete":return this.dropComplete(t,i.row,i.success)}}}var lZ={};class lG extends aY{static moduleName="mutator";static mutators=lZ;constructor(t){super(t),this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(t,e,i){return this.transformRow(e,"data",i)}initializeColumn(t){var e=!1,i={};this.allowedTypes.forEach(n=>{var s,o="mutator"+(n.charAt(0).toUpperCase()+n.slice(1));t.definition[o]&&(s=this.lookupMutator(t.definition[o]))&&(e=!0,i[o]={mutator:s,params:t.definition[o+"Params"]||{}})}),e&&(t.modules.mutate=i)}lookupMutator(t){var e=!1;switch(typeof t){case"string":lG.mutators[t]?e=lG.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":e=t}return e}transformRow(t,e,i){var n,s="mutator"+(e.charAt(0).toUpperCase()+e.slice(1));return this.enabled&&this.table.columnManager.traverse(o=>{var r,a,l;o.modules.mutate&&(r=o.modules.mutate[s]||o.modules.mutate.mutator||!1)&&(n=o.getFieldValue(void 0!==i?i:t),("data"!=e||i)&&void 0===n||(l=o.getComponent(),a="function"==typeof r.params?r.params(n,t,e,l):r.params,o.setFieldValue(t,r.mutator(n,t,e,a,l))))}),t}transformCell(t,e){if(t.column.modules.mutate){var i=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1,n={};if(i)return n=Object.assign(n,t.row.getData()),t.column.setFieldValue(n,e),i.mutator(e,n,"edit",i.params,t.getComponent())}return e}mutateLink(t){var e=t.column.definition.mutateLink;e&&(Array.isArray(e)||(e=[e]),e.forEach(e=>{var i=t.row.getCell(e);i&&i.setValue(i.getValue(),!0,!0)}))}enable(){this.enabled=!0}disable(){this.enabled=!1}}var lU={rows:function(t,e,i,n,s){var o=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",t=>{r.innerHTML=t}),this.table.modules.localize.langBind("pagination|counter|of",t=>{l.innerHTML=t}),this.table.modules.localize.langBind("pagination|counter|rows",t=>{c.innerHTML=t}),n?(a.innerHTML=" "+e+"-"+Math.min(e+t-1,n)+" ",h.innerHTML=" "+n+" ",o.appendChild(r),o.appendChild(a),o.appendChild(l),o.appendChild(h)):(a.innerHTML=" 0 ",o.appendChild(r),o.appendChild(a)),o.appendChild(c),o},pages:function(t,e,i,n,s){var o=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",t=>{r.innerHTML=t}),a.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",t=>{l.innerHTML=t}),h.innerHTML=" "+s+" ",this.table.modules.localize.langBind("pagination|counter|pages",t=>{c.innerHTML=t}),o.appendChild(r),o.appendChild(a),o.appendChild(l),o.appendChild(h),o.appendChild(c),o}};class lq extends aY{static moduleName="page";static pageCounters=lU;constructor(t){super(t),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(t,e){var i,n=this.table.rowManager,s=n.getDisplayRows();return e?s.length?i=s[0]:n.activeRows.length&&(i=n.activeRows[n.activeRows.length-1],e=!1):s.length&&(i=s[s.length-1],e=!(s.length{})}restOnRenderBefore(t,e){return e||"local"!==this.mode||this.reset(),t}rowsUpdated(){this.refreshData(!0,"all")}createElements(){var t;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),(t=document.createElement("button")).classList.add("tabulator-page"),t.setAttribute("type","button"),t.setAttribute("role","button"),t.setAttribute("aria-label",""),t.setAttribute("title",""),this.firstBut=t.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=t.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=t.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=t.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))}generatePageSizeSelectList(){var t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))t=this.table.options.paginationSizeSelector,this.pageSizes=t,-1==this.pageSizes.indexOf(this.size)&&t.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){t=[];for(let e=1;e<5;e++)t.push(this.size*e);this.pageSizes=t}else t=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach(t=>{var e=document.createElement("option");e.value=t,!0===t?this.langBind("pagination|all",function(t){e.innerHTML=t}):e.innerHTML=t,this.pageSizeSelect.appendChild(e)}),this.pageSizeSelect.value=this.size}}initializePageCounter(){var t=this.table.options.paginationCounter,e=null;t&&((e="function"==typeof t?t:lq.pageCounters[t])?(this.pageCounter=e,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",t))}initializePaginator(t){var e,i;t||(this.langBind("pagination|first",t=>{this.firstBut.innerHTML=t}),this.langBind("pagination|first_title",t=>{this.firstBut.setAttribute("aria-label",t),this.firstBut.setAttribute("title",t)}),this.langBind("pagination|prev",t=>{this.prevBut.innerHTML=t}),this.langBind("pagination|prev_title",t=>{this.prevBut.setAttribute("aria-label",t),this.prevBut.setAttribute("title",t)}),this.langBind("pagination|next",t=>{this.nextBut.innerHTML=t}),this.langBind("pagination|next_title",t=>{this.nextBut.setAttribute("aria-label",t),this.nextBut.setAttribute("title",t)}),this.langBind("pagination|last",t=>{this.lastBut.innerHTML=t}),this.langBind("pagination|last_title",t=>{this.lastBut.setAttribute("aria-label",t),this.lastBut.setAttribute("title",t)}),this.firstBut.addEventListener("click",()=>{this.setPage(1)}),this.prevBut.addEventListener("click",()=>{this.previousPage()}),this.nextBut.addEventListener("click",()=>{this.nextPage()}),this.lastBut.addEventListener("click",()=>{this.setPage(this.max)}),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(e=document.createElement("label"),this.langBind("pagination|page_size",t=>{this.pageSizeSelect.setAttribute("aria-label",t),this.pageSizeSelect.setAttribute("title",t),e.innerHTML=t}),this.element.appendChild(e),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",t=>{this.setPageSize("true"==this.pageSizeSelect.value||this.pageSizeSelect.value),this.setPage(1)})),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):"string"==typeof this.table.options.paginationCounterElement&&((i=document.querySelector(this.table.options.paginationCounterElement))?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(t){this.initializePaginator(!0),this.mode="progressive_"+t,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setMaxRows(t){t?this.max=!0===this.size?1:Math.ceil(t/this.size):this.max=1,this.page>this.max&&(this.page=this.max)}reset(t){!this.initialLoad&&("local"==this.mode||t)&&(this.page=1,this.trackChanges())}setMaxPage(t){t=parseInt(t),this.max=t||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(t){switch(t){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(t=parseInt(t))>0&&t<=this.max||"local"!==this.mode?(this.page=t,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",t),Promise.reject())}setPageToRow(t){var e=this.displayRows(-1).indexOf(t);if(!(e>-1))return console.warn("Pagination Error - Requested row is not visible"),Promise.reject();var i=!0===this.size?1:Math.ceil((e+1)/this.size);return this.setPage(i)}setPageSize(t){!0!==t&&(t=parseInt(t)),t>0&&(this.size=t,this.dispatchExternal("pageSizeChanged",t)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(t,e,i){var n;if(this.pageCounter)switch("remote"===this.mode&&(e=this.size,i=(this.page-1)*this.size+1,t=this.remoteRowCountEstimate),typeof(n=this.pageCounter.call(this,e,i,this.page,t,this.max))){case"object":if(n instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(n)}else this.pageCounterElement.innerHTML="",null!=n&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",n);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=n}}_setPageButtons(){let t=Math.floor((this.count-1)/2),e=Math.ceil((this.count-1)/2),i=this.max-this.page+t+10&&t<=this.max&&this.pagesElement.appendChild(this._generatePageButton(t));this.footerRedraw()}_generatePageButton(t){var e=document.createElement("button");return e.classList.add("tabulator-page"),t==this.page&&e.classList.add("active"),e.setAttribute("type","button"),e.setAttribute("role","button"),this.langBind("pagination|page_title",i=>{e.setAttribute("aria-label",i+" "+t),e.setAttribute("title",i+" "+t)}),e.setAttribute("data-page",t),e.textContent=t,e.addEventListener("click",e=>{this.setPage(t)}),e}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.page"row"===t.type);if("local"!=this.mode)return this._setPageButtons(),this._setPageCounter(r.length),t.slice(0);e=[],this.setMaxRows(t.length),!0===this.size?(i=0,n=t.length):n=(i=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(let r=i;r{this.dataChanging=!1});case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(t){var e;if(void 0===t.last_page&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),t.data){if(this.max=parseInt(t.last_page)||1,this.remoteRowCountEstimate=void 0!==t.last_row?t.last_row:t.last_page*this.size-(this.page==t.last_page?this.size-t.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":1==this.page?this.table.rowManager.setData(t.data,!1,1==this.page):this.table.rowManager.addRows(t.data),this.page{this.nextPage()},this.table.options.progressiveLoadDelay);break;case"progressive_scroll":t=1===this.page?t.data:this.table.rowManager.getData().concat(t.data),this.table.rowManager.setData(t,1!==this.page,1==this.page),e=this.table.options.progressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+e&&this.page{this.nextPage()})}return!1}this.dispatchExternal("pageLoaded",this.getPage())}else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return t.data}footerRedraw(){var t=this.table.footerManager.containerElement;Math.ceil(t.clientWidth)-t.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(t.clientWidth)-t.scrollWidth<0&&(this.pagesElement.style.display="none"))}}var lK={local:function(t,e){var i=localStorage.getItem(t+"-"+e);return!!i&&JSON.parse(i)},cookie:function(t,e){var i,n,s=document.cookie,o=t+"-"+e,r=s.indexOf(o+"=");return r>-1&&((i=(s=s.slice(r)).indexOf(";"))>-1&&(s=s.slice(0,i)),n=s.replace(o+"=","")),!!n&&JSON.parse(n)}},lY={local:function(t,e,i){localStorage.setItem(t+"-"+e,JSON.stringify(i))},cookie:function(t,e,i){var n=new Date;n.setDate(n.getDate()+1e4),document.cookie=t+"-"+e+"="+JSON.stringify(i)+"; expires="+n.toUTCString()}};class l$ extends aY{static moduleName="persistence";static moduleInitOrder=-10;static readers=lK;static writers=lY;constructor(t){super(t),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var t="_tabulator_test";try{return window.localStorage.setItem(t,t),window.localStorage.removeItem(t),!0}catch(t){return!1}}initialize(){if(this.table.options.persistence){var t,e=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==e?e:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:l$.readers[this.table.options.persistenceReaderFunc]?this.readFunc=l$.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):l$.readers[this.mode]?this.readFunc=l$.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:l$.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=l$.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):l$.writers[this.mode]?this.writeFunc=l$.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,headerFilter:!0===this.table.options.persistence||this.table.options.persistence.headerFilter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(t=this.retrieveData("page"))&&(void 0!==t.paginationSize&&(!0===this.config.page||this.config.page.size)&&(this.table.options.paginationSize=t.paginationSize),void 0!==t.paginationInitialPage&&(!0===this.config.page||this.config.page.page)&&(this.table.options.paginationInitialPage=t.paginationInitialPage)),this.config.group&&(t=this.retrieveData("group"))&&(void 0!==t.groupBy&&(!0===this.config.group||this.config.group.groupBy)&&(this.table.options.groupBy=t.groupBy),void 0!==t.groupStartOpen&&(!0===this.config.group||this.config.group.groupStartOpen)&&(this.table.options.groupStartOpen=t.groupStartOpen),void 0!==t.groupHeader&&(!0===this.config.group||this.config.group.groupHeader)&&(this.table.options.groupHeader=t.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("filter-changed",this.eventSave.bind(this,"headerFilter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("column-width",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(t){this.config[t]&&this.save(t)}tableBuilt(){var t,e,i;this.config.sort&&!1==!(t=this.load("sort"))&&(this.table.options.initialSort=t),this.config.filter&&!1==!(e=this.load("filter"))&&(this.table.options.initialFilter=e),this.config.headerFilter&&!1==!(i=this.load("headerFilter"))&&(this.table.options.initialHeaderFilter=i)}tableRedraw(t){t&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(t){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,t,!0)),!0}initializeColumn(t){var e;this.config.columns&&(this.defWatcherBlock=!0,e=t.getDefinition(),(!0===this.config.columns?Object.keys(e):this.config.columns).forEach(t=>{var i=Object.getOwnPropertyDescriptor(e,t),n=e[t];i&&Object.defineProperty(e,t,{set:t=>{n=t,this.defWatcherBlock||this.save("columns"),i.set&&i.set(t)},get:()=>(i.get&&i.get(),n)})}),this.defWatcherBlock=!1)}load(t,e){var i=this.retrieveData(t);return e&&(i=i?this.mergeDefinition(e,i):e),i}retrieveData(t){return!!this.readFunc&&this.readFunc(this.id,t)}mergeDefinition(t,e,i){var n=[];return(e=e||[]).forEach((e,s)=>{var o,r=this._findColumn(t,e);r&&(i?o=Object.keys(e):!0===this.config.columns||void 0==this.config.columns?(o=Object.keys(r)).push("width"):o=this.config.columns,o.forEach(t=>{"columns"!==t&&void 0!==e[t]&&(r[t]=e[t])}),r.columns&&(r.columns=this.mergeDefinition(r.columns,e.columns)),n.push(r))}),t.forEach((t,i)=>{this._findColumn(e,t)||(n.length>i?n.splice(i,0,t):n.push(t))}),n}_findColumn(t,e){var i=e.columns?"group":e.field?"field":"object";return t.find(function(t){switch(i){case"group":return t.title===e.title&&t.columns.length===e.columns.length;case"field":return t.field===e.field;case"object":return t===e}})}save(t){var e={};switch(t){case"columns":e=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":e=this.table.modules.filter.getFilters();break;case"headerFilter":e=this.table.modules.filter.getHeaderFilters();break;case"sort":e=this.validateSorters(this.table.modules.sort.getSort());break;case"group":e=this.getGroupConfig();break;case"page":e=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,t,e)}validateSorters(t){return t.forEach(function(t){t.column=t.field,delete t.field}),t}getGroupConfig(){var t={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(t.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(t.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(t.groupHeader=this.table.options.groupHeader)),t}getPageConfig(){var t={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(t.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(t.paginationInitialPage=this.table.modules.page.getPage())),t}parseColumns(t){var e=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return t.forEach(t=>{var n,s={},o=t.getDefinition();t.isGroup?(s.title=o.title,s.columns=this.parseColumns(t.getColumns())):(s.field=t.getField(),!0===this.config.columns||void 0==this.config.columns?((n=Object.keys(o)).push("width"),n.push("visible")):n=this.config.columns,n.forEach(e=>{switch(e){case"width":s.width=t.getWidth();break;case"visible":s.visible=t.visible;break;default:"function"!=typeof o[e]&&-1===i.indexOf(e)&&(s[e]=o[e])}})),e.push(s)}),e}}class lJ extends aY{static moduleName="popup";constructor(t){super(t),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("rowDblClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerTableOption("groupDblClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerDblClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup"),this.registerColumnOption("dblClickPopup"),this.registerComponentFunction("cell","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("column","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("row","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("group","popup",this._componentPopupCall.bind(this))}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}_componentPopupCall(t,e,i){this.loadPopupEvent(e,null,t,i)}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup)),this.table.options.rowDblClickPopup&&this.subscribe("row-dblclick",this.loadPopupEvent.bind(this,this.table.options.rowDblClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup)),this.table.options.groupDblClickPopup&&this.subscribe("group-dblclick",this.loadPopupEvent.bind(this,this.table.options.groupDblClickPopup))}initializeColumn(t){var e=t.definition;e.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),e.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),e.headerDblClickPopup&&!this.columnSubscribers.headerDblClickPopup&&(this.columnSubscribers.headerDblClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerDblClickPopup"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickPopup)),e.headerPopup&&this.initializeColumnHeaderPopup(t),e.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),e.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup)),e.dblClickPopup&&!this.columnSubscribers.dblClickPopup&&(this.columnSubscribers.dblClickPopup=this.loadPopupTableCellEvent.bind(this,"dblClickPopup"),this.subscribe("cell-click",this.columnSubscribers.dblClickPopup))}initializeColumnHeaderPopup(t){var e,i=t.definition.headerPopupIcon;(e=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(t.getComponent())),i instanceof HTMLElement?e.appendChild(i):e.innerHTML=i):e.innerHTML="⋮",e.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),this.loadPopupEvent(t.definition.headerPopup,e,t)}),t.titleElement.insertBefore(e,t.titleElement.firstChild)}loadPopupTableCellEvent(t,e,i){i._cell&&(i=i._cell),i.column.definition[t]&&this.loadPopupEvent(i.column.definition[t],e,i)}loadPopupTableColumnEvent(t,e,i){i._column&&(i=i._column),i.definition[t]&&this.loadPopupEvent(i.definition[t],e,i)}loadPopupEvent(t,e,i,n){var s;i._group?i=i._group:i._row&&(i=i._row),t="function"==typeof t?t.call(this.table,e,i.getComponent(),function(t){s=t}):t,this.loadPopup(e,i,t,s,n)}loadPopup(t,e,i,n,s){var o,r,a=!(t instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",t=>{t.stopPropagation()}),a||t.preventDefault(),r=this.popup(o),"function"==typeof n&&r.renderCallback(n),t?r.show(t):r.show(e.getElement(),s||"center"),r.hideOnBlur(()=>{this.dispatchExternal("popupClosed",e.getComponent())}),this.dispatchExternal("popupOpened",e.getComponent())}}class lX extends aY{static moduleName="print";constructor(t){super(t),this.element=!1,this.manualBlock=!1,this.beforeprintEventHandler=null,this.afterprintEventHandler=null,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(this.beforeprintEventHandler=this.replaceTable.bind(this),this.afterprintEventHandler=this.cleanup.bind(this),window.addEventListener("beforeprint",this.beforeprintEventHandler),window.addEventListener("afterprint",this.afterprintEventHandler),this.subscribe("table-destroy",this.destroy.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}destroy(){this.table.options.printAsHtml&&(window.removeEventListener("beforeprint",this.beforeprintEventHandler),window.removeEventListener("afterprint",this.afterprintEventHandler))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(t,e,i){var n,s,o=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),h=this.table.modules.export.generateTable(void 0!==i?i:this.table.options.printConfig,void 0!==e?e:this.table.options.printStyled,t||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(a.classList.add("tabulator-print-header"),"string"==typeof(n="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?a.innerHTML=n:a.appendChild(n),this.element.appendChild(a)),this.element.appendChild(h),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(s="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=s:l.appendChild(s),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,h),window.print(),this.cleanup(),window.scrollTo(o,r),this.manualBlock=!1}}class lQ extends aY{static moduleName="reactiveData";constructor(t){super(t),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(t){var e,i=this;this.currentVersion++,e=this.currentVersion,this.unwatchData(),this.data=t,this.origFuncs.push=t.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var n,s=Array.from(arguments);return i.blocked||e!==i.currentVersion||(i.block("data-push"),s.forEach(t=>{i.table.rowManager.addRowActual(t,!1)}),n=i.origFuncs.push.apply(t,arguments),i.unblock("data-push")),n}}),this.origFuncs.unshift=t.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var n,s=Array.from(arguments);return i.blocked||e!==i.currentVersion||(i.block("data-unshift"),s.forEach(t=>{i.table.rowManager.addRowActual(t,!0)}),n=i.origFuncs.unshift.apply(t,arguments),i.unblock("data-unshift")),n}}),this.origFuncs.shift=t.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var n,s;return i.blocked||e!==i.currentVersion||(i.block("data-shift"),i.data.length&&(n=i.table.rowManager.getRowFromDataObject(i.data[0]))&&n.deleteActual(),s=i.origFuncs.shift.call(t),i.unblock("data-shift")),s}}),this.origFuncs.pop=t.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var n,s;return i.blocked||e!==i.currentVersion||(i.block("data-pop"),i.data.length&&(n=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&n.deleteActual(),s=i.origFuncs.pop.call(t),i.unblock("data-pop")),s}}),this.origFuncs.splice=t.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var n,s,o=Array.from(arguments),r=o[0]<0?t.length+o[0]:o[0],a=o[1],l=!!o[2]&&o.slice(2);if(!i.blocked&&e===i.currentVersion){if(i.block("data-splice"),l&&((n=!!t[r]&&i.table.rowManager.getRowFromDataObject(t[r]))?l.forEach(t=>{i.table.rowManager.addRowActual(t,!0,n,!0)}):(l=l.slice().reverse()).forEach(t=>{i.table.rowManager.addRowActual(t,!0,!1,!0)})),0!==a){var h=t.slice(r,void 0===o[1]?o[1]:r+a);h.forEach((t,e)=>{var n=i.table.rowManager.getRowFromDataObject(t);n&&n.deleteActual(e!==h.length-1)})}(l||0!==a)&&i.table.rowManager.reRenderInPosition(),s=i.origFuncs.splice.apply(t,arguments),i.unblock("data-splice")}return s}})}unwatchData(){if(!1!==this.data)for(var t in this.origFuncs)Object.defineProperty(this.data,t,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}watchRow(t){var e=t.getData();for(var i in e)this.watchKey(t,e,i);this.table.options.dataTree&&this.watchTreeChildren(t)}watchTreeChildren(t){var e=this,i=t.getData()[this.table.options.dataTreeChildField],n={};i&&(n.push=i.push,Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:()=>{if(!e.blocked){e.block("tree-push");var s=n.push.apply(i,arguments);this.rebuildTree(t),e.unblock("tree-push")}return s}}),n.unshift=i.unshift,Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:()=>{if(!e.blocked){e.block("tree-unshift");var s=n.unshift.apply(i,arguments);this.rebuildTree(t),e.unblock("tree-unshift")}return s}}),n.shift=i.shift,Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:()=>{if(!e.blocked){e.block("tree-shift");var s=n.shift.call(i);this.rebuildTree(t),e.unblock("tree-shift")}return s}}),n.pop=i.pop,Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:()=>{if(!e.blocked){e.block("tree-pop");var s=n.pop.call(i);this.rebuildTree(t),e.unblock("tree-pop")}return s}}),n.splice=i.splice,Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:()=>{if(!e.blocked){e.block("tree-splice");var s=n.splice.apply(i,arguments);this.rebuildTree(t),e.unblock("tree-splice")}return s}}))}rebuildTree(t){this.table.modules.dataTree.initializeRow(t),this.table.modules.dataTree.layoutRow(t),this.table.rowManager.refreshActiveData("tree",!1,!0)}watchKey(t,e,i){var n=this,s=Object.getOwnPropertyDescriptor(e,i),o=e[i],r=this.currentVersion;Object.defineProperty(e,i,{set:e=>{if(o=e,!n.blocked&&r===n.currentVersion){n.block("key");var a={};a[i]=e,t.updateData(a),n.unblock("key")}s.set&&s.set(e)},get:()=>(s.get&&s.get(),o)})}unwatchRow(t){var e=t.getData();for(var i in e)Object.defineProperty(e,i,{value:e[i]})}block(t){this.blocked||(this.blocked=t)}unblock(t){this.blocked===t&&(this.blocked=!1)}}class l0 extends aY{static moduleName="resizeColumns";constructor(t){super(t),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1),this.registerTableOption("resizableColumnGuide",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(t){"row"===t.row.type&&(this.deInitializeComponent(t),this.initializeColumn("cell",t,t.column,t.element))}layoutColumnHeader(t){t.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(t),this.initializeColumn("header",t,t,t.element))}columnLayoutUpdated(t){var e=t.prevColumn();this.reinitializeColumn(t),e&&this.reinitializeColumn(e)}columnWidthUpdated(t){t.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(t)?this.table.modules.frozenColumns.leftColumns.forEach(t=>{this.reinitializeColumn(t)}):this.table.modules.frozenColumns.rightColumns.includes(t)&&this.table.modules.frozenColumns.rightColumns.forEach(t=>{this.reinitializeColumn(t)}))}frozenColumnOffset(t){var e=!1;return t.modules.frozen&&(e=t.modules.frozen.marginValue,"left"===t.modules.frozen.position?e+=t.getWidth()-3:e&&(e-=3)),!1!==e&&e+"px"}reinitializeColumn(t){var e=this.frozenColumnOffset(t);t.cells.forEach(i=>{i.modules.resize&&i.modules.resize.handleEl&&(e&&(i.modules.resize.handleEl.style[t.modules.frozen.position]=e,i.modules.resize.handleEl.style["z-index"]=11),i.element.after(i.modules.resize.handleEl))}),t.modules.resize&&t.modules.resize.handleEl&&(e&&(t.modules.resize.handleEl.style[t.modules.frozen.position]=e),t.element.after(t.modules.resize.handleEl))}initializeColumn(t,e,i,n){var s=this,o=i.definition.resizable,r={},a=i.getLastColumn();if("header"===t&&(r={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===o||o==t)&&this._checkResizability(a)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",function(t){t.stopPropagation()});var h=function(t){s.startColumn=i,s.initialNextColumn=s.nextColumn=a.nextColumn(),s._mouseDown(t,a,l)};l.addEventListener("mousedown",h),l.addEventListener("touchstart",h,{passive:!0}),l.addEventListener("dblclick",t=>{var e=a.getWidth();t.stopPropagation(),a.reinitializeWidth(!0),e!==a.getWidth()&&(s.dispatch("column-resized",a),s.dispatchExternal("columnResized",a.getComponent()))}),i.modules.frozen&&(l.style.position="sticky",l.style[i.modules.frozen.position]=this.frozenColumnOffset(i)),r.handleEl=l,n.parentNode&&i.visible&&n.after(l)}e.modules.resize=r}deInitializeColumn(t){this.deInitializeComponent(t),t.cells.forEach(t=>{this.deInitializeComponent(t)})}deInitializeComponent(t){var e;t.modules.resize&&(e=t.modules.resize.handleEl)&&e.parentElement&&e.parentElement.removeChild(e)}resizeHandle(t,e){t.modules.resize&&t.modules.resize.handleEl&&(t.modules.resize.handleEl.style.height=e)}resize(t,e){var i,n,s=void 0===t.clientX?t.touches[0].clientX:t.clientX,o=s-this.startX,r=s-this.latestX;if(this.latestX=s,this.table.rtl&&(o=-o,r=-r),i=e.width==e.minWidth||e.width==e.maxWidth,e.setWidth(this.startWidth+o),n=e.width==e.minWidth||e.width==e.maxWidth,r<0&&(this.nextColumn=this.initialNextColumn),this.table.options.resizableColumnFit&&this.nextColumn&&!(i&&n)){let t=this.nextColumn.getWidth();r>0&&t<=this.nextColumn.minWidth&&(this.nextColumn=this.nextColumn.nextColumn()),this.nextColumn&&this.nextColumn.setWidth(this.nextColumn.getWidth()-r)}this.table.columnManager.rerenderColumns(!0),!this.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights()}calcGuidePosition(t,e,i){var n=void 0===t.clientX?t.touches[0].clientX:t.clientX,s=i.getBoundingClientRect().x-this.table.element.getBoundingClientRect().x,o=this.table.element.getBoundingClientRect().x,r=e.element.getBoundingClientRect().left-o,a=Math.max(s+(n-this.startX),r+e.minWidth);return e.maxWidth&&(a=Math.min(a,r+e.maxWidth)),a}_checkResizability(t){return t.definition.resizable}_mouseDown(t,e,i){var n,s=this;function o(t){s.table.options.resizableColumnGuide?n.style.left=s.calcGuidePosition(t,e,i)+"px":s.resize(t,e)}function r(t){s.table.options.resizableColumnGuide&&(s.resize(t,e),n.remove()),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights(),document.body.removeEventListener("mouseup",r),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",r),s.table.element.classList.remove("tabulator-block-select"),s.startWidth!==e.getWidth()&&(s.table.columnManager.verticalAlignHeaders(),s.dispatch("column-resized",e),s.dispatchExternal("columnResized",e.getComponent()))}this.dispatchExternal("columnResizing",e.getComponent()),s.table.options.resizableColumnGuide&&((n=document.createElement("span")).classList.add("tabulator-col-resize-guide"),s.table.element.appendChild(n),setTimeout(()=>{n.style.left=s.calcGuidePosition(t,e,i)+"px"})),s.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===t.clientX?t.touches[0].clientX:t.clientX,s.latestX=s.startX,s.startWidth=e.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",r),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",r)}}class l1 extends aY{static moduleName="resizeRows";constructor(t){super(t),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1),this.registerTableOption("resizableRowGuide",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(t){var e=this,i=t.getElement(),n=document.createElement("div");n.className="tabulator-row-resize-handle";var s=document.createElement("div");s.className="tabulator-row-resize-handle prev",n.addEventListener("click",function(t){t.stopPropagation()});var o=function(i){e.startRow=t,e._mouseDown(i,t,n)};n.addEventListener("mousedown",o),n.addEventListener("touchstart",o,{passive:!0}),s.addEventListener("click",function(t){t.stopPropagation()});var r=function(i){var n=e.table.rowManager.prevDisplayRow(t);n&&(e.startRow=n,e._mouseDown(i,n,s))};s.addEventListener("mousedown",r),s.addEventListener("touchstart",r,{passive:!0}),i.appendChild(n),i.appendChild(s)}resize(t,e){e.setHeight(this.startHeight+((void 0===t.screenY?t.touches[0].screenY:t.screenY)-this.startY))}calcGuidePosition(t,e,i){var n=void 0===t.screenY?t.touches[0].screenY:t.screenY,s=i.getBoundingClientRect().y-this.table.element.getBoundingClientRect().y,o=this.table.element.getBoundingClientRect().y,r=e.element.getBoundingClientRect().top-o;return Math.max(s+(n-this.startY),r)}_mouseDown(t,e,i){var n,s=this;function o(t){s.table.options.resizableRowGuide?n.style.top=s.calcGuidePosition(t,e,i)+"px":s.resize(t,e)}function r(t){s.table.options.resizableRowGuide&&(s.resize(t,e),n.remove()),document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",r),s.table.element.classList.remove("tabulator-block-select"),s.dispatchExternal("rowResized",e.getComponent())}s.dispatchExternal("rowResizing",e.getComponent()),s.table.options.resizableRowGuide&&((n=document.createElement("span")).classList.add("tabulator-row-resize-guide"),s.table.element.appendChild(n),setTimeout(()=>{n.style.top=s.calcGuidePosition(t,e,i)+"px"})),s.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),s.startY=void 0===t.screenY?t.touches[0].screenY:t.screenY,s.startHeight=e.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",r),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",r)}}class l2 extends aY{static moduleName="resizeTable";constructor(t){super(t),this.binding=!1,this.visibilityObserver=!1,this.resizeObserver=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.visible=!1,this.initialized=!1,this.initialRedraw=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var t,e=this.table;this.tableHeight=e.element.clientHeight,this.tableWidth=e.element.clientWidth,e.element.parentNode&&(this.containerHeight=e.element.parentNode.clientHeight,this.containerWidth=e.element.parentNode.clientWidth),"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof ResizeObserver&&"virtual"===e.rowManager.getRenderMode()?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver(t=>{if(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell)){var i=Math.floor(t[0].contentRect.height),n=Math.floor(t[0].contentRect.width);(this.tableHeight!=i||this.tableWidth!=n)&&(this.tableHeight=i,this.tableWidth=n,e.element.parentNode&&(this.containerHeight=e.element.parentNode.clientHeight,this.containerWidth=e.element.parentNode.clientWidth),this.redrawTable())}}),this.resizeObserver.observe(e.element),t=window.getComputedStyle(e.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(t=>{if(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell)){var i=Math.floor(t[0].contentRect.height),n=Math.floor(t[0].contentRect.width);(this.containerHeight!=i||this.containerWidth!=n)&&(this.containerHeight=i,this.containerWidth=n,this.tableHeight=e.element.clientHeight,this.tableWidth=e.element.clientWidth),this.redrawTable()}}),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){e.browserMobile&&(!e.browserMobile||e.modules.edit&&(!e.modules.edit||e.modules.edit.currentCell))||(e.columnManager.rerenderColumns(!0),e.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}initializeVisibilityObserver(){this.visibilityObserver=new IntersectionObserver(t=>{this.visible=t[0].isIntersecting,this.initialized?this.visible&&(this.redrawTable(this.initialRedraw),this.initialRedraw=!1):(this.initialized=!0,this.initialRedraw=!this.visible)}),this.visibilityObserver.observe(this.table.element)}redrawTable(t){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(t))}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}var l3={format:{formatters:{responsiveCollapse:function(t,e,i){var n=document.createElement("div"),s=t.getRow()._row.modules.responsiveLayout;function o(t){var e=s.element;s.open=t,e&&(s.open?(n.classList.add("open"),e.style.display=""):(n.classList.remove("open"),e.style.display="none"))}return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML=` `,t.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",function(e){e.stopImmediatePropagation(),o(!s.open),t.getTable().rowManager.adjustTableSize()}),o(s.open),n}}}};class l4 extends aY{static moduleName="responsiveLayout";static moduleExtensions=l3;constructor(t){super(t),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(t){-1!==["fitColumns","fitDataStretch"].indexOf(this.layoutMode())||t||this.update()}initializeResponsivity(){var t=[];for(let e of(this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.collapseFormatter&&(this.collapseFormatter=this.collapseFormatter.bind(this.table)),this.table.columnManager.columnsByIndex.forEach((e,i)=>{e.modules.responsive&&e.modules.responsive.order&&e.modules.responsive.visible&&(e.modules.responsive.index=i,t.push(e),e.visible||"collapse"!==this.mode||this.hiddenColumns.push(e))}),t=(t=t.reverse()).sort((t,e)=>e.modules.responsive.order-t.modules.responsive.order||e.modules.responsive.index-t.modules.responsive.index),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent(),this.table.columnManager.columnsByIndex))if("responsiveCollapse"==e.definition.formatter){this.collapseHandleColumn=e;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(t){var e=t.getDefinition();t.modules.responsive={order:void 0===e.responsive?1:e.responsive,visible:!1!==e.visible}}initializeRow(t){var e;"calc"===t.type||((e=document.createElement("div")).classList.add("tabulator-responsive-collapse"),t.modules.responsiveLayout={element:e,open:this.collapseStartOpen},this.collapseStartOpen||(e.style.display="none"))}layoutRow(t){var e=t.getElement();t.modules.responsiveLayout&&(e.appendChild(t.modules.responsiveLayout.element),this.generateCollapsedRowContent(t))}updateColumnVisibility(t,e){!e&&t.modules.responsive&&(t.modules.responsive.visible=t.visible,this.initializeResponsivity())}hideColumn(t){var e=this.hiddenColumns.length;t.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(t),this.generateCollapsedContent(),this.collapseHandleColumn&&!e&&this.collapseHandleColumn.show())}showColumn(t){var e;t.show(!1,!0),t.setWidth(t.getWidth()),"collapse"===this.mode&&((e=this.hiddenColumns.indexOf(t))>-1&&this.hiddenColumns.splice(e,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var t=!0;t;){let e="fitColumns"==this.table.modules.layout.getMode()?this.table.columnManager.getFlexBaseWidth():this.table.columnManager.getWidth(),i=(this.table.options.headerVisible?this.table.columnManager.element.clientWidth:this.table.element.clientWidth)-e;if(i<0){let e=this.columns[this.index];e?(this.hideColumn(e),this.index++):t=!1}else{let e=this.columns[this.index-1];e&&i>0&&i>=e.getWidth()?(this.showColumn(e),this.index--):t=!1}this.table.rowManager.activeRowsCount||this.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){this.table.rowManager.getDisplayRows().forEach(t=>{this.generateCollapsedRowContent(t)})}generateCollapsedRowContent(t){var e,i;if(t.modules.responsiveLayout){for(e=t.modules.responsiveLayout.element;e.firstChild;)e.removeChild(e.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(t)))&&e.appendChild(i),t.calcHeight(!0)}}generateCollapsedRowData(t){var e,i=t.getData(),n=[];return this.hiddenColumns.forEach(s=>{var o=s.getFieldValue(i);s.definition.title&&s.field&&(s.modules.format&&this.table.options.responsiveLayoutCollapseUseFormatters?(e={value:!1,data:{},getValue:function(){return o},getData:function(){return i},getType:function(){return"cell"},getElement:function(){return document.createElement("div")},getRow:function(){return t.getComponent()},getColumn:function(){return s.getComponent()},getTable:()=>this.table},n.push({field:s.field,title:s.definition.title,value:s.modules.format.formatter.call(this.table.modules.format,e,s.modules.format.params,function(t){t()})})):n.push({field:s.field,title:s.definition.title,value:o}))}),n}formatCollapsedData(t){var e=document.createElement("table");return t.forEach(t=>{var i,n=document.createElement("tr"),s=document.createElement("td"),o=document.createElement("td"),r=document.createElement("strong");s.appendChild(r),this.modules.localize.bind("columns|"+t.field,function(e){r.innerHTML=e||t.title}),t.value instanceof Node?((i=document.createElement("div")).appendChild(t.value),o.appendChild(i)):o.innerHTML=t.value,n.appendChild(s),n.appendChild(o),e.appendChild(n)}),Object.keys(t).length?e:""}}var l6={format:{formatters:{rowSelection:function(t,e,i){var n=document.createElement("input"),s=!1;if(n.type="checkbox",n.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0)){if(n.addEventListener("click",t=>{t.stopPropagation()}),"function"==typeof t.getRow){var o=t.getRow();o instanceof ln?(n.addEventListener("change",t=>{"click"===this.table.options.selectableRowsRangeMode&&s?s=!1:o.toggleSelect()}),"click"===this.table.options.selectableRowsRangeMode&&n.addEventListener("click",t=>{s=!0,this.table.modules.selectRow.handleComplexRowClick(o._row,t)}),n.checked=o.isSelected&&o.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(o,n)):n=""}else n.addEventListener("change",t=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(e.rowRange)}),this.table.modules.selectRow.registerHeaderSelectCheckbox(n)}return n}}}};class l5 extends aY{static moduleName="selectRow";static moduleExtensions=l6;constructor(t){super(t),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectableRows","highlight"),this.registerTableOption("selectableRowsRangeMode","drag"),this.registerTableOption("selectableRowsRollingSelection",!0),this.registerTableOption("selectableRowsPersistence",!0),this.registerTableOption("selectableRowsCheck",function(t,e){return!0}),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){this.deprecatedOptionsCheck(),"highlight"===this.table.options.selectableRows&&this.table.options.selectableRange&&(this.table.options.selectableRows=!1),!1!==this.table.options.selectableRows&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectableRows&&!this.table.options.selectableRowsPersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}deprecatedOptionsCheck(){}rowRetrieve(t,e){return"selected"===t?this.selectedRows:e}rowDeleted(t){this._deselectRow(t,!0)}clearSelectionData(t){var e=this.selectedRows.length;this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],e&&!0!==t&&this._rowSelectionChanged()}initializeRow(t){var e=this,i=e.checkRowSelectability(t),n=t.getElement(),s=function(){setTimeout(function(){e.selecting=!1},50),document.body.removeEventListener("mouseup",s)};t.modules.select={selected:!1},n.classList.toggle("tabulator-selectable",i),n.classList.toggle("tabulator-unselectable",!i),e.checkRowSelectability(t)&&e.table.options.selectableRows&&"highlight"!=e.table.options.selectableRows&&("click"===e.table.options.selectableRowsRangeMode?n.addEventListener("click",this.handleComplexRowClick.bind(this,t)):(n.addEventListener("click",function(i){e.table.modExists("edit")&&e.table.modules.edit.getCurrentCell()||e.table._clearSelection(),e.selecting||e.toggleRow(t)}),n.addEventListener("mousedown",function(i){if(i.shiftKey)return e.table._clearSelection(),e.selecting=!0,e.selectPrev=[],document.body.addEventListener("mouseup",s),document.body.addEventListener("keyup",s),e.toggleRow(t),!1}),n.addEventListener("mouseenter",function(i){e.selecting&&(e.table._clearSelection(),e.toggleRow(t),e.selectPrev[1]==t&&e.toggleRow(e.selectPrev[0]))}),n.addEventListener("mouseout",function(i){e.selecting&&(e.table._clearSelection(),e.selectPrev.unshift(t))})))}handleComplexRowClick(t,e){if(e.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||t;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),n=this.table.rowManager.getDisplayRowIndex(t),s=i<=n?i:n,o=this.table.rowManager.getDisplayRows().slice(0).splice(s,(i>=n?i:n)-s+1);e.ctrlKey||e.metaKey?(o.forEach(e=>{e!==this.lastClickedRow&&(!0===this.table.options.selectableRows||this.isRowSelected(t)?this.toggleRow(e):this.selectedRows.lengththis.table.options.selectableRows&&(o=o.slice(0,this.table.options.selectableRows)),this.selectRows(o)),this.table._clearSelection()}else e.ctrlKey||e.metaKey?this.toggleRow(t):(this.deselectRows(void 0,!0),this.selectRows(t)),this.lastClickedRow=t}checkRowSelectability(t){return!!t&&"row"===t.type&&this.table.options.selectableRowsCheck.call(this.table,t.getComponent())}toggleRow(t){this.checkRowSelectability(t)&&(t.modules.select&&t.modules.select.selected?this._deselectRow(t):this._selectRow(t))}selectRows(t){var e,i,n=[];switch(typeof t){case"undefined":e=this.table.rowManager.rows;break;case"number":e=this.table.rowManager.findRow(t);break;case"string":(e=this.table.rowManager.findRow(t))||(e=this.table.rowManager.getRows(t));break;default:e=t}Array.isArray(e)?e.length&&(e.forEach(t=>{(i=this._selectRow(t,!0,!0))&&n.push(i)}),this._rowSelectionChanged(!1,n)):e&&this._selectRow(e,!1,!0)}_selectRow(t,e,i){if(!isNaN(this.table.options.selectableRows)&&!0!==this.table.options.selectableRows&&!i&&this.selectedRows.length>=this.table.options.selectableRows){if(!this.table.options.selectableRowsRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var n=this.table.rowManager.findRow(t);if(n){if(-1==this.selectedRows.indexOf(n))return n.getElement().classList.add("tabulator-selected"),n.modules.select||(n.modules.select={}),n.modules.select.selected=!0,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!0),this.selectedRows.push(n),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!0),this.dispatchExternal("rowSelected",n.getComponent()),this._rowSelectionChanged(e,n),n}else e||console.warn("Selection Error - No such row found, ignoring selection:"+t)}isRowSelected(t){return -1!==this.selectedRows.indexOf(t)}deselectRows(t,e){var i,n,s=[];switch(typeof t){case"undefined":i=Object.assign([],this.selectedRows);break;case"number":i=this.table.rowManager.findRow(t);break;case"string":(i=this.table.rowManager.findRow(t))||(i=this.table.rowManager.getRows(t));break;default:i=t}Array.isArray(i)?i.length&&(i.forEach(t=>{(n=this._deselectRow(t,!0,!0))&&s.push(n)}),this._rowSelectionChanged(e,[],s)):i&&this._deselectRow(i,e,!0)}_deselectRow(t,e){var i,n,s=this.table.rowManager.findRow(t);if(s){if((i=this.selectedRows.findIndex(function(t){return t==s}))>-1)return(n=s.getElement())&&n.classList.remove("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!1,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!1),this.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!1),this.dispatchExternal("rowDeselected",s.getComponent()),this._rowSelectionChanged(e,void 0,s),s}else e||console.warn("Deselection Error - No such row found, ignoring selection:"+t)}getSelectedData(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getData())}),t}getSelectedRows(){var t=[];return this.selectedRows.forEach(function(e){t.push(e.getComponent())}),t}_rowSelectionChanged(t,e=[],i=[]){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),t||(Array.isArray(e)||(e=[e]),e=e.map(t=>t.getComponent()),Array.isArray(i)||(i=[i]),i=i.map(t=>t.getComponent()),this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows(),e,i))}registerRowSelectCheckbox(t,e){t._row.modules.select||(t._row.modules.select={}),t._row.modules.select.checkboxEl=e}registerHeaderSelectCheckbox(t){this.headerCheckboxElement=t}childRowSelection(t,e){var i=this.table.modules.dataTree.getChildren(t,!0,!0);if(e)for(let t of i)this._selectRow(t,!0);else for(let t of i)this._deselectRow(t,!0)}}class l9{constructor(t){return this._range=t,new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._range.table.componentFunctionBinder.handle("range",t._range,e)}})}getElement(){return this._range.element}getData(){return this._range.getData()}getCells(){return this._range.getCells(!0,!0)}getStructuredCells(){return this._range.getStructuredCells()}getRows(){return this._range.getRows().map(t=>t.getComponent())}getColumns(){return this._range.getColumns().map(t=>t.getComponent())}getBounds(){return this._range.getBounds()}getTopEdge(){return this._range.top}getBottomEdge(){return this._range.bottom}getLeftEdge(){return this._range.left}getRightEdge(){return this._range.right}setBounds(t,e){this._range.destroyedGuard("setBounds")&&this._range.setBounds(t?t._cell:t,e?e._cell:e)}setStartBound(t){this._range.destroyedGuard("setStartBound")&&(this._range.setEndBound(t?t._cell:t),this._range.rangeManager.layoutElement())}setEndBound(t){this._range.destroyedGuard("setEndBound")&&(this._range.setEndBound(t?t._cell:t),this._range.rangeManager.layoutElement())}clearValues(){this._range.destroyedGuard("clearValues")&&this._range.clearValues()}remove(){this._range.destroyedGuard("remove")&&this._range.destroy(!0)}}class l7 extends aU{constructor(t,e,i,n){super(t),this.rangeManager=e,this.element=null,this.initialized=!1,this.initializing={start:!1,end:!1},this.destroyed=!1,this.top=0,this.bottom=0,this.left=0,this.right=0,this.table=t,this.start={row:0,col:0},this.end={row:0,col:0},this.rangeManager.rowHeader&&(this.left=1,this.right=1,this.start.col=1,this.end.col=1),this.initElement(),setTimeout(()=>{this.initBounds(i,n)})}initElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-range")}initBounds(t,e){this._updateMinMax(),t&&this.setBounds(t,e||t)}setStart(t,e){(this.start.row!==t||this.start.col!==e)&&(this.start.row=t,this.start.col=e,this.initializing.start=!0,this._updateMinMax())}setEnd(t,e){(this.end.row!==t||this.end.col!==e)&&(this.end.row=t,this.end.col=e,this.initializing.end=!0,this._updateMinMax())}setBounds(t,e,i){t&&this.setStartBound(t),this.setEndBound(e||t),this.rangeManager.layoutElement(i)}setStartBound(t){var e,i;"column"===t.type?this.rangeManager.columnSelection&&this.setStart(0,t.getPosition()-1):(e=t.row.position-1,i=t.column.getPosition()-1,t.column===this.rangeManager.rowHeader?this.setStart(e,1):this.setStart(e,i))}setEndBound(t){var e,i,n,s=this._getTableRows().length;"column"===t.type?this.rangeManager.columnSelection&&("column"===this.rangeManager.selecting?this.setEnd(s-1,t.getPosition()-1):"cell"===this.rangeManager.selecting&&this.setEnd(0,t.getPosition()-1)):(e=t.row.position-1,i=t.column.getPosition()-1,n=t.column===this.rangeManager.rowHeader,"row"===this.rangeManager.selecting?this.setEnd(e,this._getTableColumns().length-1):"row"!==this.rangeManager.selecting&&n?this.setEnd(e,0):"column"===this.rangeManager.selecting?this.setEnd(s-1,i):this.setEnd(e,i))}_updateMinMax(){this.top=Math.min(this.start.row,this.end.row),this.bottom=Math.max(this.start.row,this.end.row),this.left=Math.min(this.start.col,this.end.col),this.right=Math.max(this.start.col,this.end.col),this.initialized?this.dispatchExternal("rangeChanged",this.getComponent()):this.initializing.start&&this.initializing.end&&(this.initialized=!0,this.dispatchExternal("rangeAdded",this.getComponent()))}_getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}_getTableRows(){return this.table.rowManager.getDisplayRows().filter(t=>"row"===t.type)}layout(){var t,e,i,n,s,o,r,a,l,h,c=this.table.rowManager.renderer.vDomTop,u=this.table.rowManager.renderer.vDomBottom,d=this.table.columnManager.renderer.leftCol,m=this.table.columnManager.renderer.rightCol;"virtual"===this.table.options.renderHorizontal&&this.rangeManager.rowHeader&&(m+=1),null==c&&(c=0),null==u&&(u=1/0),null==d&&(d=0),null==m&&(m=1/0),this.overlaps(d,c,m,u)&&(t=Math.max(this.top,c),e=Math.min(this.bottom,u),i=Math.max(this.left,d),n=Math.min(this.right,m),s=this.rangeManager.getCell(t,i),o=this.rangeManager.getCell(e,n),r=s.getElement(),a=o.getElement(),l=s.row.getElement(),h=o.row.getElement(),this.element.classList.add("tabulator-range-active"),this.table.rtl?(this.element.style.right=l.offsetWidth-r.offsetLeft-r.offsetWidth+"px",this.element.style.width=r.offsetLeft+r.offsetWidth-a.offsetLeft+"px"):(this.element.style.left=l.offsetLeft+r.offsetLeft+"px",this.element.style.width=a.offsetLeft+a.offsetWidth-r.offsetLeft+"px"),this.element.style.top=l.offsetTop+"px",this.element.style.height=h.offsetTop+h.offsetHeight-l.offsetTop+"px")}atTopLeft(t){return t.row.position-1===this.top&&t.column.getPosition()-1===this.left}atBottomRight(t){return t.row.position-1===this.bottom&&t.column.getPosition()-1===this.right}occupies(t){return this.occupiesRow(t.row)&&this.occupiesColumn(t.column)}occupiesRow(t){return this.top<=t.position-1&&t.position-1<=this.bottom}occupiesColumn(t){return this.left<=t.getPosition()-1&&t.getPosition()-1<=this.right}overlaps(t,e,i,n){return!(this.left>i)&&!(t>this.right)&&!(this.top>n)&&!(e>this.bottom)}getData(){var t=[],e=this.getRows(),i=this.getColumns();return e.forEach(e=>{var n=e.getData(),s={};i.forEach(t=>{s[t.field]=n[t.field]}),t.push(s)}),t}getCells(t,e){var i=[],n=this.getRows(),s=this.getColumns();return t?i=n.map(t=>{var i=[];return t.getCells().forEach(t=>{s.includes(t.column)&&i.push(e?t.getComponent():t)}),i}):n.forEach(t=>{t.getCells().forEach(t=>{s.includes(t.column)&&i.push(e?t.getComponent():t)})}),i}getStructuredCells(){return this.getCells(!0,!0)}getRows(){return this._getTableRows().slice(this.top,this.bottom+1)}getColumns(){return this._getTableColumns().slice(this.left,this.right+1)}clearValues(){var t=this.getCells(),e=this.table.options.selectableRangeClearCellsValue;this.table.blockRedraw(),t.forEach(t=>{t.setValue(e)}),this.table.restoreRedraw()}getBounds(t){var e=this.getCells(!1,t),i={start:null,end:null};return e.length?(i.start=e[0],i.end=e[e.length-1]):console.warn("No bounds defined on range"),i}getComponent(){return this.component||(this.component=new l9(this)),this.component}destroy(t){this.destroyed=!0,this.element.remove(),t&&this.rangeManager.rangeRemoved(this),this.initialized&&this.dispatchExternal("rangeRemoved",this.getComponent())}destroyedGuard(t){return this.destroyed&&console.warn("You cannot call the "+t+" function on a destroyed range"),!this.destroyed}}var l8={keybindings:{bindings:{rangeJumpUp:["ctrl + 38","meta + 38"],rangeJumpDown:["ctrl + 40","meta + 40"],rangeJumpLeft:["ctrl + 37","meta + 37"],rangeJumpRight:["ctrl + 39","meta + 39"],rangeExpandUp:"shift + 38",rangeExpandDown:"shift + 40",rangeExpandLeft:"shift + 37",rangeExpandRight:"shift + 39",rangeExpandJumpUp:["ctrl + shift + 38","meta + shift + 38"],rangeExpandJumpDown:["ctrl + shift + 40","meta + shift + 40"],rangeExpandJumpLeft:["ctrl + shift + 37","meta + shift + 37"],rangeExpandJumpRight:["ctrl + shift + 39","meta + shift + 39"]},actions:{rangeJumpLeft:function(t){this.dispatch("keybinding-nav-range",t,"left",!0,!1)},rangeJumpRight:function(t){this.dispatch("keybinding-nav-range",t,"right",!0,!1)},rangeJumpUp:function(t){this.dispatch("keybinding-nav-range",t,"up",!0,!1)},rangeJumpDown:function(t){this.dispatch("keybinding-nav-range",t,"down",!0,!1)},rangeExpandLeft:function(t){this.dispatch("keybinding-nav-range",t,"left",!1,!0)},rangeExpandRight:function(t){this.dispatch("keybinding-nav-range",t,"right",!1,!0)},rangeExpandUp:function(t){this.dispatch("keybinding-nav-range",t,"up",!1,!0)},rangeExpandDown:function(t){this.dispatch("keybinding-nav-range",t,"down",!1,!0)},rangeExpandJumpLeft:function(t){this.dispatch("keybinding-nav-range",t,"left",!0,!0)},rangeExpandJumpRight:function(t){this.dispatch("keybinding-nav-range",t,"right",!0,!0)},rangeExpandJumpUp:function(t){this.dispatch("keybinding-nav-range",t,"up",!0,!0)},rangeExpandJumpDown:function(t){this.dispatch("keybinding-nav-range",t,"down",!0,!0)}}},clipboard:{pasteActions:{range:function(t){var e,i,n,s,o,r=[],a=this.table.modules.selectRange.activeRange,l=!1;return o=t.length,a&&(i=(e=a.getBounds()).start,e.start===e.end&&(l=!0),i&&(n=(r=this.table.rowManager.activeRows.slice()).indexOf(i.row),s=l?t.length:r.indexOf(e.end.row)-n+1,n>-1&&(this.table.blockRedraw(),(r=r.slice(n,n+s)).forEach((e,i)=>{e.updateData(t[i%o])}),this.table.restoreRedraw()))),r}},pasteParsers:{range:function(t){var e,i,n,s,o,r=[],a=[],l=this.table.modules.selectRange.activeRange,h=!1;return!!(l&&(i=(e=l.getBounds()).start,e.start===e.end&&(h=!0),i&&((t=t.split("\n")).forEach(function(t){r.push(t.split(" "))}),r.length&&(o=(s=this.table.columnManager.getVisibleColumnsByIndex()).indexOf(i.column))>-1)))&&(n=h?r[0].length:s.indexOf(e.end.column)-o+1,s=s.slice(o,o+n),r.forEach(t=>{var e={},i=t.length;s.forEach(function(n,s){e[n.field]=t[s%i]}),a.push(e)}),a)}}},export:{columnLookups:{range:function(){var t=this.modules.selectRange.selectedColumns();return this.columnManager.rowHeader&&t.unshift(this.columnManager.rowHeader),t}},rowLookups:{range:function(){return this.modules.selectRange.selectedRows()}}}};class ht extends aY{static moduleName="selectRange";static moduleInitOrder=1;static moduleExtensions=l8;constructor(t){super(t),this.selecting="cell",this.mousedown=!1,this.ranges=[],this.overlay=null,this.rowHeader=null,this.layoutChangeTimeout=null,this.columnSelection=!1,this.rowSelection=!1,this.maxRanges=0,this.activeRange=!1,this.blockKeydown=!1,this.keyDownEvent=this._handleKeyDown.bind(this),this.mouseUpEvent=this._handleMouseUp.bind(this),this.registerTableOption("selectableRange",!1),this.registerTableOption("selectableRangeColumns",!1),this.registerTableOption("selectableRangeRows",!1),this.registerTableOption("selectableRangeClearCells",!1),this.registerTableOption("selectableRangeClearCellsValue",void 0),this.registerTableFunction("getRangesData",this.getRangesData.bind(this)),this.registerTableFunction("getRanges",this.getRanges.bind(this)),this.registerTableFunction("addRange",this.addRangeFromComponent.bind(this)),this.registerComponentFunction("cell","getRanges",this.cellGetRanges.bind(this)),this.registerComponentFunction("row","getRanges",this.rowGetRanges.bind(this)),this.registerComponentFunction("column","getRanges",this.colGetRanges.bind(this))}initialize(){this.options("selectableRange")&&(this.options("selectableRows")?console.warn("SelectRange functionality cannot be used in conjunction with row selection"):(this.maxRanges=this.options("selectableRange"),this.initializeTable(),this.initializeWatchers()),this.options("columns").findIndex(t=>t.frozen)>0&&console.warn("Having frozen column in arbitrary position with selectRange option may result in unpredictable behavior."),this.options("columns").filter(t=>t.frozen)>1&&console.warn("Having multiple frozen columns with selectRange option may result in unpredictable behavior."))}initializeTable(){this.overlay=document.createElement("div"),this.overlay.classList.add("tabulator-range-overlay"),this.rangeContainer=document.createElement("div"),this.rangeContainer.classList.add("tabulator-range-container"),this.activeRangeCellElement=document.createElement("div"),this.activeRangeCellElement.classList.add("tabulator-range-cell-active"),this.overlay.appendChild(this.rangeContainer),this.overlay.appendChild(this.activeRangeCellElement),this.table.rowManager.element.addEventListener("keydown",this.keyDownEvent),this.resetRanges(),this.table.rowManager.element.appendChild(this.overlay),this.table.columnManager.element.setAttribute("tabindex",0),this.table.element.classList.add("tabulator-ranges")}initializeWatchers(){this.columnSelection=this.options("selectableRangeColumns"),this.rowSelection=this.options("selectableRangeRows"),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-mousedown",this.handleColumnMouseDown.bind(this)),this.subscribe("column-mousemove",this.handleColumnMouseMove.bind(this)),this.subscribe("column-resized",this.handleColumnResized.bind(this)),this.subscribe("column-moving",this.handleColumnMoving.bind(this)),this.subscribe("column-moved",this.handleColumnMoved.bind(this)),this.subscribe("column-width",this.layoutChange.bind(this)),this.subscribe("column-height",this.layoutChange.bind(this)),this.subscribe("column-resized",this.layoutChange.bind(this)),this.subscribe("columns-loaded",this.updateHeaderColumn.bind(this)),this.subscribe("cell-height",this.layoutChange.bind(this)),this.subscribe("cell-rendered",this.renderCell.bind(this)),this.subscribe("cell-mousedown",this.handleCellMouseDown.bind(this)),this.subscribe("cell-mousemove",this.handleCellMouseMove.bind(this)),this.subscribe("cell-click",this.handleCellClick.bind(this)),this.subscribe("cell-editing",this.handleEditingCell.bind(this)),this.subscribe("page-changed",this.redraw.bind(this)),this.subscribe("scroll-vertical",this.layoutChange.bind(this)),this.subscribe("scroll-horizontal",this.layoutChange.bind(this)),this.subscribe("data-destroy",this.tableDestroyed.bind(this)),this.subscribe("data-processed",this.resetRanges.bind(this)),this.subscribe("table-layout",this.layoutElement.bind(this)),this.subscribe("table-redraw",this.redraw.bind(this)),this.subscribe("table-destroy",this.tableDestroyed.bind(this)),this.subscribe("edit-editor-clear",this.finishEditingCell.bind(this)),this.subscribe("edit-blur",this.restoreFocus.bind(this)),this.subscribe("keybinding-nav-prev",this.keyNavigate.bind(this,"left")),this.subscribe("keybinding-nav-next",this.keyNavigate.bind(this,"right")),this.subscribe("keybinding-nav-left",this.keyNavigate.bind(this,"left")),this.subscribe("keybinding-nav-right",this.keyNavigate.bind(this,"right")),this.subscribe("keybinding-nav-up",this.keyNavigate.bind(this,"up")),this.subscribe("keybinding-nav-down",this.keyNavigate.bind(this,"down")),this.subscribe("keybinding-nav-range",this.keyNavigateRange.bind(this))}initializeColumn(t){this.columnSelection&&t.definition.headerSort&&"icon"!==this.options("headerSortClickElement")&&console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'."),t.modules.edit}updateHeaderColumn(){var t;this.rowSelection&&(this.rowHeader=this.table.columnManager.getVisibleColumnsByIndex()[0],this.rowHeader&&(this.rowHeader.definition.cssClass=this.rowHeader.definition.cssClass+" tabulator-range-row-header",this.rowHeader.definition.headerSort&&console.warn("Using column headerSort with selectableRangeRows option may result in unpredictable behavior"),this.rowHeader.definition.editor&&console.warn("Using column editor with selectableRangeRows option may result in unpredictable behavior"))),this.table.modules.frozenColumns&&this.table.modules.frozenColumns.active&&((t=this.table.modules.frozenColumns.getFrozenColumns()).length>1||1===t.length&&t[0]!==this.rowHeader)&&console.warn("Using frozen columns that are not the range header in combination with the selectRange option may result in unpredictable behavior")}getRanges(){return this.ranges.map(t=>t.getComponent())}getRangesData(){return this.ranges.map(t=>t.getData())}addRangeFromComponent(t,e){return t=t?t._cell:null,e=e?e._cell:null,this.addRange(t,e)}cellGetRanges(t){return(t.column===this.rowHeader?this.ranges.filter(e=>e.occupiesRow(t.row)):this.ranges.filter(e=>e.occupies(t))).map(t=>t.getComponent())}rowGetRanges(t){return this.ranges.filter(e=>e.occupiesRow(t)).map(t=>t.getComponent())}colGetRanges(t){return this.ranges.filter(e=>e.occupiesColumn(t)).map(t=>t.getComponent())}_handleMouseUp(t){this.mousedown=!1,document.removeEventListener("mouseup",this.mouseUpEvent)}_handleKeyDown(t){if(!this.blockKeydown&&(!this.table.modules.edit||this.table.modules.edit&&!this.table.modules.edit.currentCell)){if("Enter"===t.key){if(this.table.modules.edit&&this.table.modules.edit.currentCell)return;this.table.modules.edit.editCell(this.getActiveCell()),t.preventDefault()}("Backspace"===t.key||"Delete"===t.key)&&this.options("selectableRangeClearCells")&&this.activeRange&&this.activeRange.clearValues()}}initializeFocus(t){var e;this.restoreFocus();try{document.selection?((e=document.body.createTextRange()).moveToElementText(t.getElement()),e.select()):window.getSelection&&((e=document.createRange()).selectNode(t.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(e))}catch(t){}}restoreFocus(t){return this.table.rowManager.element.focus(),!0}handleColumnResized(t){("column"===this.selecting||"all"===this.selecting)&&this.ranges.some(e=>e.occupiesColumn(t))&&this.ranges.forEach(e=>{e.getColumns(!0).forEach(e=>{e!==t&&e.setWidth(t.width)})})}handleColumnMoving(t,e){this.resetRanges().setBounds(e),this.overlay.style.visibility="hidden"}handleColumnMoved(t,e,i){this.activeRange.setBounds(t),this.layoutElement()}handleColumnMouseDown(t,e){!(2===t.button&&("column"===this.selecting||"all"===this.selecting)&&this.activeRange.occupiesColumn(e))&&(this.table.options.movableColumns&&"column"===this.selecting&&this.activeRange.occupiesColumn(e)||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(t,e)))}handleColumnMouseMove(t,e){e!==this.rowHeader&&this.mousedown&&"all"!==this.selecting&&this.activeRange.setBounds(!1,e,!0)}renderCell(t){var e=t.getElement(),i=this.ranges.findIndex(e=>e.occupies(t));e.classList.toggle("tabulator-range-selected",-1!==i),e.classList.toggle("tabulator-range-only-cell-selected",1===this.ranges.length&&this.ranges[0].atTopLeft(t)&&this.ranges[0].atBottomRight(t)),e.dataset.range=i}handleCellMouseDown(t,e){2===t.button&&(this.activeRange.occupies(e)||("row"===this.selecting||"all"===this.selecting)&&this.activeRange.occupiesRow(e.row))||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(t,e))}handleCellMouseMove(t,e){this.mousedown&&"all"!==this.selecting&&this.activeRange.setBounds(!1,e,!0)}handleCellClick(t,e){this.initializeFocus(e)}handleEditingCell(t){this.activeRange&&this.activeRange.setBounds(t)}finishEditingCell(){this.blockKeydown=!0,this.table.rowManager.element.focus(),setTimeout(()=>{this.blockKeydown=!1},10)}keyNavigate(t,e){this.navigate(!1,!1,t),e.preventDefault()}keyNavigateRange(t,e,i,n){this.navigate(i,n,e),t.preventDefault()}navigate(t,e,i){var n,s,o,r,a,l,h=!1;if(this.table.modules.edit&&this.table.modules.edit.currentCell)return!1;if(this.ranges.length>1&&(this.ranges=this.ranges.filter(t=>t===this.activeRange?(t.setEnd(t.start.row,t.start.col),!0):(t.destroy(),!1))),n=this.activeRange,o=(s=e?n.end:n.start).row,r=s.col,t)switch(i){case"left":r=this.findJumpCellLeft(n.start.row,s.col);break;case"right":r=this.findJumpCellRight(n.start.row,s.col);break;case"up":o=this.findJumpCellUp(s.row,n.start.col);break;case"down":o=this.findJumpCellDown(s.row,n.start.col)}else{if(e&&("row"===this.selecting&&("left"===i||"right"===i)||"column"===this.selecting&&("up"===i||"down"===i)))return;switch(i){case"left":r=Math.max(r-1,0);break;case"right":r=Math.min(r+1,this.getTableColumns().length-1);break;case"up":o=Math.max(o-1,0);break;case"down":o=Math.min(o+1,this.getTableRows().length-1)}}if(this.rowHeader&&0===r&&(r=1),h=r!==s.col||o!==s.row,e||n.setStart(o,r),n.setEnd(o,r),e||(this.selecting="cell"),h)return a=this.getRowByRangePos(n.end.row),l=this.getColumnByRangePos(n.end.col),("left"===i||"right"===i)&&null===l.getElement().parentNode?l.getComponent().scrollTo(void 0,!1):("up"===i||"down"===i)&&null===a.getElement().parentNode?a.getComponent().scrollTo(void 0,!1):this.autoScroll(n,a.getElement(),l.getElement()),this.layoutElement(),!0}rangeRemoved(t){this.ranges=this.ranges.filter(e=>e!==t),this.activeRange===t&&(this.ranges.length?this.activeRange=this.ranges[this.ranges.length-1]:this.addRange()),this.layoutElement()}findJumpRow(t,e,i,n,s){return i&&(e=e.reverse()),this.findJumpItem(n,s,e,function(e){return e.getData()[t.getField()]})}findJumpCol(t,e,i,n,s){return i&&(e=e.reverse()),this.findJumpItem(n,s,e,function(e){return t.getData()[e.getField()]})}findJumpItem(t,e,i,n){var s;for(let o of i){let i=n(o);if(t){if(s=o,i)break}else if(e){if(s=o,i)break}else if(i)s=o;else break}return s}findJumpCellLeft(t,e){var i=this.getRowByRangePos(t),n=this.getTableColumns(),s=this.isEmpty(i.getData()[n[e].getField()]),o=!!n[e-1]&&this.isEmpty(i.getData()[n[e-1].getField()]),r=this.rowHeader?n.slice(1,e):n.slice(0,e),a=this.findJumpCol(i,r,!0,s,o);return a?a.getPosition()-1:e}findJumpCellRight(t,e){var i=this.getRowByRangePos(t),n=this.getTableColumns(),s=this.isEmpty(i.getData()[n[e].getField()]),o=!!n[e+1]&&this.isEmpty(i.getData()[n[e+1].getField()]),r=this.findJumpCol(i,n.slice(e+1,n.length),!1,s,o);return r?r.getPosition()-1:e}findJumpCellUp(t,e){var i=this.getColumnByRangePos(e),n=this.getTableRows(),s=this.isEmpty(n[t].getData()[i.getField()]),o=!!n[t-1]&&this.isEmpty(n[t-1].getData()[i.getField()]),r=this.findJumpRow(i,n.slice(0,t),!0,s,o);return r?r.position-1:t}findJumpCellDown(t,e){var i=this.getColumnByRangePos(e),n=this.getTableRows(),s=this.isEmpty(n[t].getData()[i.getField()]),o=!!n[t+1]&&this.isEmpty(n[t+1].getData()[i.getField()]),r=this.findJumpRow(i,n.slice(t+1,n.length),!1,s,o);return r?r.position-1:t}newSelection(t,e){var i;if("column"===e.type){if(!this.columnSelection)return;if(e===this.rowHeader){i=this.resetRanges(),this.selecting="all";var n,s=this.getCell(-1,-1);n=this.rowHeader?this.getCell(0,1):this.getCell(0,0),i.setBounds(n,s);return}this.selecting="column"}else e.column===this.rowHeader?this.selecting="row":this.selecting="cell";t.shiftKey?this.activeRange.setBounds(!1,e):t.ctrlKey?this.addRange().setBounds(e):this.resetRanges().setBounds(e)}autoScroll(t,e,i){var n,s,o,r,a,l=this.table.rowManager.element;void 0===e&&(e=this.getRowByRangePos(t.end.row).getElement()),void 0===i&&(i=this.getColumnByRangePos(t.end.col).getElement()),this.rowHeader&&(n=this.rowHeader.getElement()),s={left:i.offsetLeft,right:i.offsetLeft+i.offsetWidth,top:e.offsetTop,bottom:e.offsetTop+e.offsetHeight},o={left:l.scrollLeft,right:Math.ceil(l.scrollLeft+l.clientWidth),top:l.scrollTop,bottom:l.scrollTop+l.offsetHeight-this.table.rowManager.scrollbarWidth},n&&(o.left+=n.offsetWidth),r=o.lefto.right&&(l.scrollLeft=s.right-l.clientWidth)),!a&&(s.topo.bottom&&(l.scrollTop=s.bottom-l.clientHeight))}layoutChange(){this.overlay.style.visibility="hidden",clearTimeout(this.layoutChangeTimeout),this.layoutChangeTimeout=setTimeout(this.layoutRanges.bind(this),200)}redraw(t){t&&(this.selecting="cell",this.resetRanges(),this.layoutElement())}layoutElement(t){(t?this.table.rowManager.getVisibleRows(!0):this.table.rowManager.getRows()).forEach(t=>{"row"===t.type&&(this.layoutRow(t),t.cells.forEach(t=>this.renderCell(t)))}),this.getTableColumns().forEach(t=>{this.layoutColumn(t)}),this.layoutRanges()}layoutRow(t){var e=t.getElement(),i=!1,n=this.ranges.some(e=>e.occupiesRow(t));"row"===this.selecting?i=n:"all"===this.selecting&&(i=!0),e.classList.toggle("tabulator-range-selected",i),e.classList.toggle("tabulator-range-highlight",n)}layoutColumn(t){var e=t.getElement(),i=!1,n=this.ranges.some(e=>e.occupiesColumn(t));"column"===this.selecting?i=n:"all"===this.selecting&&(i=!0),e.classList.toggle("tabulator-range-selected",i),e.classList.toggle("tabulator-range-highlight",n)}layoutRanges(){var t,e,i;this.table.initialized&&(t=this.getActiveCell())&&(e=t.getElement(),i=t.row.getElement(),this.table.rtl?this.activeRangeCellElement.style.right=i.offsetWidth-e.offsetLeft-e.offsetWidth+"px":this.activeRangeCellElement.style.left=i.offsetLeft+e.offsetLeft+"px",this.activeRangeCellElement.style.top=i.offsetTop+"px",this.activeRangeCellElement.style.width=e.offsetWidth+"px",this.activeRangeCellElement.style.height=i.offsetHeight+"px",this.ranges.forEach(t=>t.layout()),this.overlay.style.visibility="visible")}getCell(t,e){var i;return e<0&&(e=this.getTableColumns().length+e)<0?null:(t<0&&(t=this.getTableRows().length+t),(i=this.table.rowManager.getRowFromPosition(t+1))?i.getCells(!1,!0).filter(t=>t.column.visible)[e]:null)}getActiveCell(){return this.getCell(this.activeRange.start.row,this.activeRange.start.col)}getRowByRangePos(t){return this.getTableRows()[t]}getColumnByRangePos(t){return this.getTableColumns()[t]}getTableRows(){return this.table.rowManager.getDisplayRows().filter(t=>"row"===t.type)}getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}addRange(t,e){var i;return!0!==this.maxRanges&&this.ranges.length>=this.maxRanges&&this.ranges.shift().destroy(),i=new l7(this.table,this,t,e),this.activeRange=i,this.ranges.push(i),this.rangeContainer.appendChild(i.element),i}resetRanges(){var t,e;return this.ranges.forEach(t=>t.destroy()),this.ranges=[],t=this.addRange(),this.table.rowManager.activeRows.length&&(e=this.table.rowManager.activeRows[0].cells.filter(t=>t.column.visible)[this.rowHeader?1:0])&&(t.setBounds(e),this.initializeFocus(e)),t}tableDestroyed(){document.removeEventListener("mouseup",this.mouseUpEvent),this.table.rowManager.element.removeEventListener("keydown",this.keyDownEvent)}selectedRows(t){return t?this.activeRange.getRows().map(t=>t.getComponent()):this.activeRange.getRows()}selectedColumns(t){return t?this.activeRange.getColumns().map(t=>t.getComponent()):this.activeRange.getColumns()}isEmpty(t){return null==t||""===t}}function he(t,e,i,n,s,o,r){var a=window.DateTime||luxon.DateTime,l=r.format||"dd/MM/yyyy HH:mm:ss",h=r.alignEmptyValues,c=0;if(void 0!==a){if(a.isDateTime(t)||(t="iso"===l?a.fromISO(String(t)):a.fromFormat(String(t),l)),a.isDateTime(e)||(e="iso"===l?a.fromISO(String(e)):a.fromFormat(String(e),l)),t.isValid){if(e.isValid)return t-e;c=1}else c=e.isValid?-1:0;return("top"===h&&"desc"===o||"bottom"===h&&"asc"===o)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}var hi={number:function(t,e,i,n,s,o,r){var a=r.alignEmptyValues,l=r.decimalSeparator,h=r.thousandSeparator,c=0;if(t=String(t),e=String(e),h&&(t=t.split(h).join(""),e=e.split(h).join("")),l&&(t=t.split(l).join("."),e=e.split(l).join(".")),t=parseFloat(t),e=parseFloat(e),isNaN(t))c=isNaN(e)?0:-1;else{if(!isNaN(e))return t-e;c=1}return("top"===a&&"desc"===o||"bottom"===a&&"asc"===o)&&(c*=-1),c},string:function(t,e,i,n,s,o,r){var a,l=r.alignEmptyValues,h=0;if(t){if(e){switch(typeof r.locale){case"boolean":r.locale&&(a=this.langLocale());break;case"string":a=r.locale}return String(t).toLowerCase().localeCompare(String(e).toLowerCase(),a)}h=1}else h=e?-1:0;return("top"===l&&"desc"===o||"bottom"===l&&"asc"===o)&&(h*=-1),h},date:function(t,e,i,n,s,o,r){return r.format||(r.format="dd/MM/yyyy"),he.call(this,t,e,i,n,s,o,r)},time:function(t,e,i,n,s,o,r){return r.format||(r.format="HH:mm"),he.call(this,t,e,i,n,s,o,r)},datetime:he,boolean:function(t,e,i,n,s,o,r){return(!0===t||"true"===t||"True"===t||1===t?1:0)-(!0===e||"true"===e||"True"===e||1===e?1:0)},array:function(t,e,i,n,s,o,r){var a=r.type||"length",l=r.alignEmptyValues,h=0;function c(t){var e;switch(a){case"length":e=t.length;break;case"sum":e=t.reduce(function(t,e){return t+e});break;case"max":e=Math.max.apply(null,t);break;case"min":e=Math.min.apply(null,t);break;case"avg":e=t.reduce(function(t,e){return t+e})/t.length}return e}if(Array.isArray(t)){if(Array.isArray(e))return c(e)-c(t);h=1}else h=Array.isArray(e)?-1:0;return("top"===l&&"desc"===o||"bottom"===l&&"asc"===o)&&(h*=-1),h},exists:function(t,e,i,n,s,o,r){return(void 0===t?0:1)-(void 0===e?0:1)},alphanum:function(t,e,i,n,s,o,r){var a,l,h,c,u,d=0,m=/(\d+)|(\D+)/g,p=/\d/,f=r.alignEmptyValues,g=0;if(t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if((a=String(t).toLowerCase())===(l=String(e).toLowerCase()))return 0;if(!(p.test(a)&&p.test(l)))return a>l?1:-1;for(a=a.match(m),l=l.match(m),u=a.length>l.length?l.length:a.length;dc?1:-1}return a.length>l.length}g=1}else g=e||0===e?-1:0;return("top"===f&&"desc"===o||"bottom"===f&&"asc"===o)&&(g*=-1),g}};class hn extends aY{static moduleName="sort";static sorters=hi;constructor(t){super(t),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement",""),this.registerTableOption("headerSortClickElement","header"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(t,e,i,n){var s=this.getSort();return s.forEach(t=>{delete t.column}),n.sort=s,n}userSetSort(t,e){this.setSort(t,e),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(t){var e,i,n=!1;switch(typeof t.definition.sorter){case"string":hn.sorters[t.definition.sorter]?n=hn.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":n=t.definition.sorter}if(t.modules.sort={sorter:n,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:t.definition.headerSortTristate},!1!==t.definition.headerSort){switch(((e=t.getElement()).classList.add("tabulator-sortable"),(i=document.createElement("div")).classList.add("tabulator-col-sorter"),"icon"===this.table.options.headerSortClickElement)?i.classList.add("tabulator-col-sorter-element"):e.classList.add("tabulator-col-sorter-element"),this.table.options.headerSortElement){case"function":break;case"object":i.appendChild(this.table.options.headerSortElement);break;default:i.innerHTML=this.table.options.headerSortElement}t.titleHolderElement.appendChild(i),t.modules.sort.element=i,this.setColumnHeaderSortIcon(t,"none"),"icon"===this.table.options.headerSortClickElement&&i.addEventListener("mousedown",t=>{t.stopPropagation()}),("icon"===this.table.options.headerSortClickElement?i:e).addEventListener("click",e=>{var i="",n=[],s=!1;if(t.modules.sort){if(t.modules.sort.tristate)i="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=t.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?((s=(n=this.getSort()).findIndex(e=>e.field===t.getField()))>-1?(n[s].dir=i,s=n.splice(s,1)[0],"none"!=i&&n.push(s)):"none"!=i&&n.push({column:t,dir:i}),this.setSort(n)):"none"==i?this.clear():this.setSort(t,i),this.refreshSort()}})}}refreshSort(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var t=this.changed;return this.changed=!1,t}getSort(){var t=[];return this.sortList.forEach(function(e){e.column&&t.push({column:e.column.getComponent(),field:e.column.getField(),dir:e.dir})}),t}setSort(t,e){var i=this,n=[];Array.isArray(t)||(t=[{column:t,dir:e}]),t.forEach(function(t){var e;(e=i.table.columnManager.findColumn(t.column))?(t.column=e,n.push(t),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}),i.sortList=n,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(t){var e,i=this.table.rowManager.activeRows[0],n="string";if(i&&(i=i.getData(),t.getField()))switch(typeof(e=t.getFieldValue(i))){case"undefined":n="string";break;case"boolean":n="boolean";break;default:isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(n="alphanum"):n="number"}return hn.sorters[n]}sort(t,e){var i=this,n=this.table.options.sortOrderReverse?i.sortList.slice().reverse():i.sortList,s=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",i.getSort()),e||i.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(n.forEach(function(t,n){var o;t.column&&((o=t.column.modules.sort)&&(o.sorter||(o.sorter=i.findSorter(t.column)),t.params="function"==typeof o.params?o.params(t.column.getComponent(),t.dir):o.params,s.push(t)),e||i.setColumnHeader(t.column,t.dir))}),s.length&&i._sortItems(t,s)):e||n.forEach(function(t,e){i.setColumnHeader(t.column,t.dir)}),this.subscribedExternal("dataSorted")&&(t.forEach(t=>{o.push(t.getComponent())}),this.dispatchExternal("dataSorted",i.getSort(),o)),t}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach(t=>{t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"),this.setColumnHeaderSortIcon(t,"none"))})}setColumnHeader(t,e){t.modules.sort.dir=e,t.getElement().setAttribute("aria-sort","asc"===e?"ascending":"descending"),this.setColumnHeaderSortIcon(t,e)}setColumnHeaderSortIcon(t,e){var i,n=t.modules.sort.element;if(t.definition.headerSort&&"function"==typeof this.table.options.headerSortElement){for(;n.firstChild;)n.removeChild(n.firstChild);"object"==typeof(i=this.table.options.headerSortElement.call(this.table,t.getComponent(),e))?n.appendChild(i):n.innerHTML=i}}_sortItems(t,e){var i=e.length-1;t.sort((t,n)=>{for(var s,o=i;o>=0;o--){let i=e[o];if(0!==(s=this._sortRow(t,n,i.column,i.dir,i.params)))break}return s})}_sortRow(t,e,i,n,s){var o,r,a="asc"==n?t:e,l="asc"==n?e:t;return t=i.getFieldValue(a.getData()),e=i.getFieldValue(l.getData()),t=void 0!==t?t:"",e=void 0!==e?e:"",o=a.getComponent(),r=l.getComponent(),i.modules.sort.sorter.call(this,t,e,o,r,i.getComponent(),n,s)}}class hs{constructor(t,e){this.columnCount=t,this.rowCount=e,this.columnString=[],this.columns=[],this.rows=[]}genColumns(t){var e=Math.max(this.columnCount,Math.max(...t.map(t=>t.length)));this.columnString=[],this.columns=[];for(let t=1;t<=e;t++)this.incrementChar(this.columnString.length-1),this.columns.push(this.columnString.join(""));return this.columns}genRows(t){var e=Math.max(this.rowCount,t.length);this.rows=[];for(let t=1;t<=e;t++)this.rows.push(t);return this.rows}incrementChar(t){let e=this.columnString[t];e?"Z"!==e?this.columnString[t]=String.fromCharCode(this.columnString[t].charCodeAt(0)+1):(this.columnString[t]="A",t?this.incrementChar(t-1):this.columnString.push("A")):this.columnString.push("A")}setRowCount(t){this.rowCount=t}setColumnCount(t){this.columnCount=t}}class ho{constructor(t){return this._sheet=t,new Proxy(this,{get:function(t,e,i){return void 0!==t[e]?t[e]:t._sheet.table.componentFunctionBinder.handle("sheet",t._sheet,e)}})}getTitle(){return this._sheet.title}getKey(){return this._sheet.key}getDefinition(){return this._sheet.getDefinition()}getData(){return this._sheet.getData()}setData(t){return this._sheet.setData(t)}clear(){return this._sheet.clear()}remove(){return this._sheet.remove()}active(){return this._sheet.active()}setTitle(t){return this._sheet.setTitle(t)}setRows(t){return this._sheet.setRows(t)}setColumns(t){return this._sheet.setColumns(t)}}class hr extends aU{constructor(t,e){super(t.table),this.spreadsheetManager=t,this.definition=e,this.title=this.definition.title||"",this.key=this.definition.key||this.definition.title,this.rowCount=this.definition.rows,this.columnCount=this.definition.columns,this.data=this.definition.data||[],this.element=null,this.isActive=!1,this.grid=new hs(this.columnCount,this.rowCount),this.defaultColumnDefinition={width:100,headerHozAlign:"center",headerSort:!1},this.columnDefinition=Object.assign(this.defaultColumnDefinition,this.options("spreadsheetColumnDefinition")),this.columnDefs=[],this.rowDefs=[],this.columnFields=[],this.columns=[],this.rows=[],this.scrollTop=null,this.scrollLeft=null,this.initialize(),this.dispatchExternal("sheetAdded",this.getComponent())}initialize(){this.initializeElement(),this.initializeColumns(),this.initializeRows()}reinitialize(){this.initializeColumns(),this.initializeRows()}initializeElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tab"),this.element.innerText=this.title,this.element.addEventListener("click",()=>{this.spreadsheetManager.loadSheet(this)})}initializeColumns(){this.grid.setColumnCount(this.columnCount),this.columnFields=this.grid.genColumns(this.data),this.columnDefs=[],this.columnFields.forEach(t=>{var e=Object.assign({},this.columnDefinition);e.field=t,e.title=t,this.columnDefs.push(e)})}initializeRows(){var t;this.grid.setRowCount(this.rowCount),t=this.grid.genRows(this.data),this.rowDefs=[],t.forEach((t,e)=>{var i={_id:t},n=this.data[e];n&&n.forEach((t,e)=>{var n=this.columnFields[e];n&&(i[n]=t)}),this.rowDefs.push(i)})}unload(){this.isActive=!1,this.scrollTop=this.table.rowManager.scrollTop,this.scrollLeft=this.table.rowManager.scrollLeft,this.data=this.getData(!0),this.element.classList.remove("tabulator-spreadsheet-tab-active")}load(){var t=!this.isActive;this.isActive=!0,this.table.blockRedraw(),this.table.setData([]),this.table.setColumns(this.columnDefs),this.table.setData(this.rowDefs),this.table.restoreRedraw(),t&&null!==this.scrollTop&&(this.table.rowManager.element.scrollLeft=this.scrollLeft,this.table.rowManager.element.scrollTop=this.scrollTop),this.element.classList.add("tabulator-spreadsheet-tab-active"),this.dispatchExternal("sheetLoaded",this.getComponent())}getComponent(){return new ho(this)}getDefinition(){return{title:this.title,key:this.key,rows:this.rowCount,columns:this.columnCount,data:this.getData()}}getData(t){var e,i,n,s=[];return this.rowDefs.forEach(t=>{var e=[];this.columnFields.forEach(i=>{e.push(t[i])}),s.push(e)}),t||this.options("spreadsheetOutputFull")||(i=Math.max(...e=s.map(t=>t.findLastIndex(t=>void 0!==t)+1)),n=e.findLastIndex(t=>t>0)+1,s=(s=s.slice(0,n)).map(t=>t.slice(0,i))),s}setData(t){this.data=t,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}clear(){this.setData([])}setTitle(t){this.title=t,this.element.innerText=t,this.dispatchExternal("sheetUpdated",this.getComponent())}setRows(t){this.rowCount=t,this.initializeRows(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}setColumns(t){this.columnCount=t,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}remove(){this.spreadsheetManager.removeSheet(this)}destroy(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.dispatchExternal("sheetRemoved",this.getComponent())}active(){this.spreadsheetManager.loadSheet(this)}}class ha extends aY{static moduleName="spreadsheet";constructor(t){super(t),this.sheets=[],this.element=null,this.registerTableOption("spreadsheet",!1),this.registerTableOption("spreadsheetRows",50),this.registerTableOption("spreadsheetColumns",50),this.registerTableOption("spreadsheetColumnDefinition",{}),this.registerTableOption("spreadsheetOutputFull",!1),this.registerTableOption("spreadsheetData",!1),this.registerTableOption("spreadsheetSheets",!1),this.registerTableOption("spreadsheetSheetTabs",!1),this.registerTableOption("spreadsheetSheetTabsElement",!1),this.registerTableFunction("setSheets",this.setSheets.bind(this)),this.registerTableFunction("addSheet",this.addSheet.bind(this)),this.registerTableFunction("getSheets",this.getSheets.bind(this)),this.registerTableFunction("getSheetDefinitions",this.getSheetDefinitions.bind(this)),this.registerTableFunction("setSheetData",this.setSheetData.bind(this)),this.registerTableFunction("getSheet",this.getSheet.bind(this)),this.registerTableFunction("getSheetData",this.getSheetData.bind(this)),this.registerTableFunction("clearSheet",this.clearSheet.bind(this)),this.registerTableFunction("removeSheet",this.removeSheetFunc.bind(this)),this.registerTableFunction("activeSheet",this.activeSheetFunc.bind(this))}initialize(){this.options("spreadsheet")&&(this.subscribe("table-initialized",this.tableInitialized.bind(this)),this.subscribe("data-loaded",this.loadRemoteData.bind(this)),this.table.options.index="_id",this.options("spreadsheetData")&&this.options("spreadsheetSheets")&&(console.warn("You cannot use spreadsheetData and spreadsheetSheets at the same time, ignoring spreadsheetData"),this.table.options.spreadsheetData=!1),this.compatibilityCheck(),this.options("spreadsheetSheetTabs")&&this.initializeTabset())}compatibilityCheck(){this.options("data")&&console.warn("Do not use the data option when working with spreadsheets, use either spreadsheetData or spreadsheetSheets to pass data into the table"),this.options("pagination")&&console.warn("The spreadsheet module is not compatible with the pagination module"),this.options("groupBy")&&console.warn("The spreadsheet module is not compatible with the row grouping module"),this.options("responsiveCollapse")&&console.warn("The spreadsheet module is not compatible with the responsive collapse module")}initializeTabset(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tabs");var t=this.options("spreadsheetSheetTabsElement");!t||t instanceof HTMLElement||(t=document.querySelector(t))||console.warn("Unable to find element matching spreadsheetSheetTabsElement selector:",this.options("spreadsheetSheetTabsElement")),t?t.appendChild(this.element):this.footerAppend(this.element)}tableInitialized(){this.sheets.length?this.loadSheet(this.sheets[0]):this.options("spreadsheetSheets")?this.loadSheets(this.options("spreadsheetSheets")):this.options("spreadsheetData")&&this.loadData(this.options("spreadsheetData"))}loadRemoteData(t,e,i){return console.log("data",t,e,i),Array.isArray(t)?(this.table.dataLoader.clearAlert(),this.dispatchExternal("dataLoaded",t),!t.length||Array.isArray(t[0])?this.loadData(t):this.loadSheets(t)):console.error("Spreadsheet Loading Error - Unable to process remote data due to invalid data type \nExpecting: array \nReceived: ",typeof t,"\nData: ",t),!1}loadData(t){this.loadSheet(this.newSheet({data:t}))}destroySheets(){this.sheets.forEach(t=>{t.destroy()}),this.sheets=[],this.activeSheet=null}loadSheets(t){Array.isArray(t)||(t=[]),this.destroySheets(),t.forEach(t=>{this.newSheet(t)}),this.loadSheet(this.sheets[0])}loadSheet(t){this.activeSheet!==t&&(this.activeSheet&&this.activeSheet.unload(),this.activeSheet=t,t.load())}newSheet(t={}){var e;return t.rows||(t.rows=this.options("spreadsheetRows")),t.columns||(t.columns=this.options("spreadsheetColumns")),e=new hr(this,t),this.sheets.push(e),this.element&&this.element.appendChild(e.element),e}removeSheet(t){var e,i=this.sheets.indexOf(t);this.sheets.length>1?i>-1&&(this.sheets.splice(i,1),t.destroy(),this.activeSheet===t&&((e=this.sheets[i-1]||this.sheets[0])?this.loadSheet(e):this.activeSheet=null)):console.warn("Unable to remove sheet, at least one sheet must be active")}lookupSheet(t){return t?t instanceof hr?t:t instanceof ho?t._sheet:this.sheets.find(e=>e.key===t)||!1:this.activeSheet}setSheets(t){return this.loadSheets(t),this.getSheets()}addSheet(t){return this.newSheet(t).getComponent()}getSheetDefinitions(){return this.sheets.map(t=>t.getDefinition())}getSheets(){return this.sheets.map(t=>t.getComponent())}getSheet(t){var e=this.lookupSheet(t);return!!e&&e.getComponent()}setSheetData(t,e){t&&!e&&(e=t,t=!1);var i=this.lookupSheet(t);return!!i&&i.setData(e)}getSheetData(t){var e=this.lookupSheet(t);return!!e&&e.getData()}clearSheet(t){var e=this.lookupSheet(t);return!!e&&e.clear()}removeSheetFunc(t){var e=this.lookupSheet(t);e&&this.removeSheet(e)}activeSheetFunc(t){var e=this.lookupSheet(t);return!!e&&this.loadSheet(e)}}class hl extends aY{static moduleName="tooltip";constructor(t){super(t),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeColumn(t){t.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),t.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(t,e,i){var n="tooltip"===t?i.column.definition.tooltip:i.definition.headerTooltip;n&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,e,i,n),this.table.options.tooltipDelay))}mouseoutCheck(t,e,i){this.popupInstance||this.clearPopup()}clearPopup(t,e,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(t,e,i){var n,s,o;"function"==typeof i&&(i=i(t,e.getComponent(),function(t){s=t})),i instanceof HTMLElement?n=i:(n=document.createElement("div"),!0===i&&(e instanceof a8?i=e.value:e.definition.field?this.langBind("columns|"+e.definition.field,t=>{n.innerHTML=i=t||e.definition.title}):i=e.definition.title),n.innerHTML=i),(i||0===i||!1===i)&&(n.classList.add("tabulator-tooltip"),n.addEventListener("mousemove",t=>t.preventDefault()),this.popupInstance=this.popup(n),"function"==typeof s&&this.popupInstance.renderCallback(s),o=this.popupInstance.containerEventCoords(t),this.popupInstance.show(o.x+15,o.y+15).hideOnBlur(()=>{this.dispatchExternal("TooltipClosed",e.getComponent()),this.popupInstance=null}),this.dispatchExternal("TooltipOpened",e.getComponent()))}}var hh={integer:function(t,e,i){return""===e||null==e||!isNaN(e=Number(e))&&isFinite(e)&&Math.floor(e)===e},float:function(t,e,i){return""===e||null==e||!isNaN(e=Number(e))&&isFinite(e)&&e%1!=0},numeric:function(t,e,i){return""===e||null==e||!isNaN(e)},string:function(t,e,i){return""===e||null==e||isNaN(e)},alphanumeric:function(t,e,i){return""===e||null==e||new RegExp(/^[a-z0-9]+$/i).test(e)},max:function(t,e,i){return""===e||null==e||parseFloat(e)<=i},min:function(t,e,i){return""===e||null==e||parseFloat(e)>=i},starts:function(t,e,i){return""===e||null==e||String(e).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(t,e,i){return""===e||null==e||String(e).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(t,e,i){return""===e||null==e||String(e).length>=i},maxLength:function(t,e,i){return""===e||null==e||String(e).length<=i},in:function(t,e,i){return""===e||null==e||("string"==typeof i&&(i=i.split("|")),i.indexOf(e)>-1)},regex:function(t,e,i){return""===e||null==e||new RegExp(i).test(e)},unique:function(t,e,i){if(""===e||null==e)return!0;var n=!0,s=t.getData(),o=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(t){var i=t.getData();i!==s&&e==o.getFieldValue(i)&&(n=!1)}),n},required:function(t,e,i){return""!==e&&null!=e}};class hc extends aY{static moduleName="validate";static validators=hh;constructor(t){super(t),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(t,e,i){var n="manual"===this.table.options.validationMode||this.validate(t.column.modules.validate,t,e);return!0!==n&&setTimeout(()=>{t.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",t.getComponent(),e,n)}),n}editorClear(t,e){e&&t.column.modules.validate&&this.cellValidate(t),t.getElement().classList.remove("tabulator-validation-fail")}editedClear(t){t.modules.validate&&(t.modules.validate.invalid=!1)}cellIsValid(t){return!t.modules.validate||t.modules.validate.invalid||!0}cellValidate(t){return this.validate(t.column.modules.validate,t,t.getValue())}columnValidate(t){var e=[];return t.cells.forEach(t=>{!0!==this.cellValidate(t)&&e.push(t.getComponent())}),!e.length||e}rowValidate(t){var e=[];return t.cells.forEach(t=>{!0!==this.cellValidate(t)&&e.push(t.getComponent())}),!e.length||e}userClearCellValidation(t){t||(t=this.getInvalidCells()),Array.isArray(t)||(t=[t]),t.forEach(t=>{this.clearValidation(t._getSelf())})}userValidate(t){var e=[];return this.table.rowManager.rows.forEach(t=>{var i=(t=t.getComponent()).validate();!0!==i&&(e=e.concat(i))}),!e.length||e}initializeColumnCheck(t){void 0!==t.definition.validator&&this.initializeColumn(t)}initializeColumn(t){var e,i=this,n=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach(t=>{(e=i._extractValidator(t))&&n.push(e)}):(e=this._extractValidator(t.definition.validator))&&n.push(e),t.modules.validate=!!n.length&&n)}_extractValidator(t){var e,i,n;switch(typeof t){case"string":return(n=t.indexOf(":"))>-1?(e=t.substring(0,n),i=t.substring(n+1)):e=t,this._buildValidator(e,i);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}}_buildValidator(t,e){var i="function"==typeof t?t:hc.validators[t];return i?{type:"function"==typeof t?"function":t,func:i,params:e}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)}validate(t,e,i){var n=this,s=[],o=this.invalidCells.indexOf(e);return t&&t.forEach(t=>{t.func.call(n,e.getComponent(),i,t.params)||s.push({type:t.type,parameters:t.params})}),e.modules.validate||(e.modules.validate={}),s.length?(e.modules.validate.invalid=s,"manual"!==this.table.options.validationMode&&e.getElement().classList.add("tabulator-validation-fail"),-1==o&&this.invalidCells.push(e)):(e.modules.validate.invalid=!1,e.getElement().classList.remove("tabulator-validation-fail"),o>-1&&this.invalidCells.splice(o,1)),!s.length||s}getInvalidCells(){var t=[];return this.invalidCells.forEach(e=>{t.push(e.getComponent())}),t}clearValidation(t){var e;t.modules.validate&&t.modules.validate.invalid&&(t.getElement().classList.remove("tabulator-validation-fail"),t.modules.validate.invalid=!1,(e=this.invalidCells.indexOf(t))>-1&&this.invalidCells.splice(e,1))}}var hu={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},rowHeader:!1,data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}};class hd{constructor(t,e,i={}){this.table=t,this.msgType=e,this.registeredDefaults=Object.assign({},i)}register(t,e){this.registeredDefaults[t]=e}generate(t,e={}){var i=Object.assign({},this.registeredDefaults),n=this.table.options.debugInvalidOptions||!0===e.debugInvalidOptions;for(let s in Object.assign(i,t),e)i.hasOwnProperty(s)||(n&&console.warn("Invalid "+this.msgType+" option:",s),i[s]=e.key);for(let t in i)t in e?i[t]=e[t]:Array.isArray(i[t])?i[t]=Object.assign([],i[t]):"object"==typeof i[t]&&null!==i[t]?i[t]=Object.assign({},i[t]):void 0===i[t]&&delete i[t];return i}}class hm extends aU{constructor(t){super(t),this.elementVertical=t.rowManager.element,this.elementHorizontal=t.columnManager.element,this.tableElement=t.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(t){}renderRows(){}renderColumns(){}rerenderRows(t){t&&t()}rerenderColumns(t,e){}renderRowCells(t){}rerenderRowCells(t,e){}scrollColumns(t,e){}scrollRows(t,e){}resize(){}scrollToRow(t){}scrollToRowNearestTop(t){}visibleRows(t){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(t,e){var i=t.getElement();e%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(t){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(t,e,i){var n=this.rows().indexOf(t),s=t.getElement(),o=0;return new Promise((r,a)=>{if(n>-1){if(void 0===i&&(i=this.table.options.scrollToRowIfVisible),!i&&aq.elVisible(s)&&(o=aq.elOffset(s).top-aq.elOffset(this.elementVertical).top)>0&&o{i.appendChild(t.getElement())}),t.element.appendChild(i),e||t.cells.forEach(t=>{t.cellRendered()})}reinitializeColumnWidths(t){t.forEach(function(t){t.reinitializeWidth()})}}class hf extends hm{constructor(t){super(t),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){"fitDataTable"==this.options("layout")&&console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),this.options("responsiveLayout")&&console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),this.options("rtl")&&console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction")}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(t,e){this.dataChange()}scrollColumns(t,e){this.scrollLeft!=t&&(this.scrollLeft=t,this.scroll(t-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var t=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach(e=>{if(e.visible){var i=e.getWidth();i>t&&(t=i)}}),this.windowBuffer=2*t}rerenderColumns(t,e){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},n=0;(!t||this.initialized)&&(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach(t=>{var e,i={};t.visible&&!t.modules.frozen&&(e=t.getWidth(),i.leftPos=n,i.rightPos=n+e,i.width=e,this.isFitData&&(i.fitDataCheck=!t.modules.vdomHoz||t.modules.vdomHoz.fitDataCheck),n+e>this.vDomScrollPosLeft&&n{e.appendChild(t.getElement())}),t.element.appendChild(e),t.cells.forEach(t=>{t.cellRendered()})}}rerenderRowCells(t,e){this.reinitializeRow(t,e)}reinitializeColumnWidths(t){for(let t=this.leftCol;t<=this.rightCol;t++)this.columns[t].reinitializeWidth()}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var t,e,i=!1;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach(t=>{!t.definition.width&&t.visible&&(i=!0)}),i&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,t=this.chain("rows-sample",[1],[],()=>this.table.rowManager.getDisplayRows())[0])){e=t.getElement(),t.generateCells(),this.tableElement.appendChild(e);for(let i=0;i{t!==this.columns[i]&&(e=!1)}),!e)}reinitializeRows(){var t=this.getVisibleRows(),e=this.table.rowManager.getRows().filter(e=>!t.includes(e));t.forEach(t=>{this.reinitializeRow(t,!0)}),e.forEach(t=>{t.deinitialize()})}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(t){this.vDomScrollPosLeft+=t,this.vDomScrollPosRight+=t,Math.abs(t)>this.windowBuffer/2?this.rerenderColumns():t>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(t,e,i){for(let n=t;n{if("group"!==t.type){var e=t.getCell(i);t.getElement().insertBefore(e.getElement(),t.getCell(this.columns[this.rightCol]).getElement().nextSibling),e.cellRendered()}}),this.fitDataColActualWidthCheck(i),this.rightCol++,this.getVisibleRows().forEach(t=>{"group"!==t.type&&(t.modules.vdomHoz.rightCol=this.rightCol)}),this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=i.getWidth()):e=!1}t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var t=!1,e=!0;e;){let i=this.columns[this.leftCol-1];if(i){if(i.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){t=!0,this.getVisibleRows().forEach(t=>{if("group"!==t.type){var e=t.getCell(i);t.getElement().insertBefore(e.getElement(),t.getCell(this.columns[this.leftCol]).getElement()),e.cellRendered()}}),this.leftCol--,this.getVisibleRows().forEach(t=>{"group"!==t.type&&(t.modules.vdomHoz.leftCol=this.leftCol)}),this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=i.getWidth();let e=this.fitDataColActualWidthCheck(i);e&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+e,this.vDomPadRight-=e)}else e=!1}else e=!1}t&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var t=!1,e=!0;e;){let i=this.columns[this.rightCol];i&&i.modules.vdomHoz.leftPos>this.vDomScrollPosRight?(t=!0,this.getVisibleRows().forEach(t=>{if("group"!==t.type){var e=t.getCell(i);try{t.getElement().removeChild(e.getElement())}catch(t){console.warn("Could not removeColRight",t.message)}}}),this.vDomPadRight+=i.getWidth(),this.rightCol--,this.getVisibleRows().forEach(t=>{"group"!==t.type&&(t.modules.vdomHoz.rightCol=this.rightCol)})):e=!1}t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var t=!1,e=!0;e;){let i=this.columns[this.leftCol];i&&i.modules.vdomHoz.rightPos{if("group"!==t.type){var e=t.getCell(i);try{t.getElement().removeChild(e.getElement())}catch(t){console.warn("Could not removeColLeft",t.message)}}}),this.vDomPadLeft+=i.getWidth(),this.leftCol++,this.getVisibleRows().forEach(t=>{"group"!==t.type&&(t.modules.vdomHoz.leftCol=this.leftCol)})):e=!1}t&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(t){var e,i;return t.modules.vdomHoz.fitDataCheck&&(t.reinitializeWidth(),(i=(e=t.getWidth())-t.modules.vdomHoz.width)&&(t.modules.vdomHoz.rightPos+=i,t.modules.vdomHoz.width=e,this.colPositionAdjust(this.columns.indexOf(t)+1,this.columns.length,i)),t.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(t){if("group"!==t.type){t.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol},this.table.modules.frozenColumns&&this.table.modules.frozenColumns.leftColumns.forEach(e=>{this.appendCell(t,e)});for(let e=this.leftCol;e<=this.rightCol;e++)this.appendCell(t,this.columns[e]);this.table.modules.frozenColumns&&this.table.modules.frozenColumns.rightColumns.forEach(e=>{this.appendCell(t,e)})}}appendCell(t,e){if(e&&e.visible){let i=t.getCell(e);t.getElement().appendChild(i.getElement()),i.cellRendered()}}reinitializeRow(t,e){if("group"!==t.type&&(e||!t.modules.vdomHoz||t.modules.vdomHoz.leftCol!==this.leftCol||t.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=t.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(t)}}}class hg extends aU{constructor(t){super(t),this.blockHozScrollEvent=!1,this.headersElement=null,this.contentsElement=null,this.rowHeader=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new hd(this.table,"column definition",le),this.redrawBlock=!1,this.redrawBlockUpdate=null,this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.contentsElement=this.createHeaderContentsElement(),this.element=this.createHeaderElement(),this.contentsElement.insertBefore(this.headersElement,this.contentsElement.firstChild),this.element.insertBefore(this.contentsElement,this.element.firstChild),this.initializeScrollWheelWatcher(),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scrollbar-vertical",this.padVerticalScrollbar.bind(this))}padVerticalScrollbar(t){this.table.rtl?this.headersElement.style.marginLeft=t+"px":this.headersElement.style.marginRight=t+"px"}initializeRenderer(){var t;(t="string"==typeof this.table.options.renderHorizontal?({virtual:hf,basic:hp})[this.table.options.renderHorizontal]:this.table.options.renderHorizontal)?(this.renderer=new t(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",this.table.options.renderHorizontal)}createHeadersElement(){var t=document.createElement("div");return t.classList.add("tabulator-headers"),t.setAttribute("role","row"),t}createHeaderContentsElement(){var t=document.createElement("div");return t.classList.add("tabulator-header-contents"),t.setAttribute("role","rowgroup"),t}createHeaderElement(){var t=document.createElement("div");return t.classList.add("tabulator-header"),t.setAttribute("role","rowgroup"),this.table.options.headerVisible||t.classList.add("tabulator-header-hidden"),t}getElement(){return this.element}getContentsElement(){return this.contentsElement}getHeadersElement(){return this.headersElement}scrollHorizontal(t){this.contentsElement.scrollLeft=t,this.scrollLeft=t,this.renderer.scrollColumns(t)}initializeScrollWheelWatcher(){this.contentsElement.addEventListener("wheel",t=>{var e;t.deltaX&&(e=this.contentsElement.scrollLeft+t.deltaX,this.table.rowManager.scrollHorizontal(e),this.table.columnManager.scrollHorizontal(e))})}generateColumnsFromRowData(t){var e=[],i={},n="full"===this.table.options.autoColumns?t:[t[0]],s=this.table.options.autoColumnsDefinitions;if(t&&t.length){if(n.forEach(t=>{Object.keys(t).forEach((n,s)=>{let o=t[n],r;i[n]?!0!==i[n]&&void 0!==o&&(i[n].sorter=this.calculateSorterFromValue(o),i[n]=!0):(r={field:n,title:n,sorter:this.calculateSorterFromValue(o)},e.splice(s,0,r),i[n]=void 0!==o||r)})}),s)switch(typeof s){case"function":this.table.options.columns=s.call(this.table,e);break;case"object":Array.isArray(s)?e.forEach(t=>{var e=s.find(e=>e.field===t.field);e&&Object.assign(t,e)}):e.forEach(t=>{s[t.field]&&Object.assign(t,s[t.field])}),this.table.options.columns=e}else this.table.options.columns=e;this.setColumns(this.table.options.columns)}}calculateSorterFromValue(t){var e;switch(typeof t){case"undefined":e="string";break;case"boolean":e="boolean";break;case"number":e="number";break;case"object":e=Array.isArray(t)?"array":"string";break;default:e=isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}return e}setColumns(t,e){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),this.dispatchExternal("columnsLoading"),this.table.options.rowHeader&&(this.rowHeader=new li(!0===this.table.options.rowHeader?{}:this.table.options.rowHeader,this,!0),this.columns.push(this.rowHeader),this.headersElement.appendChild(this.rowHeader.getElement()),this.rowHeader.columnRendered()),t.forEach((t,e)=>{this._addColumn(t)}),this._reIndexColumns(),this.dispatch("columns-loaded"),this.subscribedExternal("columnsLoaded")&&this.dispatchExternal("columnsLoaded",this.getComponents()),this.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(t,e,i){var n=new li(t,this),s=n.getElement(),o=i?this.findColumnIndex(i):i;if(e&&this.rowHeader&&(!i||i===this.rowHeader)&&(e=!1,i=this.rowHeader,o=0),i&&o>-1){var r=i.getTopColumn(),a=this.columns.indexOf(r),l=r.getElement();e?(this.columns.splice(a,0,n),l.parentNode.insertBefore(s,l)):(this.columns.splice(a+1,0,n),l.parentNode.insertBefore(s,l.nextSibling))}else e?(this.columns.unshift(n),this.headersElement.insertBefore(n.getElement(),this.headersElement.firstChild)):(this.columns.push(n),this.headersElement.appendChild(n.getElement()));return n.columnRendered(),n}registerColumnField(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)}registerColumnPosition(t){this.columnsByIndex.push(t)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach(function(t){t.reRegisterPosition()})}verticalAlignHeaders(){var t=0;this.redrawBlock||(this.headersElement.style.height="",this.columns.forEach(t=>{t.clearVerticalAlign()}),this.columns.forEach(e=>{var i=e.getHeight();i>t&&(t=i)}),this.headersElement.style.height=t+"px",this.columns.forEach(e=>{e.verticalAlign(this.table.options.columnHeaderVertAlign,t)}),this.table.rowManager.adjustTableSize())}findColumn(t){var e;return"object"!=typeof t?this.columnsByField[t]||!1:t instanceof li?t:t instanceof lt?t._getSelf()||!1:!!("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)&&(e=[],this.columns.forEach(t=>{e.push(t),e=e.concat(t.getColumns(!0))}),e.find(e=>e.element===t)||!1)}getColumnByField(t){return this.columnsByField[t]}getColumnsByFieldRoot(t){var e=[];return Object.keys(this.columnsByField).forEach(i=>{(this.table.options.nestedFieldSeparator?i.split(this.table.options.nestedFieldSeparator)[0]:i)===t&&e.push(this.columnsByField[i])}),e}getColumnByIndex(t){return this.columnsByIndex[t]}getFirstVisibleColumn(){var t=this.columnsByIndex.findIndex(t=>t.visible);return t>-1&&this.columnsByIndex[t]}getVisibleColumnsByIndex(){return this.columnsByIndex.filter(t=>t.visible)}getColumns(){return this.columns}findColumnIndex(t){return this.columnsByIndex.findIndex(e=>t===e)}getRealColumns(){return this.columnsByIndex}traverse(t){this.columnsByIndex.forEach((e,i)=>{t(e,i)})}getDefinitions(t){var e=[];return this.columnsByIndex.forEach(i=>{(!t||t&&i.visible)&&e.push(i.getDefinition())}),e}getDefinitionTree(){var t=[];return this.columns.forEach(e=>{t.push(e.getDefinition(!0))}),t}getComponents(t){var e=[];return(t?this.columns:this.columnsByIndex).forEach(t=>{e.push(t.getComponent())}),e}getWidth(){var t=0;return this.columnsByIndex.forEach(e=>{e.visible&&(t+=e.getWidth())}),t}moveColumn(t,e,i){e.element.parentNode.insertBefore(t.element,e.element),i&&e.element.parentNode.insertBefore(e.element,t.element),this.moveColumnActual(t,e,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(t,e,i){t.parent.isGroup?this._moveColumnInArray(t.parent.columns,t,e,i):this._moveColumnInArray(this.columns,t,e,i),this._moveColumnInArray(this.columnsByIndex,t,e,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",t,e,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",t.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(t,e,i,n,s){var o,r=t.indexOf(e);r>-1&&(t.splice(r,1),(o=t.indexOf(i))>-1?n&&(o+=1):o=r,t.splice(o,0,e),s&&(this.chain("column-moving-rows",[e,i,n],null,[])||[]).concat(this.table.rowManager.rows).forEach(function(t){if(t.cells.length){var e=t.cells.splice(r,1)[0];t.cells.splice(o,0,e)}}))}scrollToColumn(t,e,i){var n=0,s=t.getLeftOffset(),o=0,r=t.getElement();return new Promise((a,l)=>{if(void 0===e&&(e=this.table.options.scrollToColumnPosition),void 0===i&&(i=this.table.options.scrollToColumnIfVisible),t.visible){switch(e){case"middle":case"center":o=-this.element.clientWidth/2;break;case"right":o=r.clientWidth-this.headersElement.clientWidth}if(!i&&s>0&&s+r.offsetWidth{e.push(i.generateCell(t))}),e}getFlexBaseWidth(){var t=this.table.element.clientWidth,e=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(t-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var n,s,o;i.visible&&(n=i.definition.width||0,s=parseInt(i.minWidth),o="string"==typeof n?n.indexOf("%")>-1?t/100*parseInt(n):parseInt(n):n,e+=o>s?o:s)}),e}addColumn(t,e,i){return new Promise((n,s)=>{var o=this._addColumn(t,e,i);this._reIndexColumns(),this.dispatch("column-add",t,e,i),"fitColumns"!=this.layoutMode()&&o.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.rerenderColumns(),n(o)})}deregisterColumn(t){var e,i=t.getField();i&&delete this.columnsByField[i],(e=this.columnsByIndex.indexOf(t))>-1&&this.columnsByIndex.splice(e,1),(e=this.columns.indexOf(t))>-1&&this.columns.splice(e,1),this.verticalAlignHeaders(),this.redraw()}rerenderColumns(t,e){this.redrawBlock?(!1===t||!0===t&&null===this.redrawBlockUpdate)&&(this.redrawBlockUpdate=t):this.renderer.rerenderColumns(t,e)}blockRedraw(){this.redrawBlock=!0,this.redrawBlockUpdate=null}restoreRedraw(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}redraw(t){aq.elVisible(this.element)&&this.verticalAlignHeaders(),t&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",t)||this.layoutRefresh(t),this.dispatch("table-redraw",t),this.table.footerManager.redraw()}}class hb extends hm{constructor(t){super(t),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var t=this.tableElement;t.firstChild;)t.removeChild(t.firstChild);t.scrollTop=0,t.scrollLeft=0,t.style.minWidth="",t.style.minHeight="",t.style.display="",t.style.visibility=""}renderRows(){var t=this.tableElement,e=!0,i=document.createDocumentFragment(),n=this.rows();n.forEach((t,n)=>{this.styleRow(t,n),t.initialize(!1,!0),"group"!==t.type&&(e=!1),i.appendChild(t.getElement())}),t.appendChild(i),n.forEach(t=>{t.rendered(),t.heightInitialized||t.calcHeight(!0)}),n.forEach(t=>{t.heightInitialized||t.setCellHeight()}),e?t.style.minWidth=this.table.columnManager.getWidth()+"px":t.style.minWidth=""}rerenderRows(t){this.clearRows(),t&&t(),this.renderRows(),this.rows().length||this.table.rowManager.tableEmpty()}scrollToRowNearestTop(t){var e=aq.elOffset(t.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-e)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-e))}scrollToRow(t){var e=t.getElement();this.elementVertical.scrollTop=aq.elOffset(e).top-aq.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(t){return this.rows()}}class hv extends hm{constructor(t){super(t),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]}clearRows(){for(var t=this.tableElement;t.firstChild;)t.removeChild(t.firstChild);t.style.paddingTop="",t.style.paddingBottom="",t.style.minHeight="",t.style.display="",t.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(t){for(var e=this.elementVertical.scrollTop,i=!1,n=!1,s=this.table.rowManager.scrollLeft,o=this.rows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(o[r]){var a=e-o[r].getElement().offsetTop;if(!1===n||Math.abs(a){t.deinitializeHeight()}),t&&t(),this.rows().length?this._virtualRenderFill(!1===i?this.rows.length-1:i,!0,n||0):(this.clear(),this.table.rowManager.tableEmpty()),this.scrollColumns(s)}scrollColumns(t){this.table.rowManager.scrollHorizontal(t)}scrollRows(t,e){var i=t-this.vDomScrollPosTop,n=t-this.vDomScrollPosBottom,s=2*this.vDomWindowBuffer,o=this.rows();if(this.scrollTop=t,-i>s||n>s){var r=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*o.length)),this.scrollColumns(r)}else e?(i<0&&this._addTopRow(o,-i),n<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(o,-n):this.vDomScrollPosBottom=this.scrollTop)):(n>=0&&this._addBottomRow(o,n),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(o,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(t){var e=this.rows().indexOf(t);return!(Math.abs(this.vDomTop-e)>Math.abs(this.vDomBottom-e))}scrollToRow(t){var e=this.rows().indexOf(t);e>-1&&this._virtualRenderFill(e,!0)}visibleRows(t){var e=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+e,n=!1,s=0,o=0,r=this.rows();if(t)s=this.vDomTop,o=this.vDomBottom;else for(var a=this.vDomTop;a<=this.vDomBottom;a++)if(r[a]){if(n){if(i-r[a].getElement().offsetTop>=0)o=a;else break}else if(e-r[a].getElement().offsetTop>=0)s=a;else if(n=!0,i-r[a].getElement().offsetTop>=0)o=a;else break}return r.slice(s,o+1)}_virtualRenderFill(t,e,i){var n,s,o=this.tableElement,r=this.elementVertical,a=0,l=0,h=0,c=0,u=0,d=0,m=this.rows(),p=m.length,f=0,g=[],b=0,v=0,y=this.table.rowManager.fixedHeight,w=this.elementVertical.clientHeight,_=this.table.options.rowHeight,C=!0;if(i=i||0,t=t||0){for(;o.firstChild;)o.removeChild(o.firstChild);(c=(p-t+1)*this.vDomRowHeight){t.rendered(),t.heightInitialized||t.calcHeight(!0)}),g.forEach(t=>{t.heightInitialized||t.setCellHeight()}),g.forEach(t=>{h=t.getHeight(),bthis.vDomWindowBuffer&&(this.vDomWindowBuffer=2*h),b++}),C=this.table.rowManager.adjustTableSize(),w=this.elementVertical.clientHeight,C&&(y||this.table.options.maxHeight)&&(_=l/b,v=Math.max(this.vDomWindowMinTotalRows,Math.ceil(w/_+this.vDomWindowBuffer/_)))}t?(this.vDomTopPad=e?this.vDomRowHeight*this.vDomTop+i:this.scrollTop-u,this.vDomBottomPad=this.vDomBottom==p-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-l-u,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((l+u)/b),this.vDomBottomPad=this.vDomRowHeight*(p-this.vDomBottom-1),this.vDomScrollHeight=u+l+this.vDomBottomPad-w),o.style.paddingTop=this.vDomTopPad+"px",o.style.paddingBottom=this.vDomBottomPad+"px",e&&(this.scrollTop=this.vDomTopPad+u+i-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-w:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-w),this.elementVertical.scrollWidth>this.elementVertical.clientWidth&&e&&(this.scrollTop+=this.elementVertical.offsetHeight-w),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,r.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(t,e){for(var i=this.tableElement,n=[],s=0,o=this.vDomTop-1,r=0,a=!0;a;)if(this.vDomTop){let l=t[o],h,c;l&&r=h?(this.styleRow(l,o),i.insertBefore(l.getElement(),i.firstChild),l.initialized&&l.heightInitialized||n.push(l),l.initialize(),!c&&(h=l.getElement().offsetHeight)>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*h),e-=h,s+=h,this.vDomTop--,o--,r++):a=!1):a=!1}else a=!1;for(let t of n)t.clearCellHeight();this._quickNormalizeRowHeight(n),s&&(this.vDomTopPad-=s,this.vDomTopPad<0&&(this.vDomTopPad=o*this.vDomRowHeight),o<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=s)}_removeTopRow(t,e){for(var i=[],n=0,s=0,o=!0;o;){let r=t[this.vDomTop],a;r&&s=a?(this.vDomTop++,e-=a,n+=a,i.push(r),s++):o=!1):o=!1}for(let t of i){let e=t.getElement();e.parentNode&&e.parentNode.removeChild(e)}n&&(this.vDomTopPad+=n,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?n:n+this.vDomWindowBuffer)}_addBottomRow(t,e){for(var i=this.tableElement,n=[],s=0,o=this.vDomBottom+1,r=0,a=!0;a;){let l=t[o],h,c;l&&r=h?(this.styleRow(l,o),i.appendChild(l.getElement()),l.initialized&&l.heightInitialized||n.push(l),l.initialize(),!c&&(h=l.getElement().offsetHeight)>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*h),e-=h,s+=h,this.vDomBottom++,o++,r++):a=!1):a=!1}for(let t of n)t.clearCellHeight();this._quickNormalizeRowHeight(n),s&&(this.vDomBottomPad-=s,(this.vDomBottomPad<0||o==t.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=s)}_removeBottomRow(t,e){for(var i=[],n=0,s=0,o=!0;o;){let r=t[this.vDomBottom],a;r&&s=a?(this.vDomBottom--,e-=a,n+=a,i.push(r),s++):o=!1):o=!1}for(let t of i){let e=t.getElement();e.parentNode&&e.parentNode.removeChild(e)}n&&(this.vDomBottomPad+=n,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=n)}_quickNormalizeRowHeight(t){for(let e of t)e.calcHeight();for(let e of t)e.setCellHeight()}}class hy extends aU{constructor(t){super(t),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.scrollbarWidth=0,this.renderer=null}createHolderElement(){var t=document.createElement("div");return t.classList.add("tabulator-tableholder"),t.setAttribute("tabindex",0),t}createTableElement(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t.setAttribute("role","rowgroup"),t}initializePlaceholder(){var t=this.table.options.placeholder;if("function"==typeof t&&(t=t.call(this.table)),t=this.chain("placeholder",[t],t,t)||t){let e=document.createElement("div");if(e.classList.add("tabulator-placeholder"),"string"==typeof t){let i=document.createElement("div");i.classList.add("tabulator-placeholder-contents"),i.innerHTML=t,e.appendChild(i),this.placeholderContents=i}else"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?(e.appendChild(t),this.placeholderContents=t):(console.warn("Invalid placeholder provided, must be string or HTML Element",t),this.el=null);this.placeholder=e}}getElement(){return this.element}getTableElement(){return this.tableElement}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",()=>{var t=this.element.scrollLeft,e=this.scrollLeft>t,i=this.element.scrollTop,n=this.scrollTop>i;this.scrollLeft!=t&&(this.scrollLeft=t,this.dispatch("scroll-horizontal",t,e),this.dispatchExternal("scrollHorizontal",t,e),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,n),this.dispatch("scroll-vertical",i,n),this.dispatchExternal("scrollVertical",i,n))})}findRow(t){return"object"!=typeof t?void 0!==t&&(this.rows.find(e=>e.data[this.table.options.index]==t)||!1):t instanceof ls?t:t instanceof ln?t._getSelf()||!1:!!("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)&&(this.rows.find(e=>e.getElement()===t)||!1)}getRowFromDataObject(t){return this.rows.find(e=>e.data===t)||!1}getRowFromPosition(t){return this.getDisplayRows().find(e=>"row"===e.type&&e.getPosition()===t&&e.isDisplayed())}scrollToRow(t,e,i){return this.renderer.scrollToRowPosition(t,e,i)}setData(t,e,i){return new Promise((n,s)=>{e&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(t,!0):this.reRenderInPosition(()=>{this._setDataActual(t)}):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(t),this.resetScroll(),this._setDataActual(t)),n()})}_setDataActual(t,e){this.dispatchExternal("dataProcessing",t),this._wipeElements(),Array.isArray(t)?(this.dispatch("data-processing",t),t.forEach((t,e)=>{if(t&&"object"==typeof t){var i=new ls(t,this);this.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",t)}),this.refreshActiveData(!1,!1,e),this.dispatch("data-processed",t),this.dispatchExternal("dataProcessed",t)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",typeof t,"\nData: ",t)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.adjustTableSize(),this.dispatch("rows-wiped")}destroy(){this.rows.forEach(t=>{t.wipe()}),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0}deleteRow(t,e){var i=this.rows.indexOf(t),n=this.activeRows.indexOf(t);n>-1&&this.activeRows.splice(n,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator(e=>{var i=e.indexOf(t);i>-1&&e.splice(i,1)}),e||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",t.getComponent()),this.displayRowsCount||this.tableEmpty(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(t,e,i,n){return this.addRowActual(t,e,i,n)}addRows(t,e,i,n){var s=[];return new Promise((o,r)=>{e=this.findAddRowPos(e),Array.isArray(t)||(t=[t]),(void 0===i&&e||void 0!==i&&!e)&&t.reverse(),t.forEach((t,n)=>{var o=this.addRow(t,e,i,!0);s.push(o),this.dispatch("row-added",o,t,e,i)}),this.refreshActiveData(!!n&&"displayPipeline",!1,!0),this.regenerateRowPositions(),this.displayRowsCount&&this._clearPlaceholder(),o(s)})}findAddRowPos(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t}addRowActual(t,e,i,n){var s,o,r=t instanceof ls?t:new ls(t||{},this),a=this.findAddRowPos(e),l=-1;return i||(i=(o=this.chain("row-adding-position",[r,a],null,{index:i,top:a})).index,a=o.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[r,i,a],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(s=this.activeRows.indexOf(i),this.displayRowIterator(function(t){var e=t.indexOf(i);e>-1&&t.splice(a?e:e+1,0,r)}),s>-1&&this.activeRows.splice(a?s:s+1,0,r),this.rows.splice(a?l:l+1,0,r)):a?(this.displayRowIterator(function(t){t.unshift(r)}),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator(function(t){t.push(r)}),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n||this.reRenderInPosition(),r}moveRow(t,e,i){this.dispatch("row-move",t,e,i),this.moveRowActual(t,e,i),this.regenerateRowPositions(),this.dispatch("row-moved",t,e,i),this.dispatchExternal("rowMoved",t.getComponent())}moveRowActual(t,e,i){this.moveRowInArray(this.rows,t,e,i),this.moveRowInArray(this.activeRows,t,e,i),this.displayRowIterator(n=>{this.moveRowInArray(n,t,e,i)}),this.dispatch("row-moving",t,e,i)}moveRowInArray(t,e,i,n){var s,o,r,a;if(e!==i&&((s=t.indexOf(e))>-1&&(t.splice(s,1),(o=t.indexOf(i))>-1?n?t.splice(o+1,0,e):t.splice(o,0,e):t.splice(s,0,e)),t===this.getDisplayRows())){r=ss?o:s+1;for(let e=r;e<=a;e++)t[e]&&this.styleRow(t[e],e)}}clearData(){this.setData([])}getRowIndex(t){return this.findRowIndex(t,this.rows)}getDisplayRowIndex(t){var e=this.getDisplayRows().indexOf(t);return e>-1&&e}nextDisplayRow(t,e){var i=this.getDisplayRowIndex(t),n=!1;return(!1!==i&&i-1)&&i}getData(t,e){var i=[];return this.getRows(t).forEach(function(t){"row"==t.type&&i.push(t.getData(e||"data"))}),i}getComponents(t){var e=[];return this.getRows(t).forEach(function(t){e.push(t.getComponent())}),e}getDataCount(t){return this.getRows(t).length}scrollHorizontal(t){this.scrollLeft=t,this.element.scrollLeft=t,this.dispatch("scroll-horizontal",t)}registerDataPipelineHandler(t,e){void 0!==e?(this.dataPipeline.push({handler:t,priority:e}),this.dataPipeline.sort((t,e)=>t.priority-e.priority)):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(t,e){void 0!==e?(this.displayPipeline.push({handler:t,priority:e}),this.displayPipeline.sort((t,e)=>t.priority-e.priority)):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(t,e,i){var n=this.table,s="",o=0,r=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if("function"==typeof t){if((o=this.dataPipeline.findIndex(e=>e.handler===t))>-1)s="dataPipeline",e&&(o==this.dataPipeline.length-1?s="display":o++);else if((o=this.displayPipeline.findIndex(e=>e.handler===t))>-1)s="displayPipeline",e&&(o==this.displayPipeline.length-1?s="end":o++);else{console.error("Unable to refresh data, invalid handler provided",t);return}}else s=t||"all",o=0;if(this.redrawBlock){(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===s&&o{"row"===t.type&&(t.setPosition(e),e++)})}setActiveRows(t){this.activeRows=this.activeRows=Object.assign([],t),this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(t,e){this.displayRows[e]=t,e==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(t){return void 0===t?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[t]||[]}getVisibleRows(t,e){var i=Object.assign([],this.renderer.visibleRows(!e));return t&&(i=this.chain("rows-visible",[e],i,i)),i}displayRowIterator(t){this.activeRowsPipeline.forEach(t),this.displayRows.forEach(t),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(t){var e=[];switch(t){case"active":e=this.activeRows;break;case"display":e=this.table.rowManager.getDisplayRows();break;case"visible":e=this.getVisibleRows(!1,!0);break;default:e=this.chain("rows-retrieve",t,null,this.rows)||this.rows}return e}reRenderInPosition(t){this.redrawBlock?t?t():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(t),this.fixedHeight||this.adjustTableSize(),this.scrollBarCheck(),this.dispatchExternal("renderComplete"))}scrollBarCheck(){var t=0;this.element.scrollHeight>this.element.clientHeight&&(t=this.element.offsetWidth-this.element.clientWidth),t!==this.scrollbarWidth&&(this.scrollbarWidth=t,this.dispatch("scrollbar-vertical",t))}initializeRenderer(){var t;(t="string"==typeof this.table.options.renderVertical?({virtual:hv,basic:hb})[this.table.options.renderVertical]:this.table.options.renderVertical)?(this.renderMode=this.table.options.renderVertical,this.renderer=new t(this.table,this.element,this.tableElement),this.renderer.initialize(),(this.table.element.clientHeight||this.table.options.height)&&!(this.table.options.minHeight&&this.table.options.maxHeight)?this.fixedHeight=!0:this.fixedHeight=!1):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.fixedHeight||this.adjustTableSize(),this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.scrollBarCheck(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll(),this._showPlaceholder()}checkPlaceholder(){this.displayRowsCount?this._clearPlaceholder():this.tableEmpty()}_showPlaceholder(){this.placeholder&&(this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.initializePlaceholder(),this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder(),this.adjustTableSize())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth="",this.tableElement.style.display=""}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(t,e){var i=t.getElement();e%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(){this.activeRows.forEach(function(t){t.normalizeHeight()})}adjustTableSize(){let t=this.element.clientHeight,e,i=!1;if("fill"===this.renderer.verticalFillMode){let n=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));if(this.fixedHeight){e=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";let t="calc(100% - "+n+"px)";this.element.style.minHeight=e||"calc(100% - "+n+"px)",this.element.style.height=t,this.element.style.maxHeight=t}else this.element.style.height="",this.element.style.height=this.table.element.clientHeight-n+"px",this.element.scrollTop=this.scrollTop;this.renderer.resize(),this.fixedHeight||t==this.element.clientHeight||(i=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw()),this.scrollBarCheck()}return this._positionPlaceholder(),i}reinitialize(){this.rows.forEach(function(t){t.reinitialize(!0)})}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(t){this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,t?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(this.scrollLeft))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var t=document.createEvent("Event");t.initEvent("scroll",!1,!0),this.element.dispatchEvent(t)}else this.element.dispatchEvent(new Event("scroll"))}}class hw extends aU{constructor(t){super(t),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var t=document.createElement("div");return t.classList.add("tabulator-footer"),t}createContainerElement(){var t=document.createElement("div");return t.classList.add("tabulator-footer-contents"),this.element.appendChild(t),t}initializeElement(){this.table.options.footerElement&&("string"==typeof this.table.options.footerElement?"<"===this.table.options.footerElement[0]?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement)):this.element=this.table.options.footerElement)}getElement(){return this.element}append(t){this.activate(),this.containerElement.appendChild(t),this.table.rowManager.adjustTableSize()}prepend(t){this.activate(),this.element.insertBefore(t,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(t){t.parentNode.removeChild(t),this.deactivate()}deactivate(t){(!this.element.firstChild||t)&&(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class h_ extends aU{constructor(t){super(t),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var t={};this.listeners.forEach(e=>{t[e]={handler:null,components:[]}}),this.listeners=t}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach(t=>{this.pseudoTrackers[t].subscriber=this.pseudoMouseEnter.bind(this,t),this.subscribe(t+"-mouseover",this.pseudoTrackers[t].subscriber)}),this.pseudoTracking=!0}pseudoMouseEnter(t,e,i){this.pseudoTrackers[t].target!==i&&(this.pseudoTrackers[t].target&&this.dispatch(t+"-mouseleave",e,this.pseudoTrackers[t].target),this.pseudoMouseLeave(t,e),this.pseudoTrackers[t].target=i,this.dispatch(t+"-mouseenter",e,i))}pseudoMouseLeave(t,e){var i=Object.keys(this.pseudoTrackers),n={row:["cell"],cell:["row"]};(i=i.filter(e=>{var i=n[t];return e!==t&&(!i||i&&!i.includes(e))})).forEach(t=>{var i=this.pseudoTrackers[t].target;this.pseudoTrackers[t].target&&(this.dispatch(t+"-mouseleave",e,i),this.pseudoTrackers[t].target=null)})}bindSubscriptionWatchers(){var t=Object.keys(this.listeners);for(let e of Object.values(this.componentMap))for(let i of t){let t=e+"-"+i;this.subscriptionChange(t,this.subscriptionChanged.bind(this,e,i))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(t,e,i){var n=this.listeners[e].components,s=n.indexOf(t),o=!1;i?-1===s&&(n.push(t),o=!0):!this.subscribed(t+"-"+e)&&s>-1&&(n.splice(s,1),o=!0),"mouseenter"!==e&&"mouseleave"!==e||this.pseudoTracking||this.bindPseudoEvents(),o&&this.updateEventListeners()}updateEventListeners(){for(let t in this.listeners){let e=this.listeners[t];e.components.length?e.handler||(e.handler=this.track.bind(this,t),this.el.addEventListener(t,e.handler)):e.handler&&(this.el.removeEventListener(t,e.handler),e.handler=null)}}track(t,e){var i=e.composedPath&&e.composedPath()||e.path,n=this.findTargets(i);n=this.bindComponents(t,n),this.triggerEvents(t,e,n),this.pseudoTracking&&("mouseover"==t||"mouseleave"==t)&&!Object.keys(n).length&&this.pseudoMouseLeave("none",e)}findTargets(t){var e={};let i=Object.keys(this.componentMap);for(let n of t){let t=n.classList?[...n.classList]:[];if(t.filter(t=>this.abortClasses.includes(t)).length)break;for(let s of t.filter(t=>i.includes(t)))e[this.componentMap[s]]||(e[this.componentMap[s]]=n)}return e.group&&e.group===e.row&&delete e.row,e}bindComponents(t,e){var i=Object.keys(e).reverse(),n=this.listeners[t],s={},o={};for(let t of i){let i,r=e[t],a=this.previousTargets[t];if(a&&a.target===r)i=a.component;else switch(t){case"row":case"group":(n.components.includes("row")||n.components.includes("cell")||n.components.includes("group"))&&(i=this.table.rowManager.getVisibleRows(!0).find(t=>t.getElement()===r),e.row&&e.row.parentNode&&e.row.parentNode.closest(".tabulator-row")&&(e[t]=!1));break;case"column":n.components.includes("column")&&(i=this.table.columnManager.findColumn(r));break;case"cell":n.components.includes("cell")&&(s.row instanceof ls?i=s.row.findCell(r):e.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}i&&(s[t]=i,o[t]={target:r,component:i})}return this.previousTargets=o,s}triggerEvents(t,e,i){var n=this.listeners[t];for(let s in i)i[s]&&n.components.includes(s)&&this.dispatch(s+"-"+t,e,i[s])}clearWatchers(){for(let t in this.listeners){let e=this.listeners[t];e.handler&&(this.el.removeEventListener(t,e.handler),e.handler=null)}}}class hC{constructor(t){this.table=t,this.bindings={}}bind(t,e,i){this.bindings[t]||(this.bindings[t]={}),this.bindings[t][e]?console.warn("Unable to bind component handler, a matching function name is already bound",t,e,i):this.bindings[t][e]=i}handle(t,e,i){if(this.bindings[t]&&this.bindings[t][i]&&"function"==typeof this.bindings[t][i].bind)return this.bindings[t][i].bind(null,e);"then"!==i&&"string"==typeof i&&!i.startsWith("_")&&this.table.options.debugInvalidComponentFuncs&&console.error("The "+t+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class hE extends aU{constructor(t){super(t),this.requestOrder=0,this.loading=!1}initialize(){}load(t,e,i,n,s,o){var r=++this.requestOrder;return this.table.destroyed?Promise.resolve():(this.dispatchExternal("dataLoading",t),t&&(0==t.indexOf("{")||0==t.indexOf("["))&&(t=JSON.parse(t)),this.confirm("data-loading",[t,e,i,s]))?(this.loading=!0,s||this.alertLoader(),e=this.chain("data-params",[t,i,s],e||{},e||{}),e=this.mapParams(e,this.table.options.dataSendParams),this.chain("data-load",[t,e,i,s],!1,Promise.resolve([])).then(t=>{if(this.table.destroyed)console.warn("Data Load Response Blocked - Table has been destroyed");else{Array.isArray(t)||"object"!=typeof t||(t=this.mapParams(t,this.objectInvert(this.table.options.dataReceiveParams)));var e=this.chain("data-loaded",[t],null,t);r==this.requestOrder?(this.clearAlert(),!1!==e&&(this.dispatchExternal("dataLoaded",e),this.table.rowManager.setData(e,n,void 0===o?!n:o))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")}}).catch(t=>{console.error("Data Load Error: ",t),this.dispatchExternal("dataLoadError",t),s||this.alertError(),setTimeout(()=>{this.clearAlert()},this.table.options.dataLoaderErrorTimeout)}).finally(()=>{this.loading=!1})):(this.dispatchExternal("dataLoaded",t),t||(t=[]),this.table.rowManager.setData(t,n,void 0===o?!n:o),Promise.resolve())}mapParams(t,e){var i={};for(let n in t)i[e.hasOwnProperty(n)?e[n]:n]=t[n];return i}objectInvert(t){var e={};for(let i in t)e[t[i]]=i;return e}blockActiveLoad(){this.requestOrder++}alertLoader(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class hx{constructor(t,e,i){this.table=t,this.events={},this.optionsList=e||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(t,e){this.subscriptionNotifiers[t]||(this.subscriptionNotifiers[t]=[]),this.subscriptionNotifiers[t].push(e),this.subscribed(t)&&this._notifySubscriptionChange(t,!0)}subscribe(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e),this._notifySubscriptionChange(t,!0)}unsubscribe(t,e){var i;if(this.events[t]){if(e){if((i=this.events[t].findIndex(t=>t===e))>-1)this.events[t].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",t,e);return}}else delete this.events[t]}else{console.warn("Cannot remove event, no events set on:",t);return}this._notifySubscriptionChange(t,!1)}subscribed(t){return this.events[t]&&this.events[t].length}_notifySubscriptionChange(t,e){var i=this.subscriptionNotifiers[t];i&&i.forEach(t=>{t(e)})}_dispatch(){var t,e=Array.from(arguments),i=e.shift();return this.events[i]&&this.events[i].forEach((i,n)=>{let s=i.apply(this.table,e);n||(t=s)}),t}_debugDispatch(){var t=Array.from(arguments),e=t[0];return t[0]="ExternalEvent:"+t[0],(!0===this.debug||this.debug.includes(e))&&console.log(...t),this._dispatch(...arguments)}}class hT{constructor(t){this.events={},this.subscriptionNotifiers={},this.dispatch=t?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=t?this._debugChain.bind(this):this._chain.bind(this),this.confirm=t?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=t}subscriptionChange(t,e){this.subscriptionNotifiers[t]||(this.subscriptionNotifiers[t]=[]),this.subscriptionNotifiers[t].push(e),this.subscribed(t)&&this._notifySubscriptionChange(t,!0)}subscribe(t,e,i=1e4){this.events[t]||(this.events[t]=[]),this.events[t].push({callback:e,priority:i}),this.events[t].sort((t,e)=>t.priority-e.priority),this._notifySubscriptionChange(t,!0)}unsubscribe(t,e){var i;if(this.events[t]){if(e){if((i=this.events[t].findIndex(t=>t.callback===e))>-1)this.events[t].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",t,e);return}}}else{console.warn("Cannot remove event, no events set on:",t);return}this._notifySubscriptionChange(t,!1)}subscribed(t){return this.events[t]&&this.events[t].length}_chain(t,e,i,n){var s=i;return(Array.isArray(e)||(e=[e]),this.subscribed(t))?(this.events[t].forEach((t,i)=>{s=t.callback.apply(this,e.concat([s]))}),s):"function"==typeof n?n():n}_confirm(t,e){var i=!1;return Array.isArray(e)||(e=[e]),this.subscribed(t)&&this.events[t].forEach((t,n)=>{t.callback.apply(this,e)&&(i=!0)}),i}_notifySubscriptionChange(t,e){var i=this.subscriptionNotifiers[t];i&&i.forEach(t=>{t(e)})}_dispatch(){var t=Array.from(arguments),e=t.shift();this.events[e]&&this.events[e].forEach(e=>{e.callback.apply(this,t)})}_debugDispatch(){var t=Array.from(arguments),e=t[0];return t[0]="InternalEvent:"+e,(!0===this.debug||this.debug.includes(e))&&console.log(...t),this._dispatch(...arguments)}_debugChain(){var t=Array.from(arguments),e=t[0];return t[0]="InternalEvent:"+e,(!0===this.debug||this.debug.includes(e))&&console.log(...t),this._chain(...arguments)}_debugConfirm(){var t=Array.from(arguments),e=t[0];return t[0]="InternalEvent:"+e,(!0===this.debug||this.debug.includes(e))&&console.log(...t),this._confirm(...arguments)}}class hk extends aU{constructor(t){super(t)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(t,e,i){var n="";return void 0===this.options(t)||(n="Deprecated Setup Option - Use of the %c"+t+"%c option is now deprecated",e?(n=n+", Please use the %c"+e+"%c option instead",this._warnUser(n,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;"),i&&(this.table.options[e]=this.table.options[t])):this._warnUser(n,"font-weight: bold;","font-weight: normal;"),!1)}checkMsg(t,e){return void 0===this.options(t)||(this._warnUser("%cDeprecated Setup Option - Use of the %c"+t+" %c option is now deprecated, "+e,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1)}msg(t){this._warnUser(t)}}function hS(t,e){t.forEach(function(t){t.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}var hL={fitData:function(t,e){e&&this.table.columnManager.renderer.reinitializeColumnWidths(t),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:hS,fitDataTable:hS,fitDataStretch:function(t,e){var i=0,n=this.table.rowManager.element.clientWidth,s=0,o=!1;t.forEach((t,e)=>{t.widthFixed||t.reinitializeWidth(),(this.table.options.responsiveLayout?t.modules.responsive.visible:t.visible)&&(o=t),t.visible&&(i+=t.getWidth())}),o?(s=n-i+o.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(o.setWidth(0),this.table.modules.responsiveLayout.update()),s>0?o.setWidth(s):o.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(t,e){var i=this.table.rowManager.element.getBoundingClientRect().width,n=0,s=0,o=0,r=0,a=[],l=[],h=0,c=0,u=0;function d(t){return"string"==typeof t?t.indexOf("%")>-1?i/100*parseInt(t):parseInt(t):t}function m(t,e,i,n){var s=[],r=0,a=0,l=0,h=o,c=0,u=0,p=[];function f(t){return i*(t.column.definition.widthGrow||1)}function g(t){return d(t.width)-i*(t.column.definition.widthShrink||0)}return t.forEach(function(t,o){var r=n?g(t):f(t);t.column.minWidth>=r?s.push(t):t.column.maxWidth&&t.column.maxWidththis.table.rowManager.element.clientHeight&&(i-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),t.forEach(function(t){var e,i,s;t.visible&&(e=t.definition.width,i=parseInt(t.minWidth),e?(s=d(e),n+=s>i?s:i,t.definition.widthShrink&&(l.push({column:t,width:s>i?s:i}),h+=t.definition.widthShrink)):(a.push({column:t,width:0}),o+=t.definition.widthGrow||1))}),r=Math.floor((s=i-n)/o),u=m(a,s,r,!1),a.length&&u>0&&(a[a.length-1].width+=u),a.forEach(function(t){s-=t.width}),(c=Math.abs(u)+s)>0&&h&&(u=m(l,c,Math.floor(c/h),!0)),u&&l.length&&(l[l.length-1].width-=u),a.forEach(function(t){t.column.setWidth(t.width)}),l.forEach(function(t){t.column.setWidth(t.width)})}};class hM extends aY{static moduleName="layout";static modes=hL;constructor(t){super(t,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var t=this.table.options.layout;hM.modes[t]?this.mode=t:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+t),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(t){t.definition.widthGrow&&(t.definition.widthGrow=Number(t.definition.widthGrow)),t.definition.widthShrink&&(t.definition.widthShrink=Number(t.definition.widthShrink))}getMode(){return this.mode}layout(t){this.dispatch("layout-refreshing"),hM.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,t),this.dispatch("layout-refreshed")}}var hR={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class hP extends aY{static moduleName="localize";static langs=hR;constructor(t){super(t),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){for(let t in this.langList=aq.deepClone(hP.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder),this.table.options.langs)this.installLang(t,this.table.options.langs[t]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(t){this.langList.default.headerFilters.default=t}installLang(t,e){this.langList[t]?this._setLangProp(this.langList[t],e):this.langList[t]=e}_setLangProp(t,e){for(let i in e)t[i]&&"object"==typeof t[i]?this._setLangProp(t[i],e[i]):t[i]=e[i]}setLocale(t){if(!0===(t=t||"default")&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!this.langList[t]){let e=t.split("-")[0];this.langList[e]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,e),t=e):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}this.locale=t,this.lang=aq.deepClone(this.langList.default||{}),"default"!=t&&function t(e,i){for(var n in e)"object"==typeof e[n]?(i[n]||(i[n]={}),t(e[n],i[n])):i[n]=e[n]}(this.langList[t],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(t){return this.locale}getLang(t){return t?this.langList[t]:this.lang}getText(t,e){var i=(e?t+"|"+e:t).split("|");return this._getLangElement(i,this.locale)||""}_getLangElement(t,e){var i=this.lang;return t.forEach(function(t){var e;i&&(i=void 0!==(e=i[t])&&e)}),i}bind(t,e){this.bindings[t]||(this.bindings[t]=[]),this.bindings[t].push(e),e(this.getText(t),this.lang)}_executeBindings(){for(let t in this.bindings)this.bindings[t].forEach(e=>{e(this.getText(t),this.lang)})}}var hO=Object.freeze({__proto__:null,CommsModule:class extends aY{static moduleName="comms";constructor(t){super(t)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(t){var e=[];return this.table.constructor.registry.lookupTable(t).forEach(t=>{this.table!==t&&e.push(t)}),e}send(t,e,i,n){var s=this.getConnections(t);s.forEach(t=>{t.tableComms(this.table.element,e,i,n)}),!s.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)}receive(t,e,i,n){if(this.table.modExists(e))return this.table.modules[e].commsReceived(t,i,n);console.warn("Inter-table Comms Error - no such module:",e)}},LayoutModule:hM,LocalizeModule:hP});class hz{static registry={tables:[],register(t){hz.registry.tables.push(t)},deregister(t){var e=hz.registry.tables.indexOf(t);e>-1&&hz.registry.tables.splice(e,1)},lookupTable(t,e){var i,n,s=[];if("string"==typeof t){if((i=document.querySelectorAll(t)).length)for(var o=0;ohz.registry.tables.find(function(e){return t instanceof hz?e===t:e.element===t})};static findTable(t){var e=hz.registry.lookupTable(t,!0);return(!Array.isArray(e)||!!e.length)&&e}}class hD extends hz{static moduleBindings={};static moduleExtensions={};static modulesRegistered=!1;static defaultModules=!1;constructor(){super()}static initializeModuleBinder(t){!hD.modulesRegistered&&(hD.modulesRegistered=!0,hD._registerModules(hO,!0),t&&hD._registerModules(t))}static _extendModule(t,e,i){if(hD.moduleBindings[t]){var n=hD.moduleBindings[t][e];if(n){if("object"==typeof i)for(let t in i)n[t]=i[t];else console.warn("Module Error - Invalid value type, it must be an object")}else console.warn("Module Error - property does not exist:",e)}else console.warn("Module Error - module does not exist:",t)}static _registerModules(t,e){var i=Object.values(t);e&&i.forEach(t=>{t.prototype.moduleCore=!0}),hD._registerModule(i)}static _registerModule(t){Array.isArray(t)||(t=[t]),t.forEach(t=>{hD._registerModuleBinding(t),hD._registerModuleExtensions(t)})}static _registerModuleBinding(t){t.moduleName?hD.moduleBindings[t.moduleName]=t:console.error("Unable to bind module, no moduleName defined",t.moduleName)}static _registerModuleExtensions(t){var e=t.moduleExtensions;if(t.moduleExtensions)for(let t in e){let i=e[t];if(hD.moduleBindings[t])for(let e in i)hD._extendModule(t,e,i[e]);else for(let e in hD.moduleExtensions[t]||(hD.moduleExtensions[t]={}),i)hD.moduleExtensions[t][e]||(hD.moduleExtensions[t][e]={}),Object.assign(hD.moduleExtensions[t][e],i[e])}hD._extendModuleFromQueue(t)}static _extendModuleFromQueue(t){var e=hD.moduleExtensions[t.moduleName];if(e)for(let i in e)hD._extendModule(t.moduleName,i,e[i])}_bindModules(){var t=[],e=[],i=[];for(var n in this.modules={},hD.moduleBindings){let s=hD.moduleBindings[n],o=new s(this);this.modules[n]=o,s.prototype.moduleCore?this.modulesCore.push(o):s.moduleInitOrder?s.moduleInitOrder<0?t.push(o):e.push(o):i.push(o)}t.sort((t,e)=>t.moduleInitOrder>e.moduleInitOrder?1:-1),e.sort((t,e)=>t.moduleInitOrder>e.moduleInitOrder?1:-1),this.modulesRegular=t.concat(i.concat(e))}}class hA extends aU{constructor(t){super(t),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var t=document.createElement("div");return t.classList.add("tabulator-alert"),t}_createMsgElement(){var t=document.createElement("div");return t.classList.add("tabulator-alert-msg"),t.setAttribute("role","alert"),t}_typeClass(){return"tabulator-alert-state-"+this.type}alert(t,e="msg"){if(t){for(this.clear(),this.dispatch("alert-show",e),this.type=e;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof t&&(t=t()),t instanceof HTMLElement?this.msgElement.appendChild(t):this.msgElement.innerHTML=t,this.table.element.appendChild(this.element)}}clear(){this.dispatch("alert-hide",this.type),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}class hI extends hD{static defaultOptions=hu;static extendModule(){hI.initializeModuleBinder(),hI._extendModule(...arguments)}static registerModule(){hI.initializeModuleBinder(),hI._registerModule(...arguments)}constructor(t,e,i){super(),hI.initializeModuleBinder(i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new hC(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new hk(this),this.optionsList=new hd(this,"table constructor"),this.initialized=!1,this.destroyed=!1,this.initializeElement(t)&&(this.initializeCoreSystems(e),setTimeout(()=>{this._create()})),this.constructor.registry.register(this)}initializeElement(t){return"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?(this.element=t,!0):"string"!=typeof t?(console.error("Tabulator Creation Error - Invalid element provided:",t),!1):(this.element=document.querySelector(t),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",t),!1))}initializeCoreSystems(t){this.columnManager=new hg(this),this.rowManager=new hy(this),this.footerManager=new hw(this),this.dataLoader=new hE(this),this.alertManager=new hA(this),this._bindModules(),this.options=this.optionsList.generate(hI.defaultOptions,t),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new hx(this,this.options,this.options.debugEventsExternal),this.eventBus=new hT(this.options.debugEventsInternal),this.interactionMonitor=new h_(this),this.dataLoader.initialize(),this.footerManager.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this.initialized=!0,this._loadInitialData().finally(()=>{this.eventBus.dispatch("table-initialized"),this.externalEvents.dispatch("tableBuilt")})}_rtlCheck(){var t=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==t.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var t,e=this.element,i=this.options;if("TABLE"===e.tagName){this.originalElement=this.element,t=document.createElement("div");var n=e.attributes;for(var s in n)"object"==typeof n[s]&&t.setAttribute(n[s].name,n[s].value);e.parentNode.replaceChild(t,e),this.element=e=t}for(e.classList.add("tabulator"),e.setAttribute("role","grid");e.firstChild;)e.removeChild(e.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",e.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",e.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",e.style.maxHeight=i.maxHeight)}_initializeTable(){var t=this.element,e=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach(t=>{t.initialize()}),t.appendChild(this.columnManager.getElement()),t.appendChild(this.rowManager.getElement()),e.footerElement&&this.footerManager.activate(),e.autoColumns&&e.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach(t=>{t.initialize()}),this.columnManager.setColumns(e.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){return this.dataLoader.load(this.options.data).finally(()=>{this.columnManager.verticalAlignHeaders()})}destroy(){var t=this.element;for(this.destroyed=!0,this.constructor.registry.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.destroy();t.firstChild;)t.removeChild(t.firstChild);t.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var t=navigator.userAgent||navigator.vendor||window.opera;t.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):t.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):(t.indexOf("Firefox")>-1?this.browser="firefox":t.indexOf("Mac OS")>-1?this.browser="safari":this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t.slice(0,4))}initGuard(t,e){var i,n;return this.options.debugInitialization&&!this.initialized&&(t||(t=" "==(n="Error"==(i=Error().stack.split("\n"))[0]?i[2]:i[1])[0]?n.trim().split(" ")[1].split(".")[1]:n.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+t+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(e?" "+e:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(t,e,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(t,e,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(t){return this.rowManager.getData(t)}getDataCount(t){return this.rowManager.getDataCount(t)}replaceData(t,e,i){return this.initGuard(),this.dataLoader.load(t,e,i,!0,!0)}updateData(t){var e=0;return this.initGuard(),new Promise((i,n)=>{this.dataLoader.blockActiveLoad(),"string"==typeof t&&(t=JSON.parse(t)),t&&t.length>0?t.forEach(t=>{var s=this.rowManager.findRow(t[this.options.index]);s?(e++,s.updateData(t).then(()=>{--e||i()}).catch(e=>{n("Update Error - Unable to update row",t,e)})):n("Update Error - Unable to find row",t)}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}addData(t,e,i){return this.initGuard(),new Promise((n,s)=>{this.dataLoader.blockActiveLoad(),"string"==typeof t&&(t=JSON.parse(t)),t?this.rowManager.addRows(t,e,i).then(t=>{var e=[];t.forEach(function(t){e.push(t.getComponent())}),n(e)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})}updateOrAddData(t){var e=[],i=0;return this.initGuard(),new Promise((n,s)=>{this.dataLoader.blockActiveLoad(),"string"==typeof t&&(t=JSON.parse(t)),t&&t.length>0?t.forEach(t=>{var s=this.rowManager.findRow(t[this.options.index]);i++,s?s.updateData(t).then(()=>{i--,e.push(s.getComponent()),i||n(e)}):this.rowManager.addRows(t).then(t=>{i--,e.push(t[0].getComponent()),i||n(e)})}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})}getRow(t){var e=this.rowManager.findRow(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)}getRowFromPosition(t){var e=this.rowManager.getRowFromPosition(t);return e?e.getComponent():(console.warn("Find Error - No matching row found:",t),!1)}deleteRow(t){var e=[];for(let i of(this.initGuard(),Array.isArray(t)||(t=[t]),t)){let t=this.rowManager.findRow(i,!0);if(!t)return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found");e.push(t)}return e.sort((t,e)=>this.rowManager.rows.indexOf(t)>this.rowManager.rows.indexOf(e)?1:-1),e.forEach(t=>{t.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(t,e,i){return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),this.rowManager.addRows(t,e,i,!0).then(t=>t[0].getComponent())}updateOrAddRow(t,e){var i=this.rowManager.findRow(t);return(this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),i)?i.updateData(e).then(()=>i.getComponent()):this.rowManager.addRows(e).then(t=>t[0].getComponent())}updateRow(t,e){var i=this.rowManager.findRow(t);return(this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),i)?i.updateData(e).then(()=>Promise.resolve(i.getComponent())):(console.warn("Update Error - No matching row found:",t),Promise.reject("Update Error - No matching row found"))}scrollToRow(t,e,i){var n=this.rowManager.findRow(t);return n?this.rowManager.scrollToRow(n,e,i):(console.warn("Scroll Error - No matching row found:",t),Promise.reject("Scroll Error - No matching row found"))}moveRow(t,e,i){var n=this.rowManager.findRow(t);this.initGuard(),n?n.moveToRow(e,i):console.warn("Move Error - No matching row found:",t)}getRows(t){return this.rowManager.getComponents(t)}getRowPosition(t){var e=this.rowManager.findRow(t);return e?e.getPosition():(console.warn("Position Error - No matching row found:",t),!1)}setColumns(t){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(t)}getColumns(t){return this.columnManager.getComponents(t)}getColumn(t){var e=this.columnManager.findColumn(t);return e?e.getComponent():(console.warn("Find Error - No matching column found:",t),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(t){var e=this.columnManager.findColumn(t);if(this.initGuard(),!e)return console.warn("Column Show Error - No matching column found:",t),!1;e.show()}hideColumn(t){var e=this.columnManager.findColumn(t);if(this.initGuard(),!e)return console.warn("Column Hide Error - No matching column found:",t),!1;e.hide()}toggleColumn(t){var e=this.columnManager.findColumn(t);if(this.initGuard(),!e)return console.warn("Column Visibility Toggle Error - No matching column found:",t),!1;e.visible?e.hide():e.show()}addColumn(t,e,i){var n=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(t,e,n).then(t=>t.getComponent())}deleteColumn(t){var e=this.columnManager.findColumn(t);return(this.initGuard(),e)?e.delete():(console.warn("Column Delete Error - No matching column found:",t),Promise.reject())}updateColumnDefinition(t,e){var i=this.columnManager.findColumn(t);return(this.initGuard(),i)?i.updateDefinition(e):(console.warn("Column Update Error - No matching column found:",t),Promise.reject())}moveColumn(t,e,i){var n=this.columnManager.findColumn(t),s=this.columnManager.findColumn(e);this.initGuard(),n?s?this.columnManager.moveColumn(n,s,i):console.warn("Move Error - No matching column found:",s):console.warn("Move Error - No matching column found:",t)}scrollToColumn(t,e,i){return new Promise((n,s)=>{var o=this.columnManager.findColumn(t);return o?this.columnManager.scrollToColumn(o,e,i):(console.warn("Scroll Error - No matching column found:",t),Promise.reject("Scroll Error - No matching column found"))})}redraw(t){this.initGuard(),this.columnManager.redraw(t),this.rowManager.redraw(t)}setHeight(t){this.options.height=isNaN(t)?t:t+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}on(t,e){this.externalEvents.subscribe(t,e)}off(t,e){this.externalEvents.unsubscribe(t,e)}dispatchEvent(){var t=Array.from(arguments);t.shift(),this.externalEvents.dispatch(...arguments)}alert(t,e){this.initGuard(),this.alertManager.alert(t,e)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(t,e){return!!this.modules[t]||(e&&console.error("Tabulator Module Not Installed: "+t),!1)}module(t){var e=this.modules[t];return e||console.error("Tabulator module not installed: "+t),e}}function hF(t){let e=t.getValue();return e?e.format():""}function hN(t,e){return t?e?t.parsed.valueOf()-e.parsed.valueOf():-1:1}function hH(t,e){return t.join(",").localeCompare(e.join(","))}async function hB(){eO.add(eB,eH,eG,eA,ej,eI,eZ,eD,eN,eV,eF,eW),ez.watch(),function(){if(function(){try{return window.self!==window.top}catch(t){return!1}}())return;let t=document.querySelector(".header-full-screen-icon-container");t instanceof HTMLAnchorElement&&(t.style.display="none")}(),function(){let t=new e0("about popup",!1);t.subscribe(e2);let e=document.querySelector(".about-popup"),i=document.querySelector(".header-about-icon-container"),n=document.querySelector(".about-popup-close-icon-container");i?.addEventListener("click",()=>t.setValue(!t.getValue())),n?.addEventListener("click",()=>t.setValue(!1)),window.addEventListener("click",n=>{!0===t.getValue()&&n.target instanceof Element&&!i?.contains(n.target)&&!e?.contains(n.target)&&t.setValue(!1)}),t.initialize()}(),function(){let t=new e0("filter popup",!1);t.subscribe(aW,"toggle filter popup");let e=document.querySelector(".filter-popup"),i=document.querySelector(".header-filter-icon-container");if(!i)throw Error("icon not found");i.addEventListener("click",()=>{t.setValue(!t.getValue())}),window.addEventListener("click",n=>{!0===t.getValue()&&n.target instanceof Element&&!i?.contains(n.target)&&!e?.contains(n.target)&&t.setValue(!1)}),t.initialize()}();let t=null!==new URLSearchParams(window.location.search).get("revamp"),e=function(){let t=new e0("view toggle","map");return!function(t){let e=document.querySelector(".header-table-icon-container"),i=document.querySelector(".header-map-icon-container");i&&e&&(e.addEventListener("click",()=>t.setValue("table")),i.addEventListener("click",()=>t.setValue("map")))}(t),t}(),i=function(){let t=new eU.Map("map",{layers:[eK],worldCopyJump:!0});return t.setView([40,-96],3),t.attributionControl.setPrefix('Parking Reform Network'),t.createPane(eq),t.getPane(eq).style.zIndex="900",t}(),n=await aS({includeMultipleReforms:t}),s=new az(Object.values(n)),o=new aP(n,{searchInput:null,policyTypeFilter:t?"any parking reform":"legacy reform",allMinimumsRemovedToggle:!0,includedPolicyChanges:s.default("includedPolicyChanges"),scope:s.default("scope"),landUse:s.default("landUse"),status:s.default("status"),country:s.default("country"),year:s.default("year"),populationSliderIndexes:[0,aB]}),r=function(t,e,i){let n=Object.entries(t.entries).reduce((t,[i,n])=>{let[s,o]=n.place.coord,r=n.place.repeal,a=new eU.CircleMarker([o,s],{...r?eY:e$,radius:eJ({zoom:e.getZoom(),isPrimary:r})});return a.bindTooltip(i),t[i]=a,t},{}),s=new eU.FeatureGroup,o=new Set,r=!1;return t.subscribe("update map markers",()=>{if("table"===i.getValue()){r=!0;return}eX(o,t.placeIds,n,s),o=t.placeIds}),i.subscribe(e=>{"map"===e&&r&&(eX(o,t.placeIds,n,s),o=t.placeIds,r=!1)},"apply queued map data refresh"),e.addEventListener("zoomend",()=>{let i=e.getZoom();Object.entries(n).forEach(([e,n])=>{let s=eJ({zoom:i,isPrimary:t.entries[e].place.repeal});n.setRadius(s)})}),s.addTo(e),s}(o,i,e);!function(t,e){t.subscribe("move map on search",({searchInput:i})=>{if(i){let[n,s]=t.entries[i].place.coord;e.setView([s,n],6)}})}(o,i),function(t){let e=document.getElementById("map-counter"),i=document.getElementById("table-counter");e&&i&&(aG(e,t),aG(i,t),t.subscribe("update counters",n=>{e.innerHTML=aZ("map",n,t.placeIds.size,t.numMatchedPolicyRecords,t.matchedPolicyTypes,t.matchedCountries),i.innerHTML=aZ("table",n,t.placeIds.size,t.numMatchedPolicyRecords,t.matchedPolicyTypes,t.matchedCountries)}))}(o),function(t){var e;let i=Object.keys(t.entries).map(t=>({value:t,label:t})),n=document.querySelector(".search");if(!n)return;let s=new((e=eQ)&&e.__esModule?e.default:e)(n,{position:"bottom",choices:i,placeholderValue:"Search",removeItemButton:!0,allowHTML:!1,itemSelectText:"",searchEnabled:!0});s.setChoiceByValue(t.getState().searchInput||"");let o=function(){let t=new e0("search popup",!1);t.subscribe(e1);let e=document.querySelector("#search-popup"),i=document.querySelector("div.choices"),n=document.querySelector(".header-search-icon-container");if(!n)throw Error("icon not found");return n.addEventListener("click",()=>{t.setValue(!t.getValue()),setTimeout(()=>i?.click(),100)}),window.addEventListener("click",i=>{!0===t.getValue()&&i.target instanceof Element&&!n?.contains(i.target)&&!e?.contains(i.target)&&t.setValue(!1)}),t.initialize(),t}();t.subscribe("reset search UI when search is cleared",t=>{null===t.searchInput&&s.setChoiceByValue("")}),n.addEventListener("change",()=>{t.update({searchInput:s.getValue(!0)||null}),o.setValue(!1)})}(o),function(t,e){let i=document.querySelector("#filter-popup");i&&(function(t,e){if("legacy reform"===t.getState().policyTypeFilter)return;let i="filter-policy-type-dropdown",n=document.createElement("div");n.className="filter-policy-type-dropdown-container";let s=document.createElement("select");s.id=i,s.name=i,["any parking reform","add parking maximums","reduce parking minimums","remove parking minimums"].forEach(t=>{let e=document.createElement("option");e.value=t,e.textContent=iM(t),s.append(e)}),s.addEventListener("change",()=>{let e=s.value;t.update({policyTypeFilter:e})}),n.append(s),e.append(n)}(t,i),function(t,e){let i=document.createElement("div"),[n,s]=aI("filter-all-minimums-toggle","filter-all-minimums-toggle",t.getState().allMinimumsRemovedToggle,"Only places with all parking minimums removed");n.id="filter-all-minimums-toggle-label",i.append(n),e.append(i),s.addEventListener("change",()=>{t.update({allMinimumsRemovedToggle:s.checked})}),t.subscribe("possibly hide all minimums toggle",({policyTypeFilter:t})=>{i.hidden="reduce parking minimums"===t})}(t,i),function(t,e){let i=t.getState().populationSliderIndexes,[n,s]=function(t,e){let i=aF("population-slider"),n=document.createElement("div");n.className="population-slider-container";let s=document.createElement("div");s.id="population-slider-label",n.append(s);let o=document.createElement("div");o.className="population-slider-controls",n.append(o);let r=document.createElement("input");r.setAttribute("aria-labelledby","population-slider-label"),r.className="population-slider-left",r.name="min",r.type="range",r.step="0.5",r.min="0",r.value="0",o.append(r);let a=document.createElement("input");a.setAttribute("aria-labelledby","population-slider-label"),a.className="population-slider-right",a.name="max",a.type="range",a.step="0.5",a.min="0",o.append(a);let l=new e0("filter accordion population",{hidden:!1,expanded:!1,supplementalTitle:aj(t)});return l.subscribe(t=>aA(i,"Population",t)),i.accordionButton.addEventListener("click",()=>{let t=l.getValue();l.setValue({...t,expanded:!t.expanded})}),i.contentContainer.append(n),e.append(i.outerContainer),[{controls:o,label:s,left:r,right:a},l]}(i,e),o=i[1].toString();n.left.setAttribute("max",o),n.right.setAttribute("max",o),n.right.setAttribute("value",o);let r=()=>{let e=Math.floor(parseFloat(n.left.value)),i=Math.ceil(parseFloat(n.right.value));t.update({populationSliderIndexes:[e,i]})};n.left.addEventListener("input",r),n.right.addEventListener("input",r),s.subscribe(({hidden:e})=>{e||aV(t.getState().populationSliderIndexes,n)},"render population slider"),t.subscribe("update population sliders",t=>{let e=s.getValue();s.setValue({...e,supplementalTitle:aj(t.populationSliderIndexes)}),s.getValue().hidden||aV(t.populationSliderIndexes,n)}),s.initialize()}(t,i),aH(t,e,i,{htmlName:"country",filterStateKey:"country",legend:"Country",preserveCapitalization:!0}),aH(t,e,i,{htmlName:"policy-change",filterStateKey:"includedPolicyChanges",legend:"Policy change",hide:({policyTypeFilter:t})=>"legacy reform"!==t&&"any parking reform"!==t}),aH(t,e,i,{htmlName:"land-use",filterStateKey:"landUse",legend:"Affected land use",hide:({policyTypeFilter:t,allMinimumsRemovedToggle:e})=>"any parking reform"===t||e&&"reduce parking minimums"!==t}),aH(t,e,i,{htmlName:"scope",filterStateKey:"scope",legend:"Reform scope",hide:({policyTypeFilter:t,allMinimumsRemovedToggle:e})=>"any parking reform"===t||e&&"reduce parking minimums"!==t}),aH(t,e,i,{htmlName:"status",filterStateKey:"status",legend:"Reform status",hide:({policyTypeFilter:t})=>"any parking reform"===t}),aH(t,e,i,{htmlName:"year",filterStateKey:"year",legend:"Reform year",useTwoColumns:!0,hide:({policyTypeFilter:t})=>"any parking reform"===t}))}(o,s);let a=function(t,e){hI.registerModule([lw,lC,lE,hn,l0,lB,lq]);let i=new hI("#table",{data:Object.entries(t.entries).map(([t,e])=>({id:t,place:e.place.name,state:e.place.state,country:e.place.country,population:e.place.pop.toLocaleString("en-us"),date:e.unifiedPolicy.date,url:e.place.url,status:e.unifiedPolicy.status,landUse:e.unifiedPolicy.land,policyChange:e.unifiedPolicy.policy,scope:e.unifiedPolicy.scope})),columns:[{title:"Place",field:"place",width:180,frozen:!0,formatter:"link",formatterParams:{urlField:"url",labelField:"place",target:"_blank"}},{title:"State",field:"state",width:70},{title:"Country",field:"country",width:110},{title:"Population",field:"population",sorter:"number",sorterParams:{thousandSeparator:","},width:90},{title:"Date",field:"date",width:110,formatter:hF,sorter:hN},{title:"Policy change",field:"policyChange",width:260,sorter:hH},{title:"Scope",field:"scope",width:260,sorter:hH},{title:"Land use",field:"landUse",width:160,sorter:hH},{title:"Status",field:"status",width:120}],layout:"fitColumns",movableColumns:!0,pagination:!0,paginationSize:100,paginationCounter:(t,e,i,n,s)=>`Page ${i} of ${s}`}),n=!1;i.on("tableBuilt",()=>{n=!0,i.setFilter(e=>t.placeIds.has(e.id))});let s=!1;return t.subscribe("update table's records",()=>{if(n){if("map"===e.getValue()){s=!0;return}i.refreshFilter()}}),e.subscribe(t=>{"table"===t&&s&&(i.refreshFilter(),s=!1)},"apply queued table data refresh"),i}(o,e);!function(t,e){t.subscribe(t=>(function(t,e){let i=document.querySelector(".header-table-icon-container"),n=document.querySelector(".header-map-icon-container"),s=document.querySelector("#table-view"),o=document.querySelector("#map"),r=document.querySelector("#map-counter"),a=document.querySelector(".prn-logo-map");n&&i&&s&&o&&r&&a&&("map"===e?(i.style.display="inline-flex",n.style.display="none",s.style.display="none",o.hidden=!1,r.hidden=!1,a.hidden=!1):(i.style.display="none",n.style.display="inline-flex",s.style.display="flex",o.hidden=!0,r.hidden=!0,a.hidden=!0,t.redraw()))})(e,t),"switch app view")}(e,a),function(t,e,i,n){let s=new e0("scorecard",{type:"hidden"});s.subscribe(e3);let o=document.querySelector("#scorecard-container"),r=document.querySelector(".top-header");i.on("click",t=>{let e=t.sourceTarget.getTooltip().getContent();s.setValue({type:"visible",placeId:e,entry:n[e]})}),t.subscribe("open scorecard on search",t=>{let i=t.searchInput;i&&"map"===e.getValue()&&s.setValue({type:"visible",placeId:i,entry:n[i]})}),window.addEventListener("click",t=>{!("visible"===s.getValue().type&&t.target instanceof Element)||t.target instanceof SVGPathElement||r?.contains(t.target)||o?.contains(t.target)||s.setValue({type:"hidden"})}),o?.addEventListener("click",t=>{let e=t.target;e instanceof Element&&e.closest(".scorecard-close-icon-container")&&s.setValue({type:"hidden"})}),s.subscribe(({type:e})=>{s.isInitialized&&"hidden"===e&&t.update({searchInput:null})},"reset search FilterState when scorecard closed"),s.initialize()}(o,e,r,n),e.initialize(),o.initialize()}window.onload=async()=>{await hB()};
${t.unifiedPolicy.summary}