diff --git a/.gitignore b/.gitignore index 19f36aa..a1b3026 100644 --- a/.gitignore +++ b/.gitignore @@ -17,9 +17,9 @@ .idea/**/contentModel.xml # Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml +.idea/**Sources/ +.idea/**Sources.ids +.idea/**Sources.local.xml .idea/**/sqlDataSources.xml .idea/**/dynamic.xml .idea/**/uiDesigner.xml @@ -98,6 +98,6 @@ node_modules .idea .ipynb_checkpoints *.ipynb -dist -/data + + package-lock.json diff --git a/dist/bundle.js b/dist/bundle.js new file mode 100644 index 0000000..4141706 --- /dev/null +++ b/dist/bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see bundle.js.LICENSE.txt */ +(()=>{var t,e,n,i,r={5411:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var i=n(1601),r=n.n(i),o=n(6314),a=n.n(o)()(r());a.push([t.id,'.tabulator{background-color:#888;border:1px solid #999;font-size:14px;overflow:hidden;position:relative;text-align:left;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-transform:translateZ(0);transform:translateZ(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableholder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select,.tabulator.tabulator-ranges .tabulator-cell:not(.tabulator-editing){user-select:none}.tabulator .tabulator-header{background-color:#e6e6e6;border-bottom:1px solid #999;box-sizing:border-box;color:#555;font-weight:700;outline:none;overflow:hidden;position:relative;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;white-space:nowrap;width:100%}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-header-contents{overflow:hidden;position:relative}.tabulator .tabulator-header .tabulator-header-contents .tabulator-headers{display:inline-block}.tabulator .tabulator-header .tabulator-col{background:#e6e6e6;border-right:1px solid #aaa;box-sizing:border-box;display:inline-flex;flex-direction:column;justify-content:flex-start;overflow:hidden;position:relative;text-align:left;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col.tabulator-moving{background:#cdcdcd;border:1px solid #999;pointer-events:none;position:absolute}.tabulator .tabulator-header .tabulator-col.tabulator-range-highlight{background-color:#d6d6d6;color:#000}.tabulator .tabulator-header .tabulator-col.tabulator-range-selected{background-color:#3876ca;color:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;padding:4px;position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title.tabulator-col-title-wrap{text-overflow:clip;white-space:normal}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{background:#fff;border:1px solid #999;box-sizing:border-box;padding:1px;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{align-items:center;bottom:0;display:flex;position:absolute;right:4px;top:0}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #bbb;border-left:6px solid transparent;border-right:6px solid transparent;height:0;width:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{border-top:1px solid #aaa;display:flex;margin-right:-1px;overflow:hidden;position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{box-sizing:border-box;margin-top:2px;position:relative;text-align:center;width:100%}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto!important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{height:0;width:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover{background-color:#cdcdcd;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-bottom:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #bbb;border-top:none}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-bottom:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:6px solid #666;border-top:none}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{border-top:6px solid #555;cursor:pointer}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #666;color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{align-items:center;display:flex;justify-content:center;text-orientation:mixed;writing-mode:vertical-rl}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-bottom:20px;padding-right:0}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{bottom:auto;justify-content:center;left:0;right:0;top:4px}.tabulator .tabulator-header .tabulator-frozen{left:0;position:sticky;z-index:11}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator .tabulator-header .tabulator-calcs-holder{background:#f3f3f3!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;display:inline-block}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{display:inline-block}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{-webkit-overflow-scrolling:touch;overflow:auto;position:relative;white-space:nowrap;width:100%}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{align-items:center;box-sizing:border-box;display:flex;justify-content:center;min-width:100%;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{color:#ccc;display:inline-block;font-size:20px;font-weight:700;padding:10px;text-align:center;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{background-color:#fff;color:#333;display:inline-block;overflow:visible;position:relative;white-space:nowrap}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{background:#e2e2e2!important;font-weight:700}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #aaa}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #aaa}.tabulator .tabulator-tableholder .tabulator-range-overlay{inset:0;pointer-events:none;position:absolute;z-index:10}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range{border:1px solid #2975dd;box-sizing:border-box;position:absolute}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active:after{background-color:#2975dd;border-radius:999px;bottom:-3px;content:"";height:6px;position:absolute;right:-3px;width:6px}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range-cell-active{border:2px solid #2975dd;box-sizing:border-box;position:absolute}.tabulator .tabulator-footer{background-color:#e6e6e6;border-top:1px solid #999;color:#555;font-weight:700;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;white-space:nowrap}.tabulator .tabulator-footer .tabulator-footer-contents{align-items:center;display:flex;flex-direction:row;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder{background:#f3f3f3!important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;overflow:hidden;text-align:left;width:100%}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{background:#f3f3f3!important;display:inline-block}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{border-bottom:none;margin-bottom:-5px}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-left:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:400}.tabulator .tabulator-footer .tabulator-paginator{color:#555;flex:1;font-family:inherit;font-size:inherit;font-weight:inherit;text-align:right}.tabulator .tabulator-footer .tabulator-page-size{border:1px solid #aaa;border-radius:3px;display:inline-block;margin:0 5px;padding:2px 5px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{background:hsla(0,0%,100%,.2);border:1px solid #aaa;border-radius:3px;display:inline-block;margin:0 2px;padding:2px 5px}.tabulator .tabulator-footer .tabulator-page.active{color:#d00}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:.5}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-footer .tabulator-page:not(disabled):hover{background:rgba(0,0,0,.2);color:#fff;cursor:pointer}}.tabulator .tabulator-col-resize-handle{display:inline-block;margin-left:-3px;margin-right:-3px;position:relative;vertical-align:middle;width:6px;z-index:11}@media (hover:hover) and (pointer:fine){.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}}.tabulator .tabulator-col-resize-handle:last-of-type{margin-right:0;width:3px}.tabulator .tabulator-alert{align-items:center;background:rgba(0,0,0,.4);display:flex;height:100%;left:0;position:absolute;text-align:center;top:0;width:100%;z-index:100}.tabulator .tabulator-alert .tabulator-alert-msg{background:#fff;border-radius:10px;display:inline-block;font-size:16px;font-weight:700;margin:0 auto;padding:10px 20px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #d00;color:#590000}.tabulator-row{background-color:#fff;box-sizing:border-box;min-height:22px;position:relative}.tabulator-row.tabulator-row-even{background-color:#efefef}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selectable:hover{background-color:#bbb;cursor:pointer}}.tabulator-row.tabulator-selected{background-color:#9abcea}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-selected:hover{background-color:#769bcc;cursor:pointer}}.tabulator-row.tabulator-row-moving{background:#fff;border:1px solid #000}.tabulator-row.tabulator-moving{border-bottom:1px solid #aaa;border-top:1px solid #aaa;pointer-events:none;position:absolute;z-index:15}.tabulator-row.tabulator-range-highlight .tabulator-cell.tabulator-range-row-header{background-color:#d6d6d6;color:#000}.tabulator-row.tabulator-range-highlight.tabulator-range-selected .tabulator-cell.tabulator-range-row-header,.tabulator-row.tabulator-range-selected .tabulator-cell.tabulator-range-row-header{background-color:#3876ca;color:#fff}.tabulator-row .tabulator-row-resize-handle{bottom:0;height:5px;left:0;position:absolute;right:0}.tabulator-row .tabulator-row-resize-handle.prev{bottom:auto;top:0}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}}.tabulator-row .tabulator-responsive-collapse{border-bottom:1px solid #aaa;border-top:1px solid #aaa;box-sizing:border-box;padding:5px}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:14px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{border-right:1px solid #aaa;box-sizing:border-box;display:inline-block;outline:none;overflow:hidden;padding:4px;position:relative;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.tabulator-row .tabulator-cell.tabulator-frozen{background-color:inherit;display:inline-block;left:0;position:sticky;z-index:11}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1d68cd;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{background:transparent;border:1px;outline:none}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #d00}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{background:transparent;border:1px;color:#d00}.tabulator-row .tabulator-cell.tabulator-row-handle{align-items:center;display:inline-flex;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{background:#666;height:3px;margin-top:2px;width:100%}.tabulator-row .tabulator-cell.tabulator-range-selected:not(.tabulator-range-only-cell-selected):not(.tabulator-range-row-header){background-color:#9abcea}.tabulator-row .tabulator-cell .tabulator-data-tree-branch-empty{display:inline-block;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{border-bottom:2px solid #aaa;border-bottom-left-radius:1px;border-left:2px solid #aaa;display:inline-block;height:9px;margin-right:5px;margin-top:-9px;vertical-align:middle;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-control{align-items:center;background:rgba(0,0,0,.1);border:1px solid #333;border-radius:2px;display:inline-flex;height:11px;justify-content:center;margin-right:5px;overflow:hidden;vertical-align:middle;width:11px}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{background:rgba(0,0,0,.2);cursor:pointer}}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{background:transparent;display:inline-block;height:7px;position:relative;width:1px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{background:#333;display:inline-block;height:7px;position:relative;width:1px}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{align-items:center;background:#666;border-radius:20px;color:#fff;display:inline-flex;font-size:1.1em;font-weight:700;height:15px;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;width:15px}@media (hover:hover) and (pointer:fine){.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{cursor:pointer;opacity:.7}}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open{display:none}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle svg{stroke:#fff}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{border-radius:14px;display:inline-block;height:14px;width:14px}.tabulator-row.tabulator-group{background:#ccc;border-bottom:1px solid #999;border-right:1px solid #aaa;border-top:1px solid #999;box-sizing:border-box;font-weight:700;min-width:100%;padding:5px 5px 5px 10px}@media (hover:hover) and (pointer:fine){.tabulator-row.tabulator-group:hover{background-color:rgba(0,0,0,.1);cursor:pointer}}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{border-bottom:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;margin-right:10px}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{border-bottom:6px solid transparent;border-left:6px solid #666;border-right:0;border-top:6px solid transparent;display:inline-block;height:0;margin-right:16px;vertical-align:middle;width:0}.tabulator-row.tabulator-group span{color:#d00;margin-left:10px}.tabulator-popup-container{-webkit-overflow-scrolling:touch;background:#fff;border:1px solid #aaa;box-shadow:0 0 5px 0 rgba(0,0,0,.2);box-sizing:border-box;display:inline-block;font-size:14px;overflow-y:auto;position:absolute;z-index:10000}.tabulator-popup{border-radius:3px;padding:5px}.tabulator-tooltip{border-radius:2px;box-shadow:none;font-size:12px;max-width:Min(500px,100%);padding:3px 5px;pointer-events:none}.tabulator-menu .tabulator-menu-item{box-sizing:border-box;padding:5px 10px;position:relative;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:.5}@media (hover:hover) and (pointer:fine){.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{background:#efefef;cursor:pointer}}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after{border-color:#aaa;border-style:solid;border-width:1px 1px 0 0;content:"";display:inline-block;height:7px;position:absolute;right:10px;top:calc(5px + .4em);transform:rotate(45deg);vertical-align:top;width:7px}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #aaa}.tabulator-edit-list{-webkit-overflow-scrolling:touch;font-size:14px;max-height:200px;overflow-y:auto}.tabulator-edit-list .tabulator-edit-list-item{color:#333;outline:none;padding:4px}.tabulator-edit-list .tabulator-edit-list-item.active{background:#1d68cd;color:#fff}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid hsla(0,0%,100%,.5)}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1d68cd}@media (hover:hover) and (pointer:fine){.tabulator-edit-list .tabulator-edit-list-item:hover{background:#1d68cd;color:#fff;cursor:pointer}}.tabulator-edit-list .tabulator-edit-list-placeholder{color:#333;padding:4px;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #aaa;color:#333;font-weight:700;padding:6px 4px 4px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2{padding-left:12px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3{padding-left:20px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4{padding-left:28px}.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5{padding-left:36px}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{direction:rtl;text-align:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{border-left:1px solid #aaa;border-right:initial;text-align:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-left:-1px;margin-right:0}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-left:25px;padding-right:0}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{left:8px;right:auto}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-left:1px solid #aaa;border-right:initial}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{border-bottom-left-radius:0;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #aaa;margin-left:5px;margin-right:0}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-left:5px;margin-right:0}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-left:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-right:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-col-resize-handle:last-of-type{margin-left:0;margin-right:-3px;width:3px}.tabulator.tabulator-rtl .tabulator-footer .tabulator-calcs-holder{text-align:initial}.tabulator-print-fullscreen{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10000}body.tabulator-print-fullscreen-hide>:not(.tabulator-print-fullscreen){display:none!important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{border-bottom:2px solid #aaa;border-bottom-left-radius:1px;border-left:2px solid #aaa;display:inline-block;height:9px;margin-right:5px;margin-top:-9px;vertical-align:middle;width:7px}.tabulator-print-table .tabulator-print-table-group{background:#ccc;border-bottom:1px solid #999;border-right:1px solid #aaa;border-top:1px solid #999;box-sizing:border-box;font-weight:700;min-width:100%;padding:5px 5px 5px 10px}@media (hover:hover) and (pointer:fine){.tabulator-print-table .tabulator-print-table-group:hover{background-color:rgba(0,0,0,.1);cursor:pointer}}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{border-bottom:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;margin-right:10px}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px!important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px!important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{border-bottom:6px solid transparent;border-left:6px solid #666;border-right:0;border-top:6px solid transparent;display:inline-block;height:0;margin-right:16px;vertical-align:middle;width:0}.tabulator-print-table .tabulator-print-table-group span{color:#d00;margin-left:10px}.tabulator-print-table .tabulator-data-tree-control{align-items:center;background:rgba(0,0,0,.1);border:1px solid #333;border-radius:2px;display:inline-flex;height:11px;justify-content:center;margin-right:5px;overflow:hidden;vertical-align:middle;width:11px}@media (hover:hover) and (pointer:fine){.tabulator-print-table .tabulator-data-tree-control:hover{background:rgba(0,0,0,.2);cursor:pointer}}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{background:transparent;display:inline-block;height:7px;position:relative;width:1px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{background:#333;display:inline-block;height:7px;position:relative;width:1px}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{background:#333;content:"";height:1px;left:-3px;position:absolute;top:3px;width:7px}',""]);const s=a},6314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,r,o){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(i)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),e.push(c))}},e}},1601:t=>{"use strict";t.exports=function(t){return t[1]}},5794:(t,e,n)=>{"use strict";n.r(e),n.d(e,{active:()=>CE,arc:()=>q_,area:()=>Z_,areaRadial:()=>sC,ascending:()=>r,axisBottom:()=>lt,axisLeft:()=>ut,axisRight:()=>st,axisTop:()=>at,bisect:()=>u,bisectLeft:()=>l,bisectRight:()=>s,bisector:()=>o,brush:()=>vr,brushSelection:()=>gr,brushX:()=>mr,brushY:()=>br,chord:()=>Wr,clientPoint:()=>C_,cluster:()=>vp,color:()=>No,create:()=>b_,creator:()=>lw,cross:()=>d,csv:()=>Wg,csvFormat:()=>Pa,csvFormatRows:()=>La,csvParse:()=>Ra,csvParseRows:()=>Sa,cubehelix:()=>wa,curveBasis:()=>jC,curveBasisClosed:()=>VC,curveBasisOpen:()=>UC,curveBundle:()=>YC,curveCardinal:()=>$C,curveCardinalClosed:()=>ZC,curveCardinalOpen:()=>tx,curveCatmullRom:()=>ix,curveCatmullRomClosed:()=>ox,curveCatmullRomOpen:()=>sx,curveLinear:()=>K_,curveLinearClosed:()=>ux,curveMonotoneX:()=>bx,curveMonotoneY:()=>vx,curveNatural:()=>_x,curveStep:()=>xx,curveStepAfter:()=>Mx,curveStepBefore:()=>Ex,customEvent:()=>l_,descending:()=>p,deviation:()=>m,dispatch:()=>gt,drag:()=>je,dragDisable:()=>Le,dragEnable:()=>Oe,dsvFormat:()=>Da,easeBack:()=>Cs,easeBackIn:()=>ws,easeBackInOut:()=>Cs,easeBackOut:()=>_s,easeBounce:()=>bs,easeBounceIn:()=>ms,easeBounceInOut:()=>vs,easeBounceOut:()=>bs,easeCircle:()=>os,easeCircleIn:()=>is,easeCircleInOut:()=>os,easeCircleOut:()=>rs,easeCubic:()=>Ua,easeCubicIn:()=>Va,easeCubicInOut:()=>Ua,easeCubicOut:()=>Ga,easeElastic:()=>Ms,easeElasticIn:()=>Es,easeElasticInOut:()=>Ts,easeElasticOut:()=>Ms,easeExp:()=>ns,easeExpIn:()=>ts,easeExpInOut:()=>ns,easeExpOut:()=>es,easeLinear:()=>Ia,easePoly:()=>Ka,easePolyIn:()=>qa,easePolyInOut:()=>Ka,easePolyOut:()=>Ya,easeQuad:()=>Wa,easeQuadIn:()=>Ha,easeQuadInOut:()=>Wa,easeQuadOut:()=>ja,easeSin:()=>Qa,easeSinIn:()=>Ja,easeSinInOut:()=>Qa,easeSinOut:()=>Za,entries:()=>wo,event:()=>i_,extent:()=>b,forceCenter:()=>ks,forceCollide:()=>Hs,forceLink:()=>Xs,forceManyBody:()=>nl,forceRadial:()=>il,forceSimulation:()=>el,forceX:()=>rl,forceY:()=>ol,format:()=>gl,formatDefaultLocale:()=>yl,formatLocale:()=>vl,formatPrefix:()=>ml,formatSpecifier:()=>hl,geoAlbers:()=>Id,geoAlbersUsa:()=>Hd,geoArea:()=>gu,geoAzimuthalEqualArea:()=>Gd,geoAzimuthalEqualAreaRaw:()=>Vd,geoAzimuthalEquidistant:()=>qd,geoAzimuthalEquidistantRaw:()=>Ud,geoBounds:()=>sc,geoCentroid:()=>yc,geoCircle:()=>Rc,geoClipAntimeridian:()=>jc,geoClipCircle:()=>Wc,geoClipExtent:()=>qc,geoClipRectangle:()=>Uc,geoConicConformal:()=>Zd,geoConicConformalRaw:()=>Jd,geoConicEqualArea:()=>Nd,geoConicEqualAreaRaw:()=>Bd,geoConicEquidistant:()=>np,geoConicEquidistantRaw:()=>ep,geoContains:()=>ph,geoDistance:()=>rh,geoEquirectangular:()=>tp,geoEquirectangularRaw:()=>Qd,geoGnomonic:()=>rp,geoGnomonicRaw:()=>ip,geoGraticule:()=>mh,geoGraticule10:()=>bh,geoIdentity:()=>ap,geoInterpolate:()=>vh,geoLength:()=>eh,geoMercator:()=>Kd,geoMercatorRaw:()=>Yd,geoNaturalEarth1:()=>lp,geoNaturalEarth1Raw:()=>sp,geoOrthographic:()=>cp,geoOrthographicRaw:()=>up,geoPath:()=>_d,geoProjection:()=>Od,geoProjectionMutator:()=>Fd,geoRotation:()=>kc,geoStereographic:()=>dp,geoStereographicRaw:()=>hp,geoStream:()=>nu,geoTransform:()=>Cd,geoTransverseMercator:()=>fp,geoTransverseMercatorRaw:()=>pp,hcl:()=>ca,hierarchy:()=>wp,histogram:()=>S,hsl:()=>Uo,html:()=>Bg,interpolate:()=>Bf,interpolateArray:()=>Rf,interpolateBasis:()=>wf,interpolateBasisClosed:()=>_f,interpolateCool:()=>Ky,interpolateCubehelix:()=>ug,interpolateCubehelixDefault:()=>qy,interpolateCubehelixLong:()=>cg,interpolateDate:()=>Sf,interpolateHcl:()=>ag,interpolateHclLong:()=>sg,interpolateHsl:()=>ng,interpolateHslLong:()=>ig,interpolateInferno:()=>tw,interpolateLab:()=>rg,interpolateMagma:()=>Qy,interpolateNumber:()=>Pf,interpolateObject:()=>Lf,interpolatePlasma:()=>ew,interpolateRainbow:()=>$y,interpolateRgb:()=>Tf,interpolateRgbBasis:()=>Df,interpolateRgbBasisClosed:()=>Af,interpolateRound:()=>Nf,interpolateString:()=>zf,interpolateTransformCss:()=>Yf,interpolateTransformSvg:()=>Kf,interpolateViridis:()=>Zy,interpolateWarm:()=>Yy,interpolateZoom:()=>tg,interrupt:()=>$x,interval:()=>ei,isoFormat:()=>dy,isoParse:()=>fy,json:()=>Ng,keys:()=>vo,lab:()=>ra,line:()=>J_,lineRadial:()=>aC,linkHorizontal:()=>mC,linkRadial:()=>vC,linkVertical:()=>bC,local:()=>y_,map:()=>so,matcher:()=>mw,max:()=>F,mean:()=>z,median:()=>B,merge:()=>N,min:()=>I,mouse:()=>x_,namespace:()=>ow,namespaces:()=>rw,nest:()=>lo,now:()=>qn,pack:()=>Gp,packEnclose:()=>Tp,packSiblings:()=>Ip,pairs:()=>c,partition:()=>$p,path:()=>Jr,permute:()=>H,pie:()=>eC,pointRadial:()=>lC,polygonArea:()=>dg,polygonCentroid:()=>pg,polygonContains:()=>vg,polygonHull:()=>bg,polygonLength:()=>yg,precisionFixed:()=>wl,precisionPrefix:()=>_l,precisionRound:()=>Cl,quadtree:()=>Os,quantile:()=>P,quantize:()=>hg,queue:()=>kg,radialArea:()=>sC,radialLine:()=>aC,randomBates:()=>Lg,randomExponential:()=>Og,randomIrwinHall:()=>Pg,randomLogNormal:()=>Sg,randomNormal:()=>Rg,randomUniform:()=>Ag,range:()=>x,request:()=>Fg,rgb:()=>Wo,ribbon:()=>io,scaleBand:()=>Xg,scaleIdentity:()=>um,scaleImplicit:()=>Yg,scaleLinear:()=>lm,scaleLog:()=>bm,scaleOrdinal:()=>Kg,scalePoint:()=>Jg,scalePow:()=>ym,scaleQuantile:()=>_m,scaleQuantize:()=>Cm,scaleSequential:()=>nw,scaleSqrt:()=>wm,scaleThreshold:()=>xm,scaleTime:()=>My,scaleUtc:()=>Ty,scan:()=>j,schemeCategory10:()=>Dy,schemeCategory20:()=>Sy,schemeCategory20b:()=>Ay,schemeCategory20c:()=>Ry,select:()=>m_,selectAll:()=>E_,selection:()=>g_,selector:()=>cw,selectorAll:()=>dw,set:()=>bo,shuffle:()=>W,stack:()=>Ax,stackOffsetDiverging:()=>Sx,stackOffsetExpand:()=>Rx,stackOffsetNone:()=>Tx,stackOffsetSilhouette:()=>Px,stackOffsetWiggle:()=>Lx,stackOrderAscending:()=>Ox,stackOrderDescending:()=>zx,stackOrderInsideOut:()=>Bx,stackOrderNone:()=>kx,stackOrderReverse:()=>Nx,stratify:()=>nf,style:()=>Pw,sum:()=>V,symbol:()=>BC,symbolCircle:()=>yC,symbolCross:()=>wC,symbolDiamond:()=>xC,symbolSquare:()=>DC,symbolStar:()=>kC,symbolTriangle:()=>RC,symbolWye:()=>FC,symbols:()=>zC,text:()=>Ig,thresholdFreedmanDiaconis:()=>L,thresholdScott:()=>O,thresholdSturges:()=>R,tickIncrement:()=>D,tickStep:()=>A,ticks:()=>k,timeDay:()=>Um,timeDays:()=>qm,timeFormat:()=>Xb,timeFormatDefaultLocale:()=>uy,timeFormatLocale:()=>Yb,timeFriday:()=>Qm,timeFridays:()=>ab,timeHour:()=>Wm,timeHours:()=>Vm,timeInterval:()=>Tm,timeMillisecond:()=>Dm,timeMilliseconds:()=>Am,timeMinute:()=>Im,timeMinutes:()=>Hm,timeMonday:()=>Xm,timeMondays:()=>nb,timeMonth:()=>ub,timeMonths:()=>cb,timeParse:()=>$b,timeSaturday:()=>tb,timeSaturdays:()=>sb,timeSecond:()=>zm,timeSeconds:()=>Bm,timeSunday:()=>Km,timeSundays:()=>eb,timeThursday:()=>Zm,timeThursdays:()=>ob,timeTuesday:()=>$m,timeTuesdays:()=>ib,timeWednesday:()=>Jm,timeWednesdays:()=>rb,timeWeek:()=>Km,timeWeeks:()=>eb,timeYear:()=>db,timeYears:()=>pb,timeout:()=>ti,timer:()=>Xn,timerFlush:()=>$n,touch:()=>M_,touches:()=>T_,transition:()=>mE,transpose:()=>G,tree:()=>cf,treemap:()=>gf,treemapBinary:()=>mf,treemapDice:()=>Xp,treemapResquarify:()=>vf,treemapSlice:()=>hf,treemapSliceDice:()=>bf,treemapSquarify:()=>ff,tsv:()=>Vg,tsvFormat:()=>Ba,tsvFormatRows:()=>Na,tsvParse:()=>Fa,tsvParseRows:()=>za,utcDay:()=>_b,utcDays:()=>Cb,utcFormat:()=>Jb,utcFriday:()=>Ab,utcFridays:()=>zb,utcHour:()=>vb,utcHours:()=>yb,utcMillisecond:()=>Dm,utcMilliseconds:()=>Am,utcMinute:()=>gb,utcMinutes:()=>mb,utcMonday:()=>Mb,utcMondays:()=>Pb,utcMonth:()=>Ib,utcMonths:()=>Hb,utcParse:()=>Zb,utcSaturday:()=>Rb,utcSaturdays:()=>Bb,utcSecond:()=>zm,utcSeconds:()=>Bm,utcSunday:()=>Eb,utcSundays:()=>Sb,utcThursday:()=>Db,utcThursdays:()=>Fb,utcTuesday:()=>Tb,utcTuesdays:()=>Lb,utcWednesday:()=>kb,utcWednesdays:()=>Ob,utcWeek:()=>Eb,utcWeeks:()=>Sb,utcYear:()=>Wb,utcYears:()=>Vb,values:()=>yo,variance:()=>g,version:()=>i,voronoi:()=>lM,window:()=>Dw,xml:()=>Hg,zip:()=>q,zoom:()=>DM,zoomIdentity:()=>vM,zoomTransform:()=>yM});var i="4.13.0";function r(t,e){return te?1:t>=e?0:NaN}function o(t){var e;return 1===t.length&&(e=t,t=function(t,n){return r(e(t),n)}),{left:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i>>1;t(e[o],n)<0?i=o+1:r=o}return i},right:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i>>1;t(e[o],n)>0?r=o:i=o+1}return i}}}var a=o(r),s=a.right,l=a.left;const u=s;function c(t,e){null==e&&(e=h);for(var n=0,i=t.length-1,r=t[0],o=new Array(i<0?0:i);nt?1:e>=t?0:NaN}function f(t){return null===t?NaN:+t}function g(t,e){var n,i,r=t.length,o=0,a=-1,s=0,l=0;if(null==e)for(;++a1)return l/(o-1)}function m(t,e){var n=g(t,e);return n?Math.sqrt(n):n}function b(t,e){var n,i,r,o=t.length,a=-1;if(null==e){for(;++a=n)for(i=r=n;++an&&(i=n),r=n)for(i=r=n;++an&&(i=n),r0)return[t];if((i=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(r=Math.ceil(e-t+1));++s=0?(o>=E?10:o>=M?5:o>=T?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=E?10:o>=M?5:o>=T?2:1)}function A(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=E?r*=10:o>=M?r*=5:o>=T&&(r*=2),eh;)d.pop(),--p;var f,g=new Array(p+1);for(r=0;r<=p;++r)(f=g[r]=[]).x0=r>0?d[r-1]:c,f.x1=r=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,o=Math.floor(r),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(r-o)}}function L(t,e,n){return t=w.call(t,f).sort(r),Math.ceil((n-e)/(2*(P(t,.75)-P(t,.25))*Math.pow(t.length,-1/3)))}function O(t,e,n){return Math.ceil((n-e)/(3.5*m(t)*Math.pow(t.length,-1/3)))}function F(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o=n)for(i=n;++oi&&(i=n)}else for(;++o=n)for(i=n;++oi&&(i=n);return i}function z(t,e){var n,i=t.length,r=i,o=-1,a=0;if(null==e)for(;++o=0;)for(e=(i=t[r]).length;--e>=0;)n[--a]=i[e];return n}function I(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o=n)for(i=n;++on&&(i=n)}else for(;++o=n)for(i=n;++on&&(i=n);return i}function H(t,e){for(var n=e.length,i=new Array(n);n--;)i[n]=t[e[n]];return i}function j(t,e){if(n=t.length){var n,i,o=0,a=0,s=t[a];for(null==e&&(e=r);++o=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var n,i,r=new Array(n),o=0;oe?1:t>=e?0:NaN}var zt="http://www.w3.org/1999/xhtml";const Bt={svg:"http://www.w3.org/2000/svg",xhtml:zt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nt(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Bt.hasOwnProperty(e)?{space:Bt[e],local:t}:t}function It(t){return function(){this.removeAttribute(t)}}function Ht(t){return function(){this.removeAttributeNS(t.space,t.local)}}function jt(t,e){return function(){this.setAttribute(t,e)}}function Wt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Vt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Gt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Ut(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function qt(t){return function(){this.style.removeProperty(t)}}function Yt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Kt(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Xt(t,e){return t.style.getPropertyValue(e)||Ut(t).getComputedStyle(t,null).getPropertyValue(e)}function $t(t){return function(){delete this[t]}}function Jt(t,e){return function(){this[t]=e}}function Zt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Qt(t){return t.trim().split(/^|\s+/)}function te(t){return t.classList||new ee(t)}function ee(t){this._node=t,this._names=Qt(t.getAttribute("class")||"")}function ne(t,e){for(var n=te(t),i=-1,r=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Me=[null];function Te(t,e){this._groups=t,this._parents=e}function ke(){return new Te([[document.documentElement]],Me)}Te.prototype=ke.prototype={constructor:Te,select:function(t){"function"!=typeof t&&(t=kt(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r=_&&(_=w+1);!(y=b[_])&&++_=0;)(i=r[o])&&(a&&4^i.compareDocumentPosition(a)&&a.parentNode.insertBefore(i,a),a=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Ft);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o1?this.each((null==e?qt:"function"==typeof e?Kt:Yt)(t,e,null==n?"":n)):Xt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?$t:"function"==typeof e?Zt:Jt)(t,e)):this.node()[t]},classed:function(t,e){var n=Qt(t+"");if(arguments.length<2){for(var i=te(this.node()),r=-1,o=n.length;++r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?_t:wt,null==n&&(n=!1),i=0;ih}l.mouse("drag")}function g(){Ae(bt.view).on("mousemove.drag mouseup.drag",null),Oe(bt.view,n),Pe(),l.mouse("end")}function m(){if(r.apply(this,arguments)){var t,e,n=bt.changedTouches,i=o.apply(this,arguments),a=n.length;for(t=0;t>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?un(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?un(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Je.exec(t))?new dn(e[1],e[2],e[3],1):(e=Ze.exec(t))?new dn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Qe.exec(t))?un(e[1],e[2],e[3],e[4]):(e=tn.exec(t))?un(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=en.exec(t))?mn(e[1],e[2]/100,e[3]/100,1):(e=nn.exec(t))?mn(e[1],e[2]/100,e[3]/100,e[4]):rn.hasOwnProperty(t)?ln(rn[t]):"transparent"===t?new dn(NaN,NaN,NaN,0):null}function ln(t){return new dn(t>>16&255,t>>8&255,255&t,1)}function un(t,e,n,i){return i<=0&&(t=e=n=NaN),new dn(t,e,n,i)}function cn(t){return t instanceof Ge||(t=sn(t)),t?new dn((t=t.rgb()).r,t.g,t.b,t.opacity):new dn}function hn(t,e,n,i){return 1===arguments.length?cn(t):new dn(t,e,n,null==i?1:i)}function dn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function pn(){return"#"+gn(this.r)+gn(this.g)+gn(this.b)}function fn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function gn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function mn(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new vn(t,e,n,i)}function bn(t){if(t instanceof vn)return new vn(t.h,t.s,t.l,t.opacity);if(t instanceof Ge||(t=sn(t)),!t)return new vn;if(t instanceof vn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n0&&l<1?0:a,new vn(a,s,l,t.opacity)}function vn(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function yn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function wn(t,e,n,i,r){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*i+a*r)/6}function _n(t){return function(){return t}}function Cn(t,e){return function(n){return t+n*e}}function xn(t,e){var n=e-t;return n?Cn(t,n):_n(isNaN(t)?e:t)}We(Ge,sn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:on,formatHex:on,formatHsl:function(){return bn(this).formatHsl()},formatRgb:an,toString:an}),We(dn,hn,Ve(Ge,{brighter:function(t){return t=null==t?qe:Math.pow(qe,t),new dn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Ue:Math.pow(Ue,t),new dn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:pn,formatHex:pn,formatRgb:fn,toString:fn})),We(vn,(function(t,e,n,i){return 1===arguments.length?bn(t):new vn(t,e,n,null==i?1:i)}),Ve(Ge,{brighter:function(t){return t=null==t?qe:Math.pow(qe,t),new vn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Ue:Math.pow(Ue,t),new vn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new dn(yn(t>=240?t-240:t+120,r,i),yn(t,r,i),yn(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const En=function t(e){var n=function(t){return 1==(t=+t)?xn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):_n(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=hn(t)).r,(e=hn(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=xn(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function Mn(t){return function(e){var n,i,r=e.length,o=new Array(r),a=new Array(r),s=new Array(r);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),r=t[i],o=t[i+1],a=i>0?t[i-1]:2*r-o,s=io&&(r=e.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Dn(n,i)})),o=Sn.lastIndex;return o=0&&e._call.call(null,t),e=e._next;--Bn}function Jn(){Wn=(jn=Gn.now())+Vn,Bn=Nn=0;try{$n()}finally{Bn=0,function(){for(var t,e,n=Fn,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Fn=e);zn=t,Qn(i)}(),Wn=0}}function Zn(){var t=Gn.now(),e=t-jn;e>Hn&&(Vn-=e,jn=t)}function Qn(t){Bn||(Nn&&(Nn=clearTimeout(Nn)),t-Wn>24?(t<1/0&&(Nn=setTimeout(Jn,t-Gn.now()-Vn)),In&&(In=clearInterval(In))):(In||(jn=Gn.now(),In=setInterval(Zn,Hn)),Bn=1,Un(Jn)))}function ti(t,e,n){var i=new Kn;return e=null==e?0:+e,i.restart((function(n){i.stop(),t(n+e)}),e,n),i}function ei(t,e,n){var i=new Kn,r=e;return null==e?(i.restart(t,e,n),i):(e=+e,n=null==n?qn():+n,i.restart((function o(a){a+=r,i.restart(o,r+=e,n),t(a)}),e,n),i)}Kn.prototype=Xn.prototype={constructor:Kn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?qn():+n)+(null==e?0:+e),this._next||zn===this||(zn?zn._next=this:Fn=this,zn=this),this._call=t,this._time=n,Qn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Qn())}};var ni=gt("start","end","cancel","interrupt"),ii=[],ri=0,oi=2,ai=3,si=5,li=6;function ui(t,e,n,i,r,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(l){var u,c,h,d;if(1!==n.state)return s();for(u in r)if((d=r[u]).name===n.name){if(d.state===ai)return ti(o);4===d.state?(d.state=li,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[u]):+uri)throw new Error("too late; already scheduled");return n}function hi(t,e){var n=di(t,e);if(n.state>ai)throw new Error("too late; already running");return n}function di(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function pi(t,e){var n,i,r,o=t.__transition,a=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>oi&&n.state180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:Dn(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,a.rotate,s,l),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:Dn(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,a.skewX,s,l),function(t,e,n,i,o,a){if(t!==n||e!==i){var s=o.push(r(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Dn(t,n)},{i:s-2,x:Dn(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,l),o=a=null,function(t){for(var e,n=-1,i=l.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ci:hi;return function(){var a=o(this,t),s=a.on;s!==i&&(r=(i=s).copy()).on(e,n),a.on=r}}(n,t,e))},attr:function(t,e){var n=Nt(t),i="transform"===n?xi:ki;return this.attrTween(t,"function"==typeof e?(n.local?Li:Pi)(n,i,Ti(this,"attr."+t,e)):null==e?(n.local?Ai:Di)(n):(n.local?Si:Ri)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=Nt(t);return this.tween(n,(i.local?Oi:Fi)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Ci:ki;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=Xt(this,t),a=(this.style.removeProperty(t),Xt(this,t));return o===a?null:o===n&&a===i?r:r=e(n=o,i=a)}}(t,i)).on("end.style."+t,ji(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,o;return function(){var a=Xt(this,t),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(t),l=s=Xt(this,t)),a===l?null:a===i&&l===r?o:(r=l,o=e(i=a,s))}}(t,i,Ti(this,"style."+t,e))).each(function(t,e){var n,i,r,o,a="style."+e,s="end."+a;return function(){var l=hi(this,t),u=l.on,c=null==l.value[a]?o||(o=ji(e)):void 0;u===n&&r===c||(i=(n=u).copy()).on(s,r=c),l.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,o=n+"";return function(){var a=Xt(this,t);return a===o?null:a===i?r:r=e(i=a,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,o,n)),i}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Ti(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=di(this.node(),n).tween,o=0,a=r.length;o0&&(n=r-p),C<0?h=d-f:C>0&&(o=a-f),w=Qi,F.attr("cursor",or.selection),N());break;default:return}Ji()}),!0).on("keyup.brush",(function(){switch(bt.keyCode){case 16:R&&(m=b=R=!1,N());break;case 18:w===er&&(_<0?u=c:_>0&&(n=r),C<0?h=d:C>0&&(o=a),w=tr,N());break;case 32:w===Qi&&(bt.altKey?(_&&(u=c-p*_,n=r+p*_),C&&(h=d-f*C,o=a+f*C),w=er):(_<0?u=c:_>0&&(n=r),C<0?h=d:C>0&&(o=a),w=tr),F.attr("cursor",or[y]),N());break;default:return}Ji()}),!0).on("mousemove.brush",B,!0).on("mouseup.brush",I,!0);Le(bt.view)}$i(),pi(v),s.call(v),L.start()}function B(){var t=Mt(v);!R||m||b||(Math.abs(t[0]-P[0])>Math.abs(t[1]-P[1])?b=!0:m=!0),P=t,g=!0,Ji(),N()}function N(){var t;switch(p=P[0]-S[0],f=P[1]-S[1],w){case Qi:case Zi:_&&(p=Math.max(T-n,Math.min(D-u,p)),r=n+p,c=u+p),C&&(f=Math.max(k-o,Math.min(A-h,f)),a=o+f,d=h+f);break;case tr:_<0?(p=Math.max(T-n,Math.min(D-n,p)),r=n+p,c=u):_>0&&(p=Math.max(T-u,Math.min(D-u,p)),r=n,c=u+p),C<0?(f=Math.max(k-o,Math.min(A-o,f)),a=o+f,d=h):C>0&&(f=Math.max(k-h,Math.min(A-h,f)),a=o,d=h+f);break;case er:_&&(r=Math.max(T,Math.min(D,n-p*_)),c=Math.max(T,Math.min(D,u+p*_))),C&&(a=Math.max(k,Math.min(A,o-f*C)),d=Math.max(k,Math.min(A,h+f*C)))}ce?1:t>=e?0:NaN}function _r(t){var e;return 1===t.length&&(e=t,t=function(t,n){return wr(e(t),n)}),{left:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i>>1;t(e[o],n)<0?i=o+1:r=o}return i},right:function(e,n,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i>>1;t(e[o],n)>0?r=o:i=o+1}return i}}}var Cr=_r(wr),xr=Cr.right;Cr.left;const Er=xr;var Mr=Array.prototype,Tr=(Mr.slice,Mr.map,Math.sqrt(50)),kr=Math.sqrt(10),Dr=Math.sqrt(2);function Ar(t,e,n){var i,r,o,a,s=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((i=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(r=Math.ceil(e-t+1));++s=0?(o>=Tr?10:o>=kr?5:o>=Dr?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=Tr?10:o>=kr?5:o>=Dr?2:1)}function Sr(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=Tr?r*=10:o>=kr?r*=5:o>=Dr&&(r*=2),e=0;)for(e=(i=t[r]).length;--e>=0;)n[--a]=i[e];return n}function Lr(t){return null===t?NaN:+t}function Or(t,e,n){if(null==n&&(n=Lr),i=t.length){if((e=+e)<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,o=Math.floor(r),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(r-o)}}function Fr(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++iYr)if(Math.abs(c*s-l*u)>Yr&&r){var d=n-o,p=i-a,f=s*s+l*l,g=d*d+p*p,m=Math.sqrt(f),b=Math.sqrt(h),v=r*Math.tan((Ur-Math.acos((f+h-g)/(2*m*b)))/2),y=v/b,w=v/m;Math.abs(y-1)>Yr&&(this._+="L"+(t+y*u)+","+(e+y*c)),this._+="A"+r+","+r+",0,0,"+ +(c*d>u*p)+","+(this._x1=t+w*s)+","+(this._y1=e+w*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,i,r,o){t=+t,e=+e;var a=(n=+n)*Math.cos(i),s=n*Math.sin(i),l=t+a,u=e+s,c=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>Yr||Math.abs(this._y1-u)>Yr)&&(this._+="L"+l+","+u),n&&(h<0&&(h=h%qr+qr),h>Kr?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):h>Yr&&(this._+="A"+n+","+n+",0,"+ +(h>=Ur)+","+c+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};const Jr=$r;function Zr(t){return t.source}function Qr(t){return t.target}function to(t){return t.radius}function eo(t){return t.startAngle}function no(t){return t.endAngle}function io(){var t=Zr,e=Qr,n=to,i=eo,r=no,o=null;function a(){var a,s=Vr.call(arguments),l=t.apply(this,s),u=e.apply(this,s),c=+n.apply(this,(s[0]=l,s)),h=i.apply(this,s)-Ir,d=r.apply(this,s)-Ir,p=c*zr(h),f=c*Br(h),g=+n.apply(this,(s[0]=u,s)),m=i.apply(this,s)-Ir,b=r.apply(this,s)-Ir;if(o||(o=a=Jr()),o.moveTo(p,f),o.arc(0,0,c,h,d),h===m&&d===b||(o.quadraticCurveTo(0,0,g*zr(m),g*Br(m)),o.arc(0,0,g,m,b)),o.quadraticCurveTo(0,0,p,f),o.closePath(),a)return o=null,a+""||null}return a.radius=function(t){return arguments.length?(n="function"==typeof t?t:Gr(+t),a):n},a.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Gr(+t),a):i},a.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:Gr(+t),a):r},a.source=function(e){return arguments.length?(t=e,a):t},a.target=function(t){return arguments.length?(e=t,a):e},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}var ro="$";function oo(){}function ao(t,e){var n=new oo;if(t instanceof oo)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var i,r=-1,o=t.length;if(null==e)for(;++r=i.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var l,u,c,h=-1,d=n.length,p=i[r++],f=so(),g=a();++hi.length)return t;var o,s=r[n-1];return null!=e&&n>=i.length?o=t.entries():(o=[],t.each((function(t,e){o.push({key:e,values:a(t,n)})}))),null!=s?o.sort((function(t,e){return s(t.key,e.key)})):o}return n={object:function(t){return o(t,0,uo,co)},map:function(t){return o(t,0,ho,po)},entries:function(t){return a(o(t,0,ho,po),0)},key:function(t){return i.push(t),n},sortKeys:function(t){return r[i.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}}function uo(){return{}}function co(t,e,n){t[e]=n}function ho(){return so()}function po(t,e,n){t.set(e,n)}function fo(){}var go=so.prototype;function mo(t,e){var n=new fo;if(t instanceof fo)t.each((function(t){n.add(t)}));else if(t){var i=-1,r=t.length;if(null==e)for(;++i>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=Ro.exec(t))?Io(parseInt(e[1],16)):(e=So.exec(t))?new Vo(e[1],e[2],e[3],1):(e=Po.exec(t))?new Vo(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Lo.exec(t))?Ho(e[1],e[2],e[3],e[4]):(e=Oo.exec(t))?Ho(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Fo.exec(t))?Go(e[1],e[2]/100,e[3]/100,1):(e=zo.exec(t))?Go(e[1],e[2]/100,e[3]/100,e[4]):Bo.hasOwnProperty(t)?Io(Bo[t]):"transparent"===t?new Vo(NaN,NaN,NaN,0):null}function Io(t){return new Vo(t>>16&255,t>>8&255,255&t,1)}function Ho(t,e,n,i){return i<=0&&(t=e=n=NaN),new Vo(t,e,n,i)}function jo(t){return t instanceof xo||(t=No(t)),t?new Vo((t=t.rgb()).r,t.g,t.b,t.opacity):new Vo}function Wo(t,e,n,i){return 1===arguments.length?jo(t):new Vo(t,e,n,null==i?1:i)}function Vo(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Go(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new qo(t,e,n,i)}function Uo(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof qo)return new qo(t.h,t.s,t.l,t.opacity);if(t instanceof xo||(t=No(t)),!t)return new qo;if(t instanceof qo)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n0&&l<1?0:a,new qo(a,s,l,t.opacity)}(t):new qo(t,e,n,null==i?1:i)}function qo(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Yo(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}_o(xo,No,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),_o(Vo,Wo,Co(xo,{brighter:function(t){return t=null==t?Mo:Math.pow(Mo,t),new Vo(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Eo:Math.pow(Eo,t),new Vo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),_o(qo,Uo,Co(xo,{brighter:function(t){return t=null==t?Mo:Math.pow(Mo,t),new qo(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Eo:Math.pow(Eo,t),new qo(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Vo(Yo(t>=240?t-240:t+120,r,i),Yo(t,r,i),Yo(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Ko=Math.PI/180,Xo=180/Math.PI,$o=.95047,Jo=1,Zo=1.08883,Qo=4/29,ta=6/29,ea=3*ta*ta,na=ta*ta*ta;function ia(t){if(t instanceof oa)return new oa(t.l,t.a,t.b,t.opacity);if(t instanceof ha){var e=t.h*Ko;return new oa(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof Vo||(t=jo(t));var n=ua(t.r),i=ua(t.g),r=ua(t.b),o=aa((.4124564*n+.3575761*i+.1804375*r)/$o),a=aa((.2126729*n+.7151522*i+.072175*r)/Jo);return new oa(116*a-16,500*(o-a),200*(a-aa((.0193339*n+.119192*i+.9503041*r)/Zo)),t.opacity)}function ra(t,e,n,i){return 1===arguments.length?ia(t):new oa(t,e,n,null==i?1:i)}function oa(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function aa(t){return t>na?Math.pow(t,1/3):t/ea+Qo}function sa(t){return t>ta?t*t*t:ea*(t-Qo)}function la(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ua(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ca(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof ha)return new ha(t.h,t.c,t.l,t.opacity);t instanceof oa||(t=ia(t));var e=Math.atan2(t.b,t.a)*Xo;return new ha(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new ha(t,e,n,null==i?1:i)}function ha(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}_o(oa,ra,Co(xo,{brighter:function(t){return new oa(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new oa(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return t=Jo*sa(t),new Vo(la(3.2404542*(e=$o*sa(e))-1.5371385*t-.4985314*(n=Zo*sa(n))),la(-.969266*e+1.8760108*t+.041556*n),la(.0556434*e-.2040259*t+1.0572252*n),this.opacity)}})),_o(ha,ca,Co(xo,{brighter:function(t){return new ha(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new ha(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return ia(this).rgb()}}));var da=-.14861,pa=1.78277,fa=-.29227,ga=-.90649,ma=1.97294,ba=ma*ga,va=ma*pa,ya=pa*fa-ga*da;function wa(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof _a)return new _a(t.h,t.s,t.l,t.opacity);t instanceof Vo||(t=jo(t));var e=t.r/255,n=t.g/255,i=t.b/255,r=(ya*i+ba*e-va*n)/(ya+ba-va),o=i-r,a=(ma*(n-r)-fa*o)/ga,s=Math.sqrt(a*a+o*o)/(ma*r*(1-r)),l=s?Math.atan2(a,o)*Xo-120:NaN;return new _a(l<0?l+360:l,s,r,t.opacity)}(t):new _a(t,e,n,null==i?1:i)}function _a(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}_o(_a,wa,Co(xo,{brighter:function(t){return t=null==t?Mo:Math.pow(Mo,t),new _a(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Eo:Math.pow(Eo,t),new _a(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Ko,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),r=Math.sin(t);return new Vo(255*(e+n*(da*i+pa*r)),255*(e+n*(fa*i+ga*r)),255*(e+n*(ma*i)),this.opacity)}}));var Ca={},xa={},Ea=34,Ma=10,Ta=13;function ka(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+"]"})).join(",")+"}")}function Da(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var i,r=[],o=t.length,a=0,s=0,l=o<=0,u=!1;function c(){if(l)return xa;if(u)return u=!1,Ca;var e,i,r=a;if(t.charCodeAt(r)===Ea){for(;a++=o?l=!0:(i=t.charCodeAt(a++))===Ma?u=!0:i===Ta&&(u=!0,t.charCodeAt(a)===Ma&&++a),t.slice(r+1,e-1).replace(/""/g,'"')}for(;a=(o=(g+b)/2))?g=o:b=o,(c=n>=(a=(m+v)/2))?m=a:v=a,r=p,!(p=p[h=c<<1|u]))return r[h]=f,t;if(s=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===s&&n===l)return f.next=p,r?r[h]=f:t._root=f,t;do{r=r?r[h]=new Array(4):t._root=new Array(4),(u=e>=(o=(g+b)/2))?g=o:b=o,(c=n>=(a=(m+v)/2))?m=a:v=a}while((h=c<<1|u)==(d=(l>=a)<<1|s>=o));return r[d]=p,r[h]=f,t}function Ss(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function Ps(t){return t[0]}function Ls(t){return t[1]}function Os(t,e,n){var i=new Fs(null==e?Ps:e,null==n?Ls:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Fs(t,e,n,i,r,o){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function zs(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Bs=Os.prototype=Fs.prototype;function Ns(t){return t.x+t.vx}function Is(t){return t.y+t.vy}function Hs(t){var e,n,i=1,r=1;function o(){for(var t,o,s,l,u,c,h,d=e.length,p=0;pl+p||ru+p||os.index){var f=l-a.x-a.vx,g=u-a.y-a.vy,m=f*f+g*g;mt.r&&(t.r=t[e].r)}function s(){if(e){var i,r,o=e.length;for(n=new Array(o),i=0;ic&&(c=i),rh&&(h=r));for(ct||t>r||i>e||e>o))return this;var a,s,l=r-n,u=this._root;switch(s=(e<(i+o)/2)<<1|t<(n+r)/2){case 0:do{(a=new Array(4))[s]=u,u=a}while(o=i+(l*=2),t>(r=n+l)||e>o);break;case 1:do{(a=new Array(4))[s]=u,u=a}while(o=i+(l*=2),(n=r-l)>t||e>o);break;case 2:do{(a=new Array(4))[s]=u,u=a}while(i=o-(l*=2),t>(r=n+l)||i>e);break;case 3:do{(a=new Array(4))[s]=u,u=a}while(i=o-(l*=2),(n=r-l)>t||i>e)}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this},Bs.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},Bs.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Bs.find=function(t,e,n){var i,r,o,a,s,l,u,c=this._x0,h=this._y0,d=this._x1,p=this._y1,f=[],g=this._root;for(g&&f.push(new Ss(g,c,h,d,p)),null==n?n=1/0:(c=t-n,h=e-n,d=t+n,p=e+n,n*=n);l=f.pop();)if(!(!(g=l.node)||(r=l.x0)>d||(o=l.y0)>p||(a=l.x1)=b)<<1|t>=m)&&(l=f[f.length-1],f[f.length-1]=f[f.length-1-u],f[f.length-1-u]=l)}else{var v=t-+this._x.call(null,g.data),y=e-+this._y.call(null,g.data),w=v*v+y*y;if(w=(s=(f+m)/2))?f=s:m=s,(c=a>=(l=(g+b)/2))?g=l:b=l,e=p,!(p=p[h=c<<1|u]))return this;if(!p.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,d=h)}for(;p.data!==t;)if(i=p,!(p=p.next))return this;return(r=p.next)&&delete p.next,i?(r?i.next=r:delete i.next,this):e?(r?e[h]=r:delete e[h],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[d]=p:this._root=p),this):(this._root=r,this)},Bs.removeAll=function(t){for(var e=0,n=t.length;e1?(null==n?s.remove(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,i){var r,o,a,s,l,u=0,c=t.length;for(null==i?i=1/0:i*=i,u=0;u1?(u.on(t,n),e):u.on(t)}}}function nl(){var t,e,n,i,r=Ds(-30),o=1,a=1/0,s=.81;function l(i){var r,o=t.length,a=Os(t,$s,Js).visitAfter(c);for(n=i,r=0;r=a)){(t.data!==e||t.next)&&(0===c&&(p+=(c=As())*c),0===h&&(p+=(h=As())*h),p1?i[0]+i.slice(2):i,+t.slice(n+1)]}function sl(t){return(t=al(Math.abs(t)))?t[1]:NaN}function ll(t,e){var n=al(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const ul={"":function(t,e){t:for(var n,i=(t=t.toPrecision(e)).length,r=1,o=-1;r0&&(o=0)}return o>0?t.slice(0,o)+t.slice(n+1):t},"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return ll(100*t,e)},r:ll,s:function(t,e){var n=al(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(Zs=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+al(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};var cl=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function hl(t){return new dl(t)}function dl(t){if(!(e=cl.exec(t)))throw new Error("invalid format: "+t);var e,n=e[1]||" ",i=e[2]||">",r=e[3]||"-",o=e[4]||"",a=!!e[5],s=e[6]&&+e[6],l=!!e[7],u=e[8]&&+e[8].slice(1),c=e[9]||"";"n"===c?(l=!0,c="g"):ul[c]||(c=""),(a||"0"===n&&"="===i)&&(a=!0,n="0",i="="),this.fill=n,this.align=i,this.sign=r,this.symbol=o,this.zero=a,this.width=s,this.comma=l,this.precision=u,this.type=c}function pl(t){return t}hl.prototype=dl.prototype,dl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var fl,gl,ml,bl=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vl(t){var e,n,i=t.grouping&&t.thousands?(e=t.grouping,n=t.thousands,function(t,i){for(var r=t.length,o=[],a=0,s=e[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),o.push(t.substring(r-=s,r+s)),!((l+=s+1)>i));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}):pl,r=t.currency,o=t.decimal,a=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(t.numerals):pl,s=t.percent||"%";function l(t){var e=(t=hl(t)).fill,n=t.align,l=t.sign,u=t.symbol,c=t.zero,h=t.width,d=t.comma,p=t.precision,f=t.type,g="$"===u?r[0]:"#"===u&&/[boxX]/.test(f)?"0"+f.toLowerCase():"",m="$"===u?r[1]:/[%p]/.test(f)?s:"",b=ul[f],v=!f||/[defgprs%]/.test(f);function y(t){var r,s,u,y=g,w=m;if("c"===f)w=b(t)+w,t="";else{var _=(t=+t)<0;if(t=b(Math.abs(t),p),_&&0==+t&&(_=!1),y=(_?"("===l?l:"-":"-"===l||"("===l?"":l)+y,w=("s"===f?bl[8+Zs/3]:"")+w+(_&&"("===l?")":""),v)for(r=-1,s=t.length;++r(u=t.charCodeAt(r))||u>57){w=(46===u?o+t.slice(r+1):t.slice(r))+w,t=t.slice(0,r);break}}d&&!c&&(t=i(t,1/0));var C=y.length+t.length+w.length,x=C>1)+y+t+w+x.slice(C);break;default:t=x+y+t+w}return a(t)}return p=null==p?f?6:12:/[gprs]/.test(f)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),y.toString=function(){return t+""},y}return{format:l,formatPrefix:function(t,e){var n=l(((t=hl(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(sl(e)/3))),r=Math.pow(10,-i),o=bl[8+i/3];return function(t){return n(r*t)+o}}}}function yl(t){return fl=vl(t),gl=fl.format,ml=fl.formatPrefix,fl}function wl(t){return Math.max(0,-sl(Math.abs(t)))}function _l(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(sl(e)/3)))-sl(Math.abs(t)))}function Cl(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,sl(e)-sl(t))+1}function xl(){return new El}function El(){this.reset()}yl({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),El.prototype={constructor:El,reset:function(){this.s=this.t=0},add:function(t){Tl(Ml,t,this.t),Tl(this,Ml.s,this.s),this.s?this.t+=Ml.t:this.s=Ml.t},valueOf:function(){return this.s}};var Ml=new El;function Tl(t,e,n){var i=t.s=e+n,r=i-e,o=i-r;t.t=e-o+(n-r)}var kl=1e-6,Dl=1e-12,Al=Math.PI,Rl=Al/2,Sl=Al/4,Pl=2*Al,Ll=180/Al,Ol=Al/180,Fl=Math.abs,zl=Math.atan,Bl=Math.atan2,Nl=Math.cos,Il=Math.ceil,Hl=Math.exp,jl=(Math.floor,Math.log),Wl=Math.pow,Vl=Math.sin,Gl=Math.sign||function(t){return t>0?1:t<0?-1:0},Ul=Math.sqrt,ql=Math.tan;function Yl(t){return t>1?0:t<-1?Al:Math.acos(t)}function Kl(t){return t>1?Rl:t<-1?-Rl:Math.asin(t)}function Xl(t){return(t=Vl(t/2))*t}function $l(){}function Jl(t,e){t&&Ql.hasOwnProperty(t.type)&&Ql[t.type](t,e)}var Zl={Feature:function(t,e){Jl(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i=0?1:-1,r=i*n,o=Nl(e=(e*=Ol)/2+Sl),a=Vl(e),s=su*a,l=au*o+s*Nl(r),u=s*i*Vl(r);lu.add(Bl(u,l)),ou=t,au=o,su=a}function gu(t){return uu.reset(),nu(t,cu),2*uu}function mu(t){return[Bl(t[1],t[0]),Kl(t[2])]}function bu(t){var e=t[0],n=t[1],i=Nl(n);return[i*Nl(e),i*Vl(e),Vl(n)]}function vu(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function yu(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function wu(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _u(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Cu(t){var e=Ul(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var xu,Eu,Mu,Tu,ku,Du,Au,Ru,Su,Pu,Lu,Ou,Fu,zu,Bu,Nu,Iu,Hu,ju,Wu,Vu,Gu,Uu,qu,Yu,Ku,Xu=xl(),$u={point:Ju,lineStart:Qu,lineEnd:tc,polygonStart:function(){$u.point=ec,$u.lineStart=nc,$u.lineEnd=ic,Xu.reset(),cu.polygonStart()},polygonEnd:function(){cu.polygonEnd(),$u.point=Ju,$u.lineStart=Qu,$u.lineEnd=tc,lu<0?(xu=-(Mu=180),Eu=-(Tu=90)):Xu>kl?Tu=90:Xu<-kl&&(Eu=-90),Pu[0]=xu,Pu[1]=Mu}};function Ju(t,e){Su.push(Pu=[xu=t,Mu=t]),eTu&&(Tu=e)}function Zu(t,e){var n=bu([t*Ol,e*Ol]);if(Ru){var i=yu(Ru,n),r=yu([i[1],-i[0],0],i);Cu(r),r=mu(r);var o,a=t-ku,s=a>0?1:-1,l=r[0]*Ll*s,u=Fl(a)>180;u^(s*kuTu&&(Tu=o):u^(s*ku<(l=(l+360)%360-180)&&lTu&&(Tu=e)),u?trc(xu,Mu)&&(Mu=t):rc(t,Mu)>rc(xu,Mu)&&(xu=t):Mu>=xu?(tMu&&(Mu=t)):t>ku?rc(xu,t)>rc(xu,Mu)&&(Mu=t):rc(t,Mu)>rc(xu,Mu)&&(xu=t)}else Su.push(Pu=[xu=t,Mu=t]);eTu&&(Tu=e),Ru=n,ku=t}function Qu(){$u.point=Zu}function tc(){Pu[0]=xu,Pu[1]=Mu,$u.point=Ju,Ru=null}function ec(t,e){if(Ru){var n=t-ku;Xu.add(Fl(n)>180?n+(n>0?360:-360):n)}else Du=t,Au=e;cu.point(t,e),Zu(t,e)}function nc(){cu.lineStart()}function ic(){ec(Du,Au),cu.lineEnd(),Fl(Xu)>kl&&(xu=-(Mu=180)),Pu[0]=xu,Pu[1]=Mu,Ru=null}function rc(t,e){return(e-=t)<0?e+360:e}function oc(t,e){return t[0]-e[0]}function ac(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:erc(i[0],i[1])&&(i[1]=r[1]),rc(r[0],i[1])>rc(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(a=-1/0,e=0,i=o[n=o.length-1];e<=n;i=r,++e)r=o[e],(s=rc(i[1],r[0]))>a&&(a=s,xu=r[0],Mu=i[1])}return Su=Pu=null,xu===1/0||Eu===1/0?[[NaN,NaN],[NaN,NaN]]:[[xu,Eu],[Mu,Tu]]}var lc={sphere:$l,point:uc,lineStart:hc,lineEnd:fc,polygonStart:function(){lc.lineStart=gc,lc.lineEnd=mc},polygonEnd:function(){lc.lineStart=hc,lc.lineEnd=fc}};function uc(t,e){t*=Ol;var n=Nl(e*=Ol);cc(n*Nl(t),n*Vl(t),Vl(e))}function cc(t,e,n){++Lu,Fu+=(t-Fu)/Lu,zu+=(e-zu)/Lu,Bu+=(n-Bu)/Lu}function hc(){lc.point=dc}function dc(t,e){t*=Ol;var n=Nl(e*=Ol);qu=n*Nl(t),Yu=n*Vl(t),Ku=Vl(e),lc.point=pc,cc(qu,Yu,Ku)}function pc(t,e){t*=Ol;var n=Nl(e*=Ol),i=n*Nl(t),r=n*Vl(t),o=Vl(e),a=Bl(Ul((a=Yu*o-Ku*r)*a+(a=Ku*i-qu*o)*a+(a=qu*r-Yu*i)*a),qu*i+Yu*r+Ku*o);Ou+=a,Nu+=a*(qu+(qu=i)),Iu+=a*(Yu+(Yu=r)),Hu+=a*(Ku+(Ku=o)),cc(qu,Yu,Ku)}function fc(){lc.point=uc}function gc(){lc.point=bc}function mc(){vc(Gu,Uu),lc.point=uc}function bc(t,e){Gu=t,Uu=e,t*=Ol,e*=Ol,lc.point=vc;var n=Nl(e);qu=n*Nl(t),Yu=n*Vl(t),Ku=Vl(e),cc(qu,Yu,Ku)}function vc(t,e){t*=Ol;var n=Nl(e*=Ol),i=n*Nl(t),r=n*Vl(t),o=Vl(e),a=Yu*o-Ku*r,s=Ku*i-qu*o,l=qu*r-Yu*i,u=Ul(a*a+s*s+l*l),c=Kl(u),h=u&&-c/u;ju+=h*a,Wu+=h*s,Vu+=h*l,Ou+=c,Nu+=c*(qu+(qu=i)),Iu+=c*(Yu+(Yu=r)),Hu+=c*(Ku+(Ku=o)),cc(qu,Yu,Ku)}function yc(t){Lu=Ou=Fu=zu=Bu=Nu=Iu=Hu=ju=Wu=Vu=0,nu(t,lc);var e=ju,n=Wu,i=Vu,r=e*e+n*n+i*i;return rAl?t-Pl:t<-Al?t+Pl:t,e]}function xc(t,e,n){return(t%=Pl)?e||n?_c(Mc(t),Tc(e,n)):Mc(t):e||n?Tc(e,n):Cc}function Ec(t){return function(e,n){return[(e+=t)>Al?e-Pl:e<-Al?e+Pl:e,n]}}function Mc(t){var e=Ec(t);return e.invert=Ec(-t),e}function Tc(t,e){var n=Nl(t),i=Vl(t),r=Nl(e),o=Vl(e);function a(t,e){var a=Nl(e),s=Nl(t)*a,l=Vl(t)*a,u=Vl(e),c=u*n+s*i;return[Bl(l*r-c*o,s*n-u*i),Kl(c*r+l*o)]}return a.invert=function(t,e){var a=Nl(e),s=Nl(t)*a,l=Vl(t)*a,u=Vl(e),c=u*r-l*o;return[Bl(l*r+u*o,s*n+c*i),Kl(c*n-s*i)]},a}function kc(t){function e(e){return(e=t(e[0]*Ol,e[1]*Ol))[0]*=Ll,e[1]*=Ll,e}return t=xc(t[0]*Ol,t[1]*Ol,t.length>2?t[2]*Ol:0),e.invert=function(e){return(e=t.invert(e[0]*Ol,e[1]*Ol))[0]*=Ll,e[1]*=Ll,e},e}function Dc(t,e,n,i,r,o){if(n){var a=Nl(e),s=Vl(e),l=i*n;null==r?(r=e+i*Pl,o=e-l/2):(r=Ac(a,r),o=Ac(a,o),(i>0?ro)&&(r+=i*Pl));for(var u,c=r;i>0?c>o:c1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Pc(t,e){return Fl(t[0]-e[0])=0;--o)r.point((c=u[o])[0],c[1]);else i(d.x,d.p.x,-1,r);d=d.p}u=(d=d.o).z,p=!p}while(!d.v);r.lineEnd()}}}function Fc(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i=0?1:-1,E=x*C,M=E>Al,T=f*w;if(zc.add(Bl(T*x*Vl(E),g*_+T*Nl(E))),o+=M?C+x*Pl:C,M^d>=n^v>=n){var k=yu(bu(h),bu(b));Cu(k);var D=yu(r,k);Cu(D);var A=(M^C>=0?-1:1)*Kl(D[2]);(i>A||i===A&&(k[0]||k[1]))&&(a+=M^C>=0?1:-1)}}return(o<-kl||o0){for(h||(r.polygonStart(),h=!0),r.lineStart(),t=0;t1&&2&l&&d.push(d.pop().concat(d.shift())),a.push(d.filter(Ic))}return d}}function Ic(t){return t.length>1}function Hc(t,e){return((t=t.x)[0]<0?t[1]-Rl-kl:Rl-t[1])-((e=e.x)[0]<0?e[1]-Rl-kl:Rl-e[1])}const jc=Nc((function(){return!0}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?Al:-Al,l=Fl(o-n);Fl(l-Al)0?Rl:-Rl),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),t.point(o,i),e=0):r!==s&&l>=Al&&(Fl(n-r)kl?zl((Vl(e)*(o=Nl(i))*Vl(n)-Vl(i)*(r=Nl(e))*Vl(t))/(r*o*a)):(e+i)/2}(n,i,o,a),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(s,i),e=0),t.point(n=o,i=a),r=s},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;if(null==t)r=n*Rl,i.point(-Al,r),i.point(0,r),i.point(Al,r),i.point(Al,0),i.point(Al,-r),i.point(0,-r),i.point(-Al,-r),i.point(-Al,0),i.point(-Al,r);else if(Fl(t[0]-e[0])>kl){var o=t[0]0,r=Fl(e)>kl;function o(t,n){return Nl(t)*Nl(n)>e}function a(t,n,i){var r=[1,0,0],o=yu(bu(t),bu(n)),a=vu(o,o),s=o[0],l=a-s*s;if(!l)return!i&&t;var u=e*a/l,c=-e*s/l,h=yu(r,o),d=_u(r,u);wu(d,_u(o,c));var p=h,f=vu(d,p),g=vu(p,p),m=f*f-g*(vu(d,d)-1);if(!(m<0)){var b=Ul(m),v=_u(p,(-f-b)/g);if(wu(v,d),v=mu(v),!i)return v;var y,w=t[0],_=n[0],C=t[1],x=n[1];_0^v[1]<(Fl(v[0]-w)Al^(w<=v[0]&&v[0]<=_)){var T=_u(p,(-f+b)/g);return wu(T,d),[v,mu(T)]}}}function s(e,n){var r=i?t:Al-t,o=0;return e<-r?o|=1:e>r&&(o|=2),n<-r?o|=4:n>r&&(o|=8),o}return Nc(o,(function(t){var e,n,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,d){var p,f=[h,d],g=o(h,d),m=i?g?0:s(h,d):g?s(h+(h<0?Al:-Al),d):0;if(!e&&(u=l=g)&&t.lineStart(),g!==l&&(!(p=a(e,f))||Pc(e,p)||Pc(f,p))&&(f[0]+=kl,f[1]+=kl,g=o(f[0],f[1])),g!==l)c=0,g?(t.lineStart(),p=a(f,e),t.point(p[0],p[1])):(p=a(e,f),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(r&&e&&i^g){var b;m&n||!(b=a(f,e,!0))||(c=0,i?(t.lineStart(),t.point(b[0][0],b[0][1]),t.point(b[1][0],b[1][1]),t.lineEnd()):(t.point(b[1][0],b[1][1]),t.lineEnd(),t.lineStart(),t.point(b[0][0],b[0][1])))}!g||e&&Pc(e,f)||t.point(f[0],f[1]),e=f,l=g,n=m},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return c|(u&&l)<<1}}}),(function(e,i,r,o){Dc(o,t,n,r,e,i)}),i?[0,-t]:[-Al,t-Al])}var Vc=1e9,Gc=-Vc;function Uc(t,e,n,i){function r(r,o){return t<=r&&r<=n&&e<=o&&o<=i}function o(r,o,s,u){var c=0,h=0;if(null==r||(c=a(r,s))!==(h=a(o,s))||l(r,o)<0^s>0)do{u.point(0===c||3===c?t:n,c>1?i:e)}while((c=(c+s+4)%4)!==h);else u.point(o[0],o[1])}function a(i,r){return Fl(i[0]-t)0?0:3:Fl(i[0]-n)0?2:1:Fl(i[1]-e)0?1:0:r>0?3:2}function s(t,e){return l(t.x,e.x)}function l(t,e){var n=a(t,1),i=a(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var l,u,c,h,d,p,f,g,m,b,v,y=a,w=Sc(),_={point:C,lineStart:function(){_.point=x,u&&u.push(c=[]),b=!0,m=!1,f=g=NaN},lineEnd:function(){l&&(x(h,d),p&&m&&w.rejoin(),l.push(w.result())),_.point=C,m&&y.lineEnd()},polygonStart:function(){y=w,l=[],u=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=u.length;ni&&(d-o)*(i-a)>(p-a)*(t-o)&&++e:p<=i&&(d-o)*(i-a)<(p-a)*(t-o)&&--e;return e}(),n=v&&e,r=(l=Pr(l)).length;(n||r)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),r&&Oc(l,s,e,o,a),a.polygonEnd()),y=a,l=u=c=null}};function C(t,e){r(t,e)&&y.point(t,e)}function x(o,a){var s=r(o,a);if(u&&c.push([o,a]),b)h=o,d=a,p=s,b=!1,s&&(y.lineStart(),y.point(o,a));else if(s&&m)y.point(o,a);else{var l=[f=Math.max(Gc,Math.min(Vc,f)),g=Math.max(Gc,Math.min(Vc,g))],w=[o=Math.max(Gc,Math.min(Vc,o)),a=Math.max(Gc,Math.min(Vc,a))];!function(t,e,n,i,r,o){var a,s=t[0],l=t[1],u=0,c=1,h=e[0]-s,d=e[1]-l;if(a=n-s,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>c)return;a>u&&(u=a)}if(a=r-s,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>u&&(u=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>c)return;a>u&&(u=a)}if(a=o-l,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>u&&(u=a)}else if(d>0){if(a0&&(t[0]=s+u*h,t[1]=l+u*d),c<1&&(e[0]=s+c*h,e[1]=l+c*d),!0}}}}}(l,w,t,e,n,i)?s&&(y.lineStart(),y.point(o,a),v=!1):(m||(y.lineStart(),y.point(l[0],l[1])),y.point(w[0],w[1]),s||y.lineEnd(),v=!1)}f=o,g=a,m=s}return _}}function qc(){var t,e,n,i=0,r=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=Uc(i,r,o,a)(e=n)},extent:function(s){return arguments.length?(i=+s[0][0],r=+s[0][1],o=+s[1][0],a=+s[1][1],t=e=null,n):[[i,r],[o,a]]}}}var Yc,Kc,Xc,$c=xl(),Jc={sphere:$l,point:$l,lineStart:function(){Jc.point=Qc,Jc.lineEnd=Zc},lineEnd:$l,polygonStart:$l,polygonEnd:$l};function Zc(){Jc.point=Jc.lineEnd=$l}function Qc(t,e){Yc=t*=Ol,Kc=Vl(e*=Ol),Xc=Nl(e),Jc.point=th}function th(t,e){t*=Ol;var n=Vl(e*=Ol),i=Nl(e),r=Fl(t-Yc),o=Nl(r),a=i*Vl(r),s=Xc*n-Kc*i*o,l=Kc*n+Xc*i*o;$c.add(Bl(Ul(a*a+s*s),l)),Yc=t,Kc=n,Xc=i}function eh(t){return $c.reset(),nu(t,Jc),+$c}var nh=[null,null],ih={type:"LineString",coordinates:nh};function rh(t,e){return nh[0]=t,nh[1]=e,eh(ih)}var oh={Feature:function(t,e){return sh(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++ikl})).map(l)).concat(Fr(Il(o/p)*p,r,p).filter((function(t){return Fl(t%g)>kl})).map(u))}return b.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},b.outline=function(){return{type:"Polygon",coordinates:[c(i).concat(h(a).slice(1),c(n).reverse().slice(1),h(s).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.extentMajor(t).extentMinor(t):b.extentMinor()},b.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],i>n&&(t=i,i=n,n=t),s>a&&(t=s,s=a,a=t),b.precision(m)):[[i,s],[n,a]]},b.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),o>r&&(n=o,o=r,r=n),b.precision(m)):[[e,o],[t,r]]},b.step=function(t){return arguments.length?b.stepMajor(t).stepMinor(t):b.stepMinor()},b.stepMajor=function(t){return arguments.length?(f=+t[0],g=+t[1],b):[f,g]},b.stepMinor=function(t){return arguments.length?(d=+t[0],p=+t[1],b):[d,p]},b.precision=function(d){return arguments.length?(m=+d,l=fh(o,r,90),u=gh(e,t,m),c=fh(s,a,90),h=gh(i,n,m),b):m},b.extentMajor([[-180,-90+kl],[180,90-kl]]).extentMinor([[-180,-80-kl],[180,80+kl]])}function bh(){return mh()()}function vh(t,e){var n=t[0]*Ol,i=t[1]*Ol,r=e[0]*Ol,o=e[1]*Ol,a=Nl(i),s=Vl(i),l=Nl(o),u=Vl(o),c=a*Nl(n),h=a*Vl(n),d=l*Nl(r),p=l*Vl(r),f=2*Kl(Ul(Xl(o-i)+a*l*Xl(r-n))),g=Vl(f),m=f?function(t){var e=Vl(t*=f)/g,n=Vl(f-t)/g,i=n*c+e*d,r=n*h+e*p,o=n*s+e*u;return[Bl(r,i)*Ll,Bl(o,Ul(i*i+r*r))*Ll]}:function(){return[n*Ll,i*Ll]};return m.distance=f,m}function yh(t){return t}var wh,_h,Ch,xh,Eh=xl(),Mh=xl(),Th={point:$l,lineStart:$l,lineEnd:$l,polygonStart:function(){Th.lineStart=kh,Th.lineEnd=Rh},polygonEnd:function(){Th.lineStart=Th.lineEnd=Th.point=$l,Eh.add(Fl(Mh)),Mh.reset()},result:function(){var t=Eh/2;return Eh.reset(),t}};function kh(){Th.point=Dh}function Dh(t,e){Th.point=Ah,wh=Ch=t,_h=xh=e}function Ah(t,e){Mh.add(xh*t-Ch*e),Ch=t,xh=e}function Rh(){Ah(wh,_h)}const Sh=Th;var Ph=1/0,Lh=Ph,Oh=-Ph,Fh=Oh,zh={point:function(t,e){tOh&&(Oh=t),eFh&&(Fh=e)},lineStart:$l,lineEnd:$l,polygonStart:$l,polygonEnd:$l,result:function(){var t=[[Ph,Lh],[Oh,Fh]];return Oh=Fh=-(Lh=Ph=1/0),t}};const Bh=zh;var Nh,Ih,Hh,jh,Wh=0,Vh=0,Gh=0,Uh=0,qh=0,Yh=0,Kh=0,Xh=0,$h=0,Jh={point:Zh,lineStart:Qh,lineEnd:nd,polygonStart:function(){Jh.lineStart=id,Jh.lineEnd=rd},polygonEnd:function(){Jh.point=Zh,Jh.lineStart=Qh,Jh.lineEnd=nd},result:function(){var t=$h?[Kh/$h,Xh/$h]:Yh?[Uh/Yh,qh/Yh]:Gh?[Wh/Gh,Vh/Gh]:[NaN,NaN];return Wh=Vh=Gh=Uh=qh=Yh=Kh=Xh=$h=0,t}};function Zh(t,e){Wh+=t,Vh+=e,++Gh}function Qh(){Jh.point=td}function td(t,e){Jh.point=ed,Zh(Hh=t,jh=e)}function ed(t,e){var n=t-Hh,i=e-jh,r=Ul(n*n+i*i);Uh+=r*(Hh+t)/2,qh+=r*(jh+e)/2,Yh+=r,Zh(Hh=t,jh=e)}function nd(){Jh.point=Zh}function id(){Jh.point=od}function rd(){ad(Nh,Ih)}function od(t,e){Jh.point=ad,Zh(Nh=Hh=t,Ih=jh=e)}function ad(t,e){var n=t-Hh,i=e-jh,r=Ul(n*n+i*i);Uh+=r*(Hh+t)/2,qh+=r*(jh+e)/2,Yh+=r,Kh+=(r=jh*t-Hh*e)*(Hh+t),Xh+=r*(jh+e),$h+=3*r,Zh(Hh=t,jh=e)}const sd=Jh;function ld(t){this._context=t}ld.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Pl)}},result:$l};var ud,cd,hd,dd,pd,fd=xl(),gd={point:$l,lineStart:function(){gd.point=md},lineEnd:function(){ud&&bd(cd,hd),gd.point=$l},polygonStart:function(){ud=!0},polygonEnd:function(){ud=null},result:function(){var t=+fd;return fd.reset(),t}};function md(t,e){gd.point=bd,cd=dd=t,hd=pd=e}function bd(t,e){dd-=t,pd-=e,fd.add(Ul(dd*dd+pd*pd)),dd=t,pd=e}const vd=gd;function yd(){this._string=[]}function wd(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function _d(t,e){var n,i,r=4.5;function o(t){return t&&("function"==typeof r&&i.pointRadius(+r.apply(this,arguments)),nu(t,n(i))),i.result()}return o.area=function(t){return nu(t,n(Sh)),Sh.result()},o.measure=function(t){return nu(t,n(vd)),vd.result()},o.bounds=function(t){return nu(t,n(Bh)),Bh.result()},o.centroid=function(t){return nu(t,n(sd)),sd.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,yh):(t=e).stream,o):t},o.context=function(t){return arguments.length?(i=null==t?(e=null,new yd):new ld(e=t),"function"!=typeof r&&i.pointRadius(r),o):e},o.pointRadius=function(t){return arguments.length?(r="function"==typeof t?t:(i.pointRadius(+t),+t),o):r},o.projection(t).context(e)}function Cd(t){return{stream:xd(t)}}function xd(t){return function(e){var n=new Ed;for(var i in t)n[i]=t[i];return n.stream=e,n}}function Ed(){}function Md(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),nu(n,t.stream(Bh)),e(Bh.result()),null!=i&&t.clipExtent(i),t}function Td(t,e,n){return Md(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),a=+e[0][0]+(i-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function kd(t,e,n){return Td(t,[[0,0],e],n)}function Dd(t,e,n){return Md(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),o=(i-r*(n[1][0]+n[0][0]))/2,a=-r*n[0][1];t.scale(150*r).translate([o,a])}),n)}function Ad(t,e,n){return Md(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),o=-r*n[0][0],a=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([o,a])}),n)}yd.prototype={_radius:4.5,_circle:wd(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=wd(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Ed.prototype={constructor:Ed,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Rd=16,Sd=Nl(30*Ol);function Pd(t,e){return+e?function(t,e){function n(i,r,o,a,s,l,u,c,h,d,p,f,g,m){var b=u-i,v=c-r,y=b*b+v*v;if(y>4*e&&g--){var w=a+d,_=s+p,C=l+f,x=Ul(w*w+_*_+C*C),E=Kl(C/=x),M=Fl(Fl(C)-1)e||Fl((b*A+v*R)/y-.5)>.3||a*d+s*p+l*f2?t[2]%360*Ol:0,D()):[m*Ll,b*Ll,v*Ll]},M.precision=function(t){return arguments.length?(E=Pd(k,x=t*t),A()):Ul(x)},M.fitExtent=function(t,e){return Td(M,t,e)},M.fitSize=function(t,e){return kd(M,t,e)},M.fitWidth=function(t,e){return Dd(M,t,e)},M.fitHeight=function(t,e){return Ad(M,t,e)},function(){return e=t.apply(this,arguments),M.invert=e.invert&&T,D()}}function zd(t){var e=0,n=Al/3,i=Fd(t),r=i(e,n);return r.parallels=function(t){return arguments.length?i(e=t[0]*Ol,n=t[1]*Ol):[e*Ll,n*Ll]},r}function Bd(t,e){var n=Vl(t),i=(n+Vl(e))/2;if(Fl(i)=.12&&r<.234&&i>=-.425&&i<-.214?s:r>=.166&&r<.234&&i>=-.214&&i<-.115?l:a).invert(t)},c.stream=function(n){return t&&e===n?t:(i=[a.stream(e=n),s.stream(n),l.stream(n)],r=i.length,t={point:function(t,e){for(var n=-1;++n0?e<-Rl+kl&&(e=-Rl+kl):e>Rl-kl&&(e=Rl-kl);var n=r/Wl($d(e),i);return[n*Vl(i*t),r-n*Nl(i*t)]}return o.invert=function(t,e){var n=r-e,o=Gl(i)*Ul(t*t+n*n);return[Bl(t,Fl(n))/i*Gl(n),2*zl(Wl(r/o,1/i))-Rl]},o}function Zd(){return zd(Jd).scale(109.5).parallels([30,30])}function Qd(t,e){return[t,e]}function tp(){return Od(Qd).scale(152.63)}function ep(t,e){var n=Nl(t),i=t===e?Vl(t):(n-Nl(e))/(e-t),r=n/i+t;if(Fl(i)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}function gp(t,e){return t.parent===e.parent?1:2}function mp(t,e){return t+e.x}function bp(t,e){return Math.max(t,e.y)}function vp(){var t=gp,e=1,n=1,i=!1;function r(r){var o,a=0;r.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(mp,0)/t.length}(n),e.y=function(t){return 1+t.reduce(bp,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(r),l=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(r),u=s.x-t(s,l)/2,c=l.x+t(l,s)/2;return r.eachAfter(i?function(t){t.x=(t.x-r.x)*e,t.y=(r.y-t.y)*n}:function(t){t.x=(t.x-u)/(c-u)*e,t.y=(1-(r.y?t.y/r.y:1))*n})}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r}function yp(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function wp(t,e){var n,i,r,o,a,s=new Ep(t),l=+t.value&&(s.value=t.value),u=[s];for(null==e&&(e=_p);n=u.pop();)if(l&&(n.value=+n.data.value),(r=e(n.data))&&(a=r.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(i=n.children[o]=new Ep(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(xp)}function _p(t){return t.children}function Cp(t){t.data=t.data.data}function xp(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Ep(t){this.data=t,this.depth=this.height=0,this.parent=null}Ud.invert=Wd((function(t){return t})),Yd.invert=function(t,e){return[t,2*zl(Hl(e))-Rl]},Qd.invert=Qd,ip.invert=Wd(zl),sp.invert=function(t,e){var n,i=e,r=25;do{var o=i*i,a=o*o;i-=n=(i*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Fl(n)>kl&&--r>0);return[t/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]},up.invert=Wd(Kl),hp.invert=Wd((function(t){return 2*zl(t)})),pp.invert=function(t,e){return[-e,2*zl(Hl(t))-Rl]},Ep.prototype=wp.prototype={constructor:Ep,count:function(){return this.eachAfter(yp)},each:function(t){var e,n,i,r,o=this,a=[o];do{for(e=a.reverse(),a=[];o=e.pop();)if(t(o),n=o.children)for(i=0,r=n.length;i=0;--n)r.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return wp(this).eachBefore(Cp)}};var Mp=Array.prototype.slice;function Tp(t){for(var e,n,i=0,r=(t=function(t){for(var e,n,i=t.length;i;)n=Math.random()*i--|0,e=t[i],t[i]=t[n],t[n]=e;return t}(Mp.call(t))).length,o=[];i0&&n*n>i*i+r*r}function Rp(t,e){for(var n=0;nn*n+i*i}function zp(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,o=(e.y*n.r+n.y*e.r)/i;return r*r+o*o}function Bp(t){this._=t,this.next=null,this.previous=null}function Np(t){if(!(r=t.length))return 0;var e,n,i,r,o,a,s,l,u,c,h;if((e=t[0]).x=0,e.y=0,!(r>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(r>2))return e.r+n.r;Op(n,e,i=t[2]),e=new Bp(e),n=new Bp(n),i=new Bp(i),e.next=i.previous=n,n.next=e.previous=i,i.next=n.previous=e;t:for(s=3;s0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=Hp(e),n):t},n.parentId=function(t){return arguments.length?(e=Hp(t),n):e},n}function rf(t,e){return t.parent===e.parent?1:2}function of(t){var e=t.children;return e?e[0]:t.t}function af(t){var e=t.children;return e?e[e.length-1]:t.t}function sf(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function lf(t,e,n){return t.a.parent===e.parent?t.a:n}function uf(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function cf(){var t=rf,e=1,n=1,i=null;function r(r){var l=function(t){for(var e,n,i,r,o,a=new uf(t,0),s=[a];e=s.pop();)if(i=e._.children)for(e.children=new Array(o=i.length),r=o-1;r>=0;--r)s.push(n=e.children[r]=new uf(i[r],r)),n.parent=e;return(a.parent=new uf(null,0)).children=[a],a}(r);if(l.eachAfter(o),l.parent.m=-l.z,l.eachBefore(a),i)r.eachBefore(s);else{var u=r,c=r,h=r;r.eachBefore((function(t){t.xc.x&&(c=t),t.depth>h.depth&&(h=t)}));var d=u===c?1:t(u,c)/2,p=d-u.x,f=e/(c.x+d+p),g=n/(h.depth||1);r.eachBefore((function(t){t.x=(t.x+p)*f,t.y=t.depth*g}))}return r}function o(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;--o>=0;)(e=r[o]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-o):e.z=o}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,o=e,a=e,s=n,l=o.parent.children[0],u=o.m,c=a.m,h=s.m,d=l.m;s=af(s),o=of(o),s&&o;)l=of(l),(a=af(a)).a=e,(r=s.z+h-o.z-u+t(s._,o._))>0&&(sf(lf(s,e,i),e,r),u+=r,c+=r),h+=s.m,u+=o.m,d+=l.m,c+=a.m;s&&!af(a)&&(a.t=s,a.m+=h-c),o&&!of(l)&&(l.t=o,l.m+=u-d,i=e)}return i}(e,r,e.parent.A||i[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r}function hf(t,e,n,i,r){for(var o,a=t.children,s=-1,l=a.length,u=t.value&&(r-n)/t.value;++sd&&(d=s),m=c*c*g,(p=Math.max(d/m,m/h))>f){c-=s;break}f=p}b.push(a={value:c,dice:l1?e:1)},n}(df);function gf(){var t=ff,e=!1,n=1,i=1,r=[0],o=jp,a=jp,s=jp,l=jp,u=jp;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=i,t.eachBefore(h),r=[0],e&&t.eachBefore(Kp),t}function h(e){var n=r[e.depth],i=e.x0+n,c=e.y0+n,h=e.x1-n,d=e.y1-n;h=n-1){var c=s[e];return c.x0=r,c.y0=o,c.x1=a,void(c.y1=l)}for(var h=u[e],d=i/2+h,p=e+1,f=n-1;p>>1;u[g]l-o){var v=(r*b+a*m)/i;t(e,p,m,r,o,v,l),t(p,n,b,v,o,a,l)}else{var y=(o*b+l*m)/i;t(e,p,m,r,o,a,y),t(p,n,b,r,y,a,l)}}(0,l,t.value,e,n,i,r)}function bf(t,e,n,i,r){(1&t.depth?hf:Xp)(t,e,n,i,r)}const vf=function t(e){function n(t,n,i,r,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,l,u,c,h=-1,d=a.length,p=t.value;++h1?e:1)},n}(df);function yf(t,e,n,i,r){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*i+a*r)/6}function wf(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),r=t[i],o=t[i+1],a=i>0?t[i-1]:2*r-o,s=i180||n<-180?n-360*Math.round(n/360):n):Cf(isNaN(t)?e:t)}function Mf(t,e){var n=e-t;return n?xf(t,n):Cf(isNaN(t)?e:t)}const Tf=function t(e){var n=function(t){return 1==(t=+t)?Mf:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Cf(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=Wo(t)).r,(e=Wo(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=Mf(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function kf(t){return function(e){var n,i,r=e.length,o=new Array(r),a=new Array(r),s=new Array(r);for(n=0;no&&(r=e.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Pf(n,i)})),o=Ff.lastIndex;return o180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:Pf(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,a.rotate,s,l),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:Pf(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,a.skewX,s,l),function(t,e,n,i,o,a){if(t!==n||e!==i){var s=o.push(r(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Pf(t,n)},{i:s-2,x:Pf(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,l),o=a=null,function(t){for(var e,n=-1,i=l.length;++n1&&fg(t[n[i-2]],t[n[i-1]],t[r])<=0;)--i;n[i++]=r}return n.slice(0,i)}function bg(t){if((n=t.length)<3)return null;var e,n,i=new Array(n),r=new Array(n);for(e=0;e=0;--e)u.push(t[i[o[e]][2]]);for(e=+s;es!=u>s&&a<(l-n)*(s-i)/(u-i)+n&&(c=!c),l=n,u=i;return c}function yg(t){for(var e,n,i=-1,r=t.length,o=t[r-1],a=o[0],s=o[1],l=0;++i=0;)if((n=t._tasks[i])&&(t._tasks[i]=null,n.abort))try{n.abort()}catch(e){}t._active=NaN,Tg(t)}function Tg(t){if(!t._active&&t._call){var e=t._data;t._data=void 0,t._call(t._error,e)}}function kg(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new Cg(t)}function Dg(){return Math.random()}Cg.prototype=kg.prototype={constructor:Cg,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var e=wg.call(arguments,1);return e.push(t),++this._waiting,this._tasks.push(e),xg(this),this},abort:function(){return null==this._error&&Mg(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(e,n){t.apply(null,[e].concat(n))},Tg(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,Tg(this),this}};const Ag=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,1===arguments.length?(n=t,t=0):n-=t,function(){return e()*n+t}}return n.source=t,n}(Dg),Rg=function t(e){function n(t,n){var i,r;return t=null==t?0:+t,n=null==n?1:+n,function(){var o;if(null!=i)o=i,i=null;else do{i=2*e()-1,o=2*e()-1,r=i*i+o*o}while(!r||r>1);return t+n*o*Math.sqrt(-2*Math.log(r)/r)}}return n.source=t,n}(Dg),Sg=function t(e){function n(){var t=Rg.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(Dg),Pg=function t(e){function n(t){return function(){for(var n=0,i=0;i=200&&i<300||304===i){if(r)try{e=r.call(n,l)}catch(t){return void a.call("error",n,t)}else e=l;a.call("load",n,e)}else a.call("error",n,t)}if("undefined"!=typeof XDomainRequest&&!("withCredentials"in l)&&/^(http(s)?:)?\/\//.test(t)&&(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=l.ontimeout=d:l.onreadystatechange=function(t){l.readyState>3&&d(t)},l.onprogress=function(t){a.call("progress",n,t)},n={header:function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s.get(t):(null==e?s.remove(t):s.set(t,e+""),n)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",n):i},responseType:function(t){return arguments.length?(o=t,n):o},timeout:function(t){return arguments.length?(h=+t,n):h},user:function(t){return arguments.length<1?u:(u=null==t?null:t+"",n)},password:function(t){return arguments.length<1?c:(c=null==t?null:t+"",n)},response:function(t){return r=t,n},get:function(t,e){return n.send("GET",t,e)},post:function(t,e){return n.send("POST",t,e)},send:function(e,r,d){return l.open(e,t,!0,u,c),null==i||s.has("accept")||s.set("accept",i+",*/*"),l.setRequestHeader&&s.each((function(t,e){l.setRequestHeader(e,t)})),null!=i&&l.overrideMimeType&&l.overrideMimeType(i),null!=o&&(l.responseType=o),h>0&&(l.timeout=h),null==d&&"function"==typeof r&&(d=r,r=null),null!=d&&1===d.length&&(d=function(t){return function(e,n){t(null==e?n:null)}}(d)),null!=d&&n.on("error",d).on("load",(function(t){d(null,t)})),a.call("beforesend",n,l),l.send(null==r?null:r),n},abort:function(){return l.abort(),n},on:function(){var t=a.on.apply(a,arguments);return t===a?n:t}},null!=e){if("function"!=typeof e)throw new Error("invalid callback: "+e);return n.get(e)}return n}function zg(t,e){return function(n,i){var r=Fg(n).mimeType(t).response(e);if(null!=i){if("function"!=typeof i)throw new Error("invalid callback: "+i);return r.get(i)}return r}}const Bg=zg("text/html",(function(t){return document.createRange().createContextualFragment(t.responseText)})),Ng=zg("application/json",(function(t){return JSON.parse(t.responseText)})),Ig=zg("text/plain",(function(t){return t.responseText})),Hg=zg("application/xml",(function(t){var e=t.responseXML;if(!e)throw new Error("parse error");return e}));function jg(t,e){return function(n,i,r){arguments.length<3&&(r=i,i=null);var o=Fg(n).mimeType(t);return o.row=function(t){return arguments.length?o.response(function(t,e){return function(n){return t(n.responseText,e)}}(e,i=t)):i},o.row(i),r?o.get(r):o}}const Wg=jg("text/csv",Ra),Vg=jg("text/tab-separated-values",Fa);var Gg=Array.prototype,Ug=Gg.map,qg=Gg.slice,Yg={name:"implicit"};function Kg(t){var e=Gs(),n=[],i=Yg;function r(r){var o=r+"",a=e.get(o);if(!a){if(i!==Yg)return i;e.set(o,a=n.push(r))}return t[(a-1)%t.length]}return t=null==t?[]:qg.call(t),r.domain=function(t){if(!arguments.length)return n.slice();n=[],e=Gs();for(var i,o,a=-1,s=t.length;++a2?rm:im,i=r=null,c}function c(e){return(i||(i=n(o,a,l?function(t){return function(e,n){var i=t(e=+e,n=+n);return function(t){return t<=e?0:t>=n?1:i(t)}}}(t):t,s)))(+e)}return c.invert=function(t){return(r||(r=n(a,o,nm,l?function(t){return function(e,n){var i=t(e=+e,n=+n);return function(t){return t<=0?e:t>=1?n:i(t)}}}(e):e)))(+t)},c.domain=function(t){return arguments.length?(o=Ug.call(t,tm),u()):o.slice()},c.range=function(t){return arguments.length?(a=qg.call(t),u()):a.slice()},c.rangeRound=function(t){return a=qg.call(t),s=Zg,u()},c.clamp=function(t){return arguments.length?(l=!!t,u()):l},c.interpolate=function(t){return arguments.length?(s=t,u()):s},u()}function sm(t){var e=t.domain;return t.ticks=function(t){var n=e();return Ar(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){return function(t,e,n){var i,r=t[0],o=t[t.length-1],a=Sr(r,o,null==e?10:e);switch((n=hl(null==n?",f":n)).type){case"s":var s=Math.max(Math.abs(r),Math.abs(o));return null!=n.precision||isNaN(i=_l(a,s))||(n.precision=i),ml(n,s);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(i=Cl(a,Math.max(Math.abs(r),Math.abs(o))))||(n.precision=i-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(i=wl(a))||(n.precision=i-2*("%"===n.type))}return gl(n)}(e(),t,n)},t.nice=function(n){null==n&&(n=10);var i,r=e(),o=0,a=r.length-1,s=r[o],l=r[a];return l0?i=Rr(s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i,n):i<0&&(i=Rr(s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(l/i)*i,e(r)):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(l*i)/i,e(r)),t},t}function lm(){var t=am(nm,Dn);return t.copy=function(){return om(t,lm())},sm(t)}function um(){var t=[0,1];function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=Ug.call(n,tm),e):t.slice()},e.copy=function(){return um().domain(t)},sm(e)}function cm(t,e){var n,i=0,r=(t=t.slice()).length-1,o=t[i],a=t[r];return a0){for(;dl)break;g.push(h)}}else for(;d=1;--c)if(!((h=u*c)l)break;g.push(h)}}else g=Ar(d,p,Math.min(p-d,f)).map(r);return o?g.reverse():g},t.tickFormat=function(e,o){if(null==o&&(o=10===n?".0e":","),"function"!=typeof o&&(o=gl(o)),e===1/0)return o;null==e&&(e=10);var a=Math.max(1,n*e/t.ticks().length);return function(t){var e=t/r(Math.round(i(t)));return e*n0?n[r-1]:t[0],r=n?[i[n-1],e]:[i[a-1],i[a]]},o.copy=function(){return Cm().domain([t,e]).range(r)},sm(o)}function xm(){var t=[.5],e=[0,1],n=1;function i(i){if(i<=i)return e[Er(t,i,0,n)]}return i.domain=function(r){return arguments.length?(t=qg.call(r),n=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(r){return arguments.length?(e=qg.call(r),n=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(n){var i=e.indexOf(n);return[t[i-1],t[i]]},i.copy=function(){return xm().domain(t).range(e)},i}var Em=new Date,Mm=new Date;function Tm(t,e,n,i){function r(e){return t(e=new Date(+e)),e}return r.floor=r,r.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},r.round=function(t){var e=r(t),n=r.ceil(t);return t-e0))return s;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,i){if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););}))},n&&(r.count=function(e,i){return Em.setTime(+e),Mm.setTime(+i),t(Em),t(Mm),Math.floor(n(Em,Mm))},r.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?function(e){return i(e)%t==0}:function(e){return r.count(0,e)%t==0}):r:null}),r}var km=Tm((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));km.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Tm((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):km:null};const Dm=km;var Am=km.range,Rm=1e3,Sm=6e4,Pm=36e5,Lm=864e5,Om=6048e5,Fm=Tm((function(t){t.setTime(Math.floor(t/Rm)*Rm)}),(function(t,e){t.setTime(+t+e*Rm)}),(function(t,e){return(e-t)/Rm}),(function(t){return t.getUTCSeconds()}));const zm=Fm;var Bm=Fm.range,Nm=Tm((function(t){t.setTime(Math.floor(t/Sm)*Sm)}),(function(t,e){t.setTime(+t+e*Sm)}),(function(t,e){return(e-t)/Sm}),(function(t){return t.getMinutes()}));const Im=Nm;var Hm=Nm.range,jm=Tm((function(t){var e=t.getTimezoneOffset()*Sm%Pm;e<0&&(e+=Pm),t.setTime(Math.floor((+t-e)/Pm)*Pm+e)}),(function(t,e){t.setTime(+t+e*Pm)}),(function(t,e){return(e-t)/Pm}),(function(t){return t.getHours()}));const Wm=jm;var Vm=jm.range,Gm=Tm((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Sm)/Lm}),(function(t){return t.getDate()-1}));const Um=Gm;var qm=Gm.range;function Ym(t){return Tm((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Sm)/Om}))}var Km=Ym(0),Xm=Ym(1),$m=Ym(2),Jm=Ym(3),Zm=Ym(4),Qm=Ym(5),tb=Ym(6),eb=Km.range,nb=Xm.range,ib=$m.range,rb=Jm.range,ob=Zm.range,ab=Qm.range,sb=tb.range,lb=Tm((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}));const ub=lb;var cb=lb.range,hb=Tm((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));hb.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Tm((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};const db=hb;var pb=hb.range,fb=Tm((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*Sm)}),(function(t,e){return(e-t)/Sm}),(function(t){return t.getUTCMinutes()}));const gb=fb;var mb=fb.range,bb=Tm((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*Pm)}),(function(t,e){return(e-t)/Pm}),(function(t){return t.getUTCHours()}));const vb=bb;var yb=bb.range,wb=Tm((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/Lm}),(function(t){return t.getUTCDate()-1}));const _b=wb;var Cb=wb.range;function xb(t){return Tm((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/Om}))}var Eb=xb(0),Mb=xb(1),Tb=xb(2),kb=xb(3),Db=xb(4),Ab=xb(5),Rb=xb(6),Sb=Eb.range,Pb=Mb.range,Lb=Tb.range,Ob=kb.range,Fb=Db.range,zb=Ab.range,Bb=Rb.range,Nb=Tm((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}));const Ib=Nb;var Hb=Nb.range,jb=Tm((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));jb.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Tm((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};const Wb=jb;var Vb=jb.range;function Gb(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ub(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function qb(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Yb(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,a=t.shortDays,s=t.months,l=t.shortMonths,u=ov(r),c=av(r),h=ov(o),d=av(o),p=ov(a),f=av(a),g=ov(s),m=av(s),b=ov(l),v=av(l),y={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Tv,e:Tv,f:Sv,H:kv,I:Dv,j:Av,L:Rv,m:Pv,M:Lv,p:function(t){return r[+(t.getHours()>=12)]},Q:sy,s:ly,S:Ov,u:Fv,U:zv,V:Bv,w:Nv,W:Iv,x:null,X:null,y:Hv,Y:jv,Z:Wv,"%":ay},w={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Vv,e:Vv,f:Kv,H:Gv,I:Uv,j:qv,L:Yv,m:Xv,M:$v,p:function(t){return r[+(t.getUTCHours()>=12)]},Q:sy,s:ly,S:Jv,u:Zv,U:Qv,V:ty,w:ey,W:ny,x:null,X:null,y:iy,Y:ry,Z:oy,"%":ay},_={a:function(t,e,n){var i=p.exec(e.slice(n));return i?(t.w=f[i[0].toLowerCase()],n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=d[i[0].toLowerCase()],n+i[0].length):-1},b:function(t,e,n){var i=b.exec(e.slice(n));return i?(t.m=v[i[0].toLowerCase()],n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m[i[0].toLowerCase()],n+i[0].length):-1},c:function(t,n,i){return E(t,e,n,i)},d:mv,e:mv,f:Cv,H:vv,I:vv,j:bv,L:_v,m:gv,M:yv,p:function(t,e,n){var i=u.exec(e.slice(n));return i?(t.p=c[i[0].toLowerCase()],n+i[0].length):-1},Q:Ev,s:Mv,S:wv,u:lv,U:uv,V:cv,w:sv,W:hv,x:function(t,e,i){return E(t,n,e,i)},X:function(t,e,n){return E(t,i,e,n)},y:pv,Y:dv,Z:fv,"%":xv};function C(t,e){return function(n){var i,r,o,a=[],s=-1,l=0,u=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=Ub(qb(o.y))).getUTCDay(),i=r>4||0===r?Mb.ceil(i):Mb(i),i=_b.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=e(qb(o.y))).getDay(),i=r>4||0===r?Xm.ceil(i):Xm(i),i=Um.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?Ub(qb(o.y)).getUTCDay():e(qb(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Ub(o)):e(o)}}function E(t,e,n,i){for(var r,o,a=0,s=e.length,l=n.length;a=l)return-1;if(37===(r=e.charCodeAt(a++))){if(r=e.charAt(a++),!(o=_[r in Qb?e.charAt(a++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return y.x=C(n,y),y.X=C(i,y),y.c=C(e,y),w.x=C(n,w),w.X=C(i,w),w.c=C(e,w),{format:function(t){var e=C(t+="",y);return e.toString=function(){return t},e},parse:function(t){var e=x(t+="",Gb);return e.toString=function(){return t},e},utcFormat:function(t){var e=C(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=x(t,Ub);return e.toString=function(){return t},e}}}var Kb,Xb,$b,Jb,Zb,Qb={"-":"",_:" ",0:"0"},tv=/^\s*\d+/,ev=/^%/,nv=/[\\^$*+?|[\]().{}]/g;function iv(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o68?1900:2e3),n+i[0].length):-1}function fv(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function gv(t,e,n){var i=tv.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function mv(t,e,n){var i=tv.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function bv(t,e,n){var i=tv.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function vv(t,e,n){var i=tv.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function yv(t,e,n){var i=tv.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function wv(t,e,n){var i=tv.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function _v(t,e,n){var i=tv.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Cv(t,e,n){var i=tv.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function xv(t,e,n){var i=ev.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function Ev(t,e,n){var i=tv.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Mv(t,e,n){var i=tv.exec(e.slice(n));return i?(t.Q=1e3*+i[0],n+i[0].length):-1}function Tv(t,e){return iv(t.getDate(),e,2)}function kv(t,e){return iv(t.getHours(),e,2)}function Dv(t,e){return iv(t.getHours()%12||12,e,2)}function Av(t,e){return iv(1+Um.count(db(t),t),e,3)}function Rv(t,e){return iv(t.getMilliseconds(),e,3)}function Sv(t,e){return Rv(t,e)+"000"}function Pv(t,e){return iv(t.getMonth()+1,e,2)}function Lv(t,e){return iv(t.getMinutes(),e,2)}function Ov(t,e){return iv(t.getSeconds(),e,2)}function Fv(t){var e=t.getDay();return 0===e?7:e}function zv(t,e){return iv(Km.count(db(t),t),e,2)}function Bv(t,e){var n=t.getDay();return t=n>=4||0===n?Zm(t):Zm.ceil(t),iv(Zm.count(db(t),t)+(4===db(t).getDay()),e,2)}function Nv(t){return t.getDay()}function Iv(t,e){return iv(Xm.count(db(t),t),e,2)}function Hv(t,e){return iv(t.getFullYear()%100,e,2)}function jv(t,e){return iv(t.getFullYear()%1e4,e,4)}function Wv(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+iv(e/60|0,"0",2)+iv(e%60,"0",2)}function Vv(t,e){return iv(t.getUTCDate(),e,2)}function Gv(t,e){return iv(t.getUTCHours(),e,2)}function Uv(t,e){return iv(t.getUTCHours()%12||12,e,2)}function qv(t,e){return iv(1+_b.count(Wb(t),t),e,3)}function Yv(t,e){return iv(t.getUTCMilliseconds(),e,3)}function Kv(t,e){return Yv(t,e)+"000"}function Xv(t,e){return iv(t.getUTCMonth()+1,e,2)}function $v(t,e){return iv(t.getUTCMinutes(),e,2)}function Jv(t,e){return iv(t.getUTCSeconds(),e,2)}function Zv(t){var e=t.getUTCDay();return 0===e?7:e}function Qv(t,e){return iv(Eb.count(Wb(t),t),e,2)}function ty(t,e){var n=t.getUTCDay();return t=n>=4||0===n?Db(t):Db.ceil(t),iv(Db.count(Wb(t),t)+(4===Wb(t).getUTCDay()),e,2)}function ey(t){return t.getUTCDay()}function ny(t,e){return iv(Mb.count(Wb(t),t),e,2)}function iy(t,e){return iv(t.getUTCFullYear()%100,e,2)}function ry(t,e){return iv(t.getUTCFullYear()%1e4,e,4)}function oy(){return"+0000"}function ay(){return"%"}function sy(t){return+t}function ly(t){return Math.floor(+t/1e3)}function uy(t){return Kb=Yb(t),Xb=Kb.format,$b=Kb.parse,Jb=Kb.utcFormat,Zb=Kb.utcParse,Kb}uy({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var cy="%Y-%m-%dT%H:%M:%S.%LZ",hy=Date.prototype.toISOString?function(t){return t.toISOString()}:Jb(cy);const dy=hy;var py=+new Date("2000-01-01T00:00:00.000Z")?function(t){var e=new Date(t);return isNaN(e)?null:e}:Zb(cy);const fy=py;var gy=1e3,my=60*gy,by=60*my,vy=24*by,yy=7*vy,wy=30*vy,_y=365*vy;function Cy(t){return new Date(t)}function xy(t){return t instanceof Date?+t:+new Date(+t)}function Ey(t,e,n,i,r,o,a,s,l){var u=am(nm,Dn),c=u.invert,h=u.domain,d=l(".%L"),p=l(":%S"),f=l("%I:%M"),g=l("%I %p"),m=l("%a %d"),b=l("%b %d"),v=l("%B"),y=l("%Y"),w=[[a,1,gy],[a,5,5*gy],[a,15,15*gy],[a,30,30*gy],[o,1,my],[o,5,5*my],[o,15,15*my],[o,30,30*my],[r,1,by],[r,3,3*by],[r,6,6*by],[r,12,12*by],[i,1,vy],[i,2,2*vy],[n,1,yy],[e,1,wy],[e,3,3*wy],[t,1,_y]];function _(s){return(a(s)180||n<-180?n-360*Math.round(n/360):n):_n(isNaN(t)?e:t)}));var Uy=Gy(xn);const qy=Uy(Wy(300,.5,0),Wy(-240,.5,1));var Yy=Uy(Wy(-100,.75,.35),Wy(80,1.5,.8)),Ky=Uy(Wy(260,.75,.35),Wy(80,1.5,.8)),Xy=Wy();function $y(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Xy.h=360*t-100,Xy.s=1.5-1.5*e,Xy.l=.8-.9*e,Xy+""}function Jy(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const Zy=Jy(ky("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Qy=Jy(ky("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),tw=Jy(ky("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),ew=Jy(ky("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function nw(t){var e=0,n=1,i=!1;function r(r){var o=(r-e)/(n-e);return t(i?Math.max(0,Math.min(1,o)):o)}return r.domain=function(t){return arguments.length?(e=+t[0],n=+t[1],r):[e,n]},r.clamp=function(t){return arguments.length?(i=!!t,r):i},r.interpolator=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return nw(t).domain([e,n]).clamp(i)},sm(r)}var iw="http://www.w3.org/1999/xhtml";const rw={svg:"http://www.w3.org/2000/svg",xhtml:iw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ow(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),rw.hasOwnProperty(e)?{space:rw[e],local:t}:t}function aw(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===iw&&e.documentElement.namespaceURI===iw?e.createElement(t):e.createElementNS(n,t)}}function sw(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function lw(t){var e=ow(t);return(e.local?sw:aw)(e)}function uw(){}function cw(t){return null==t?uw:function(){return this.querySelector(t)}}function hw(){return[]}function dw(t){return null==t?hw:function(){return this.querySelectorAll(t)}}var pw=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var fw=document.documentElement;if(!fw.matches){var gw=fw.webkitMatchesSelector||fw.msMatchesSelector||fw.mozMatchesSelector||fw.oMatchesSelector;pw=function(t){return function(){return gw.call(this,t)}}}}const mw=pw;function bw(t){return new Array(t.length)}function vw(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}vw.prototype={constructor:vw,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function yw(t,e,n,i,r,o){for(var a,s=0,l=e.length,u=o.length;se?1:t>=e?0:NaN}function Cw(t){return function(){this.removeAttribute(t)}}function xw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ew(t,e){return function(){this.setAttribute(t,e)}}function Mw(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Tw(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function kw(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Dw(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Aw(t){return function(){this.style.removeProperty(t)}}function Rw(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Sw(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Pw(t,e){return t.style.getPropertyValue(e)||Dw(t).getComputedStyle(t,null).getPropertyValue(e)}function Lw(t){return function(){delete this[t]}}function Ow(t,e){return function(){this[t]=e}}function Fw(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function zw(t){return t.trim().split(/^|\s+/)}function Bw(t){return t.classList||new Nw(t)}function Nw(t){this._node=t,this._names=zw(t.getAttribute("class")||"")}function Iw(t,e){for(var n=Bw(t),i=-1,r=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var n_={},i_=null;function r_(t,e,n){return t=o_(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function o_(t,e,n){return function(i){var r=i_;i_=i;try{t.call(this,this.__data__,e,n)}finally{i_=r}}}function a_(t){return function(){var e=this.__on;if(e){for(var n,i=0,r=-1,o=e.length;i=_&&(_=w+1);!(y=b[_])&&++_=0;)(i=r[o])&&(a&&a!==i.nextSibling&&a.parentNode.insertBefore(i,a),a=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=_w);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o1?this.each((null==e?Aw:"function"==typeof e?Sw:Rw)(t,e,null==n?"":n)):Pw(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Lw:"function"==typeof e?Fw:Ow)(t,e)):this.node()[t]},classed:function(t,e){var n=zw(t+"");if(arguments.length<2){for(var i=Bw(this.node()),r=-1,o=n.length;++r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?s_:a_,null==n&&(n=!1),i=0;i=1?B_:t<=-1?-B_:Math.asin(t)}function H_(t){return t.innerRadius}function j_(t){return t.outerRadius}function W_(t){return t.startAngle}function V_(t){return t.endAngle}function G_(t){return t&&t.padAngle}function U_(t,e,n,i,r,o,a){var s=t-n,l=e-i,u=(a?o:-o)/O_(s*s+l*l),c=u*l,h=-u*s,d=t+c,p=e+h,f=n+c,g=i+h,m=(d+f)/2,b=(p+g)/2,v=f-d,y=g-p,w=v*v+y*y,_=r-o,C=d*g-f*p,x=(y<0?-1:1)*O_(S_(0,_*_*w-C*C)),E=(C*y-v*x)/w,M=(-C*v-y*x)/w,T=(C*y+v*x)/w,k=(-C*v+y*x)/w,D=E-m,A=M-b,R=T-m,S=k-b;return D*D+A*A>R*R+S*S&&(E=T,M=k),{cx:E,cy:M,x01:-c,y01:-h,x11:E*(r/_-1),y11:M*(r/_-1)}}function q_(){var t=H_,e=j_,n=k_(0),i=null,r=W_,o=V_,a=G_,s=null;function l(){var l,u,c,h=+t.apply(this,arguments),d=+e.apply(this,arguments),p=r.apply(this,arguments)-B_,f=o.apply(this,arguments)-B_,g=D_(f-p),m=f>p;if(s||(s=l=Jr()),dF_)if(g>N_-F_)s.moveTo(d*R_(p),d*L_(p)),s.arc(0,0,d,p,f,!m),h>F_&&(s.moveTo(h*R_(f),h*L_(f)),s.arc(0,0,h,f,p,m));else{var b,v,y=p,w=f,_=p,C=f,x=g,E=g,M=a.apply(this,arguments)/2,T=M>F_&&(i?+i.apply(this,arguments):O_(h*h+d*d)),k=P_(D_(d-h)/2,+n.apply(this,arguments)),D=k,A=k;if(T>F_){var R=I_(T/h*L_(M)),S=I_(T/d*L_(M));(x-=2*R)>F_?(_+=R*=m?1:-1,C-=R):(x=0,_=C=(p+f)/2),(E-=2*S)>F_?(y+=S*=m?1:-1,w-=S):(E=0,y=w=(p+f)/2)}var P=d*R_(y),L=d*L_(y),O=h*R_(C),F=h*L_(C);if(k>F_){var z=d*R_(w),B=d*L_(w),N=h*R_(_),I=h*L_(_);if(gF_?function(t,e,n,i,r,o,a,s){var l=n-t,u=i-e,c=a-r,h=s-o,d=(c*(e-o)-h*(t-r))/(h*l-c*u);return[t+d*l,e+d*u]}(P,L,N,I,z,B,O,F):[O,F],j=P-H[0],W=L-H[1],V=z-H[0],G=B-H[1],U=1/L_(((c=(j*V+W*G)/(O_(j*j+W*W)*O_(V*V+G*G)))>1?0:c<-1?z_:Math.acos(c))/2),q=O_(H[0]*H[0]+H[1]*H[1]);D=P_(k,(h-q)/(U-1)),A=P_(k,(d-q)/(U+1))}}E>F_?A>F_?(b=U_(N,I,P,L,d,A,m),v=U_(z,B,O,F,d,A,m),s.moveTo(b.cx+b.x01,b.cy+b.y01),AF_&&x>F_?D>F_?(b=U_(O,F,z,B,h,-D,m),v=U_(P,L,N,I,h,-D,m),s.lineTo(b.cx+b.x01,b.cy+b.y01),D=c;--h)s.point(m[h],b[h]);s.lineEnd(),s.areaEnd()}g&&(m[u]=+t(d,u,l),b[u]=+n(d,u,l),s.point(e?+e(d,u,l):m[u],i?+i(d,u,l):b[u]))}if(p)return s=null,p+""||null}function u(){return J_().defined(r).curve(a).context(o)}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:k_(+n),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:k_(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:k_(+t),l):e},l.y=function(t){return arguments.length?(n="function"==typeof t?t:k_(+t),i=null,l):n},l.y0=function(t){return arguments.length?(n="function"==typeof t?t:k_(+t),l):n},l.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:k_(+t),l):i},l.lineX0=l.lineY0=function(){return u().x(t).y(n)},l.lineY1=function(){return u().x(t).y(i)},l.lineX1=function(){return u().x(e).y(n)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:k_(!!t),l):r},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}function Q_(t,e){return et?1:e>=t?0:NaN}function tC(t){return t}function eC(){var t=tC,e=Q_,n=null,i=k_(0),r=k_(N_),o=k_(0);function a(a){var s,l,u,c,h,d=a.length,p=0,f=new Array(d),g=new Array(d),m=+i.apply(this,arguments),b=Math.min(N_,Math.max(-N_,r.apply(this,arguments)-m)),v=Math.min(Math.abs(b)/d,o.apply(this,arguments)),y=v*(b<0?-1:1);for(s=0;s0&&(p+=h);for(null!=e?f.sort((function(t,n){return e(g[t],g[n])})):null!=n&&f.sort((function(t,e){return n(a[t],a[e])})),s=0,u=p?(b-d*y)/p:0;s0?h*u:0)+y,g[l]={data:a[l],index:s,value:h,startAngle:m,endAngle:c,padAngle:v};return g}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:k_(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:k_(+t),a):i},a.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:k_(+t),a):r},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:k_(+t),a):o},a}Y_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var nC=rC(K_);function iC(t){this._curve=t}function rC(t){function e(e){return new iC(t(e))}return e._curve=t,e}function oC(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(rC(t)):e()._curve},t}function aC(){return oC(J_().curve(nC))}function sC(){var t=Z_().curve(nC),e=t.curve,n=t.lineX0,i=t.lineX1,r=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return oC(n())},delete t.lineX0,t.lineEndAngle=function(){return oC(i())},delete t.lineX1,t.lineInnerRadius=function(){return oC(r())},delete t.lineY0,t.lineOuterRadius=function(){return oC(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(rC(t)):e()._curve},t}function lC(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}iC.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var uC=Array.prototype.slice;function cC(t){return t.source}function hC(t){return t.target}function dC(t){var e=cC,n=hC,i=X_,r=$_,o=null;function a(){var a,s=uC.call(arguments),l=e.apply(this,s),u=n.apply(this,s);if(o||(o=a=Jr()),t(o,+i.apply(this,(s[0]=l,s)),+r.apply(this,s),+i.apply(this,(s[0]=u,s)),+r.apply(this,s)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(e=t,a):e},a.target=function(t){return arguments.length?(n=t,a):n},a.x=function(t){return arguments.length?(i="function"==typeof t?t:k_(+t),a):i},a.y=function(t){return arguments.length?(r="function"==typeof t?t:k_(+t),a):r},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function pC(t,e,n,i,r){t.moveTo(e,n),t.bezierCurveTo(e=(e+i)/2,n,e,r,i,r)}function fC(t,e,n,i,r){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+r)/2,i,n,i,r)}function gC(t,e,n,i,r){var o=lC(e,n),a=lC(e,n=(n+r)/2),s=lC(i,n),l=lC(i,r);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],s[0],s[1],l[0],l[1])}function mC(){return dC(pC)}function bC(){return dC(fC)}function vC(){var t=dC(gC);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}const yC={draw:function(t,e){var n=Math.sqrt(e/z_);t.moveTo(n,0),t.arc(0,0,n,0,N_)}},wC={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}};var _C=Math.sqrt(1/3),CC=2*_C;const xC={draw:function(t,e){var n=Math.sqrt(e/CC),i=n*_C;t.moveTo(0,-n),t.lineTo(i,0),t.lineTo(0,n),t.lineTo(-i,0),t.closePath()}};var EC=Math.sin(z_/10)/Math.sin(7*z_/10),MC=Math.sin(N_/10)*EC,TC=-Math.cos(N_/10)*EC;const kC={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),i=MC*n,r=TC*n;t.moveTo(0,-n),t.lineTo(i,r);for(var o=1;o<5;++o){var a=N_*o/5,s=Math.cos(a),l=Math.sin(a);t.lineTo(l*n,-s*n),t.lineTo(s*i-l*r,l*i+s*r)}t.closePath()}},DC={draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}};var AC=Math.sqrt(3);const RC={draw:function(t,e){var n=-Math.sqrt(e/(3*AC));t.moveTo(0,2*n),t.lineTo(-AC*n,-n),t.lineTo(AC*n,-n),t.closePath()}};var SC=-.5,PC=Math.sqrt(3)/2,LC=1/Math.sqrt(12),OC=3*(LC/2+1);const FC={draw:function(t,e){var n=Math.sqrt(e/OC),i=n/2,r=n*LC,o=i,a=n*LC+n,s=-o,l=a;t.moveTo(i,r),t.lineTo(o,a),t.lineTo(s,l),t.lineTo(SC*i-PC*r,PC*i+SC*r),t.lineTo(SC*o-PC*a,PC*o+SC*a),t.lineTo(SC*s-PC*l,PC*s+SC*l),t.lineTo(SC*i+PC*r,SC*r-PC*i),t.lineTo(SC*o+PC*a,SC*a-PC*o),t.lineTo(SC*s+PC*l,SC*l-PC*s),t.closePath()}};var zC=[yC,wC,xC,DC,kC,RC,FC];function BC(){var t=k_(yC),e=k_(64),n=null;function i(){var i;if(n||(n=i=Jr()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return i.type=function(e){return arguments.length?(t="function"==typeof e?e:k_(e),i):t},i.size=function(t){return arguments.length?(e="function"==typeof t?t:k_(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}function NC(){}function IC(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function HC(t){this._context=t}function jC(t){return new HC(t)}function WC(t){this._context=t}function VC(t){return new WC(t)}function GC(t){this._context=t}function UC(t){return new GC(t)}function qC(t,e){this._basis=new HC(t),this._beta=e}HC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:IC(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:IC(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},WC.prototype={areaStart:NC,areaEnd:NC,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:IC(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},GC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:IC(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},qC.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,r=t[0],o=e[0],a=t[n]-r,s=e[n]-o,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*t[l]+(1-this._beta)*(r+i*a),this._beta*e[l]+(1-this._beta)*(o+i*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const YC=function t(e){function n(t){return 1===e?new HC(t):new qC(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function KC(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function XC(t,e){this._context=t,this._k=(1-e)/6}XC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:KC(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:KC(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const $C=function t(e){function n(t){return new XC(t,e)}return n.tension=function(e){return t(+e)},n}(0);function JC(t,e){this._context=t,this._k=(1-e)/6}JC.prototype={areaStart:NC,areaEnd:NC,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:KC(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const ZC=function t(e){function n(t){return new JC(t,e)}return n.tension=function(e){return t(+e)},n}(0);function QC(t,e){this._context=t,this._k=(1-e)/6}QC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:KC(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const tx=function t(e){function n(t){return new QC(t,e)}return n.tension=function(e){return t(+e)},n}(0);function ex(t,e,n){var i=t._x1,r=t._y1,o=t._x2,a=t._y2;if(t._l01_a>F_){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>F_){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*u+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*u+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(i,r,o,a,t._x2,t._y2)}function nx(t,e){this._context=t,this._alpha=e}nx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:ex(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const ix=function t(e){function n(t){return e?new nx(t,e):new XC(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function rx(t,e){this._context=t,this._alpha=e}rx.prototype={areaStart:NC,areaEnd:NC,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ex(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const ox=function t(e){function n(t){return e?new rx(t,e):new JC(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function ax(t,e){this._context=t,this._alpha=e}ax.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ex(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const sx=function t(e){function n(t){return e?new ax(t,e):new QC(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function lx(t){this._context=t}function ux(t){return new lx(t)}function cx(t){return t<0?-1:1}function hx(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),a=(n-t._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(cx(o)+cx(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function dx(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function px(t,e,n){var i=t._x0,r=t._y0,o=t._x1,a=t._y1,s=(o-i)/3;t._context.bezierCurveTo(i+s,r+s*e,o-s,a-s*n,o,a)}function fx(t){this._context=t}function gx(t){this._context=new mx(t)}function mx(t){this._context=t}function bx(t){return new fx(t)}function vx(t){return new gx(t)}function yx(t){this._context=t}function wx(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)r[e]=(a[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e1)for(var n,i,r,o=1,a=t[e[0]],s=a.length;o=0;)n[e]=e;return n}function Dx(t,e){return t[e]}function Ax(){var t=k_([]),e=kx,n=Tx,i=Dx;function r(r){var o,a,s=t.apply(this,arguments),l=r.length,u=s.length,c=new Array(u);for(o=0;o0){for(var n,i,r,o=0,a=t[0].length;o1)for(var n,i,r,o,a,s,l=0,u=t[e[0]].length;l=0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=a,i[0]=a+=r):i[0]=o}function Px(t,e){if((n=t.length)>0){for(var n,i=0,r=t[e[0]],o=r.length;i0&&(i=(n=t[e[0]]).length)>0){for(var n,i,r,o=0,a=1;a=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Ix=gt("start","end","interrupt"),Hx=[],jx=0,Wx=1,Vx=2,Gx=5,Ux=6;function qx(t,e,n,i,r,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(l){var u,c,h,d;if(n.state!==Wx)return s();for(u in r)if((d=r[u]).name===n.name){if(3===d.state)return ti(o);4===d.state?(d.state=Ux,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[u]):+ujx)throw new Error("too late; already scheduled");return n}function Kx(t,e){var n=Xx(t,e);if(n.state>Vx)throw new Error("too late; already started");return n}function Xx(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function $x(t,e){var n,i,r,o=t.__transition,a=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>Vx&&n.state=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Yx:Kx;return function(){var a=o(this,t),s=a.on;s!==i&&(r=(i=s).copy()).on(e,n),a.on=r}}(n,t,e))},attr:function(t,e){var n=ow(t),i="transform"===n?Kf:tE;return this.attrTween(t,"function"==typeof e?(n.local?aE:oE)(n,i,Qx(this,"attr."+t,e)):null==e?(n.local?nE:eE)(n):(n.local?rE:iE)(n,i,e+""))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=ow(t);return this.tween(n,(i.local?sE:lE)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?Yf:tE;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=Pw(this,t),a=(this.style.removeProperty(t),Pw(this,t));return o===a?null:o===n&&a===i?r:r=e(n=o,i=a)}}(t,i)).on("end.style."+t,function(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof e?function(t,e,n){var i,r,o;return function(){var a=Pw(this,t),s=n(this);return null==s&&(this.style.removeProperty(t),s=Pw(this,t)),a===s?null:a===i&&s===r?o:o=e(i=a,r=s)}}(t,i,Qx(this,"style."+t,e)):function(t,e,n){var i,r;return function(){var o=Pw(this,t);return o===n?null:o===i?r:r=e(i=o,n)}}(t,i,e+""),n)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){function i(){var i=this,r=e.apply(i,arguments);return r&&function(e){i.style.setProperty(t,r(e),n)}}return i._value=e,i}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Qx(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=Xx(this.node(),n).tween,o=0,a=r.length;oWx&&n.name===e)return new gE([[t]],_E,e,+i);return null}function xE(t){return function(){return t}}function EE(t){return t[0]}function ME(t){return t[1]}function TE(){this._=null}function kE(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function DE(t,e){var n=e,i=e.R,r=n.U;r?r.L===n?r.L=i:r.R=i:t._=i,i.U=r,n.U=i,n.R=i.L,n.R&&(n.R.U=n),i.L=n}function AE(t,e){var n=e,i=e.L,r=n.U;r?r.L===n?r.L=i:r.R=i:t._=i,i.U=r,n.U=i,n.L=i.R,n.L&&(n.L.U=n),i.R=n}function RE(t){for(;t.L;)t=t.L;return t}TE.prototype={constructor:TE,insert:function(t,e){var n,i,r;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=RE(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(i=n.U).L?(r=i.R)&&r.C?(n.C=r.C=!1,i.C=!0,t=i):(t===n.R&&(DE(this,n),n=(t=n).U),n.C=!1,i.C=!0,AE(this,i)):(r=i.L)&&r.C?(n.C=r.C=!1,i.C=!0,t=i):(t===n.L&&(AE(this,n),n=(t=n).U),n.C=!1,i.C=!0,DE(this,i)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,i,r=t.U,o=t.L,a=t.R;if(n=o?a?RE(a):o:a,r?r.L===t?r.L=n:r.R=n:this._=n,o&&a?(i=n.C,n.C=t.C,n.L=o,o.U=n,n!==a?(r=n.U,n.U=t.U,t=n.R,r.L=t,n.R=a,a.U=n):(n.U=r,r=n,t=n.R)):(i=t.C,t=n),t&&(t.U=r),!i)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===r.L){if((e=r.R).C&&(e.C=!1,r.C=!0,DE(this,r),e=r.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,AE(this,e),e=r.R),e.C=r.C,r.C=e.R.C=!1,DE(this,r),t=this._;break}}else if((e=r.L).C&&(e.C=!1,r.C=!0,AE(this,r),e=r.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,DE(this,e),e=r.L),e.C=r.C,r.C=e.L.C=!1,AE(this,r),t=this._;break}e.C=!0,t=r,r=r.U}while(!t.C);t&&(t.C=!1)}}};const SE=TE;function PE(t,e,n,i){var r=[null,null],o=nM.push(r)-1;return r.left=t,r.right=e,n&&OE(r,t,e,n),i&&OE(r,e,t,i),tM[t.index].halfedges.push(o),tM[e.index].halfedges.push(o),r}function LE(t,e,n){var i=[e,n];return i.left=t,i}function OE(t,e,n,i){t[0]||t[1]?t.left===n?t[1]=i:t[0]=i:(t[0]=i,t.left=e,t.right=n)}function FE(t,e,n,i,r){var o,a=t[0],s=t[1],l=a[0],u=a[1],c=0,h=1,d=s[0]-l,p=s[1]-u;if(o=e-l,d||!(o>0)){if(o/=d,d<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=i-l,d||!(o<0)){if(o/=d,d<0){if(o>h)return;o>c&&(c=o)}else if(d>0){if(o0)){if(o/=p,p<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o0||h<1)||(c>0&&(t[0]=[l+c*d,u+c*p]),h<1&&(t[1]=[l+h*d,u+h*p]),!0)}}}}}function zE(t,e,n,i,r){var o=t[1];if(o)return!0;var a,s,l=t[0],u=t.left,c=t.right,h=u[0],d=u[1],p=c[0],f=c[1],g=(h+p)/2,m=(d+f)/2;if(f===d){if(g=i)return;if(h>p){if(l){if(l[1]>=r)return}else l=[g,n];o=[g,r]}else{if(l){if(l[1]1)if(h>p){if(l){if(l[1]>=r)return}else l=[(n-s)/a,n];o=[(r-s)/a,r]}else{if(l){if(l[1]=i)return}else l=[e,a*e+s];o=[i,a*i+s]}else{if(l){if(l[0]=-rM)){var p=l*l+u*u,f=c*c+h*h,g=(h*p-u*f)/d,m=(l*f-c*p)/d,b=jE.pop()||new WE;b.arc=t,b.site=r,b.x=g+a,b.y=(b.cy=m+s)+Math.sqrt(g*g+m*m),t.circle=b;for(var v=null,y=eM._;y;)if(b.yiM)s=s.L;else{if(!((r=o-ZE(s,a))>iM)){i>-iM?(e=s.P,n=s):r>-iM?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}!function(t){tM[t.index]={site:t,halfedges:[]}}(t);var l=YE(t);if(QE.insert(e,l),e||n){if(e===n)return GE(e),n=YE(e.site),QE.insert(l,n),l.edge=n.edge=PE(e.site,l.site),VE(e),void VE(n);if(n){GE(e),GE(n);var u=e.site,c=u[0],h=u[1],d=t[0]-c,p=t[1]-h,f=n.site,g=f[0]-c,m=f[1]-h,b=2*(d*m-p*g),v=d*d+p*p,y=g*g+m*m,w=[(m*v-p*y)/b+c,(d*y-g*v)/b+h];OE(n.edge,u,f,w),l.edge=PE(u,t,null,w),n.edge=PE(t,f,null,w),VE(e),VE(n)}else l.edge=PE(e.site,l.site)}}function JE(t,e){var n=t.site,i=n[0],r=n[1],o=r-e;if(!o)return i;var a=t.P;if(!a)return-1/0;var s=(n=a.site)[0],l=n[1],u=l-e;if(!u)return s;var c=s-i,h=1/o-1/u,d=c/u;return h?(-d+Math.sqrt(d*d-2*h*(c*c/(-2*u)-l+u/2+r-o/2)))/h+i:(i+s)/2}function ZE(t,e){var n=t.N;if(n)return JE(n,e);var i=t.site;return i[1]===e?i[0]:1/0}var QE,tM,eM,nM,iM=1e-6,rM=1e-12;function oM(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function aM(t,e){return e[1]-t[1]||e[0]-t[0]}function sM(t,e){var n,i,r,o=t.sort(aM).pop();for(nM=[],tM=new Array(t.length),QE=new SE,eM=new SE;;)if(r=HE,o&&(!r||o[1]iM||Math.abs(r[0][1]-r[1][1])>iM)||delete nM[o]}(a,s,l,u),function(t,e,n,i){var r,o,a,s,l,u,c,h,d,p,f,g,m=tM.length,b=!0;for(r=0;riM||Math.abs(g-d)>iM)&&(l.splice(s,0,nM.push(LE(a,p,Math.abs(f-t)iM?[t,Math.abs(h-t)iM?[Math.abs(d-i)iM?[n,Math.abs(h-n)iM?[Math.abs(d-e)=s)return null;var l=t-r.site[0],u=e-r.site[1],c=l*l+u*u;do{r=o.cells[i=a],a=null,r.halfedges.forEach((function(n){var i=o.edges[n],s=i.left;if(s!==r.site&&s||(s=i.right)){var l=t-s[0],u=e-s[1],h=l*l+u*u;hi?(i+r)/2:Math.min(0,i)||Math.max(0,r),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function DM(){var t,e,n=CM,i=xM,r=kM,o=MM,a=TM,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,c=fM,h=[],d=gt("start","zoom","end"),p=500,f=150,g=0;function m(t){t.property("__zoom",EM).on("wheel.zoom",x).on("mousedown.zoom",E).on("dblclick.zoom",M).filter(a).on("touchstart.zoom",T).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",D).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new bM(e,t.x,t.y)}function v(t,e,n){var i=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return i===t.x&&r===t.y?t:new bM(t.k,i,r)}function y(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n){t.on("start.zoom",(function(){_(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){_(this,arguments).end()})).tween("zoom",(function(){var t=this,r=arguments,o=_(t,r),a=i.apply(t,r),s=n||y(a),l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=t.__zoom,h="function"==typeof e?e.apply(t,r):e,d=c(u.invert(s).concat(l/u.k),h.invert(s).concat(l/h.k));return function(t){if(1===t)t=h;else{var e=d(t),n=l/e[2];t=new bM(n,s[0]-e[0]*n,s[1]-e[1]*n)}o.zoom(null,t)}}))}function _(t,e){for(var n,i=0,r=h.length;ig}t.zoom("mouse",r(v(t.that.__zoom,t.mouse[0]=Mt(t.that),t.mouse[1]),t.extent,l))}),!0).on("mouseup.zoom",(function(){i.on("mousemove.zoom mouseup.zoom",null),Oe(bt.view,t.moved),_M(),t.end()}),!0),o=Mt(this),a=bt.clientX,s=bt.clientY;Le(bt.view),wM(),t.mouse=[o,this.__zoom.invert(o)],pi(this),t.start()}}function M(){if(n.apply(this,arguments)){var t=this.__zoom,e=Mt(this),o=t.invert(e),a=t.k*(bt.shiftKey?.5:2),s=r(v(b(t,a),e,o),i.apply(this,arguments),l);_M(),u>0?Ae(this).transition().duration(u).call(w,s,e):Ae(this).call(m.transform,s)}}function T(){if(n.apply(this,arguments)){var e,i,r,o,a=_(this,arguments),s=bt.changedTouches,l=s.length;for(wM(),i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.METADATA_KEY={provide:"inversify-binding-decorators:provide"}},941:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(4147),r=n(6175),o=n(2472),a=n(1902),s=n(1151);e.default=function(t){var e=function(e,n){return e(t).to(n)},n=new s.default((function(t,n){return e(t,n)._binding}));return new i.default(new a.default((function(t,n){return e(t,n)}),n),new r.default(e,n),new o.default(e,n))}},8044:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1519),r=n(5906);e.default=function(t,e){return function(n){var o=Reflect.hasOwnMetadata(i.METADATA_KEY.PARAM_TYPES,n),a=!0===e;if(!0===a&&!1===o)i.decorate(i.injectable(),n);else if(!0===a&&!0===o);else try{i.decorate(i.injectable(),n)}catch(t){throw new Error("Cannot apply @provide decorator multiple times but is has been used multiple times in "+n.name+" Please use @provide(ID, true) if you are trying to declare multiple bindings!")}var s={constraint:function(e,n){return e(t).to(n)},implementationType:n},l=Reflect.getMetadata(r.METADATA_KEY.provide,Reflect)||[],u=[s].concat(l);return Reflect.defineMetadata(r.METADATA_KEY.provide,u,Reflect),n}}},4069:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(5906),r=n(1519);e.default=function(){return new r.ContainerModule((function(t,e){(Reflect.getMetadata(i.METADATA_KEY.provide,Reflect)||[]).map((function(e){return function(t,e){return t.constraint(e,t.implementationType)}(e,t)}))}))}},5567:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(9080);e.autoProvide=i.default;var r=n(8044);e.provide=r.default;var o=n(941);e.fluentProvide=o.default;var a=n(4069);e.buildProviderModule=a.default},1151:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1519),r=n(1519),o=n(5906),a=function(){function t(t){this._binding=t}return t.prototype.done=function(t){var e=this;return function(n){var a=Reflect.hasOwnMetadata(r.METADATA_KEY.PARAM_TYPES,n),s=!0===t;if(!0===s&&!1===a)i.decorate(i.injectable(),n);else if(!0===s&&!0===a);else try{i.decorate(i.injectable(),n)}catch(t){throw new Error("Cannot apply @provideFluent decorator multiple times but is has been used multiple times in "+n.name+" Please use done(true) if you are trying to declare multiple bindings!")}var l={constraint:e._binding,implementationType:n},u=Reflect.getMetadata(o.METADATA_KEY.provide,Reflect)||[],c=[l].concat(u);return Reflect.defineMetadata(o.METADATA_KEY.provide,c,Reflect),n}},t}();e.default=a},1902:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2303),r=n(6175),o=n(2472),a=n(1151),s=function(){function t(t,e){this._bindingInSyntax=t,this._provideDoneSyntax=e}return t.prototype.inSingletonScope=function(){var t=this,e=function(e,n){return t._bindingInSyntax(e,n).inSingletonScope()},n=new a.default(e),s=new r.default(e,n),l=new o.default(e,n);return new i.default(s,l)},t.prototype.inTransientScope=function(){var t=this,e=function(e,n){return t._bindingInSyntax(e,n).inTransientScope()},n=new a.default(e),s=new r.default(e,n),l=new o.default(e,n);return new i.default(s,l)},t.prototype.done=function(t){return this._provideDoneSyntax.done(t)},t}();e.default=s},4147:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,n){this._provideInSyntax=t,this._provideWhenSyntax=e,this._provideOnSyntax=n}return t.prototype.when=function(t){return this._provideWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._provideWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetTagged=function(t,e){return this._provideWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._provideWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._provideWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._provideWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._provideWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._provideWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._provideWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._provideWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._provideWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._provideWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._provideWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._provideWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._provideOnSyntax.onActivation(t)},t.prototype.inSingletonScope=function(){return this._provideInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._provideInSyntax.inTransientScope()},t.prototype.done=function(t){return this._provideInSyntax.done(t)},t}();e.default=n},2472:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(6175),r=n(1151),o=function(){function t(t,e){this._bindingOnSyntax=t,this._provideDoneSyntax=e}return t.prototype.onActivation=function(t){var e=this,n=function(n,i){return e._bindingOnSyntax(n,i).onActivation(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.done=function(t){return this._provideDoneSyntax.done(t)},t}();e.default=o},2303:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this._provideWhenSyntax=t,this._provideOnSyntax=e}return t.prototype.when=function(t){return this._provideWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._provideWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetTagged=function(t,e){return this._provideWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._provideWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._provideWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._provideWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._provideWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._provideWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._provideWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._provideWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._provideWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._provideWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._provideWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._provideWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._provideOnSyntax.onActivation(t)},t.prototype.done=function(t){return this._provideWhenSyntax.done(t)},t}();e.default=n},6175:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2472),r=n(1151),o=function(){function t(t,e){this._bindingWhenSyntax=t,this._provideDoneSyntax=e}return t.prototype.when=function(t){var e=this,n=function(n,i){return e._bindingWhenSyntax(n,i).when(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.whenTargetNamed=function(t){var e=this,n=function(n,i){return e._bindingWhenSyntax(n,i).whenTargetNamed(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.whenTargetTagged=function(t,e){var n=this,o=function(i,r){return n._bindingWhenSyntax(i,r).whenTargetTagged(t,e)},a=new r.default(o);return new i.default(o,a)},t.prototype.whenInjectedInto=function(t){var e=this,n=function(n,i){return e._bindingWhenSyntax(n,i).whenInjectedInto(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.whenParentNamed=function(t){var e=this,n=function(n,i){return e._bindingWhenSyntax(n,i).whenParentNamed(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.whenParentTagged=function(t,e){var n=this,o=function(i,r){return n._bindingWhenSyntax(i,r).whenParentTagged(t,e)},a=new r.default(o);return new i.default(o,a)},t.prototype.whenAnyAncestorIs=function(t){var e=this,n=function(n,i){return e._bindingWhenSyntax(n,i).whenAnyAncestorIs(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.whenNoAncestorIs=function(t){var e=this,n=function(n,i){return e._bindingWhenSyntax(n,i).whenNoAncestorIs(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.whenAnyAncestorNamed=function(t){var e=this,n=function(n,i){return e._bindingWhenSyntax(n,i).whenAnyAncestorNamed(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.whenAnyAncestorTagged=function(t,e){var n=this,o=function(i,r){return n._bindingWhenSyntax(i,r).whenAnyAncestorTagged(t,e)},a=new r.default(o);return new i.default(o,a)},t.prototype.whenNoAncestorNamed=function(t){var e=this,n=function(n,i){return e._bindingWhenSyntax(n,i).whenNoAncestorNamed(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.whenNoAncestorTagged=function(t,e){var n=this,o=function(i,r){return n._bindingWhenSyntax(i,r).whenNoAncestorTagged(t,e)},a=new r.default(o);return new i.default(o,a)},t.prototype.whenAnyAncestorMatches=function(t){var e=this,n=function(n,i){return e._bindingWhenSyntax(n,i).whenAnyAncestorMatches(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.whenNoAncestorMatches=function(t){var e=this,n=function(n,i){return e._bindingWhenSyntax(n,i).whenNoAncestorMatches(t)},o=new r.default(n);return new i.default(n,o)},t.prototype.done=function(t){return this._provideDoneSyntax.done(t)},t}();e.default=o},9080:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1519),r=n(8044);e.default=function(t){for(var e=[],n=1;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0;var i=n(5507),r=n(2006);function o(t,e,n,r,o){var a={},s="number"==typeof o,l=void 0!==o&&s?o.toString():n;if(s&&void 0!==n)throw new Error(i.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(a=Reflect.getMetadata(t,e));var u=a[l];if(Array.isArray(u))for(var c=0,h=u;c{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var i=n(5507),r=n(2006),o=n(4425),a=n(4157),s=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=s,e.inject=function(t){return function(e,n,s){if(void 0===t)throw new Error(i.UNDEFINED_INJECT_ANNOTATION(e.name));var l=new o.Metadata(r.INJECT_TAG,t);"number"==typeof s?a.tagParameter(e,n,s,l):a.tagProperty(e,n,l)}}},9925:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var i=n(5507),r=n(2006);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(r.PARAM_TYPES,t))throw new Error(i.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(r.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(r.PARAM_TYPES,e,t),t}}},3655:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var i=n(2006),r=n(4425),o=n(4157);e.multiInject=function(t){return function(e,n,a){var s=new r.Metadata(i.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},1555:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var i=n(2006),r=n(4425),o=n(4157);e.named=function(t){return function(e,n,a){var s=new r.Metadata(i.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},5136:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var i=n(2006),r=n(4425),o=n(4157);e.optional=function(){return function(t,e,n){var a=new r.Metadata(i.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},3380:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var i=n(5507),r=n(2006),o=n(4425);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(r.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(r.POST_CONSTRUCT,t.constructor))throw new Error(i.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(r.POST_CONSTRUCT,a,t.constructor)}}},8928:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var i=n(4425),r=n(4157);e.tagged=function(t,e){return function(n,o,a){var s=new i.Metadata(t,e);"number"==typeof a?r.tagParameter(n,o,a,s):r.tagProperty(n,o,s)}}},375:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var i=n(2006),r=n(4425),o=n(4157);e.targetName=function(t){return function(e,n,a){var s=new r.Metadata(i.NAME_TAG,t);o.tagParameter(e,n,a,s)}}},958:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var i=n(2006),r=n(4425),o=n(4157);e.unmanaged=function(){return function(t,e,n){var a=new r.Metadata(i.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},3684:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var i=n(7801),r=n(8615),o=function(){function t(t,e){this.id=r.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=i.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===i.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=o},1372:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0,e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}},5507:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;e= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0,e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"},e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},2006:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]},3389:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var i=n(8615);e.ContainerModule=function(t){this.id=i.id(),this.registry=t};e.AsyncContainerModule=function(t){this.id=i.id(),this.registry=t}},5900:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var i=new t;return i.bindings=e,i.middleware=n,i},t}();e.ContainerSnapshot=n},9378:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var i=n(5507),r=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(i.NULL_ARGUMENT);if(null==e)throw new Error(i.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(i.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(i.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(i.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(i.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,i){var r=n.filter((function(e){return!t(e)}));r.length>0?e._map.set(i,r):e._map.delete(i)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(i.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=r},1519:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=e.getServiceIdentifierAsString=e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=e.decorate=e.id=e.MetadataReader=e.postConstruct=e.targetName=e.multiInject=e.unmanaged=e.optional=e.LazyServiceIdentifer=e.inject=e.named=e.tagged=e.injectable=e.ContainerModule=e.AsyncContainerModule=e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=e.Container=e.METADATA_KEY=void 0;var i=n(2006);e.METADATA_KEY=i;var r=n(3389);Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return r.Container}});var o=n(7801);Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return o.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return o.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return o.TargetTypeEnum}});var a=n(9872);Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return a.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return a.ContainerModule}});var s=n(9925);Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return s.injectable}});var l=n(8928);Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return l.tagged}});var u=n(1555);Object.defineProperty(e,"named",{enumerable:!0,get:function(){return u.named}});var c=n(8825);Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return c.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return c.LazyServiceIdentifer}});var h=n(5136);Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return h.optional}});var d=n(958);Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return d.unmanaged}});var p=n(3655);Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return p.multiInject}});var f=n(375);Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return f.targetName}});var g=n(3380);Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return g.postConstruct}});var m=n(7339);Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return m.MetadataReader}});var b=n(8615);Object.defineProperty(e,"id",{enumerable:!0,get:function(){return b.id}});var v=n(4157);Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return v.decorate}});var y=n(795);Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return y.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return y.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return y.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return y.typeConstraint}});var w=n(2172);Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return w.getServiceIdentifierAsString}});var _=n(3447);Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return _.multiBindToService}})},1077:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var i=n(8615),r=function(){function t(t){this.id=i.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=r},4425:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var i=n(2006),r=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===i.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=r},7339:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var i=n(2006),r=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(i.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(i.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(i.TAGGED_PROP,t)||[]},t}();e.MetadataReader=r},6811:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0;e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}},7322:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0;var i=n(1372),r=n(5507),o=n(7801),a=n(2006),s=n(6596),l=n(2172),u=n(1077),c=n(4425),h=n(6811),d=n(5643),p=n(3747),f=n(57);function g(t){return t._bindingDictionary}function m(t,e,n,o,a){var s,u=v(n.container,a.serviceIdentifier);return u.length===i.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof a.serviceIdentifier&&t.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),u=v(n.container,a.serviceIdentifier)),s=e?u:u.filter((function(t){var e=new p.Request(t.serviceIdentifier,n,o,t,a);return t.constraint(e)})),function(t,e,n,o){switch(e.length){case i.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var a=l.getServiceIdentifierAsString(t),s=r.NOT_REGISTERED;throw s+=l.listMetadataForTarget(a,n),s+=l.listRegisteredBindingsForServiceIdentifier(o,a,v),new Error(s);case i.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;case i.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return e;throw a=l.getServiceIdentifierAsString(t),s=r.AMBIGUOUS_MATCH+" "+a,s+=l.listRegisteredBindingsForServiceIdentifier(o,a,v),new Error(s)}}(a.serviceIdentifier,s,a,n.container),s}function b(t,e,n,i,a,s){var l,u;if(null===a){l=m(t,e,i,null,s),u=new p.Request(n,i,null,l,s);var c=new h.Plan(i,u);i.addPlan(c)}else l=m(t,e,i,a,s),u=a.addChildRequest(s.serviceIdentifier,l,s);l.forEach((function(e){var n=null;if(s.isArray())n=u.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;n=u}if(e.type===o.BindingTypeEnum.Instance&&null!==e.implementationType){var a=d.getDependencies(t,e.implementationType);if(!i.container.options.skipBaseClassChecks){var l=d.getBaseClassDependencyCount(t,e.implementationType);if(a.length{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=n},5643:function(t,e,n){"use strict";var i=this&&this.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;n0,f=c.length>n.length,g=function(t,e,n,i,r){for(var o=[],a=0;a0?u:t(e,i)}return 0}},3747:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var i=n(8615),r=function(){function t(t,e,n,r,o){this.id=i.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(r)?r:[r],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,i){var r=new t(e,this.parentContext,this,n,i);return this.childRequests.push(r),r},t}();e.Request=r},57:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var i=n(2006),r=n(8615),o=n(4425),a=n(1120),s=function(){function t(t,e,n,s){this.id=r.id(),this.type=t,this.serviceIdentifier=n,this.name=new a.QueryableString(e||""),this.metadata=new Array;var l=null;"string"==typeof s?l=new o.Metadata(i.NAMED_TAG,s):s instanceof o.Metadata&&(l=s),null!==l&&this.metadata.push(l)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e0?(l=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n),u=function(t,e,n){var i=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ClassProperty})),r=i.map(n);return i.forEach((function(e,n){var i;i=e.target.name.value();var o=r[n];t[i]=o})),t}(u=new((s=t).bind.apply(s,i([void 0],l))),e,n)):u=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(r.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,u),u}},4051:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var i=n(5507),r=n(7801),o=n(6596),a=n(2172),s=n(1752),l=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(i.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},u=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,o=e.childRequests,c=e.target&&e.target.isArray(),h=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(c&&h)return o.map((function(e){return u(t)(e)}));var d=null;if(!e.target.isOptional()||0!==n.length){var p=n[0],f=p.scope===r.BindingScopeEnum.Singleton,g=p.scope===r.BindingScopeEnum.Request;if(f&&p.activated)return p.cache;if(g&&null!==t&&t.has(p.id))return t.get(p.id);if(p.type===r.BindingTypeEnum.ConstantValue)d=p.cache,p.activated=!0;else if(p.type===r.BindingTypeEnum.Function)d=p.cache,p.activated=!0;else if(p.type===r.BindingTypeEnum.Constructor)d=p.implementationType;else if(p.type===r.BindingTypeEnum.DynamicValue&&null!==p.dynamicValue)d=l("toDynamicValue",p.serviceIdentifier,(function(){return p.dynamicValue(e.parentContext)}));else if(p.type===r.BindingTypeEnum.Factory&&null!==p.factory)d=l("toFactory",p.serviceIdentifier,(function(){return p.factory(e.parentContext)}));else if(p.type===r.BindingTypeEnum.Provider&&null!==p.provider)d=l("toProvider",p.serviceIdentifier,(function(){return p.provider(e.parentContext)}));else{if(p.type!==r.BindingTypeEnum.Instance||null===p.implementationType){var m=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(i.INVALID_BINDING_TYPE+" "+m)}d=s.resolveInstance(p.implementationType,o,u(t))}return"function"==typeof p.onActivation&&(d=p.onActivation(e.parentContext,d)),f&&(p.cache=d,p.activated=!0),g&&null!==t&&!t.has(p.id)&&t.set(p.id,d),d}}};e.resolve=function(t){return u(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},4501:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var i=n(7801),r=n(3334),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=i.BindingScopeEnum.Request,new r.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=i.BindingScopeEnum.Singleton,new r.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=i.BindingScopeEnum.Transient,new r.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},4076:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var i=n(4501),r=n(2903),o=n(6744),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding),this._bindingInSyntax=new i.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},2903:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var i=n(6744),r=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new i.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=r},1415:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var i=n(5507),r=n(7801),o=n(4076),a=n(3334),s=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=r.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+i.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=r.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=r.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=r.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=r.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=r.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=r.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=r.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(i.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=r.BindingTypeEnum.Function,this._binding.scope=r.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=r.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=r.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=r.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=r.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=s},3334:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var i=n(2903),r=n(6744),o=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new r.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=o},6744:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var i=n(2903),r=n(795),o=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new i.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=r.namedConstraint(t),new i.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new i.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=r.taggedConstraint(t)(e),new i.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return r.typeConstraint(t)(e.parentRequest)},new i.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return r.namedConstraint(t)(e.parentRequest)},new i.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return r.taggedConstraint(t)(e)(n.parentRequest)},new i.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return r.traverseAncerstors(e,r.typeConstraint(t))},new i.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!r.traverseAncerstors(e,r.typeConstraint(t))},new i.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return r.traverseAncerstors(e,r.namedConstraint(t))},new i.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!r.traverseAncerstors(e,r.namedConstraint(t))},new i.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return r.traverseAncerstors(n,r.taggedConstraint(t)(e))},new i.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!r.traverseAncerstors(n,r.taggedConstraint(t)(e))},new i.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return r.traverseAncerstors(e,t)},new i.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!r.traverseAncerstors(e,t)},new i.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=o},795:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var i=n(2006),r=n(4425),o=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||o(n,e))};e.traverseAncerstors=o;var a=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new r.Metadata(t,e),n}};e.taggedConstraint=a;var s=a(i.NAMED_TAG);e.namedConstraint=s,e.typeConstraint=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var i=e.bindings[0].implementationType;return t===i}return!1}}},3447:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0,e.multiBindToService=function(t){return function(e){return function(){for(var n=[],i=0;i{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0;var i=n(5507);e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===i.STACK_OVERFLOW}},8615:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}},2172:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0;var i=n(5507);function r(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function o(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||o(t.parentRequest,e))}function a(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}e.getServiceIdentifierAsString=r,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var i="",r=n(t,e);return 0!==r.length&&(i="\nRegistered bindings:",r.forEach((function(t){var e="Object";null!==t.implementationType&&(e=a(t.implementationType)),i=i+"\n "+e,t.constraint.metaData&&(i=i+" - "+t.constraint.metaData)}))),i},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(o(e,e.serviceIdentifier)){var n=function(t){return function t(e,n){void 0===n&&(n=[]);var i=r(e.serviceIdentifier);return n.push(i),null!==e.parentRequest?t(e.parentRequest,n):n}(t).reverse().join(" --\x3e ")}(e);throw new Error(i.CIRCULAR_DEPENDENCY+" "+n)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",i=e.getNamedTag(),r=e.getCustomTags();return null!==i&&(n+=i.toString()+"\n"),null!==r&&r.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=a},2543:function(t,e,n){var i;t=n.nmd(t),function(){var r,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=32,u=128,c=1/0,h=9007199254740991,d=NaN,p=4294967295,f=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],g="[object Arguments]",m="[object Array]",b="[object Boolean]",v="[object Date]",y="[object Error]",w="[object Function]",_="[object GeneratorFunction]",C="[object Map]",x="[object Number]",E="[object Object]",M="[object Promise]",T="[object RegExp]",k="[object Set]",D="[object String]",A="[object Symbol]",R="[object WeakMap]",S="[object ArrayBuffer]",P="[object DataView]",L="[object Float32Array]",O="[object Float64Array]",F="[object Int8Array]",z="[object Int16Array]",B="[object Int32Array]",N="[object Uint8Array]",I="[object Uint8ClampedArray]",H="[object Uint16Array]",j="[object Uint32Array]",W=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,Y=RegExp(U.source),K=RegExp(q.source),X=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),it=/^\s+/,rt=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,pt=/^[-+]0x[0-9a-f]+$/i,ft=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,bt=/^(?:0|[1-9]\d*)$/,vt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,_t="\\ud800-\\udfff",Ct="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",Mt="A-Z\\xc0-\\xd6\\xd8-\\xde",Tt="\\ufe0e\\ufe0f",kt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Dt="["+_t+"]",At="["+kt+"]",Rt="["+Ct+"]",St="\\d+",Pt="["+xt+"]",Lt="["+Et+"]",Ot="[^"+_t+kt+St+xt+Et+Mt+"]",Ft="\\ud83c[\\udffb-\\udfff]",zt="[^"+_t+"]",Bt="(?:\\ud83c[\\udde6-\\uddff]){2}",Nt="[\\ud800-\\udbff][\\udc00-\\udfff]",It="["+Mt+"]",Ht="\\u200d",jt="(?:"+Lt+"|"+Ot+")",Wt="(?:"+It+"|"+Ot+")",Vt="(?:['’](?:d|ll|m|re|s|t|ve))?",Gt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ut="(?:"+Rt+"|"+Ft+")?",qt="["+Tt+"]?",Yt=qt+Ut+"(?:"+Ht+"(?:"+[zt,Bt,Nt].join("|")+")"+qt+Ut+")*",Kt="(?:"+[Pt,Bt,Nt].join("|")+")"+Yt,Xt="(?:"+[zt+Rt+"?",Rt,Bt,Nt,Dt].join("|")+")",$t=RegExp("['’]","g"),Jt=RegExp(Rt,"g"),Zt=RegExp(Ft+"(?="+Ft+")|"+Xt+Yt,"g"),Qt=RegExp([It+"?"+Lt+"+"+Vt+"(?="+[At,It,"$"].join("|")+")",Wt+"+"+Gt+"(?="+[At,It+jt,"$"].join("|")+")",It+"?"+jt+"+"+Vt,It+"+"+Gt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",St,Kt].join("|"),"g"),te=RegExp("["+Ht+_t+Ct+Tt+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,re={};re[L]=re[O]=re[F]=re[z]=re[B]=re[N]=re[I]=re[H]=re[j]=!0,re[g]=re[m]=re[S]=re[b]=re[P]=re[v]=re[y]=re[w]=re[C]=re[x]=re[E]=re[T]=re[k]=re[D]=re[R]=!1;var oe={};oe[g]=oe[m]=oe[S]=oe[P]=oe[b]=oe[v]=oe[L]=oe[O]=oe[F]=oe[z]=oe[B]=oe[C]=oe[x]=oe[E]=oe[T]=oe[k]=oe[D]=oe[A]=oe[N]=oe[I]=oe[H]=oe[j]=!0,oe[y]=oe[w]=oe[R]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},se=parseFloat,le=parseInt,ue="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ce="object"==typeof self&&self&&self.Object===Object&&self,he=ue||ce||Function("return this")(),de=e&&!e.nodeType&&e,pe=de&&t&&!t.nodeType&&t,fe=pe&&pe.exports===de,ge=fe&&ue.process,me=function(){try{return pe&&pe.require&&pe.require("util").types||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),be=me&&me.isArrayBuffer,ve=me&&me.isDate,ye=me&&me.isMap,we=me&&me.isRegExp,_e=me&&me.isSet,Ce=me&&me.isTypedArray;function xe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ee(t,e,n,i){for(var r=-1,o=null==t?0:t.length;++r-1}function Re(t,e,n){for(var i=-1,r=null==t?0:t.length;++i-1;);return n}function Qe(t,e){for(var n=t.length;n--&&Ie(e,t[n],0)>-1;);return n}var tn=Ge({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),en=Ge({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(t){return"\\"+ae[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}function an(t,e){return function(n){return t(e(n))}}function sn(t,e){for(var n=-1,i=t.length,r=0,o=[];++n",""":'"',"'":"'"}),fn=function t(e){var n,i=(e=null==e?he:fn.defaults(he.Object(),e,fn.pick(he,ne))).Array,rt=e.Date,_t=e.Error,Ct=e.Function,xt=e.Math,Et=e.Object,Mt=e.RegExp,Tt=e.String,kt=e.TypeError,Dt=i.prototype,At=Ct.prototype,Rt=Et.prototype,St=e["__core-js_shared__"],Pt=At.toString,Lt=Rt.hasOwnProperty,Ot=0,Ft=(n=/[^.]+$/.exec(St&&St.keys&&St.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",zt=Rt.toString,Bt=Pt.call(Et),Nt=he._,It=Mt("^"+Pt.call(Lt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ht=fe?e.Buffer:r,jt=e.Symbol,Wt=e.Uint8Array,Vt=Ht?Ht.allocUnsafe:r,Gt=an(Et.getPrototypeOf,Et),Ut=Et.create,qt=Rt.propertyIsEnumerable,Yt=Dt.splice,Kt=jt?jt.isConcatSpreadable:r,Xt=jt?jt.iterator:r,Zt=jt?jt.toStringTag:r,te=function(){try{var t=lo(Et,"defineProperty");return t({},"",{}),t}catch(t){}}(),ae=e.clearTimeout!==he.clearTimeout&&e.clearTimeout,ue=rt&&rt.now!==he.Date.now&&rt.now,ce=e.setTimeout!==he.setTimeout&&e.setTimeout,de=xt.ceil,pe=xt.floor,ge=Et.getOwnPropertySymbols,me=Ht?Ht.isBuffer:r,ze=e.isFinite,Ge=Dt.join,gn=an(Et.keys,Et),mn=xt.max,bn=xt.min,vn=rt.now,yn=e.parseInt,wn=xt.random,_n=Dt.reverse,Cn=lo(e,"DataView"),xn=lo(e,"Map"),En=lo(e,"Promise"),Mn=lo(e,"Set"),Tn=lo(e,"WeakMap"),kn=lo(Et,"create"),Dn=Tn&&new Tn,An={},Rn=Bo(Cn),Sn=Bo(xn),Pn=Bo(En),Ln=Bo(Mn),On=Bo(Tn),Fn=jt?jt.prototype:r,zn=Fn?Fn.valueOf:r,Bn=Fn?Fn.toString:r;function Nn(t){if(ts(t)&&!Va(t)&&!(t instanceof Wn)){if(t instanceof jn)return t;if(Lt.call(t,"__wrapped__"))return No(t)}return new jn(t)}var In=function(){function t(){}return function(e){if(!Qa(e))return{};if(Ut)return Ut(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function Hn(){}function jn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function ai(t,e,n,i,o,a){var s,l=1&e,u=2&e,c=4&e;if(n&&(s=o?n(t,i,o,a):n(t)),s!==r)return s;if(!Qa(t))return t;var h=Va(t);if(h){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return Tr(t,s)}else{var d=ho(t),p=d==w||d==_;if(Ya(t))return wr(t,l);if(d==E||d==g||p&&!o){if(s=u||p?{}:fo(t),!l)return u?function(t,e){return kr(t,co(t),e)}(t,function(t,e){return t&&kr(e,Ss(e),t)}(s,t)):function(t,e){return kr(t,uo(t),e)}(t,ni(s,t))}else{if(!oe[d])return o?t:{};s=function(t,e,n){var i,r=t.constructor;switch(e){case S:return _r(t);case b:case v:return new r(+t);case P:return function(t,e){var n=e?_r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case L:case O:case F:case z:case B:case N:case I:case H:case j:return Cr(t,n);case C:return new r;case x:case D:return new r(t);case T:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case k:return new r;case A:return i=t,zn?Et(zn.call(i)):{}}}(t,d,l)}}a||(a=new Yn);var f=a.get(t);if(f)return f;a.set(t,s),os(t)?t.forEach((function(i){s.add(ai(i,e,n,i,t,a))})):es(t)&&t.forEach((function(i,r){s.set(r,ai(i,e,n,r,t,a))}));var m=h?r:(c?u?eo:to:u?Ss:Rs)(t);return Me(m||t,(function(i,r){m&&(i=t[r=i]),Qn(s,r,ai(i,e,n,r,t,a))})),s}function si(t,e,n){var i=n.length;if(null==t)return!i;for(t=Et(t);i--;){var o=n[i],a=e[o],s=t[o];if(s===r&&!(o in t)||!a(s))return!1}return!0}function li(t,e,n){if("function"!=typeof t)throw new kt(o);return Do((function(){t.apply(r,n)}),e)}function ui(t,e,n,i){var r=-1,o=Ae,a=!0,s=t.length,l=[],u=e.length;if(!s)return l;n&&(e=Se(e,Xe(n))),i?(o=Re,a=!1):e.length>=200&&(o=Je,a=!1,e=new qn(e));t:for(;++r-1},Gn.prototype.set=function(t,e){var n=this.__data__,i=ti(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this},Un.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(xn||Gn),string:new Vn}},Un.prototype.delete=function(t){var e=ao(this,t).delete(t);return this.size-=e?1:0,e},Un.prototype.get=function(t){return ao(this,t).get(t)},Un.prototype.has=function(t){return ao(this,t).has(t)},Un.prototype.set=function(t,e){var n=ao(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},qn.prototype.add=qn.prototype.push=function(t){return this.__data__.set(t,a),this},qn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Gn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Gn){var i=n.__data__;if(!xn||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Un(i)}return n.set(t,e),this.size=n.size,this};var ci=Rr(vi),hi=Rr(yi,!0);function di(t,e){var n=!0;return ci(t,(function(t,i,r){return n=!!e(t,i,r)})),n}function pi(t,e,n){for(var i=-1,o=t.length;++i0&&n(s)?e>1?gi(s,e-1,n,i,r):Pe(r,s):i||(r[r.length]=s)}return r}var mi=Sr(),bi=Sr(!0);function vi(t,e){return t&&mi(t,e,Rs)}function yi(t,e){return t&&bi(t,e,Rs)}function wi(t,e){return De(e,(function(e){return $a(t[e])}))}function _i(t,e){for(var n=0,i=(e=mr(e,t)).length;null!=t&&ne}function Mi(t,e){return null!=t&&Lt.call(t,e)}function Ti(t,e){return null!=t&&e in Et(t)}function ki(t,e,n){for(var o=n?Re:Ae,a=t[0].length,s=t.length,l=s,u=i(s),c=1/0,h=[];l--;){var d=t[l];l&&e&&(d=Se(d,Xe(e))),c=bn(d.length,c),u[l]=!n&&(e||a>=120&&d.length>=120)?new qn(l&&d):r}d=t[0];var p=-1,f=u[0];t:for(;++p=s?l:l*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,n)}));i--;)t[i]=t[i].value;return t}(r)}function Wi(t,e,n){for(var i=-1,r=e.length,o={};++i-1;)s!==t&&Yt.call(s,l,1),Yt.call(t,l,1);return t}function Gi(t,e){for(var n=t?e.length:0,i=n-1;n--;){var r=e[n];if(n==i||r!==o){var o=r;mo(r)?Yt.call(t,r,1):lr(t,r)}}return t}function Ui(t,e){return t+pe(wn()*(e-t+1))}function qi(t,e){var n="";if(!t||e<1||e>h)return n;do{e%2&&(n+=t),(e=pe(e/2))&&(t+=t)}while(e);return n}function Yi(t,e){return Ao(Eo(t,e,nl),t+"")}function Ki(t){return Xn(Is(t))}function Xi(t,e){var n=Is(t);return Po(n,oi(e,0,n.length))}function $i(t,e,n,i){if(!Qa(t))return t;for(var o=-1,a=(e=mr(e,t)).length,s=a-1,l=t;null!=l&&++oo?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=i(o);++r>>1,a=t[o];null!==a&&!ss(a)&&(n?a<=e:a=200){var u=e?null:qr(t);if(u)return ln(u);a=!1,r=Je,l=new qn}else l=e?[]:s;t:for(;++i=i?t:tr(t,e,n)}var yr=ae||function(t){return he.clearTimeout(t)};function wr(t,e){if(e)return t.slice();var n=t.length,i=Vt?Vt(n):new t.constructor(n);return t.copy(i),i}function _r(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Cr(t,e){var n=e?_r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function xr(t,e){if(t!==e){var n=t!==r,i=null===t,o=t==t,a=ss(t),s=e!==r,l=null===e,u=e==e,c=ss(e);if(!l&&!c&&!a&&t>e||a&&s&&u&&!l&&!c||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!c&&t1?n[o-1]:r,s=o>2?n[2]:r;for(a=t.length>3&&"function"==typeof a?(o--,a):r,s&&bo(n[0],n[1],s)&&(a=o<3?r:a,o=1),e=Et(e);++i-1?o[a?e[s]:s]:r}}function zr(t){return Qr((function(e){var n=e.length,i=n,a=jn.prototype.thru;for(t&&e.reverse();i--;){var s=e[i];if("function"!=typeof s)throw new kt(o);if(a&&!l&&"wrapper"==io(s))var l=new jn([],!0)}for(i=l?i:n;++i1&&w.reverse(),p&&hl))return!1;var c=a.get(t),h=a.get(e);if(c&&h)return c==e&&h==t;var d=-1,p=!0,f=2&n?new qn:r;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(ot,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Me(f,(function(n){var i="_."+n[0];e&n[1]&&!Ae(t,i)&&t.push(i)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(st):[]}(i),n)))}function So(t){var e=0,n=0;return function(){var i=vn(),o=16-(i-n);if(n=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Po(t,e){var n=-1,i=t.length,o=i-1;for(e=e===r?i:e;++n1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,ra(t,n)}));function ha(t){var e=Nn(t);return e.__chain__=!0,e}function da(t,e){return e(t)}var pa=Qr((function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,o=function(e){return ri(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Wn&&mo(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:da,args:[o],thisArg:r}),new jn(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(r),t}))):this.thru(o)})),fa=Dr((function(t,e,n){Lt.call(t,n)?++t[n]:ii(t,n,1)})),ga=Fr(Wo),ma=Fr(Vo);function ba(t,e){return(Va(t)?Me:ci)(t,oo(e,3))}function va(t,e){return(Va(t)?Te:hi)(t,oo(e,3))}var ya=Dr((function(t,e,n){Lt.call(t,n)?t[n].push(e):ii(t,n,[e])})),wa=Yi((function(t,e,n){var r=-1,o="function"==typeof e,a=Ua(t)?i(t.length):[];return ci(t,(function(t){a[++r]=o?xe(e,t,n):Di(t,e,n)})),a})),_a=Dr((function(t,e,n){ii(t,n,e)}));function Ca(t,e){return(Va(t)?Se:zi)(t,oo(e,3))}var xa=Dr((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ea=Yi((function(t,e){if(null==t)return[];var n=e.length;return n>1&&bo(t,e[0],e[1])?e=[]:n>2&&bo(e[0],e[1],e[2])&&(e=[e[0]]),ji(t,gi(e,1),[])})),Ma=ue||function(){return he.Date.now()};function Ta(t,e,n){return e=n?r:e,e=t&&null==e?t.length:e,Kr(t,u,r,r,r,r,e)}function ka(t,e){var n;if("function"!=typeof e)throw new kt(o);return t=ps(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var Da=Yi((function(t,e,n){var i=1;if(n.length){var r=sn(n,ro(Da));i|=l}return Kr(t,i,e,n,r)})),Aa=Yi((function(t,e,n){var i=3;if(n.length){var r=sn(n,ro(Aa));i|=l}return Kr(e,i,t,n,r)}));function Ra(t,e,n){var i,a,s,l,u,c,h=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new kt(o);function g(e){var n=i,o=a;return i=a=r,h=e,l=t.apply(o,n)}function m(t){var n=t-c;return c===r||n>=e||n<0||p&&t-h>=s}function b(){var t=Ma();if(m(t))return v(t);u=Do(b,function(t){var n=e-(t-c);return p?bn(n,s-(t-h)):n}(t))}function v(t){return u=r,f&&i?g(t):(i=a=r,l)}function y(){var t=Ma(),n=m(t);if(i=arguments,a=this,c=t,n){if(u===r)return function(t){return h=t,u=Do(b,e),d?g(t):l}(c);if(p)return yr(u),u=Do(b,e),g(c)}return u===r&&(u=Do(b,e)),l}return e=gs(e)||0,Qa(n)&&(d=!!n.leading,s=(p="maxWait"in n)?mn(gs(n.maxWait)||0,e):s,f="trailing"in n?!!n.trailing:f),y.cancel=function(){u!==r&&yr(u),h=0,i=c=a=u=r},y.flush=function(){return u===r?l:v(Ma())},y}var Sa=Yi((function(t,e){return li(t,1,e)})),Pa=Yi((function(t,e,n){return li(t,gs(e)||0,n)}));function La(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new kt(o);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=t.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(La.Cache||Un),n}function Oa(t){if("function"!=typeof t)throw new kt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}La.Cache=Un;var Fa=br((function(t,e){var n=(e=1==e.length&&Va(e[0])?Se(e[0],Xe(oo())):Se(gi(e,1),Xe(oo()))).length;return Yi((function(i){for(var r=-1,o=bn(i.length,n);++r=e})),Wa=Ai(function(){return arguments}())?Ai:function(t){return ts(t)&&Lt.call(t,"callee")&&!qt.call(t,"callee")},Va=i.isArray,Ga=be?Xe(be):function(t){return ts(t)&&xi(t)==S};function Ua(t){return null!=t&&Za(t.length)&&!$a(t)}function qa(t){return ts(t)&&Ua(t)}var Ya=me||gl,Ka=ve?Xe(ve):function(t){return ts(t)&&xi(t)==v};function Xa(t){if(!ts(t))return!1;var e=xi(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!is(t)}function $a(t){if(!Qa(t))return!1;var e=xi(t);return e==w||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ja(t){return"number"==typeof t&&t==ps(t)}function Za(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function Qa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ts(t){return null!=t&&"object"==typeof t}var es=ye?Xe(ye):function(t){return ts(t)&&ho(t)==C};function ns(t){return"number"==typeof t||ts(t)&&xi(t)==x}function is(t){if(!ts(t)||xi(t)!=E)return!1;var e=Gt(t);if(null===e)return!0;var n=Lt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Pt.call(n)==Bt}var rs=we?Xe(we):function(t){return ts(t)&&xi(t)==T},os=_e?Xe(_e):function(t){return ts(t)&&ho(t)==k};function as(t){return"string"==typeof t||!Va(t)&&ts(t)&&xi(t)==D}function ss(t){return"symbol"==typeof t||ts(t)&&xi(t)==A}var ls=Ce?Xe(Ce):function(t){return ts(t)&&Za(t.length)&&!!re[xi(t)]},us=Vr(Fi),cs=Vr((function(t,e){return t<=e}));function hs(t){if(!t)return[];if(Ua(t))return as(t)?hn(t):Tr(t);if(Xt&&t[Xt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Xt]());var e=ho(t);return(e==C?on:e==k?ln:Is)(t)}function ds(t){return t?(t=gs(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ps(t){var e=ds(t),n=e%1;return e==e?n?e-n:e:0}function fs(t){return t?oi(ps(t),0,p):0}function gs(t){if("number"==typeof t)return t;if(ss(t))return d;if(Qa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ke(t);var n=ft.test(t);return n||mt.test(t)?le(t.slice(2),n?2:8):pt.test(t)?d:+t}function ms(t){return kr(t,Ss(t))}function bs(t){return null==t?"":ar(t)}var vs=Ar((function(t,e){if(_o(e)||Ua(e))kr(e,Rs(e),t);else for(var n in e)Lt.call(e,n)&&Qn(t,n,e[n])})),ys=Ar((function(t,e){kr(e,Ss(e),t)})),ws=Ar((function(t,e,n,i){kr(e,Ss(e),t,i)})),_s=Ar((function(t,e,n,i){kr(e,Rs(e),t,i)})),Cs=Qr(ri),xs=Yi((function(t,e){t=Et(t);var n=-1,i=e.length,o=i>2?e[2]:r;for(o&&bo(e[0],e[1],o)&&(i=1);++n1),e})),kr(t,eo(t),n),i&&(n=ai(n,7,Jr));for(var r=e.length;r--;)lr(n,e[r]);return n})),Fs=Qr((function(t,e){return null==t?{}:function(t,e){return Wi(t,e,(function(e,n){return Ts(t,n)}))}(t,e)}));function zs(t,e){if(null==t)return{};var n=Se(eo(t),(function(t){return[t]}));return e=oo(e),Wi(t,n,(function(t,n){return e(t,n[0])}))}var Bs=Yr(Rs),Ns=Yr(Ss);function Is(t){return null==t?[]:$e(t,Rs(t))}var Hs=Lr((function(t,e,n){return e=e.toLowerCase(),t+(n?js(e):e)}));function js(t){return Xs(bs(t).toLowerCase())}function Ws(t){return(t=bs(t))&&t.replace(vt,tn).replace(Jt,"")}var Vs=Lr((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Gs=Lr((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Us=Pr("toLowerCase"),qs=Lr((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ys=Lr((function(t,e,n){return t+(n?" ":"")+Xs(e)})),Ks=Lr((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Xs=Pr("toUpperCase");function $s(t,e,n){return t=bs(t),(e=n?r:e)===r?function(t){return ee.test(t)}(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(e)||[]}var Js=Yi((function(t,e){try{return xe(t,r,e)}catch(t){return Xa(t)?t:new _t(t)}})),Zs=Qr((function(t,e){return Me(e,(function(e){e=zo(e),ii(t,e,Da(t[e],t))})),t}));function Qs(t){return function(){return t}}var tl=zr(),el=zr(!0);function nl(t){return t}function il(t){return Li("function"==typeof t?t:ai(t,1))}var rl=Yi((function(t,e){return function(n){return Di(n,t,e)}})),ol=Yi((function(t,e){return function(n){return Di(t,n,e)}}));function al(t,e,n){var i=Rs(e),r=wi(e,i);null!=n||Qa(e)&&(r.length||!i.length)||(n=e,e=t,t=this,r=wi(e,Rs(e)));var o=!(Qa(n)&&"chain"in n&&!n.chain),a=$a(t);return Me(r,(function(n){var i=e[n];t[n]=i,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Tr(this.__actions__)).push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,Pe([this.value()],arguments))})})),t}function sl(){}var ll=Hr(Se),ul=Hr(ke),cl=Hr(Fe);function hl(t){return vo(t)?Ve(zo(t)):function(t){return function(e){return _i(e,t)}}(t)}var dl=Wr(),pl=Wr(!0);function fl(){return[]}function gl(){return!1}var ml,bl=Ir((function(t,e){return t+e}),0),vl=Ur("ceil"),yl=Ir((function(t,e){return t/e}),1),wl=Ur("floor"),_l=Ir((function(t,e){return t*e}),1),Cl=Ur("round"),xl=Ir((function(t,e){return t-e}),0);return Nn.after=function(t,e){if("function"!=typeof e)throw new kt(o);return t=ps(t),function(){if(--t<1)return e.apply(this,arguments)}},Nn.ary=Ta,Nn.assign=vs,Nn.assignIn=ys,Nn.assignInWith=ws,Nn.assignWith=_s,Nn.at=Cs,Nn.before=ka,Nn.bind=Da,Nn.bindAll=Zs,Nn.bindKey=Aa,Nn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Va(t)?t:[t]},Nn.chain=ha,Nn.chunk=function(t,e,n){e=(n?bo(t,e,n):e===r)?1:mn(ps(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,s=0,l=i(de(o/e));ao?0:o+n),(i=i===r||i>o?o:ps(i))<0&&(i+=o),i=n>i?0:fs(i);n>>0)?(t=bs(t))&&("string"==typeof e||null!=e&&!rs(e))&&!(e=ar(e))&&rn(t)?vr(hn(t),0,n):t.split(e,n):[]},Nn.spread=function(t,e){if("function"!=typeof t)throw new kt(o);return e=null==e?0:mn(ps(e),0),Yi((function(n){var i=n[e],r=vr(n,0,e);return i&&Pe(r,i),xe(t,this,r)}))},Nn.tail=function(t){var e=null==t?0:t.length;return e?tr(t,1,e):[]},Nn.take=function(t,e,n){return t&&t.length?tr(t,0,(e=n||e===r?1:ps(e))<0?0:e):[]},Nn.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?tr(t,(e=i-(e=n||e===r?1:ps(e)))<0?0:e,i):[]},Nn.takeRightWhile=function(t,e){return t&&t.length?cr(t,oo(e,3),!1,!0):[]},Nn.takeWhile=function(t,e){return t&&t.length?cr(t,oo(e,3)):[]},Nn.tap=function(t,e){return e(t),t},Nn.throttle=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new kt(o);return Qa(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Ra(t,e,{leading:i,maxWait:e,trailing:r})},Nn.thru=da,Nn.toArray=hs,Nn.toPairs=Bs,Nn.toPairsIn=Ns,Nn.toPath=function(t){return Va(t)?Se(t,zo):ss(t)?[t]:Tr(Fo(bs(t)))},Nn.toPlainObject=ms,Nn.transform=function(t,e,n){var i=Va(t),r=i||Ya(t)||ls(t);if(e=oo(e,4),null==n){var o=t&&t.constructor;n=r?i?new o:[]:Qa(t)&&$a(o)?In(Gt(t)):{}}return(r?Me:vi)(t,(function(t,i,r){return e(n,t,i,r)})),n},Nn.unary=function(t){return Ta(t,1)},Nn.union=ta,Nn.unionBy=ea,Nn.unionWith=na,Nn.uniq=function(t){return t&&t.length?sr(t):[]},Nn.uniqBy=function(t,e){return t&&t.length?sr(t,oo(e,2)):[]},Nn.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?sr(t,r,e):[]},Nn.unset=function(t,e){return null==t||lr(t,e)},Nn.unzip=ia,Nn.unzipWith=ra,Nn.update=function(t,e,n){return null==t?t:ur(t,e,gr(n))},Nn.updateWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:ur(t,e,gr(n),i)},Nn.values=Is,Nn.valuesIn=function(t){return null==t?[]:$e(t,Ss(t))},Nn.without=oa,Nn.words=$s,Nn.wrap=function(t,e){return za(gr(e),t)},Nn.xor=aa,Nn.xorBy=sa,Nn.xorWith=la,Nn.zip=ua,Nn.zipObject=function(t,e){return pr(t||[],e||[],Qn)},Nn.zipObjectDeep=function(t,e){return pr(t||[],e||[],$i)},Nn.zipWith=ca,Nn.entries=Bs,Nn.entriesIn=Ns,Nn.extend=ys,Nn.extendWith=ws,al(Nn,Nn),Nn.add=bl,Nn.attempt=Js,Nn.camelCase=Hs,Nn.capitalize=js,Nn.ceil=vl,Nn.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=gs(n))==n?n:0),e!==r&&(e=(e=gs(e))==e?e:0),oi(gs(t),e,n)},Nn.clone=function(t){return ai(t,4)},Nn.cloneDeep=function(t){return ai(t,5)},Nn.cloneDeepWith=function(t,e){return ai(t,5,e="function"==typeof e?e:r)},Nn.cloneWith=function(t,e){return ai(t,4,e="function"==typeof e?e:r)},Nn.conformsTo=function(t,e){return null==e||si(t,e,Rs(e))},Nn.deburr=Ws,Nn.defaultTo=function(t,e){return null==t||t!=t?e:t},Nn.divide=yl,Nn.endsWith=function(t,e,n){t=bs(t),e=ar(e);var i=t.length,o=n=n===r?i:oi(ps(n),0,i);return(n-=e.length)>=0&&t.slice(n,o)==e},Nn.eq=Ia,Nn.escape=function(t){return(t=bs(t))&&K.test(t)?t.replace(q,en):t},Nn.escapeRegExp=function(t){return(t=bs(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Nn.every=function(t,e,n){var i=Va(t)?ke:di;return n&&bo(t,e,n)&&(e=r),i(t,oo(e,3))},Nn.find=ga,Nn.findIndex=Wo,Nn.findKey=function(t,e){return Be(t,oo(e,3),vi)},Nn.findLast=ma,Nn.findLastIndex=Vo,Nn.findLastKey=function(t,e){return Be(t,oo(e,3),yi)},Nn.floor=wl,Nn.forEach=ba,Nn.forEachRight=va,Nn.forIn=function(t,e){return null==t?t:mi(t,oo(e,3),Ss)},Nn.forInRight=function(t,e){return null==t?t:bi(t,oo(e,3),Ss)},Nn.forOwn=function(t,e){return t&&vi(t,oo(e,3))},Nn.forOwnRight=function(t,e){return t&&yi(t,oo(e,3))},Nn.get=Ms,Nn.gt=Ha,Nn.gte=ja,Nn.has=function(t,e){return null!=t&&po(t,e,Mi)},Nn.hasIn=Ts,Nn.head=Uo,Nn.identity=nl,Nn.includes=function(t,e,n,i){t=Ua(t)?t:Is(t),n=n&&!i?ps(n):0;var r=t.length;return n<0&&(n=mn(r+n,0)),as(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&Ie(t,e,n)>-1},Nn.indexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:ps(n);return r<0&&(r=mn(i+r,0)),Ie(t,e,r)},Nn.inRange=function(t,e,n){return e=ds(e),n===r?(n=e,e=0):n=ds(n),function(t,e,n){return t>=bn(e,n)&&t=-9007199254740991&&t<=h},Nn.isSet=os,Nn.isString=as,Nn.isSymbol=ss,Nn.isTypedArray=ls,Nn.isUndefined=function(t){return t===r},Nn.isWeakMap=function(t){return ts(t)&&ho(t)==R},Nn.isWeakSet=function(t){return ts(t)&&"[object WeakSet]"==xi(t)},Nn.join=function(t,e){return null==t?"":Ge.call(t,e)},Nn.kebabCase=Vs,Nn.last=Xo,Nn.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ps(n))<0?mn(i+o,0):bn(o,i-1)),e==e?function(t,e,n){for(var i=n+1;i--;)if(t[i]===e)return i;return i}(t,e,o):Ne(t,je,o,!0)},Nn.lowerCase=Gs,Nn.lowerFirst=Us,Nn.lt=us,Nn.lte=cs,Nn.max=function(t){return t&&t.length?pi(t,nl,Ei):r},Nn.maxBy=function(t,e){return t&&t.length?pi(t,oo(e,2),Ei):r},Nn.mean=function(t){return We(t,nl)},Nn.meanBy=function(t,e){return We(t,oo(e,2))},Nn.min=function(t){return t&&t.length?pi(t,nl,Fi):r},Nn.minBy=function(t,e){return t&&t.length?pi(t,oo(e,2),Fi):r},Nn.stubArray=fl,Nn.stubFalse=gl,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=_l,Nn.nth=function(t,e){return t&&t.length?Hi(t,ps(e)):r},Nn.noConflict=function(){return he._===this&&(he._=Nt),this},Nn.noop=sl,Nn.now=Ma,Nn.pad=function(t,e,n){t=bs(t);var i=(e=ps(e))?cn(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return jr(pe(r),n)+t+jr(de(r),n)},Nn.padEnd=function(t,e,n){t=bs(t);var i=(e=ps(e))?cn(t):0;return e&&ie){var i=t;t=e,e=i}if(n||t%1||e%1){var o=wn();return bn(t+o*(e-t+se("1e-"+((o+"").length-1))),e)}return Ui(t,e)},Nn.reduce=function(t,e,n){var i=Va(t)?Le:Ue,r=arguments.length<3;return i(t,oo(e,4),n,r,ci)},Nn.reduceRight=function(t,e,n){var i=Va(t)?Oe:Ue,r=arguments.length<3;return i(t,oo(e,4),n,r,hi)},Nn.repeat=function(t,e,n){return e=(n?bo(t,e,n):e===r)?1:ps(e),qi(bs(t),e)},Nn.replace=function(){var t=arguments,e=bs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Nn.result=function(t,e,n){var i=-1,o=(e=mr(e,t)).length;for(o||(o=1,t=r);++ih)return[];var n=p,i=bn(t,p);e=oo(e),t-=p;for(var r=Ye(i,e);++n=a)return t;var l=n-cn(i);if(l<1)return i;var u=s?vr(s,0,l).join(""):t.slice(0,l);if(o===r)return u+i;if(s&&(l+=u.length-l),rs(o)){if(t.slice(l).search(o)){var c,h=u;for(o.global||(o=Mt(o.source,bs(dt.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var d=c.index;u=u.slice(0,d===r?l:d)}}else if(t.indexOf(ar(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+i},Nn.unescape=function(t){return(t=bs(t))&&Y.test(t)?t.replace(U,pn):t},Nn.uniqueId=function(t){var e=++Ot;return bs(t)+e},Nn.upperCase=Ks,Nn.upperFirst=Xs,Nn.each=ba,Nn.eachRight=va,Nn.first=Uo,al(Nn,(ml={},vi(Nn,(function(t,e){Lt.call(Nn.prototype,e)||(ml[e]=t)})),ml),{chain:!1}),Nn.VERSION="4.17.21",Me(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Nn[t].placeholder=Nn})),Me(["drop","take"],(function(t,e){Wn.prototype[t]=function(n){n=n===r?1:mn(ps(n),0);var i=this.__filtered__&&!e?new Wn(this):this.clone();return i.__filtered__?i.__takeCount__=bn(n,i.__takeCount__):i.__views__.push({size:bn(n,p),type:t+(i.__dir__<0?"Right":"")}),i},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Me(["filter","map","takeWhile"],(function(t,e){var n=e+1,i=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:oo(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}})),Me(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),Me(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(nl)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Yi((function(t,e){return"function"==typeof t?new Wn(this):this.map((function(n){return Di(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Oa(oo(t)))},Wn.prototype.slice=function(t,e){t=ps(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Wn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=ps(e))<0?n.dropRight(-e):n.take(e-t)),n)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(p)},vi(Wn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Nn[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(Nn.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,l=e instanceof Wn,u=s[0],c=l||Va(e),h=function(t){var e=o.apply(Nn,Pe([t],s));return i&&d?e[0]:e};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,p=!!this.__actions__.length,f=a&&!d,g=l&&!p;if(!a&&c){e=g?e:new Wn(this);var m=t.apply(e,s);return m.__actions__.push({func:da,args:[h],thisArg:r}),new jn(m,d)}return f&&g?t.apply(this,s):(m=this.thru(h),f?i?m.value()[0]:m.value():m)})})),Me(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Dt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Nn.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(Va(r)?r:[],t)}return this[n]((function(n){return e.apply(Va(n)?n:[],t)}))}})),vi(Wn.prototype,(function(t,e){var n=Nn[e];if(n){var i=n.name+"";Lt.call(An,i)||(An[i]=[]),An[i].push({name:e,func:n})}})),An[Br(r,2).name]=[{name:"wrapper",func:r}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Tr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Tr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Tr(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Va(t),i=e<0,r=n?t.length:0,o=function(t,e,n){for(var i=-1,r=n.length;++i=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},Nn.prototype.plant=function(t){for(var e,n=this;n instanceof Hn;){var i=No(n);i.__index__=0,i.__values__=r,e?o.__wrapped__=i:e=i;var o=i;n=n.__wrapped__}return o.__wrapped__=t,e},Nn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:da,args:[Qo],thisArg:r}),new jn(e,this.__chain__)}return this.thru(Qo)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return hr(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,Xt&&(Nn.prototype[Xt]=function(){return this}),Nn}();he._=fn,(i=function(){return fn}.call(e,n,e,t))===r||(t.exports=i)}.call(this)},133:function(t){t.exports=function(){"use strict";function t(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i={exports:{}};function r(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}i.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:r,changeDefaults:function(t){i.exports.defaults=t}};var o=/[&<>"']/,a=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,u={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(t){return u[t]};var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(t){return t.replace(h,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var p=/(^|[^\[])\^/g;var f=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var m={},b=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function w(t,e){m[" "+t]||(b.test(t)?m[" "+t]=t+"/":m[" "+t]=_(t,"/",!0));var n=-1===(t=m[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(v,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(y,"$1")+e:t+e}function _(t,e,n){var i=t.length;if(0===i)return"";for(var r=0;r=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n.length>e)n.splice(e);else for(;n.length1;)1&e&&(n+=t),e>>=1,t+=t;return n+t},L=i.exports.defaults,O=A,F=D,z=C,B=R;function N(t,e,n){var i=e.href,r=e.title?z(e.title):null,o=t[1].replace(/\\([\[\]])/g,"$1");return"!"!==t[0].charAt(0)?{type:"link",raw:n,href:i,title:r,text:o}:{type:"image",raw:n,href:i,title:r,text:z(o)}}var I=function(){function t(t){this.options=t||L}var e=t.prototype;return e.space=function(t){var e=this.rules.block.newline.exec(t);if(e)return e[0].length>1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t){var e=this.rules.block.code.exec(t);if(e){var n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:O(n,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=i.length?t.slice(i.length):t})).join("\n")}(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:i}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e){var n=e[2].trim();if(/#$/.test(n)){var i=O(n,"#");this.options.pedantic?n=i.trim():i&&!/ $/.test(i)||(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n}}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var n={type:"table",header:F(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i ?/gm,"");return{type:"blockquote",raw:e[0],text:n}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){var n,i,r,o,a,s,l,u,c,h=e[0],d=e[2],p=d.length>1,f={type:"list",raw:h,ordered:p,start:p?+d.slice(0,-1):"",loose:!1,items:[]},g=e[0].match(this.rules.block.item),m=!1,b=g.length;r=this.rules.block.listItemStart.exec(g[0]);for(var v=0;vr[1].length:o[1].length>=r[0].length||o[1].length>3){g.splice(v,2,g[v]+(!this.options.pedantic&&o[1].length/i.test(i[0])&&(e=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:e,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):z(i[0]):i[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=e[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;var i=O(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=B(e[2],"()");if(r>-1){var o=(0===e[0].indexOf("!")?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,o).trim(),e[3]=""}}var a=e[2],s="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);l&&(a=l[1],s=l[3])}else s=e[3]?e[3].slice(1,-1):"";return a=a.trim(),/^$/.test(n)?a.slice(1):a.slice(1,-1)),N(e,{href:a?a.replace(this.rules.inline._escapes,"$1"):a,title:s?s.replace(this.rules.inline._escapes,"$1"):s},e[0])}},e.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=e[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return N(n,i,n[0])}},e.emStrong=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.emStrong.lDelim.exec(t);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var o,a,s=i[0].length-1,l=s,u=0,c="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+s);null!=(i=c.exec(e));)if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6])if(a=o.length,i[3]||i[4])l+=a;else if(!((i[5]||i[6])&&s%3)||(s+a)%3){if(!((l-=a)>0))return a=Math.min(a,a+l+u),Math.min(s,a)%2?{type:"em",raw:t.slice(0,s+i.index+a+1),text:t.slice(1,s+i.index+a)}:{type:"strong",raw:t.slice(0,s+i.index+a+1),text:t.slice(2,s+i.index+a-1)}}else u+=a}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=z(n,!0),{type:"codespan",raw:e[0],text:n}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2]}},e.autolink=function(t,e){var n,i,r=this.rules.inline.autolink.exec(t);if(r)return i="@"===r[2]?"mailto:"+(n=z(this.options.mangle?e(r[1]):r[1])):n=z(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},e.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var i,r;if("@"===n[2])r="mailto:"+(i=z(this.options.mangle?e(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=z(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},e.inlineText=function(t,e,n){var i,r=this.rules.inline.text.exec(t);if(r)return i=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):z(r[0]):r[0]:z(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},t}(),H=T,j=E,W=k,V={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:H,table:H,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};V.def=j(V.def).replace("label",V._label).replace("title",V._title).getRegex(),V.bullet=/(?:[*+-]|\d{1,9}[.)])/,V.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,V.item=j(V.item,"gm").replace(/bull/g,V.bullet).getRegex(),V.listItemStart=j(/^( *)(bull) */).replace("bull",V.bullet).getRegex(),V.list=j(V.list).replace(/bull/g,V.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+V.def.source+")").getRegex(),V._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",V._comment=/|$)/,V.html=j(V.html,"i").replace("comment",V._comment).replace("tag",V._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),V.paragraph=j(V._paragraph).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.blockquote=j(V.blockquote).replace("paragraph",V.paragraph).getRegex(),V.normal=W({},V),V.gfm=W({},V.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),V.gfm.nptable=j(V.gfm.nptable).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.gfm.table=j(V.gfm.table).replace("hr",V.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",V._tag).getRegex(),V.pedantic=W({},V.normal,{html:j("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",V._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:H,paragraph:j(V.normal._paragraph).replace("hr",V.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",V.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var G={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:H,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:H,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};G.punctuation=j(G.punctuation).replace(/punctuation/g,G._punctuation).getRegex(),G.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,G.escapedEmSt=/\\\*|\\_/g,G._comment=j(V._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),G.emStrong.lDelim=j(G.emStrong.lDelim).replace(/punct/g,G._punctuation).getRegex(),G.emStrong.rDelimAst=j(G.emStrong.rDelimAst,"g").replace(/punct/g,G._punctuation).getRegex(),G.emStrong.rDelimUnd=j(G.emStrong.rDelimUnd,"g").replace(/punct/g,G._punctuation).getRegex(),G._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,G._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,G._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,G.autolink=j(G.autolink).replace("scheme",G._scheme).replace("email",G._email).getRegex(),G._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,G.tag=j(G.tag).replace("comment",G._comment).replace("attribute",G._attribute).getRegex(),G._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,G._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,G._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,G.link=j(G.link).replace("label",G._label).replace("href",G._href).replace("title",G._title).getRegex(),G.reflink=j(G.reflink).replace("label",G._label).getRegex(),G.reflinkSearch=j(G.reflinkSearch,"g").replace("reflink",G.reflink).replace("nolink",G.nolink).getRegex(),G.normal=W({},G),G.pedantic=W({},G.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:j(/^!?\[(label)\]\((.*?)\)/).replace("label",G._label).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",G._label).getRegex()}),G.gfm=W({},G.normal,{escape:j(G.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var Q=function(){function e(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Y,this.options.tokenizer=this.options.tokenizer||new q,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:K.normal,inline:X.normal};this.options.pedantic?(e.block=K.pedantic,e.inline=X.pedantic):this.options.gfm&&(e.block=K.gfm,this.options.breaks?e.inline=X.breaks:e.inline=X.gfm),this.tokenizer.rules=e}e.lex=function(t,n){return new e(n).lex(t)},e.lexInline=function(t,n){return new e(n).inlineTokens(t)};var n,i,r,o=e.prototype;return o.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},o.blockTokens=function(t,e,n){var i,r,o,a,s,l,u=this;for(void 0===e&&(e=[]),void 0===n&&(n=!0),this.options.pedantic&&(t=t.replace(/^ +$/gm,""));t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(n){return!!(i=n.call(u,t,e))&&(t=t.substring(i.raw.length),e.push(i),!0)}))))if(i=this.tokenizer.space(t))t=t.substring(i.raw.length),i.type&&e.push(i);else if(i=this.tokenizer.code(t))t=t.substring(i.raw.length),(a=e[e.length-1])&&"paragraph"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text):e.push(i);else if(i=this.tokenizer.fences(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.heading(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.nptable(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.hr(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.blockquote(t))t=t.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),e.push(i);else if(i=this.tokenizer.list(t)){for(t=t.substring(i.raw.length),o=i.items.length,r=0;r=0&&(e=Math.min(e,i))})),e<1/0&&e>=0&&(s=t.substring(0,e+1))}(),n&&(i=this.tokenizer.paragraph(s)))a=e[e.length-1],l&&"paragraph"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text):e.push(i),l=s.length!==t.length,t=t.substring(i.raw.length);else if(i=this.tokenizer.text(t))t=t.substring(i.raw.length),(a=e[e.length-1])&&"text"===a.type?(a.raw+="\n"+i.raw,a.text+="\n"+i.text):e.push(i);else if(t){var c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}return e},o.inline=function(t){var e,n,i,r,o,a,s=t.length;for(e=0;e0)for(;null!=(l=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,l.index)+"["+$("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(l=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,l.index)+"["+$("a",l[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(l=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,l.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;t;)if(u||(c=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(r=n.call(s,t,e))&&(t=t.substring(r.raw.length),e.push(r),!0)}))))if(r=this.tokenizer.escape(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.tag(t,n,i))t=t.substring(r.raw.length),n=r.inLink,i=r.inRawBlock,(o=e[e.length-1])&&"text"===r.type&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):e.push(r);else if(r=this.tokenizer.link(t))t=t.substring(r.raw.length),"link"===r.type&&(r.tokens=this.inlineTokens(r.text,[],!0,i)),e.push(r);else if(r=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(r.raw.length),o=e[e.length-1],"link"===r.type?(r.tokens=this.inlineTokens(r.text,[],!0,i),e.push(r)):o&&"text"===r.type&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):e.push(r);else if(r=this.tokenizer.emStrong(t,h,c))t=t.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),e.push(r);else if(r=this.tokenizer.codespan(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.br(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.del(t))t=t.substring(r.raw.length),r.tokens=this.inlineTokens(r.text,[],n,i),e.push(r);else if(r=this.tokenizer.autolink(t,Z))t=t.substring(r.raw.length),e.push(r);else if(n||!(r=this.tokenizer.url(t,Z))){if(a=t,this.options.extensions&&this.options.extensions.startInline&&function(){var e=1/0,n=t.slice(1),i=void 0;s.options.extensions.startInline.forEach((function(t){"number"==typeof(i=t.call(this,n))&&i>=0&&(e=Math.min(e,i))})),e<1/0&&e>=0&&(a=t.substring(0,e+1))}(),r=this.tokenizer.inlineText(a,i,J))t=t.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(c=r.raw.slice(-1)),u=!0,(o=e[e.length-1])&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):e.push(r);else if(t){var p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}throw new Error(p)}}else t=t.substring(r.raw.length),e.push(r);return e},n=e,r=[{key:"rules",get:function(){return{block:K,inline:X}}}],(i=null)&&t(n.prototype,i),r&&t(n,r),e}(),tt=i.exports.defaults,et=M,nt=C,it=function(){function t(t){this.options=t||tt}var e=t.prototype;return e.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,i);null!=r&&r!==t&&(n=!0,t=r)}return t=t.replace(/\n$/,"")+"\n",i?'
'+(n?t:nt(t,!0))+"
\n":"
"+(n?t:nt(t,!0))+"
\n"},e.blockquote=function(t){return"
\n"+t+"
\n"},e.html=function(t){return t},e.heading=function(t,e,n,i){return this.options.headerIds?"'+t+"\n":""+t+"\n"},e.hr=function(){return this.options.xhtml?"
\n":"
\n"},e.list=function(t,e,n){var i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"\n"},e.listitem=function(t){return"
  • "+t+"
  • \n"},e.checkbox=function(t){return" "},e.paragraph=function(t){return"

    "+t+"

    \n"},e.table=function(t,e){return e&&(e=""+e+""),"\n\n"+t+"\n"+e+"
    \n"},e.tablerow=function(t){return"\n"+t+"\n"},e.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"\n"},e.strong=function(t){return""+t+""},e.em=function(t){return""+t+""},e.codespan=function(t){return""+t+""},e.br=function(){return this.options.xhtml?"
    ":"
    "},e.del=function(t){return""+t+""},e.link=function(t,e,n){if(null===(t=et(this.options.sanitize,this.options.baseUrl,t)))return n;var i='"+n+""},e.image=function(t,e,n){if(null===(t=et(this.options.sanitize,this.options.baseUrl,t)))return n;var i=''+n+'":">")},e.text=function(t){return t},t}(),rt=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),ot=function(){function t(){this.seen={}}var e=t.prototype;return e.serialize=function(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},e.getNextSafeSlug=function(t,e){var n=t,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[t];do{n=t+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=i,this.seen[n]=0),n},e.slug=function(t,e){void 0===e&&(e={});var n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)},t}(),at=it,st=rt,lt=ot,ut=i.exports.defaults,ct=x,ht=Q,dt=function(){function t(t){this.options=t||ut,this.options.renderer=this.options.renderer||new at,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new st,this.slugger=new lt}t.parse=function(e,n){return new t(n).parse(e)},t.parseInline=function(e,n){return new t(n).parseInline(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var n,i,r,o,a,s,l,u,c,h,d,p,f,g,m,b,v,y,w,_="",C=t.length;for(n=0;n0&&"text"===m.tokens[0].type?(m.tokens[0].text=y+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=y+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:y}):g+=y),g+=this.parse(m.tokens,f),c+=this.renderer.listitem(g,v,b);_+=this.renderer.list(c,d,p);continue;case"html":_+=this.renderer.html(h.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(c=h.tokens?this.parseInline(h.tokens):h.text;n+1An error occurred:

    "+yt(t.message+"",!0)+"
    ";throw t}}return xt.options=xt.setOptions=function(t){return bt(xt.defaults,t),_t(xt.defaults),xt},xt.getDefaults=wt,xt.defaults=Ct,xt.use=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;iAn error occurred:

    "+yt(t.message+"",!0)+"
    ";throw t}},xt.Parser=dt,xt.parser=dt.parse,xt.Renderer=ft,xt.TextRenderer=gt,xt.Lexer=ht,xt.lexer=ht.lex,xt.Tokenizer=pt,xt.Slugger=mt,xt.parse=xt,xt}()},4741:(t,e,n)=>{var i;!function(t){!function(e){var i="object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=o(t);function o(t,e){return function(n,i){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:i}),e&&e(n,i)}}void 0===i.Reflect?i.Reflect=t:r=o(i.Reflect,r),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,l={create:o?function(){return F(Object.create(null))}:a?function(){return F({__proto__:null})}:function(){return F({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},u=Object.getPrototypeOf(Function),c="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[r]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var i=this._keys.length,r=n+1;r=0;--n){var i=(0,t[n])(e);if(!x(i)&&!E(i)){if(!R(i))throw new TypeError;e=i}}return e}(t,e)}if(!D(t))throw new TypeError;if(!M(e))throw new TypeError;if(!M(i)&&!x(i)&&!E(i))throw new TypeError;return E(i)&&(i=void 0),function(t,e,n,i){for(var r=t.length-1;r>=0;--r){var o=(0,t[r])(e,n,i);if(!x(o)&&!E(o)){if(!M(o))throw new TypeError;i=o}}return i}(t,e,n=k(n),i)})),t("metadata",(function(t,e){return function(n,i){if(!M(n))throw new TypeError;if(!x(i)&&!function(t){switch(C(t)){case 3:case 4:return!0;default:return!1}}(i))throw new TypeError;y(t,e,n,i)}})),t("defineMetadata",(function(t,e,n,i){if(!M(n))throw new TypeError;return x(i)||(i=k(i)),y(t,e,n,i)})),t("hasMetadata",(function(t,e,n){if(!M(e))throw new TypeError;return x(n)||(n=k(n)),g(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!M(e))throw new TypeError;return x(n)||(n=k(n)),m(t,e,n)})),t("getMetadata",(function(t,e,n){if(!M(e))throw new TypeError;return x(n)||(n=k(n)),b(t,e,n)})),t("getOwnMetadata",(function(t,e,n){if(!M(e))throw new TypeError;return x(n)||(n=k(n)),v(t,e,n)})),t("getMetadataKeys",(function(t,e){if(!M(t))throw new TypeError;return x(e)||(e=k(e)),w(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!M(t))throw new TypeError;return x(e)||(e=k(e)),_(t,e)})),t("deleteMetadata",(function(t,e,n){if(!M(e))throw new TypeError;x(n)||(n=k(n));var i=f(e,n,!1);if(x(i))return!1;if(!i.delete(t))return!1;if(i.size>0)return!0;var r=p.get(e);return r.delete(n),r.size>0||p.delete(e),!0}))}(r)}()}(i||(i={}))},654:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>b});var i=n(5072),r=n.n(i),o=n(7825),a=n.n(o),s=n(7659),l=n.n(s),u=n(5056),c=n.n(u),h=n(540),d=n.n(h),p=n(1113),f=n.n(p),g=n(5411),m={};m.styleTagTransform=f(),m.setAttributes=c(),m.insert=l().bind(null,"head"),m.domAPI=a(),m.insertStyleElement=d(),r()(g.A,m);const b=g.A&&g.A.locals?g.A.locals:void 0},5072:t=>{"use strict";var e=[];function n(t){for(var n=-1,i=0;i{"use strict";var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},5056:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},1113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},1838:(t,e,n)=>{"use strict";n.r(e),n.d(e,{AccessorModule:()=>s,AjaxModule:()=>p,CalcComponent:()=>g,CellComponent:()=>m,ClipboardModule:()=>f,ColumnCalcsModule:()=>E,ColumnComponent:()=>v,DataTreeModule:()=>M,DownloadModule:()=>k,EditModule:()=>S,ExportModule:()=>O,FilterModule:()=>z,FormatModule:()=>N,FrozenColumnsModule:()=>I,FrozenRowsModule:()=>H,GroupComponent:()=>j,GroupRowsModule:()=>V,HistoryModule:()=>G,HtmlTableImportModule:()=>U,ImportModule:()=>Y,InteractionModule:()=>K,KeybindingsModule:()=>X,MenuModule:()=>$,Module:()=>a,MoveColumnsModule:()=>J,MoveRowsModule:()=>Z,MutatorModule:()=>Q,PageModule:()=>et,PersistenceModule:()=>rt,PopupModule:()=>ot,PrintModule:()=>at,PseudoRow:()=>Xt,ReactiveDataModule:()=>st,Renderer:()=>Et,ResizeColumnsModule:()=>lt,ResizeRowsModule:()=>ut,ResizeTableModule:()=>ct,ResponsiveLayoutModule:()=>ht,RowComponent:()=>_,SelectRangeModule:()=>vt,SelectRowModule:()=>dt,SortModule:()=>gt,Tabulator:()=>Yt,TabulatorFull:()=>Kt,TooltipModule:()=>yt,ValidateModule:()=>_t});class i{constructor(t){this.table=t}reloadData(t,e,n){return this.table.dataLoader.load(t,void 0,void 0,void 0,e,n)}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,n){return this.table.deprecationAdvisor.check(t,e,n)}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 r{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,n){var i,r=t?e.split(t):[e],o=r.length;for(let t=0;tt.subject===l)),a>-1?e[o]=n[a].copy:(s=Object.assign(Array.isArray(l)?[]:{},l),n.unshift({subject:l,copy:s}),e[o]=this.deepClone(l,s,n)))}return e}}class o extends i{constructor(t,e,n){super(t),this.element=e,this.container=this._lookupContainer(),this.parent=n,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),n=e?t.touches[0].pageX:t.pageX,i=e?t.touches[0].pageY:t.pageY;if(this.container!==document.body){let t=r.elOffset(this.container);n-=t.left,i-=t.top}return{x:n,y:i}}elementPositionCoords(t,e="right"){var n,i,o,a=r.elOffset(t);switch(this.container!==document.body&&(n=r.elOffset(this.container),a.left-=n.left,a.top-=n.top),e){case"right":i=a.left+t.offsetWidth,o=a.top-1;break;case"bottom":i=a.left,o=a.top+t.offsetHeight;break;case"left":i=a.left,o=a.top-1;break;case"top":i=a.left,o=a.top;break;case"center":i=a.left+t.offsetWidth/2,o=a.top+t.offsetHeight/2}return{x:i,y:o,offset:a}}show(t,e){var n,i,r,o,a;return this.destroyed||this.table.destroyed||(t instanceof HTMLElement?(r=t,o=(a=this.elementPositionCoords(t,e)).offset,n=a.x,i=a.y):"number"==typeof t?(o={top:0,left:0},n=t,i=e):(n=(a=this.containerEventCoords(t)).x,i=a.y,this.reversedX=!1),this.element.style.top=i+"px",this.element.style.left=n+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(n,i,r,o,e),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",(t=>{t.stopPropagation()}))),this}_fitToScreen(t,e,n,i,r){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="",this.element.style.right=n?this.container.offsetWidth-i.left+"px":this.container.offsetWidth-t+"px",this.reversedX=!0),e+this.element.offsetHeight>Math.max(this.container.offsetHeight,o?this.container.scrollHeight:0)&&(this.element.style.top=n?"bottom"===r?parseInt(this.element.style.top)-this.element.offsetHeight-n.offsetHeight-1+"px":parseInt(this.element.style.top)-this.element.offsetHeight+n.offsetHeight+1+"px":parseInt(this.element.style.top)-this.element.offsetHeight+"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(t){return this.childPopup&&this.childPopup.hide(),this.childPopup=new o(this.table,t,this),this.childPopup}}class a extends i{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]=(...n)=>(this.table.initGuard(t),e(...n)):console.warn("Unable to bind table function, name already in use",t)}registerComponentFunction(t,e,n){return this.table.componentFunctionBinder.bind(t,e,n)}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,n=this.table.rowManager.displayRows.length-1;if(this._handler&&(e=this.table.rowManager.displayPipeline.findIndex((t=>t.handler===this._handler)))>-1&&(n=e),t&&(n+=t),this._handler)return n>-1?this.table.rowManager.getDisplayRows(n):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 o(this.table,t,e)}alert(t,e){return this.table.alertManager.alert(t,e)}clearAlert(){return this.table.alertManager.clear()}}class s extends 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,n={};this.allowedTypes.forEach((i=>{var r,o="accessor"+(i.charAt(0).toUpperCase()+i.slice(1));t.definition[o]&&(r=this.lookupAccessor(t.definition[o]))&&(e=!0,n[o]={accessor:r,params:t.definition[o+"Params"]||{}})})),e&&(t.modules.accessor=n)}lookupAccessor(t){var e=!1;switch(typeof t){case"string":s.accessors[t]?e=s.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":e=t}return e}transformRow(t,e){var n="accessor"+(e.charAt(0).toUpperCase()+e.slice(1)),i=t.getComponent(),o=r.deepClone(t.data||{});return this.table.columnManager.traverse((function(t){var r,a,s,l;t.modules.accessor&&(a=t.modules.accessor[n]||t.modules.accessor.accessor||!1)&&"undefined"!=(r=t.getFieldValue(o))&&(l=t.getComponent(),s="function"==typeof a.params?a.params(r,o,e,l,i):a.params,t.setFieldValue(o,a.accessor(r,o,e,s,l,i)))})),o}}function l(t,e){var n=[];if(e=e||"",Array.isArray(t))t.forEach(((t,i)=>{n=n.concat(l(t,e?e+"["+i+"]":i))}));else if("object"==typeof t)for(var i in t)n=n.concat(l(t[i],e?e+"["+i+"]":i));else n.push({key:e,value:t});return n}function u(t){var e=l(t),n=[];return e.forEach((function(t){n.push(encodeURIComponent(t.key)+"="+encodeURIComponent(t.value))})),n.join("&")}function c(t,e,n){return t&&n&&Object.keys(n).length&&(e.method&&"get"!=e.method.toLowerCase()||(e.method="get",t+=(t.includes("?")?"&":"?")+u(n))),t}function h(t,e){var n=[];if(e=e||"",Array.isArray(t))t.forEach(((t,i)=>{n=n.concat(h(t,e?e+"["+i+"]":i))}));else if("object"==typeof t)for(var i in t)n=n.concat(h(t[i],e?e+"["+i+"]":i));else n.push({key:e,value:t});return n}s.moduleName="accessor",s.accessors={};var d={json:{headers:{"Content-Type":"application/json"},body:function(t,e,n){return JSON.stringify(n)}},form:{headers:{},body:function(t,e,n){var i=h(n),r=new FormData;return i.forEach((function(t){r.append(t.key,t.value)})),r}}};class p extends a{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=p.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||p.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||p.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,n,i){var r=this.table.options.ajaxParams;return r&&("function"==typeof r&&(r=r.call(this.table)),i=Object.assign(Object.assign({},r),i)),i}requestDataCheck(t,e,n,i){return!((t||!this.url)&&"string"!=typeof t)}requestData(t,e,n,i,r){var o;return!r&&this.requestDataCheck(t)?(t&&this.setUrl(t),o=this.generateConfig(n),this.sendRequest(this.url,e,o)):r}setDefaultConfig(t={}){this.config=Object.assign({},p.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,n){return!1!==this.table.options.ajaxRequesting.call(this.table,t,e)?this.loaderPromise(t,n,e).then((n=>(this.table.options.ajaxResponse&&(n=this.table.options.ajaxResponse.call(this.table,t,e,n)),n))):Promise.reject()}}p.moduleName="ajax",p.defaultConfig={method:"GET"},p.defaultURLGenerator=c,p.defaultLoaderPromise=function(t,e,n){var i;return new Promise(((r,o)=>{if(t=this.urlGenerator.call(this.table,t,e,n),"GET"!=e.method.toUpperCase())if(i="object"==typeof this.table.options.ajaxContentType?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType]){for(var a in i.headers)e.headers||(e.headers={}),void 0===e.headers[a]&&(e.headers[a]=i.headers[a]);e.body=i.body.call(this,t,e,n)}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=>{r(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"),r([]))}))},p.contentTypeFormatters=d;class f extends a{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,n,i;this.blocked||(t.preventDefault(),this.customSelection?(e=this.customSelection,this.table.options.clipboardCopyFormatter&&(e=this.table.options.clipboardCopyFormatter("plain",e))):(i=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),e=(n=this.table.modules.export.generateHTMLTable(i))?this.generatePlainContent(i):"",this.table.options.clipboardCopyFormatter&&(e=this.table.options.clipboardCopyFormatter("plain",e),n=this.table.options.clipboardCopyFormatter("html",n))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",e):t.clipboardData&&t.clipboardData.setData?(t.clipboardData.setData("text/plain",e),n&&t.clipboardData.setData("text/html",n)):t.originalEvent&&t.originalEvent.clipboardData.setData&&(t.originalEvent.clipboardData.setData("text/plain",e),n&&t.originalEvent.clipboardData.setData("text/html",n)),this.dispatchExternal("clipboardCopied",e,n),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 n=[];t.columns.forEach((e=>{var i="";if(e)if("group"===t.type&&(e.value=e.component.getKey()),null===e.value)i="";else switch(typeof e.value){case"object":i=JSON.stringify(e.value);break;case"undefined":i="";break;default:i=e.value}n.push(i)})),e.push(n.join("\t"))})),e.join("\n")}copy(t,e){var n,i;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),(n=window.getSelection()).toString()&&e&&(this.customSelection=n.toString()),n.removeAllRanges(),n.addRange(t)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((i=document.body.createTextRange()).moveToElementText(this.table.element),i.select()),document.execCommand("copy"),n&&n.removeAllRanges())}setPasteAction(t){switch(typeof t){case"string":this.pasteAction=f.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=f.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}}paste(t){var e,n,i;this.checkPasteOrigin(t)&&(e=this.getPasteData(t),(n=this.pasteParser.call(this,e))?(t.preventDefault(),this.table.modExists("mutator")&&(n=this.mutateData(n)),i=this.pasteAction.call(this,n),this.dispatchExternal("clipboardPasted",e,n,i)):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}}f.moduleName="clipboard",f.pasteActions={replace:function(t){return this.table.setData(t)},update:function(t){return this.table.updateOrAddData(t)},insert:function(t){return this.table.addData(t)},range:function(t){var e,n,i,r,o,a=[],s=this.table.modules.selectRange.activeRange,l=!1;return o=t.length,s&&(n=(e=s.getBounds()).start,e.start===e.end&&(l=!0),n&&(i=(a=this.table.rowManager.activeRows.slice()).indexOf(n.row),r=l?t.length:a.indexOf(e.end.row)-i+1,i>-1&&(this.table.blockRedraw(),(a=a.slice(i,i+r)).forEach(((e,n)=>{e.updateData(t[n%o])})),this.table.restoreRedraw()))),a}},f.pasteParsers={table:function(t){var e=[],n=!0,i=this.table.columnManager.columns,r=[],o=[];return(t=t.split("\n")).forEach((function(t){e.push(t.split("\t"))})),!(!e.length||1===e.length&&e[0].length<2)&&(e[0].forEach((function(t){var e=i.find((function(e){return t&&e.definition.title&&t.trim()&&e.definition.title.trim()===t.trim()}));e?r.push(e):n=!1})),n||(n=!0,r=[],e[0].forEach((function(t){var e=i.find((function(e){return t&&e.field&&t.trim()&&e.field.trim()===t.trim()}));e?r.push(e):n=!1})),n||(r=this.table.columnManager.columnsByIndex)),n&&e.shift(),e.forEach((function(t){var e={};t.forEach((function(t,n){r[n]&&(e[r[n].field]=t)})),o.push(e)})),o)},range:function(t){var e,n,i,r,o,a=[],s=[],l=this.table.modules.selectRange.activeRange,u=!1;return!!(l&&(n=(e=l.getBounds()).start,e.start===e.end&&(u=!0),n&&((t=t.split("\n")).forEach((function(t){a.push(t.split("\t"))})),a.length&&(o=(r=this.table.columnManager.getVisibleColumnsByIndex()).indexOf(n.column))>-1)))&&(i=u?a[0].length:r.indexOf(e.end.column)-o+1,r=r.slice(o,o+i),a.forEach((t=>{var e={},n=t.length;r.forEach((function(i,r){e[i.field]=t[r%n]})),s.push(e)})),s)}};class g{constructor(t){return this._row=t,new Proxy(this,{get:function(t,e,n){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 m{constructor(t){return this._cell=t,new Proxy(this,{get:function(t,e,n){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 b extends i{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")}_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,n){this.setValueProcessData(t,e,n)&&(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,n){var i=!1;return(this.value!==t||n)&&(i=!0,e&&(t=this.chain("cell-value-changing",[this,t],null,t))),this.setValueActual(t),i&&this.dispatch("cell-value-changed",this),i}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 m(this)),this.component}}class v{constructor(t){return this._column=t,this.type="ColumnComponent",new Proxy(this,{get:function(t,e,n){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.parent instanceof w&&this._column.parent.getComponent()}_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 n=this._column.table.columnManager.findColumn(t);n?this._column.table.columnManager.moveColumn(this._column,n,e):console.warn("Move Error - No matching column found:",n)}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 y={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 w extends i{constructor(t,e){super(e.table),this.definition=t,this.parent=e,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,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 n=new w(t,this);this.attachColumn(n)})),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.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(w.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach((t=>{-1===w.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 n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",(t=>{t.stopPropagation(),n.focus()})),n.addEventListener("mousedown",(t=>{t.stopPropagation()})),n.addEventListener("change",(()=>{t.title=n.value,this.dispatchExternal("columnTitleChanged",this.getComponent())})),e.appendChild(n),t.field?this.langBind("columns|"+t.field,(e=>{n.value=e||t.title||" "})):n.value=t.title||" "}else t.field?this.langBind("columns|"+t.field,(n=>{this._formatColumnHeaderTitle(e,n||t.title||" ")})):this._formatColumnHeaderTitle(e,t.title||" ");return e}_formatColumnHeaderTitle(t,e){var n=this.chain("column-format",[this,e,t],null,(()=>e));switch(typeof n){case"object":n instanceof Node?t.appendChild(n):(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:",n));break;case"undefined":t.innerHTML="";break;default:t.innerHTML=n}}_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,n=t,i=this.fieldStructure,r=i.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.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)}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&&(t=this.maxWidth,console.warn("the minWidth ("+t+"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 n=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 n=t.getWidth();n>e&&(e=n)})),e)){var n=e+1;this.maxInitialWidth&&!t&&(n=Math.min(n,this.maxInitialWidth)),this.setWidthActual(n)}}}updateDefinition(t){var e;return this.isGroup||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({},this.getDefinition()),e=Object.assign(e,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 v(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}}w.defaultOptionList=y;class _{constructor(t){return this._row=t,new Proxy(this,{get:function(t,e,n){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 C extends i{constructor(t,e,n="row"){super(e.table),this.parent=e,this.data={},this.type=n,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,n=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(e=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach((function(t){var e=t.getHeight();e>n&&(n=e)})),this.height=t?Math.max(n,e):this.manualHeight?this.height:Math.max(n,e)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}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)}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,n=this.element&&r.elVisible(this.element),i={};return new Promise(((r,o)=>{"string"==typeof t&&(t=JSON.parse(t)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(i=Object.assign(i,this.data),i=Object.assign(i,t)),e=this.chain("row-data-changing",[this,i,t],null,t);for(let t in e)this.data[t]=e[t];this.dispatch("row-data-save-after",this);for(let i in t)this.table.columnManager.getColumnsByFieldRoot(i).forEach((t=>{let i=this.getCell(t.getField());if(i){let r=t.getFieldValue(e);i.getValue()!==r&&(i.setValueProcessData(r),n&&i.cellRendered())}}));n?(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,n,t),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),r()}))}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 n=this.table.rowManager.findRow(t);n?(this.table.rowManager.moveRowActual(this,n,!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 _(this)),this.component}}var x={avg:function(t,e,n){var i=0,r=void 0!==n.precision?n.precision:2;return t.length&&(i=t.reduce((function(t,e){return Number(t)+Number(e)})),i/=t.length,i=!1!==r?i.toFixed(r):i),parseFloat(i).toString()},max:function(t,e,n){var i=null,r=void 0!==n.precision&&n.precision;return t.forEach((function(t){((t=Number(t))>i||null===i)&&(i=t)})),null!==i?!1!==r?i.toFixed(r):i:""},min:function(t,e,n){var i=null,r=void 0!==n.precision&&n.precision;return t.forEach((function(t){((t=Number(t))(t||0===e)&&t.indexOf(e)===n)).length}};class E extends a{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 w({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,n={topCalcParams:e.topCalcParams||{},botCalcParams:e.bottomCalcParams||{}};if(e.topCalc){switch(typeof e.topCalc){case"string":E.calculations[e.topCalc]?n.topCalc=E.calculations[e.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.topCalc);break;case"function":n.topCalc=e.topCalc}n.topCalc&&(t.modules.columnCalcs=n,this.topCalcs.push(t),"group"!=this.table.options.columnCalcs&&this.initializeTopRow())}if(e.bottomCalc){switch(typeof e.bottomCalc){case"string":E.calculations[e.bottomCalc]?n.botCalc=E.calculations[e.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",e.bottomCalc);break;case"function":n.botCalc=e.bottomCalc}n.botCalc&&(t.modules.columnCalcs=n,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,n;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(e=this.rowsToData(t),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),n=this.generateRow("top",e),this.topRow=n;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(n.getElement()),n.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),n=this.generateRow("bottom",e),this.botRow=n;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(n.getElement()),n.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,n;this.blockCheck()||t&&t.calcs&&(t.calcs.bottom&&(e=this.rowsToData(t.rows),n=this.generateRowData("bottom",e),t.calcs.bottom.updateData(n),t.calcs.bottom.reinitialize()),t.calcs.top&&(e=this.rowsToData(t.rows),n=this.generateRowData("top",e),t.calcs.top.updateData(n),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=[];return t.forEach((t=>{if(e.push(t.getData()),this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs&&t.modules.dataTree&&t.modules.dataTree.open){var n=this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(t));e=e.concat(n)}})),e}generateRow(t,e){var n,i=this.generateRowData(t,e);return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),n=new C(i,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),n.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t),n.component=!1,n.getComponent=()=>(n.component||(n.component=new g(n)),n.component),n.generateCells=()=>{var e=[];this.table.columnManager.columnsByIndex.forEach((i=>{this.genColumn.setField(i.getField()),this.genColumn.hozAlign=i.hozAlign,i.definition[t+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(i.definition[t+"CalcFormatter"]),params:i.definition[t+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=i.definition.cssClass;var r=new b(this.genColumn,n);r.getElement(),r.column=i,r.setWidth(),i.cells.push(r),e.push(r),i.visible||r.hide()})),n.cells=e},n}generateRowData(t,e){var n,i,r={},o="top"==t?this.topCalcs:this.botCalcs,a="top"==t?"topCalc":"botCalc";return o.forEach((function(t){var o=[];t.modules.columnCalcs&&t.modules.columnCalcs[a]&&(e.forEach((function(e){o.push(t.getFieldValue(e))})),i=a+"Params",n="function"==typeof t.modules.columnCalcs[i]?t.modules.columnCalcs[i](o,e):t.modules.columnCalcs[i],t.setFieldValue(r,t.modules.columnCalcs[a](o,e,n)))})),r}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(),n=t.getSubGroups(),i={};return n.forEach((t=>{i[t.getKey()]=this.getGroupResults(t)})),{top:e.calcs.top?e.calcs.top.getData():{},bottom:e.calcs.bottom?e.calcs.bottom.getData():{},groups:i}}adjustForScrollbar(t){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=t+"px":this.botElement.style.paddingRight=t+"px")}}E.moduleName="columnCalcs",E.calculations=x;class M extends a{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,n){return e.dataTreeStartExpanded};break;case"function":this.startOpen=e.dataTreeStartExpanded;break;default:this.startOpen=function(t,n){return e.dataTreeStartExpanded[n]}}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,n){this.redrawNeeded(n)&&(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],n=Array.isArray(e),i=n||!n&&"object"==typeof e&&null!==e;!i&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!i&&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:!!i&&(t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0)),controlEl:!(!t.modules.dataTree||!i)&&t.modules.dataTree.controlEl,branchEl:!(!t.modules.dataTree||!i)&&t.modules.dataTree.branchEl,parent:!!t.modules.dataTree&&t.modules.dataTree.parent,children:i}}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(),n=t.modules.dataTree;n.branchEl&&(n.branchEl.parentNode&&n.branchEl.parentNode.removeChild(n.branchEl),n.branchEl=!1),n.controlEl&&(n.controlEl.parentNode&&n.controlEl.parentNode.removeChild(n.controlEl),n.controlEl=!1),this.generateControlElement(t,e),t.getElement().classList.add("tabulator-tree-level-"+n.index),n.index&&(this.branchEl?(n.branchEl=this.branchEl.cloneNode(!0),e.insertBefore(n.branchEl,e.firstChild),this.table.rtl?n.branchEl.style.marginRight=(n.branchEl.offsetWidth+n.branchEl.style.marginLeft)*(n.index-1)+n.index*this.indent+"px":n.branchEl.style.marginLeft=(n.branchEl.offsetWidth+n.branchEl.style.marginRight)*(n.index-1)+n.index*this.indent+"px"):this.table.rtl?e.style.paddingRight=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-right"))+n.index*this.indent+"px":e.style.paddingLeft=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-left"))+n.index*this.indent+"px")}generateControlElement(t,e){var n=t.modules.dataTree,i=n.controlEl;e=e||t.getCells()[0].getElement(),!1!==n.children&&(n.open?(n.controlEl=this.collapseEl.cloneNode(!0),n.controlEl.addEventListener("click",(e=>{e.stopPropagation(),this.collapseRow(t)}))):(n.controlEl=this.expandEl.cloneNode(!0),n.controlEl.addEventListener("click",(e=>{e.stopPropagation(),this.expandRow(t)}))),n.controlEl.addEventListener("mousedown",(t=>{t.stopPropagation()})),i&&i.parentNode===e?i.parentNode.replaceChild(n.controlEl,i):e.insertBefore(n.controlEl,e.firstChild))}getRows(t){var e=[];return t.forEach(((t,n)=>{var i;e.push(t),t instanceof C&&(t.create(),(i=t.modules.dataTree).index||!1===i.children||this.getChildren(t).forEach((t=>{t.create(),e.push(t)})))})),e}getChildren(t,e){var n=t.modules.dataTree,i=[],r=[];return!1!==n.children&&(n.open||e)&&(Array.isArray(n.children)||(n.children=this.generateChildren(t)),i=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(i),i.forEach((t=>{r.push(t),this.getChildren(t).forEach((t=>{r.push(t)}))}))),r}generateChildren(t){var e=[],n=t.getData()[this.field];return Array.isArray(n)||(n=[n]),n.forEach((n=>{var i=new C(n||{},this.table.rowManager);i.create(),i.modules.dataTree.index=t.modules.dataTree.index+1,i.modules.dataTree.parent=t,i.modules.dataTree.children&&(i.modules.dataTree.open=this.startOpen(i.getComponent(),i.modules.dataTree.index)),e.push(i)})),e}expandRow(t,e){var n=t.modules.dataTree;!1!==n.children&&(n.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,n=[];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 C&&n.push(t)}))),n}rowDelete(t){var e,n=t.modules.dataTree.parent;n&&(!1!==(e=this.findChildIndex(t,n))&&n.data[this.field].splice(e,1),n.data[this.field].length||delete n.data[this.field],this.initializeRow(n),this.layoutRow(n)),this.refreshData(!0)}addTreeChildRow(t,e,n,i){var r=!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!==i&&!1!==(r=this.findChildIndex(i,t))&&t.data[this.field].splice(n?r:r+1,0,e),!1===r&&(n?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 n=!1;return"object"==typeof t?t instanceof C?n=t.data:t instanceof _?n=t._getSelf().data:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?e.modules.dataTree&&(n=e.modules.dataTree.children.find((e=>e instanceof C&&e.element===t)))&&(n=n.data):null===t&&(n=!1):n=void 0!==t&&e.data[this.field].find((e=>e.data[this.table.options.index]==t)),n&&(Array.isArray(e.data[this.field])&&(n=e.data[this.field].indexOf(n)),-1==n&&(n=!1)),n}getTreeChildren(t,e,n){var i=t.modules.dataTree,r=[];return i&&i.children&&(Array.isArray(i.children)||(i.children=this.generateChildren(t)),i.children.forEach((t=>{t instanceof C&&(r.push(e?t.getComponent():t),n&&(r=r.concat(this.getTreeChildren(t,e,n))))}))),r}getChildField(){return this.field}redrawNeeded(t){return!!this.field&&void 0!==t[this.field]||!!this.elementField&&void 0!==t[this.elementField]}}M.moduleName="dataTree";var T={csv:function(t,e={},n){var i=e.delimiter?e.delimiter:",",r=[],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('""')+'"')}})),r.push(e.join(i))}})),o.length&&r.unshift(o.join(i)),r=r.join("\n"),e.bom&&(r="\ufeff"+r),n(r,"text/csv")},json:function(t,e,n){var i=[];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)})),i.push(e)}})),n(i=JSON.stringify(i,null,"\t"),"application/json")},jsonLines:function(t,e,n){const i=[];t.forEach((t=>{const 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)})),i.push(JSON.stringify(e))}})),n(i.join("\n"),"application/x-ndjson")},pdf:function(t,e={},n){var i=[],r=[],o={},a=e.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},s=e.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},l=e.jsPDF||{},u=e.title?e.title:"";function c(t,e){var n=[];return t.columns.forEach((t=>{var i;if(t){switch(typeof t.value){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}i={content:t.value,colSpan:t.width,rowSpan:t.height},e&&(i.styles=e),n.push(i)}})),n}l.orientation||(l.orientation=e.orientation||"landscape"),l.unit||(l.unit="pt"),t.forEach((t=>{switch(t.type){case"header":i.push(c(t));break;case"group":r.push(c(t,a));break;case"calc":r.push(c(t,s));break;case"row":r.push(c(t))}}));var h=new jspdf.jsPDF(l);e.autoTable&&(o="function"==typeof e.autoTable?e.autoTable(h)||{}:e.autoTable),u&&(o.didDrawPage=function(t){h.text(u,40,30)}),o.head=i,o.body=r,h.autoTable(o),e.documentProcessing&&e.documentProcessing(h),n(h.output("arraybuffer"),"application/pdf")},xlsx:function(t,e,n){var r=e.sheetName||"Sheet1",o=XLSX.utils.book_new(),a=new i(this),s=!("compress"in e)||e.compress,l=e.writeOptions||{bookType:"xlsx",bookSST:!0,compression:s};function u(){var e=[],n=[],i={},r={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,i)=>{var r=[];t.columns.forEach((function(t,e){t?(r.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)&&n.push({s:{r:i,c:e},e:{r:i+t.height-1,c:e+t.width-1}})):r.push("")})),e.push(r)})),XLSX.utils.sheet_add_aoa(i,e),i["!ref"]=XLSX.utils.encode_range(r),n.length&&(i["!merges"]=n),i}if(l.type="binary",o.SheetNames=[],o.Sheets={},e.sheetOnly)n(u());else{if(e.sheets)for(var c in e.sheets)!0===e.sheets[c]?(o.SheetNames.push(c),o.Sheets[c]=u()):(o.SheetNames.push(c),a.commsSend(e.sheets[c],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(t){o.Sheets[c]=t}}));else o.SheetNames.push(r),o.Sheets[r]=u();e.documentProcessing&&(o=e.documentProcessing(o)),n(function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),i=0;i!=t.length;++i)n[i]=255&t.charCodeAt(i);return e}(XLSX.write(o,l)),"application/octet-stream")}},html:function(t,e,n){this.modExists("export",!0)&&n(this.modules.export.generateHTMLTable(t),"text/html")}};class k extends a{constructor(t){super(t),this.registerTableOption("downloadEncoder",(function(t,e){return new Blob([t],{type:e})})),this.registerTableOption("downloadReady",void 0),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(){this.deprecationCheck("downloadReady","downloadEncoder")}downloadToTab(t,e,n,i){this.download(t,e,n,i,!0)}download(t,e,n,i,r){var o=!1;if("function"==typeof t?o=t:k.downloaders[t]?o=k.downloaders[t]:console.warn("Download Error - No such download type found: ",t),o){var a=this.generateExportList(i);o.call(this.table,a,n||{},function(n,i){r?!0===r?this.triggerDownload(n,i,t,e,!0):r(n):this.triggerDownload(n,i,t,e)}.bind(this))}}generateExportList(t){var e=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,t||this.table.options.downloadRowRange,"download"),n=this.table.options.groupHeaderDownload;return n&&!Array.isArray(n)&&(n=[n]),e.forEach((t=>{var e;"group"===t.type&&(e=t.columns[0],n&&n[t.indent]&&(e.value=n[t.indent](e.value,t.component._group.getRowCount(),t.component._group.getData(),t.component)))})),e}triggerDownload(t,e,n,i,r){var o=document.createElement("a"),a=this.table.options.downloadEncoder(t,e);a&&(r?window.open(window.URL.createObjectURL(a)):(i=i||"Tabulator."+("function"==typeof n?"txt":n),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(a,i):(o.setAttribute("href",window.URL.createObjectURL(a)),o.setAttribute("download",i),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o))),this.dispatchExternal("downloadComplete"))}commsReceived(t,e,n){"intercept"===e&&this.download(n.type,"",n.options,n.active,n.intercept)}}function D(t,e){var n=e.mask,i=void 0!==e.maskLetterChar?e.maskLetterChar:"A",r=void 0!==e.maskNumberChar?e.maskNumberChar:"9",o=void 0!==e.maskWildcardChar?e.maskWildcardChar:"*";function a(e){var s=n[e];void 0!==s&&s!==o&&s!==i&&s!==r&&(t.value=t.value+""+s,a(e+1))}t.addEventListener("keydown",(e=>{var a=t.value.length,s=e.key;if(e.keyCode>46&&!e.ctrlKey&&!e.metaKey){if(a>=n.length)return e.preventDefault(),e.stopPropagation(),!1;switch(n[a]){case i:if(s.toUpperCase()==s.toLowerCase())return e.preventDefault(),e.stopPropagation(),!1;break;case r:if(isNaN(s))return e.preventDefault(),e.stopPropagation(),!1;break;case o:break;default:if(s!==n[a])return e.preventDefault(),e.stopPropagation(),!1}}})),t.addEventListener("keyup",(n=>{n.keyCode>46&&e.maskAutoFill&&a(t.value.length)})),t.placeholder||(t.placeholder=n),e.maskAutoFill&&a(t.value.length)}k.moduleName="download",k.downloaders=T;class A{constructor(t,e,n,i,r,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:i,cancel:r},this._deprecatedOptionsCheck(),this._initializeValue(),n(this._onRendered.bind(this))}_deprecatedOptionsCheck(){this.params.listItemFormatter&&this.cell.getTable().deprecationAdvisor.msg("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.sortValuesList&&this.cell.getTable().deprecationAdvisor.msg("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchFunc&&this.cell.getTable().deprecationAdvisor.msg("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchingPlaceholder&&this.cell.getTable().deprecationAdvisor.msg("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options")}_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 n in t)"+"==n.charAt(0)?(n=n.slice(1),e.setAttribute(n,e.getAttribute(n)+t["+"+n])):e.setAttribute(n,t[n]);return this.params.mask&&D(e,this.params),this._bindInputEvents(e),e}_initializeParams(t){var e,n=["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=>n.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 n=this.displayItems.find((t=>void 0!==t.label&&t.label.toLowerCase().startsWith(this.filterTerm)));n&&this._focusItem(n),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=[],n=++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===n?this._parseList(t):Promise.reject(n)))):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){return t=c(t,{},this.params.filterRemote?{term:e}:{}),fetch(t).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,n={},i=this.table.getData(this.params.valuesLookup);return(e=t?this.table.columnManager.getColumnByField(t):this.cell.getColumn()._getSelf())?i.forEach((t=>{var i=e.getFieldValue(t);null!=i&&""!==i&&(n[i]=!0)})):(console.warn("unable to find matching column to create select lookup list:",t),n=[]),Object.keys(n)}_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,n){var i={};t.options?i=this._parseListGroup(t,n+1):(i={label:t.label,value:t.value,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:!1,selected:!1,visible:!0,level:n,original:t},this.initialValues&&this.initialValues.indexOf(t.value)>-1&&this._chooseItem(i,!0)),e.push(i)}_parseListGroup(t,e){var n={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,n.options,e)})),n}_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,n)=>t(e.label,n.label,e.value,n.value,e.original,n.original))),e.forEach((e=>{e.group&&this._sortGroup(t,e.options)}))}_defaultSortFunction(t,e){var n,i,r,o,a,s=0,l=/(\d+)|(\D+)/g,u=/\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((n=String(t).toLowerCase())===(i=String(e).toLowerCase()))return 0;if(!u.test(n)||!u.test(i))return n>i?1:-1;for(n=n.match(l),i=i.match(l),a=n.length>i.length?i.length:n.length;so?1:-1;return n.length>i.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((n=>{this._filterItem(t,e,n)}))):this.filtered=!1,this.data}_filterItem(t,e,n){var i=!1;return n.group?(n.options.forEach((n=>{this._filterItem(t,e,n)&&(i=!0)})),n.visible=i):n.visible=t(e,n.label,n.value,n.original),n.visible}_defaultFilterFunc(t,e,n,i){return t=String(t).toLowerCase(),null!=e&&(String(e).toLowerCase().indexOf(t)>-1||String(n).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,n=t.element;if(!this.filtered||t.visible){if(!n){if((n=document.createElement("div")).tabIndex=0,(e=this.params.itemFormatter?this.params.itemFormatter(t.label,t.value,t.original,n):t.label)instanceof HTMLElement?n.appendChild(e):n.innerHTML=e,t.group?n.classList.add("tabulator-edit-list-group"):n.classList.add("tabulator-edit-list-item"),n.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),n.setAttribute(e,this.input.getAttribute(e)+t.elementAttributes["+"+e])):n.setAttribute(e,t.elementAttributes[e]);t.group?n.addEventListener("click",this._groupClick.bind(this,t)):n.addEventListener("click",this._itemClick.bind(this,t)),n.addEventListener("mousedown",this._preventBlur.bind(this)),t.element=n}this._styleItem(t),this.listEl.appendChild(n),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)return void(this.popup&&this.popup.hide(!0));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 n;this.typing=!1,this.params.multiselect?((n=this.currentItems.indexOf(t))>-1?(this.currentItems.splice(n,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,n;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))return void this.actions.cancel();e=this.input.value}else e=this.currentItems[0]?this.currentItems[0].value:null==(n=Array.isArray(this.initialValues)?this.initialValues[0]:this.initialValues)||""===n?n: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 R={input:function(t,e,n,i,r){var o=t.getValue(),a=document.createElement("input");if(a.setAttribute("type",r.search?"search":"text"),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",r.elementAttributes&&"object"==typeof r.elementAttributes)for(let t in r.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),a.setAttribute(t,a.getAttribute(t)+r.elementAttributes["+"+t])):a.setAttribute(t,r.elementAttributes[t]);function s(t){null==o&&""!==a.value||a.value!==o?n(a.value)&&(o=a.value):i()}return a.value=void 0!==o?o:"",e((function(){"cell"===t.getType()&&(a.focus({preventScroll:!0}),a.style.height="100%",r.selectContents&&a.select())})),a.addEventListener("change",s),a.addEventListener("blur",s),a.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:s();break;case 27:i();break;case 35:case 36:t.stopPropagation()}})),r.mask&&D(a,r),a},textarea:function(t,e,n,i,r){var o=t.getValue(),a=r.verticalNavigation||"hybrid",s=String(null!=o?o:""),l=document.createElement("textarea"),u=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",r.elementAttributes&&"object"==typeof r.elementAttributes)for(let t in r.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),l.setAttribute(t,l.getAttribute(t)+r.elementAttributes["+"+t])):l.setAttribute(t,r.elementAttributes[t]);function c(e){null==o&&""!==l.value||l.value!==o?(n(l.value)&&(o=l.value),setTimeout((function(){t.getRow().normalizeHeight()}),300)):i()}return l.value=s,e((function(){"cell"===t.getType()&&(l.focus({preventScroll:!0}),l.style.height="100%",l.scrollHeight,l.style.height=l.scrollHeight+"px",t.getRow().normalizeHeight(),r.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!=u&&(u=e,t.getRow().normalizeHeight())})),l.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:t.shiftKey&&r.shiftEnterSubmit&&c();break;case 27:i();break;case 38:("editor"==a||"hybrid"==a&&l.selectionStart)&&(t.stopImmediatePropagation(),t.stopPropagation());break;case 40:("editor"==a||"hybrid"==a&&l.selectionStart!==l.value.length)&&(t.stopImmediatePropagation(),t.stopPropagation());break;case 35:case 36:t.stopPropagation()}})),r.mask&&D(l,r),l},number:function(t,e,n,i,r){var o=t.getValue(),a=r.verticalNavigation||"editor",s=document.createElement("input");if(s.setAttribute("type","number"),void 0!==r.max&&s.setAttribute("max",r.max),void 0!==r.min&&s.setAttribute("min",r.min),void 0!==r.step&&s.setAttribute("step",r.step),s.style.padding="4px",s.style.width="100%",s.style.boxSizing="border-box",r.elementAttributes&&"object"==typeof r.elementAttributes)for(let t in r.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),s.setAttribute(t,s.getAttribute(t)+r.elementAttributes["+"+t])):s.setAttribute(t,r.elementAttributes[t]);s.value=o;var l=function(t){u()};function u(){var t=s.value;isNaN(t)||""===t||(t=Number(t)),t!==o?n(t)&&(o=t):i()}return e((function(){"cell"===t.getType()&&(s.removeEventListener("blur",l),s.focus({preventScroll:!0}),s.style.height="100%",s.addEventListener("blur",l),r.selectContents&&s.select())})),s.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:u();break;case 27:i();break;case 38:case 40:"editor"==a&&(t.stopImmediatePropagation(),t.stopPropagation());break;case 35:case 36:t.stopPropagation()}})),r.mask&&D(s,r),s},range:function(t,e,n,i,r){var o=t.getValue(),a=document.createElement("input");if(a.setAttribute("type","range"),void 0!==r.max&&a.setAttribute("max",r.max),void 0!==r.min&&a.setAttribute("min",r.min),void 0!==r.step&&a.setAttribute("step",r.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",r.elementAttributes&&"object"==typeof r.elementAttributes)for(let t in r.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),a.setAttribute(t,a.getAttribute(t)+r.elementAttributes["+"+t])):a.setAttribute(t,r.elementAttributes[t]);function s(){var t=a.value;isNaN(t)||""===t||(t=Number(t)),t!=o?n(t)&&(o=t):i()}return a.value=o,e((function(){"cell"===t.getType()&&(a.focus({preventScroll:!0}),a.style.height="100%")})),a.addEventListener("blur",(function(t){s()})),a.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:s();break;case 27:i()}})),a},date:function(t,e,n,i,r){var o=r.format,a=r.verticalNavigation||"editor",s=o?window.DateTime||luxon.DateTime:null,l=t.getValue(),u=document.createElement("input");function c(t){return(s.isDateTime(t)?t:"iso"===o?s.fromISO(String(t)):s.fromFormat(String(t),o)).toFormat("yyyy-MM-dd")}if(u.type="date",u.style.padding="4px",u.style.width="100%",u.style.boxSizing="border-box",r.max&&u.setAttribute("max",o?c(r.max):r.max),r.min&&u.setAttribute("min",o?c(r.min):r.min),r.elementAttributes&&"object"==typeof r.elementAttributes)for(let t in r.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),u.setAttribute(t,u.getAttribute(t)+r.elementAttributes["+"+t])):u.setAttribute(t,r.elementAttributes[t]);function h(){var t,e=u.value;if(null==l&&""!==e||e!==l){if(e&&o)switch(t=s.fromFormat(String(e),"yyyy-MM-dd"),o){case!0:e=t;break;case"iso":e=t.toISO();break;default:e=t.toFormat(o)}n(e)&&(l=u.value)}else i()}return l=void 0!==l?l:"",o&&(s?l=c(l):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),u.value=l,e((function(){"cell"===t.getType()&&(u.focus({preventScroll:!0}),u.style.height="100%",r.selectContents&&u.select())})),u.addEventListener("blur",(function(t){(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==u)&&h()})),u.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:h();break;case 27:i();break;case 35:case 36:t.stopPropagation();break;case 38:case 40:"editor"==a&&(t.stopImmediatePropagation(),t.stopPropagation())}})),u},time:function(t,e,n,i,r){var o,a=r.format,s=r.verticalNavigation||"editor",l=a?window.DateTime||luxon.DateTime:null,u=t.getValue(),c=document.createElement("input");if(c.type="time",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",r.elementAttributes&&"object"==typeof r.elementAttributes)for(let t in r.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),c.setAttribute(t,c.getAttribute(t)+r.elementAttributes["+"+t])):c.setAttribute(t,r.elementAttributes[t]);function h(){var t,e=c.value;if(null==u&&""!==e||e!==u){if(e&&a)switch(t=l.fromFormat(String(e),"hh:mm"),a){case!0:e=t;break;case"iso":e=t.toISO();break;default:e=t.toFormat(a)}n(e)&&(u=c.value)}else i()}return u=void 0!==u?u:"",a&&(l?(o=l.isDateTime(u)?u:"iso"===a?l.fromISO(String(u)):l.fromFormat(String(u),a),u=o.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),console.log("val",u),c.value=u,e((function(){"cell"==t.getType()&&(c.focus({preventScroll:!0}),c.style.height="100%",r.selectContents&&c.select())})),c.addEventListener("blur",(function(t){(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==c)&&h()})),c.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:h();break;case 27:i();break;case 35:case 36:t.stopPropagation();break;case 38:case 40:"editor"==s&&(t.stopImmediatePropagation(),t.stopPropagation())}})),c},datetime:function(t,e,n,i,r){var o,a=r.format,s=r.verticalNavigation||"editor",l=a?window.DateTime||luxon.DateTime:null,u=t.getValue(),c=document.createElement("input");if(c.type="datetime-local",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",r.elementAttributes&&"object"==typeof r.elementAttributes)for(let t in r.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),c.setAttribute(t,c.getAttribute(t)+r.elementAttributes["+"+t])):c.setAttribute(t,r.elementAttributes[t]);function h(){var t,e=c.value;if(null==u&&""!==e||e!==u){if(e&&a)switch(t=l.fromISO(String(e)),a){case!0:e=t;break;case"iso":e=t.toISO();break;default:e=t.toFormat(a)}n(e)&&(u=c.value)}else i()}return u=void 0!==u?u:"",a&&(l?(o=l.isDateTime(u)?u:"iso"===a?l.fromISO(String(u)):l.fromFormat(String(u),a),u=o.toFormat("yyyy-MM-dd")+"T"+o.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),c.value=u,e((function(){"cell"===t.getType()&&(c.focus({preventScroll:!0}),c.style.height="100%",r.selectContents&&c.select())})),c.addEventListener("blur",(function(t){(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==c)&&h()})),c.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:h();break;case 27:i();break;case 35:case 36:t.stopPropagation();break;case 38:case 40:"editor"==s&&(t.stopImmediatePropagation(),t.stopPropagation())}})),c},select:function(t,e,n,i,r){return this.deprecationMsg("The select editor has been deprecated, please use the new list editor"),new A(this,t,e,n,i,r).input},list:function(t,e,n,i,r){return new A(this,t,e,n,i,r).input},autocomplete:function(t,e,n,i,r){return this.deprecationMsg("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam"),r.autocomplete=!0,new A(this,t,e,n,i,r).input},star:function(t,e,n,i,r){var o=this,a=t.getElement(),s=t.getValue(),l=a.getElementsByTagName("svg").length||5,u=a.getElementsByTagName("svg")[0]?a.getElementsByTagName("svg")[0].getAttribute("width"):14,c=[],h=document.createElement("div"),d=document.createElementNS("http://www.w3.org/2000/svg","svg");function p(t){c.forEach((function(e,n){n'):("ie"==o.table.browser?e.setAttribute("class","tabulator-star-inactive"):e.classList.replace("tabulator-star-active","tabulator-star-inactive"),e.innerHTML='')}))}function f(t){var e=document.createElement("span"),i=d.cloneNode(!0);c.push(i),e.addEventListener("mouseenter",(function(e){e.stopPropagation(),e.stopImmediatePropagation(),p(t)})),e.addEventListener("mousemove",(function(t){t.stopPropagation(),t.stopImmediatePropagation()})),e.addEventListener("click",(function(e){e.stopPropagation(),e.stopImmediatePropagation(),n(t),a.blur()})),e.appendChild(i),h.appendChild(e)}function g(t){s=t,p(t)}if(a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",h.style.verticalAlign="middle",h.style.display="inline-block",h.style.padding="4px",d.setAttribute("width",u),d.setAttribute("height",u),d.setAttribute("viewBox","0 0 512 512"),d.setAttribute("xml:space","preserve"),d.style.padding="0 1px",r.elementAttributes&&"object"==typeof r.elementAttributes)for(let t in r.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),h.setAttribute(t,h.getAttribute(t)+r.elementAttributes["+"+t])):h.setAttribute(t,r.elementAttributes[t]);for(var m=1;m<=l;m++)f(m);return p(s=Math.min(parseInt(s),l)),h.addEventListener("mousemove",(function(t){p(0)})),h.addEventListener("click",(function(t){n(0)})),a.addEventListener("blur",(function(t){i()})),a.addEventListener("keydown",(function(t){switch(t.keyCode){case 39:g(s+1);break;case 37:g(s-1);break;case 13:n(s);break;case 27:i()}})),h},progress:function(t,e,n,i,r){var o,a,s=t.getElement(),l=void 0===r.max?s.getElementsByTagName("div")[0]&&s.getElementsByTagName("div")[0].getAttribute("max")||100:r.max,u=void 0===r.min?s.getElementsByTagName("div")[0]&&s.getElementsByTagName("div")[0].getAttribute("min")||0:r.min,c=(l-u)/100,h=t.getValue()||0,d=document.createElement("div"),p=document.createElement("div");function f(){var t=window.getComputedStyle(s,null),e=c*Math.round(p.offsetWidth/((s.clientWidth-parseInt(t.getPropertyValue("padding-left"))-parseInt(t.getPropertyValue("padding-right")))/100))+u;n(e),s.setAttribute("aria-valuenow",e),s.setAttribute("aria-label",h)}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"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",r.elementAttributes&&"object"==typeof r.elementAttributes)for(let t in r.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),p.setAttribute(t,p.getAttribute(t)+r.elementAttributes["+"+t])):p.setAttribute(t,r.elementAttributes[t]);return s.style.padding="4px 4px",h=Math.min(parseFloat(h),l),h=Math.max(parseFloat(h),u),h=Math.round((h-u)/c),p.style.width=h+"%",s.setAttribute("aria-valuemin",u),s.setAttribute("aria-valuemax",l),p.appendChild(d),d.addEventListener("mousedown",(function(t){o=t.screenX,a=p.offsetWidth})),d.addEventListener("mouseover",(function(){d.style.cursor="ew-resize"})),s.addEventListener("mousemove",(function(t){o&&(p.style.width=a+t.screenX-o+"px")})),s.addEventListener("mouseup",(function(t){o&&(t.stopPropagation(),t.stopImmediatePropagation(),o=!1,a=!1,f())})),s.addEventListener("keydown",(function(t){switch(t.keyCode){case 39:t.preventDefault(),p.style.width=p.clientWidth+s.clientWidth/100+"px";break;case 37:t.preventDefault(),p.style.width=p.clientWidth-s.clientWidth/100+"px";break;case 9:case 13:f();break;case 27:i()}})),s.addEventListener("blur",(function(){i()})),p},tickCross:function(t,e,n,i,r){var o=t.getValue(),a=document.createElement("input"),s=r.tristate,l=void 0===r.indeterminateValue?null:r.indeterminateValue,u=!1,c=Object.keys(r).includes("trueValue"),h=Object.keys(r).includes("falseValue");if(a.setAttribute("type","checkbox"),a.style.marginTop="5px",a.style.boxSizing="border-box",r.elementAttributes&&"object"==typeof r.elementAttributes)for(let t in r.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),a.setAttribute(t,a.getAttribute(t)+r.elementAttributes["+"+t])):a.setAttribute(t,r.elementAttributes[t]);function d(t){var e=a.checked;return c&&e?e=r.trueValue:h&&!e&&(e=r.falseValue),s?t?u?l:e:a.checked&&!u?(a.checked=!1,a.indeterminate=!0,u=!0,l):(u=!1,e):e}return a.value=o,!s||void 0!==o&&o!==l&&""!==o||(u=!0,a.indeterminate=!0),"firefox"!=this.table.browser&&"safari"!=this.table.browser&&e((function(){"cell"===t.getType()&&a.focus({preventScroll:!0})})),a.checked=c?o===r.trueValue:!0===o||"true"===o||"True"===o||1===o,a.addEventListener("change",(function(t){n(d())})),a.addEventListener("blur",(function(t){n(d(!0))})),a.addEventListener("keydown",(function(t){13==t.keyCode&&n(d()),27==t.keyCode&&i()})),a}};class S extends a{constructor(t){super(t),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.editors=S.editors,this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableOption("editTriggerEvent","focus"),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))}pasteBlocker(t){if(this.currentCell)return!0}keybindingNavigateNext(t){var e=this.currentCell,n=this.options("tabEndNewRow");e&&(this.navigateNext(e,t)||n&&(e.getElement().firstChild.blur(),this.invalidEdit||(n=!0===n?this.table.addRow({}):"function"==typeof n?this.table.addRow(n(e.row.getComponent())):this.table.addRow(Object.assign({},n))).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 n,i;if(t){if(e&&e.preventDefault(),n=this.navigateLeft())return!0;if((i=this.table.rowManager.prevDisplayRow(t.row,!0))&&(n=this.findPrevEditableCell(i,i.cells.length)))return n.getComponent().edit(),!0}return!1}navigateNext(t=this.currentCell,e){var n,i;if(t){if(e&&e.preventDefault(),n=this.navigateRight())return!0;if((i=this.table.rowManager.nextDisplayRow(t.row,!0))&&(n=this.findNextEditableCell(i,-1)))return n.getComponent().edit(),!0}return!1}navigateLeft(t=this.currentCell,e){var n,i;return!!(t&&(e&&e.preventDefault(),n=t.getIndex(),i=this.findPrevEditableCell(t.row,n)))&&(i.getComponent().edit(),!0)}navigateRight(t=this.currentCell,e){var n,i;return!!(t&&(e&&e.preventDefault(),n=t.getIndex(),i=this.findNextEditableCell(t.row,n)))&&(i.getComponent().edit(),!0)}navigateUp(t=this.currentCell,e){var n,i;return!!(t&&(e&&e.preventDefault(),n=t.getIndex(),i=this.table.rowManager.prevDisplayRow(t.row,!0)))&&(i.cells[n].getComponent().edit(),!0)}navigateDown(t=this.currentCell,e){var n,i;return!!(t&&(e&&e.preventDefault(),n=t.getIndex(),i=this.table.rowManager.nextDisplayRow(t.row,!0)))&&(i.cells[n].getComponent().edit(),!0)}findNextEditableCell(t,e){var n=!1;if(e0)for(var i=e-1;i>=0;i--){let e=t.cells[i];if(e.column.modules.edit&&r.elVisible(e.getElement())&&this.allowEdit(e)){n=e;break}}return n}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={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{}};switch(typeof t.definition.editor){case"string":this.editors[t.definition.editor]?e.editor=this.editors[t.definition.editor]:console.warn("Editor Error - No such editor found: ",t.definition.editor);break;case"function":e.editor=t.definition.editor;break;case"boolean":!0===t.definition.editor&&("function"!=typeof t.definition.formatter?this.editors[t.definition.formatter]?e.editor=this.editors[t.definition.formatter]:e.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter))}e.editor&&(t.modules.edit=e)}getCurrentCell(){return!!this.currentCell&&this.currentCell.getComponent()}clearEditor(t){var e,n=this.currentCell;if(this.invalidEdit=!1,n){for(this.currentCell=!1,e=n.getElement(),this.dispatch("edit-editor-clear",n,t),e.classList.remove("tabulator-editing");e.firstChild;)e.removeChild(e.firstChild);n.row.getElement().classList.remove("tabulator-editing"),n.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,n=t.getElement(!0);this.updateCellClass(t),n.setAttribute("tabindex",0),n.addEventListener("mousedown",(function(t){2===t.button?t.preventDefault():e.mouseClick=!0})),"dblclick"===this.options("editTriggerEvent")&&n.addEventListener("dblclick",(function(i){n.classList.contains("tabulator-editing")||(n.focus({preventScroll:!0}),e.edit(t,i,!1))})),"focus"!==this.options("editTriggerEvent")&&"click"!==this.options("editTriggerEvent")||n.addEventListener("click",(function(i){n.classList.contains("tabulator-editing")||(n.focus({preventScroll:!0}),e.edit(t,i,!1))})),"focus"===this.options("editTriggerEvent")&&n.addEventListener("focus",(function(n){e.recursionBlock||e.edit(t,n,!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,n=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,i=t.row.getElement();i.offsetTopn&&(this.table.rowManager.element.scrollTop+=i.offsetTop+i.offsetHeight-n);var r=this.table.rowManager.element.scrollLeft,o=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,a=t.getElement();this.table.modExists("frozenColumns")&&(r+=parseInt(this.table.modules.frozenColumns.leftMargin||0),o-=parseInt(this.table.modules.frozenColumns.rightMargin||0)),"virtual"===this.table.options.renderHorizontal&&(r-=parseInt(this.table.columnManager.renderer.vDomPadLeft),o-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),a.offsetLefto&&(this.table.rowManager.element.scrollLeft+=a.offsetLeft+a.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,n){var i,r,o,a=this,s=function(){},l=t.getElement(),u=!1;if(!this.currentCell){if(t.column.modules.edit.blocked)return this.mouseClick=!1,this.blur(l),!1;if(e&&e.stopPropagation(),this.allowEdit(t)||n){if(a.cancelEdit(),a.currentCell=t,this.focusScrollAdjust(t),r=t.getComponent(),this.mouseClick&&(this.mouseClick=!1,t.column.definition.cellClick&&t.column.definition.cellClick.call(this.table,e,r)),t.column.definition.cellEditing&&t.column.definition.cellEditing.call(this.table,r),this.dispatch("cell-editing",t),this.dispatchExternal("cellEditing",r),o="function"==typeof t.column.modules.edit.params?t.column.modules.edit.params(r):t.column.modules.edit.params,i=t.column.modules.edit.editor.call(a,r,(function(t){s=t}),(function(e){if(a.currentCell===t&&!u){var n=a.chain("edit-success",[t,e],!0,!0);return!0===n||"highlight"===a.table.options.validationMode?(u=!0,a.clearEditor(),t.modules.edit||(t.modules.edit={}),t.modules.edit.edited=!0,-1==a.editedCells.indexOf(t)&&a.editedCells.push(t),t.setValue(e,!0),!0===n):(u=!0,a.invalidEdit=!0,a.focusCellNoEvent(t,!0),s(),setTimeout((()=>{u=!1}),10),!1)}}),(function(){a.currentCell!==t||u||a.cancelEdit()}),o),!this.currentCell||!1===i)return this.blur(l),!1;if(!(i instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",i),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(i),s();for(var c=l.children,h=0;h{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)}}S.moduleName="edit",S.editors=R;class P{constructor(t,e,n,i){this.type=t,this.columns=e,this.component=n||!1,this.indent=i||0}}class L{constructor(t,e,n,i,r){this.value=t,this.component=e||!1,this.width=n,this.height=i,this.depth=r}}class O extends a{constructor(t){super(t),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(t,e,n,i){var r,o;if(this.cloneTableStyle=e,this.config=t||{},this.colVisProp=i,"range"===n){var a=this.table.modules.selectRange.selectedColumns();r=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders(a)):[],o=this.bodyToExportRows(this.rowLookup(n),this.table.modules.selectRange.selectedColumns(!0))}else r=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],o=this.bodyToExportRows(this.rowLookup(n));return r.concat(o)}generateTable(t,e,n,i){var r=this.generateExportList(t,e,n,i);return this.generateTableElement(r)}rowLookup(t){var e=[];if("function"==typeof t)t.call(this.table).forEach((t=>{(t=this.table.rowManager.findRow(t))&&e.push(t)}));else switch(t){case!0:case"visible":e=this.table.rowManager.getVisibleRows(!1,!0);break;case"all":e=this.table.rowManager.rows;break;case"selected":e=this.table.modules.selectRow.selectedRows;break;case"range":e=this.table.modules.selectRange.selectedRows();break;default:e=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return 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 n=this.processColumnGroup(t);n&&e.push(n)})),e}processColumnGroup(t){var e=t.columns,n=0,i={title:t.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||t.definition.title,column:t,depth:1};if(e.length){if(i.subGroups=[],i.width=0,e.forEach((t=>{var e=this.processColumnGroup(t);e&&(i.width+=e.width,i.subGroups.push(e),e.depth>n&&(n=e.depth))})),i.depth+=n,!i.width)return!1}else{if(!this.columnVisCheck(t))return!1;i.width=1}return i}columnVisCheck(t){var e=t.definition[this.colVisProp];return"function"==typeof e&&(e=e.call(this.table,t.getComponent())),!1!==e&&(t.visible||!t.visible&&e)}headersToExportRows(t){var e=[],n=0,i=[];function r(t,i){var o=n-i;if(void 0===e[i]&&(e[i]=[]),t.height=t.subGroups?1:o-t.depth+1,e[i].push(t),t.height>1)for(let n=1;n1)for(let n=1;nn&&(n=t.depth)})),t.forEach((function(t){r(t,0)})),e.forEach((t=>{var e=[];t.forEach((t=>{if(t){let n=void 0===t.title?"":t.title;e.push(new L(n,t.column.getComponent(),t.width,t.height,t.depth))}else e.push(null)})),i.push(new P("header",e))})),i}bodyToExportRows(t,e=[]){var n=[];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,i)=>{var r=t.getData(this.colVisProp),o=[],a=0;switch(t.type){case"group":a=t.level,o.push(new L(t.key,t.getComponent(),e.length,1));break;case"calc":case"row":e.forEach((t=>{o.push(new L(t._column.getFieldValue(r),t,1,1))})),this.table.options.dataTree&&!1!==this.config.dataTree&&(a=t.modules.dataTree.index)}n.push(new P(t.type,o,t.getComponent(),a))})),n}generateTableElement(t){var e=document.createElement("table"),n=document.createElement("thead"),i=document.createElement("tbody"),r=this.lookupTableStyles(),o=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],a={};return a.rowFormatter=null!==o?o:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(a.treeElementField=this.table.modules.dataTree.elementField),a.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],a.groupHeader&&!Array.isArray(a.groupHeader)&&(a.groupHeader=[a.groupHeader]),e.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),n,["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":n.appendChild(this.generateHeaderElement(t,a,r));break;case"group":i.appendChild(this.generateGroupElement(t,a,r));break;case"calc":i.appendChild(this.generateCalcElement(t,a,r));break;case"row":o=this.generateRowElement(t,a,r),this.mapElementStyles(e%2&&r.evenRow?r.evenRow:r.oddRow,o,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),i.appendChild(o)}})),n.innerHTML&&e.appendChild(n),e.appendChild(i),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.firstCell=t.styleCells[0],t.lastCell=t.styleCells[t.styleCells.length-1])),t}generateHeaderElement(t,e,n){var i=document.createElement("tr");return t.columns.forEach((t=>{if(t){var e=document.createElement("th"),n=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"),n.forEach((function(t){e.classList.add(t)})),this.mapElementStyles(t.component.getElement(),e,["text-align","border-top","border-left","border-right","border-bottom","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&&this.mapElementStyles(t.component._column.parent.groupElement,e,["border-top"]),i.appendChild(e)}})),i}generateGroupElement(t,e,n){var i=document.createElement("tr"),r=document.createElement("td"),o=t.columns[0];return i.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)),r.colSpan=o.width,r.innerHTML=o.value,i.classList.add("tabulator-print-table-group"),i.classList.add("tabulator-group-level-"+t.indent),o.component.isVisible()&&i.classList.add("tabulator-group-visible"),this.mapElementStyles(n.firstGroup,i,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(n.firstGroup,r,["padding-top","padding-left","padding-right","padding-bottom"]),i.appendChild(r),i}generateCalcElement(t,e,n){var i=this.generateRowElement(t,e,n);return i.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(n.calcRow,i,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),i}generateRowElement(t,e,n){var i=document.createElement("tr");return i.classList.add("tabulator-print-table-row"),t.columns.forEach(((r,o)=>{if(r){var a,s=document.createElement("td"),l=r.component._column,u=this.table,c=u.columnManager.findColumnIndex(l),h=r.value,d={modules:{},getValue:function(){return h},getField:function(){return l.definition.field},getElement:function(){return s},getType:function(){return"cell"},getColumn:function(){return l.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getTable:function(){return u},getComponent:function(){return d},column:l};if((l.definition.cssClass?l.definition.cssClass.split(" "):[]).forEach((function(t){s.classList.add(t)})),this.table.modExists("format")&&!1!==this.config.formatCells)h=this.table.modules.format.formatExportValue(d,this.colVisProp);else switch(typeof h){case"object":h=null!==h?JSON.stringify(h):"";break;case"undefined":h=""}h instanceof Node?s.appendChild(h):s.innerHTML=h,(a=n.styleCells&&n.styleCells[c]?n.styleCells[c]:n.firstCell)&&(this.mapElementStyles(a,s,["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"]),l.definition.align&&(s.style.textAlign=l.definition.align)),this.table.options.dataTree&&!1!==this.config.dataTree&&(e.treeElementField&&e.treeElementField==l.field||!e.treeElementField&&0==o)&&(t.component._row.modules.dataTree.controlEl&&s.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),s.firstChild),t.component._row.modules.dataTree.branchEl&&s.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),s.firstChild)),i.appendChild(s),d.modules.format&&d.modules.format.renderedCallback&&d.modules.format.renderedCallback()}})),e.rowFormatter&&"row"===t.type&&!1!==this.config.formatCells&&(Object.assign(t.component).getElement=function(){return i},e.rowFormatter(t.component)),i}generateHTMLTable(t){var e=document.createElement("div");return e.appendChild(this.generateTableElement(t)),e.innerHTML}getHtml(t,e,n,i){var r=this.generateExportList(n||this.table.options.htmlOutputConfig,e,t,i||"htmlOutput");return this.generateHTMLTable(r)}mapElementStyles(t,e,n){if(this.cloneTableStyle&&t&&e){var i={"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 r=window.getComputedStyle(t);n.forEach((function(t){e.style[i[t]]||(e.style[i[t]]=r.getPropertyValue(t))}))}}}}O.moduleName="export";var F={"=":function(t,e,n,i){return e==t},"<":function(t,e,n,i){return e":function(t,e,n,i){return e>t},">=":function(t,e,n,i){return e>=t},"!=":function(t,e,n,i){return e!=t},regex:function(t,e,n,i){return"string"==typeof t&&(t=new RegExp(t)),t.test(e)},like:function(t,e,n,i){return null==t?e===t:null!=e&&String(e).toLowerCase().indexOf(t.toLowerCase())>-1},keywords:function(t,e,n,i){var r=t.toLowerCase().split(void 0===i.separator?" ":i.separator),o=String(null==e?"":e).toLowerCase(),a=[];return r.forEach((t=>{o.includes(t)&&a.push(!0)})),i.matchAll?a.length===r.length:!!a.length},starts:function(t,e,n,i){return null==t?e===t:null!=e&&String(e).toLowerCase().startsWith(t.toLowerCase())},ends:function(t,e,n,i){return null==t?e===t:null!=e&&String(e).toLowerCase().endsWith(t.toLowerCase())},in:function(t,e,n,i){return Array.isArray(t)?!t.length||t.indexOf(e)>-1:(console.warn("Filter Error - filter value is not an array:",t),!1)}};class z extends a{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,n,i){return i.filter=this.getFilters(!0,!0),i}generatePlaceholder(t){if(this.table.options.placeholderHeaderFilter&&Object.keys(this.headerFilters).length)return this.table.options.placeholderHeaderFilter}userSetFilter(t,e,n,i){this.setFilter(t,e,n,i),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(t,e,n,i){this.addFilter(t,e,n,i),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 n=this.table.columnManager.findColumn(t);if(!n)return console.warn("Column Filter Error - No matching column found:",t),!1;this.setHeaderFilterValue(n,e)}userRemoveFilter(t,e,n){this.removeFilter(t,e,n),this.refreshFilter()}userClearFilter(t){this.clearFilter(t),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(t,e,n){return this.search("rows",t,e,n)}searchData(t,e,n){return this.search("data",t,e,n)}initializeColumnHeaderFilter(t){t.definition.headerFilter&&this.initializeColumn(t)}initializeColumn(t,e){var n=this,i=t.getField();t.modules.filter={success:function(e){var r,o="input"==t.modules.filter.tagType&&"text"==t.modules.filter.attrType||"textarea"==t.modules.filter.tagType?"partial":"match",a="",s="";if(void 0===t.modules.filter.prevSuccess||t.modules.filter.prevSuccess!==e){if(t.modules.filter.prevSuccess=e,t.modules.filter.emptyFunc(e))delete n.headerFilters[i];else{switch(t.modules.filter.value=e,typeof t.definition.headerFilterFunc){case"string":z.filters[t.definition.headerFilterFunc]?(a=t.definition.headerFilterFunc,r=function(n){var i=t.definition.headerFilterFuncParams||{},r=t.getFieldValue(n);return i="function"==typeof i?i(e,r,n):i,z.filters[t.definition.headerFilterFunc](e,r,n,i)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":a=r=function(n){var i=t.definition.headerFilterFuncParams||{},r=t.getFieldValue(n);return i="function"==typeof i?i(e,r,n):i,t.definition.headerFilterFunc(e,r,n,i)}}r||("partial"===o?(r=function(n){var i=t.getFieldValue(n);return null!=i&&String(i).toLowerCase().indexOf(String(e).toLowerCase())>-1},a="like"):(r=function(n){return t.getFieldValue(n)==e},a="=")),n.headerFilters[i]={value:e,func:r,type:a}}t.modules.filter.value=e,s=JSON.stringify(n.headerFilters),n.prevHeaderFilterChangeCheck!==s&&(n.prevHeaderFilterChangeCheck=s,n.trackChanges(),n.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)}generateHeaderFilterElement(t,e,n){var i,r,o,a,s,l,u,c,h=this,d=t.modules.filter.success,p=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),p){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(t){return!t&&0!==t},(i=document.createElement("div")).classList.add("tabulator-header-filter"),typeof t.definition.headerFilter){case"string":h.table.modules.edit.editors[t.definition.headerFilter]?(r=h.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":r=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?r=t.modules.edit.editor:t.definition.formatter&&h.table.modules.edit.editors[t.definition.formatter]?(r=h.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})):r=h.table.modules.edit.editors.input}if(r){if(a={getValue:function(){return void 0!==e?e:""},getField:function(){return t.definition.field},getElement:function(){return i},getColumn:function(){return t.getComponent()},getTable:()=>this.table,getType:()=>"header",getRow:function(){return{normalizeHeight:function(){}}}},u="function"==typeof(u=t.definition.headerFilterParams||{})?u.call(h.table,a):u,!(o=r.call(this.table.modules.edit,a,(function(t){c=t}),d,(function(){}),u)))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(o instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",o);h.langBind("headerFilters|columns|"+t.definition.field,(function(e){o.setAttribute("placeholder",void 0!==e&&e?e:t.definition.headerFilterPlaceholder||h.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))})),s=!1,l=function(t){s&&clearTimeout(s),s=setTimeout((function(){d(o.value)}),h.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()}))),i.appendChild(o),t.contentElement.appendChild(i),n||h.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,n,i){this.filterList=[],Array.isArray(t)||(t=[{field:t,type:e,value:n,params:i}]),this.addFilter(t)}addFilter(t,e,n,i){var r=!1;Array.isArray(t)||(t=[{field:t,type:e,value:n,params:i}]),t.forEach((t=>{(t=this.findFilter(t))&&(this.filterList.push(t),r=!0)})),r&&this.trackChanges()}findFilter(t){var e;if(Array.isArray(t))return this.findSubFilters(t);var n=!1;return"function"==typeof t.field?n=function(e){return t.field(e,t.type||{})}:z.filters[t.type]?n=(e=this.table.columnManager.getColumnByField(t.field))?function(n){return z.filters[t.type](t.value,e.getFieldValue(n),n,t.params||{})}:function(e){return z.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=n,!!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 n=[];return t&&(n=this.getHeaderFilters()),e&&n.forEach((function(t){"function"==typeof t.type&&(t.type="function")})),n.concat(this.filtersToArray(this.filterList,e))}filtersToArray(t,e){var n=[];return t.forEach((t=>{var i;Array.isArray(t)?n.push(this.filtersToArray(t,e)):(i={field:t.field,type:t.type,value:t.value},e&&"function"==typeof i.type&&(i.type="function"),n.push(i))})),n}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,n){Array.isArray(t)||(t=[{field:t,type:e,value:n}]),t.forEach((t=>{var e;(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,n,i){var r=[],o=[];return Array.isArray(e)||(e=[{field:e,type:n,value:i}]),e.forEach((t=>{(t=this.findFilter(t))&&o.push(t)})),this.table.rowManager.rows.forEach((e=>{var n=!0;o.forEach((t=>{this.filterRecurse(t,e.getData())||(n=!1)})),n&&r.push("data"===t?e.getData("data"):e.getComponent())})),r}filter(t,e){var n=[],i=[];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)&&n.push(t)})):n=t.slice(0),this.subscribedExternal("dataFiltered")&&(n.forEach((t=>{i.push(t.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),i)),n}filterRow(t,e){var n=!0,i=t.getData();for(var r in this.filterList.forEach((t=>{this.filterRecurse(t,i)||(n=!1)})),this.headerFilters)this.headerFilters[r].func(i)||(n=!1);return n}filterRecurse(t,e){var n=!1;return Array.isArray(t)?t.forEach((t=>{this.filterRecurse(t,e)&&(n=!0)})):n=t.func(e),n}}z.moduleName="filter",z.filters=F;var B={plaintext:function(t,e,n){return this.emptyToSpace(this.sanitizeHTML(t.getValue()))},html:function(t,e,n){return t.getValue()},textarea:function(t,e,n){return t.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(t.getValue()))},money:function(t,e,n){var i,r,o,a,s,l=parseFloat(t.getValue()),u="",c=e.decimal||".",h=e.thousand||",",d=e.negativeSign||"-",p=e.symbol||"",f=!!e.symbolAfter,g=void 0!==e.precision?e.precision:2;if(isNaN(l))return this.emptyToSpace(this.sanitizeHTML(t.getValue()));if(l<0&&(l=Math.abs(l),u=d),i=!1!==g?l.toFixed(g):l,r=(i=String(i).split("."))[0],o=i.length>1?c+i[1]:"",!1!==e.thousand)for(a=/(\d+)(\d{3})/;a.test(r);)r=r.replace(a,"$1"+h+"$2");return s=r+o,!0===u?(s="("+s+")",f?s+p:p+s):f?u+s+p:u+p+s},link:function(t,e,n){var i,o=t.getValue(),a=e.urlPrefix||"",s=e.download,l=o,u=document.createElement("a");if(e.labelField&&(i=t.getData(),l=function t(e,n){var i=n[e.shift()];return e.length&&"object"==typeof i?t(e,i):i}(e.labelField.split(this.table.options.nestedFieldSeparator),i)),e.label)switch(typeof e.label){case"string":l=e.label;break;case"function":l=e.label(t)}if(l){if(e.urlField&&(i=t.getData(),o=r.retrieveNestedData(this.table.options.nestedFieldSeparator,e.urlField,i)),e.url)switch(typeof e.url){case"string":o=e.url;break;case"function":o=e.url(t)}return u.setAttribute("href",a+o),e.target&&u.setAttribute("target",e.target),e.download&&(s="function"==typeof s?s(t):!0===s?"":s,u.setAttribute("download",s)),u.innerHTML=this.emptyToSpace(this.sanitizeHTML(l)),u}return" "},image:function(t,e,n){var i=document.createElement("img"),r=t.getValue();switch(e.urlPrefix&&(r=e.urlPrefix+t.getValue()),e.urlSuffix&&(r+=e.urlSuffix),i.setAttribute("src",r),typeof e.height){case"number":i.style.height=e.height+"px";break;case"string":i.style.height=e.height}switch(typeof e.width){case"number":i.style.width=e.width+"px";break;case"string":i.style.width=e.width}return i.addEventListener("load",(function(){t.getRow().normalizeHeight()})),i},tickCross:function(t,e,n){var i=t.getValue(),r=t.getElement(),o=e.allowEmpty,a=e.allowTruthy,s=Object.keys(e).includes("trueValue"),l=void 0!==e.tickElement?e.tickElement:'',u=void 0!==e.crossElement?e.crossElement:'';return s&&i===e.trueValue||!s&&(a&&i||!0===i||"true"===i||"True"===i||1===i||"1"===i)?(r.setAttribute("aria-checked",!0),l||""):!o||"null"!==i&&""!==i&&null!=i?(r.setAttribute("aria-checked",!1),u||""):(r.setAttribute("aria-checked","mixed"),"")},datetime:function(t,e,n){var i,r=window.DateTime||luxon.DateTime,o=e.inputFormat||"yyyy-MM-dd HH:mm:ss",a=e.outputFormat||"dd/MM/yyyy HH:mm:ss",s=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",l=t.getValue();if(void 0!==r)return(i=r.isDateTime(l)?l:"iso"===o?r.fromISO(String(l)):r.fromFormat(String(l),o)).isValid?(e.timezone&&(i=i.setZone(e.timezone)),i.toFormat(a)):!0!==s&&l?"function"==typeof s?s(l):s:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(t,e,n){var i,r=window.DateTime||luxon.DateTime,o=e.inputFormat||"yyyy-MM-dd HH:mm:ss",a=void 0!==e.invalidPlaceholder?e.invalidPlaceholder:"",s=void 0!==e.suffix&&e.suffix,l=void 0!==e.unit?e.unit:"days",u=void 0!==e.humanize&&e.humanize,c=void 0!==e.date?e.date:r.now(),h=t.getValue();if(void 0!==r)return(i=r.isDateTime(h)?h:"iso"===o?r.fromISO(String(h)):r.fromFormat(String(h),o)).isValid?u?i.diff(c,l).toHuman()+(s?" "+s:""):parseInt(i.diff(c,l)[l])+(s?" "+s:""):!0===a?h:"function"==typeof a?a(h):a;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(t,e,n){var i=t.getValue();return void 0===e[i]?(console.warn("Missing display value for "+i),i):e[i]},star:function(t,e,n){var i=t.getValue(),r=t.getElement(),o=e&&e.stars?e.stars:5,a=document.createElement("span"),s=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.verticalAlign="middle",s.setAttribute("width","14"),s.setAttribute("height","14"),s.setAttribute("viewBox","0 0 512 512"),s.setAttribute("xml:space","preserve"),s.style.padding="0 1px",i=i&&!isNaN(i)?parseInt(i):0,i=Math.max(0,Math.min(i,o));for(var l=1;l<=o;l++){var u=s.cloneNode(!0);u.innerHTML=l<=i?'':'',a.appendChild(u)}return r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",r.setAttribute("aria-label",i),a},traffic:function(t,e,n){var i,r,o=this.sanitizeHTML(t.getValue())||0,a=document.createElement("span"),s=e&&e.max?e.max:100,l=e&&e.min?e.min:0,u=e&&void 0!==e.color?e.color:["red","orange","green"],c="#666666";if(!isNaN(o)&&void 0!==t.getValue()){switch(a.classList.add("tabulator-traffic-light"),r=parseFloat(o)<=s?parseFloat(o):s,r=parseFloat(r)>=l?parseFloat(r):l,i=(s-l)/100,r=Math.round((r-l)/i),typeof u){case"string":c=u;break;case"function":c=u(o);break;case"object":if(Array.isArray(u)){var h=100/u.length,d=Math.floor(r/h);d=Math.min(d,u.length-1),c=u[d=Math.max(d,0)];break}}return a.style.backgroundColor=c,a}},progress:function(t,e={},n){var i,r,o,a,s,l=this.sanitizeHTML(t.getValue())||0,u=t.getElement(),c=e.max?e.max:100,h=e.min?e.min:0,d=e.legendAlign?e.legendAlign:"center";switch(r=parseFloat(l)<=c?parseFloat(l):c,r=parseFloat(r)>=h?parseFloat(r):h,i=(c-h)/100,r=Math.round((r-h)/i),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=100/e.color.length,n=Math.floor(r/t);n=Math.min(n,e.color.length-1),n=Math.max(n,0),o=e.color[n];break}default:o="#2DC214"}switch(typeof e.legend){case"string":a=e.legend;break;case"function":a=e.legend(l);break;case"boolean":a=l;break;default:a=!1}switch(typeof e.legendColor){case"string":s=e.legendColor;break;case"function":s=e.legendColor(l);break;case"object":if(Array.isArray(e.legendColor)){let t=100/e.legendColor.length,n=Math.floor(r/t);n=Math.min(n,e.legendColor.length-1),n=Math.max(n,0),s=e.legendColor[n]}break;default:s="#000"}u.style.minWidth="30px",u.style.position="relative",u.setAttribute("aria-label",r);var p=document.createElement("div");p.style.display="inline-block",p.style.width=r+"%",p.style.backgroundColor=o,p.style.height="100%",p.setAttribute("data-max",c),p.setAttribute("data-min",h);var f=document.createElement("div");if(f.style.position="relative",f.style.width="100%",f.style.height="100%",a){var g=document.createElement("div");g.style.position="absolute",g.style.top=0,g.style.left=0,g.style.textAlign=d,g.style.width="100%",g.style.color=s,g.innerHTML=a}return n((function(){if(!(t instanceof m)){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",u.appendChild(e),u=e}u.appendChild(f),f.appendChild(p),a&&f.appendChild(g)})),""},color:function(t,e,n){return t.getElement().style.backgroundColor=this.sanitizeHTML(t.getValue()),""},buttonTick:function(t,e,n){return''},buttonCross:function(t,e,n){return''},rownum:function(t,e,n){var i=document.createElement("span"),r=t.getRow(),o=t.getTable();return r.watchPosition((t=>{e.relativeToPage&&(t+=o.modules.page.getPageSize()*(o.modules.page.getPage()-1)),i.innerText=t})),i},handle:function(t,e,n){return t.getElement().classList.add("tabulator-row-handle"),"
    "},responsiveCollapse:function(t,e,n){var i=document.createElement("div"),r=t.getRow()._row.modules.responsiveLayout;function o(t){var e=r.element;r.open=t,e&&(r.open?(i.classList.add("open"),e.style.display=""):(i.classList.remove("open"),e.style.display="none"))}return i.classList.add("tabulator-responsive-collapse-toggle"),i.innerHTML='\n \n \n\n\n\n \n',t.getElement().classList.add("tabulator-row-handle"),i.addEventListener("click",(function(e){e.stopImmediatePropagation(),o(!r.open),t.getTable().rowManager.adjustTableSize()})),o(r.open),i},rowSelection:function(t,e,n){var i=document.createElement("input"),r=!1;if(i.type="checkbox",i.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(i.addEventListener("click",(t=>{t.stopPropagation()})),"function"==typeof t.getRow){var o=t.getRow();o instanceof _?(i.addEventListener("change",(t=>{"click"===this.table.options.selectableRowsRangeMode&&r?r=!1:o.toggleSelect()})),"click"===this.table.options.selectableRowsRangeMode&&i.addEventListener("click",(t=>{r=!0,this.table.modules.selectRow.handleComplexRowClick(o._row,t)})),i.checked=o.isSelected&&o.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(o,i)):i=""}else i.addEventListener("change",(t=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(e.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(i);return i}};class N extends a{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 n={params:t.definition["formatter"+e+"Params"]||{}},i=t.definition["formatter"+e];switch(typeof i){case"string":N.formatters[i]?n.formatter=N.formatters[i]:(console.warn("Formatter Error - No such formatter found: ",i),n.formatter=N.formatters.plaintext);break;case"function":n.formatter=i;break;default:n.formatter=N.formatters.plaintext}return n}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,n){var i,r,o,a;return t.definition.titleFormatter?(i=this.getFormatter(t.definition.titleFormatter),o=e=>{t.titleFormatterRendered=e},a={getValue:function(){return e},getElement:function(){return n},getType:function(){return"header"},getColumn:function(){return t.getComponent()},getTable:()=>this.table},r="function"==typeof(r=t.definition.titleFormatterParams||{})?r():r,i.call(this,a,r,o)):e}formatValue(t){var e=t.getComponent(),n="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,n,(function(e){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=e,t.modules.format.rendered=!1}))}formatExportValue(t,e){var n,i=t.column.modules.format[e];if(i){function r(e){t.modules.format||(t.modules.format={}),t.modules.format.renderedCallback=e,t.modules.format.rendered=!1}return n="function"==typeof i.params?i.params(t.getComponent()):i.params,i.formatter.call(this,t.getComponent(),n,r)}return this.formatValue(t)}sanitizeHTML(t){if(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=/]/g,(function(t){return e[t]}))}return t}emptyToSpace(t){return null==t||""===t?" ":t}getFormatter(t){switch(typeof t){case"string":N.formatters[t]?t=N.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=N.formatters.plaintext);break;case"function":break;default:t=N.formatters.plaintext}return t}}N.moduleName="format",N.formatters=B;class I extends a{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=[],n=0,i=0;this.leftColumns.forEach(((i,r)=>{if(i.modules.frozen.marginValue=n,i.modules.frozen.margin=i.modules.frozen.marginValue+"px",i.visible&&(n+=i.getWidth()),r==this.leftColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup){var o=this.getColGroupParentElement(i);e.includes(o)||(this.layoutElement(o,i),e.push(o)),o.classList.toggle("tabulator-frozen-left",i.modules.frozen.edge&&"left"===i.modules.frozen.position),o.classList.toggle("tabulator-frozen-right",i.modules.frozen.edge&&"right"===i.modules.frozen.position)}else this.layoutElement(i.getElement(),i);t&&i.cells.forEach((t=>{this.layoutElement(t.getElement(!0),i)}))})),this.rightColumns.forEach(((e,n)=>{e.modules.frozen.marginValue=i,e.modules.frozen.margin=e.modules.frozen.marginValue+"px",e.visible&&(i+=e.getWidth()),n==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 n=t.getCell(e);n&&this.layoutElement(n.getElement(!0),e)})),this.rightColumns.forEach((e=>{var n=t.getCell(e);n&&this.layoutElement(n.getElement(!0),e)}))}layoutElement(t,e){var n;e.modules.frozen&&t&&(t.style.position="sticky",n=this.table.rtl?"left"===e.modules.frozen.position?"right":"left":e.modules.frozen.position,t.style[n]=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)")}_calcSpace(t,e){var n=0;for(let i=0;i{this.initializeRow(t)}))}initializeRow(t){var e=this.table.options.frozenRows,n=typeof e;"number"===n?t.getPosition()&&t.getPosition()+this.rows.length<=e&&this.freezeRow(t):"function"===n?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 n=e.indexOf(t);n>-1&&e.splice(n,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 n=t.getElement();n.parentNode&&n.parentNode.removeChild(n),this.rows.splice(e,1)}}styleRows(t){this.rows.forEach(((t,e)=>{this.table.rowManager.styleRow(t,e)}))}}H.moduleName="frozenRows";class j{constructor(t){return this._group=t,this.type="GroupComponent",new Proxy(this,{get:function(t,e,n){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 W{constructor(t,e,n,i,r,o,a){this.groupManager=t,this.parent=e,this.key=i,this.level=n,this.field=r,this.hasSubGroups=n{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 n=e+"_"+t,i=new W(this.groupManager,this,e,t,this.groupManager.groupIDLookups[e].field,this.groupManager.headerGenerator[e]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[n]);this.groups[n]=i,this.groupList.push(i)}_addRowToGroup(t){var e=this.level+1;if(this.hasSubGroups){var n=this.groupManager.groupIDLookups[e].func(t.getData()),i=e+"_"+n;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]?this.groups[i]&&this.groups[i].addRow(t):(this.groups[i]||this._createGroup(n,e),this.groups[i].addRow(t))}}_addRow(t){this.rows.push(t),t.modules.group=this}insertRow(t,e,n){var i=this.conformRowData({});t.updateData(i);var r=this.rows.indexOf(e);r>-1?n?this.rows.splice(r+1,0,t):this.rows.splice(r,0,t):n?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),n=t.getElement();e>-1&&this.rows.splice(e,1),this.groupManager.table.options.groupValues||this.rows.length?(n.parentNode&&n.parentNode.removeChild(n),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,n=t.level+"_"+t.key;this.groups[n]&&(delete this.groups[n],(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 n=[];return this._visSet(),(!t||t&&this.visible)&&this.rows.forEach((t=>{n.push(t.getData(e||"data"))})),n}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 n=e.getElement();t.parentNode.insertBefore(n,t.nextSibling),e.initialize(),t=n}))})):this.rows.forEach((e=>{var n=e.getElement();t.parentNode.insertBefore(n,t.nextSibling),e.initialize(),t=n})),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(n){var i=n.getRowGroup(t);i&&(e=i)})):this.rows.find((function(e){return e===t}))&&(e=this),e}getSubGroups(t){var e=[];return this.groupList.forEach((function(n){e.push(t?n.getComponent():n)})),e}getRows(t,e){var n=[];return e&&this.groupList.length?this.groupList.forEach((i=>{n=n.concat(i.getRows(t,e))})):this.rows.forEach((function(e){n.push(t?e.getComponent():e)})),n}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;tn.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]=(n,i,r)=>(void 0===n?"":n)+"("+i+" "+(1===i?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 n,i;n="function"==typeof t?t:(i=this.table.columnManager.getColumnByField(t))?function(t){return i.getFieldValue(t)}:function(e){return e[t]},this.groupIDLookups.push({field:"function"!=typeof t&&t,func:n,values:!!this.allowedValues&&this.allowedValues[e]})})),e&&(Array.isArray(e)||(e=[e]),e.forEach((t=>{})),this.startOpen=e),n&&(this.headerGenerator=Array.isArray(n)?n:[n])}else this.groupList=[],this.groups={}}rowSample(t,e){if(this.table.options.groupBy){var n=this.getGroups(!1)[0];e.push(n.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,n){if(this.table.options.groupBy){this.assignRowToGroup(t);var i=t.modules.group.rows;return i.length>1&&(!e||e&&-1==i.indexOf(e)?n?i[0]!==t&&(e=i[0],this.table.rowManager.moveRowInArray(t.modules.group.rows,t,e,!n)):i[i.length-1]!==t&&(e=i[i.length-1],this.table.rowManager.moveRowInArray(t.modules.group.rows,t,e,!n)):this.table.rowManager.moveRowInArray(t.modules.group.rows,t,e,!n)),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,n){if(this.table.options.groupBy){!n&&e instanceof W&&(e=this.table.rowManager.prevDisplayRow(t)||e);var i=e instanceof W?e:e.modules.group,r=t instanceof W?t:t.modules.group;i===r?this.table.rowManager.moveRowInArray(i.rows,t,e,n):(r&&r.removeRow(t),i.insertRow(t,e,n))}}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(n){e.push(t?n.getComponent():n)})),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 n={level:0,rowCount:0,headerContent:""},i=[];t.hasSubGroups?(i=this.pullGroupListData(t.groupList),n.level=t.level,n.rowCount=i.length-t.groupList.length,n.headerContent=t.generator(t.key,n.rowCount,t.rows,t),e.push(n),e=e.concat(i)):(n.level=t.level,n.headerContent=t.generator(t.key,t.rows.length,t.rows,t),n.rowCount=t.getRows().length,e.push(n),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((n=>{var i=n.getRowGroup(t);i&&(e=i)})),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,n){var i,r=e+"_"+t;n=n||[],i=new W(this,!1,e,t,this.groupIDLookups[0].field,this.headerGenerator[0],n[r]),this.groups[r]=i,this.groupList.push(i)}assignRowToExistingGroup(t,e){var n="0_"+this.groupIDLookups[0].func(t.getData());this.groups[n]&&this.groups[n].addRow(t)}assignRowToGroup(t,e){var n=this.groupIDLookups[0].func(t.getData()),i=!this.groups["0_"+n];return i&&this.createGroup(n,0,e),this.groups["0_"+n].addRow(t),!i}reassignRowToGroup(t){if("row"===t.type){var e=t.modules.group,n=e.getPath(),i=this.getExpectedPath(t);n.length==i.length&&n.every(((t,e)=>t===i[e]))||(e.removeRow(t),this.assignRowToGroup(t,this.groups),this.refreshData(!0))}}getExpectedPath(t){var e=[],n=t.getData();return this.groupIDLookups.forEach((t=>{e.push(t.func(n))})),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,n=t.level+"_"+t.key;this.groups[n]&&(delete this.groups[n],(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(((n,i)=>{this.table.rowManager.styleRow(n,i),t.appendChild(n.getElement()),n.initialize(!0),"group"!==n.type&&(e=!1)})),t.style.minWidth=e?this.table.columnManager.getWidth()+"px":""}}V.moduleName="groupRows";class G extends a{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,n){this.action("rowMove",t,{posFrom:t.getPosition(),posTo:e.getPosition(),to:e,after:n})}rowAdded(t,e,n,i){this.action("rowAdd",t,{data:e,pos:n,index:i})}rowDeleted(t){var e,n;this.table.options.groupBy?(e=(n=t.getComponent().getGroup()._getSelf().rows).indexOf(t))&&(e=n[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,n){this.history=this.history.slice(0,this.index+1),this.history.push({type:t,component:e,data:n}),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){let t=this.history[this.index];return G.undoers[t.type].call(this,t),this.index--,this.dispatchExternal("historyUndo",t.type,t.component.getComponent(),t.data),!0}return console.warn(this.options("history")?"History Undo Error - No more history to undo":"History module not enabled"),!1}redo(){if(this.history.length-1>this.index){this.index++;let t=this.history[this.index];return G.redoers[t.type].call(this,t),this.dispatchExternal("historyRedo",t.type,t.component.getComponent(),t.data),!0}return console.warn(this.options("history")?"History Redo Error - No more history to redo":"History module not enabled"),!1}_rebindRow(t,e){this.history.forEach((function(n){if(n.component instanceof C)n.component===t&&(n.component=e);else if(n.component instanceof b&&n.component.row===t){var i=n.component.column.getField();i&&(n.component=e.getCell(i))}}))}}G.moduleName="history",G.undoers={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()}},G.redoers={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()}};class U extends a{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,n=t.getElementsByTagName("th"),i=t.getElementsByTagName("tbody")[0],r=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),i=i?i.getElementsByTagName("tr"):[],this._extractOptions(t,e),n.length?this._extractHeaders(n,i):this._generateBlankHeaders(n,i);for(var o=0;o{o[t.toLowerCase()]=t})),i){var s,l=i[a];l&&"object"==typeof l&&l.name&&0===l.name.indexOf("tabulator-")&&(s=l.name.replace("tabulator-",""),void 0!==o[s]&&(e[o[s]]=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 n=0;n(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?Y.importers[t]:t)||console.error("Import Error - Importer not found:",t),e}importFromFile(t,e){var n=this.lookupImporter(t);if(n)return this.pickFile(e).then(this.importData.bind(this,n)).then(this.structureData.bind(this)).then(this.setData.bind(this)).catch((t=>(console.error("Import Error:",t||"Unable to import file"),Promise.reject(t))))}pickFile(t){return new Promise(((e,n)=>{var i=document.createElement("input");i.type="file",i.accept=t,i.addEventListener("change",(t=>{var r=i.files[0],o=new FileReader;switch(this.table.options.importReader){case"buffer":o.readAsArrayBuffer(r);break;case"binary":o.readAsBinaryString(r);break;case"url":o.readAsDataURL(r);break;default:o.readAsText(r)}o.onload=t=>{e(o.result)},o.onerror=t=>{console.warn("File Load Error - Unable to read file"),n()}})),i.click()}))}importData(t,e){var n=t.call(this.table,e);return n instanceof Promise?n:n?Promise.resolve(n):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 n={};return e.forEach(((e,i)=>{n[e]=t[i]})),n}))}structureArrayToColumns(t){var e=[],n=this.table.getColumns();return n[0]&&t[0][0]&&n[0].getDefinition().title===t[0][0]&&t.shift(),t.forEach((t=>{var i={};t.forEach(((t,e)=>{var r=n[e];r&&(i[r.getField()]=t)})),e.push(i)})),e}setData(t){return this.table.setData(t)}}Y.moduleName="import",Y.importers=q;class K extends a{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 n;if(!this.table.modExists("edit")||this.table.modules.edit.currentCell!==e){t.preventDefault();try{document.selection?((n=document.body.createTextRange()).moveToElementText(e.getElement()),n.select()):window.getSelection&&((n=document.createRange()).selectNode(e.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(n))}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,n=this.eventMap[t];if(this.subscribers[t]&&!this.subscribedExternal(t)){delete this.subscribers[t];for(let t in this.eventMap)this.eventMap[t]===n&&this.subscribers[t]&&(e=!1);e&&(this.unsubscribe(n+"-touchstart",this.touchSubscribers[n+"-touchstart"]),this.unsubscribe(n+"-touchend",this.touchSubscribers[n+"-touchend"]),delete this.touchSubscribers[n+"-touchstart"],delete this.touchSubscribers[n+"-touchend"])}}initializeColumn(t){var e=t.definition;for(let n in this.eventMap)e[n]&&(this.subscriptionChanged(n,!0),this.columnSubscribers[n]||(this.columnSubscribers[n]=[]),this.columnSubscribers[n].push(t))}handle(t,e,n){this.dispatchEvent(t,e,n)}handleTouch(t,e,n,i){var r=this.touchWatchers[t];switch("column"===t&&(t="header"),e){case"start":r.tap=!0,clearTimeout(r.tapHold),r.tapHold=setTimeout((()=>{clearTimeout(r.tapHold),r.tapHold=null,r.tap=null,clearTimeout(r.tapDbl),r.tapDbl=null,this.dispatchEvent(t+"TapHold",n,i)}),1e3);break;case"end":r.tap&&(r.tap=null,this.dispatchEvent(t+"Tap",n,i)),r.tapDbl?(clearTimeout(r.tapDbl),r.tapDbl=null,this.dispatchEvent(t+"DblTap",n,i)):r.tapDbl=setTimeout((()=>{clearTimeout(r.tapDbl),r.tapDbl=null}),300),clearTimeout(r.tapHold),r.tapHold=null}}dispatchEvent(t,e,n){var i,r=n.getComponent();this.columnSubscribers[t]&&(n instanceof b?i=n.column.definition[t]:n instanceof w&&(i=n.definition[t]),i&&i(e,r)),this.dispatchExternal(t,e,r)}}K.moduleName="interaction";class X extends a{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,X.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)X.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 n={action:X.actions[t],keys:[],ctrl:!1,shift:!1,meta:!1};e.toString().toLowerCase().split(" ").join("").split("+").forEach((t=>{switch(t){case"ctrl":n.ctrl=!0;break;case"shift":n.shift=!0;break;case"meta":n.meta=!0;break;default:t=isNaN(t)?t.toUpperCase().charCodeAt(0):parseInt(t),n.keys.push(t),this.watchKeys[t]||(this.watchKeys[t]=[]),this.watchKeys[t].push(n)}}))}bindEvents(){var t=this;this.keyupBinding=function(e){var n=e.keyCode,i=t.watchKeys[n];i&&(t.pressedKeys.push(n),i.forEach((function(n){t.checkBinding(e,n)})))},this.keydownBinding=function(e){var n=e.keyCode;if(t.watchKeys[n]){var i=t.pressedKeys.indexOf(n);i>-1&&t.pressedKeys.splice(i,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 n=!0;return t.ctrlKey==e.ctrl&&t.shiftKey==e.shift&&t.metaKey==e.meta&&(e.keys.forEach((t=>{-1==this.pressedKeys.indexOf(t)&&(n=!1)})),n&&e.action.call(this,t),!0)}}X.moduleName="keybindings",X.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,navLeft:37,navRight:39,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"],copyToClipboard:["ctrl + 67","meta + 67"],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"]},X.actions={keyBlock:function(t){t.stopPropagation(),t.preventDefault()},scrollPageUp:function(t){var e=this.table.rowManager,n=e.scrollTop-e.element.clientHeight;t.preventDefault(),e.displayRowsCount&&(n>=0?e.element.scrollTop=n:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(t){var e=this.table.rowManager,n=e.scrollTop+e.element.clientHeight,i=e.element.scrollHeight;t.preventDefault(),e.displayRowsCount&&(n<=i?e.element.scrollTop=n: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)},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)},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()))},copyToClipboard:function(t){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};class $ extends a{constructor(t){super(t),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("menuContainer",void 0),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(){this.deprecationCheck("menuContainer","popupContainer")||(this.table.options.popupContainer=this.table.options.menuContainer)}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,n=t.definition.headerMenuIcon;(e=document.createElement("span")).classList.add("tabulator-header-popup-button"),n?("function"==typeof n&&(n=n(t.getComponent())),n instanceof HTMLElement?e.appendChild(n):e.innerHTML=n):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,n){n._cell&&(n=n._cell),n.column.definition[t]&&this.loadMenuEvent(n.column.definition[t],e,n)}loadMenuTableColumnEvent(t,e,n){n._column&&(n=n._column),n.definition[t]&&this.loadMenuEvent(n.definition[t],e,n)}loadMenuEvent(t,e,n){n._group?n=n._group:n._row&&(n=n._row),t="function"==typeof t?t.call(this.table,e,n.getComponent()):t,this.loadMenu(e,n,t)}loadMenu(t,e,n,i,r){var o,a=!(t instanceof MouseEvent),s=document.createElement("div");if(s.classList.add("tabulator-menu"),a||t.preventDefault(),n&&n.length){if(i)o=r.child(s);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(s)}n.forEach((t=>{var n=document.createElement("div"),i=t.label,r=t.disabled;t.separator?n.classList.add("tabulator-menu-separator"):(n.classList.add("tabulator-menu-item"),"function"==typeof i&&(i=i.call(this.table,e.getComponent())),i instanceof Node?n.appendChild(i):n.innerHTML=i,"function"==typeof r&&(r=r.call(this.table,e.getComponent())),r?(n.classList.add("tabulator-menu-item-disabled"),n.addEventListener("click",(t=>{t.stopPropagation()}))):t.menu&&t.menu.length?n.addEventListener("click",(i=>{i.stopPropagation(),this.loadMenu(i,e,t.menu,n,o)})):t.action&&n.addEventListener("click",(n=>{t.action(n,e.getComponent())})),t.menu&&t.menu.length&&n.classList.add("tabulator-menu-item-submenu")),s.appendChild(n)})),s.addEventListener("click",(t=>{this.rootPopup&&this.rootPopup.hide()})),o.show(i||t),o===this.rootPopup&&(this.rootPopup.hideOnBlur((()=>{this.rootPopup=null,this.currentComponent&&(this.dispatch("menu-closed",n,o),this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)})),this.currentComponent=e,this.dispatch("menu-opened",n,o),this.dispatchExternal("menuOpened",e.getComponent()))}}}$.moduleName="menu";class J extends a{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,n=this,i={};t.modules.frozen||t.isGroup||(e=t.getElement(),i.mousemove=function(i){t.parent===n.moving.parent&&((n.touchMove?i.touches[0].pageX:i.pageX)-r.elOffset(e).left+n.table.columnManager.contentsElement.scrollLeft>t.getWidth()/2?n.toCol===t&&n.toColAfter||(e.parentNode.insertBefore(n.placeholderElement,e.nextSibling),n.moveColumn(t,!0)):(n.toCol!==t||n.toColAfter)&&(e.parentNode.insertBefore(n.placeholderElement,e),n.moveColumn(t,!1)))}.bind(n),e.addEventListener("mousedown",(function(e){n.touchMove=!1,1===e.which&&(n.checkTimeout=setTimeout((function(){n.startMove(e,t)}),n.checkPeriod))})),e.addEventListener("mouseup",(function(t){1===t.which&&n.checkTimeout&&clearTimeout(n.checkTimeout)})),n.bindTouchEvents(t)),t.modules.moveColumn=i}bindTouchEvents(t){var e,n,i,r,o,a,s=t.getElement(),l=!1;s.addEventListener("touchstart",(s=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,e=t.nextColumn(),i=e?e.getWidth()/2:0,n=t.prevColumn(),r=n?n.getWidth()/2:0,o=0,a=0,l=!1,this.startMove(s,t)}),this.checkPeriod)}),{passive:!0}),s.addEventListener("touchmove",(s=>{var u,c;this.moving&&(this.moveHover(s),l||(l=s.touches[0].pageX),(u=s.touches[0].pageX-l)>0?e&&u-o>i&&(c=e)!==t&&(l=s.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveColumn(c,!0)):n&&-u-a>r&&(c=n)!==t&&(l=s.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveColumn(c,!1)),c&&(e=c.nextColumn(),o=i,i=e?e.getWidth()/2:0,n=c.prevColumn(),a=r,r=n?n.getWidth()/2:0))}),{passive:!0}),s.addEventListener("touchend",(t=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(t)}))}startMove(t,e){var n=e.getElement(),i=this.table.columnManager.getContentsElement(),o=this.table.columnManager.getHeadersElement();this.moving=e,this.startX=(this.touchMove?t.touches[0].pageX:t.pageX)-r.elOffset(n).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=e.getWidth()+"px",this.placeholderElement.style.height=e.getHeight()+"px",n.parentNode.insertBefore(this.placeholderElement,n),n.parentNode.removeChild(n),this.hoverElement=n.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),i.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=i.clientHeight-o.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(t)}_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 n=this.moving.getCells();this.toCol=t,this.toColAfter=e,e?t.getCells().forEach((function(t,e){var i=t.getElement(!0);i.parentNode&&n[e]&&i.parentNode.insertBefore(n[e].getElement(),i.nextSibling)})):t.getCells().forEach((function(t,e){var i=t.getElement(!0);i.parentNode&&n[e]&&i.parentNode.insertBefore(n[e].getElement(),i)}))}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,n=this.table.columnManager.getContentsElement(),i=n.scrollLeft,o=(this.touchMove?t.touches[0].pageX:t.pageX)-r.elOffset(n).left+i;this.hoverElement.style.left=o-this.startX+"px",o-i{e=Math.max(0,i-5),this.table.rowManager.getElement().scrollLeft=e,this.autoScrollTimeout=!1}),1))),i+n.clientWidth-o{e=Math.min(n.clientWidth,i+5),this.table.rowManager.getElement().scrollLeft=e,this.autoScrollTimeout=!1}),1)))}}J.moduleName="moveColumn";class Z extends a{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,n={};n.mouseup=function(n){e.tableRowDrop(n,t)}.bind(e),n.mousemove=function(n){var i;n.pageY-r.elOffset(t.element).top+e.table.rowManager.element.scrollTop>t.getHeight()/2?e.toRow===t&&e.toRowAfter||((i=t.getElement()).parentNode.insertBefore(e.placeholderElement,i.nextSibling),e.moveRow(t,!0)):(e.toRow!==t||e.toRowAfter)&&(i=t.getElement()).previousSibling&&(i.parentNode.insertBefore(e.placeholderElement,i),e.moveRow(t,!1))}.bind(e),t.modules.moveRow=n}initializeRow(t){var e,n=this,i={};i.mouseup=function(e){n.tableRowDrop(e,t)}.bind(n),i.mousemove=function(e){var i=t.getElement();e.pageY-r.elOffset(i).top+n.table.rowManager.element.scrollTop>t.getHeight()/2?n.toRow===t&&n.toRowAfter||(i.parentNode.insertBefore(n.placeholderElement,i.nextSibling),n.moveRow(t,!0)):(n.toRow!==t||n.toRowAfter)&&(i.parentNode.insertBefore(n.placeholderElement,i),n.moveRow(t,!1))}.bind(n),this.hasHandle||((e=t.getElement()).addEventListener("mousedown",(function(e){1===e.which&&(n.checkTimeout=setTimeout((function(){n.startMove(e,t)}),n.checkPeriod))})),e.addEventListener("mouseup",(function(t){1===t.which&&n.checkTimeout&&clearTimeout(n.checkTimeout)})),this.bindTouchEvents(t,t.getElement())),t.modules.moveRow=i}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,n=t.getElement(!0);n.addEventListener("mousedown",(function(n){1===n.which&&(e.checkTimeout=setTimeout((function(){e.startMove(n,t.row)}),e.checkPeriod))})),n.addEventListener("mouseup",(function(t){1===t.which&&e.checkTimeout&&clearTimeout(e.checkTimeout)})),this.bindTouchEvents(t.row,n)}}bindTouchEvents(t,e){var n,i,r,o,a,s,l=!1;e.addEventListener("touchstart",(e=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,n=t.nextRow(),r=n?n.getHeight()/2:0,i=t.prevRow(),o=i?i.getHeight()/2:0,a=0,s=0,l=!1,this.startMove(e,t)}),this.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,e.addEventListener("touchmove",(e=>{var u,c;this.moving&&(e.preventDefault(),this.moveHover(e),l||(l=e.touches[0].pageY),(u=e.touches[0].pageY-l)>0?n&&u-a>r&&(c=n)!==t&&(l=e.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveRow(c,!0)):i&&-u-s>o&&(c=i)!==t&&(l=e.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveRow(c,!1)),c&&(n=c.nextRow(),a=r,r=n?n.getHeight()/2:0,i=c.prevRow(),s=o,o=i?i.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 n=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)):(n.parentNode.insertBefore(this.placeholderElement,n),n.parentNode.removeChild(n)),this.hoverElement=n.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 n,i,r=this.touchMove?t.touches[0].pageX:t.pageX,o=this.touchMove?t.touches[0].pageY:t.pageY;n=e.getElement(),this.connection?(i=n.getBoundingClientRect(),this.startX=i.left-r+window.pageXOffset,this.startY=i.top-o+window.pageYOffset):this.startY=o-n.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(),n=e.scrollTop,i=(this.touchMove?t.touches[0].pageY:t.pageY)-e.getBoundingClientRect().top+n;this.hoverElement.style.top=Math.min(i-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,n){this.dispatchExternal("movableRowsElementDrop",t,e,!!n&&n.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,n){var i=!1;if(n){switch(typeof this.table.options.movableRowsSender){case"string":i=this.senders[this.table.options.movableRowsSender];break;case"function":i=this.table.options.movableRowsSender}i?i.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 n=!1,i=!1;switch(t.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":n=this.receivers[this.table.options.movableRowsReceiver];break;case"function":n=this.table.options.movableRowsReceiver}n?i=n.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),i?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:i})}commsReceived(t,e,n){switch(e){case"connect":return this.connect(t,n.row);case"disconnect":return this.disconnect(t);case"dropcomplete":return this.dropComplete(t,n.row,n.success)}}}Z.prototype.receivers={insert:function(t,e,n){return this.table.addRow(t.getData(),void 0,e),!0},add:function(t,e,n){return this.table.addRow(t.getData()),!0},update:function(t,e,n){return!!e&&(e.update(t.getData()),!0)},replace:function(t,e,n){return!!e&&(this.table.addRow(t.getData(),void 0,e),e.delete(),!0)}},Z.prototype.senders={delete:function(t,e,n){t.delete()}},Z.moduleName="moveRow";class Q extends a{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,n){return this.transformRow(e,"data",n)}initializeColumn(t){var e=!1,n={};this.allowedTypes.forEach((i=>{var r,o="mutator"+(i.charAt(0).toUpperCase()+i.slice(1));t.definition[o]&&(r=this.lookupMutator(t.definition[o]))&&(e=!0,n[o]={mutator:r,params:t.definition[o+"Params"]||{}})})),e&&(t.modules.mutate=n)}lookupMutator(t){var e=!1;switch(typeof t){case"string":Q.mutators[t]?e=Q.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":e=t}return e}transformRow(t,e,n){var i,r="mutator"+(e.charAt(0).toUpperCase()+e.slice(1));return this.enabled&&this.table.columnManager.traverse((o=>{var a,s,l;o.modules.mutate&&(a=o.modules.mutate[r]||o.modules.mutate.mutator||!1)&&(i=o.getFieldValue(void 0!==n?n:t),("data"==e&&!n||void 0!==i)&&(l=o.getComponent(),s="function"==typeof a.params?a.params(i,t,e,l):a.params,o.setFieldValue(t,a.mutator(i,t,e,s,l))))})),t}transformCell(t,e){if(t.column.modules.mutate){var n=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||!1,i={};if(n)return i=Object.assign(i,t.row.getData()),t.column.setFieldValue(i,e),n.mutator(e,i,"edit",n.params,t.getComponent())}return e}mutateLink(t){var e=t.column.definition.mutateLink;e&&(Array.isArray(e)||(e=[e]),e.forEach((e=>{var n=t.row.getCell(e);n&&n.setValue(n.getValue(),!0,!0)})))}enable(){this.enabled=!0}disable(){this.enabled=!1}}Q.moduleName="mutator",Q.mutators={};var tt={rows:function(t,e,n,i,r){var o=document.createElement("span"),a=document.createElement("span"),s=document.createElement("span"),l=document.createElement("span"),u=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(t=>{a.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})),i?(s.innerHTML=" "+e+"-"+Math.min(e+t-1,i)+" ",u.innerHTML=" "+i+" ",o.appendChild(a),o.appendChild(s),o.appendChild(l),o.appendChild(u),o.appendChild(c)):(s.innerHTML=" 0 ",o.appendChild(a),o.appendChild(s),o.appendChild(c)),o},pages:function(t,e,n,i,r){var o=document.createElement("span"),a=document.createElement("span"),s=document.createElement("span"),l=document.createElement("span"),u=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(t=>{a.innerHTML=t})),s.innerHTML=" "+n+" ",this.table.modules.localize.langBind("pagination|counter|of",(t=>{l.innerHTML=t})),u.innerHTML=" "+r+" ",this.table.modules.localize.langBind("pagination|counter|pages",(t=>{c.innerHTML=t})),o.appendChild(a),o.appendChild(s),o.appendChild(l),o.appendChild(u),o.appendChild(c),o}};class et extends a{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 n,i=this.table.rowManager,r=i.getDisplayRows();return e?r.length?n=r[0]:i.activeRows.length&&(n=i.activeRows[i.activeRows.length-1],e=!1):r.length&&(n=r[r.length-1],e=!(r.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:et.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,n;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&&((n=document.querySelector(this.table.options.paginationCounterElement))?n.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){this.max=t?!0===this.size?1:Math.ceil(t/this.size):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){var n=!0===this.size?1:Math.ceil((e+1)/this.size);return this.setPage(n)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}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,n){var i;if(this.pageCounter)switch("remote"===this.mode&&(e=this.size,n=(this.page-1)*this.size+1,t=this.remoteRowCountEstimate),typeof(i=this.pageCounter.call(this,e,n,this.page,t,this.max))){case"object":if(i instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(i)}else this.pageCounterElement.innerHTML="",null!=i&&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:",i);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=i}}_setPageButtons(){let t=Math.floor((this.count-1)/2),e=Math.ceil((this.count-1)/2),n=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",(n=>{e.setAttribute("aria-label",n+" "+t),e.setAttribute("title",n+" "+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){e=[],this.setMaxRows(t.length),!0===this.size?(n=0,i=t.length):i=(n=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(let a=n;a{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"))}}et.moduleName="page",et.pageCounters=tt;var nt={local:function(t,e){var n=localStorage.getItem(t+"-"+e);return!!n&&JSON.parse(n)},cookie:function(t,e){var n,i,r=document.cookie,o=t+"-"+e,a=r.indexOf(o+"=");return a>-1&&((n=(r=r.slice(a)).indexOf(";"))>-1&&(r=r.slice(0,n)),i=r.replace(o+"=","")),!!i&&JSON.parse(i)}},it={local:function(t,e,n){localStorage.setItem(t+"-"+e,JSON.stringify(n))},cookie:function(t,e,n){var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=t+"-"+e+"="+JSON.stringify(n)+"; expires="+i.toUTCString()}};class rt extends a{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,n=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:rt.readers[this.table.options.persistenceReaderFunc]?this.readFunc=rt.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):rt.readers[this.mode]?this.readFunc=rt.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:rt.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=rt.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):rt.writers[this.mode]?this.writeFunc=rt.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(n||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,n;this.config.sort&&0==!(t=this.load("sort"))&&(this.table.options.initialSort=t),this.config.filter&&0==!(e=this.load("filter"))&&(this.table.options.initialFilter=e),this.config.headerFilter&&0==!(n=this.load("headerFilter"))&&(this.table.options.initialHeaderFilter=n)}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 n=Object.getOwnPropertyDescriptor(e,t),i=e[t];n&&Object.defineProperty(e,t,{set:t=>{i=t,this.defWatcherBlock||this.save("columns"),n.set&&n.set(t)},get:()=>(n.get&&n.get(),i)})})),this.defWatcherBlock=!1)}load(t,e){var n=this.retrieveData(t);return e&&(n=n?this.mergeDefinition(e,n):e),n}retrieveData(t){return!!this.readFunc&&this.readFunc(this.id,t)}mergeDefinition(t,e,n){var i=[];return(e=e||[]).forEach(((e,r)=>{var o,a=this._findColumn(t,e);a&&(n?o=Object.keys(e):!0===this.config.columns||null==this.config.columns?(o=Object.keys(a)).push("width"):o=this.config.columns,o.forEach((t=>{"columns"!==t&&void 0!==e[t]&&(a[t]=e[t])})),a.columns&&(a.columns=this.mergeDefinition(a.columns,e.columns)),i.push(a))})),t.forEach(((t,n)=>{this._findColumn(e,t)||(i.length>n?i.splice(n,0,t):i.push(t))})),i}_findColumn(t,e){var n=e.columns?"group":e.field?"field":"object";return t.find((function(t){switch(n){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=[],n=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return t.forEach((t=>{var i,r={},o=t.getDefinition();t.isGroup?(r.title=o.title,r.columns=this.parseColumns(t.getColumns())):(r.field=t.getField(),!0===this.config.columns||null==this.config.columns?((i=Object.keys(o)).push("width"),i.push("visible")):i=this.config.columns,i.forEach((e=>{switch(e){case"width":r.width=t.getWidth();break;case"visible":r.visible=t.visible;break;default:"function"!=typeof o[e]&&-1===n.indexOf(e)&&(r[e]=o[e])}}))),e.push(r)})),e}}rt.moduleName="persistence",rt.moduleInitOrder=-10,rt.readers=nt,rt.writers=it;class ot extends a{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,n){this.loadPopupEvent(e,null,t,n)}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,n=t.definition.headerPopupIcon;(e=document.createElement("span")).classList.add("tabulator-header-popup-button"),n?("function"==typeof n&&(n=n(t.getComponent())),n instanceof HTMLElement?e.appendChild(n):e.innerHTML=n):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,n){n._cell&&(n=n._cell),n.column.definition[t]&&this.loadPopupEvent(n.column.definition[t],e,n)}loadPopupTableColumnEvent(t,e,n){n._column&&(n=n._column),n.definition[t]&&this.loadPopupEvent(n.definition[t],e,n)}loadPopupEvent(t,e,n,i){var r;n._group?n=n._group:n._row&&(n=n._row),t="function"==typeof t?t.call(this.table,e,n.getComponent(),(function(t){r=t})):t,this.loadPopup(e,n,t,r,i)}loadPopup(t,e,n,i,r){var o,a,s=!(t instanceof MouseEvent);n instanceof HTMLElement?o=n:(o=document.createElement("div")).innerHTML=n,o.classList.add("tabulator-popup"),o.addEventListener("click",(t=>{t.stopPropagation()})),s||t.preventDefault(),a=this.popup(o),"function"==typeof i&&a.renderCallback(i),t?a.show(t):a.show(e.getElement(),r||"center"),a.hideOnBlur((()=>{this.dispatchExternal("popupClosed",e.getComponent())})),this.dispatchExternal("popupOpened",e.getComponent())}}ot.moduleName="popup";class at extends a{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,n){var i,r,o=window.scrollX,a=window.scrollY,s=document.createElement("div"),l=document.createElement("div"),u=this.table.modules.export.generateTable(void 0!==n?n: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&&(s.classList.add("tabulator-print-header"),"string"==typeof(i="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?s.innerHTML=i:s.appendChild(i),this.element.appendChild(s)),this.element.appendChild(u),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(r="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=r:l.appendChild(r),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,u),window.print(),this.cleanup(),window.scrollTo(o,a),this.manualBlock=!1}}at.moduleName="print";class st extends a{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,n=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 i,r=Array.from(arguments);return n.blocked||e!==n.currentVersion||(n.block("data-push"),r.forEach((t=>{n.table.rowManager.addRowActual(t,!1)})),i=n.origFuncs.push.apply(t,arguments),n.unblock("data-push")),i}}),this.origFuncs.unshift=t.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var i,r=Array.from(arguments);return n.blocked||e!==n.currentVersion||(n.block("data-unshift"),r.forEach((t=>{n.table.rowManager.addRowActual(t,!0)})),i=n.origFuncs.unshift.apply(t,arguments),n.unblock("data-unshift")),i}}),this.origFuncs.shift=t.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var i,r;return n.blocked||e!==n.currentVersion||(n.block("data-shift"),n.data.length&&(i=n.table.rowManager.getRowFromDataObject(n.data[0]))&&i.deleteActual(),r=n.origFuncs.shift.call(t),n.unblock("data-shift")),r}}),this.origFuncs.pop=t.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var i,r;return n.blocked||e!==n.currentVersion||(n.block("data-pop"),n.data.length&&(i=n.table.rowManager.getRowFromDataObject(n.data[n.data.length-1]))&&i.deleteActual(),r=n.origFuncs.pop.call(t),n.unblock("data-pop")),r}}),this.origFuncs.splice=t.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var i,r,o=Array.from(arguments),a=o[0]<0?t.length+o[0]:o[0],s=o[1],l=!!o[2]&&o.slice(2);if(!n.blocked&&e===n.currentVersion){if(n.block("data-splice"),l&&((i=!!t[a]&&n.table.rowManager.getRowFromDataObject(t[a]))?l.forEach((t=>{n.table.rowManager.addRowActual(t,!0,i,!0)})):(l=l.slice().reverse()).forEach((t=>{n.table.rowManager.addRowActual(t,!0,!1,!0)}))),0!==s){var u=t.slice(a,void 0===o[1]?o[1]:a+s);u.forEach(((t,e)=>{var i=n.table.rowManager.getRowFromDataObject(t);i&&i.deleteActual(e!==u.length-1)}))}(l||0!==s)&&n.table.rowManager.reRenderInPosition(),r=n.origFuncs.splice.apply(t,arguments),n.unblock("data-splice")}return r}})}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 n in e)this.watchKey(t,e,n);this.table.options.dataTree&&this.watchTreeChildren(t)}watchTreeChildren(t){var e=this,n=t.getData()[this.table.options.dataTreeChildField],i={};n&&(i.push=n.push,Object.defineProperty(n,"push",{enumerable:!1,configurable:!0,value:()=>{if(!e.blocked){e.block("tree-push");var r=i.push.apply(n,arguments);this.rebuildTree(t),e.unblock("tree-push")}return r}}),i.unshift=n.unshift,Object.defineProperty(n,"unshift",{enumerable:!1,configurable:!0,value:()=>{if(!e.blocked){e.block("tree-unshift");var r=i.unshift.apply(n,arguments);this.rebuildTree(t),e.unblock("tree-unshift")}return r}}),i.shift=n.shift,Object.defineProperty(n,"shift",{enumerable:!1,configurable:!0,value:()=>{if(!e.blocked){e.block("tree-shift");var r=i.shift.call(n);this.rebuildTree(t),e.unblock("tree-shift")}return r}}),i.pop=n.pop,Object.defineProperty(n,"pop",{enumerable:!1,configurable:!0,value:()=>{if(!e.blocked){e.block("tree-pop");var r=i.pop.call(n);this.rebuildTree(t),e.unblock("tree-pop")}return r}}),i.splice=n.splice,Object.defineProperty(n,"splice",{enumerable:!1,configurable:!0,value:()=>{if(!e.blocked){e.block("tree-splice");var r=i.splice.apply(n,arguments);this.rebuildTree(t),e.unblock("tree-splice")}return r}}))}rebuildTree(t){this.table.modules.dataTree.initializeRow(t),this.table.modules.dataTree.layoutRow(t),this.table.rowManager.refreshActiveData("tree",!1,!0)}watchKey(t,e,n){var i=this,r=Object.getOwnPropertyDescriptor(e,n),o=e[n],a=this.currentVersion;Object.defineProperty(e,n,{set:e=>{if(o=e,!i.blocked&&a===i.currentVersion){i.block("key");var s={};s[n]=e,t.updateData(s),i.unblock("key")}r.set&&r.set(e)},get:()=>(r.get&&r.get(),o)})}unwatchRow(t){var e=t.getData();for(var n in e)Object.defineProperty(e,n,{value:e[n]})}block(t){this.blocked||(this.blocked=t)}unblock(t){this.blocked===t&&(this.blocked=!1)}}st.moduleName="reactiveData";class lt extends a{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)}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((n=>{n.modules.resize&&n.modules.resize.handleEl&&(e&&(n.modules.resize.handleEl.style[t.modules.frozen.position]=e,n.modules.resize.handleEl.style["z-index"]=11),n.element.after(n.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,n,i){var r=this,o=n.definition.resizable,a={},s=n.getLastColumn();if("header"===t&&(a={variableHeight:"textarea"==n.definition.formatter||n.definition.variableHeight}),(!0===o||o==t)&&this._checkResizability(s)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(t){t.stopPropagation()}));var u=function(t){r.startColumn=n,r.initialNextColumn=r.nextColumn=s.nextColumn(),r._mouseDown(t,s,l)};l.addEventListener("mousedown",u),l.addEventListener("touchstart",u,{passive:!0}),l.addEventListener("dblclick",(t=>{var e=s.getWidth();t.stopPropagation(),s.reinitializeWidth(!0),e!==s.getWidth()&&(r.dispatch("column-resized",s),r.table.externalEvents.dispatch("columnResized",s.getComponent()))})),n.modules.frozen&&(l.style.position="sticky",l.style[n.modules.frozen.position]=this.frozenColumnOffset(n)),a.handleEl=l,i.parentNode&&n.visible&&i.after(l)}e.modules.resize=a}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)}_checkResizability(t){return t.definition.resizable}_mouseDown(t,e,n){var i=this;function r(t){var n,r,o=void 0===t.screenX?t.touches[0].screenX:t.screenX,a=o-i.startX,s=o-i.latestX;if(i.latestX=o,i.table.rtl&&(a=-a,s=-s),n=e.width==e.minWidth||e.width==e.maxWidth,e.setWidth(i.startWidth+a),r=e.width==e.minWidth||e.width==e.maxWidth,s<0&&(i.nextColumn=i.initialNextColumn),i.table.options.resizableColumnFit&&i.nextColumn&&(!n||!r)){let t=i.nextColumn.getWidth();s>0&&t<=i.nextColumn.minWidth&&(i.nextColumn=i.nextColumn.nextColumn()),i.nextColumn&&i.nextColumn.setWidth(i.nextColumn.getWidth()-s)}i.table.columnManager.rerenderColumns(!0),!i.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights()}function o(t){i.startColumn.modules.edit&&(i.startColumn.modules.edit.blocked=!1),i.table.browserSlow&&e.modules.resize&&e.modules.resize.variableHeight&&e.checkCellHeights(),document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",r),n.removeEventListener("touchmove",r),n.removeEventListener("touchend",o),i.table.element.classList.remove("tabulator-block-select"),i.startWidth!==e.getWidth()&&(i.table.columnManager.verticalAlignHeaders(),i.dispatch("column-resized",e),i.table.externalEvents.dispatch("columnResized",e.getComponent()))}i.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),i.startColumn.modules.edit&&(i.startColumn.modules.edit.blocked=!0),i.startX=void 0===t.screenX?t.touches[0].screenX:t.screenX,i.latestX=i.startX,i.startWidth=e.getWidth(),document.body.addEventListener("mousemove",r),document.body.addEventListener("mouseup",o),n.addEventListener("touchmove",r,{passive:!0}),n.addEventListener("touchend",o)}}lt.moduleName="resizeColumns";class ut extends a{constructor(t){super(t),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(t){var e=this,n=t.getElement(),i=document.createElement("div");i.className="tabulator-row-resize-handle";var r=document.createElement("div");r.className="tabulator-row-resize-handle prev",i.addEventListener("click",(function(t){t.stopPropagation()}));var o=function(n){e.startRow=t,e._mouseDown(n,t,i)};i.addEventListener("mousedown",o),i.addEventListener("touchstart",o,{passive:!0}),r.addEventListener("click",(function(t){t.stopPropagation()}));var a=function(n){var i=e.table.rowManager.prevDisplayRow(t);i&&(e.startRow=i,e._mouseDown(n,i,r))};r.addEventListener("mousedown",a),r.addEventListener("touchstart",a,{passive:!0}),n.appendChild(i),n.appendChild(r)}_mouseDown(t,e,n){var i=this;function r(t){e.setHeight(i.startHeight+((void 0===t.screenY?t.touches[0].screenY:t.screenY)-i.startY))}function o(t){document.body.removeEventListener("mouseup",r),document.body.removeEventListener("mousemove",r),n.removeEventListener("touchmove",r),n.removeEventListener("touchend",o),i.table.element.classList.remove("tabulator-block-select"),i.dispatchExternal("rowResized",e.getComponent())}i.table.element.classList.add("tabulator-block-select"),t.stopPropagation(),i.startY=void 0===t.screenY?t.touches[0].screenY:t.screenY,i.startHeight=e.getHeight(),document.body.addEventListener("mousemove",r),document.body.addEventListener("mouseup",o),n.addEventListener("touchmove",r,{passive:!0}),n.addEventListener("touchend",o)}}ut.moduleName="resizeRows";class ct extends a{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 n=Math.floor(t[0].contentRect.height),i=Math.floor(t[0].contentRect.width);this.tableHeight==n&&this.tableWidth==i||(this.tableHeight=n,this.tableWidth=i,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 n=Math.floor(t[0].contentRect.height),i=Math.floor(t[0].contentRect.width);this.containerHeight==n&&this.containerWidth==i||(this.containerHeight=n,this.containerWidth=i,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)}}ct.moduleName="resizeTable";class ht extends a{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=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(((e,n)=>{e.modules.responsive&&e.modules.responsive.order&&e.modules.responsive.visible&&(e.modules.responsive.index=n,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();for(let t of this.table.columnManager.columnsByIndex)if("responsiveCollapse"==t.definition.formatter){this.collapseHandleColumn=t;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(),n=(this.table.options.headerVisible?this.table.columnManager.element.clientWidth:this.table.element.clientWidth)-e;if(n<0){let e=this.columns[this.index];e?(this.hideColumn(e),this.index++):t=!1}else{let e=this.columns[this.index-1];e&&n>0&&n>=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,n;if(t.modules.responsiveLayout){for(e=t.modules.responsiveLayout.element;e.firstChild;)e.removeChild(e.firstChild);(n=this.collapseFormatter(this.generateCollapsedRowData(t)))&&e.appendChild(n)}}generateCollapsedRowData(t){var e,n=t.getData(),i=[];return this.hiddenColumns.forEach((r=>{var o=r.getFieldValue(n);if(r.definition.title&&r.field)if(r.modules.format&&this.table.options.responsiveLayoutCollapseUseFormatters){function a(t){t()}e={value:!1,data:{},getValue:function(){return o},getData:function(){return n},getType:function(){return"cell"},getElement:function(){return document.createElement("div")},getRow:function(){return t.getComponent()},getColumn:function(){return r.getComponent()},getTable:()=>this.table},i.push({field:r.field,title:r.definition.title,value:r.modules.format.formatter.call(this.table.modules.format,e,r.modules.format.params,a)})}else i.push({field:r.field,title:r.definition.title,value:o})})),i}formatCollapsedData(t){var e=document.createElement("table");return t.forEach((function(t){var n,i=document.createElement("tr"),r=document.createElement("td"),o=document.createElement("td"),a=document.createElement("strong");r.appendChild(a),this.langBind("columns|"+t.field,(function(e){a.innerHTML=e||t.title})),t.value instanceof Node?((n=document.createElement("div")).appendChild(t.value),o.appendChild(n)):o.innerHTML=t.value,i.appendChild(r),i.appendChild(o),e.appendChild(i)}),this),Object.keys(t).length?e:""}}ht.moduleName="responsiveLayout";class dt extends a{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(){this.deprecationCheck("selectable","selectableRows",!0),this.deprecationCheck("selectableRollingSelection","selectableRowsRollingSelection",!0),this.deprecationCheck("selectableRangeMode","selectableRowsRangeMode",!0),this.deprecationCheck("selectablePersistence","selectableRowsPersistence",!0),this.deprecationCheck("selectableCheck","selectableRowsCheck",!0)}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,n=e.checkRowSelectability(t),i=t.getElement(),r=function(){setTimeout((function(){e.selecting=!1}),50),document.body.removeEventListener("mouseup",r)};t.modules.select={selected:!1},i.classList.toggle("tabulator-selectable",n),i.classList.toggle("tabulator-unselectable",!n),e.checkRowSelectability(t)&&e.table.options.selectableRows&&"highlight"!=e.table.options.selectableRows&&("click"===e.table.options.selectableRowsRangeMode?i.addEventListener("click",this.handleComplexRowClick.bind(this,t)):(i.addEventListener("click",(function(n){e.table.modExists("edit")&&e.table.modules.edit.getCurrentCell()||e.table._clearSelection(),e.selecting||e.toggleRow(t)})),i.addEventListener("mousedown",(function(n){if(n.shiftKey)return e.table._clearSelection(),e.selecting=!0,e.selectPrev=[],document.body.addEventListener("mouseup",r),document.body.addEventListener("keyup",r),e.toggleRow(t),!1})),i.addEventListener("mouseenter",(function(n){e.selecting&&(e.table._clearSelection(),e.toggleRow(t),e.selectPrev[1]==t&&e.toggleRow(e.selectPrev[0]))})),i.addEventListener("mouseout",(function(n){e.selecting&&(e.table._clearSelection(),e.selectPrev.unshift(t))}))))}handleComplexRowClick(t,e){if(e.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||t;var n=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),i=this.table.rowManager.getDisplayRowIndex(t),r=n<=i?n:i,o=n>=i?n:i,a=this.table.rowManager.getDisplayRows().slice(0).splice(r,o-r+1);e.ctrlKey||e.metaKey?(a.forEach((e=>{e!==this.lastClickedRow&&(!0===this.table.options.selectableRows||this.isRowSelected(t)||this.selectedRows.lengththis.table.options.selectableRows&&(a=a.slice(0,this.table.options.selectableRows)),this.selectRows(a)),this.table._clearSelection()}else e.ctrlKey||e.metaKey?(this.toggleRow(t),this.lastClickedRow=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,n,i=[];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=>{(n=this._selectRow(t,!0,!0))&&i.push(n)})),this._rowSelectionChanged(!1,i)):e&&this._selectRow(e,!1,!0)}_selectRow(t,e,n){if(!isNaN(this.table.options.selectableRows)&&!0!==this.table.options.selectableRows&&!n&&this.selectedRows.length>=this.table.options.selectableRows){if(!this.table.options.selectableRowsRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var i=this.table.rowManager.findRow(t);if(i){if(-1==this.selectedRows.indexOf(i))return i.getElement().classList.add("tabulator-selected"),i.modules.select||(i.modules.select={}),i.modules.select.selected=!0,i.modules.select.checkboxEl&&(i.modules.select.checkboxEl.checked=!0),this.selectedRows.push(i),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(i,!0),this.dispatchExternal("rowSelected",i.getComponent()),this._rowSelectionChanged(e,i),i}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 n,i,r=[];switch(typeof t){case"undefined":n=Object.assign([],this.selectedRows);break;case"number":n=this.table.rowManager.findRow(t);break;case"string":(n=this.table.rowManager.findRow(t))||(n=this.table.rowManager.getRows(t));break;default:n=t}Array.isArray(n)?n.length&&(n.forEach((t=>{(i=this._deselectRow(t,!0,!0))&&r.push(i)})),this._rowSelectionChanged(e,[],r)):n&&this._deselectRow(n,e,!0)}_deselectRow(t,e){var n,i,r=this,o=r.table.rowManager.findRow(t);if(o){if((n=r.selectedRows.findIndex((function(t){return t==o})))>-1)return(i=o.getElement())&&i.classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),r.selectedRows.splice(n,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),r._rowSelectionChanged(e,void 0,o),o}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=[],n=[]){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(n)||(n=[n]),n=n.map((t=>t.getComponent())),this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows(),e,n))}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 n=this.table.modules.dataTree.getChildren(t,!0);if(e)for(let t of n)this._selectRow(t,!0);else for(let t of n)this._deselectRow(t,!0)}}function pt(t,e,n,i,r,o,a){var s=window.DateTime||luxon.DateTime,l=a.format||"dd/MM/yyyy HH:mm:ss",u=a.alignEmptyValues,c=0;if(void 0!==s){if(s.isDateTime(t)||(t="iso"===l?s.fromISO(String(t)):s.fromFormat(String(t),l)),s.isDateTime(e)||(e="iso"===l?s.fromISO(String(e)):s.fromFormat(String(e),l)),t.isValid){if(e.isValid)return t-e;c=1}else c=e.isValid?-1:0;return("top"===u&&"desc"===o||"bottom"===u&&"asc"===o)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}dt.moduleName="selectRow";var ft={number:function(t,e,n,i,r,o,a){var s=a.alignEmptyValues,l=a.decimalSeparator,u=a.thousandSeparator,c=0;if(t=String(t),e=String(e),u&&(t=t.split(u).join(""),e=e.split(u).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"===s&&"desc"===o||"bottom"===s&&"asc"===o)&&(c*=-1),c},string:function(t,e,n,i,r,o,a){var s,l=a.alignEmptyValues,u=0;if(t){if(e){switch(typeof a.locale){case"boolean":a.locale&&(s=this.langLocale());break;case"string":s=a.locale}return String(t).toLowerCase().localeCompare(String(e).toLowerCase(),s)}u=1}else u=e?-1:0;return("top"===l&&"desc"===o||"bottom"===l&&"asc"===o)&&(u*=-1),u},date:function(t,e,n,i,r,o,a){return a.format||(a.format="dd/MM/yyyy"),pt.call(this,t,e,n,i,r,o,a)},time:function(t,e,n,i,r,o,a){return a.format||(a.format="HH:mm"),pt.call(this,t,e,n,i,r,o,a)},datetime:pt,boolean:function(t,e,n,i,r,o,a){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,n,i,r,o,a){var s=a.type||"length",l=a.alignEmptyValues,u=0;function c(t){var e;switch(s){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);u=1}else u=Array.isArray(e)?-1:0;return("top"===l&&"desc"===o||"bottom"===l&&"asc"===o)&&(u*=-1),u},exists:function(t,e,n,i,r,o,a){return(void 0===t?0:1)-(void 0===e?0:1)},alphanum:function(t,e,n,i,r,o,a){var s,l,u,c,h,d=0,p=/(\d+)|(\D+)/g,f=/\d/,g=a.alignEmptyValues,m=0;if(t||0===t){if(e||0===e){if(isFinite(t)&&isFinite(e))return t-e;if((s=String(t).toLowerCase())===(l=String(e).toLowerCase()))return 0;if(!f.test(s)||!f.test(l))return s>l?1:-1;for(s=s.match(p),l=l.match(p),h=s.length>l.length?l.length:s.length;dc?1:-1;return s.length>l.length}m=1}else m=e||0===e?-1:0;return("top"===g&&"desc"===o||"bottom"===g&&"asc"===o)&&(m*=-1),m}};class gt extends a{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,n,i){var r=this.getSort();return r.forEach((t=>{delete t.column})),i.sort=r,i}userSetSort(t,e){this.setSort(t,e),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(t){var e,n,i=!1;switch(typeof t.definition.sorter){case"string":gt.sorters[t.definition.sorter]?i=gt.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":i=t.definition.sorter}if(t.modules.sort={sorter:i,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"),(n=document.createElement("div")).classList.add("tabulator-col-sorter"),"icon"===this.table.options.headerSortClickElement?n.classList.add("tabulator-col-sorter-element"):e.classList.add("tabulator-col-sorter-element"),this.table.options.headerSortElement){case"function":break;case"object":n.appendChild(this.table.options.headerSortElement);break;default:n.innerHTML=this.table.options.headerSortElement}t.titleHolderElement.appendChild(n),t.modules.sort.element=n,this.setColumnHeaderSortIcon(t,"none"),"icon"===this.table.options.headerSortClickElement&&n.addEventListener("mousedown",(t=>{t.stopPropagation()})),("icon"===this.table.options.headerSortClickElement?n:e).addEventListener("click",(e=>{var n="",i=[],r=!1;if(t.modules.sort){if(t.modules.sort.tristate)n="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":n="desc";break;case"desc":n="asc";break;default:n=t.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?(r=(i=this.getSort()).findIndex((e=>e.field===t.getField())),r>-1?(i[r].dir=n,r=i.splice(r,1)[0],"none"!=n&&i.push(r)):"none"!=n&&i.push({column:t,dir:n}),this.setSort(i)):"none"==n?this.clear():this.setSort(t,n),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 n=this,i=[];Array.isArray(t)||(t=[{column:t,dir:e}]),t.forEach((function(t){var e;(e=n.table.columnManager.findColumn(t.column))?(t.column=e,i.push(t),n.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)})),n.sortList=i,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(t){var e,n=this.table.rowManager.activeRows[0],i="string";if(n&&(n=n.getData(),t.getField()))switch(typeof(e=t.getFieldValue(n))){case"undefined":i="string";break;case"boolean":i="boolean";break;default:isNaN(e)||""===e?e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum"):i="number"}return gt.sorters[i]}sort(t){var e=this,n=this.table.options.sortOrderReverse?e.sortList.slice().reverse():e.sortList,i=[],r=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",e.getSort()),e.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(n.forEach((function(t,n){var r;t.column&&((r=t.column.modules.sort)&&(r.sorter||(r.sorter=e.findSorter(t.column)),t.params="function"==typeof r.params?r.params(t.column.getComponent(),t.dir):r.params,i.push(t)),e.setColumnHeader(t.column,t.dir))})),i.length&&e._sortItems(t,i)):n.forEach((function(t,n){e.setColumnHeader(t.column,t.dir)})),this.subscribedExternal("dataSorted")&&(t.forEach((t=>{r.push(t.getComponent())})),this.dispatchExternal("dataSorted",e.getSort(),r)),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 n,i=t.modules.sort.element;if(t.definition.headerSort&&"function"==typeof this.table.options.headerSortElement){for(;i.firstChild;)i.removeChild(i.firstChild);"object"==typeof(n=this.table.options.headerSortElement.call(this.table,t.getComponent(),e))?i.appendChild(n):i.innerHTML=n}}_sortItems(t,e){var n=e.length-1;t.sort(((t,i)=>{for(var r,o=n;o>=0;o--){let n=e[o];if(0!==(r=this._sortRow(t,i,n.column,n.dir,n.params)))break}return r}))}_sortRow(t,e,n,i,r){var o,a,s="asc"==i?t:e,l="asc"==i?e:t;return t=void 0!==(t=n.getFieldValue(s.getData()))?t:"",e=void 0!==(e=n.getFieldValue(l.getData()))?e:"",o=s.getComponent(),a=l.getComponent(),n.modules.sort.sorter.call(this,t,e,o,a,n.getComponent(),i,r)}}gt.moduleName="sort",gt.sorters=ft;class mt{constructor(t){return this._range=t,new Proxy(this,{get:function(t,e,n){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)}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 bt extends i{constructor(t,e,n,i){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(n,i)}))}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,n){t&&this.setStartBound(t),this.setEndBound(e||t),this.rangeManager.layoutElement(n)}setStartBound(t){var e,n;"column"===t.type?this.rangeManager.columnSelection&&this.setStart(0,t.getPosition()-1):(e=t.row.position-1,n=t.column.getPosition()-1,t.column===this.rangeManager.rowHeader?this.setStart(e,1):this.setStart(e,n))}setEndBound(t){var e,n,i,r=this._getTableRows().length;"column"===t.type?this.rangeManager.columnSelection&&("column"===this.rangeManager.selecting?this.setEnd(r-1,t.getPosition()-1):"cell"===this.rangeManager.selecting&&this.setEnd(0,t.getPosition()-1)):(e=t.row.position-1,n=t.column.getPosition()-1,i=t.column===this.rangeManager.rowHeader,"row"===this.rangeManager.selecting?this.setEnd(e,this._getTableColumns().length-1):"row"!==this.rangeManager.selecting&&i?this.setEnd(e,0):"column"===this.rangeManager.selecting?this.setEnd(r-1,n):this.setEnd(e,n))}_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()}layout(){var t,e,n,i,r,o,a=this.table.rowManager.renderer.vDomTop,s=this.table.rowManager.renderer.vDomBottom,l=this.table.columnManager.renderer.leftCol,u=this.table.columnManager.renderer.rightCol;null==a&&(a=0),null==s&&(s=1/0),null==l&&(l=0),null==u&&(u=1/0),this.overlaps(l,a,u,s)&&(t=Math.max(this.top,a),e=Math.min(this.bottom,s),n=Math.max(this.left,l),i=Math.min(this.right,u),r=this.rangeManager.getCell(t,n),o=this.rangeManager.getCell(e,i),this.element.classList.add("tabulator-range-active"),this.element.style.left=r.row.getElement().offsetLeft+r.getElement().offsetLeft+"px",this.element.style.top=r.row.getElement().offsetTop+"px",this.element.style.width=o.getElement().offsetLeft+o.getElement().offsetWidth-r.getElement().offsetLeft+"px",this.element.style.height=o.row.getElement().offsetTop+o.row.getElement().offsetHeight-r.row.getElement().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,n,i){return!(this.left>n||t>this.right||this.top>i||e>this.bottom)}getData(){var t=[],e=this.getRows(),n=this.getColumns();return e.forEach((e=>{var i=e.getData(),r={};n.forEach((t=>{r[t.field]=i[t.field]})),t.push(r)})),t}getCells(t,e){var n=[],i=this.getRows(),r=this.getColumns();return t?n=i.map((t=>{var n=[];return t.getCells().forEach((t=>{r.includes(t.column)&&n.push(e?t.getComponent():t)})),n})):i.forEach((t=>{t.getCells().forEach((t=>{r.includes(t.column)&&n.push(e?t.getComponent():t)}))})),n}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),n={start:null,end:null};return e.length?(n.start=e[0],n.end=e[e.length-1]):console.warn("No bounds defined on range"),n}getComponent(){return this.component||(this.component=new mt(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}}class vt extends a{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()))}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-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(){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")))}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;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)}))}))}handleColumnMouseDown(t,e){(2!==t.button||"column"!==this.selecting&&"all"!==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(),n=this.ranges.findIndex((e=>e.occupies(t)));e.classList.toggle("tabulator-range-selected",-1!==n),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=n}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,n,i){this.navigate(n,i,e)&&t.preventDefault()}navigate(t,e,n){var i,r,o,a,s,l,u;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)))),r=this.activeRange,a=(o=e?r.end:r.start).row,s=o.col,t)switch(n){case"left":s=this.findJumpCellLeft(r.start.row,o.col);break;case"right":s=this.findJumpCellRight(r.start.row,o.col);break;case"up":a=this.findJumpCellUp(o.row,r.start.col);break;case"down":a=this.findJumpCellDown(o.row,r.start.col)}else{if(e&&("row"===this.selecting&&("left"===n||"right"===n)||"column"===this.selecting&&("up"===n||"down"===n)))return;switch(n){case"left":s=Math.max(s-1,0);break;case"right":s=Math.min(s+1,this.getTableColumns().length-1);break;case"up":a=Math.max(a-1,0);break;case"down":a=Math.min(a+1,this.getTableRows().length-1)}}return i=s!==o.col||a!==o.row,e||r.setStart(a,s),r.setEnd(a,s),e||(this.selecting="cell"),i?(l=this.getRowByRangePos(r.end.row),u=this.getColumnByRangePos(r.end.col),"left"!==n&&"right"!==n||null!==u.getElement().parentNode?"up"!==n&&"down"!==n||null!==l.getElement().parentNode?this.autoScroll(r,l.getElement(),u.getElement()):l.getComponent().scrollTo(void 0,!1):u.getComponent().scrollTo(void 0,!1),this.layoutElement(),!0):void 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()}findJumpCell(t,e,n,i){var r;e&&(t=t.reverse());for(let e of t){let t=e.getValue();if(n){if(r=e,t)break}else if(i){if(r=e,t)break}else{if(!t)break;r=e}}return r}findJumpCellLeft(t,e){var n=this.getRowByRangePos(t).cells.filter((t=>t.column.visible)),i=!n[e].getValue(),r=!!n[e]&&!n[e].getValue(),o=e,a=this.rowHeader?n.slice(1,e):n.slice(0,e),s=this.findJumpCell(a,!0,i,r);return s&&(o=s.column.getPosition()-1),o}findJumpCellRight(t,e){var n=this.getRowByRangePos(t).cells.filter((t=>t.column.visible)),i=!n[e].getValue(),r=!!n[e+1]&&!n[e+1].getValue(),o=e,a=this.findJumpCell(n.slice(e+1,n.length),!1,i,r);return a&&(o=a.column.getPosition()-1),o}findJumpCellUp(t,e){var n=this.getColumnByRangePos(e).cells.filter((t=>this.table.rowManager.activeRows.includes(t.row))),i=!n[t].getValue(),r=!!n[t-1]&&!n[t-1].getValue(),o=t,a=this.findJumpCell(n.slice(0,o),!0,i,r);return a&&(o=a.row.position-1),o}findJumpCellDown(t,e){var n=this.getColumnByRangePos(e).cells.filter((t=>this.table.rowManager.activeRows.includes(t.row))),i=!n[t].getValue(),r=!!n[t+1]&&!n[t+1].getValue(),o=t,a=this.findJumpCell(n.slice(o+1,n.length),!1,i,r);return a&&(o=a.row.position-1),o}newSelection(t,e){var n;if("column"===e.type){if(!this.columnSelection)return;if(e===this.rowHeader){n=this.resetRanges(),this.selecting="all";var i,r=this.getCell(-1,-1);return i=this.rowHeader?this.getCell(0,1):this.getCell(0,0),void n.setBounds(i,r)}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,n){var i,r,o,a,s,l=this.table.rowManager.element;void 0===e&&(e=this.getRowByRangePos(t.end.row).getElement()),void 0===n&&(n=this.getColumnByRangePos(t.end.col).getElement()),this.rowHeader&&(i=this.rowHeader.getElement()),r={left:n.offsetLeft,right:n.offsetLeft+n.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},i&&(o.left+=i.offsetWidth),a=o.lefto.right&&(l.scrollLeft=r.right-l.clientWidth)),s||(r.topo.bottom&&(l.scrollTop=r.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(),n=!1,i=this.ranges.some((e=>e.occupiesRow(t)));"row"===this.selecting?n=i:"all"===this.selecting&&(n=!0),e.classList.toggle("tabulator-range-selected",n),e.classList.toggle("tabulator-range-highlight",i)}layoutColumn(t){var e=t.getElement(),n=!1,i=this.ranges.some((e=>e.occupiesColumn(t)));"column"===this.selecting?n=i:"all"===this.selecting&&(n=!0),e.classList.toggle("tabulator-range-selected",n),e.classList.toggle("tabulator-range-highlight",i)}layoutRanges(){var t;this.table.initialized&&(t=this.getActiveCell())&&(this.activeRangeCellElement.style.left=t.row.getElement().offsetLeft+t.getElement().offsetLeft+"px",this.activeRangeCellElement.style.top=t.row.getElement().offsetTop+"px",this.activeRangeCellElement.style.width=t.getElement().offsetLeft+t.getElement().offsetWidth-t.getElement().offsetLeft+"px",this.activeRangeCellElement.style.height=t.row.getElement().offsetTop+t.row.getElement().offsetHeight-t.row.getElement().offsetTop+"px",this.ranges.forEach((t=>t.layout())),this.overlay.style.visibility="visible")}getCell(t,e){var n;return e<0&&(e=this.getTableColumns().length+e)<0?null:(t<0&&(t=this.getTableRows().length+t),(n=this.table.rowManager.getRowFromPosition(t+1))?n.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()}getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}addRange(t,e){var n;return!0!==this.maxRanges&&this.ranges.length>=this.maxRanges&&this.ranges.shift().destroy(),n=new bt(this.table,this,t,e),this.activeRange=n,this.ranges.push(n),this.rangeContainer.appendChild(n.element),n}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[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()}}vt.moduleName="selectRange";class yt extends a{constructor(t){super(t),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipGenerationMode",void 0),this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){this.deprecationCheckMsg("tooltipGenerationMode","This option is no longer needed as tooltips are always generated on hover now")}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,n){var i="tooltip"===t?n.column.definition.tooltip:n.definition.headerTooltip;i&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,e,n,i),this.table.options.tooltipDelay))}mouseoutCheck(t,e,n){this.popupInstance||this.clearPopup()}clearPopup(t,e,n){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(t,e,n){var i,r,o;"function"==typeof n&&(n=n(t,e.getComponent(),(function(t){r=t}))),n instanceof HTMLElement?i=n:(i=document.createElement("div"),!0===n&&(e instanceof b?n=e.value:e.definition.field?this.langBind("columns|"+e.definition.field,(t=>{i.innerHTML=n=t||e.definition.title})):n=e.definition.title),i.innerHTML=n),(n||0===n||!1===n)&&(i.classList.add("tabulator-tooltip"),i.addEventListener("mousemove",(t=>t.preventDefault())),this.popupInstance=this.popup(i),"function"==typeof r&&this.popupInstance.renderCallback(r),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()))}}yt.moduleName="tooltip";var wt={integer:function(t,e,n){return""===e||null==e||(e=Number(e),!isNaN(e)&&isFinite(e)&&Math.floor(e)===e)},float:function(t,e,n){return""===e||null==e||(e=Number(e),!isNaN(e)&&isFinite(e)&&e%1!=0)},numeric:function(t,e,n){return""===e||null==e||!isNaN(e)},string:function(t,e,n){return""===e||null==e||isNaN(e)},alphanumeric:function(t,e,n){return""===e||null==e||new RegExp(/^[a-z0-9]+$/i).test(e)},max:function(t,e,n){return""===e||null==e||parseFloat(e)<=n},min:function(t,e,n){return""===e||null==e||parseFloat(e)>=n},starts:function(t,e,n){return""===e||null==e||String(e).toLowerCase().startsWith(String(n).toLowerCase())},ends:function(t,e,n){return""===e||null==e||String(e).toLowerCase().endsWith(String(n).toLowerCase())},minLength:function(t,e,n){return""===e||null==e||String(e).length>=n},maxLength:function(t,e,n){return""===e||null==e||String(e).length<=n},in:function(t,e,n){return""===e||null==e||("string"==typeof n&&(n=n.split("|")),n.indexOf(e)>-1)},regex:function(t,e,n){return""===e||null==e||new RegExp(n).test(e)},unique:function(t,e,n){if(""===e||null==e)return!0;var i=!0,r=t.getData(),o=t.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(t){var n=t.getData();n!==r&&e==o.getFieldValue(n)&&(i=!1)})),i},required:function(t,e,n){return""!==e&&null!=e}};class _t extends a{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,n){var i="manual"===this.table.options.validationMode||this.validate(t.column.modules.validate,t,e);return!0!==i&&setTimeout((()=>{t.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",t.getComponent(),e,i)})),i}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 n=(t=t.getComponent()).validate();!0!==n&&(e=e.concat(n))})),!e.length||e}initializeColumnCheck(t){void 0!==t.definition.validator&&this.initializeColumn(t)}initializeColumn(t){var e,n=this,i=[];t.definition.validator&&(Array.isArray(t.definition.validator)?t.definition.validator.forEach((t=>{(e=n._extractValidator(t))&&i.push(e)})):(e=this._extractValidator(t.definition.validator))&&i.push(e),t.modules.validate=!!i.length&&i)}_extractValidator(t){var e,n,i;switch(typeof t){case"string":return(i=t.indexOf(":"))>-1?(e=t.substring(0,i),n=t.substring(i+1)):e=t,this._buildValidator(e,n);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}}_buildValidator(t,e){var n="function"==typeof t?t:_t.validators[t];return n?{type:"function"==typeof t?"function":t,func:n,params:e}:(console.warn("Validator Setup Error - No matching validator found:",t),!1)}validate(t,e,n){var i=this,r=[],o=this.invalidCells.indexOf(e);return t&&t.forEach((t=>{t.func.call(i,e.getComponent(),n,t.params)||r.push({type:t.type,parameters:t.params})})),e.modules.validate||(e.modules.validate={}),r.length?(e.modules.validate.invalid=r,"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)),!r.length||r}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))}}_t.moduleName="validate",_t.validators=wt;var Ct=Object.freeze({__proto__:null,AccessorModule:s,AjaxModule:p,ClipboardModule:f,ColumnCalcsModule:E,DataTreeModule:M,DownloadModule:k,EditModule:S,ExportModule:O,FilterModule:z,FormatModule:N,FrozenColumnsModule:I,FrozenRowsModule:H,GroupRowsModule:V,HistoryModule:G,HtmlTableImportModule:U,ImportModule:Y,InteractionModule:K,KeybindingsModule:X,MenuModule:$,MoveColumnsModule:J,MoveRowsModule:Z,MutatorModule:Q,PageModule:et,PersistenceModule:rt,PopupModule:ot,PrintModule:at,ReactiveDataModule:st,ResizeColumnsModule:lt,ResizeRowsModule:ut,ResizeTableModule:ct,ResponsiveLayoutModule:ht,SelectRowModule:dt,SortModule:gt,SelectRangeModule:vt,TooltipModule:yt,ValidateModule:_t});class xt{constructor(t,e,n={}){this.table=t,this.msgType=e,this.registeredDefaults=Object.assign({},n)}register(t,e){this.registeredDefaults[t]=e}generate(t,e={}){var n=Object.assign({},this.registeredDefaults),i=this.table.options.debugInvalidOptions||!0===e.debugInvalidOptions;Object.assign(n,t);for(let t in e)n.hasOwnProperty(t)||(i&&console.warn("Invalid "+this.msgType+" option:",t),n[t]=e.key);for(let t in n)t in e?n[t]=e[t]:Array.isArray(n[t])?n[t]=Object.assign([],n[t]):"object"==typeof n[t]&&null!==n[t]?n[t]=Object.assign({},n[t]):void 0===n[t]&&delete n[t];return n}}class Et extends i{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 n=t.getElement();e%2?(n.classList.add("tabulator-row-even"),n.classList.remove("tabulator-row-odd")):(n.classList.add("tabulator-row-odd"),n.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(t){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(t,e,n){var i=this.rows().indexOf(t),o=t.getElement(),a=0;return new Promise(((s,l)=>{if(i>-1){if(void 0===n&&(n=this.table.options.scrollToRowIfVisible),!n&&r.elVisible(o)&&(a=r.elOffset(o).top-r.elOffset(this.elementVertical).top)>0&&a{n.appendChild(t.getElement())})),t.element.appendChild(n),e||t.cells.forEach((t=>{t.cellRendered()}))}reinitializeColumnWidths(t){t.forEach((function(t){t.reinitializeWidth()}))}}class Tt extends Et{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 n=e.getWidth();n>t&&(t=n)}})),this.windowBuffer=2*t}rerenderColumns(t,e){var n={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},i=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,n={};t.visible&&(t.modules.frozen||(e=t.getWidth(),n.leftPos=i,n.rightPos=i+e,n.width=e,this.isFitData&&(n.fitDataCheck=!t.modules.vdomHoz||t.modules.vdomHoz.fitDataCheck),i+e>this.vDomScrollPosLeft&&i{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,n=!1;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach((t=>{!t.definition.width&&t.visible&&(n=!0)})),n&&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 n=0;n{t!==this.columns[n]&&(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,n){for(let i=t;i{if("group"!==t.type){var e=t.getCell(n);t.getElement().insertBefore(e.getElement(),t.getCell(this.columns[this.rightCol]).getElement().nextSibling),e.cellRendered()}})),this.fitDataColActualWidthCheck(n),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-=n.getWidth()):e=!1}t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var t=!1,e=!0;e;){let n=this.columns[this.leftCol-1];if(n)if(n.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){t=!0,this.getVisibleRows().forEach((t=>{if("group"!==t.type){var e=t.getCell(n);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-=n.getWidth();let e=this.fitDataColActualWidthCheck(n);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 n=this.columns[this.rightCol];n&&n.modules.vdomHoz.leftPos>this.vDomScrollPosRight?(t=!0,this.getVisibleRows().forEach((t=>{if("group"!==t.type){var e=t.getCell(n);try{t.getElement().removeChild(e.getElement())}catch(t){console.warn("Could not removeColRight",t.message)}}})),this.vDomPadRight+=n.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 n=this.columns[this.leftCol];n&&n.modules.vdomHoz.rightPos{if("group"!==t.type){var e=t.getCell(n);try{t.getElement().removeChild(e.getElement())}catch(t){console.warn("Could not removeColLeft",t.message)}}})),this.vDomPadLeft+=n.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,n;return t.modules.vdomHoz.fitDataCheck&&(t.reinitializeWidth(),(n=(e=t.getWidth())-t.modules.vdomHoz.width)&&(t.modules.vdomHoz.rightPos+=n,t.modules.vdomHoz.width=e,this.colPositionAdjust(this.columns.indexOf(t)+1,this.columns.length,n)),t.modules.vdomHoz.fitDataCheck=!1),n}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 n=t.getCell(e);t.getElement().appendChild(n.getElement()),n.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 n=t.getElement();n.firstChild;)n.removeChild(n.firstChild);this.initializeRow(t)}}}class kt extends i{constructor(t){super(t),this.blockHozScrollEvent=!1,this.headersElement=null,this.contentsElement=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new xt(this.table,"column definition",y),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,e={virtual:Tt,basic:Mt};(t="string"==typeof this.table.options.renderHorizontal?e[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,n,i=[],r=this.table.options.autoColumnsDefinitions;if(t&&t.length){for(var o in e=t[0]){let t={field:o,title:o},r=e[o];switch(typeof r){case"undefined":n="string";break;case"boolean":n="boolean";break;case"object":n=Array.isArray(r)?"array":"string";break;default:n=isNaN(r)||""===r?r.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}t.sorter=n,i.push(t)}if(r)switch(typeof r){case"function":this.table.options.columns=r.call(this.table,i);break;case"object":Array.isArray(r)?i.forEach((t=>{var e=r.find((e=>e.field===t.field));e&&Object.assign(t,e)})):i.forEach((t=>{r[t.field]&&Object.assign(t,r[t.field])})),this.table.options.columns=i}else this.table.options.columns=i;this.setColumns(this.table.options.columns)}}setColumns(t,e){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),t.forEach(((t,e)=>{this._addColumn(t)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(t,e,n){var i=new w(t,this),r=i.getElement(),o=n?this.findColumnIndex(n):n;if(n&&o>-1){var a=n.getTopColumn(),s=this.columns.indexOf(a),l=a.getElement();e?(this.columns.splice(s,0,i),l.parentNode.insertBefore(r,l)):(this.columns.splice(s+1,0,i),l.parentNode.insertBefore(r,l.nextSibling))}else e?(this.columns.unshift(i),this.headersElement.insertBefore(i.getElement(),this.headersElement.firstChild)):(this.columns.push(i),this.headersElement.appendChild(i.getElement()));return i.columnRendered(),i}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 n=e.getHeight();n>t&&(t=n)})),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 w?t:t instanceof v?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((n=>{(this.table.options.nestedFieldSeparator?n.split(this.table.options.nestedFieldSeparator)[0]:n)===t&&e.push(this.columnsByField[n])})),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,n)=>{t(e,n)}))}getDefinitions(t){var e=[];return this.columnsByIndex.forEach((n=>{(!t||t&&n.visible)&&e.push(n.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,n){e.element.parentNode.insertBefore(t.element,e.element),n&&e.element.parentNode.insertBefore(e.element,t.element),this.moveColumnActual(t,e,n),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(t,e,n){t.parent.isGroup?this._moveColumnInArray(t.parent.columns,t,e,n):this._moveColumnInArray(this.columns,t,e,n),this._moveColumnInArray(this.columnsByIndex,t,e,n,!0),this.rerenderColumns(!0),this.dispatch("column-moved",t,e,n),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",t.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(t,e,n,i,r){var o,a=t.indexOf(e);a>-1&&(t.splice(a,1),(o=t.indexOf(n))>-1?i&&(o+=1):o=a,t.splice(o,0,e),r&&(this.chain("column-moving-rows",[e,n,i],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(t){if(t.cells.length){var e=t.cells.splice(a,1)[0];t.cells.splice(o,0,e)}})))}scrollToColumn(t,e,n){var i=0,r=t.getLeftOffset(),o=0,a=t.getElement();return new Promise(((s,l)=>{if(void 0===e&&(e=this.table.options.scrollToColumnPosition),void 0===n&&(n=this.table.options.scrollToColumnIfVisible),t.visible){switch(e){case"middle":case"center":o=-this.element.clientWidth/2;break;case"right":o=a.clientWidth-this.headersElement.clientWidth}if(!n&&r>0&&r+a.offsetWidth{e.push(n.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(n){var i,r,o;n.visible&&(i=n.definition.width||0,r=parseInt(n.minWidth),o="string"==typeof i?i.indexOf("%")>-1?t/100*parseInt(i):parseInt(i):i,e+=o>r?o:r)})),e}addColumn(t,e,n){return new Promise(((i,r)=>{var o=this._addColumn(t,e,n);this._reIndexColumns(),this.dispatch("column-add",t,e,n),"fitColumns"!=this.layoutMode()&&o.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.rerenderColumns(),i(o)}))}deregisterColumn(t){var e,n=t.getField();n&&delete this.columnsByField[n],(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){r.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 Dt extends Et{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,n=document.createDocumentFragment(),i=this.rows();i.forEach(((t,i)=>{this.styleRow(t,i),t.initialize(!1,!0),"group"!==t.type&&(e=!1),n.appendChild(t.getElement())})),t.appendChild(n),i.forEach((t=>{t.rendered(),t.heightInitialized||t.calcHeight(!0)})),i.forEach((t=>{t.heightInitialized||t.setCellHeight()})),t.style.minWidth=e?this.table.columnManager.getWidth()+"px":""}rerenderRows(t){this.clearRows(),t&&t(),this.renderRows(),this.rows().length||this.table.rowManager.tableEmpty()}scrollToRowNearestTop(t){var e=r.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=r.elOffset(e).top-r.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(t){return this.rows()}}class At extends Et{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,n=!1,i=!1,r=this.table.rowManager.scrollLeft,o=this.rows(),a=this.vDomTop;a<=this.vDomBottom;a++)if(o[a]){var s=e-o[a].getElement().offsetTop;if(!(!1===i||Math.abs(s){t.deinitializeHeight()})),t&&t(),this.rows().length?this._virtualRenderFill(!1===n?this.rows.length-1:n,!0,i||0):(this.clear(),this.table.rowManager.tableEmpty()),this.scrollColumns(r)}scrollColumns(t){this.table.rowManager.scrollHorizontal(t)}scrollRows(t,e){var n=t-this.vDomScrollPosTop,i=t-this.vDomScrollPosBottom,r=2*this.vDomWindowBuffer,o=this.rows();if(this.scrollTop=t,-n>r||i>r){var a=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*o.length)),this.scrollColumns(a)}else e?(n<0&&this._addTopRow(o,-n),i<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(o,-i):this.vDomScrollPosBottom=this.scrollTop)):(i>=0&&this._addBottomRow(o,i),n>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(o,n):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,n=this.elementVertical.clientHeight+e,i=!1,r=0,o=0,a=this.rows();if(t)r=this.vDomTop,o=this.vDomBottom;else for(var s=this.vDomTop;s<=this.vDomBottom;s++)if(a[s])if(i){if(!(n-a[s].getElement().offsetTop>=0))break;o=s}else if(e-a[s].getElement().offsetTop>=0)r=s;else{if(i=!0,!(n-a[s].getElement().offsetTop>=0))break;o=s}return a.slice(r,o+1)}_virtualRenderFill(t,e,n){var i,o,a=this.tableElement,s=this.elementVertical,l=0,u=0,c=0,h=0,d=0,p=0,f=this.rows(),g=f.length,m=0,b=[],v=0,y=0,w=this.table.rowManager.fixedHeight,_=this.elementVertical.clientHeight,C=this.table.options.rowHeight,x=!0;if(n=n||0,t=t||0){for(;a.firstChild;)a.removeChild(a.firstChild);(h=(g-t+1)*this.vDomRowHeight)<_&&(t-=Math.ceil((_-h)/this.vDomRowHeight))<0&&(t=0),t-=l=Math.min(Math.max(Math.floor(this.vDomWindowBuffer/this.vDomRowHeight),this.vDomWindowMinMarginRows),t)}else this.clear();if(g&&r.elVisible(this.elementVertical)){for(this.vDomTop=t,this.vDomBottom=t-1,w||this.table.options.maxHeight?(C&&(y=_/C+this.vDomWindowBuffer/C),y=Math.max(this.vDomWindowMinTotalRows,Math.ceil(y))):y=g;(y==g||u<=_+this.vDomWindowBuffer||v{t.rendered(),t.heightInitialized||t.calcHeight(!0)})),b.forEach((t=>{t.heightInitialized||t.setCellHeight()})),b.forEach((t=>{c=t.getHeight(),vthis.vDomWindowBuffer&&(this.vDomWindowBuffer=2*c),v++})),x=this.table.rowManager.adjustTableSize(),_=this.elementVertical.clientHeight,x&&(w||this.table.options.maxHeight)&&(C=u/v,y=Math.max(this.vDomWindowMinTotalRows,Math.ceil(_/C+this.vDomWindowBuffer/C)))}t?(this.vDomTopPad=e?this.vDomRowHeight*this.vDomTop+n:this.scrollTop-d,this.vDomBottomPad=this.vDomBottom==g-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-u-d,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((u+d)/v),this.vDomBottomPad=this.vDomRowHeight*(g-this.vDomBottom-1),this.vDomScrollHeight=d+u+this.vDomBottomPad-_),a.style.paddingTop=this.vDomTopPad+"px",a.style.paddingBottom=this.vDomBottomPad+"px",e&&(this.scrollTop=this.vDomTopPad+d+n-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-_:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-_),this.elementVertical.scrollWidth>this.elementVertical.clientWidth&&e&&(this.scrollTop+=this.elementVertical.offsetHeight-_),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,s.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(t,e){for(var n=this.tableElement,i=[],r=0,o=this.vDomTop-1,a=0,s=!0;s;)if(this.vDomTop){let l,u,c=t[o];c&&a=l?(this.styleRow(c,o),n.insertBefore(c.getElement(),n.firstChild),c.initialized&&c.heightInitialized||i.push(c),c.initialize(),u||(l=c.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),e-=l,r+=l,this.vDomTop--,o--,a++):s=!1):s=!1}else s=!1;for(let t of i)t.clearCellHeight();this._quickNormalizeRowHeight(i),r&&(this.vDomTopPad-=r,this.vDomTopPad<0&&(this.vDomTopPad=o*this.vDomRowHeight),o<1&&(this.vDomTopPad=0),n.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=r)}_removeTopRow(t,e){for(var n=[],i=0,r=0,o=!0;o;){let a,s=t[this.vDomTop];s&&r=a?(this.vDomTop++,e-=a,i+=a,n.push(s),r++):o=!1):o=!1}for(let t of n){let e=t.getElement();e.parentNode&&e.parentNode.removeChild(e)}i&&(this.vDomTopPad+=i,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?i:i+this.vDomWindowBuffer)}_addBottomRow(t,e){for(var n=this.tableElement,i=[],r=0,o=this.vDomBottom+1,a=0,s=!0;s;){let l,u,c=t[o];c&&a=l?(this.styleRow(c,o),n.appendChild(c.getElement()),c.initialized&&c.heightInitialized||i.push(c),c.initialize(),u||(l=c.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),e-=l,r+=l,this.vDomBottom++,o++,a++):s=!1):s=!1}for(let t of i)t.clearCellHeight();this._quickNormalizeRowHeight(i),r&&(this.vDomBottomPad-=r,(this.vDomBottomPad<0||o==t.length-1)&&(this.vDomBottomPad=0),n.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=r)}_removeBottomRow(t,e){for(var n=[],i=0,r=0,o=!0;o;){let a,s=t[this.vDomBottom];s&&r=a?(this.vDomBottom--,e-=a,i+=a,n.push(s),r++):o=!1):o=!1}for(let t of n){let e=t.getElement();e.parentNode&&e.parentNode.removeChild(e)}i&&(this.vDomBottomPad+=i,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=i)}_quickNormalizeRowHeight(t){for(let e of t)e.calcHeight();for(let e of t)e.setCellHeight()}}class Rt extends i{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 n=document.createElement("div");n.classList.add("tabulator-placeholder-contents"),n.innerHTML=t,e.appendChild(n),this.placeholderContents=n}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,n=this.element.scrollTop,i=this.scrollTop>n;this.scrollLeft!=t&&(this.scrollLeft=t,this.dispatch("scroll-horizontal",t,e),this.dispatchExternal("scrollHorizontal",t,e),this._positionPlaceholder()),this.scrollTop!=n&&(this.scrollTop=n,this.renderer.scrollRows(n,i),this.dispatch("scroll-vertical",n,i),this.dispatchExternal("scrollVertical",n,i))}))}findRow(t){return"object"!=typeof t?void 0!==t&&(this.rows.find((e=>e.data[this.table.options.index]==t))||!1):t instanceof C?t:t instanceof _?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=>e.getPosition()===t&&e.isDisplayed()))}scrollToRow(t,e,n){return this.renderer.scrollToRowPosition(t,e,n)}setData(t,e,n){return new Promise(((i,r)=>{e&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(t,!0):this.reRenderInPosition((()=>{this._setDataActual(t)})):(this.table.options.autoColumns&&n&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(t),this.resetScroll(),this._setDataActual(t)),i()}))}_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 n=new C(t,this);this.rows.push(n)}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 n=this.rows.indexOf(t),i=this.activeRows.indexOf(t);i>-1&&this.activeRows.splice(i,1),n>-1&&this.rows.splice(n,1),this.setActiveRows(this.activeRows),this.displayRowIterator((e=>{var n=e.indexOf(t);n>-1&&e.splice(n,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,n,i){return this.addRowActual(t,e,n,i)}addRows(t,e,n,i){var r=[];return new Promise(((o,a)=>{e=this.findAddRowPos(e),Array.isArray(t)||(t=[t]),(void 0===n&&e||void 0!==n&&!e)&&t.reverse(),t.forEach(((t,i)=>{var o=this.addRow(t,e,n,!0);r.push(o),this.dispatch("row-added",o,t,e,n)})),this.refreshActiveData(!!i&&"displayPipeline",!1,!0),this.regenerateRowPositions(),this.displayRowsCount&&this._clearPlaceholder(),o(r)}))}findAddRowPos(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t}addRowActual(t,e,n,i){var r,o,a=t instanceof C?t:new C(t||{},this),s=this.findAddRowPos(e),l=-1;return n||(o=this.chain("row-adding-position",[a,s],null,{index:n,top:s}),n=o.index,s=o.top),void 0!==n&&(n=this.findRow(n)),(n=this.chain("row-adding-index",[a,n,s],null,n))&&(l=this.rows.indexOf(n)),n&&l>-1?(r=this.activeRows.indexOf(n),this.displayRowIterator((function(t){var e=t.indexOf(n);e>-1&&t.splice(s?e:e+1,0,a)})),r>-1&&this.activeRows.splice(s?r:r+1,0,a),this.rows.splice(s?l:l+1,0,a)):s?(this.displayRowIterator((function(t){t.unshift(a)})),this.activeRows.unshift(a),this.rows.unshift(a)):(this.displayRowIterator((function(t){t.push(a)})),this.activeRows.push(a),this.rows.push(a)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",a.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),i||this.reRenderInPosition(),a}moveRow(t,e,n){this.dispatch("row-move",t,e,n),this.moveRowActual(t,e,n),this.regenerateRowPositions(),this.dispatch("row-moved",t,e,n),this.dispatchExternal("rowMoved",t.getComponent())}moveRowActual(t,e,n){this.moveRowInArray(this.rows,t,e,n),this.moveRowInArray(this.activeRows,t,e,n),this.displayRowIterator((i=>{this.moveRowInArray(i,t,e,n)})),this.dispatch("row-moving",t,e,n)}moveRowInArray(t,e,n,i){var r,o,a;if(e!==n&&((r=t.indexOf(e))>-1&&(t.splice(r,1),(o=t.indexOf(n))>-1?i?t.splice(o+1,0,e):t.splice(o,0,e):t.splice(r,0,e)),t===this.getDisplayRows())){a=o>r?o:r+1;for(let e=r-1&&e}nextDisplayRow(t,e){var n=this.getDisplayRowIndex(t),i=!1;return!1!==n&&n-1)&&n}getData(t,e){var n=[];return this.getRows(t).forEach((function(t){"row"==t.type&&n.push(t.getData(e||"data"))})),n}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,n){var i=this.table,o="",a=0,s=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if("function"==typeof t)if((a=this.dataPipeline.findIndex((e=>e.handler===t)))>-1)o="dataPipeline",e&&(a==this.dataPipeline.length-1?o="display":a++);else{if(!((a=this.displayPipeline.findIndex((e=>e.handler===t)))>-1))return void console.error("Unable to refresh data, invalid handler provided",t);o="displayPipeline",e&&(a==this.displayPipeline.length-1?o="end":a++)}else o=t||"all",a=0;if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===o&&a{"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 n=Object.assign([],this.renderer.visibleRows(!e));return t&&(n=this.chain("rows-visible",[e],n,n)),n}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,e={virtual:At,basic:Dt};(t="string"==typeof this.table.options.renderVertical?e[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=!1:this.fixedHeight=!0):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 n=t.getElement();e%2?(n.classList.add("tabulator-row-even"),n.classList.remove("tabulator-row-odd")):(n.classList.add("tabulator-row-odd"),n.classList.remove("tabulator-row-even"))}normalizeHeight(){this.activeRows.forEach((function(t){t.normalizeHeight()}))}adjustTableSize(){let t,e=this.element.clientHeight,n=!1;if("fill"===this.renderer.verticalFillMode){let i=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){t=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";const e="calc(100% - "+i+"px)";this.element.style.minHeight=t||"calc(100% - "+i+"px)",this.element.style.height=e,this.element.style.maxHeight=e}else this.element.style.height="",this.element.style.height=this.table.element.clientHeight-i+"px",this.element.scrollTop=this.scrollTop;this.renderer.resize(),this.fixedHeight||e==this.element.clientHeight||(n=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw()),this.scrollBarCheck()}return this._positionPlaceholder(),n}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 St extends i{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 Pt extends i{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,n){this.pseudoTrackers[t].target!==n&&(this.pseudoTrackers[t].target&&this.dispatch(t+"-mouseleave",e,this.pseudoTrackers[t].target),this.pseudoMouseLeave(t,e),this.pseudoTrackers[t].target=n,this.dispatch(t+"-mouseenter",e,n))}pseudoMouseLeave(t,e){var n=Object.keys(this.pseudoTrackers),i={row:["cell"],cell:["row"]};(n=n.filter((e=>{var n=i[t];return e!==t&&(!n||n&&!n.includes(e))}))).forEach((t=>{var n=this.pseudoTrackers[t].target;this.pseudoTrackers[t].target&&(this.dispatch(t+"-mouseleave",e,n),this.pseudoTrackers[t].target=null)}))}bindSubscriptionWatchers(){var t=Object.keys(this.listeners),e=Object.values(this.componentMap);for(let n of e)for(let e of t){let t=n+"-"+e;this.subscriptionChange(t,this.subscriptionChanged.bind(this,n,e))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(t,e,n){var i=this.listeners[e].components,r=i.indexOf(t),o=!1;n?-1===r&&(i.push(t),o=!0):this.subscribed(t+"-"+e)||r>-1&&(i.splice(r,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 n=e.composedPath&&e.composedPath()||e.path,i=this.findTargets(n);i=this.bindComponents(t,i),this.triggerEvents(t,e,i),!this.pseudoTracking||"mouseover"!=t&&"mouseleave"!=t||Object.keys(i).length||this.pseudoMouseLeave("none",e)}findTargets(t){var e={};let n=Object.keys(this.componentMap);for(let i of t){let t=i.classList?[...i.classList]:[];if(t.filter((t=>this.abortClasses.includes(t))).length)break;let r=t.filter((t=>n.includes(t)));for(let t of r)e[this.componentMap[t]]||(e[this.componentMap[t]]=i)}return e.group&&e.group===e.row&&delete e.row,e}bindComponents(t,e){var n=Object.keys(e).reverse(),i=this.listeners[t],r={},o={};for(let t of n){let n,a=e[t],s=this.previousTargets[t];if(s&&s.target===a)n=s.component;else switch(t){case"row":case"group":(i.components.includes("row")||i.components.includes("cell")||i.components.includes("group"))&&(n=this.table.rowManager.getVisibleRows(!0).find((t=>t.getElement()===a)),e.row&&e.row.parentNode&&e.row.parentNode.closest(".tabulator-row")&&(e[t]=!1));break;case"column":i.components.includes("column")&&(n=this.table.columnManager.findColumn(a));break;case"cell":i.components.includes("cell")&&(r.row instanceof C?n=r.row.findCell(a):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?"))}n&&(r[t]=n,o[t]={target:a,component:n})}return this.previousTargets=o,r}triggerEvents(t,e,n){var i=this.listeners[t];for(let r in n)n[r]&&i.components.includes(r)&&this.dispatch(r+"-"+t,e,n[r])}clearWatchers(){for(let t in this.listeners){let e=this.listeners[t];e.handler&&(this.el.removeEventListener(t,e.handler),e.handler=null)}}}class Lt{constructor(t){this.table=t,this.bindings={}}bind(t,e,n){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,n):this.bindings[t][e]=n}handle(t,e,n){if(this.bindings[t]&&this.bindings[t][n]&&"function"==typeof this.bindings[t][n].bind)return this.bindings[t][n].bind(null,e);"then"===n||"string"!=typeof n||n.startsWith("_")||this.table.options.debugInvalidComponentFuncs&&console.error("The "+t+" component does not have a "+n+" function, have you checked that you have the correct Tabulator module installed?")}}class Ot extends i{constructor(t){super(t),this.requestOrder=0,this.loading=!1}initialize(){}load(t,e,n,i,r,o){var a=++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,n,r])?(this.loading=!0,r||this.alertLoader(),e=this.chain("data-params",[t,n,r],e||{},e||{}),e=this.mapParams(e,this.table.options.dataSendParams),this.chain("data-load",[t,e,n,r],!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);a==this.requestOrder?(this.clearAlert(),!1!==e&&(this.dispatchExternal("dataLoaded",e),this.table.rowManager.setData(e,i,void 0===o?!i: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),r||this.alertError(),setTimeout((()=>{this.clearAlert()}),this.table.options.dataLoaderErrorTimeout)})).finally((()=>{this.loading=!1}))):(this.dispatchExternal("dataLoaded",t),t||(t=[]),this.table.rowManager.setData(t,i,void 0===o?!i:o),Promise.resolve()))}mapParams(t,e){var n={};for(let i in t)n[e.hasOwnProperty(i)?e[i]:i]=t[i];return n}objectInvert(t){var e={};for(let n in t)e[t[n]]=n;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 Ft{constructor(t,e,n){this.table=t,this.events={},this.optionsList=e||{},this.subscriptionNotifiers={},this.dispatch=n?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=n}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 n;if(this.events[t]){if(e){if(!((n=this.events[t].findIndex((t=>t===e)))>-1))return void console.warn("Cannot remove event, no matching event found:",t,e);this.events[t].splice(n,1)}else delete this.events[t];this._notifySubscriptionChange(t,!1)}else console.warn("Cannot remove event, no events set on:",t)}subscribed(t){return this.events[t]&&this.events[t].length}_notifySubscriptionChange(t,e){var n=this.subscriptionNotifiers[t];n&&n.forEach((t=>{t(e)}))}_dispatch(){var t,e=Array.from(arguments),n=e.shift();return this.events[n]&&this.events[n].forEach(((n,i)=>{let r=n.apply(this.table,e);i||(t=r)})),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 zt{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,n=1e4){this.events[t]||(this.events[t]=[]),this.events[t].push({callback:e,priority:n}),this.events[t].sort(((t,e)=>t.priority-e.priority)),this._notifySubscriptionChange(t,!0)}unsubscribe(t,e){var n;if(this.events[t]){if(e){if(!((n=this.events[t].findIndex((t=>t.callback===e)))>-1))return void console.warn("Cannot remove event, no matching event found:",t,e);this.events[t].splice(n,1)}this._notifySubscriptionChange(t,!1)}else console.warn("Cannot remove event, no events set on:",t)}subscribed(t){return this.events[t]&&this.events[t].length}_chain(t,e,n,i){var r=n;return Array.isArray(e)||(e=[e]),this.subscribed(t)?(this.events[t].forEach(((t,n)=>{r=t.callback.apply(this,e.concat([r]))})),r):"function"==typeof i?i():i}_confirm(t,e){var n=!1;return Array.isArray(e)||(e=[e]),this.subscribed(t)&&this.events[t].forEach(((t,i)=>{t.callback.apply(this,e)&&(n=!0)})),n}_notifySubscriptionChange(t,e){var n=this.subscriptionNotifiers[t];n&&n.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 Bt extends i{constructor(t){super(t)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(t,e,n){var i="";return void 0===this.options(t)||(i="Deprecated Setup Option - Use of the %c"+t+"%c option is now deprecated",e?(i=i+", Please use the %c"+e+"%c option instead",this._warnUser(i,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;"),n&&(this.table.options[e]=this.table.options[t])):this._warnUser(i,"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)}}class Nt{static register(t){Nt.tables.push(t)}static deregister(t){var e=Nt.tables.indexOf(t);e>-1&&Nt.tables.splice(e,1)}static lookupTable(t,e){var n,i,r=[];if("string"==typeof t){if((n=document.querySelectorAll(t)).length)for(var o=0;o{t.widthFixed||t.reinitializeWidth(),(this.table.options.responsiveLayout?t.modules.responsive.visible:t.visible)&&(o=t),t.visible&&(n+=t.getWidth())})),o?(r=i-n+o.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(o.setWidth(0),this.table.modules.responsiveLayout.update()),r>0?o.setWidth(r):o.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(t,e){var n,i,r=this.table.rowManager.element.getBoundingClientRect().width,o=0,a=0,s=0,l=[],u=[],c=0,h=0;function d(t){return"string"==typeof t?t.indexOf("%")>-1?r/100*parseInt(t):parseInt(t):t}function p(t,e,n,i){var r=[],o=0,a=0,l=0,u=s,c=0,h=0,f=[];function g(t){return n*(t.column.definition.widthGrow||1)}function m(t){return d(t.width)-n*(t.column.definition.widthShrink||0)}return t.forEach((function(t,o){var a=i?m(t):g(t);t.column.minWidth>=a?r.push(t):t.column.maxWidth&&t.column.maxWidththis.table.rowManager.element.clientHeight&&(r-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),t.forEach((function(t){var e,n,i;t.visible&&(e=t.definition.width,n=parseInt(t.minWidth),e?(i=d(e),o+=i>n?i:n,t.definition.widthShrink&&(u.push({column:t,width:i>n?i:n}),c+=t.definition.widthShrink)):(l.push({column:t,width:0}),s+=t.definition.widthGrow||1))})),a=r-o,n=Math.floor(a/s),h=p(l,a,n,!1),l.length&&h>0&&(l[l.length-1].width+=h),l.forEach((function(t){a-=t.width})),(i=Math.abs(h)+a)>0&&c&&(h=p(u,i,Math.floor(i/c),!0)),h&&u.length&&(u[u.length-1].width-=h),l.forEach((function(t){t.column.setWidth(t.width)})),u.forEach((function(t){t.column.setWidth(t.width)}))}};class jt extends a{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;jt.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"),jt.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,t),this.dispatch("layout-refreshed")}}jt.moduleName="layout",jt.modes=Ht;class Wt extends a{constructor(t){super(t),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=r.deepClone(Wt.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let t in 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 n in e)t[n]&&"object"==typeof t[n]?this._setLangProp(t[n],e[n]):t[n]=e[n]}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=r.deepClone(this.langList.default||{}),"default"!=t&&function t(e,n){for(var i in e)"object"==typeof e[i]?(n[i]||(n[i]={}),t(e[i],n[i])):n[i]=e[i]}(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 n=(e?t+"|"+e:t).split("|");return this._getLangElement(n,this.locale)||""}_getLangElement(t,e){var n=this.lang;return t.forEach((function(t){var e;n&&(e=n[t],n=void 0!==e&&e)})),n}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)}))}}Wt.moduleName="localize",Wt.langs={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 Vt extends a{constructor(t){super(t)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(t){var e=[];return Nt.lookupTable(t).forEach((t=>{this.table!==t&&e.push(t)})),e}send(t,e,n,i){var r=this.getConnections(t);r.forEach((t=>{t.tableComms(this.table.element,e,n,i)})),!r.length&&t&&console.warn("Table Connection Error - No tables matching selector found",t)}receive(t,e,n,i){if(this.table.modExists(e))return this.table.modules[e].commsReceived(t,n,i);console.warn("Inter-table Comms Error - no such module:",e)}}Vt.moduleName="comms";var Gt=Object.freeze({__proto__:null,LayoutModule:jt,LocalizeModule:Wt,CommsModule:Vt});class Ut{constructor(t,e){this.bindStaticFunctionality(t),this.bindModules(t,Gt,!0),e&&this.bindModules(t,e)}bindStaticFunctionality(t){t.moduleBindings={},t.extendModule=function(e,n,i){if(t.moduleBindings[e]){var r=t.moduleBindings[e][n];if(r)if("object"==typeof i)for(let t in i)r[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:",n)}else console.warn("Module Error - module does not exist:",e)},t.registerModule=function(e){Array.isArray(e)||(e=[e]),e.forEach((e=>{t.registerModuleBinding(e)}))},t.registerModuleBinding=function(e){t.moduleBindings[e.moduleName]=e},t.findTable=function(t){var e=Nt.lookupTable(t,!0);return!(Array.isArray(e)&&!e.length)&&e},t.prototype.bindModules=function(){var e=[],n=[],i=[];for(var r in this.modules={},t.moduleBindings){let o=t.moduleBindings[r],a=new o(this);this.modules[r]=a,o.prototype.moduleCore?this.modulesCore.push(a):o.moduleInitOrder?o.moduleInitOrder<0?e.push(a):n.push(a):i.push(a)}e.sort(((t,e)=>t.moduleInitOrder>e.moduleInitOrder?1:-1)),n.sort(((t,e)=>t.moduleInitOrder>e.moduleInitOrder?1:-1)),this.modulesRegular=e.concat(i.concat(n))}}bindModules(t,e,n){var i=Object.values(e);n&&i.forEach((t=>{t.prototype.moduleCore=!0})),t.registerModule(i)}}class qt extends i{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 Yt{constructor(t,e){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 Lt(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new Bt(this),this.optionsList=new xt(this,"table constructor"),this.initialized=!1,this.destroyed=!1,this.initializeElement(t)&&(this.initializeCoreSystems(e),setTimeout((()=>{this._create()}))),Nt.register(this)}initializeElement(t){return"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?(this.element=t,!0):"string"==typeof t?(this.element=document.querySelector(t),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",t),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",t),!1)}initializeCoreSystems(t){this.columnManager=new kt(this),this.rowManager=new Rt(this),this.footerManager=new St(this),this.dataLoader=new Ot(this),this.alertManager=new qt(this),this.bindModules(),this.options=this.optionsList.generate(Yt.defaultOptions,t),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Ft(this,this.options,this.options.debugEventsExternal),this.eventBus=new zt(this.options.debugEventsInternal),this.interactionMonitor=new Pt(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._loadInitialData(),this.initialized=!0,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,n=this.options;if("TABLE"===e.tagName){this.originalElement=this.element,t=document.createElement("div");var i=e.attributes;for(var r in i)"object"==typeof i[r]&&t.setAttribute(i[r].name,i[r].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);n.height&&(n.height=isNaN(n.height)?n.height:n.height+"px",e.style.height=n.height),!1!==n.minHeight&&(n.minHeight=isNaN(n.minHeight)?n.minHeight:n.minHeight+"px",e.style.minHeight=n.minHeight),!1!==n.maxHeight&&(n.maxHeight=isNaN(n.maxHeight)?n.maxHeight:n.maxHeight+"px",e.style.maxHeight=n.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(){this.dataLoader.load(this.options.data),this.columnManager.verticalAlignHeaders()}destroy(){var t=this.element;for(this.destroyed=!0,Nt.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",this.browserSlow=!1):t.indexOf("Mac OS")>-1?(this.browser="safari",this.browserSlow=!1):(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 n,i;return this.options.debugInitialization&&!this.initialized&&(t||(t=" "==(i="Error"==(n=(new Error).stack.split("\n"))[0]?n[2]:n[1])[0]?i.trim().split(" ")[1].split(".")[1]:i.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,n){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(t,e,n,!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,n){return this.initGuard(),this.dataLoader.load(t,e,n,!0,!0)}updateData(t){var e=0;return this.initGuard(),new Promise(((n,i)=>{this.dataLoader.blockActiveLoad(),"string"==typeof t&&(t=JSON.parse(t)),t&&t.length>0?t.forEach((t=>{var r=this.rowManager.findRow(t[this.options.index]);r?(e++,r.updateData(t).then((()=>{--e||n()})).catch((e=>{i("Update Error - Unable to update row",t,e)}))):i("Update Error - Unable to find row",t)})):(console.warn("Update Error - No data provided"),i("Update Error - No data provided"))}))}addData(t,e,n){return this.initGuard(),new Promise(((i,r)=>{this.dataLoader.blockActiveLoad(),"string"==typeof t&&(t=JSON.parse(t)),t?this.rowManager.addRows(t,e,n).then((t=>{var e=[];t.forEach((function(t){e.push(t.getComponent())})),i(e)})):(console.warn("Update Error - No data provided"),r("Update Error - No data provided"))}))}updateOrAddData(t){var e=[],n=0;return this.initGuard(),new Promise(((i,r)=>{this.dataLoader.blockActiveLoad(),"string"==typeof t&&(t=JSON.parse(t)),t&&t.length>0?t.forEach((t=>{var r=this.rowManager.findRow(t[this.options.index]);n++,r?r.updateData(t).then((()=>{n--,e.push(r.getComponent()),n||i(e)})):this.rowManager.addRows(t).then((t=>{n--,e.push(t[0].getComponent()),n||i(e)}))})):(console.warn("Update Error - No data provided"),r("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=[];this.initGuard(),Array.isArray(t)||(t=[t]);for(let n of t){let t=this.rowManager.findRow(n,!0);if(!t)return console.error("Delete Error - No matching row found:",n),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,n){return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),this.rowManager.addRows(t,e,n,!0).then((t=>t[0].getComponent()))}updateOrAddRow(t,e){var n=this.rowManager.findRow(t);return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),n?n.updateData(e).then((()=>n.getComponent())):this.rowManager.addRows(e).then((t=>t[0].getComponent()))}updateRow(t,e){var n=this.rowManager.findRow(t);return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),n?n.updateData(e).then((()=>Promise.resolve(n.getComponent()))):(console.warn("Update Error - No matching row found:",t),Promise.reject("Update Error - No matching row found"))}scrollToRow(t,e,n){var i=this.rowManager.findRow(t);return i?this.rowManager.scrollToRow(i,e,n):(console.warn("Scroll Error - No matching row found:",t),Promise.reject("Scroll Error - No matching row found"))}moveRow(t,e,n){var i=this.rowManager.findRow(t);this.initGuard(),i?i.moveToRow(e,n):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,n){var i=this.columnManager.findColumn(n);return this.initGuard(),this.columnManager.addColumn(t,e,i).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 n=this.columnManager.findColumn(t);return this.initGuard(),n?n.updateDefinition(e):(console.warn("Column Update Error - No matching column found:",t),Promise.reject())}moveColumn(t,e,n){var i=this.columnManager.findColumn(t),r=this.columnManager.findColumn(e);this.initGuard(),i?r?this.columnManager.moveColumn(i,r,n):console.warn("Move Error - No matching column found:",r):console.warn("Move Error - No matching column found:",t)}scrollToColumn(t,e,n){return new Promise(((i,r)=>{var o=this.columnManager.findColumn(t);return o?this.columnManager.scrollToColumn(o,e,n):(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(){Array.from(arguments).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}}Yt.defaultOptions={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},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:{}},new Ut(Yt);class Kt extends Yt{}new Ut(Kt,Ct);class Xt{constructor(t){this.type=t,this.element=this._createElement()}_createElement(){var t=document.createElement("div");return t.classList.add("tabulator-row"),t}getElement(){return this.element}getComponent(){return!1}getData(){return{}}getHeight(){return this.element.outerHeight}initialize(){}reinitialize(){}normalizeHeight(){}generateCells(){}reinitializeHeight(){}calcHeight(){}setCellHeight(){}clearCellHeight(){}rendered(){}}},8398:function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.dataUrl=e.brs=e.nations=e.Content=e.Sidebar=e.Navbar=e.GlobalEnv=void 0;var i=n(6185),r=n(5794),o=function(){function t(){}return t.init=function(){i.Container.bind(e.Navbar).toConstantValue(a),i.Container.bind(e.Sidebar).toConstantValue(s),i.Container.bind(e.Content).toConstantValue(l)},t}();e.GlobalEnv=o,e.Navbar=Symbol("Navbar");var a=r.select("#navbar");e.Sidebar=Symbol("Sidebar");var s=r.select("#sidebar");e.Content=Symbol("Content");var l=r.select("#content");e.nations=["USA","Germany","USSR","Britain","Japan","France","Italy","China","Sweden","Israel"],e.brs={1:["1.0 ~ 2.0","1.3 ~ 2.3","1.7 ~ 2.7","2.0 ~ 3.0","2.3 ~ 3.3","2.7 ~ 3.7","3.0 ~ 4.0","3.3 ~ 4.3","3.7 ~ 4.7","4.0 ~ 5.0","4.3 ~ 5.3","4.7 ~ 5.7","5.0 ~ 6.0","5.3 ~ 6.3","5.7 ~ 6.7","6.0 ~ 7.0","6.3 ~ 7.3","6.7 ~ 7.7","7.0 ~ 8.0","7.3 ~ 8.3","7.7 ~ 8.7","8.0 ~ 9.0","8.3 ~ 9.3","8.7 ~ 9.7","9.0 ~ 10.0","9.3 ~ 10.3","9.7 ~ 10.7","10.0 ~ 11.0","10.3 ~ 11.3","10.7 ~ 11.7","11.0 ~ 12.0","11.3 ~ 12.3","11.7 ~ 12.7","12.0 ~ 13.0","12.3 ~ 13.3","12.7 ~ 13.7","13.0 ~ 14.0"],0:["1.0","1.3","1.7","2.0","2.3","2.7","3.0","3.3","3.7","4.0","4.3","4.7","5.0","5.3","5.7","6.0","6.3","6.7","7.0","7.3","7.7","8.0","8.3","8.7","9.0","9.3","9.7","10.0","10.3","10.7","11.0","11.3","11.7","12.0","12.3","12.7","13.0"]},e.dataUrl="https://controlnet.space/wt-data-project.data"},1007:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.Logo=void 0;var a=n(6839),s=n(6185),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="nav-logo",e.name=null,e.image="/img/logo64.png",e}var n;return r(e,t),n=e,e.prototype.init=function(){this.navbar.append("li").append("img").attr("id",this.id).attr("src",this.image).classed("image-tab",!0)},o([(0,s.Singleton)(n)],e)}(a.NavTab);e.Logo=l},2690:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.DataRepo=void 0;var a=n(6501),s=n(6185),l=n(2836),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="data-repo",e.url="https://github.com/ControlNet/wt-data-project.data",e}var n;return r(e,t),n=e,o([(0,s.Inject)(l.Localization.Navbar.DataRepo)],e.prototype,"name",void 0),o([(0,s.Singleton)(n)],e)}(a.Link);e.DataRepo=u},236:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.Forum=void 0;var a=n(6185),s=n(6501),l=n(2836),u=n(5794),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="forum",e.url="https://github.com/ControlNet/wt-data-project.web/discussions",e}var n;return r(e,t),n=e,e.prototype.init=function(){t.prototype.init.call(this),u.select("#".concat(this.id)).html("".concat(this.name,'NEW'))},o([(0,a.Inject)(l.Localization.Navbar.Forum)],e.prototype,"name",void 0),o([(0,a.Singleton)(n)],e)}(s.Link);e.Forum=c},9800:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.GithubIssue=void 0;var a=n(6185),s=n(6501),l=n(2836),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="issues",e.url="https://github.com/ControlNet/wt-data-project.web/issues",e}var n;return r(e,t),n=e,o([(0,a.Inject)(l.Localization.Navbar.Issues)],e.prototype,"name",void 0),o([(0,a.Singleton)(n)],e)}(s.Link);e.GithubIssue=u},4707:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.GithubLink=void 0;var a=n(6501),s=n(6185),l=n(2836),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="github",e.url="https://github.com/ControlNet",e}var n;return r(e,t),n=e,o([(0,s.Inject)(l.Localization.Navbar.Github)],e.prototype,"name",void 0),o([(0,s.Singleton)(n)],e)}(a.Link);e.GithubLink=u},6501:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.Link=void 0;var a=n(6839),s=n(6185),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.init=function(){this.navbar.append("li").append("a").attr("id",this.id).attr("href",this.url).attr("rel","noopener").attr("target","_blank").classed("link-tab",!0).html(this.name)},o([s.Injectable],e)}(a.NavTab);e.Link=l},6684:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.WebRepo=void 0;var a=n(6501),s=n(6185),l=n(2836),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="GitHub",e.id="web-repo",e.url="https://github.com/ControlNet/wt-data-project.web",e}var n;return r(e,t),n=e,o([(0,s.Inject)(l.Localization.Navbar.WebRepo)],e.prototype,"name",void 0),o([(0,s.Singleton)(n)],e)}(a.Link);e.WebRepo=u},6839:function(t,e,n){"use strict";var i=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.NavTab=void 0;var r=n(6185),o=n(8743),a=function(){function t(){}return i([(0,r.Inject)(o.Navbar)],t.prototype,"navbar",void 0),i([r.Injectable],t)}();e.NavTab=a},957:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.Page=void 0;var a=n(5794),s=n(6839),l=n(6185),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.init=function(){var t=this;this.navbar.append("li").append("a").attr("id",this.id).attr("href","#".concat(this.id)).classed("page-tab",!0).html(this.name).on("click",(function(){return t.update.call(t)}))},e.prototype.removeOld=function(){a.select("#sidebar").html(""),a.select("#content").html("")},o([l.Injectable],e)}(s.NavTab);e.Page=u},1745:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.StackedAreaPage=void 0;var a=n(5707),s=n(6185),l=n(8743),u=n(8315),c=n(1043),h=n(2836),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="stacked-area",e}var n;return r(e,t),n=e,e.prototype.update=function(){var t=this;this.removeOld(),s.Container.get(u.ClassSelect).init(),s.Container.get(u.ModeSelect).init(),s.Container.get(u.ScaleSelect).init(),s.Container.rebind(c.StackedLineChart).toSelf(),this.plot=s.Container.get(c.StackedLineChart),s.Container.rebind(c.StackedLineChart).toConstantValue(this.plot),this.plot.init(),s.utils.setEvent.byClass("plot-selection").onchange((function(){return t.plot.update()}))},Object.defineProperty(e.prototype,"clazz",{get:function(){return s.utils.getSelectedValue("class-selection")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mode",{get:function(){return s.utils.getSelectedValue("mode-selection")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return s.utils.getSelectedValue("scale-selection")},enumerable:!1,configurable:!0}),o([(0,s.Inject)(h.Localization.Navbar.StackedArea)],e.prototype,"name",void 0),o([(0,s.Inject)(l.Sidebar)],e.prototype,"sidebar",void 0),o([(0,s.Singleton)(n)],e)}(a.Page);e.StackedAreaPage=d},9934:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.TodoPage=void 0;var a=n(5707),s=n(5794),l=n(133),u=n(6185),c=n(2836),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.id="todo-list",e.name="Todo List",e}var n;return r(e,t),n=e,e.prototype.update=function(){this.removeOld(),s.text("https://wt.controlnet.space/README.md",(function(t){s.select("#content").html(l(t)).html(s.select("div#todo-list-section").html())}))},o([(0,u.Inject)(c.Localization.Navbar.TodoList)],e.prototype,"name",void 0),o([(0,u.Singleton)(n)],e)}(a.Page);e.TodoPage=h},7230:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.ColorblindCheckbox=e.CheckboxBuilder=e.Checkbox=void 0;var a=n(6185),s=n(4970),l=n(8743),u=n(2836),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return r(e,t),n=e,e.prototype.with=function(t,e,n,i){return this.labelText=t,this.id=e,this.classes=n,this.checked=i,this},e.prototype.init=function(){return this.initLabel().initSelect().addData()},e.prototype.initLabel=function(){return this.checkbox=this.sidebar.append("label").text(this.labelText),this},e.prototype.initSelect=function(){this.checkbox=this.checkbox.append("input").attr("id",this.id).attr("name",this.id).attr("type","checkbox");for(var t=0,e=this.classes;t=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.ScaleSelect=e.BrRangeSelect=e.MeasurementSelect=e.ModeSelect=e.ClassSelect=e.DateSelect=e.SelectBuilder=e.Select=void 0;var a=n(4970),s=n(6185),l=n(8743),u=n(8398),c=n(2836),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}var n;return r(e,t),n=e,e.prototype.with=function(t,e,n,i,r){return this.labelText=t,this.id=e,this.classes=n,this.data=i,this.defaultSelectId=r,this},e.prototype.init=function(){return this.initLabel().initSelect().addData()},e.prototype.initLabel=function(){return this.selection=this.sidebar.append("label").text(this.labelText),this},e.prototype.initSelect=function(){this.selection=this.selection.append("select").attr("id",this.id);for(var t=0,e=this.classes;t=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.SideBarElement=void 0;var r=n(6185),o=function(){function t(){}return i([r.Injectable],t)}();e.SideBarElement=o},3790:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Getter=void 0;e.Getter=function(){}},8133:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.JoinedRowGetter=void 0;var o=function(t){function e(e,n){var i=t.call(this)||this;return i.data=e,i.mode=n,i}return r(e,t),Object.defineProperty(e.prototype,"br",{get:function(){switch(this.mode){case"ab":return+this.data.ab_br;case"rb":return+this.data.rb_br;case"sb":return+this.data.sb_br}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"battles",{get:function(){switch(this.mode){case"ab":return+this.data.ab_battles;case"rb":return+this.data.rb_battles;case"sb":return+this.data.sb_battles}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"winRate",{get:function(){switch(this.mode){case"ab":return+this.data.ab_win_rate;case"rb":return+this.data.rb_win_rate;case"sb":return+this.data.sb_win_rate}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"airFragsPerBattle",{get:function(){switch(this.mode){case"ab":return+this.data.ab_air_frags_per_battle;case"rb":return+this.data.rb_air_frags_per_battle;case"sb":return+this.data.sb_air_frags_per_battle}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"airFragsPerDeath",{get:function(){switch(this.mode){case"ab":return+this.data.ab_air_frags_per_death;case"rb":return+this.data.rb_air_frags_per_death;case"sb":return+this.data.sb_air_frags_per_death}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundFragsPerBattle",{get:function(){switch(this.mode){case"ab":return+this.data.ab_ground_frags_per_battle;case"rb":return+this.data.rb_ground_frags_per_battle;case"sb":return+this.data.sb_ground_frags_per_battle}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groundFragsPerDeath",{get:function(){switch(this.mode){case"ab":return+this.data.ab_ground_frags_per_death;case"rb":return+this.data.rb_ground_frags_per_death;case"sb":return+this.data.sb_ground_frags_per_death}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rpRate",{get:function(){switch(this.mode){case"ab":return+this.data.ab_rp_rate;case"rb":return+this.data.rb_rp_rate;case"sb":return+this.data.sb_rp_rate}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slRate",{get:function(){switch(this.mode){case"ab":return+this.data.ab_sl_rate;case"rb":return+this.data.rb_sl_rate;case"sb":return+this.data.sb_sl_rate}},enumerable:!1,configurable:!0}),e}(n(3790).Getter);e.JoinedRowGetter=o},3282:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.TimeseriesRowGetter=void 0;var o=function(t){function e(e,n,i){var r=t.call(this)||this;return r.data=e,r.mode=n,r.measurement=i,r}return r(e,t),Object.defineProperty(e.prototype,"value",{get:function(){switch(this.mode){case"ab":var t=this.data;switch(this.measurement){case"win_rate":return+t.ab_win_rate;case"battles_sum":return+t.ab_battles_sum;case"air_frags_per_battle":return+t.ab_air_frags_per_battle;case"air_frags_per_death":return+t.ab_air_frags_per_death;case"ground_frags_per_battle":return+t.ab_ground_frags_per_battle;case"ground_frags_per_death":return+t.ab_ground_frags_per_death}break;case"rb":var e=this.data;switch(this.measurement){case"win_rate":return+e.rb_win_rate;case"battles_sum":return+e.rb_battles_sum;case"air_frags_per_battle":return+e.rb_air_frags_per_battle;case"air_frags_per_death":return+e.rb_air_frags_per_death;case"ground_frags_per_battle":return+e.rb_ground_frags_per_battle;case"ground_frags_per_death":return+e.rb_ground_frags_per_death}break;case"sb":var n=this.data;switch(this.measurement){case"win_rate":return+n.sb_win_rate;case"battles_sum":return+n.sb_battles_sum;case"air_frags_per_battle":return+n.sb_air_frags_per_battle;case"air_frags_per_death":return+n.sb_air_frags_per_death;case"ground_frags_per_battle":return+n.sb_ground_frags_per_battle;case"ground_frags_per_death":return+n.sb_ground_frags_per_death}}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"br",{get:function(){switch(this.mode){case"ab":return this.data.ab_br;case"rb":return this.data.rb_br;case"sb":return this.data.sb_br}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lowerBr",{get:function(){switch(this.mode){case"ab":return+this.data.ab_lower_br;case"rb":return+this.data.rb_lower_br;case"sb":return+this.data.sb_lower_br}},enumerable:!1,configurable:!0}),e}(n(3790).Getter);e.TimeseriesRowGetter=o},3555:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrHeatColorMap=e.ColorMap=void 0;var i=n(6185),r=n(5794),o=function(t,e,n){this.name=t,this.colors=e,this.percentiles=n};e.ColorMap=o;var a=function(){};e.BrHeatColorMap=a,i.Container.bind(a).toDynamicValue((function(){var t;return t=r.select("#colorblind-checkbox").property("checked")?i.CONT_COLORS_BLIND:i.CONT_COLORS,{winRate:{Ground_vehicles:new o("ground-vehicles-win-rate",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.05,.43,.53,.63,.95,1]),Aviation:new o("aviation-win-rate",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.01,.5,.6,.7,.99,1])},battlesSum:{Ground_vehicles:new o("ground-vehicles-battles-sum",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.01,.4,.5,.6,.99,1]),Aviation:new o("aviation-battles-sum",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.01,.4,.5,.6,.99,1])},airFragsPerBattle:{Ground_vehicles:new o("ground-vehicles-air-frags-per-battle",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.001,.01,.025,.05,.999,1]),Aviation:new o("aviation-air-frags-per-battle",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.001,.07,.13,.25,.999,1])},airFragsPerDeath:{Ground_vehicles:new o("ground-vehicles-air-frags-per-death",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.001,.01,.025,.05,.999,1]),Aviation:new o("aviation-air-frags-per-death",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.001,.07,.13,.25,.999,1])},groundFragsPerBattle:{Ground_vehicles:new o("ground-vehicles-ground-frags-per-battle",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.001,.1,.2,.3,.999,1]),Aviation:new o("aviation-ground-frags-per-battle",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.001,.01,.05,.3,.999,1])},groundFragsPerDeath:{Ground_vehicles:new o("ground-vehicles-ground-frags-per-death",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.001,.1,.2,.3,.999,1]),Aviation:new o("aviation-ground-frags-per-death",[t.BLACK,t.BLACK,t.RED,t.YELLOW,t.GREEN,t.BLACK,t.BLACK],[0,.001,.01,.05,.3,.999,1])}}}))},2541:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0?this.tooltip.appear():this.tooltip.hide()},e.prototype.onPointerMove=function(t,e){return a(this,void 0,void 0,(function(){var t,n,i=this;return s(this,(function(r){switch(r.label){case 0:return t=new p.MousePosition(l.mouse(e)[0],l.mouse(e)[1]),void 0===this.xAxis?[2]:(n=this.xAxis.invert(t.x-this.margin.left),this.selectedDate=p.utils.findClosest(this.allDates,n.getTime()),[4,this.tooltip.update(this.selected.map((function(t){var e;return"".concat(p.Container.get(f.Localization.Nation)(t.nation)," ")+"".concat(t.br,": ").concat(u.round(null===(e=t.values.find((function(t){return t.date.getTime()===i.selectedDate})))||void 0===e?void 0:e.value,3))})),t)]);case 1:return r.sent(),[2]}}))}))},e.prototype.init=function(){return t.prototype.init.call(this),this.tooltip.init(),this.svg.on("pointerover",p.utils.eventWrapper(this,this.onPointerOver)),this.svg.on("pointermove",p.utils.eventWrapper(this,this.onPointerMove)),this.svg.on("pointerleave",p.utils.eventWrapper(this,this.onPointerLeave)),this},e.prototype.update=function(){return a(this,void 0,void 0,(function(){var t,e,n,i,r,o,a,c,h,d,g,m=this;return s(this,(function(s){return t=this.g.selectAll(".x-axis"),e=this.g.selectAll(".y-axis"),n=this.brHeatmap.cache,i=this.groupBy(p.WasmUtils.extractData(n,this.brHeatmap.selected,this.page.clazz,this.page.mode,this.page.measurement)),this.selected=i,r=l.scaleUtc().domain(l.extent(n,(function(t){return p.utils.parseDate(t.date)}))).range([0,this.width]),this.xAxis=r,this.g.append("g").classed("x-axis",!0).attr("transform","translate(0, ".concat(this.height,")")).style("font-size",9).call(l.axisBottom(r).tickFormat(l.timeFormat("%y/%m"))),this.g.append("text").classed("x-axis",!0).text(p.Container.get(f.Localization.BrHeatmapPage.BrLineChart.date)).attr("transform","translate(".concat(this.width/2,", ").concat(this.height+30,")")).style("font-size",12).style("text-anchor","middle"),t.remove(),o=u.flatMap(i,(function(t){return t.values})).map((function(t){return+t.value})),a="win_rate"===this.page.measurement?Math.min(1.02*u.max(o),100):1.02*u.max(o),c="win_rate"===this.page.measurement?Math.max(.98*u.min(o),0):.98*u.min(o),h=l.scaleLinear().domain([c,a]).range([this.height,0]),this.g.append("g").classed("y-axis",!0).call(l.axisLeft(h)),this.g.append("text").classed("y-axis",!0).text(p.Container.get(f.Localization.Measurement)(this.page.measurement)).attr("transform","translate(".concat(-30,", ").concat(this.height/2,") rotate(270)")).style("font-size",12).style("text-anchor","middle"),e.remove(),d=l.line().x((function(t){return r(t.date)})).y((function(t){return h(t.value)})),(g=this.g.selectAll("#line-chart-path-g").size()>0?this.g.select("#line-chart-path-g").selectAll("path").data(i,(function(t){return t.nation+t.br})):this.g.append("g").attr("id","line-chart-path-g").style("fill","None").selectAll("path").data(i,(function(t){return t.nation+t.br}))).exit().transition().duration(500).style("opacity",0).remove(),g.transition().duration(500).attr("d",(function(t){return d(t.values)})).attr("stroke",(function(t){return m.brHeatmap.colorPool.get(t)})),g.enter().append("path").style("opacity",0).style("stroke-width",3).transition().duration(500).style("opacity",1).attr("d",(function(t){return d(t.values)})).attr("stroke",(function(t){return m.brHeatmap.colorPool.get(t)})),[2,this]}))}))},Object.defineProperty(e.prototype,"brHeatmap",{get:function(){return p.Container.get(h.BrHeatmap)},enumerable:!1,configurable:!0}),e.prototype.reset=function(){return this.g.html(null),this},e.prototype.groupBy=function(t){for(var e=[],n=function(t){if(e.filter((function(e){return e.br===t.br&&e.nation===t.nation})).length>0)for(var n=0,i=e;n0})),t}))},o([(0,p.Inject)(f.Config.BrHeatmapPage.BrLineChart.svgHeight)],e.prototype,"svgHeight",void 0),o([(0,p.Inject)(f.Config.BrHeatmapPage.BrLineChart.svgWidth)],e.prototype,"svgWidth",void 0),o([(0,p.Inject)(f.Config.BrHeatmapPage.BrLineChart.margin)],e.prototype,"margin",void 0),o([(0,p.Inject)(m.BRHeatMapPage)],e.prototype,"page",void 0),o([(0,p.Inject)(y.LineChartTooltip)],e.prototype,"tooltip",void 0),o([(0,p.Provider)(n)],e)}(_);e.BrLineChart=C;var x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.measurement="battles_sum",e.dataCache=[],e}var n;return r(e,t),n=e,e.prototype.init=function(){var e=this;return t.prototype.init.call(this),l.csv(this.dataPath,(function(t){return a(e,void 0,void 0,(function(){var e,n,i,r;return s(this,(function(o){return e=this.groupBy(this.extractData(t)),n=l.stack().keys(g.nations)(e),this.dataCache.push({clazz:this.page.clazz,data:n,mode:this.page.mode,scale:this.page.scale}),this.x=l.scaleUtc().domain(l.extent(t,(function(t){return p.utils.parseDate(t.date)}))).range([0,this.width]),this.g.append("g").classed("x-axis",!0).attr("transform","translate(0, ".concat(this.height,")")).call(l.axisBottom(this.x).tickFormat(l.timeFormat("%Y/%m"))),this.g.append("text").classed("x-axis",!0).text(p.Container.get(f.Localization.StackedAreaPage.StackedLineChart.date)).attr("transform","translate(".concat(this.width/2,", ").concat(this.height+30,")")).style("font-size",12).style("text-anchor","middle"),i=this.setYAxis(n),this.legend.init(),r=this.getArea(this.x,i),this.g.append("g").classed("stacked-area",!0).selectAll().data(n).enter().append("path").attr("fill",(function(t){var e=t.key;return p.nationColors.get(e)})).attr("d",r).style("stroke","black"),this.updateSubPlots().then(),[2]}))}))})),this},e.prototype.update=function(){return a(this,void 0,void 0,(function(){var t,e,n,i;return s(this,(function(r){switch(r.label){case 0:return t=this.g.selectAll(".y-axis"),[4,this.searchInCache()];case 1:return e=r.sent(),n=this.setYAxis(e),t.remove(),[4,this.updateSubPlots()];case 2:return r.sent(),i=this.getArea(this.x,n),this.g.select("g.stacked-area").selectAll("path").data(e).transition().duration(500).attr("d",i),[2,this]}}))}))},e.prototype.getArea=function(t,e){return l.area().x((function(e){return t(e.data.date)})).y0((function(t){return e(t[0])})).y1((function(t){return e(t[1])}))},e.prototype.setYAxis=function(t){var e="value"===this.page.scale?l.max(t[g.nations.length-1],(function(t){return t[1]})):1,n=l.scaleLinear().domain([0,e]).range([this.height,0]);return this.g.append("g").classed("y-axis",!0).call(l.axisLeft(n)),this.g.append("text").classed("y-axis",!0).text(p.Container.get(f.Localization.StackedAreaPage.StackedLineChart.battles)).attr("transform","translate(".concat(-60,", ").concat(this.height/2,") rotate(270)")).style("font-size",12).style("text-anchor","middle"),n},e.prototype.searchInCache=function(){return a(this,void 0,void 0,(function(){var t,e,n,i=this;return s(this,(function(r){for(t=0,e=this.dataCache;t=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.Plot=void 0;var r=n(6185),o=n(8743),a=function(){function t(){}return Object.defineProperty(t.prototype,"width",{get:function(){return this.svgWidth-this.margin.left-this.margin.right},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.svgHeight-this.margin.top-this.margin.bottom},enumerable:!1,configurable:!0}),i([(0,r.Inject)(o.Content)],t.prototype,"content",void 0),i([r.Injectable],t)}();e.Plot=a},2222:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=r&&n.nation===a&&n.cls===t}))})).flat(),r=this.selectColumns(d.uniqBy(i,(function(t){return t.name}))),this.tabulator=new m.TabulatorFull("#selected-table",{data:r,layout:"fitColumns",columns:[{title:"ts_name",field:"ts_name"},{title:"wk_name",field:"wk_name"},{title:"nation",field:"nation",maxWidth:80,formatter:function(t){var e=t.getValue(),n=t.getElement(),i=p.nationColors.get(e);return n.style.backgroundColor=i,n.style.color=p.utils.genTextColorFromBgColor(i),e}},{title:"class",field:"class",maxWidth:120},{title:"br",field:"br",maxWidth:50},{title:"battles",field:"battles",maxWidth:85},{title:"win_rate",field:"win_rate",maxWidth:95,formatter:function(t){var e=t.getValue(),n=t.getElement(),i=p.utils.rgbToHex(o.winRateValue2color(e));return n.style.backgroundColor=i,n.style.color=p.utils.genTextColorFromBgColor(i),e}},{title:"air_frags_per_battle",field:"air_frags_per_battle"},{title:"air_frags_per_death",field:"air_frags_per_death"},{title:"ground_frags_per_battle",field:"ground_frags_per_battle"},{title:"ground_frags_per_death",field:"ground_frags_per_death"},{title:"premium",field:"is_premium",maxWidth:99,formatter:function(t){var e=t.getValue();return"True"===e&&(t.getElement().style.backgroundColor=p.COLORS.YELLOW),e}},{title:"rp_rate",field:"rp_rate",maxWidth:84},{title:"sl_rate",field:"sl_rate",maxWidth:80}]}),this.downloadButton.style("visibility","visible"),[2,this]}}))}))},e.prototype.reset=function(){return this.table.html(null),this},e.prototype.selectColumns=function(t){var e=this.page.mode;return t.map((function(t){var n=new h.JoinedRowGetter(t,e);return{ts_name:t.name,wk_name:t.wk_name,nation:t.nation,class:t.cls,br:n.br,battles:n.battles,win_rate:n.winRate,air_frags_per_battle:n.airFragsPerBattle,air_frags_per_death:n.airFragsPerDeath,ground_frags_per_battle:n.groundFragsPerBattle,ground_frags_per_death:n.groundFragsPerDeath,is_premium:t.is_premium,rp_rate:n.rpRate,sl_rate:n.slRate}}))},Object.defineProperty(e.prototype,"brHeatmap",{get:function(){return p.Container.get(u.BrHeatmap)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataPath",{get:function(){return"".concat(f.dataUrl,"/joined/").concat(this.page.date,".csv")},enumerable:!1,configurable:!0}),o([(0,p.Inject)(f.Content)],e.prototype,"content",void 0),o([(0,p.Inject)(g.BRHeatMapPage)],e.prototype,"page",void 0),o([(0,p.Provider)(n)],e)}(l.Plot);e.Table=b},9305:function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__decorate||function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=t[n-1])return t[n-1];function i(t,n){return e-t>=n-e?n:t}for(var r=0,o=n,a=0;r0&&e>t[a-1])return i(t[a-1],t[a]);o=a}else{if(a125?"black":"white";var e}}(o=e.utils||(e.utils={})),function(t){t.GREEN="#C3E88D",t.YELLOW="#FFCB6B",t.RED="#F07178",t.BLUE="#82AAFF",t.PURPLE="#C792EA",t.ORANGE="#F78C6C",t.AZURE="#467CDA",t.SKY="#89DDFF",t.BLACK="#2B2B2B",t.GRAY="#616161",t.WHITE="#EEFFFF",t.BLANK="#FFFFFF"}(a=e.COLORS||(e.COLORS={})),e.categoricalColors=[a.GREEN,a.YELLOW,a.RED,a.BLUE,a.PURPLE,a.ORANGE,a.AZURE,a.SKY,a.GRAY],e.nationColors=new Map(Object.entries({Britain:a.BLUE,China:a.ORANGE,France:a.AZURE,Germany:a.GRAY,Italy:a.GREEN,Israel:a.BLACK,Japan:a.PURPLE,Sweden:a.YELLOW,USA:a.SKY,USSR:a.RED})),(l=e.CONT_COLORS||(e.CONT_COLORS={})).RED="#D11141",l.YELLOW="#FFC425",l.GREEN="#00b159",l.BLACK="#2B2B2B",l.WHITE="#FFFFFF",(s=e.CONT_COLORS_BLIND||(e.CONT_COLORS_BLIND={})).RED="#F05039",s.YELLOW="#E57A77",s.GREEN="#1F449C",s.BLACK="#2B2B2B",s.WHITE="#FFFFFF";e.MousePosition=function(t,e){this.x=t,this.y=e},e.Singleton=function(t){return(0,c.fluentProvide)(t).inSingletonScope().done()},e.Provider=c.provide,e.Inject=h.inject,e.Injectable=(0,h.injectable)();var f=function(){function t(){}return t.importProvider=function(){t.container.load((0,c.buildProviderModule)())},t.get=function(e){return t.container.get(e)},t.rebind=function(e){return t.container.rebind(e)},t.unbind=function(e){return t.container.unbind(e)},t.bind=function(e){return t.container.bind(e)},t.container=new h.Container,t}();e.Container=f;var g=function(){function t(){this.getObj=[]}return Object.defineProperty(t.prototype,"length",{get:function(){return this.getObj.length},enumerable:!1,configurable:!0}),t.prototype.addLayer=function(t){return this.getObj.push(t),this},t.chainMapLayer2=function(t){return Object.keys(t()).map((function(t){return[t]}))},t.chainMapLayer3=function(e,n){return t.chainMapLayer2(e).map((function(t){var e=t[0];return Object.keys(n(e)).map((function(t){return[e,t]}))})).flat(1)},t.chainMapLayer4=function(e,n,i){return t.chainMapLayer3(e,n).map((function(t){var e=t[0],n=t[1];return Object.keys(i(e,n)).map((function(t){return[e,n,t]}))})).flat(1)},t.prototype.getKVs=function(){var e=this;if(this.length<=1)throw Error("Number of layers should >= 2");return t.objChainMapFunc[this.length].apply(void 0,this.getObj).map((function(t){var n;return[t,(n=e.getObj)[e.length-1].apply(n,t)]}))},t.prototype.map=function(t){return this.getKVs().map((function(e){var n=e[0],i=e[1];return t(n,i)}))},t.prototype.forEach=function(t){this.getKVs().forEach((function(e){var n=e[0],i=e[1];return t(n,i)}))},t.objChainMapFunc={2:t.chainMapLayer2,3:t.chainMapLayer3,4:t.chainMapLayer4},t}();e.ObjChainMap=g;var m=function(){function t(){}return t.init=function(){return i(this,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return e=t,[4,Promise.resolve().then((function(){return n(5401)}))];case 1:return e.wasm=i.sent(),[2]}}))}))},t.clazz2int=function(t){return+("Aviation"===t)},t.nation2int=function(t){switch(t){case"USA":return 0;case"Germany":return 1;case"USSR":return 2;case"Britain":return 3;case"Japan":return 4;case"France":return 5;case"Italy":return 6;case"China":return 7;case"Sweden":return 8;case"Israel":return 9}},t.measurement2int=function(t){switch(t){case"win_rate":return 0;case"battles_sum":return 1}},t.extractData=function(e,n,i,r,a){var s=new Uint8Array(e.map((function(e){return t.clazz2int(e.cls)}))),l=new Uint8Array(e.map((function(e){return t.nation2int(e.nation)}))),u=new Float32Array(e.map((function(t){return new p.TimeseriesRowGetter(t,r,a).lowerBr}))),c=new Uint8Array(n.map((function(e){return t.nation2int(e.nation)}))),h=new Float32Array(n.map((function(t){return parseFloat(d.split(t.br," ~ ")[0])}))),f=t.wasm.extract_data(s,l,u,c,h,t.clazz2int(i));return Array.from(f).map((function(t){return e[t]})).map((function(t){var e=new p.TimeseriesRowGetter(t,r,a);return{date:o.parseDate(t.date),nation:t.nation,br:e.br,value:e.value}}))},t}();e.WasmUtils=m},5401:(t,e,n)=>{"use strict";n.a(t,(async(t,i)=>{try{n.r(e),n.d(e,{__wbg_buffer_12d079cc21e14bdb:()=>o.Fm,__wbg_error_f851667af71bcfc6:()=>o.Xu,__wbg_getindex_03d06b4e7ea3475e:()=>o.mI,__wbg_getindex_289b14432d9c89b9:()=>o.yI,__wbg_length_c20a40f15020d68a:()=>o.qY,__wbg_new_2afb9348997957e9:()=>o.G9,__wbg_new_abda76e883ba8a5f:()=>o.V5,__wbg_newwithbyteoffsetandlength_3125852e5a7fbcff:()=>o._H,__wbg_set_wasm:()=>o.lI,__wbg_stack_658279fe44541cf6:()=>o.u$,__wbindgen_memory:()=>o.Py,__wbindgen_object_drop_ref:()=>o.bk,__wbindgen_throw:()=>o.Qn,extract_data:()=>o.RP});var r=n(7005),o=n(9947),a=t([r]);r=(a.then?(await a)():a)[0],(0,o.lI)(r),i()}catch(t){i(t)}}))},9947:(t,e,n)=>{"use strict";let i;function r(t){i=t}n.d(e,{Fm:()=>T,G9:()=>A,Py:()=>L,Qn:()=>P,RP:()=>m,V5:()=>x,Xu:()=>M,_H:()=>D,bk:()=>C,lI:()=>r,mI:()=>R,qY:()=>k,u$:()=>E,yI:()=>S}),t=n.hmd(t);const o=new Array(128).fill(void 0);function a(t){return o[t]}o.push(void 0,null,!0,!1);let s=o.length;function l(t){const e=a(t);return function(t){t<132||(o[t]=s,s=t)}(t),e}let u=new("undefined"==typeof TextDecoder?(0,t.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});u.decode();let c=null;function h(){return null!==c&&0!==c.byteLength||(c=new Uint8Array(i.memory.buffer)),c}function d(t,e){return t>>>=0,u.decode(h().subarray(t,t+e))}function p(t){s===o.length&&o.push(o.length+1);const e=s;return s=o[e],o[e]=t,e}let f=128;function g(t){if(1==f)throw new Error("out of js stack");return o[--f]=t,f}function m(t,e,n,r,a,s){try{return l(i.extract_data(g(t),g(e),g(n),g(r),g(a),s))}finally{o[f++]=void 0,o[f++]=void 0,o[f++]=void 0,o[f++]=void 0,o[f++]=void 0}}let b=0,v=new("undefined"==typeof TextEncoder?(0,t.require)("util").TextEncoder:TextEncoder)("utf-8");const y="function"==typeof v.encodeInto?function(t,e){return v.encodeInto(t,e)}:function(t,e){const n=v.encode(t);return e.set(n),{read:t.length,written:n.length}};let w=null;function _(){return null!==w&&0!==w.byteLength||(w=new Int32Array(i.memory.buffer)),w}function C(t){l(t)}function x(){return p(new Error)}function E(t,e){const n=function(t,e,n){if(void 0===n){const n=v.encode(t),i=e(n.length,1)>>>0;return h().subarray(i,i+n.length).set(n),b=n.length,i}let i=t.length,r=e(i,1)>>>0;const o=h();let a=0;for(;a127)break;o[r+a]=e}if(a!==i){0!==a&&(t=t.slice(a)),r=n(r,i,i=a+3*t.length,1)>>>0;const e=h().subarray(r+a,r+i);a+=y(t,e).written,r=n(r,i,a,1)>>>0}return b=a,r}(a(e).stack,i.__wbindgen_malloc,i.__wbindgen_realloc),r=b;_()[t/4+1]=r,_()[t/4+0]=n}function M(t,e){let n,r;try{n=t,r=e,console.error(d(t,e))}finally{i.__wbindgen_free(n,r,1)}}function T(t){return p(a(t).buffer)}function k(t){return a(t).length}function D(t,e,n){return p(new Uint32Array(a(t),e>>>0,n>>>0))}function A(t){return p(new Uint32Array(a(t)))}function R(t,e){return a(t)[e>>>0]}function S(t,e){return a(t)[e>>>0]}function P(t,e){throw new Error(d(t,e))}function L(){return p(i.memory)}},7005:(t,e,n)=>{"use strict";var i=n(9947);t.exports=n.v(e,t.id,"cad71def2d3d24741483",{"./wasm_utils_bg.js":{__wbindgen_object_drop_ref:i.bk,__wbg_new_abda76e883ba8a5f:i.V5,__wbg_stack_658279fe44541cf6:i.u$,__wbg_error_f851667af71bcfc6:i.Xu,__wbg_buffer_12d079cc21e14bdb:i.Fm,__wbg_length_c20a40f15020d68a:i.qY,__wbg_newwithbyteoffsetandlength_3125852e5a7fbcff:i._H,__wbg_new_2afb9348997957e9:i.G9,__wbg_getindex_03d06b4e7ea3475e:i.mI,__wbg_getindex_289b14432d9c89b9:i.yI,__wbindgen_throw:i.Qn,__wbindgen_memory:i.Py}})}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={id:t,loaded:!1,exports:{}};return r[t].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}t="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",e="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",n="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",i=t=>{t&&t.d<1&&(t.d=1,t.forEach((t=>t.r--)),t.forEach((t=>t.r--?t.r++:t())))},a.a=(r,o,a)=>{var s;a&&((s=[]).d=-1);var l,u,c,h=new Set,d=r.exports,p=new Promise(((t,e)=>{c=e,u=t}));p[e]=d,p[t]=t=>(s&&t(s),h.forEach(t),p.catch((t=>{}))),r.exports=p,o((r=>{var o;l=(r=>r.map((r=>{if(null!==r&&"object"==typeof r){if(r[t])return r;if(r.then){var o=[];o.d=0,r.then((t=>{a[e]=t,i(o)}),(t=>{a[n]=t,i(o)}));var a={};return a[t]=t=>t(o),a}}var s={};return s[t]=t=>{},s[e]=r,s})))(r);var a=()=>l.map((t=>{if(t[n])throw t[n];return t[e]})),u=new Promise((e=>{(o=()=>e(a)).r=0;var n=t=>t!==s&&!h.has(t)&&(h.add(t),t&&!t.d&&(o.r++,t.push(o)));l.map((e=>e[t](n)))}));return o.r?u:a()}),(t=>(t?c(p[n]=t):u(d),i(s)))),s&&s.d<0&&(s.d=0)},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),a.v=(t,e,n,i)=>{var r=fetch(a.p+""+n+".module.wasm"),o=()=>r.then((t=>t.arrayBuffer())).then((t=>WebAssembly.instantiate(t,i))).then((e=>Object.assign(t,e.instance.exports)));return r.then((e=>"function"==typeof WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,i).then((e=>Object.assign(t,e.instance.exports)),(t=>{if("application/wasm"!==e.headers.get("Content-Type"))return console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t),o();throw t})):o()))},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!t||!/^http(s?):/.test(t));)t=n[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.nc=void 0,(()=>{"use strict";var t=a(8398),e=a(957),n=a(1745),i=a(9934),r=a(6684),o=a(2690),s=a(4707),l=a(1007),u=a(9800),c=a(236);t.Application.build.withLogo(l.Logo).withPages(e.BRHeatMapPage,n.StackedAreaPage,i.TodoPage).withLinks(r.WebRepo,o.DataRepo,u.GithubIssue,c.Forum,s.GithubLink).class.run()})()})(); \ No newline at end of file diff --git a/dist/bundle.js.LICENSE.txt b/dist/bundle.js.LICENSE.txt new file mode 100644 index 0000000..f587991 --- /dev/null +++ b/dist/bundle.js.LICENSE.txt @@ -0,0 +1,23 @@ +/*! ***************************************************************************** +Copyright (C) Microsoft. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ diff --git a/dist/cad71def2d3d24741483.module.wasm b/dist/cad71def2d3d24741483.module.wasm new file mode 100644 index 0000000..5b0dcb6 Binary files /dev/null and b/dist/cad71def2d3d24741483.module.wasm differ diff --git a/img/brheatmap-click.gif b/img/brheatmap-click.gif deleted file mode 100644 index d0921cf..0000000 Binary files a/img/brheatmap-click.gif and /dev/null differ diff --git a/img/brheatmap-raws.gif b/img/brheatmap-raws.gif deleted file mode 100644 index c588809..0000000 Binary files a/img/brheatmap-raws.gif and /dev/null differ diff --git a/img/brheatmap-tooltip.gif b/img/brheatmap-tooltip.gif deleted file mode 100644 index 7b9e204..0000000 Binary files a/img/brheatmap-tooltip.gif and /dev/null differ diff --git a/img/logo400.png b/img/logo400.png deleted file mode 100644 index aa6f319..0000000 Binary files a/img/logo400.png and /dev/null differ diff --git a/src/app/application.ts b/src/app/application.ts deleted file mode 100644 index 533e4d1..0000000 --- a/src/app/application.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { Page, PageClass } from "./page/page"; -import { Metadata } from "../data/metadata"; -import * as d3 from "d3"; -import { Link, LinkClass } from "./link/link"; -import { Config, Localization } from "./config"; -import { Container, WasmUtils } from "../utils"; -import "reflect-metadata"; -import "../plot/br-heatmap"; -import "../plot/color-bar"; -import "../plot/line-chart"; -import "../plot/legend"; -import "../plot/table"; -import "../plot/tooltip"; -import { dataUrl, GlobalEnv } from "./global-env"; -import "./sidebar/sidebar-element"; -import "./sidebar/select"; -import { Logo, LogoClass } from "./image/logo"; - - -export class Application { - static Logo: LogoClass; - static logo: Logo; - static Pages: Array>; - static pages: Array; - static metadata: Array; - static dates: Array; - static Links: Array>; - static links: Array - - static run(): void { - - d3.json(`${dataUrl}/metadata.json`, async (metadata: Array) => { - // load wasm module - await WasmUtils.init(); - // init Container constants - Container.importProvider(); - await Config.load(); - await Localization.load(); - GlobalEnv.init(); - - Application.metadata = metadata; - // initialize the dates - Application.dates = Application.metadata - .filter(each => each.type === "joined") - .map(each => each.date) - .reverse(); - // initialize the logo - Application.logo = Container.get(Application.Logo); - Application.logo.init(); - - // initialize the pages - Application.pages = Application.Pages.map(Container.get); - Application.pages.forEach(page => page.init()); - - // initialize the links - Application.links = Application.Links.map(Container.get); - Application.links.forEach(link => link.init()); - - // render the first page - Application.pages[0].update(); - - }) - } - - static build = { - withBlank() { - return Application.build; - }, - - withLogo(Logo: LogoClass) { - Application.Logo = Logo; - return Application.build; - }, - - withPages(...Pages: Array>) { - Application.Pages = Pages; - return Application.build; - }, - - withLinks(...Links: Array>) { - Application.Links = Links; - return Application.build; - }, - - class: Application - } -} diff --git a/src/app/config.ts b/src/app/config.ts deleted file mode 100644 index 53268f5..0000000 --- a/src/app/config.ts +++ /dev/null @@ -1,486 +0,0 @@ -import { Container, ObjChainMap } from "../utils"; -import { Nation } from "../data/wiki-data"; -import { Measurement } from "./options"; -import * as d3 from "d3"; - - -export interface ConfigJson { - readonly BrHeatmapPage: { - readonly BrHeatmap: MainPlotConfigJson; - readonly ColorBar: PlotConfigJson; - readonly BrLineChart: PlotConfigJson; - readonly Legend: PlotConfigJson; - readonly Tooltip: TooltipConfigJson; - readonly LineChartTooltip: TooltipConfigJson; - } - - readonly StackedAreaPage: { - readonly StackedLineChart: MainPlotConfigJson; - readonly Legend: PlotConfigJson; - } -} - -export class Margin { - readonly top: number; - readonly right: number; - readonly bottom: number; - readonly left: number; -} - -interface PlotConfigJson { - readonly svgHeight: number; - readonly svgWidth: number; - readonly margin: Margin; -} - -interface MainPlotConfigJson extends PlotConfigJson { - readonly mainSvgId: string; -} - -interface TooltipConfigJson { - readonly parentSvgId: string; - readonly opacity: number; - readonly nRow: number; - readonly rectWidth: number; - readonly rectXBias: number; - readonly rectYBias: number; - readonly textXBias: number; - readonly textYBias: number; - readonly leftShiftXThreshold: number; - readonly downShiftYThreshold: number; - readonly leftShiftOffset: number; - readonly downShiftOffset: number; -} - -abstract class AbstractConfig { - protected readonly class = "Config"; - protected readonly plot: string; - protected readonly page: string; - - constructor(page: string, name: string) { - this.page = page; - this.plot = name; - } -} - -class PlotConfig extends AbstractConfig { - get svgHeight(): string { - return `${this.class}.${this.page}.${this.plot}.svgHeight`; - }; - - get svgWidth(): string { - return `${this.class}.${this.page}.${this.plot}.svgWidth`; - } - - get margin(): string { - return `${this.class}.${this.page}.${this.plot}.margin`; - } -} - -class MainPlotConfig extends PlotConfig { - get mainSvgId() { - return `${this.class}.${this.page}.${this.plot}.mainSvgId`; - } -} - -class TooltipConfig extends AbstractConfig { - get parentSvgId(): string { - return `${this.class}.${this.page}.${this.plot}.parentSvgId`; - } - - get opacity(): string { - return `${this.class}.${this.page}.${this.plot}.opacity`; - } - - get nRow(): string { - return `${this.class}.${this.page}.${this.plot}.nRow`; - } - - get rectWidth(): string { - return `${this.class}.${this.page}.${this.plot}.rectWidth`; - } - - get rectXBias(): string { - return `${this.class}.${this.page}.${this.plot}.rectXBias`; - } - - get rectYBias(): string { - return `${this.class}.${this.page}.${this.plot}.rectYBias`; - } - - get textXBias(): string { - return `${this.class}.${this.page}.${this.plot}.textXBias`; - } - - get textYBias(): string { - return `${this.class}.${this.page}.${this.plot}.textYBias`; - } - - get leftShiftXThreshold(): string { - return `${this.class}.${this.page}.${this.plot}.leftShiftXThreshold`; - } - - get downShiftYThreshold(): string { - return `${this.class}.${this.page}.${this.plot}.downShiftYThreshold`; - } - - get leftShiftOffset(): string { - return `${this.class}.${this.page}.${this.plot}.leftShiftOffset`; - } - - get downShiftOffset(): string { - return `${this.class}.${this.page}.${this.plot}.downShiftOffset`; - } -} - - -export class Config { - static async load(): Promise { - const json: ConfigJson = await (await fetch("config/params.json")).json() - - new ObjChainMap() - .addLayer(() => json) - .addLayer((page: keyof Config) => json[page]) - .addLayer((page: keyof Config, plot: string) => json[page][plot]) - .addLayer((page: keyof Config, plot: string, attr: string) => json[page][plot][attr]) - .forEach((layers, value) => { - const [page, plot, attr] = layers as [keyof Config, string, string]; - const key = Config[page][plot][attr]; - Container.bind(key).toConstantValue(value); - }) - } - - static BrHeatmapPage = class { - static BrHeatmap = new MainPlotConfig("BrHeatmapPage", "BrHeatmap"); - static ColorBar = new PlotConfig("BrHeatmapPage", "ColorBar"); - static BrLineChart = new PlotConfig("BrHeatmapPage", "BrLineChart"); - static Legend = new PlotConfig("BrHeatmapPage", "Legend"); - static Tooltip = new TooltipConfig("BrHeatmapPage", "Tooltip") - static LineChartTooltip = new TooltipConfig("BrHeatmapPage", "LineChartTooltip"); - } - - static StackedAreaPage = class { - static StackedLineChart = new MainPlotConfig("StackedAreaPage", "StackedLineChart"); - static Legend = new PlotConfig("StackedAreaPage", "Legend"); - } -} - -interface LocalizationJson { - readonly Navbar: { - readonly BrHeatmap: string, - readonly StackedArea: string, - readonly TodoList: string, - readonly WebRepo: string, - readonly DataRepo: string, - readonly Issues: string, - readonly Forum: string, - readonly Github: string - } - - readonly Sidebar: { - readonly Mode: { - readonly label: string, - readonly ab: string, - readonly rb: string, - readonly sb: string - } - readonly Measurement: { - readonly label: string, - readonly winRate: string, - readonly battlesSum: string - readonly airFragsPerBattle: string, - readonly airFragsPerDeath: string, - readonly groundFragsPerBattle: string, - readonly groundFragsPerDeath: string, - } - readonly BrRange: { - readonly label: string - } - readonly Scale: { - readonly label: string, - readonly value: string, - readonly percentage: string - } - readonly Colorblind: { - readonly label: string - } - } - - readonly BrHeatmapPage: { - readonly Tooltip: { - readonly nation: string, - readonly br: string - } - - readonly BrLineChart: { - readonly date: string - } - } - - readonly StackedAreaPage: { - readonly StackedLineChart: { - readonly date: string, - readonly battles: string - } - } - - readonly Nation: { - readonly USA: string, - readonly Germany: string, - readonly USSR: string, - readonly Britain: string, - readonly Japan: string, - readonly France: string, - readonly Italy: string, - readonly China: string, - readonly Sweden: string, - readonly Israel: string - } -} - -abstract class AbstractLocalization { - protected readonly class = "Localization"; - protected abstract readonly layout: string; -} - -class NavbarLocalization extends AbstractLocalization { - protected layout: string = "Navbar"; - - get BrHeatmap(): string { - return `${this.class}.${this.layout}.BrHeatmap`; - } - get StackedArea(): string { - return `${this.class}.${this.layout}.StackedArea`; - } - get TodoList(): string { - return `${this.class}.${this.layout}.TodoList`; - } - get WebRepo(): string { - return `${this.class}.${this.layout}.WebRepo`; - } - get DataRepo(): string { - return `${this.class}.${this.layout}.DataRepo`; - } - get Issues(): string { - return `${this.class}.${this.layout}.Issues`; - } - get Forum(): string { - return `${this.class}.${this.layout}.Forum`; - } - get Github(): string { - return `${this.class}.${this.layout}.Github`; - } -} - -class SelectionLocalization extends AbstractLocalization { - protected readonly layout: string; - protected readonly selection: string; - - constructor(layout: string, selection: string) { - super(); - this.layout = layout; - this.selection = selection; - } - - get label(): string { - return `${this.class}.${this.layout}.${this.selection}.label`; - } -} - -class CheckboxLocalization extends AbstractLocalization { - protected readonly layout: string; - protected readonly selection: string; - - constructor(layout: string, selection: string) { - super(); - this.layout = layout; - this.selection = selection; - } - - get label(): string { - return `${this.class}.${this.layout}.${this.selection}.checked`; - } -} - -export type NationTranslator = (n: Nation) => string; -export type MeasurementTranslator = (m: Measurement) => string; - -export class Localization { - static async load() { - let lang; - let is_zh = false; - - try { - if (navigator.language === "zh-CN" || navigator.language === "zh") { - lang = "zh-CN"; - is_zh = true; - } else { - lang = "en-US"; - } - d3.select("html").attr("lang", lang); - - if (is_zh) { - d3.select("#stat").style("display", null); - } - } catch (e) { - console.error(e); - lang = "en-US"; - } - const {Navbar, Sidebar, BrHeatmapPage, StackedAreaPage, Nation}: LocalizationJson = - await (await fetch(`config/i18n/${lang}.json`)).json(); - - // set navbar i18n - Object.entries(Navbar).forEach(([layer, value]) => { - const attr = layer as keyof NavbarLocalization; - const key = Localization.Navbar[attr]; - Container.bind(key).toConstantValue(value); - }) - - // set sidebar i18n - new ObjChainMap() - .addLayer(() => Sidebar) - .addLayer((selection: keyof typeof Sidebar) => Sidebar[selection]) - .addLayer((selection: keyof typeof Sidebar, attr: keyof SelectionLocalization) => Sidebar[selection][attr]) - .forEach((layers, value) => { - const [selection, attr] = layers as [keyof typeof Sidebar, keyof SelectionLocalization]; - const key = Localization.Sidebar[selection][attr]; - Container.bind(key).toConstantValue(value); - }) - - // set BrHeatmapPage i18n - new ObjChainMap() - .addLayer(() => BrHeatmapPage) - .addLayer((plot: keyof typeof BrHeatmapPage) => BrHeatmapPage[plot]) - .addLayer((plot: keyof typeof BrHeatmapPage, attr: keyof Localization) => BrHeatmapPage[plot][attr]) - .forEach((layers, value) => { - const [plot, attr] = layers as [keyof typeof BrHeatmapPage, keyof Localization]; - const key = Localization.BrHeatmapPage[plot][attr]; - Container.bind(key).toConstantValue(value); - }) - - // set StackedAreaPage i18n - new ObjChainMap() - .addLayer(() => StackedAreaPage) - .addLayer((plot: keyof typeof StackedAreaPage) => StackedAreaPage[plot]) - .addLayer((plot: keyof typeof StackedAreaPage, attr: keyof Localization) => StackedAreaPage[plot][attr]) - .forEach((layers, value) => { - const [plot, attr] = layers as [keyof typeof StackedAreaPage, keyof Localization]; - const key = Localization.StackedAreaPage[plot][attr]; - Container.bind(key).toConstantValue(value); - }) - - // set nation map - Container.bind(Localization.Nation).toFunction((n: Nation) => Nation[n]); - - // set measurement map - Container.bind(Localization.Measurement).toFunction((m: Measurement) => { - switch (m) { - case "win_rate": - return Container.get(Localization.Sidebar.Measurement.winRate); - case "battles_sum": - return Container.get(Localization.Sidebar.Measurement.battlesSum); - case "air_frags_per_battle": - return Container.get(Localization.Sidebar.Measurement.airFragsPerBattle); - case "air_frags_per_death": - return Container.get(Localization.Sidebar.Measurement.airFragsPerDeath); - case "ground_frags_per_battle": - return Container.get(Localization.Sidebar.Measurement.groundFragsPerBattle); - case "ground_frags_per_death": - return Container.get(Localization.Sidebar.Measurement.groundFragsPerDeath); - } - }) - } - - static Navbar = new NavbarLocalization(); - static Sidebar = class { - static Date = new SelectionLocalization("Sidebar", "Date"); - - static Class = new class extends SelectionLocalization { - get groundVehicles(): string { - return `${this.class}.${this.layout}.${this.selection}.groundVehicles`; - } - get aviation(): string { - return `${this.class}.${this.layout}.${this.selection}.aviation` - } - }("Sidebar", "Class"); - - static Mode = new class extends SelectionLocalization { - get ab(): string { - return `${this.class}.${this.layout}.${this.selection}.ab`; - } - get rb(): string { - return `${this.class}.${this.layout}.${this.selection}.rb`; - } - get sb(): string { - return `${this.class}.${this.layout}.${this.selection}.sb`; - } - }("Sidebar", "Mode"); - - static Measurement = new class extends SelectionLocalization { - get winRate(): string { - return `${this.class}.${this.layout}.${this.selection}.winRate`; - } - get battlesSum(): string { - return `${this.class}.${this.layout}.${this.selection}.battlesSum`; - } - get airFragsPerBattle(): string { - return `${this.class}.${this.layout}.${this.selection}.airFragsPerBattle`; - } - get airFragsPerDeath(): string { - return `${this.class}.${this.layout}.${this.selection}.airFragsPerDeath`; - } - get groundFragsPerBattle(): string { - return `${this.class}.${this.layout}.${this.selection}.groundFragsPerBattle`; - } - get groundFragsPerDeath(): string { - return `${this.class}.${this.layout}.${this.selection}.groundFragsPerDeath`; - } - }("Sidebar", "Measurement"); - - static BrRange = new SelectionLocalization("Sidebar", "BrRange"); - - static Scale = new class extends SelectionLocalization { - get value(): string { - return `${this.class}.${this.layout}.${this.selection}.value`; - } - get percentage(): string { - return `${this.class}.${this.layout}.${this.selection}.percentage`; - } - }("Sidebar", "Scale") - - static Colorblind = new CheckboxLocalization("Sidebar", "Colorblind"); - }; - - static BrHeatmapPage = { - Tooltip: new class { - get nation() { - return "Localization.BrHeatmapPage.Tooltip.nation"; - } - - get br() { - return "Localization.BrHeatmapPage.Tooltip.br"; - } - }(), - - BrLineChart: new class { - get date() { - return "Localization.BrHeatmapPage.BrLineChart.date"; - } - }() - } - - static StackedAreaPage = { - StackedLineChart: new class { - get date(): string { - return "Localization.StackedAreaPage.StackedLineChart.date"; - } - - get battles(): string { - return "Localization.StackedAreaPage.StackedLineChart.battles"; - } - }() - } - - static Nation = "Localization.Nation"; - static Measurement = "Localization.Measurement" -} diff --git a/src/app/global-env.ts b/src/app/global-env.ts deleted file mode 100644 index fd329fd..0000000 --- a/src/app/global-env.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Container } from "../utils"; -import * as d3 from "d3"; -import { Nation } from "../data/wiki-data"; - -export class GlobalEnv { - static init() { - Container.bind(Navbar).toConstantValue(navbar); - Container.bind(Sidebar).toConstantValue(sidebar); - Container.bind(Content).toConstantValue(content); - } -} - -export const Navbar = Symbol("Navbar"); -const navbar = d3.select("#navbar") -export const Sidebar = Symbol("Sidebar"); -const sidebar = d3.select("#sidebar"); -export const Content = Symbol("Content"); -const content = d3.select("#content"); - -export const nations: Array = ["USA", "Germany", "USSR", "Britain", "Japan", "France", "Italy", "China", "Sweden", "Israel"]; - -export const brs = { - "1": ['1.0 ~ 2.0', '1.3 ~ 2.3', '1.7 ~ 2.7', '2.0 ~ 3.0', '2.3 ~ 3.3', '2.7 ~ 3.7', - '3.0 ~ 4.0', '3.3 ~ 4.3', '3.7 ~ 4.7', '4.0 ~ 5.0', '4.3 ~ 5.3', '4.7 ~ 5.7', - '5.0 ~ 6.0', '5.3 ~ 6.3', '5.7 ~ 6.7', '6.0 ~ 7.0', '6.3 ~ 7.3', '6.7 ~ 7.7', - '7.0 ~ 8.0', '7.3 ~ 8.3', '7.7 ~ 8.7', '8.0 ~ 9.0', '8.3 ~ 9.3', '8.7 ~ 9.7', - '9.0 ~ 10.0', '9.3 ~ 10.3', '9.7 ~ 10.7', '10.0 ~ 11.0', '10.3 ~ 11.3', '10.7 ~ 11.7', - '11.0 ~ 12.0', '11.3 ~ 12.3', '11.7 ~ 12.7', '12.0 ~ 13.0', '12.3 ~ 13.3', '12.7 ~ 13.7', '13.0 ~ 14.0' - ], - "0": ['1.0', '1.3', '1.7', '2.0', '2.3', '2.7', '3.0', '3.3', '3.7', '4.0', '4.3', '4.7', '5.0', '5.3', '5.7', - '6.0', '6.3', '6.7', '7.0', '7.3', '7.7', '8.0', '8.3', '8.7', '9.0', '9.3', '9.7', '10.0', '10.3', '10.7', - '11.0', '11.3', '11.7', '12.0', '12.3', '12.7', '13.0' - ] -}; - -export const dataUrl = "https://controlnet.space/wt-data-project.data"; diff --git a/src/app/image/logo.ts b/src/app/image/logo.ts deleted file mode 100644 index 13424ab..0000000 --- a/src/app/image/logo.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NavTab } from "../nav-tab"; -import { Singleton } from "../../utils"; - -@Singleton(Logo) -export class Logo extends NavTab { - readonly id: string = "nav-logo"; - readonly name: string = null; - readonly image: string = "/img/logo64.png"; - - init(): void { - this.navbar - .append("li") - .append("img") - .attr("id", this.id) - .attr("src", this.image) - .classed("image-tab", true); - } -} - -export type LogoClass = { new(...args: any[]): Logo }; diff --git a/src/app/link/data-repo.ts b/src/app/link/data-repo.ts deleted file mode 100644 index 1bda461..0000000 --- a/src/app/link/data-repo.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Link } from "./link"; -import { Inject, Singleton } from "../../utils"; -import { Localization } from "../config"; - -@Singleton(DataRepo) -export class DataRepo extends Link { - @Inject(Localization.Navbar.DataRepo) readonly name: string; - readonly id = "data-repo"; - readonly url = "https://github.com/ControlNet/wt-data-project.data"; -} \ No newline at end of file diff --git a/src/app/link/forum.ts b/src/app/link/forum.ts deleted file mode 100644 index ac1aac6..0000000 --- a/src/app/link/forum.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Inject, Singleton } from "../../utils"; -import { Link } from "./link"; -import { Localization } from "../config"; -import * as d3 from "d3"; - -@Singleton(Forum) -export class Forum extends Link { - @Inject(Localization.Navbar.Forum) readonly name: string; - readonly id = "forum"; - readonly url = "https://github.com/ControlNet/wt-data-project.web/discussions"; - - init() { - super.init(); - d3.select(`#${this.id}`) - .html(`${this.name}NEW`) - } -} diff --git a/src/app/link/github-issue.ts b/src/app/link/github-issue.ts deleted file mode 100644 index fbf32be..0000000 --- a/src/app/link/github-issue.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Inject, Singleton } from "../../utils"; -import { Link } from "./link"; -import { Localization } from "../config"; - -@Singleton(GithubIssue) -export class GithubIssue extends Link { - @Inject(Localization.Navbar.Issues) readonly name: string; - readonly id = "issues"; - readonly url = "https://github.com/ControlNet/wt-data-project.web/issues"; -} \ No newline at end of file diff --git a/src/app/link/github-link.ts b/src/app/link/github-link.ts deleted file mode 100644 index 9d724ec..0000000 --- a/src/app/link/github-link.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Link } from "./link"; -import { Inject, Singleton } from "../../utils"; -import { Localization } from "../config"; - -@Singleton(GithubLink) -export class GithubLink extends Link { - @Inject(Localization.Navbar.Github) readonly name: string; - readonly id = "github"; - readonly url = "https://github.com/ControlNet"; -} \ No newline at end of file diff --git a/src/app/link/link.ts b/src/app/link/link.ts deleted file mode 100644 index 7ffebf3..0000000 --- a/src/app/link/link.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { NavTab } from "../nav-tab" -import { Injectable } from "../../utils"; - -@Injectable -export abstract class Link extends NavTab { - abstract readonly url: string; - - init(): void { - this.navbar - .append("li") - .append("a") - .attr("id", this.id) - .attr("href", this.url) - .attr("rel", "noopener") - .attr("target", "_blank") - .classed("link-tab", true) - .html(this.name) - } - -} - - -export type LinkClass = { new(...args: any[]): T }; diff --git a/src/app/link/web-repo.ts b/src/app/link/web-repo.ts deleted file mode 100644 index 8dff517..0000000 --- a/src/app/link/web-repo.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Link } from "./link"; -import { Inject, Singleton } from "../../utils"; -import { Localization } from "../config"; - -@Singleton(WebRepo) -export class WebRepo extends Link { - @Inject(Localization.Navbar.WebRepo) readonly name = "GitHub"; - readonly id = "web-repo"; - readonly url = "https://github.com/ControlNet/wt-data-project.web"; -} \ No newline at end of file diff --git a/src/app/nav-tab.ts b/src/app/nav-tab.ts deleted file mode 100644 index 0ae9934..0000000 --- a/src/app/nav-tab.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Inject, Injectable } from "../utils"; -import { Navbar } from "./global-env"; -import * as d3 from "d3"; - -@Injectable -export abstract class NavTab { - abstract readonly id: string; - abstract readonly name: string; - abstract init(): void; - @Inject(Navbar) navbar: d3.Selection; -} \ No newline at end of file diff --git a/src/app/options.ts b/src/app/options.ts deleted file mode 100644 index fb8439b..0000000 --- a/src/app/options.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type BRRange = "0" | "1"; - -export type Measurement = "win_rate" | "battles_sum" | "air_frags_per_battle" | "air_frags_per_death" | "ground_frags_per_battle" | "ground_frags_per_death"; - -export type Mode = "ab" | "rb" | "sb"; - -export type Clazz = "Aviation" | "Ground_vehicles"; - -export type Scale = "value" | "percentage"; \ No newline at end of file diff --git a/src/app/page/br-heatmap-page.ts b/src/app/page/br-heatmap-page.ts deleted file mode 100644 index cd64fed..0000000 --- a/src/app/page/br-heatmap-page.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Page } from "./page"; -import { Container, Inject, Singleton, utils } from "../../utils"; -import { BrHeatmap } from "../../plot/br-heatmap"; -import { Sidebar } from "../global-env"; -import { BrRangeSelect, ClassSelect, DateSelect, MeasurementSelect, ModeSelect, Select } from "../sidebar/select"; -import * as d3 from "d3"; -import { BRRange, Clazz, Measurement, Mode } from "../options"; -import { Localization } from "../config"; -import { Checkbox, ColorblindCheckbox } from "../sidebar/checkbox"; - - -@Singleton(BRHeatMapPage) -export class BRHeatMapPage extends Page { - plot: BrHeatmap; - readonly id = "br-heatmap"; - @Inject(Localization.Navbar.BrHeatmap) readonly name: string; - @Inject(Sidebar) sidebar: d3.Selection; - - update(): void { - // remove old plot - this.removeOld(); - // add date selection - Container.get(ClassSelect).init(); - // add mode selection for measurement - Container.get(MeasurementSelect).init(); - // br range selection - Container.get(ClassSelect).init(); - // add mode selection for measurement - Container.get(ScaleSelect).init(); - - // init main plot - Container.rebind(StackedLineChart).toSelf(); - this.plot = Container.get(StackedLineChart); - // rebind the plot object as constant value for other subplots - Container.rebind(StackedLineChart).toConstantValue(this.plot); - this.plot.init(); - - // change any selection will refresh the BrHeatmap. - utils.setEvent.byClass("plot-selection") - .onchange(() => this.plot.update()); - } - - get clazz(): Clazz { - return utils.getSelectedValue("class-selection"); - } - - get mode(): Mode { - return utils.getSelectedValue("mode-selection"); - } - - get scale(): Scale { - return utils.getSelectedValue("scale-selection"); - } -} \ No newline at end of file diff --git a/src/app/page/todo-page.ts b/src/app/page/todo-page.ts deleted file mode 100644 index 51c767e..0000000 --- a/src/app/page/todo-page.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Page } from "./page"; -import * as d3 from "d3"; -import * as marked from "marked"; -import { Inject, Singleton } from "../../utils"; -import { Localization } from "../config"; - - -@Singleton(TodoPage) -export class TodoPage extends Page { - readonly id = "todo-list"; - @Inject(Localization.Navbar.TodoList) readonly name = "Todo List"; - - update(): void { - // remove old content of previous page - this.removeOld(); - d3.text("https://wt.controlnet.space/README.md", function(md) { - d3.select("#content") - .html(marked(md)) - .html(d3.select("div#todo-list-section").html()) - }) - } -} \ No newline at end of file diff --git a/src/app/sidebar/checkbox.ts b/src/app/sidebar/checkbox.ts deleted file mode 100644 index d50fad0..0000000 --- a/src/app/sidebar/checkbox.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { Container, Inject, Provider } from "../../utils"; -import { SideBarElement } from "./sidebar-element"; -import { Sidebar } from "../global-env"; -import * as d3 from "d3"; -import { Select } from "./select"; -import { Localization } from "../config"; - -@Provider(Checkbox) -export class Checkbox extends SideBarElement { - @Inject(Sidebar) sidebar: d3.Selection; - private labelText: string; - private id: string; - private classes: Array; - private checked: boolean; - private checkbox: d3.Selection; - - with(labelText: string, id: string, classes: Array, checked: boolean) { - this.labelText = labelText; - this.id = id; - this.classes = classes; - this.checked = checked; - return this; - } - - init() { - // init - return this.initLabel() - .initSelect() - .addData(); - } - - private initLabel() { - this.checkbox = this.sidebar - .append("label") - .text(this.labelText); - return this; - } - - private initSelect() { - this.checkbox = this.checkbox - .append("input") - .attr("id", this.id) - .attr("name", this.id) - .attr("type", "checkbox"); - for (const className of this.classes) { - this.checkbox = this.checkbox.classed(className, true); - } - return this; - } - - private addData() { - this.checkbox - .property("checked", this.checked); - return this; - } -} - -@Provider(CheckboxBuilder) -export class CheckboxBuilder { - private labelText: string; - private _id: string; - private _class: Array = []; - - label(text: string): CheckboxBuilder { - this.labelText = text; - return this; - } - - id(id: string): CheckboxBuilder { - this._id = id; - return this; - } - - get class() { - const self = this; - return { - set(classArr: Array) { - self._class = classArr; - return self; - }, - add(newClass: string) { - self._class.push(newClass); - return self; - } - } - } - - init(): Checkbox { - const checked = localStorage.getItem(this._id) === "true"; - return Container.get(Checkbox) - .with(this.labelText, this._id, this._class, checked) - .init(); - } -} - -// date selection for choosing date -export const ColorblindCheckbox = Symbol("ColorblindCheckbox"); -Container.bind(ColorblindCheckbox).toDynamicValue(() => { - return Container.get(CheckboxBuilder) - .id("colorblind-checkbox") - .label(Container.get(Localization.Sidebar.Colorblind.label)) - .class.add("plot-checkbox"); -}) diff --git a/src/app/sidebar/select.ts b/src/app/sidebar/select.ts deleted file mode 100644 index 1a48dc8..0000000 --- a/src/app/sidebar/select.ts +++ /dev/null @@ -1,201 +0,0 @@ -import { SideBarElement } from "./sidebar-element"; -import { Container, Inject, Provider } from "../../utils"; -import { Sidebar } from "../global-env"; -import * as d3 from "d3"; -import { Application } from "../application"; -import { Localization } from "../config"; - - -@Provider(Select) -export class Select extends SideBarElement { - @Inject(Sidebar) sidebar: d3.Selection; - private labelText: string; - private id: string; - private classes: Array; - private data: Array<{ id: string, text: string }>; - private defaultSelectId: string; - private selection: d3.Selection; - - with(labelText: string, id: string, classes: Array, data: Array<{ id: string, text: string }>, - defaultSelectId: string - ) { - this.labelText = labelText; - this.id = id; - this.classes = classes; - this.data = data; - this.defaultSelectId = defaultSelectId; - return this; - } - - init() { - // init - return this.initLabel() - .initSelect() - .addData(); - } - - private initLabel() { - this.selection = this.sidebar - .append("label") - .text(this.labelText); - return this; - } - - private initSelect() { - this.selection = this.selection - .append("select") - .attr("id", this.id); - for (const className of this.classes) { - this.selection = this.selection.classed(className, true); - } - return this; - } - - private addData() { - this.selection - .selectAll() - .data(this.data) - .enter() - .append("option") - .attr("value", d => d.id) - .attr("selected", d => d.id === this.defaultSelectId ? "selected" : undefined) - .html(d => d.text); - return this; - } -} - - -@Provider(SelectBuilder) -export class SelectBuilder { - private labelText: string; - private _id: string; - private _class: Array = []; - private _data: Array<{ id: string, text: string }> = []; - private defaultId: string; - - label(text: string): SelectBuilder { - this.labelText = text; - return this; - } - - id(id: string): SelectBuilder { - this._id = id; - return this; - } - - get class() { - const self = this; - return { - set(classArr: Array) { - self._class = classArr; - return self; - }, - add(newClass: string) { - self._class.push(newClass); - return self; - } - } - } - - get data() { - const self = this; - return { - set(dataArr: Array<{ id: string, text: string }>): SelectBuilder { - self._data = dataArr; - return self; - }, - add(newData: { id: string, text: string }): SelectBuilder { - self._data.push(newData); - return self; - } - } - } - - default(defaultId: string): SelectBuilder { - this.defaultId = defaultId; - return this - } - - init(): Select { - return Container.get(Select) - .with(this.labelText, this._id, this._class, this._data, this.defaultId) - .init(); - } -} - -// date selection for choosing date -export const DateSelect = Symbol("DateSelect"); -Container.bind(DateSelect).toDynamicValue(() => { - return Container.get(SelectBuilder) - .id("date-selection") - .label(Container.get(Localization.Sidebar.Date.label)) - .class.add("plot-selection") - .data.set(Application.dates.map(date => { - return {id: date, text: date} - })); -}) - -// class selection for choosing ground_vehicles or aviation. -export const ClassSelect = Symbol("ClassSelect"); -Container.bind(ClassSelect).toDynamicValue(() => { - return Container.get(SelectBuilder) - .id("class-selection") - .label(Container.get(Localization.Sidebar.Class.label)) - .class.add("plot-selection") - .data.add({id: "Ground_vehicles", text: Container.get(Localization.Sidebar.Class.groundVehicles)}) - .data.add({id: "Aviation", text: Container.get(Localization.Sidebar.Class.aviation)}) - .default("Ground_vehicles"); -}) - -// mode selection for choosing ab, rb and sb -export const ModeSelect = Symbol("ModeSelect"); -Container.bind(ModeSelect).toDynamicValue(() => { - return Container.get(SelectBuilder) - .id("mode-selection") - .label(Container.get(Localization.Sidebar.Mode.label)) - .class.add("plot-selection") - .data.add({id: "ab", text: Container.get(Localization.Sidebar.Mode.ab)}) - .data.add({id: "rb", text: Container.get(Localization.Sidebar.Mode.rb)}) - .data.add({id: "sb", text: Container.get(Localization.Sidebar.Mode.sb)}) - .default("rb"); -}) - -// measurement selection for choose win_rate or battles_sum -export const MeasurementSelect = Symbol("MeasurementSelect"); -Container.bind(MeasurementSelect).toDynamicValue(() => { - return Container.get(SelectBuilder) - .id("measurement-selection") - .label(Container.get(Localization.Sidebar.Measurement.label)) - .class.add("plot-selection") - .data.add({id: "win_rate", text: Container.get(Localization.Sidebar.Measurement.winRate)}) - .data.add({id: "battles_sum", text: Container.get(Localization.Sidebar.Measurement.battlesSum)}) - .data.add({id: "air_frags_per_battle", text: Container.get(Localization.Sidebar.Measurement.airFragsPerBattle)}) - .data.add({id: "air_frags_per_death", text: Container.get(Localization.Sidebar.Measurement.airFragsPerDeath)}) - .data.add({id: "ground_frags_per_battle", text: Container.get(Localization.Sidebar.Measurement.groundFragsPerBattle)}) - .data.add({id: "ground_frags_per_death", text: Container.get(Localization.Sidebar.Measurement.groundFragsPerDeath)}) - .default("win_rate"); -}) - -// br range select for choosing 1 or 0 as br-range -export const BrRangeSelect = Symbol("BrRangeSelect"); -Container.bind(BrRangeSelect).toDynamicValue(() => { - return Container.get(SelectBuilder) - .id("br-range-selection") - .label(Container.get(Localization.Sidebar.BrRange.label)) - .class.add("plot-selection") - .data.add({id: "0", text: "0"}) - .data.add({id: "1", text: "1"}) - .default("1"); -}) - -// scale select for absolute value or percentage -export const ScaleSelect = Symbol("ScaleSelect"); -Container.bind(ScaleSelect).toDynamicValue(() => { - return Container.get(SelectBuilder) - .id("scale-selection") - .label(Container.get(Localization.Sidebar.Scale.label)) - .class.add("plot-selection") - .data.add({id: "value", text: Container.get(Localization.Sidebar.Scale.value)}) - .data.add({id: "percentage", text: Container.get(Localization.Sidebar.Scale.percentage)}) - .default("value"); -}) diff --git a/src/app/sidebar/sidebar-element.ts b/src/app/sidebar/sidebar-element.ts deleted file mode 100644 index 43b7b84..0000000 --- a/src/app/sidebar/sidebar-element.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Injectable } from "../../utils"; - -@Injectable -export abstract class SideBarElement { -} diff --git a/src/data/getter.ts b/src/data/getter.ts deleted file mode 100644 index 86e070e..0000000 --- a/src/data/getter.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Mode } from "../app/options"; - -export abstract class Getter { - protected readonly abstract data: Gettable; - protected readonly abstract mode: Mode; - -} - - -export interface Gettable { -} \ No newline at end of file diff --git a/src/data/joined-data.ts b/src/data/joined-data.ts deleted file mode 100644 index f2ee7e7..0000000 --- a/src/data/joined-data.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { TsRow } from "./ts-data"; -import { WikiRow } from "./wiki-data"; -import { Mode } from "../app/options"; -import { Getter } from "./getter"; - -export type JoinedData = Array; - -export interface JoinedRow extends TsRow, WikiRow { - wk_name: string -} - -export class JoinedRowGetter extends Getter { - protected readonly data: JoinedRow; - protected readonly mode: Mode; - - constructor(data: JoinedRow, mode: Mode) { - super(); - this.data = data; - this.mode = mode; - } - - get br(): number { - switch (this.mode) { - case "ab": - return +this.data.ab_br; - case "rb": - return +this.data.rb_br; - case "sb": - return +this.data.sb_br; - } - } - - get battles(): number { - switch (this.mode) { - case "ab": - return +this.data["ab_battles"]; - case "rb": - return +this.data["rb_battles"]; - case "sb": - return +this.data["sb_battles"]; - } - } - - get winRate(): number { - switch (this.mode) { - case "ab": - return +this.data["ab_win_rate"]; - case "rb": - return +this.data["rb_win_rate"]; - case "sb": - return +this.data["sb_win_rate"]; - } - } - - get airFragsPerBattle(): number { - switch (this.mode) { - case "ab": - return +this.data["ab_air_frags_per_battle"]; - case "rb": - return +this.data["rb_air_frags_per_battle"]; - case "sb": - return +this.data["sb_air_frags_per_battle"]; - } - } - - get airFragsPerDeath(): number { - switch (this.mode) { - case "ab": - return +this.data["ab_air_frags_per_death"]; - case "rb": - return +this.data["rb_air_frags_per_death"]; - case "sb": - return +this.data["sb_air_frags_per_death"]; - } - } - - get groundFragsPerBattle(): number { - switch (this.mode) { - case "ab": - return +this.data["ab_ground_frags_per_battle"]; - case "rb": - return +this.data["rb_ground_frags_per_battle"]; - case "sb": - return +this.data["sb_ground_frags_per_battle"]; - } - } - - get groundFragsPerDeath(): number { - switch (this.mode) { - case "ab": - return +this.data["ab_ground_frags_per_death"] - case "rb": - return +this.data["rb_ground_frags_per_death"] - case "sb": - return +this.data["sb_ground_frags_per_death"] - } - } - - get rpRate(): number { - switch (this.mode) { - case "ab": - return +this.data["ab_rp_rate"]; - case "rb": - return +this.data["rb_rp_rate"]; - case "sb": - return +this.data["sb_rp_rate"]; - } - } - - get slRate(): number { - switch (this.mode) { - case "ab": - return +this.data["ab_sl_rate"]; - case "rb": - return +this.data["rb_sl_rate"]; - case "sb": - return +this.data["sb_sl_rate"]; - } - } -} \ No newline at end of file diff --git a/src/data/metadata.ts b/src/data/metadata.ts deleted file mode 100644 index b60b816..0000000 --- a/src/data/metadata.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface Metadata { - type: string; - date: string; - path: string; -} - diff --git a/src/data/timeseries-data.ts b/src/data/timeseries-data.ts deleted file mode 100644 index 7da30d4..0000000 --- a/src/data/timeseries-data.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { Gettable, Getter } from "./getter"; -import { Clazz, Measurement, Mode } from "../app/options"; -import { Nation } from "./wiki-data"; - -export type TimeseriesData = Array; - -export interface TimeseriesRow extends Gettable { - nation: Nation - cls: Clazz - date: string -} - -export interface TimeseriesABRow extends TimeseriesRow { - ab_br: string - ab_lower_br: number - ab_battles_sum: number - ab_battles_mean: number - ab_win_rate: number - ab_air_frags_per_battle: number - ab_air_frags_per_death: number - ab_ground_frags_per_battle: number - ab_ground_frags_per_death: number -} - -export interface TimeseriesRBRow extends TimeseriesRow { - rb_br: string - rb_lower_br: number - rb_battles_sum: number - rb_battles_mean: number - rb_win_rate: number - rb_air_frags_per_battle: number - rb_air_frags_per_death: number - rb_ground_frags_per_battle: number - rb_ground_frags_per_death: number -} - -export interface TimeseriesSBRow extends TimeseriesRow { - sb_br: string - sb_lower_br: number - sb_battles_sum: number - sb_battles_mean: number - sb_win_rate: number - sb_air_frags_per_battle: number - sb_air_frags_per_death: number - sb_ground_frags_per_battle: number - sb_ground_frags_per_death: number -} - -export class TimeseriesRowGetter extends Getter { - protected readonly data: T; - protected readonly mode: Mode; - private readonly measurement: Measurement; - - constructor(data: T, mode: Mode, measurement: Measurement) { - super(); - this.data = data; - this.mode = mode; - this.measurement = measurement; - } - - get value(): number { - switch (this.mode) { - case "ab": - const abData = this.data; - switch (this.measurement) { - case "win_rate": - return +abData.ab_win_rate; - case "battles_sum": - return +abData.ab_battles_sum; - case "air_frags_per_battle": - return +abData.ab_air_frags_per_battle; - case "air_frags_per_death": - return +abData.ab_air_frags_per_death; - case "ground_frags_per_battle": - return +abData.ab_ground_frags_per_battle; - case "ground_frags_per_death": - return +abData.ab_ground_frags_per_death; - } - break; - case "rb": - const rbData = this.data; - switch (this.measurement) { - case "win_rate": - return +rbData.rb_win_rate; - case "battles_sum": - return +rbData.rb_battles_sum; - case "air_frags_per_battle": - return +rbData.rb_air_frags_per_battle; - case "air_frags_per_death": - return +rbData.rb_air_frags_per_death; - case "ground_frags_per_battle": - return +rbData.rb_ground_frags_per_battle; - case "ground_frags_per_death": - return +rbData.rb_ground_frags_per_death; - } - break; - case "sb": - const sbData = this.data; - switch (this.measurement) { - case "win_rate": - return +sbData.sb_win_rate; - case "battles_sum": - return +sbData.sb_battles_sum; - case "air_frags_per_battle": - return +sbData.sb_air_frags_per_battle; - case "air_frags_per_death": - return +sbData.sb_air_frags_per_death; - case "ground_frags_per_battle": - return +sbData.sb_ground_frags_per_battle; - case "ground_frags_per_death": - return +sbData.sb_ground_frags_per_death; - } - break; - } - } - - get br(): string { - switch (this.mode) { - case "ab": - return (this.data).ab_br; - case "rb": - return (this.data).rb_br; - case "sb": - return (this.data).sb_br; - } - } - - get lowerBr(): number { - switch (this.mode) { - case "ab": - return +(this.data).ab_lower_br; - case "rb": - return +(this.data).rb_lower_br; - case "sb": - return +(this.data).sb_lower_br; - } - } -} diff --git a/src/data/ts-data.ts b/src/data/ts-data.ts deleted file mode 100644 index 5e429a9..0000000 --- a/src/data/ts-data.ts +++ /dev/null @@ -1,24 +0,0 @@ -export type TsData = Array - -export interface TsRow { - name: string - ab_battles: number - ab_win_rate: number - ab_air_frags_per_battle: number - ab_air_frags_per_death: number - ab_ground_frags_per_battle: number - ab_ground_frags_per_death: number - rb_battles: number - rb_win_rate: number - rb_air_frags_per_battle: number - rb_air_frags_per_death: number - rb_ground_frags_per_battle: number - rb_ground_frags_per_death: number - sb_battles: number - sb_win_rate: number - sb_air_frags_per_battle: number - sb_air_frags_per_death: number - sb_ground_frags_per_battle: number - sb_ground_frags_per_death: number - alt_name: string -} \ No newline at end of file diff --git a/src/data/wiki-data.ts b/src/data/wiki-data.ts deleted file mode 100644 index 6bc8041..0000000 --- a/src/data/wiki-data.ts +++ /dev/null @@ -1,22 +0,0 @@ -export type WikiData = Array - -export interface WikiRow { - name: string - nation: Nation - cls: string - ab_br: number - rb_br: number - sb_br: number - ab_repair: number - rb_repair: number - sb_repair: number - is_premium: boolean - ab_rp_rate: number - ab_sl_rate: number - rb_rp_rate: number - rb_sl_rate: number - sb_rp_rate: number - sb_sl_rate: number -} - -export type Nation = "USA" | "Germany" | "USSR" | "Britain" | "Japan" | "France" | "Italy" | "China" | "Sweden" | "Israel"; \ No newline at end of file diff --git a/src/main.ts b/src/main.ts deleted file mode 100644 index 95d2fe2..0000000 --- a/src/main.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Application } from "./app/application"; -import { BRHeatMapPage } from "./app/page/br-heatmap-page"; -import { StackedAreaPage } from "./app/page/stacked-area-page"; -import { TodoPage } from "./app/page/todo-page"; -import { WebRepo } from "./app/link/web-repo"; -import { DataRepo } from "./app/link/data-repo"; -import { GithubLink } from "./app/link/github-link"; -import { Logo } from "./app/image/logo"; -import { GithubIssue } from "./app/link/github-issue"; -import { Forum } from "./app/link/forum"; - -Application.build - .withLogo(Logo) - .withPages(BRHeatMapPage, StackedAreaPage, TodoPage) - .withLinks(WebRepo, DataRepo, GithubIssue, Forum, GithubLink) - .class - .run() diff --git a/src/misc/color-map-def.ts b/src/misc/color-map-def.ts deleted file mode 100644 index 435f087..0000000 --- a/src/misc/color-map-def.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { CONT_COLORS, CONT_COLORS_BLIND, Container } from "../utils"; -import * as d3 from "d3"; - -export class ColorMap { - constructor( - public name: string, - public colors: Array, - public percentiles: Array - ) { - } -} - - -export class BrHeatColorMap { - winRate: { Aviation: ColorMap; Ground_vehicles: ColorMap }; - battlesSum: { Aviation: ColorMap; Ground_vehicles: ColorMap }; - airFragsPerBattle: { Aviation: ColorMap; Ground_vehicles: ColorMap }; - airFragsPerDeath: { Aviation: ColorMap; Ground_vehicles: ColorMap }; - groundFragsPerBattle: { Aviation: ColorMap; Ground_vehicles: ColorMap }; - groundFragsPerDeath: { Aviation: ColorMap; Ground_vehicles: ColorMap }; -} - -const getBrHeatmapColorMaps: (isColorblind: boolean) => BrHeatColorMap = (isColorblind) => { - const colors = isColorblind ? CONT_COLORS_BLIND : CONT_COLORS; - return { - "winRate": { - "Ground_vehicles": new ColorMap( - "ground-vehicles-win-rate", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.05, 0.43, 0.53, 0.63, 0.95, 1.0] - ), - "Aviation": new ColorMap( - "aviation-win-rate", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.01, 0.5, 0.6, 0.7, 0.99, 1.0] - ) - }, - "battlesSum": { - "Ground_vehicles": new ColorMap( - "ground-vehicles-battles-sum", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.01, 0.4, 0.5, 0.6, 0.99, 1.0], - ), - "Aviation": new ColorMap( - "aviation-battles-sum", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.01, 0.4, 0.5, 0.6, 0.99, 1.0], - ) - }, - "airFragsPerBattle": { - "Ground_vehicles": new ColorMap( - "ground-vehicles-air-frags-per-battle", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.001, 0.01, 0.025, 0.05, 0.999, 1.0], - ), - "Aviation": new ColorMap( - "aviation-air-frags-per-battle", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.001, 0.07, 0.13, 0.25, 0.999, 1.0], - ) - }, - "airFragsPerDeath": { - "Ground_vehicles": new ColorMap( - "ground-vehicles-air-frags-per-death", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.001, 0.01, 0.025, 0.05, 0.999, 1.0], - ), - "Aviation": new ColorMap( - "aviation-air-frags-per-death", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.001, 0.07, 0.13, 0.25, 0.999, 1.0], - ) - }, - "groundFragsPerBattle": { - "Ground_vehicles": new ColorMap( - "ground-vehicles-ground-frags-per-battle", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.001, 0.1, 0.2, 0.3, 0.999, 1.0], - ), - "Aviation": new ColorMap( - "aviation-ground-frags-per-battle", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.001, 0.01, 0.05, 0.3, 0.999, 1.0], - ) - }, - "groundFragsPerDeath": { - "Ground_vehicles": new ColorMap( - "ground-vehicles-ground-frags-per-death", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.001, 0.1, 0.2, 0.3, 0.999, 1.0], - ), - "Aviation": new ColorMap( - "aviation-ground-frags-per-death", - [colors.BLACK, colors.BLACK, colors.RED, colors.YELLOW, colors.GREEN, colors.BLACK, colors.BLACK], - [0, 0.001, 0.01, 0.05, 0.3, 0.999, 1.0], - ) - } - } -} - -// Container.bind(BrHeatColorMap).toConstantValue(brHeatmapColorMaps); -Container.bind(BrHeatColorMap).toDynamicValue(() => { - const isColorblindMode = d3.select("#colorblind-checkbox").property("checked") as boolean; - return getBrHeatmapColorMaps(isColorblindMode) -}); diff --git a/src/plot/br-heatmap.ts b/src/plot/br-heatmap.ts deleted file mode 100644 index 3d80473..0000000 --- a/src/plot/br-heatmap.ts +++ /dev/null @@ -1,453 +0,0 @@ -import * as d3 from "d3"; -import * as _ from "lodash"; -import { Plot } from "./plot"; -import { TimeseriesData, TimeseriesRow, TimeseriesRowGetter } from "../data/timeseries-data"; -import { categoricalColors, COLORS, CONT_COLORS, Container, Inject, MousePosition, Provider, utils } from "../utils"; -import { ColorBar } from "./color-bar"; -import { BrLineChart, BrLineChartDataObj } from "./line-chart"; -import { BrHeatmapLegend } from "./legend"; -import { Table } from "./table"; -import { BrHeatmapTooltip, Tooltip } from "./tooltip"; -import { Config, Localization, Margin, MeasurementTranslator, NationTranslator } from "../app/config"; -import { brs, Content, dataUrl, nations } from "../app/global-env"; -import { BRHeatMapPage } from "../app/page/br-heatmap-page"; -import { Nation } from "../data/wiki-data"; -import { BrHeatColorMap } from "../misc/color-map-def"; - - -@Provider(BrHeatmap) -export class BrHeatmap extends Plot { - @Inject(Config.BrHeatmapPage.BrHeatmap.svgHeight) readonly svgHeight: number; - @Inject(Config.BrHeatmapPage.BrHeatmap.svgWidth) readonly svgWidth: number; - @Inject(Config.BrHeatmapPage.BrHeatmap.margin) readonly margin: Margin; - @Inject(Config.BrHeatmapPage.BrHeatmap.mainSvgId) readonly mainSvgId: string; - @Inject(ColorBar) readonly colorBar: ColorBar; - @Inject(BrLineChart) readonly lineChart: BrLineChart; - @Inject(BrHeatmapLegend) readonly legend: BrHeatmapLegend; - @Inject(Table) readonly table: Table; - @Inject(BrHeatmapTooltip) readonly tooltip: Tooltip; - @Inject(Content) readonly content: d3.Selection - @Inject(BRHeatMapPage) readonly page: BRHeatMapPage; - colorMaps: BrHeatColorMap | null = null; - - selected: Array = []; - - async updateSubPlots() { - await this.table.update(); - await this.lineChart.update(); - await this.legend.update(); - } - - async resetSubPlots() { - this.table.reset(); - this.lineChart.reset(); - await this.legend.update(); - } - - onPointerLeave(_: SquareInfo, node: SVGRectElement): void { - d3.select(node).style("stroke", "black"); - this.tooltip.hide(); - } - - onPointerOver(d: SquareInfo, node: SVGRectElement): void { - d3.select(node).style("stroke", "white"); - this.tooltip.appear(); - this.tooltip.rect - .transition() - .duration(100) - .style("fill", this.value2color(d.value)); - } - - async onPointerMove(d: SquareInfo, node: SVGRectElement): Promise { - await this.tooltip.update([ - `${Container.get(Localization.BrHeatmapPage.Tooltip.nation)}${Container.get(Localization.Nation)(d.nation)}`, - `${Container.get(Localization.BrHeatmapPage.Tooltip.br)}${d.br}`, - `${Container.get(Localization.Measurement)(this.page.measurement)}: ${_.round(d.value, 3)}` - ], new MousePosition( - d3.mouse(node)[0], - d3.mouse(node)[1] - )); - } - - async onClick(_: SquareInfo, node: SVGRectElement): Promise { - const square: d3.Selection = d3.select(node); - const info: SquareInfo = square.data()[0]; - - if (utils.rgbToHex(square.style("fill")).toUpperCase() === COLORS.AZURE) { - // if the square is selected - square.style("fill", this.value2color(info.value)); - // remove the item in the `this.selected` - this.selected = this.selected.filter(each => each.br !== info.br || each.nation !== info.nation); - } else { - // if the square is not selected - square.style("fill", COLORS.AZURE); - // add the item into the `this.selected` - this.selected.push(info); - } - await this.updateSubPlots(); - } - - cache: TimeseriesData; - value2color: Value2Color; - - colorPool = { - values: utils.deepCopy(categoricalColors), - i: 0, - - bindings: new Array<{ br: string, nation: string, color: string }>(), - - get: function(d: BrLineChartDataObj) { - // if the category is generated before, use previous color - for (const binding of this.bindings) { - if (binding.br === d.br && binding.nation === d.nation) { - return binding.color; - } - } - // else assign a new color to the nation - const out = this.values[this.i]; - this.i++; - if (this.i === this.values.length) { - this.i = 0; - } - - // add to binding - this.bindings.push({ - nation: d.nation, - br: d.br, - color: out - }) - return out; - }, - } - - init(): BrHeatmap { - // build new plot in the content div of page - this.svg = this.content - .append("svg") - .attr("height", this.svgHeight) - .attr("width", this.svgWidth) - .attr("id", this.mainSvgId); - - // init the heatmap plot body - this.g = this.svg.append("g") - .attr("id", "main-g") - .attr("transform", `translate(${this.margin.left}, ${this.margin.top})`); - - d3.csv(this.dataPath, async (data: TimeseriesData) => { - // init - const dataObjs = this.extractData(data) - const squareWidth = this.width / nations.length; - const squareHeight = this.height / brs[this.page.brRange].length; - // build axis - const {x, y} = this.buildAxis(); - - // init the color bar, line chart, legend, table and tooltip - this.colorBar.init(); - this.lineChart.init(); - this.legend.init(); - this.table.init(); - this.tooltip.init(); - - // colorMap function - this.value2color = await this.getValue2color(); - if (this.table.winRateValue2color === null && this.page.measurement === "win_rate") { - this.table.winRateValue2color = this.value2color; - } - - // add heat squares - this.g.selectAll() - .data(dataObjs, d => d.nation + d.lowerBr) - .enter() - .append("rect") - .attr("x", d => x(d.nation)) - .attr("y", d => y(d.br)) - .attr("width", squareWidth) - .attr("height", squareHeight) - .style("fill", d => this.value2color(d.value)) - .style("stroke-width", 1) - .style("stroke", "black") - .on("pointerover", utils.eventWrapper(this, this.onPointerOver)) - .on("pointerleave", utils.eventWrapper(this, this.onPointerLeave)) - .on("pointermove", utils.eventWrapper(this, this.onPointerMove)) - .on("click", utils.eventWrapper(this, this.onClick)); - - this.cache = data; - - // sort the tooltip in the top layer - this.tooltip.toTopLayer(); - }) - return this; - } - - async update(reDownload: boolean): Promise { - const oldAxis = d3.selectAll("g#br-heatmap-x, g#br-heatmap-y"); - - if (reDownload) { - // if need re-download data - d3.csv(this.dataPath, (data: TimeseriesData) => { - this.updateSquares(data); - this.cache = data; - }) - } else { - // else read data from cache - await this.updateSquares(this.cache); - } - - // reset axis - this.buildAxis(); - oldAxis.remove(); - // reset selected data and sub plots - this.selected = []; - await this.resetSubPlots(); - - // sort the tooltip in the top layer - this.tooltip.toTopLayer(); - - return this; - } - - private async updateSquares(data: TimeseriesData) { - // init - const dataObjs = this.extractData(data) - - // colorMap function - this.value2color = await this.getValue2color(); - - // change fill of squares - const rects = this.g - .selectAll("rect") - .data(dataObjs, d => d.nation + d.lowerBr); - - rects.enter() - .transition() - .style("fill", d => this.value2color(d.value)); - - rects.exit() - .transition() - .style("fill", COLORS.BLANK); - - rects.transition() - .style("fill", d => this.value2color(d.value)); - } - - private buildAxis() { - // x-axis - const x = d3.scaleBand() - .range([0, this.width]) - .domain(nations); - - this.g.append("g") - .attr("id", "br-heatmap-x") - .style("font-size", 13) - .attr("transform", `translate(0, ${this.height + 10})`) - .call(d3.axisBottom(x).tickSize(0) - .tickFormat(Container.get(Localization.Nation))) - .select("#main-g g path.domain").remove() - - // y-axis - const y = d3.scaleBand() - .range([this.height, 0]) - .domain(brs[this.page.brRange]); - - this.g.append("g") - .attr("id", "br-heatmap-y") - .style("font-size", 15) - .attr("transform", `translate(-5, 0)`) - .call(d3.axisLeft(y).tickSize(0)) - .select("#main-g g path.domain").remove() - return {x, y}; - } - - private extractData(data: Array): Array { - const dataObjs = data.filter(row => row.date === this.page.date && row.cls === this.page.clazz) - .map(row => { - const get = new TimeseriesRowGetter(row, this.page.mode, this.page.measurement); - return { - nation: row.nation, - br: get.br, - lowerBr: get.lowerBr, - value: get.value - } - }); - - const blankObjs: Array = []; - nations.forEach(nation => { - brs[this.page.brRange].forEach(br => { - if (!dataObjs.find(obj => obj.nation === nation && obj.br === br)) { - blankObjs.push({ - nation, - br, - value: 0, - lowerBr: +br.split("~")[0].replace(" ", ""), - }) - } - }) - }) - - return dataObjs.concat(blankObjs); - } - - private async getValue2color(): Promise { - this.colorMaps = Container.get(BrHeatColorMap) - let value2range: d3.ScaleLinear; - let range2color: d3.ScaleLinear; - let valueMin: number; - let valueMax: number; - - switch (this.page.measurement) { - case "win_rate": - valueMin = 0; - valueMax = 100; - - value2range = d3.scaleLinear() - .domain([valueMin, valueMax]) - .range([0, 1]); - - if (this.page.clazz === "Ground_vehicles") { - range2color = d3.scaleLinear() - .domain(this.colorMaps.winRate.Ground_vehicles.percentiles) - .range(this.colorMaps.winRate.Ground_vehicles.colors) - .interpolate(d3.interpolateHsl) - } else if (this.page.clazz === "Aviation") { - range2color = d3.scaleLinear() - .domain(this.colorMaps.winRate.Aviation.percentiles) - .range(this.colorMaps.winRate.Aviation.colors) - .interpolate(d3.interpolateHsl) - } else { - throw new Error(`Invalid clazz ${this.page.clazz} for colorMap win_rate`); - } - break; - case "battles_sum": - valueMin = Math.pow(10, 2.5); - valueMax = Math.pow(10, 5.5); - - value2range = d3.scaleLog() - .domain([valueMin, valueMax]) - .range([0, 1]); - - range2color = d3.scaleLinear() - .domain(this.colorMaps.battlesSum.Ground_vehicles.percentiles) - .range(this.colorMaps.battlesSum.Ground_vehicles.colors) - .interpolate(d3.interpolateHsl) - break; - case "air_frags_per_battle": - valueMin = 0; - valueMax = 10; - - value2range = d3.scaleLinear() - .domain([valueMin, valueMax]) - .range([0, 1]); - - if (this.page.clazz === "Ground_vehicles") { - range2color = d3.scaleLinear() - .domain(this.colorMaps.airFragsPerBattle.Ground_vehicles.percentiles) - .range(this.colorMaps.airFragsPerBattle.Ground_vehicles.colors) - .interpolate(d3.interpolateHsl) - } else if (this.page.clazz === "Aviation") { - range2color = d3.scaleLinear() - .domain(this.colorMaps.airFragsPerBattle.Aviation.percentiles) - .range(this.colorMaps.airFragsPerBattle.Aviation.colors) - .interpolate(d3.interpolateHsl) - } else { - throw new Error(`Invalid clazz ${this.page.clazz} for colorMap air_frags_per_battle`); - } - break; - case "air_frags_per_death": - valueMin = 0; - valueMax = 10; - - value2range = d3.scaleLinear() - .domain([valueMin, valueMax]) - .range([0, 1]); - - if (this.page.clazz === "Ground_vehicles") { - range2color = d3.scaleLinear() - .domain(this.colorMaps.airFragsPerDeath.Ground_vehicles.percentiles) - .range(this.colorMaps.airFragsPerDeath.Ground_vehicles.colors) - .interpolate(d3.interpolateHsl) - } else if (this.page.clazz === "Aviation") { - range2color = d3.scaleLinear() - .domain(this.colorMaps.airFragsPerDeath.Aviation.percentiles) - .range(this.colorMaps.airFragsPerDeath.Aviation.colors) - .interpolate(d3.interpolateHsl) - } else { - throw new Error(`Invalid clazz ${this.page.clazz} for colorMap air_frags_per_death`); - } - break; - case "ground_frags_per_battle": - valueMin = 0; - valueMax = 10; - - value2range = d3.scaleLinear() - .domain([valueMin, valueMax]) - .range([0, 1]); - - if (this.page.clazz === "Ground_vehicles") { - range2color = d3.scaleLinear() - .domain(this.colorMaps.groundFragsPerBattle.Ground_vehicles.percentiles) - .range(this.colorMaps.groundFragsPerBattle.Ground_vehicles.colors) - .interpolate(d3.interpolateHsl) - } else if (this.page.clazz === "Aviation") { - range2color = d3.scaleLinear() - .domain(this.colorMaps.groundFragsPerBattle.Aviation.percentiles) - .range(this.colorMaps.groundFragsPerBattle.Aviation.colors) - .interpolate(d3.interpolateHsl) - } else { - throw new Error(`Invalid clazz ${this.page.clazz} for colorMap ground_frags_per_battle`); - } - break; - case "ground_frags_per_death": - valueMin = 0; - valueMax = 10; - - value2range = d3.scaleLinear() - .domain([valueMin, valueMax]) - .range([0, 1]); - - if (this.page.clazz === "Ground_vehicles") { - range2color = d3.scaleLinear() - .domain(this.colorMaps.groundFragsPerDeath.Ground_vehicles.percentiles) - .range(this.colorMaps.groundFragsPerDeath.Ground_vehicles.colors) - .interpolate(d3.interpolateHsl) - } else if (this.page.clazz === "Aviation") { - range2color = d3.scaleLinear() - .domain(this.colorMaps.groundFragsPerDeath.Aviation.percentiles) - .range(this.colorMaps.groundFragsPerDeath.Aviation.colors) - .interpolate(d3.interpolateHsl) - } else { - throw new Error(`Invalid clazz ${this.page.clazz} for colorMap ground_frags_per_death`); - } - break; - default: - throw new Error("Invalid measurement for colorMap " + this.page.measurement); - } - - const value2color = (value: number) => range2color(value2range(value)); - - // update color bar - await this.colorBar.update(valueMin, valueMax, value2color); - - return (value: number) => { - if (value == 0.) { - return COLORS.BLANK; - } else { - return range2color(value2range(value)); - } - } - } - - get dataPath(): string { - return `${dataUrl}/${this.page.mode.toLowerCase()}_ranks_${this.page.brRange}.csv` - } -} - -export interface SquareInfo { - nation: Nation; - br: string; - lowerBr: number; - value: number; -} - -export interface Value2Color { - (value: number): number | string | COLORS -} diff --git a/src/plot/color-bar.ts b/src/plot/color-bar.ts deleted file mode 100644 index eb08ee2..0000000 --- a/src/plot/color-bar.ts +++ /dev/null @@ -1,122 +0,0 @@ -import * as d3 from "d3"; -import { Plot } from "./plot"; -import { BrHeatmap, Value2Color } from "./br-heatmap"; -import { Container, Inject, Provider, utils } from "../utils"; -import { Config, Margin } from "../app/config"; -import { Content } from "../app/global-env"; -import { BRHeatMapPage } from "../app/page/br-heatmap-page"; - - -@Provider(ColorBar) -export class ColorBar extends Plot { - @Inject(Config.BrHeatmapPage.ColorBar.svgHeight) readonly svgHeight: number; - @Inject(Config.BrHeatmapPage.ColorBar.svgWidth) readonly svgWidth: number; - @Inject(Config.BrHeatmapPage.ColorBar.margin) readonly margin: Margin; - @Inject(Content) readonly content: d3.Selection - @Inject(BRHeatMapPage) readonly page: BRHeatMapPage; - valueMin: number; - valueMax: number; - value2color: Value2Color; - - init(): ColorBar { - this.svg = this.content - .append("svg") - .attr("height", this.svgHeight) - .attr("width", this.svgWidth) - .attr("id", "color-bar-svg"); - - this.g = this.svg.append("g") - .attr("id", "color-bar-g") - .attr("transform", `translate(${this.margin.left}, ${this.margin.top})`); - return this; - } - - async update(valueMin: number, valueMax: number, value2color: Value2Color): Promise { - this.valueMin = valueMin; - this.valueMax = valueMax; - this.value2color = value2color; - - const scale = this.page.measurement === "battles_sum" ? "log" : "linear"; - const samples = scale === "log" - ? utils.logspace(this.valueMin, this.valueMax, 100) - : utils.linspace(this.valueMin, this.valueMax, 100); - const colors = samples.map(this.value2color); - - // remove current legend - this.g.selectAll("*").remove(); - - // append gradient bar - const gradientId = `${this.svg.attr("id")}-gradient`; - const gradient = this.g.append("defs") - .append("linearGradient") - .attr('id', gradientId) - .attr('x1', '0%') // bottom - .attr('y1', '100%') - .attr('x2', '0%') // to top - .attr('y2', '0%') - .attr('spreadMethod', 'pad'); - - // values for legend - const pct = utils.linspace(0, 100, 100).map(function(d) { - return Math.round(d) + '%'; - }); - - d3.zip(pct, colors).forEach(function([pct, scale]) { - gradient.append('stop') - .attr('offset', pct) - .attr('stop-color', scale) - .attr('stop-opacity', 1); - }); - - const legendHeight = this.height; - const legendWidth = this.width; - - this.g.append('rect') - .attr('x1', 0) - .attr('y1', 10) - .attr('width', legendWidth) - .attr('height', legendHeight) - .style('fill', `url(#${gradientId})`); - - // create a scale and axis for the legend - let legendScale; - if (scale === "log") { - legendScale = d3.scaleLog() - .domain([this.valueMin, this.valueMax]) - .range([legendHeight, 0]) - } else { - legendScale = d3.scaleLinear() - .domain([this.valueMin, this.valueMax]) - .range([legendHeight, 0]) - } - - let legendAxis = d3.axisRight(legendScale); - - if (scale === "log") { - legendAxis = legendAxis.ticks(3); - } - - legendAxis = legendAxis - .tickFormat((d: number) => { - if (scale === "log") { - return 10 + utils.formatPower(Math.round(Math.log10(d))) - } else if (this.page.measurement === "battles_sum") { - return d + "%"; - } else { - return d.toString(); - } - }); - - this.g.append("g") - .style("font-size", scale === "log" ? 12 : null) - .attr("class", "legend-axis") - .attr("transform", "translate(" + legendWidth + ", 0)") - .call(legendAxis); - - return this; - } - - get brHeatmap(): BrHeatmap { - return Container.get(BrHeatmap); - } -} \ No newline at end of file diff --git a/src/plot/legend.ts b/src/plot/legend.ts deleted file mode 100644 index 0604e7d..0000000 --- a/src/plot/legend.ts +++ /dev/null @@ -1,135 +0,0 @@ -import * as d3 from "d3"; -import { Plot } from "./plot"; -import { BrHeatmap, SquareInfo } from "./br-heatmap"; -import { Config, Localization, Margin, NationTranslator } from "../app/config"; -import { Container, Inject, Injectable, nationColors, Provider } from "../utils"; -import { nations } from "../app/global-env"; -import { Nation } from "../data/wiki-data"; - - -@Injectable -abstract class Legend extends Plot { - init(): Legend { - // build new plot in the content div of page - this.svg = this.content - .append("svg") - .attr("height", this.svgHeight) - .attr("width", this.svgWidth) - .attr("id", "legend-svg"); - this.g = this.svg.append("g") - .attr("id", "legend-g") - .attr("transform", `translate(${this.margin.left}, ${this.margin.top})`); - return this; - } -} - -@Provider(BrHeatmapLegend) -export class BrHeatmapLegend extends Legend { - @Inject(Config.BrHeatmapPage.Legend.svgHeight) readonly svgHeight: number; - @Inject(Config.BrHeatmapPage.Legend.svgWidth) readonly svgWidth: number; - @Inject(Config.BrHeatmapPage.Legend.margin) readonly margin: Margin; - - async update(): Promise { - const legends = this.g.selectAll("g") - .data(this.brHeatmap.selected, (info: SquareInfo) => info.nation + info.br); - - const height = this.height; - const brHeatmap = this.brHeatmap; - const g = this.g; - - // removed legend - legends.exit() - .each(function(d: SquareInfo, i: number) { - d3.selectAll(g.selectAll("g.legend-row").nodes().slice(i + 1)) - .each(function() { - const obj = d3.select(this); - const rect = obj.select("rect"); - const text = obj.select("text"); - rect.transition().duration(500).attr("y", +rect.attr("y") + 30); - text.transition().duration(500).attr("y", +text.attr("y") + 30); - }) - }) - .transition() - .duration(500) - .style("opacity", 0) - .remove() - - // new legend - legends.enter() - .append("g") - .classed("legend-row", true) - .each(function(d: SquareInfo, i: number) { - // add rect - d3.select(this) - .append("rect") - .classed("legend-rect", true) - .attr("x", 5) - .attr("y", height - 30 - 30 * i) - .attr("width", 20) - .attr("height", 20) - .style("fill", brHeatmap.colorPool.bindings.filter(binding => { - return binding.br === d.br && binding.nation === d.nation - })[0].color); - // add text - d3.select(this) - .append("text") - .attr("x", 35) - .attr("y", height - 15 - 30 * i) - .text(`${Container.get(Localization.Nation)(d.nation)} ${d.br}`) - .attr("text-anchor", "start") - .style("font-size", 12.5); - }) - - return this; - } - - get brHeatmap(): BrHeatmap { - return Container.get(BrHeatmap); - } - - async reset(): Promise { - this.g.html(null) - return this; - } -} - - -@Provider(StackedLineChartLegend) -export class StackedLineChartLegend extends Legend { - @Inject(Config.StackedAreaPage.Legend.svgHeight) readonly svgHeight: number; - @Inject(Config.StackedAreaPage.Legend.svgWidth) readonly svgWidth: number; - @Inject(Config.StackedAreaPage.Legend.margin) readonly margin: Margin; - - update(): Promise { - const legends = this.g.selectAll("g") - .data(nations); - - const height = this.height; - - // new legend - legends.enter() - .append("g") - .classed("legend-row", true) - .each(function(d: Nation, i: number) { - // add rect - d3.select(this) - .append("rect") - .classed("legend-rect", true) - .attr("x", 5) - .attr("y", height - 30 - 30 * i) - .attr("width", 20) - .attr("height", 20) - .style("fill", nationColors.get(d)); - // add text - d3.select(this) - .append("text") - .attr("x", 35) - .attr("y", height - 15 - 30 * i) - .text(d) - .attr("text-anchor", "start") - .style("font-size", 12.5); - }); - - return Promise.resolve(this); - } -} \ No newline at end of file diff --git a/src/plot/line-chart.ts b/src/plot/line-chart.ts deleted file mode 100644 index 59b6eda..0000000 --- a/src/plot/line-chart.ts +++ /dev/null @@ -1,520 +0,0 @@ -import * as d3 from "d3"; -import * as _ from "lodash"; -import { Plot } from "./plot"; -import { BrHeatmap, SquareInfo } from "./br-heatmap"; -import { TimeseriesData, TimeseriesRow, TimeseriesRowGetter } from "../data/timeseries-data"; -import { Container, Inject, Injectable, MousePosition, nationColors, Provider, utils, WasmUtils } from "../utils"; -import { Clazz, Mode, Scale } from "../app/options"; -import { Config, Localization, Margin, MeasurementTranslator, NationTranslator } from "../app/config"; -import { dataUrl, nations } from "../app/global-env"; -import { BRHeatMapPage } from "../app/page/br-heatmap-page"; -import { StackedAreaPage } from "../app/page/stacked-area-page"; -import { Nation } from "../data/wiki-data"; -import { StackedLineChartLegend } from "./legend"; -import { LineChartTooltip, Tooltip } from "./tooltip"; -import { Application } from "../app/application"; - - -@Injectable -export abstract class LineChart extends Plot { - init(): LineChart { - // build new plot in the content div of page - this.svg = this.content - .append("svg") - .attr("height", this.svgHeight) - .attr("width", this.svgWidth) - .attr("id", "line-chart-svg"); - this.g = this.svg.append("g") - .attr("id", "line-chart-g") - .attr("transform", `translate(${this.margin.left}, ${this.margin.top})`); - return this; - } -} - - -@Provider(BrLineChart) -export class BrLineChart extends LineChart { - @Inject(Config.BrHeatmapPage.BrLineChart.svgHeight) readonly svgHeight: number; - @Inject(Config.BrHeatmapPage.BrLineChart.svgWidth) readonly svgWidth: number; - @Inject(Config.BrHeatmapPage.BrLineChart.margin) readonly margin: Margin; - @Inject(BRHeatMapPage) readonly page: BRHeatMapPage; - @Inject(LineChartTooltip) readonly tooltip: Tooltip; - selected: Array | null = null; - selectedDate: number; - xAxis: d3.ScaleTime; - readonly allDates = Application.dates.map(utils.parseDate).map(date => date.getTime()).reverse(); - - onPointerLeave(_: SquareInfo, _2: SVGSVGElement): void { - this.tooltip.hide(); - } - - onPointerOver(_: SquareInfo, _2: SVGSVGElement): void { - if (this.selected?.length > 0) { - this.tooltip.appear(); - } else { - this.tooltip.hide(); - } - } - - async onPointerMove(_d: SquareInfo, node: SVGSVGElement): Promise { - const mousePos = new MousePosition( - d3.mouse(node)[0], - d3.mouse(node)[1] - ); - if (this.xAxis === undefined) { - return; - } - const xValue = this.xAxis.invert(mousePos.x - this.margin.left); - this.selectedDate = utils.findClosest(this.allDates, xValue.getTime()); - await this.tooltip.update(this.selected!.map(dataObj => - `${Container.get(Localization.Nation)(dataObj.nation)} ` + - `${dataObj.br}: ${_.round(dataObj.values.find(value => value.date.getTime() === this.selectedDate)?.value, 3)}` - ), mousePos); - } - - init(): LineChart { - super.init(); - this.tooltip.init(); - this.svg.on("pointerover", utils.eventWrapper(this, this.onPointerOver)); - this.svg.on("pointermove", utils.eventWrapper(this, this.onPointerMove)); - this.svg.on("pointerleave", utils.eventWrapper(this, this.onPointerLeave)); - return this; - } - - async update(): Promise { - const oldXAxis = this.g.selectAll(".x-axis"); - const oldYAxis = this.g.selectAll(".y-axis"); - - const data = this.brHeatmap.cache; - // const dataObjs: Array = this.groupBy(this.extractData(data)); - const dataObjs = this.groupBy(WasmUtils.extractData(data, this.brHeatmap.selected, this.page.clazz, this.page.mode, this.page.measurement)); - this.selected = dataObjs; - - // x axis - const x = d3.scaleUtc() - .domain(d3.extent(data, d => utils.parseDate(d.date))) - .range([0, this.width]); - this.xAxis = x; - - // generate sticks - this.g.append("g") - .classed("x-axis", true) - .attr("transform", `translate(0, ${this.height})`) - .style("font-size", 9) - .call(d3.axisBottom(x) - .tickFormat(d3.timeFormat('%y/%m'))); - - // add x label - this.g.append("text") - .classed("x-axis", true) - .text(Container.get(Localization.BrHeatmapPage.BrLineChart.date)) - .attr("transform", `translate(${this.width / 2}, ${this.height + 30})`) - .style("font-size", 12) - .style("text-anchor", "middle"); - - oldXAxis.remove(); - - // y axis - const yValues: Array = _.flatMap(dataObjs, obj => obj.values).map(row => +row.value); - const yMax = this.page.measurement === "win_rate" - ? Math.min(_.max(yValues) * 1.02, 100) - : _.max(yValues) * 1.02; - const yMin = this.page.measurement === "win_rate" - ? Math.max(_.min(yValues) * 0.98, 0) - : _.min(yValues) * 0.98; - const y = d3.scaleLinear() - .domain([yMin, yMax]) - .range([this.height, 0]); - // generate sticks - this.g.append("g") - .classed("y-axis", true) - .call(d3.axisLeft(y)); - - // add y label - this.g.append("text") - .classed("y-axis", true) - .text(Container.get(Localization.Measurement)(this.page.measurement)) - .attr("transform", `translate(${-30}, ${this.height / 2}) rotate(270)`) - .style("font-size", 12) - .style("text-anchor", "middle"); - - oldYAxis.remove(); - - const line = d3.line<{ date: Date, value: number }>() - .x(function(d) { - return x(d.date) - }) - .y(function(d) { - return y(d.value) - }) - - // add lines - let paths: d3.Selection; - if (this.g.selectAll("#line-chart-path-g").size() > 0) { - paths = this.g.select("#line-chart-path-g") - .selectAll("path") - .data(dataObjs, (d: BrLineChartDataObj) => d.nation + d.br); - } else { - paths = this.g.append("g") - .attr("id", "line-chart-path-g") - .style("fill", "None") - .selectAll("path") - .data(dataObjs, (d: BrLineChartDataObj) => d.nation + d.br); - } - - // remove lines for removed selection - paths.exit().transition() - .duration(500) - .style("opacity", 0) - .remove(); - - // shift the lines with re-adjusted y-axis range - paths.transition() - .duration(500) - .attr("d", (d: BrLineChartDataObj) => line(d.values)) - .attr("stroke", d => this.brHeatmap.colorPool.get(d)); - - // add lines for new selected data - paths.enter() - .append("path") - .style("opacity", 0) - .style("stroke-width", 3) - .transition() - .duration(500) - .style("opacity", 1) - .attr("d", (d: BrLineChartDataObj) => line(d.values)) - .attr("stroke", (d: BrLineChartDataObj) => this.brHeatmap.colorPool.get(d)); - - return this; - } - - get brHeatmap(): BrHeatmap { - return Container.get(BrHeatmap); - } - - reset(): BrLineChart { - this.g.html(null); - return this; - } - - // private extractData(data: Array): BrLineChartData { - // const results = data.filter(row => { - // const get = new TimeseriesRowGetter(row, this.page.mode, this.page.measurement); - // return this.brHeatmap.selected.some( - // info => info.nation === row.nation - // && info.br === get.br - // && this.page.clazz === row.cls - // ) - // }).map(row => { - // const get = new TimeseriesRowGetter(row, this.page.mode, this.page.measurement); - // return { - // date: utils.parseDate(row.date), - // nation: row.nation, - // br: get.br, - // value: get.value - // } - // }); - // return results; - // } - - private groupBy(data: BrLineChartData): Array { - const result: Array = []; - for (const row of data) { - // if there is an existed category - if (result.filter(category => category.br === row.br && category.nation === row.nation).length > 0) { - for (const category of result) { - if (category.br === row.br && category.nation === row.nation) { - category.values.push({ - date: row.date, - value: row.value - }); - break - } - } - } else { - // if no category for this item - result.push({ - br: row.br, - nation: row.nation, - values: [{ - date: row.date, - value: row.value - }] - }) - } - } - - // remove 0 values - return result.map(category => { - category.values = category.values.filter(row => row.value > 0); - return category; - }); - } -} - -export type BrLineChartData = Array; - -interface BrLineChartRow { - date: Date; - br: string; - nation: Nation; - value: number; -} - -export interface BrLineChartDataObj { - br: string; - nation: Nation; - values: Array<{ date: Date, value: number }> -} - -@Provider(StackedLineChart) -export class StackedLineChart extends LineChart { - @Inject(Config.StackedAreaPage.StackedLineChart.svgHeight) readonly svgHeight: number; - @Inject(Config.StackedAreaPage.StackedLineChart.svgWidth) readonly svgWidth: number; - @Inject(Config.StackedAreaPage.StackedLineChart.margin) readonly margin: Margin; - @Inject(StackedLineChartLegend) readonly legend: StackedLineChartLegend; - @Inject(StackedAreaPage) readonly page: StackedAreaPage; - readonly measurement = "battles_sum"; - - dataCache: Array = []; - x: d3.ScaleTime; - - init(): StackedLineChart { - super.init(); - - d3.csv(this.dataPath, async (data: TimeseriesData) => { - const dataObjs: Array = this.groupBy(this.extractData(data)); - const stacks = d3.stack() - .keys(nations)(dataObjs); - - this.dataCache.push({clazz: this.page.clazz, data: stacks, mode: this.page.mode, scale: this.page.scale}); - - // x axis - this.x = d3.scaleUtc() - .domain(d3.extent(data, d => utils.parseDate(d.date))) - .range([0, this.width]); - - // generate sticks - this.g.append("g") - .classed("x-axis", true) - .attr("transform", `translate(0, ${this.height})`) - .call(d3.axisBottom(this.x) - .tickFormat(d3.timeFormat('%Y/%m'))); - - // add x label - this.g.append("text") - .classed("x-axis", true) - .text(Container.get(Localization.StackedAreaPage.StackedLineChart.date)) - .attr("transform", `translate(${this.width / 2}, ${this.height + 30})`) - .style("font-size", 12) - .style("text-anchor", "middle"); - const y = this.setYAxis(stacks); - - // init subplots - this.legend.init(); - - // add area - const area = this.getArea(this.x, y); - - // init areas - const areas = this.g.append("g") - .classed("stacked-area", true) - .selectAll() - .data(stacks); - - areas.enter() - .append("path") - .attr("fill", ({key}) => nationColors.get(key)) - .attr("d", area) - .style("stroke", "black"); - - this.updateSubPlots().then(); - }) - - return this; - } - - async update(): Promise { - const oldYAxis = this.g.selectAll(".y-axis"); - // get data from cache or download - const stacks = await this.searchInCache(); - - // update y axis - const y = this.setYAxis(stacks); - oldYAxis.remove(); - - // update subplots - await this.updateSubPlots() - - // add area - const area = this.getArea(this.x, y); - - // update areas - const areas = this.g.select("g.stacked-area") - .selectAll("path") - .data(stacks); - - areas.transition() - .duration(500) - .attr("d", area); - - return this; - } - - private getArea(x: d3.ScaleTime, y: d3.ScaleLinear) { - return d3.area<{ 0: number, 1: number, data: StackedLineChartDataObj }>() - .x(d => x(d.data.date)) - .y0(d => y(d[0])) - .y1(d => y(d[1])); - } - - private setYAxis(stacks: Array>) { - // y axis - const yMax = this.page.scale === "value" ? d3.max(stacks[nations.length - 1], d => d[1]) : 1; - const yMin = 0; - - const y = d3.scaleLinear() - .domain([yMin, yMax]) - .range([this.height, 0]); - // generate sticks - this.g.append("g") - .classed("y-axis", true) - .call(d3.axisLeft(y)); - - // add y label - this.g.append("text") - .classed("y-axis", true) - .text(Container.get(Localization.StackedAreaPage.StackedLineChart.battles)) - .attr("transform", `translate(${-60}, ${this.height / 2}) rotate(270)`) - .style("font-size", 12) - .style("text-anchor", "middle"); - return y; - } - - private async searchInCache(): Promise>> { - // search dataObj in cache - for (const cache of this.dataCache) { - if (this.page.clazz === cache.clazz - && this.page.mode === cache.mode - && this.page.scale === cache.scale - ) { - return cache.data; - } - } - // else generate a new cache - return new Promise(resolve => { - d3.csv(this.dataPath, (data: TimeseriesData) => { - const dataObjs = this.groupBy(this.extractData(data)); - const stacks = d3.stack() - .keys(nations)(dataObjs); - this.dataCache.push({ - clazz: this.page.clazz, - mode: this.page.mode, - scale: this.page.scale, - data: stacks - }); - resolve(stacks); - }) - }); - } - - private extractData(data: Array): StackedLineChartData { - return data - .filter(row => row.cls === this.page.clazz) - .map(row => { - const get = new TimeseriesRowGetter(row, this.page.mode, this.measurement); - return { - date: utils.parseDate(row.date), - nation: row.nation, - value: get.value - } - }); - } - - private groupBy(data: StackedLineChartData): Array { - const dataMap: Map = new Map(); - data.forEach((row: StackedLineChartRow) => { - const dateStr = row.date.toString(); - if (dataMap.has(dateStr)) { - dataMap.get(dateStr)[row.nation] = row.value; - } else { - const newObj: StackedLineChartDataObj = { - Britain: 0, - China: 0, - France: 0, - Germany: 0, - Italy: 0, - Israel: 0, - Japan: 0, - Sweden: 0, - USA: 0, - USSR: 0, - date: row.date - }; - newObj[row.nation] = row.value; - dataMap.set(dateStr, newObj); - } - }); - // scale as percentage if the option is chosen - const dataObjs = Array.from(dataMap.values()); - switch (this.page.scale) { - case "value": - return dataObjs; - case "percentage": - return dataObjs.map(({Britain, China, France, Germany, Italy, Israel, Japan, Sweden, USA, USSR, date}) => { - const s = _.sum([Britain, China, France, Germany, Italy, Israel, Japan, Sweden, USA, USSR]); - return { - Britain: Britain / s, - China: China / s, - France: France / s, - Germany: Germany / s, - Italy: Italy / s, - Israel: Israel / s, - Japan: Japan / s, - Sweden: Sweden / s, - USA: USA / s, - USSR: USSR / s, - date: date - } - }); - } - } - - async updateSubPlots() { - await this.legend.update(); - } - - get dataPath(): string { - return `${dataUrl}/${this.page.mode.toLowerCase()}_ranks_all.csv` - } -} - - -interface StackedLineChartCache { - clazz: Clazz; - mode: Mode; - scale: Scale; - data: Array>; -} - -type StackedLineChartData = Array; - -interface StackedLineChartRow { - date: Date; - nation: Nation; - value: number; -} - -interface StackedLineChartDataObj { - date: Date; - USA: number; - Germany: number; - USSR: number; - Britain: number; - Japan: number; - France: number; - Italy: number; - China: number; - Sweden: number; - Israel: number -} diff --git a/src/plot/plot.ts b/src/plot/plot.ts deleted file mode 100644 index 4bc66cf..0000000 --- a/src/plot/plot.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as d3 from "d3"; -import { Inject, Injectable } from "../utils"; -import { Margin } from "../app/config"; -import { Content } from "../app/global-env"; - -@Injectable -export abstract class Plot { - readonly svgHeight: number; - readonly svgWidth: number; - readonly margin: Margin; - @Inject(Content) readonly content: d3.Selection - svg: d3.Selection - g: d3.Selection - - abstract init(...args: any[]): Plot; - - abstract update(...args: any[]): Promise; - - get width() { - return this.svgWidth - this.margin.left - this.margin.right; - } - - get height() { - return this.svgHeight - this.margin.top - this.margin.bottom; - } -} diff --git a/src/plot/table.ts b/src/plot/table.ts deleted file mode 100644 index 819d6f0..0000000 --- a/src/plot/table.ts +++ /dev/null @@ -1,180 +0,0 @@ -import { Plot } from "./plot"; -import { BrHeatmap, SquareInfo, Value2Color } from "./br-heatmap"; -import * as d3 from "d3"; -import { JoinedData, JoinedRow, JoinedRowGetter } from "../data/joined-data"; -import * as _ from "lodash"; -import { COLORS, Container, Inject, nationColors, Provider, utils } from "../utils"; -import { Content, dataUrl } from "../app/global-env"; -import { BRHeatMapPage } from "../app/page/br-heatmap-page"; -import { TabulatorFull as Tabulator } from 'tabulator-tables'; -import "tabulator-tables/dist/css/tabulator.min.css"; - -@Provider(Table) -export class Table extends Plot { - table: d3.Selection - @Inject(Content) readonly content: d3.Selection - @Inject(BRHeatMapPage) page: BRHeatMapPage; - cache: Map = new Map(); - winRateValue2color: Value2Color | null = null - tabulator: Tabulator | null = null - downloadButton: d3.Selection | null = null; - - init(): Table { - this.table = this.content - .append("div") - .attr("id", "selected-table-div") - .append("table") - .attr("id", "selected-table"); - - this.downloadButton = d3.select("#selected-table-div") - .append("button") - .html("Export to CSV") - .on("click", () => this.tabulator?.download("csv", `data.csv`)) - .style("visibility", "hidden") - return this; - } - - async searchInCache(): Promise { - const key = this.page.date; - if (this.cache.has(key)) { - return this.cache.get(key); - } else { - return new Promise(resolve => d3.csv(this.dataPath, (data: JoinedData) => { - this.cache.set(key, data); - resolve(data); - })); - } - } - - async update(): Promise { - // remove previous - this.reset(); - - const clazz = this.page.clazz; - const brRange = +this.page.brRange; - const data = await this.searchInCache(); - // filter the data - const filtered = this.brHeatmap.selected.map((selected: SquareInfo) => { - const lowerBr = selected.lowerBr; - const nation = selected.nation; - - return data.filter(d => { - // filter br - const get = new JoinedRowGetter(d, this.page.mode); - const br = get.br; - const filterBr = () => br <= lowerBr + brRange && br >= lowerBr; - // filter nation - const filterNation = () => d.nation === nation; - // filter class - const filterClass = () => d.cls === clazz; - return filterBr() && filterNation() && filterClass(); - }) - }).flat(); - - // select columns with selected mode - const tableData = this.selectColumns(_.uniqBy(filtered, d => d.name)); - this.tabulator = new Tabulator("#selected-table", { - data: tableData, - layout: "fitColumns", - columns: [ - {title: "ts_name", field: "ts_name"}, - {title: "wk_name", field: "wk_name"}, - { - title: "nation", field: "nation", maxWidth: 80, formatter: cell => { - const value = cell.getValue(); - const element = cell.getElement(); - const color = nationColors.get(value); - element.style.backgroundColor = color; - element.style.color = utils.genTextColorFromBgColor(color); - return value; - } - }, - {title: "class", field: "class", maxWidth: 120}, - {title: "br", field: "br", maxWidth: 50}, - {title: "battles", field: "battles", maxWidth: 85}, - { - title: "win_rate", field: "win_rate", maxWidth: 95, formatter: cell => { - const value = cell.getValue(); - const element = cell.getElement(); - const color = utils.rgbToHex(this.winRateValue2color(value) as string); - element.style.backgroundColor = color; - element.style.color = utils.genTextColorFromBgColor(color); - return value; - } - }, - {title: "air_frags_per_battle", field: "air_frags_per_battle"}, - {title: "air_frags_per_death", field: "air_frags_per_death"}, - {title: "ground_frags_per_battle", field: "ground_frags_per_battle"}, - {title: "ground_frags_per_death", field: "ground_frags_per_death"}, - { - title: "premium", field: "is_premium", maxWidth: 99, formatter: (cell) => { - const value = cell.getValue(); - if (value === "True") { - cell.getElement().style.backgroundColor = COLORS.YELLOW; - } - return value; - } - }, - {title: "rp_rate", field: "rp_rate", maxWidth: 84}, - {title: "sl_rate", field: "sl_rate", maxWidth: 80}, - ] - }) - - this.downloadButton.style("visibility", "visible"); - return this; - } - - reset(): Table { - // remove previous - this.table.html(null); - return this; - } - - selectColumns(data: JoinedData): Array { - const mode = this.page.mode; - return data.map((d: JoinedRow) => { - const get = new JoinedRowGetter(d, mode) - return { - ts_name: d.name, - wk_name: d.wk_name, - nation: d.nation, - "class": d.cls, - br: get.br, - battles: get.battles, - win_rate: get.winRate, - air_frags_per_battle: get.airFragsPerBattle, - air_frags_per_death: get.airFragsPerDeath, - ground_frags_per_battle: get.groundFragsPerBattle, - ground_frags_per_death: get.groundFragsPerDeath, - is_premium: d.is_premium, - rp_rate: get.rpRate, - sl_rate: get.slRate - } - }) - } - - get brHeatmap(): BrHeatmap { - return Container.get(BrHeatmap); - } - - get dataPath(): string { - return `${dataUrl}/joined/${this.page.date}.csv`; - } -} - -export interface TableRow { - ts_name: string - wk_name: string - nation: string - "class": string - br: number - battles: number - win_rate: number - air_frags_per_battle: number - air_frags_per_death: number - ground_frags_per_battle: number - ground_frags_per_death: number - is_premium: boolean - rp_rate: number - sl_rate: number -} \ No newline at end of file diff --git a/src/plot/tooltip.ts b/src/plot/tooltip.ts deleted file mode 100644 index 203bb7f..0000000 --- a/src/plot/tooltip.ts +++ /dev/null @@ -1,194 +0,0 @@ -import * as d3 from "d3"; -import * as _ from "lodash"; -import { Container, Inject, Injectable, MousePosition, Provider } from "../utils"; -import { Plot } from "./plot"; -import { Config } from "../app/config"; -import { BrLineChart, LineChart } from "./line-chart"; - - -@Injectable -export abstract class Tooltip extends Plot { - readonly parentSvgId: string; - readonly opacity: number; - readonly nRow: number; - readonly rectWidth: number; - readonly rectXBias: number; - readonly rectYBias: number; - readonly textXBias: number; - readonly textYBias: number; - readonly leftShiftXThreshold: number; - readonly downShiftYThreshold: number; - readonly leftShiftOffset: number; - readonly downShiftOffset: number; - - parentSvg: d3.Selection; - g: d3.Selection; - rect: d3.Selection; - text: d3.Selection; - - init(): Tooltip { - // select parent svg - this.parentSvg = d3.select("#" + this.parentSvgId); - - // init tooltip g element - this.g = this.parentSvg.append("g") - .attr("class", "tooltip") - .style("opacity", 0) - .style("pointer-events", "none"); - - // init tooltip rect background - this.rect = this.g.append("rect") - .attr("class", "tooltip-rect") - .attr("height", 5 + this.nRow * 15) - .attr("width", this.rectWidth) - .attr("fill", "white") - .style("stroke", "black") - .style("opacity", this.opacity) - .attr("rx", "5px") - .attr("ry", "5px"); - - // init tooltip text - this.text = this.g.append("text") - .attr("class", "tooltip-text") - .style("font-size", 12) - .style("opacity", 0.9); - - // generate tspan for each text row - _.range(this.nRow) - .map((n) => this.text.append("tspan").attr("class", `tooltip-text-row${n}`)); - return this; - } - - // move the tooltip to the top layer of parent svg. - toTopLayer(): Tooltip { - this.parentSvg.node().appendChild(this.g.node()); - return this; - } - - // update rect - updateRect(mousePos: MousePosition): Tooltip { - const x = mousePos.x < this.leftShiftXThreshold - ? mousePos.x + this.rectXBias + this.leftShiftOffset - : mousePos.x + this.rectXBias; - const y = mousePos.y < this.downShiftYThreshold - ? mousePos.y + this.rectYBias + this.downShiftOffset - : mousePos.y + this.rectYBias; - this.rect.attr("x", x).attr("y", y); - return this; - } - - // update text with new position and new string - updateText(textArr: Array, mousePos: MousePosition): Tooltip { - textArr.forEach((line, i) => { - const x = mousePos.x < this.leftShiftXThreshold - ? this.textXBias + mousePos.x + this.leftShiftOffset - : this.textXBias + mousePos.x - const y = mousePos.y < this.downShiftYThreshold - ? this.textYBias + mousePos.y + 15 * i + this.downShiftOffset - : this.textYBias + mousePos.y + 15 * i; - this.text - .select(`.tooltip-text-row${i}`) - .text(line) - .attr("x", x + "px") - .attr("y", y + "px") - .attr("text-anchor", "left"); - }); - - _.range(textArr.length, this.nRow).forEach((i) => { - this.text.select(`.tooltip-text-row${i}`).text(""); - }) - return this; - } - - async update(textArr: Array, mousePos: MousePosition): Promise { - this.updateRect(mousePos); - this.updateText(textArr, mousePos); - return this; - } - - hide(): Tooltip { - this.g.style("opacity", 0); - return this; - } - - appear(): Tooltip { - this.g.style("opacity", 1); - return this; - } -} - - -@Provider(BrHeatmapTooltip) -export class BrHeatmapTooltip extends Tooltip { - @Inject(Config.BrHeatmapPage.Tooltip.parentSvgId) readonly parentSvgId: string; - @Inject(Config.BrHeatmapPage.Tooltip.opacity) readonly opacity: number; - @Inject(Config.BrHeatmapPage.Tooltip.nRow) readonly nRow: number; - @Inject(Config.BrHeatmapPage.Tooltip.rectWidth) readonly rectWidth: number; - @Inject(Config.BrHeatmapPage.Tooltip.rectXBias) readonly rectXBias: number; - @Inject(Config.BrHeatmapPage.Tooltip.rectYBias) readonly rectYBias: number; - @Inject(Config.BrHeatmapPage.Tooltip.textXBias) readonly textXBias: number; - @Inject(Config.BrHeatmapPage.Tooltip.textYBias) readonly textYBias: number; - @Inject(Config.BrHeatmapPage.Tooltip.leftShiftXThreshold) readonly leftShiftXThreshold: number; - @Inject(Config.BrHeatmapPage.Tooltip.downShiftYThreshold) readonly downShiftYThreshold: number; - @Inject(Config.BrHeatmapPage.Tooltip.leftShiftOffset) readonly leftShiftOffset: number; - @Inject(Config.BrHeatmapPage.Tooltip.downShiftOffset) readonly downShiftOffset: number; -} - -@Provider(LineChartTooltip) -export class LineChartTooltip extends Tooltip { - @Inject(Config.BrHeatmapPage.LineChartTooltip.parentSvgId) readonly parentSvgId: string; - @Inject(Config.BrHeatmapPage.LineChartTooltip.opacity) readonly opacity: number; - @Inject(Config.BrHeatmapPage.LineChartTooltip.nRow) readonly nRow: number; - @Inject(Config.BrHeatmapPage.LineChartTooltip.rectWidth) readonly rectWidth: number; - @Inject(Config.BrHeatmapPage.LineChartTooltip.rectXBias) readonly rectXBias: number; - @Inject(Config.BrHeatmapPage.LineChartTooltip.rectYBias) readonly rectYBias: number; - @Inject(Config.BrHeatmapPage.LineChartTooltip.textXBias) readonly textXBias: number; - @Inject(Config.BrHeatmapPage.LineChartTooltip.textYBias) readonly textYBias: number; - @Inject(Config.BrHeatmapPage.LineChartTooltip.leftShiftXThreshold) readonly leftShiftXThreshold: number; - @Inject(Config.BrHeatmapPage.LineChartTooltip.downShiftYThreshold) readonly downShiftYThreshold: number; - @Inject(Config.BrHeatmapPage.LineChartTooltip.leftShiftOffset) readonly leftShiftOffset: number; - @Inject(Config.BrHeatmapPage.LineChartTooltip.downShiftOffset) readonly downShiftOffset: number; - - line: d3.Selection; - - init(): Tooltip { - super.init(); - this.line = this.g.append("line") - .classed("tooltip", true) - .classed("tooltip-line", true) - .attr("y1", 0) - .attr("y2", this.parent.height) - .attr("x1", 150) - .attr("x2", 150) - .style("stroke", "black") - .style("opacity", 0); - return this; - } - - async update(textArr: Array, mousePos: MousePosition): Promise { - await super.update(textArr, mousePos); - const newRow = textArr.length; - this.rect.attr("height", 5 + newRow * 15); - this.g.attr("transform", `translate(0, ${-15 * newRow + 20})`); - this.line.attr("transform", `translate(0, ${15 * newRow - 10})`) - this.line.attr("x1", mousePos.x + this.rectXBias + 163) - .attr("x2", mousePos.x + this.rectXBias + 163); - return this; - } - - get parent(): LineChart { - return Container.get(BrLineChart); - } - - hide(): Tooltip { - super.hide(); - this.line.style("opacity", 0); - return this; - } - - appear(): Tooltip { - super.appear(); - this.line.style("opacity", 1); - return this; - } -} diff --git a/src/utils.ts b/src/utils.ts deleted file mode 100644 index 9aab82a..0000000 --- a/src/utils.ts +++ /dev/null @@ -1,416 +0,0 @@ -import * as d3 from "d3"; -import { buildProviderModule, fluentProvide, provide } from "inversify-binding-decorators"; -import { interfaces, interfaces as inversifyInterfaces } from "inversify/lib/interfaces/interfaces"; -import { Container as InvContainer, inject, injectable } from "inversify"; -import { Nation } from "./data/wiki-data"; -import * as _ from "lodash"; -import { Clazz, Measurement, Mode } from "./app/options"; -import { SquareInfo } from "./plot/br-heatmap"; -import { TimeseriesData, TimeseriesRowGetter } from "./data/timeseries-data"; -import { BrLineChartData } from "./plot/line-chart"; - -export namespace utils { - export function getSelectedValue(id: string): T { - return (document.getElementById(id)).value; - } - - export const setEvent = { - byIds(...elementIds: Array) { - const elements = elementIds.map(id => document.getElementById(id)); - return { - onchange: (event: () => void) => { - return elements.forEach(element => element.onchange = event) - } - } - }, - - byClass(className: string) { - const elements = >Array.from(document.getElementsByClassName(className)); - return { - onchange: (event: () => void) => { - return elements.forEach(element => element.onchange = event) - } - } - } - } - - export function isNotNull(x: any) { - return x !== null && x !== undefined; - } - - export function linspace(start: number, end: number, n: number) { - const out = []; - const delta = (end - start) / (n - 1); - - let i = 0; - while (i < (n - 1)) { - out.push(start + (i * delta)); - i++; - } - - out.push(end); - return out; - } - - export function logspace(start: number, end: number, n: number) { - start = Math.log10(start); - end = Math.log10(end); - const samples = this.linspace(start, end, n); - return samples.map((x: number) => 10 ** x); - } - - export function formatPower(d: number) { - const prefix = d < 0 ? "⁻" : ""; - const number = (d + "").split("").map(function (c: string) { - return "⁰¹²³⁴⁵⁶⁷⁸⁹"[+c]; - }).join(""); - return prefix + number; - } - - export function rgbToHex(rgb: string) { - // rgb(x, y, z) - const color = rgb.match(/\d+/g); - let hex = "#"; - - if (color === null && rgb.startsWith("#")) { - return rgb; - } - for (let i = 0; i < 3; i++) { - hex += ("0" + Number(color[i]).toString(16)).slice(-2); - } - return hex; - } - - export const parseDate = d3.timeParse("%Y-%m-%d") - - // an implementation for deep copy - export function deepCopy>(obj: T): T { - if (Array.isArray(obj)) { - const newArr: Array = []; - obj.forEach(value => { - newArr.push(this.deepCopy(value)); - }) - return newArr; - } else if (typeof obj === "object") { - const newObj: any = {}; - Object.entries(obj).forEach(([key, value]) => { - newObj[key] = this.deepCopy(value); - }) - return newObj; - } else { - return obj; - } - } - - // find closest value in ordered array - // using binary search - export function findClosest(array: Array, target: number): number { - const n = array.length; - - if (target <= array[0]) - return array[0]; - if (target >= array[n - 1]) - return array[n - 1]; - - function getClosest(val1: number, val2: number) { - if (target - val1 >= val2 - target) - return val2; - else - return val1; - } - - // Doing binary search - let low = 0, high = n, mid = 0; - while (low < high) { - mid = Math.floor((low + high) / 2) - if (array[mid] === target) - return array[mid]; - if (target < array[mid]) { - if (mid > 0 && target > array[mid - 1]) - return getClosest(array[mid - 1], array[mid]); - high = mid; - } else { - if (mid < n - 1 && target < array[mid + 1]) - return getClosest(array[mid], array[mid + 1]); - low = mid + 1; - } - } - return array[mid]; - } - - export function eventWrapper void | Promise>(thisBinding: unknown, cb: T): (this: S, d: SquareInfo, i: number, n: S[]) => void { - return (d, i, n) => - // https://stackoverflow.com/questions/27746304/how-to-check-if-an-object-is-a-promise/27760489#27760489 - Promise.resolve((cb.bind(thisBinding) as T)(d, n[i])).then(() => { - }); - } - - // https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb - function hexToRgb(hex: string) { - // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") - const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; - hex = hex.replace(shorthandRegex, function(m, r, g, b) { - return r + r + g + g + b + b; - }); - - const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); - return result ? { - r: parseInt(result[1], 16), - g: parseInt(result[2], 16), - b: parseInt(result[3], 16) - } : null; - } - - function color2brightness(hex: string): number { - const rgb = hexToRgb(hex); - return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000; - } - - export function genTextColorFromBgColor(bgColor: string): string { - return color2brightness(bgColor) > 125 ? "black" : "white"; - } -} - -export enum COLORS { - GREEN = "#C3E88D", - YELLOW = "#FFCB6B", - RED = "#F07178", - BLUE = "#82AAFF", - PURPLE = "#C792EA", - ORANGE = "#F78C6C", - AZURE = "#467CDA", - SKY = "#89DDFF", - BLACK = "#2B2B2B", - GRAY = "#616161", - WHITE = "#EEFFFF", - BLANK = "#FFFFFF" -} - -export const categoricalColors = [ - COLORS.GREEN, COLORS.YELLOW, COLORS.RED, COLORS.BLUE, - COLORS.PURPLE, COLORS.ORANGE, COLORS.AZURE, COLORS.SKY, - COLORS.GRAY -]; - -export const nationColors: Map = new Map(>Object.entries({ - Britain: COLORS.BLUE, - China: COLORS.ORANGE, - France: COLORS.AZURE, - Germany: COLORS.GRAY, - Italy: COLORS.GREEN, - Israel: COLORS.BLACK, - Japan: COLORS.PURPLE, - Sweden: COLORS.YELLOW, - USA: COLORS.SKY, - USSR: COLORS.RED -})) - -// Colors for continuous values -export enum CONT_COLORS { - RED = "#D11141", - YELLOW = "#FFC425", - GREEN = "#00b159", - BLACK = "#2B2B2B", - WHITE = "#FFFFFF" -} - -export enum CONT_COLORS_BLIND { - RED = "#F05039", - YELLOW = "#E57A77", - GREEN = "#1F449C", - BLACK = "#2B2B2B", - WHITE = "#FFFFFF" -} - -export class MousePosition { - x: number; - y: number; - - constructor(x: number, y: number) { - this.x = x; - this.y = y; - } -} - -// IOC containers -export function Singleton(serviceIdentifier: inversifyInterfaces.ServiceIdentifier) { - return fluentProvide(serviceIdentifier).inSingletonScope().done(); -} - -export const Provider = provide; -export const Inject = inject; -export const Injectable = injectable(); - - -export class Container { - static container: InvContainer = new InvContainer(); - - static importProvider() { - Container.container.load(buildProviderModule()); - } - - static get(serviceIdentifier: interfaces.ServiceIdentifier): T { - return Container.container.get(serviceIdentifier); - }; - - static rebind(serviceIdentifier: interfaces.ServiceIdentifier): interfaces.BindingToSyntax { - return Container.container.rebind(serviceIdentifier); - }; - - static unbind(serviceIdentifier: interfaces.ServiceIdentifier): void { - return Container.container.unbind(serviceIdentifier); - }; - - static bind(serviceIdentifier: interfaces.ServiceIdentifier): interfaces.BindingToSyntax { - return Container.container.bind(serviceIdentifier); - } -} - -// object chain map and forEach -interface ObjGetter { - (...layers: Array): any -} - -interface ChainMapLayer { - (...getValues: Array): Array> -} - -export class ObjChainMap { - readonly getObj: Array = []; - - get length(): number { - return this.getObj.length; - } - - addLayer(getter: ObjGetter) { - this.getObj.push(getter); - return this; - } - - static chainMapLayer2(getValue0: ObjGetter): Array> { - return Object.keys(getValue0()).map(layer1 => { - return [layer1] - }) - } - - static chainMapLayer3(getValue0: ObjGetter, getValue1: ObjGetter): Array> { - return ObjChainMap.chainMapLayer2(getValue0).map(([layer1]) => { - return Object.keys(getValue1(layer1)).map(layer2 => { - return [layer1, layer2] - }) - }).flat(1) - } - - static chainMapLayer4(getValue0: ObjGetter, getValue1: ObjGetter, getValue2: ObjGetter): Array> { - return ObjChainMap.chainMapLayer3(getValue0, getValue1).map(([layer1, layer2]) => { - return Object.keys(getValue2(layer1, layer2)).map(layer3 => { - return [layer1, layer2, layer3] - }); - }).flat(1) - } - - static objChainMapFunc: { [length: number]: ChainMapLayer } = { - 2: ObjChainMap.chainMapLayer2, - 3: ObjChainMap.chainMapLayer3, - 4: ObjChainMap.chainMapLayer4 - } - - getKVs() { - let values; - if (this.length <= 1) { - throw Error("Number of layers should >= 2"); - } else { - const chainMapLayer = ObjChainMap.objChainMapFunc[this.length]; - values = chainMapLayer(...this.getObj) - .map(layers => [layers, this.getObj[this.length - 1](...layers)]) - } - return values; - } - - map(func: (layers: Array, value: T) => T): Array { - return this.getKVs().map(([layers, value]) => func(layers, value)) - } - - forEach(func: (layers: Array, value: T) => T): void { - this.getKVs().forEach(([layers, value]) => func(layers, value)) - } -} - -export class WasmUtils { - static wasm: { - extract_data(data_cls: Uint8Array, data_nation: Uint8Array, data_br: Float32Array, - selected_nation: Uint8Array, selected_br: Float32Array, clazz: number): Uint32Array; - }; - - static async init() { - WasmUtils.wasm = await import("wasm-utils"); - } - - static clazz2int(clazz: Clazz): number { - return +(clazz === "Aviation"); - } - - static nation2int(nation: Nation): number { - switch (nation) { - case "USA": - return 0; - case "Germany": - return 1; - case "USSR": - return 2; - case "Britain": - return 3; - case "Japan": - return 4; - case "France": - return 5; - case "Italy": - return 6; - case "China": - return 7; - case "Sweden": - return 8; - case "Israel": - return 9; - } - } - - static measurement2int(measurement: Measurement): number { - switch (measurement) { - case "win_rate": - return 0; - case "battles_sum": - return 1; - } - } - - static extractData(data: TimeseriesData, selected: Array, clazz: Clazz, mode: Mode, measurement: Measurement): BrLineChartData { - // transpose columns from data - const dataCls = new Uint8Array(data.map(d => WasmUtils.clazz2int(d.cls))); - const dataNation = new Uint8Array(data.map(d => WasmUtils.nation2int(d.nation))); - const dataBr = new Float32Array(data.map(d => { - const get = new TimeseriesRowGetter(d, mode, measurement); - return get.lowerBr; - })); - // transpose columns from selected - const selectedNation = new Uint8Array(selected.map(d => WasmUtils.nation2int(d.nation))); - const selectedBr = new Float32Array(selected.map(d => { - return parseFloat(_.split(d.br, " ~ ")[0]) - })); - - // get filtered indexes - const filteredIndexes = WasmUtils.wasm.extract_data(dataCls, dataNation, dataBr, selectedNation, selectedBr, - WasmUtils.clazz2int(clazz)); - - return Array.from(filteredIndexes).map(i => data[i]).map(d => { - const get = new TimeseriesRowGetter(d, mode, measurement); - return { - date: utils.parseDate(d.date), - nation: d.nation, - br: get.br, - value: get.value - } - }); - } -} diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 57c18af..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "noImplicitAny": true, - "sourceMap": true, - "lib": ["es5", "es6", "es2019", "dom"], - "experimentalDecorators": true - }, - "exclude": [ - "dist", - "node_modules" - ] -} diff --git a/wasm-utils/.gitignore b/wasm-utils/.gitignore deleted file mode 100644 index 4e30131..0000000 --- a/wasm-utils/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/target -**/*.rs.bk -Cargo.lock -bin/ -pkg/ -wasm-pack.log diff --git a/wasm-utils/Cargo.toml b/wasm-utils/Cargo.toml deleted file mode 100644 index 41e3a77..0000000 --- a/wasm-utils/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "wasm-utils" -version = "0.1.0" -authors = ["ControlNet"] -edition = "2018" - -[lib] -crate-type = ["cdylib", "rlib"] - -[features] -default = ["console_error_panic_hook"] - -[dependencies] -wasm-bindgen = { version = "0.2.63" } -js-sys = "0.3.59" - -# The `console_error_panic_hook` crate provides better debugging of panics by -# logging them with `console.error`. This is great for development, but requires -# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for -# code size when deploying. -console_error_panic_hook = { version = "0.1.6", optional = true } - -# `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size -# compared to the default allocator's ~10K. It is slower than the default -# allocator, however. -# -# Unfortunately, `wee_alloc` requires nightly Rust when targeting wasm for now. -wee_alloc = { version = "0.4.5", optional = true } - -[profile.release] -# Tell `rustc` to optimize for small code size. -opt-level = "s" diff --git a/wasm-utils/src/lib.rs b/wasm-utils/src/lib.rs deleted file mode 100644 index a568572..0000000 --- a/wasm-utils/src/lib.rs +++ /dev/null @@ -1,45 +0,0 @@ -use std::panic; - -use js_sys::{Float32Array, Uint32Array, Uint8Array}; -use wasm_bindgen::prelude::*; - -// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global -// allocator. -#[cfg(feature = "wee_alloc")] -#[global_allocator] -static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; - -#[wasm_bindgen] -extern "C" {} - -#[wasm_bindgen] -pub fn extract_data( - data_cls: &Uint8Array, - data_nation: &Uint8Array, - data_br: &Float32Array, - selected_nation: &Uint8Array, - selected_br: &Float32Array, - clazz: u8, -) -> Uint32Array { - panic::set_hook(Box::new(console_error_panic_hook::hook)); - let mut filtered_indexes: Vec = Vec::new(); - for i in 0..data_cls.length() { - let row_clazz = data_cls.get_index(i); - let row_nation = data_nation.get_index(i); - let row_br = data_br.get_index(i); - if row_clazz == clazz { - let mut ok = false; - for j in 0..selected_nation.length() { - let info_nation = selected_nation.get_index(j); - let info_br = selected_br.get_index(j); - if info_nation == row_nation && info_br == row_br { - ok = true; - } - } - if ok { - filtered_indexes.push(i); - } - } - } - return Uint32Array::from(&filtered_indexes[..]); -} diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 39743ce..0000000 --- a/webpack.config.js +++ /dev/null @@ -1,35 +0,0 @@ -const path = require('path'); - -module.exports = { - entry: './src/main.ts', - devtool: 'inline-source-map', - watch: false, - mode: "development", - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/, - }, - { - test: /\.css$/, - use: [ - 'style-loader', - 'css-loader' - ] - } - ], - }, - resolve: { - extensions: ['.ts', '.js'], - }, - output: { - filename: 'bundle.js', - path: path.resolve(__dirname, 'dist'), - }, - experiments: { - asyncWebAssembly: true, - syncWebAssembly: true - } -}; diff --git a/webpack.prod.js b/webpack.prod.js deleted file mode 100644 index 594564c..0000000 --- a/webpack.prod.js +++ /dev/null @@ -1,34 +0,0 @@ -const path = require('path'); - -module.exports = { - entry: './src/main.ts', - watch: false, - mode: "production", - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/, - }, - { - test: /\.css$/, - use: [ - 'style-loader', - 'css-loader' - ] - } - ], - }, - resolve: { - extensions: ['.ts', '.js'], - }, - output: { - filename: 'bundle.js', - path: path.resolve(__dirname, 'dist'), - }, - experiments: { - asyncWebAssembly: true, - syncWebAssembly: true - } -};