@zhangqingcq/vgce 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +16 -2
  2. package/dist/style.css +1 -1
  3. package/dist/vgce.js +28 -34
  4. package/dist/vgce.umd.cjs +5 -5
  5. package/package.json +3 -2
  6. package/src/App.vue +11 -0
  7. package/src/assets/base.less +49 -0
  8. package/src/assets/icons/add.svg +1 -0
  9. package/src/assets/icons/delete.svg +12 -0
  10. package/src/assets/icons/export.svg +1 -0
  11. package/src/assets/icons/group.svg +13 -0
  12. package/src/assets/icons/import.svg +1 -0
  13. package/src/assets/icons/lock.svg +7 -0
  14. package/src/assets/icons/menu-fold.svg +9 -0
  15. package/src/assets/icons/menu-unfold.svg +9 -0
  16. package/src/assets/icons/preview.svg +6 -0
  17. package/src/assets/icons/redo.svg +8 -0
  18. package/src/assets/icons/return.svg +8 -0
  19. package/src/assets/icons/rotate.svg +1 -0
  20. package/src/assets/icons/save.svg +9 -0
  21. package/src/assets/icons/setting.svg +6 -0
  22. package/src/assets/icons/undo.svg +7 -0
  23. package/src/assets/icons/ungroup.svg +16 -0
  24. package/src/assets/icons/unlock.svg +7 -0
  25. package/src/assets/main.less +6 -0
  26. package/src/assets/svgs/alternator.svg +8 -0
  27. package/src/assets/svgs/bot-12.svg +1 -0
  28. package/src/assets/svgs/bot-2.svg +1 -0
  29. package/src/assets/svgs/bot-3.svg +1 -0
  30. package/src/assets/svgs/bot-7.svg +1 -0
  31. package/src/assets/svgs/bot-9.svg +94 -0
  32. package/src/assets/svgs/car.svg +1 -0
  33. package/src/assets/svgs/circuit-breaker.svg +11 -0
  34. package/src/assets/svgs/clock-a.svg +23 -0
  35. package/src/assets/svgs/common-table.svg +7 -0
  36. package/src/assets/svgs/el-button.svg +10 -0
  37. package/src/assets/svgs/el-tag.svg +13 -0
  38. package/src/assets/svgs/hospital.svg +1 -0
  39. package/src/assets/svgs/house.svg +1 -0
  40. package/src/assets/svgs/light.svg +24 -0
  41. package/src/assets/svgs/now-time.svg +9 -0
  42. package/src/assets/svgs/package.svg +1 -0
  43. package/src/assets/svgs/pie-charts.svg +10 -0
  44. package/src/assets/svgs/progress-a.svg +1 -0
  45. package/src/assets/svgs/reservoir.svg +10 -0
  46. package/src/assets/svgs/svg-text.svg +5 -0
  47. package/src/assets/svgs/switch-a.svg +5 -0
  48. package/src/assets/svgs/traction-transformer.svg +11 -0
  49. package/src/components/ace-edit/index.ts +27 -0
  50. package/src/components/config/index.ts +450 -0
  51. package/src/components/config/types.ts +25 -0
  52. package/src/components/svg-analysis/index.vue +11 -0
  53. package/src/components/svg-editor/center-panel/index.vue +867 -0
  54. package/src/components/svg-editor/center-panel/types.ts +11 -0
  55. package/src/components/svg-editor/component-tree/index.vue +33 -0
  56. package/src/components/svg-editor/connection-line/index.vue +125 -0
  57. package/src/components/svg-editor/connection-panel/index.vue +198 -0
  58. package/src/components/svg-editor/export-json/index.vue +37 -0
  59. package/src/components/svg-editor/handle-panel/index.vue +342 -0
  60. package/src/components/svg-editor/import-json/index.vue +37 -0
  61. package/src/components/svg-editor/index.vue +280 -0
  62. package/src/components/svg-editor/left-panel/index.vue +83 -0
  63. package/src/components/svg-editor/right-panel/code-edit-modal.vue +50 -0
  64. package/src/components/svg-editor/right-panel/common-animate.vue +96 -0
  65. package/src/components/svg-editor/right-panel/condition.vue +101 -0
  66. package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +97 -0
  67. package/src/components/svg-editor/right-panel/index.vue +304 -0
  68. package/src/components/svg-editor/right-panel/list.vue +86 -0
  69. package/src/components/svg-editor/top-panel/index.vue +139 -0
  70. package/src/components/svg-editor/types.ts +22 -0
  71. package/src/components/svg-viewer/index.vue +340 -0
  72. package/src/components/vue3-ruler-tool/index.vue +506 -0
  73. package/src/config/files/clock-a.vue +66 -0
  74. package/src/config/files/common-table.vue +49 -0
  75. package/src/config/files/light-a.vue +72 -0
  76. package/src/config/files/now-time.vue +53 -0
  77. package/src/config/files/pie-charts.vue +72 -0
  78. package/src/config/files/progress.vue +40 -0
  79. package/src/config/files/svg-text.vue +39 -0
  80. package/src/config/files/switch-a.vue +45 -0
  81. package/src/config/index.ts +28 -0
  82. package/src/config/svg/animation/index.ts +8 -0
  83. package/src/config/svg/animation/reservoir.ts +32 -0
  84. package/src/config/svg/custom/clock-a.ts +23 -0
  85. package/src/config/svg/custom/index.ts +11 -0
  86. package/src/config/svg/custom/light.ts +29 -0
  87. package/src/config/svg/custom/svg-text.ts +54 -0
  88. package/src/config/svg/custom/switch-a.ts +29 -0
  89. package/src/config/svg/index.ts +12 -0
  90. package/src/config/svg/stateful/circuit-breaker.ts +38 -0
  91. package/src/config/svg/stateful/index.ts +8 -0
  92. package/src/config/svg/stateless/alternator.ts +28 -0
  93. package/src/config/svg/stateless/bot-12.ts +22 -0
  94. package/src/config/svg/stateless/bot-2.ts +22 -0
  95. package/src/config/svg/stateless/bot-3.ts +22 -0
  96. package/src/config/svg/stateless/bot-7.ts +22 -0
  97. package/src/config/svg/stateless/bot-9.ts +22 -0
  98. package/src/config/svg/stateless/car.ts +22 -0
  99. package/src/config/svg/stateless/hospital.ts +22 -0
  100. package/src/config/svg/stateless/house.ts +22 -0
  101. package/src/config/svg/stateless/index.ts +30 -0
  102. package/src/config/svg/stateless/package.ts +22 -0
  103. package/src/config/svg/stateless/traction-transformer.ts +28 -0
  104. package/src/config/types.ts +126 -0
  105. package/src/config/vue/component/button.ts +57 -0
  106. package/src/config/vue/component/common-table.ts +124 -0
  107. package/src/config/vue/component/index.ts +13 -0
  108. package/src/config/vue/component/now-time.ts +29 -0
  109. package/src/config/vue/component/progress.ts +29 -0
  110. package/src/config/vue/component/tag.ts +46 -0
  111. package/src/config/vue/echarts/index.ts +8 -0
  112. package/src/config/vue/echarts/pie-charts.ts +60 -0
  113. package/src/config/vue/index.ts +5 -0
  114. package/src/hooks.ts +47 -0
  115. package/src/index.ts +14 -0
  116. package/src/main.ts +15 -0
  117. package/src/router.ts +24 -0
  118. package/src/stores/config/index.ts +44 -0
  119. package/src/stores/config/types.ts +27 -0
  120. package/src/stores/global/index.ts +109 -0
  121. package/src/stores/global/types.ts +115 -0
  122. package/src/stores/main.ts +10 -0
  123. package/src/stores/svg-edit-layout/index.ts +17 -0
  124. package/src/stores/svg-edit-layout/types.ts +8 -0
  125. package/src/stores/system/index.ts +174 -0
  126. package/src/stores/system/types.ts +43 -0
  127. package/src/utils/fetch.ts +351 -0
  128. package/src/utils/file-read-write.ts +26 -0
  129. package/src/utils/index.ts +397 -0
  130. package/src/utils/mqtt-net.ts +48 -0
  131. package/src/utils/proxy.ts +7 -0
  132. package/src/utils/scale-core.ts +214 -0
  133. package/src/utils/types.ts +13 -0
  134. package/src/views/EditorS.vue +18 -0
  135. package/src/views/Preview.vue +12 -0
package/dist/vgce.umd.cjs CHANGED
@@ -289,7 +289,7 @@ usage: app.provide(ID_INJECTION_KEY, {
289
289
  * Copyright(c) 2015 Andreas Lubbe
290
290
  * Copyright(c) 2015 Tiancheng "Timothy" Gu
291
291
  * MIT Licensed
292
- */var matchHtmlRegExp=/["'&<>]/,escapeHtml_1=escapeHtml;function escapeHtml(i){var n=""+i,r=matchHtmlRegExp.exec(n);if(!r)return n;var g,k="",V=0,$=0;for(V=r.index;V<n.length;V++){switch(n.charCodeAt(V)){case 34:g="&quot;";break;case 38:g="&amp;";break;case 39:g="&#39;";break;case 60:g="&lt;";break;case 62:g="&gt;";break;default:continue}$!==V&&(k+=n.substring($,V)),$=V+1,k+=g}return $!==V?k+n.substring($,V):k}const escapeHtml$1=getDefaultExportFromCjs(escapeHtml_1),getCell=function(i){var n;return(n=i.target)==null?void 0:n.closest("td")},orderBy=function(i,n,r,g,k){if(!n&&!g&&(!k||Array.isArray(k)&&!k.length))return i;typeof r=="string"?r=r==="descending"?-1:1:r=r&&r<0?-1:1;const V=g?null:function(oe,re){return k?(Array.isArray(k)||(k=[k]),k.map(Ce=>typeof Ce=="string"?get$1(oe,Ce):Ce(oe,re,i))):(n!=="$key"&&isObject$4(oe)&&"$value"in oe&&(oe=oe.$value),[isObject$4(oe)?get$1(oe,n):oe])},$=function(oe,re){if(g)return g(oe.value,re.value);for(let Ce=0,ie=oe.key.length;Ce<ie;Ce++){if(oe.key[Ce]<re.key[Ce])return-1;if(oe.key[Ce]>re.key[Ce])return 1}return 0};return i.map((oe,re)=>({value:oe,index:re,key:V?V(oe,re):null})).sort((oe,re)=>{let Ce=$(oe,re);return Ce||(Ce=oe.index-re.index),Ce*+r}).map(oe=>oe.value)},getColumnById=function(i,n){let r=null;return i.columns.forEach(g=>{g.id===n&&(r=g)}),r},getColumnByKey=function(i,n){let r=null;for(let g=0;g<i.columns.length;g++){const k=i.columns[g];if(k.columnKey===n){r=k;break}}return r||throwError$1("ElTable",`No column matching with column-key: ${n}`),r},getColumnByCell=function(i,n,r){const g=(n.className||"").match(new RegExp(`${r}-table_[^\\s]+`,"gm"));return g?getColumnById(i,g[0]):null},getRowIdentity=(i,n)=>{if(!i)throw new Error("Row is required when get row identity");if(typeof n=="string"){if(!n.includes("."))return`${i[n]}`;const r=n.split(".");let g=i;for(const k of r)g=g[k];return`${g}`}else if(typeof n=="function")return n.call(null,i)},getKeysMap=function(i,n){const r={};return(i||[]).forEach((g,k)=>{r[getRowIdentity(g,n)]={row:g,index:k}}),r};function mergeOptions(i,n){const r={};let g;for(g in i)r[g]=i[g];for(g in n)if(hasOwn$1(n,g)){const k=n[g];typeof k<"u"&&(r[g]=k)}return r}function parseWidth(i){return i===""||i!==void 0&&(i=Number.parseInt(i,10),Number.isNaN(i)&&(i="")),i}function parseMinWidth(i){return i===""||i!==void 0&&(i=parseWidth(i),Number.isNaN(i)&&(i=80)),i}function parseHeight(i){return typeof i=="number"?i:typeof i=="string"?/^\d+(?:px)?$/.test(i)?Number.parseInt(i,10):i:null}function compose(...i){return i.length===0?n=>n:i.length===1?i[0]:i.reduce((n,r)=>(...g)=>n(r(...g)))}function toggleRowStatus(i,n,r){let g=!1;const k=i.indexOf(n),V=k!==-1,$=oe=>{oe==="add"?i.push(n):i.splice(k,1),g=!0,isArray$3(n.children)&&n.children.forEach(re=>{toggleRowStatus(i,re,r??!V)})};return isBoolean(r)?r&&!V?$("add"):!r&&V&&$("remove"):$(V?"remove":"add"),g}function walkTreeNode(i,n,r="children",g="hasChildren"){const k=$=>!(Array.isArray($)&&$.length);function V($,oe,re){n($,oe,re),oe.forEach(Ce=>{if(Ce[g]){n(Ce,null,re+1);return}const ie=Ce[r];k(ie)||V(Ce,ie,re+1)})}i.forEach($=>{if($[g]){n($,null,0);return}const oe=$[r];k(oe)||V($,oe,0)})}let removePopper;function createTablePopper(i,n,r,g,k){k=merge$2({enterable:!0,showArrow:!0},k);const V=i==null?void 0:i.dataset.prefix,$=i==null?void 0:i.querySelector(`.${V}-scrollbar__wrap`);function oe(){const Ne=k.effect==="light",he=document.createElement("div");return he.className=[`${V}-popper`,Ne?"is-light":"is-dark",k.popperClass||""].join(" "),r=escapeHtml$1(r),he.innerHTML=r,he.style.zIndex=String(g()),i==null||i.appendChild(he),he}function re(){const Ne=document.createElement("div");return Ne.className=`${V}-popper__arrow`,Ne}function Ce(){ie&&ie.update()}removePopper==null||removePopper(),removePopper=()=>{try{ie&&ie.destroy(),Ie&&(i==null||i.removeChild(Ie)),n.removeEventListener("mouseenter",ae),n.removeEventListener("mouseleave",le),$==null||$.removeEventListener("scroll",removePopper),removePopper=void 0}catch{}};let ie=null,ae=Ce,le=removePopper;k.enterable&&({onOpen:ae,onClose:le}=useDelayedToggle({showAfter:k.showAfter,hideAfter:k.hideAfter,open:Ce,close:removePopper}));const Ie=oe();Ie.onmouseenter=ae,Ie.onmouseleave=le;const ue=[];if(k.offset&&ue.push({name:"offset",options:{offset:[0,k.offset]}}),k.showArrow){const Ne=Ie.appendChild(re());ue.push({name:"arrow",options:{element:Ne,padding:10}})}const de=k.popperOptions||{};return ie=yn(n,Ie,{placement:k.placement||"top",strategy:"fixed",...de,modifiers:de.modifiers?ue.concat(de.modifiers):ue}),n.addEventListener("mouseenter",ae),n.addEventListener("mouseleave",le),$==null||$.addEventListener("scroll",removePopper),ie}function getCurrentColumns(i){return i.children?flatMap(i.children,getCurrentColumns):[i]}function getColSpan(i,n){return i+n.colSpan}const isFixedColumn=(i,n,r,g)=>{let k=0,V=i;const $=r.states.columns.value;if(g){const re=getCurrentColumns(g[i]);k=$.slice(0,$.indexOf(re[0])).reduce(getColSpan,0),V=k+re.reduce(getColSpan,0)-1}else k=i;let oe;switch(n){case"left":V<r.states.fixedLeafColumnsLength.value&&(oe="left");break;case"right":k>=$.length-r.states.rightFixedLeafColumnsLength.value&&(oe="right");break;default:V<r.states.fixedLeafColumnsLength.value?oe="left":k>=$.length-r.states.rightFixedLeafColumnsLength.value&&(oe="right")}return oe?{direction:oe,start:k,after:V}:{}},getFixedColumnsClass=(i,n,r,g,k,V=0)=>{const $=[],{direction:oe,start:re,after:Ce}=isFixedColumn(n,r,g,k);if(oe){const ie=oe==="left";$.push(`${i}-fixed-column--${oe}`),ie&&Ce+V===g.states.fixedLeafColumnsLength.value-1?$.push("is-last-column"):!ie&&re-V===g.states.columns.value.length-g.states.rightFixedLeafColumnsLength.value&&$.push("is-first-column")}return $};function getOffset(i,n){return i+(n.realWidth===null||Number.isNaN(n.realWidth)?Number(n.width):n.realWidth)}const getFixedColumnOffset=(i,n,r,g)=>{const{direction:k,start:V=0,after:$=0}=isFixedColumn(i,n,r,g);if(!k)return;const oe={},re=k==="left",Ce=r.states.columns.value;return re?oe.left=Ce.slice(0,V).reduce(getOffset,0):oe.right=Ce.slice($+1).reverse().reduce(getOffset,0),oe},ensurePosition=(i,n)=>{i&&(Number.isNaN(i[n])||(i[n]=`${i[n]}px`))};function useExpand(i){const n=vue.getCurrentInstance(),r=vue.ref(!1),g=vue.ref([]);return{updateExpandRows:()=>{const re=i.data.value||[],Ce=i.rowKey.value;if(r.value)g.value=re.slice();else if(Ce){const ie=getKeysMap(g.value,Ce);g.value=re.reduce((ae,le)=>{const Ie=getRowIdentity(le,Ce);return ie[Ie]&&ae.push(le),ae},[])}else g.value=[]},toggleRowExpansion:(re,Ce)=>{toggleRowStatus(g.value,re,Ce)&&n.emit("expand-change",re,g.value.slice())},setExpandRowKeys:re=>{n.store.assertRowKey();const Ce=i.data.value||[],ie=i.rowKey.value,ae=getKeysMap(Ce,ie);g.value=re.reduce((le,Ie)=>{const ue=ae[Ie];return ue&&le.push(ue.row),le},[])},isRowExpanded:re=>{const Ce=i.rowKey.value;return Ce?!!getKeysMap(g.value,Ce)[getRowIdentity(re,Ce)]:g.value.includes(re)},states:{expandRows:g,defaultExpandAll:r}}}function useCurrent(i){const n=vue.getCurrentInstance(),r=vue.ref(null),g=vue.ref(null),k=Ce=>{n.store.assertRowKey(),r.value=Ce,$(Ce)},V=()=>{r.value=null},$=Ce=>{const{data:ie,rowKey:ae}=i;let le=null;ae.value&&(le=(vue.unref(ie)||[]).find(Ie=>getRowIdentity(Ie,ae.value)===Ce)),g.value=le,n.emit("current-change",g.value,null)};return{setCurrentRowKey:k,restoreCurrentRowKey:V,setCurrentRowByKey:$,updateCurrentRow:Ce=>{const ie=g.value;if(Ce&&Ce!==ie){g.value=Ce,n.emit("current-change",g.value,ie);return}!Ce&&ie&&(g.value=null,n.emit("current-change",null,ie))},updateCurrentRowData:()=>{const Ce=i.rowKey.value,ie=i.data.value||[],ae=g.value;if(!ie.includes(ae)&&ae){if(Ce){const le=getRowIdentity(ae,Ce);$(le)}else g.value=null;g.value===null&&n.emit("current-change",null,ae)}else r.value&&($(r.value),V())},states:{_currentRowKey:r,currentRow:g}}}function useTree(i){const n=vue.ref([]),r=vue.ref({}),g=vue.ref(16),k=vue.ref(!1),V=vue.ref({}),$=vue.ref("hasChildren"),oe=vue.ref("children"),re=vue.getCurrentInstance(),Ce=vue.computed(()=>{if(!i.rowKey.value)return{};const he=i.data.value||[];return ae(he)}),ie=vue.computed(()=>{const he=i.rowKey.value,pe=Object.keys(V.value),ze={};return pe.length&&pe.forEach(Fe=>{if(V.value[Fe].length){const xe={children:[]};V.value[Fe].forEach(_e=>{const Dt=getRowIdentity(_e,he);xe.children.push(Dt),_e[$.value]&&!ze[Dt]&&(ze[Dt]={children:[]})}),ze[Fe]=xe}}),ze}),ae=he=>{const pe=i.rowKey.value,ze={};return walkTreeNode(he,(Fe,xe,_e)=>{const Dt=getRowIdentity(Fe,pe);Array.isArray(xe)?ze[Dt]={children:xe.map($e=>getRowIdentity($e,pe)),level:_e}:k.value&&(ze[Dt]={children:[],lazy:!0,level:_e})},oe.value,$.value),ze},le=(he=!1,pe=(ze=>(ze=re.store)==null?void 0:ze.states.defaultExpandAll.value)())=>{var ze;const Fe=Ce.value,xe=ie.value,_e=Object.keys(Fe),Dt={};if(_e.length){const $e=vue.unref(r),Ue=[],Ve=(At,qe)=>{if(he)return n.value?pe||n.value.includes(qe):!!(pe||At!=null&&At.expanded);{const Lt=pe||n.value&&n.value.includes(qe);return!!(At!=null&&At.expanded||Lt)}};_e.forEach(At=>{const qe=$e[At],Lt={...Fe[At]};if(Lt.expanded=Ve(qe,At),Lt.lazy){const{loaded:kt=!1,loading:jt=!1}=qe||{};Lt.loaded=!!kt,Lt.loading=!!jt,Ue.push(At)}Dt[At]=Lt});const Oe=Object.keys(xe);k.value&&Oe.length&&Ue.length&&Oe.forEach(At=>{const qe=$e[At],Lt=xe[At].children;if(Ue.includes(At)){if(Dt[At].children.length!==0)throw new Error("[ElTable]children must be an empty array.");Dt[At].children=Lt}else{const{loaded:kt=!1,loading:jt=!1}=qe||{};Dt[At]={lazy:!0,loaded:!!kt,loading:!!jt,expanded:Ve(qe,At),children:Lt,level:""}}})}r.value=Dt,(ze=re.store)==null||ze.updateTableScrollY()};vue.watch(()=>n.value,()=>{le(!0)}),vue.watch(()=>Ce.value,()=>{le()}),vue.watch(()=>ie.value,()=>{le()});const Ie=he=>{n.value=he,le()},ue=(he,pe)=>{re.store.assertRowKey();const ze=i.rowKey.value,Fe=getRowIdentity(he,ze),xe=Fe&&r.value[Fe];if(Fe&&xe&&"expanded"in xe){const _e=xe.expanded;pe=typeof pe>"u"?!xe.expanded:pe,r.value[Fe].expanded=pe,_e!==pe&&re.emit("expand-change",he,pe),re.store.updateTableScrollY()}},de=he=>{re.store.assertRowKey();const pe=i.rowKey.value,ze=getRowIdentity(he,pe),Fe=r.value[ze];k.value&&Fe&&"loaded"in Fe&&!Fe.loaded?Ne(he,ze,Fe):ue(he,void 0)},Ne=(he,pe,ze)=>{const{load:Fe}=re.props;Fe&&!r.value[pe].loaded&&(r.value[pe].loading=!0,Fe(he,ze,xe=>{if(!Array.isArray(xe))throw new TypeError("[ElTable] data must be an array");r.value[pe].loading=!1,r.value[pe].loaded=!0,r.value[pe].expanded=!0,xe.length&&(V.value[pe]=xe),re.emit("expand-change",he,!0)}))};return{loadData:Ne,loadOrToggle:de,toggleTreeExpansion:ue,updateTreeExpandKeys:Ie,updateTreeData:le,normalize:ae,states:{expandRowKeys:n,treeData:r,indent:g,lazy:k,lazyTreeNodeMap:V,lazyColumnIdentifier:$,childrenColumnName:oe}}}const sortData=(i,n)=>{const r=n.sortingColumn;return!r||typeof r.sortable=="string"?i:orderBy(i,n.sortProp,n.sortOrder,r.sortMethod,r.sortBy)},doFlattenColumns=i=>{const n=[];return i.forEach(r=>{r.children&&r.children.length>0?n.push.apply(n,doFlattenColumns(r.children)):n.push(r)}),n};function useWatcher$1(){var i;const n=vue.getCurrentInstance(),{size:r}=vue.toRefs((i=n.proxy)==null?void 0:i.$props),g=vue.ref(null),k=vue.ref([]),V=vue.ref([]),$=vue.ref(!1),oe=vue.ref([]),re=vue.ref([]),Ce=vue.ref([]),ie=vue.ref([]),ae=vue.ref([]),le=vue.ref([]),Ie=vue.ref([]),ue=vue.ref([]),de=[],Ne=vue.ref(0),he=vue.ref(0),pe=vue.ref(0),ze=vue.ref(!1),Fe=vue.ref([]),xe=vue.ref(!1),_e=vue.ref(!1),Dt=vue.ref(null),$e=vue.ref({}),Ue=vue.ref(null),Ve=vue.ref(null),Oe=vue.ref(null),At=vue.ref(null),qe=vue.ref(null);vue.watch(k,()=>n.state&&ti(!1),{deep:!0});const Lt=()=>{if(!g.value)throw new Error("[ElTable] prop row-key is required")},kt=Oi=>{var xi;(xi=Oi.children)==null||xi.forEach(Li=>{Li.fixed=Oi.fixed,kt(Li)})},jt=()=>{oe.value.forEach(ki=>{kt(ki)}),ie.value=oe.value.filter(ki=>ki.fixed===!0||ki.fixed==="left"),ae.value=oe.value.filter(ki=>ki.fixed==="right"),ie.value.length>0&&oe.value[0]&&oe.value[0].type==="selection"&&!oe.value[0].fixed&&(oe.value[0].fixed=!0,ie.value.unshift(oe.value[0]));const Oi=oe.value.filter(ki=>!ki.fixed);re.value=[].concat(ie.value).concat(Oi).concat(ae.value);const xi=doFlattenColumns(Oi),Li=doFlattenColumns(ie.value),Wi=doFlattenColumns(ae.value);Ne.value=xi.length,he.value=Li.length,pe.value=Wi.length,Ce.value=[].concat(Li).concat(xi).concat(Wi),$.value=ie.value.length>0||ae.value.length>0},ti=(Oi,xi=!1)=>{Oi&&jt(),xi?n.state.doLayout():n.state.debouncedUpdateLayout()},ei=Oi=>Fe.value.includes(Oi),Pt=()=>{ze.value=!1,Fe.value.length&&(Fe.value=[],n.emit("selection-change",[]))},ni=()=>{let Oi;if(g.value){Oi=[];const xi=getKeysMap(Fe.value,g.value),Li=getKeysMap(k.value,g.value);for(const Wi in xi)hasOwn$1(xi,Wi)&&!Li[Wi]&&Oi.push(xi[Wi].row)}else Oi=Fe.value.filter(xi=>!k.value.includes(xi));if(Oi.length){const xi=Fe.value.filter(Li=>!Oi.includes(Li));Fe.value=xi,n.emit("selection-change",xi.slice())}},gi=()=>(Fe.value||[]).slice(),di=(Oi,xi=void 0,Li=!0)=>{if(toggleRowStatus(Fe.value,Oi,xi)){const ki=(Fe.value||[]).slice();Li&&n.emit("select",ki,Oi),n.emit("selection-change",ki)}},li=()=>{var Oi,xi;const Li=_e.value?!ze.value:!(ze.value||Fe.value.length);ze.value=Li;let Wi=!1,ki=0;const Ri=(xi=(Oi=n==null?void 0:n.store)==null?void 0:Oi.states)==null?void 0:xi.rowKey.value;k.value.forEach((Ki,Ti)=>{const Di=Ti+ki;Dt.value?Dt.value.call(null,Ki,Di)&&toggleRowStatus(Fe.value,Ki,Li)&&(Wi=!0):toggleRowStatus(Fe.value,Ki,Li)&&(Wi=!0),ki+=pi(getRowIdentity(Ki,Ri))}),Wi&&n.emit("selection-change",Fe.value?Fe.value.slice():[]),n.emit("select-all",Fe.value)},ai=()=>{const Oi=getKeysMap(Fe.value,g.value);k.value.forEach(xi=>{const Li=getRowIdentity(xi,g.value),Wi=Oi[Li];Wi&&(Fe.value[Wi.index]=xi)})},ci=()=>{var Oi,xi,Li;if(((Oi=k.value)==null?void 0:Oi.length)===0){ze.value=!1;return}let Wi;g.value&&(Wi=getKeysMap(Fe.value,g.value));const ki=function(Di){return Wi?!!Wi[getRowIdentity(Di,g.value)]:Fe.value.includes(Di)};let Ri=!0,Ki=0,Ti=0;for(let Di=0,Bi=(k.value||[]).length;Di<Bi;Di++){const Vi=(Li=(xi=n==null?void 0:n.store)==null?void 0:xi.states)==null?void 0:Li.rowKey.value,Ei=Di+Ti,ji=k.value[Di],Ui=Dt.value&&Dt.value.call(null,ji,Ei);if(ki(ji))Ki++;else if(!Dt.value||Ui){Ri=!1;break}Ti+=pi(getRowIdentity(ji,Vi))}Ki===0&&(Ri=!1),ze.value=Ri},pi=Oi=>{var xi;if(!n||!n.store)return 0;const{treeData:Li}=n.store.states;let Wi=0;const ki=(xi=Li.value[Oi])==null?void 0:xi.children;return ki&&(Wi+=ki.length,ki.forEach(Ri=>{Wi+=pi(Ri)})),Wi},yi=(Oi,xi)=>{Array.isArray(Oi)||(Oi=[Oi]);const Li={};return Oi.forEach(Wi=>{$e.value[Wi.id]=xi,Li[Wi.columnKey||Wi.id]=xi}),Li},Ai=(Oi,xi,Li)=>{Ve.value&&Ve.value!==Oi&&(Ve.value.order=null),Ve.value=Oi,Oe.value=xi,At.value=Li},hi=()=>{let Oi=vue.unref(V);Object.keys($e.value).forEach(xi=>{const Li=$e.value[xi];if(!Li||Li.length===0)return;const Wi=getColumnById({columns:Ce.value},xi);Wi&&Wi.filterMethod&&(Oi=Oi.filter(ki=>Li.some(Ri=>Wi.filterMethod.call(null,Ri,ki,Wi))))}),Ue.value=Oi},wi=()=>{k.value=sortData(Ue.value,{sortingColumn:Ve.value,sortProp:Oe.value,sortOrder:At.value})},Ci=(Oi=void 0)=>{Oi&&Oi.filter||hi(),wi()},mi=Oi=>{const{tableHeaderRef:xi}=n.refs;if(!xi)return;const Li=Object.assign({},xi.filterPanels),Wi=Object.keys(Li);if(Wi.length)if(typeof Oi=="string"&&(Oi=[Oi]),Array.isArray(Oi)){const ki=Oi.map(Ri=>getColumnByKey({columns:Ce.value},Ri));Wi.forEach(Ri=>{const Ki=ki.find(Ti=>Ti.id===Ri);Ki&&(Ki.filteredValue=[])}),n.store.commit("filterChange",{column:ki,values:[],silent:!0,multi:!0})}else Wi.forEach(ki=>{const Ri=Ce.value.find(Ki=>Ki.id===ki);Ri&&(Ri.filteredValue=[])}),$e.value={},n.store.commit("filterChange",{column:{},values:[],silent:!0})},Ni=()=>{Ve.value&&(Ai(null,null,null),n.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:Mi,toggleRowExpansion:fi,updateExpandRows:zi,states:Si,isRowExpanded:si}=useExpand({data:k,rowKey:g}),{updateTreeExpandKeys:Ii,toggleTreeExpansion:oi,updateTreeData:Et,loadOrToggle:ii,states:ri}=useTree({data:k,rowKey:g}),{updateCurrentRowData:ui,updateCurrentRow:vi,setCurrentRowKey:bi,states:Zi}=useCurrent({data:k,rowKey:g});return{assertRowKey:Lt,updateColumns:jt,scheduleLayout:ti,isSelected:ei,clearSelection:Pt,cleanSelection:ni,getSelectionRows:gi,toggleRowSelection:di,_toggleAllSelection:li,toggleAllSelection:null,updateSelectionByRowKey:ai,updateAllSelected:ci,updateFilters:yi,updateCurrentRow:vi,updateSort:Ai,execFilter:hi,execSort:wi,execQuery:Ci,clearFilter:mi,clearSort:Ni,toggleRowExpansion:fi,setExpandRowKeysAdapter:Oi=>{Mi(Oi),Ii(Oi)},setCurrentRowKey:bi,toggleRowExpansionAdapter:(Oi,xi)=>{Ce.value.some(({type:Wi})=>Wi==="expand")?fi(Oi,xi):oi(Oi,xi)},isRowExpanded:si,updateExpandRows:zi,updateCurrentRowData:ui,loadOrToggle:ii,updateTreeData:Et,states:{tableSize:r,rowKey:g,data:k,_data:V,isComplex:$,_columns:oe,originColumns:re,columns:Ce,fixedColumns:ie,rightFixedColumns:ae,leafColumns:le,fixedLeafColumns:Ie,rightFixedLeafColumns:ue,updateOrderFns:de,leafColumnsLength:Ne,fixedLeafColumnsLength:he,rightFixedLeafColumnsLength:pe,isAllSelected:ze,selection:Fe,reserveSelection:xe,selectOnIndeterminate:_e,selectable:Dt,filters:$e,filteredData:Ue,sortingColumn:Ve,sortProp:Oe,sortOrder:At,hoverRow:qe,...Si,...ri,...Zi}}}function replaceColumn(i,n){return i.map(r=>{var g;return r.id===n.id?n:((g=r.children)!=null&&g.length&&(r.children=replaceColumn(r.children,n)),r)})}function sortColumn(i){i.forEach(n=>{var r,g;n.no=(r=n.getColumnIndex)==null?void 0:r.call(n),(g=n.children)!=null&&g.length&&sortColumn(n.children)}),i.sort((n,r)=>n.no-r.no)}function useStore(){const i=vue.getCurrentInstance(),n=useWatcher$1();return{ns:useNamespace("table"),...n,mutations:{setData($,oe){const re=vue.unref($._data)!==oe;$.data.value=oe,$._data.value=oe,i.store.execQuery(),i.store.updateCurrentRowData(),i.store.updateExpandRows(),i.store.updateTreeData(i.store.states.defaultExpandAll.value),vue.unref($.reserveSelection)?(i.store.assertRowKey(),i.store.updateSelectionByRowKey()):re?i.store.clearSelection():i.store.cleanSelection(),i.store.updateAllSelected(),i.$ready&&i.store.scheduleLayout()},insertColumn($,oe,re,Ce){const ie=vue.unref($._columns);let ae=[];re?(re&&!re.children&&(re.children=[]),re.children.push(oe),ae=replaceColumn(ie,re)):(ie.push(oe),ae=ie),sortColumn(ae),$._columns.value=ae,$.updateOrderFns.push(Ce),oe.type==="selection"&&($.selectable.value=oe.selectable,$.reserveSelection.value=oe.reserveSelection),i.$ready&&(i.store.updateColumns(),i.store.scheduleLayout())},updateColumnOrder($,oe){var re;((re=oe.getColumnIndex)==null?void 0:re.call(oe))!==oe.no&&(sortColumn($._columns.value),i.$ready&&i.store.updateColumns())},removeColumn($,oe,re,Ce){const ie=vue.unref($._columns)||[];if(re)re.children.splice(re.children.findIndex(le=>le.id===oe.id),1),vue.nextTick(()=>{var le;((le=re.children)==null?void 0:le.length)===0&&delete re.children}),$._columns.value=replaceColumn(ie,re);else{const le=ie.indexOf(oe);le>-1&&(ie.splice(le,1),$._columns.value=ie)}const ae=$.updateOrderFns.indexOf(Ce);ae>-1&&$.updateOrderFns.splice(ae,1),i.$ready&&(i.store.updateColumns(),i.store.scheduleLayout())},sort($,oe){const{prop:re,order:Ce,init:ie}=oe;if(re){const ae=vue.unref($.columns).find(le=>le.property===re);ae&&(ae.order=Ce,i.store.updateSort(ae,re,Ce),i.store.commit("changeSortCondition",{init:ie}))}},changeSortCondition($,oe){const{sortingColumn:re,sortProp:Ce,sortOrder:ie}=$,ae=vue.unref(re),le=vue.unref(Ce),Ie=vue.unref(ie);Ie===null&&($.sortingColumn.value=null,$.sortProp.value=null);const ue={filter:!0};i.store.execQuery(ue),(!oe||!(oe.silent||oe.init))&&i.emit("sort-change",{column:ae,prop:le,order:Ie}),i.store.updateTableScrollY()},filterChange($,oe){const{column:re,values:Ce,silent:ie}=oe,ae=i.store.updateFilters(re,Ce);i.store.execQuery(),ie||i.emit("filter-change",ae),i.store.updateTableScrollY()},toggleAllSelection(){i.store.toggleAllSelection()},rowSelectedChanged($,oe){i.store.toggleRowSelection(oe),i.store.updateAllSelected()},setHoverRow($,oe){$.hoverRow.value=oe},setCurrentRow($,oe){i.store.updateCurrentRow(oe)}},commit:function($,...oe){const re=i.store.mutations;if(re[$])re[$].apply(i,[i.store.states].concat(oe));else throw new Error(`Action not found: ${$}`)},updateTableScrollY:function(){vue.nextTick(()=>i.layout.updateScrollY.apply(i.layout))}}}const InitialStateMap={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data",["treeProps.hasChildren"]:{key:"lazyColumnIdentifier",default:"hasChildren"},["treeProps.children"]:{key:"childrenColumnName",default:"children"}};function createStore(i,n){if(!i)throw new Error("Table is required.");const r=useStore();return r.toggleAllSelection=debounce(r._toggleAllSelection,10),Object.keys(InitialStateMap).forEach(g=>{handleValue(getArrKeysValue(n,g),g,r)}),proxyTableProps(r,n),r}function proxyTableProps(i,n){Object.keys(InitialStateMap).forEach(r=>{vue.watch(()=>getArrKeysValue(n,r),g=>{handleValue(g,r,i)})})}function handleValue(i,n,r){let g=i,k=InitialStateMap[n];typeof InitialStateMap[n]=="object"&&(k=k.key,g=g||InitialStateMap[n].default),r.states[k].value=g}function getArrKeysValue(i,n){if(n.includes(".")){const r=n.split(".");let g=i;return r.forEach(k=>{g=g[k]}),g}else return i[n]}class TableLayout{constructor(n){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=vue.ref(null),this.scrollX=vue.ref(!1),this.scrollY=vue.ref(!1),this.bodyWidth=vue.ref(null),this.fixedWidth=vue.ref(null),this.rightFixedWidth=vue.ref(null),this.gutterWidth=0;for(const r in n)hasOwn$1(n,r)&&(vue.isRef(this[r])?this[r].value=n[r]:this[r]=n[r]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){if(this.height.value===null)return!1;const r=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(r!=null&&r.wrapRef)){let g=!0;const k=this.scrollY.value;return g=r.wrapRef.scrollHeight>r.wrapRef.clientHeight,this.scrollY.value=g,k!==g}return!1}setHeight(n,r="height"){if(!isClient)return;const g=this.table.vnode.el;if(n=parseHeight(n),this.height.value=Number(n),!g&&(n||n===0))return vue.nextTick(()=>this.setHeight(n,r));typeof n=="number"?(g.style[r]=`${n}px`,this.updateElsHeight()):typeof n=="string"&&(g.style[r]=n,this.updateElsHeight())}setMaxHeight(n){this.setHeight(n,"max-height")}getFlattenColumns(){const n=[];return this.table.store.states.columns.value.forEach(g=>{g.isColumnGroup?n.push.apply(n,g.columns):n.push(g)}),n}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(n){if(!n)return!0;let r=n;for(;r.tagName!=="DIV";){if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}updateColumnsWidth(){if(!isClient)return;const n=this.fit,r=this.table.vnode.el.clientWidth;let g=0;const k=this.getFlattenColumns(),V=k.filter(re=>typeof re.width!="number");if(k.forEach(re=>{typeof re.width=="number"&&re.realWidth&&(re.realWidth=null)}),V.length>0&&n){if(k.forEach(re=>{g+=Number(re.width||re.minWidth||80)}),g<=r){this.scrollX.value=!1;const re=r-g;if(V.length===1)V[0].realWidth=Number(V[0].minWidth||80)+re;else{const Ce=V.reduce((le,Ie)=>le+Number(Ie.minWidth||80),0),ie=re/Ce;let ae=0;V.forEach((le,Ie)=>{if(Ie===0)return;const ue=Math.floor(Number(le.minWidth||80)*ie);ae+=ue,le.realWidth=Number(le.minWidth||80)+ue}),V[0].realWidth=Number(V[0].minWidth||80)+re-ae}}else this.scrollX.value=!0,V.forEach(re=>{re.realWidth=Number(re.minWidth)});this.bodyWidth.value=Math.max(g,r),this.table.state.resizeState.value.width=this.bodyWidth.value}else k.forEach(re=>{!re.width&&!re.minWidth?re.realWidth=80:re.realWidth=Number(re.width||re.minWidth),g+=re.realWidth}),this.scrollX.value=g>r,this.bodyWidth.value=g;const $=this.store.states.fixedColumns.value;if($.length>0){let re=0;$.forEach(Ce=>{re+=Number(Ce.realWidth||Ce.width)}),this.fixedWidth.value=re}const oe=this.store.states.rightFixedColumns.value;if(oe.length>0){let re=0;oe.forEach(Ce=>{re+=Number(Ce.realWidth||Ce.width)}),this.rightFixedWidth.value=re}this.notifyObservers("columns")}addObserver(n){this.observers.push(n)}removeObserver(n){const r=this.observers.indexOf(n);r!==-1&&this.observers.splice(r,1)}notifyObservers(n){this.observers.forEach(g=>{var k,V;switch(n){case"columns":(k=g.state)==null||k.onColumnsChange(this);break;case"scrollable":(V=g.state)==null||V.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${n}.`)}})}}const{CheckboxGroup:ElCheckboxGroup}=ElCheckbox,_sfc_main$D=vue.defineComponent({name:"ElTableFilterPanel",components:{ElCheckbox,ElCheckboxGroup,ElScrollbar,ElTooltip,ElIcon,ArrowDown:arrow_down_default,ArrowUp:arrow_up_default},directives:{ClickOutside},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(i){const n=vue.getCurrentInstance(),{t:r}=useLocale(),g=useNamespace("table-filter"),k=n==null?void 0:n.parent;k.filterPanels.value[i.column.id]||(k.filterPanels.value[i.column.id]=n);const V=vue.ref(!1),$=vue.ref(null),oe=vue.computed(()=>i.column&&i.column.filters),re=vue.computed({get:()=>{var Fe;return(((Fe=i.column)==null?void 0:Fe.filteredValue)||[])[0]},set:Fe=>{Ce.value&&(typeof Fe<"u"&&Fe!==null?Ce.value.splice(0,1,Fe):Ce.value.splice(0,1))}}),Ce=vue.computed({get(){return i.column?i.column.filteredValue||[]:[]},set(Fe){i.column&&i.upDataColumn("filteredValue",Fe)}}),ie=vue.computed(()=>i.column?i.column.filterMultiple:!0),ae=Fe=>Fe.value===re.value,le=()=>{V.value=!1},Ie=Fe=>{Fe.stopPropagation(),V.value=!V.value},ue=()=>{V.value=!1},de=()=>{pe(Ce.value),le()},Ne=()=>{Ce.value=[],pe(Ce.value),le()},he=Fe=>{re.value=Fe,pe(typeof Fe<"u"&&Fe!==null?Ce.value:[]),le()},pe=Fe=>{i.store.commit("filterChange",{column:i.column,values:Fe}),i.store.updateAllSelected()};vue.watch(V,Fe=>{i.column&&i.upDataColumn("filterOpened",Fe)},{immediate:!0});const ze=vue.computed(()=>{var Fe,xe;return(xe=(Fe=$.value)==null?void 0:Fe.popperRef)==null?void 0:xe.contentRef});return{tooltipVisible:V,multiple:ie,filteredValue:Ce,filterValue:re,filters:oe,handleConfirm:de,handleReset:Ne,handleSelect:he,isActive:ae,t:r,ns:g,showFilterPanel:Ie,hideFilterPanel:ue,popperPaneRef:ze,tooltip:$}}}),_hoisted_1$s={key:0},_hoisted_2$m=["disabled"],_hoisted_3$g=["label","onClick"];function _sfc_render$5(i,n,r,g,k,V){const $=vue.resolveComponent("el-checkbox"),oe=vue.resolveComponent("el-checkbox-group"),re=vue.resolveComponent("el-scrollbar"),Ce=vue.resolveComponent("arrow-up"),ie=vue.resolveComponent("arrow-down"),ae=vue.resolveComponent("el-icon"),le=vue.resolveComponent("el-tooltip"),Ie=vue.resolveDirective("click-outside");return vue.openBlock(),vue.createBlock(le,{ref:"tooltip",visible:i.tooltipVisible,offset:0,placement:i.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":i.ns.b(),persistent:""},{content:vue.withCtx(()=>[i.multiple?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$s,[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("content"))},[vue.createVNode(re,{"wrap-class":i.ns.e("wrap")},{default:vue.withCtx(()=>[vue.createVNode(oe,{modelValue:i.filteredValue,"onUpdate:modelValue":n[0]||(n[0]=ue=>i.filteredValue=ue),class:vue.normalizeClass(i.ns.e("checkbox-group"))},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.filters,ue=>(vue.openBlock(),vue.createBlock($,{key:ue.value,label:ue.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ue.text),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["wrap-class"])],2),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("bottom"))},[vue.createElementVNode("button",{class:vue.normalizeClass({[i.ns.is("disabled")]:i.filteredValue.length===0}),disabled:i.filteredValue.length===0,type:"button",onClick:n[1]||(n[1]=(...ue)=>i.handleConfirm&&i.handleConfirm(...ue))},vue.toDisplayString(i.t("el.table.confirmFilter")),11,_hoisted_2$m),vue.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=(...ue)=>i.handleReset&&i.handleReset(...ue))},vue.toDisplayString(i.t("el.table.resetFilter")),1)],2)])):(vue.openBlock(),vue.createElementBlock("ul",{key:1,class:vue.normalizeClass(i.ns.e("list"))},[vue.createElementVNode("li",{class:vue.normalizeClass([i.ns.e("list-item"),{[i.ns.is("active")]:i.filterValue===void 0||i.filterValue===null}]),onClick:n[3]||(n[3]=ue=>i.handleSelect(null))},vue.toDisplayString(i.t("el.table.clearFilter")),3),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.filters,ue=>(vue.openBlock(),vue.createElementBlock("li",{key:ue.value,class:vue.normalizeClass([i.ns.e("list-item"),i.ns.is("active",i.isActive(ue))]),label:ue.value,onClick:de=>i.handleSelect(ue.value)},vue.toDisplayString(ue.text),11,_hoisted_3$g))),128))],2))]),default:vue.withCtx(()=>[vue.withDirectives((vue.openBlock(),vue.createElementBlock("span",{class:vue.normalizeClass([`${i.ns.namespace.value}-table__column-filter-trigger`,`${i.ns.namespace.value}-none-outline`]),onClick:n[4]||(n[4]=(...ue)=>i.showFilterPanel&&i.showFilterPanel(...ue))},[vue.createVNode(ae,null,{default:vue.withCtx(()=>[i.column.filterOpened?(vue.openBlock(),vue.createBlock(Ce,{key:0})):(vue.openBlock(),vue.createBlock(ie,{key:1}))]),_:1})],2)),[[Ie,i.hideFilterPanel,i.popperPaneRef]])]),_:1},8,["visible","placement","popper-class"])}var FilterPanel=_export_sfc$1(_sfc_main$D,[["render",_sfc_render$5],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/filter-panel.vue"]]);function useLayoutObserver(i){const n=vue.getCurrentInstance();vue.onBeforeMount(()=>{r.value.addObserver(n)}),vue.onMounted(()=>{g(r.value),k(r.value)}),vue.onUpdated(()=>{g(r.value),k(r.value)}),vue.onUnmounted(()=>{r.value.removeObserver(n)});const r=vue.computed(()=>{const V=i.layout;if(!V)throw new Error("Can not find table layout.");return V}),g=V=>{var $;const oe=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col"))||[];if(!oe.length)return;const re=V.getFlattenColumns(),Ce={};re.forEach(ie=>{Ce[ie.id]=ie});for(let ie=0,ae=oe.length;ie<ae;ie++){const le=oe[ie],Ie=le.getAttribute("name"),ue=Ce[Ie];ue&&le.setAttribute("width",ue.realWidth||ue.width)}},k=V=>{var $,oe;const re=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let ie=0,ae=re.length;ie<ae;ie++)re[ie].setAttribute("width",V.scrollY.value?V.gutterWidth:"0");const Ce=((oe=i.vnode.el)==null?void 0:oe.querySelectorAll("th.gutter"))||[];for(let ie=0,ae=Ce.length;ie<ae;ie++){const le=Ce[ie];le.style.width=V.scrollY.value?`${V.gutterWidth}px`:"0",le.style.display=V.scrollY.value?"":"none"}};return{tableLayout:r.value,onColumnsChange:g,onScrollableChange:k}}const TABLE_INJECTION_KEY=Symbol("ElTable");function useEvent(i,n){const r=vue.getCurrentInstance(),g=vue.inject(TABLE_INJECTION_KEY),k=de=>{de.stopPropagation()},V=(de,Ne)=>{!Ne.filters&&Ne.sortable?ue(de,Ne,!1):Ne.filterable&&!Ne.sortable&&k(de),g==null||g.emit("header-click",Ne,de)},$=(de,Ne)=>{g==null||g.emit("header-contextmenu",Ne,de)},oe=vue.ref(null),re=vue.ref(!1),Ce=vue.ref({}),ie=(de,Ne)=>{if(isClient&&!(Ne.children&&Ne.children.length>0)&&oe.value&&i.border){re.value=!0;const he=g;n("set-drag-visible",!0);const ze=(he==null?void 0:he.vnode.el).getBoundingClientRect().left,Fe=r.vnode.el.querySelector(`th.${Ne.id}`),xe=Fe.getBoundingClientRect(),_e=xe.left-ze+30;addClass(Fe,"noclick"),Ce.value={startMouseLeft:de.clientX,startLeft:xe.right-ze,startColumnLeft:xe.left-ze,tableLeft:ze};const Dt=he==null?void 0:he.refs.resizeProxy;Dt.style.left=`${Ce.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const $e=Ve=>{const Oe=Ve.clientX-Ce.value.startMouseLeft,At=Ce.value.startLeft+Oe;Dt.style.left=`${Math.max(_e,At)}px`},Ue=()=>{if(re.value){const{startColumnLeft:Ve,startLeft:Oe}=Ce.value,qe=Number.parseInt(Dt.style.left,10)-Ve;Ne.width=Ne.realWidth=qe,he==null||he.emit("header-dragend",Ne.width,Oe-Ve,Ne,de),requestAnimationFrame(()=>{i.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",re.value=!1,oe.value=null,Ce.value={},n("set-drag-visible",!1)}document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",Ue),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{removeClass(Fe,"noclick")},0)};document.addEventListener("mousemove",$e),document.addEventListener("mouseup",Ue)}},ae=(de,Ne)=>{if(Ne.children&&Ne.children.length>0)return;const he=de.target;if(!isElement(he))return;const pe=he==null?void 0:he.closest("th");if(!(!Ne||!Ne.resizable)&&!re.value&&i.border){const ze=pe.getBoundingClientRect(),Fe=document.body.style;ze.width>12&&ze.right-de.pageX<8?(Fe.cursor="col-resize",hasClass(pe,"is-sortable")&&(pe.style.cursor="col-resize"),oe.value=Ne):re.value||(Fe.cursor="",hasClass(pe,"is-sortable")&&(pe.style.cursor="pointer"),oe.value=null)}},le=()=>{isClient&&(document.body.style.cursor="")},Ie=({order:de,sortOrders:Ne})=>{if(de==="")return Ne[0];const he=Ne.indexOf(de||null);return Ne[he>Ne.length-2?0:he+1]},ue=(de,Ne,he)=>{var pe;de.stopPropagation();const ze=Ne.order===he?null:he||Ie(Ne),Fe=(pe=de.target)==null?void 0:pe.closest("th");if(Fe&&hasClass(Fe,"noclick")){removeClass(Fe,"noclick");return}if(!Ne.sortable)return;const xe=i.store.states;let _e=xe.sortProp.value,Dt;const $e=xe.sortingColumn.value;($e!==Ne||$e===Ne&&$e.order===null)&&($e&&($e.order=null),xe.sortingColumn.value=Ne,_e=Ne.property),ze?Dt=Ne.order=ze:Dt=Ne.order=null,xe.sortProp.value=_e,xe.sortOrder.value=Dt,g==null||g.store.commit("changeSortCondition")};return{handleHeaderClick:V,handleHeaderContextMenu:$,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:ue,handleFilterClick:k}}function useStyle$2(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getHeaderRowStyle:oe=>{const re=n==null?void 0:n.props.headerRowStyle;return typeof re=="function"?re.call(null,{rowIndex:oe}):re},getHeaderRowClass:oe=>{const re=[],Ce=n==null?void 0:n.props.headerRowClassName;return typeof Ce=="string"?re.push(Ce):typeof Ce=="function"&&re.push(Ce.call(null,{rowIndex:oe})),re.join(" ")},getHeaderCellStyle:(oe,re,Ce,ie)=>{var ae;let le=(ae=n==null?void 0:n.props.headerCellStyle)!=null?ae:{};typeof le=="function"&&(le=le.call(null,{rowIndex:oe,columnIndex:re,row:Ce,column:ie}));const Ie=getFixedColumnOffset(re,ie.fixed,i.store,Ce);return ensurePosition(Ie,"left"),ensurePosition(Ie,"right"),Object.assign({},le,Ie)},getHeaderCellClass:(oe,re,Ce,ie)=>{const ae=getFixedColumnsClass(r.b(),re,ie.fixed,i.store,Ce),le=[ie.id,ie.order,ie.headerAlign,ie.className,ie.labelClassName,...ae];ie.children||le.push("is-leaf"),ie.sortable&&le.push("is-sortable");const Ie=n==null?void 0:n.props.headerCellClassName;return typeof Ie=="string"?le.push(Ie):typeof Ie=="function"&&le.push(Ie.call(null,{rowIndex:oe,columnIndex:re,row:Ce,column:ie})),le.push(r.e("cell")),le.filter(ue=>!!ue).join(" ")}}}const getAllColumns=i=>{const n=[];return i.forEach(r=>{r.children?(n.push(r),n.push.apply(n,getAllColumns(r.children))):n.push(r)}),n},convertToRows=i=>{let n=1;const r=(V,$)=>{if($&&(V.level=$.level+1,n<V.level&&(n=V.level)),V.children){let oe=0;V.children.forEach(re=>{r(re,V),oe+=re.colSpan}),V.colSpan=oe}else V.colSpan=1};i.forEach(V=>{V.level=1,r(V,void 0)});const g=[];for(let V=0;V<n;V++)g.push([]);return getAllColumns(i).forEach(V=>{V.children?(V.rowSpan=1,V.children.forEach($=>$.isSubColumn=!0)):V.rowSpan=n-V.level+1,g[V.level-1].push(V)}),g};function useUtils$1(i){const n=vue.inject(TABLE_INJECTION_KEY),r=vue.computed(()=>convertToRows(i.store.states.originColumns.value));return{isGroup:vue.computed(()=>{const V=r.value.length>1;return V&&n&&(n.state.isGroup.value=!0),V}),toggleAllSelection:V=>{V.stopPropagation(),n==null||n.store.commit("toggleAllSelection")},columnRows:r}}var TableHeader=vue.defineComponent({name:"ElTableHeader",components:{ElCheckbox},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(i,{emit:n}){const r=vue.getCurrentInstance(),g=vue.inject(TABLE_INJECTION_KEY),k=useNamespace("table"),V=vue.ref({}),{onColumnsChange:$,onScrollableChange:oe}=useLayoutObserver(g);vue.onMounted(async()=>{await vue.nextTick(),await vue.nextTick();const{prop:_e,order:Dt}=i.defaultSort;g==null||g.store.commit("sort",{prop:_e,order:Dt,init:!0})});const{handleHeaderClick:re,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue}=useEvent(i,n),{getHeaderRowStyle:de,getHeaderRowClass:Ne,getHeaderCellStyle:he,getHeaderCellClass:pe}=useStyle$2(i),{isGroup:ze,toggleAllSelection:Fe,columnRows:xe}=useUtils$1(i);return r.state={onColumnsChange:$,onScrollableChange:oe},r.filterPanels=V,{ns:k,filterPanels:V,onColumnsChange:$,onScrollableChange:oe,columnRows:xe,getHeaderRowClass:Ne,getHeaderRowStyle:de,getHeaderCellClass:pe,getHeaderCellStyle:he,handleHeaderClick:re,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue,isGroup:ze,toggleAllSelection:Fe}},render(){const{ns:i,isGroup:n,columnRows:r,getHeaderCellStyle:g,getHeaderCellClass:k,getHeaderRowClass:V,getHeaderRowStyle:$,handleHeaderClick:oe,handleHeaderContextMenu:re,handleMouseDown:Ce,handleMouseMove:ie,handleSortClick:ae,handleMouseOut:le,store:Ie,$parent:ue}=this;let de=1;return vue.h("thead",{class:{[i.is("group")]:n}},r.map((Ne,he)=>vue.h("tr",{class:V(he),key:he,style:$(he)},Ne.map((pe,ze)=>(pe.rowSpan>de&&(de=pe.rowSpan),vue.h("th",{class:k(he,ze,Ne,pe),colspan:pe.colSpan,key:`${pe.id}-thead`,rowspan:pe.rowSpan,style:g(he,ze,Ne,pe),onClick:Fe=>oe(Fe,pe),onContextmenu:Fe=>re(Fe,pe),onMousedown:Fe=>Ce(Fe,pe),onMousemove:Fe=>ie(Fe,pe),onMouseout:le},[vue.h("div",{class:["cell",pe.filteredValue&&pe.filteredValue.length>0?"highlight":""]},[pe.renderHeader?pe.renderHeader({column:pe,$index:ze,store:Ie,_self:ue}):pe.label,pe.sortable&&vue.h("span",{onClick:Fe=>ae(Fe,pe),class:"caret-wrapper"},[vue.h("i",{onClick:Fe=>ae(Fe,pe,"ascending"),class:"sort-caret ascending"}),vue.h("i",{onClick:Fe=>ae(Fe,pe,"descending"),class:"sort-caret descending"})]),pe.filterable&&vue.h(FilterPanel,{store:Ie,placement:pe.filterPlacement||"bottom-start",column:pe,upDataColumn:(Fe,xe)=>{pe[Fe]=xe}})])]))))))}});function useEvents(i){const n=vue.inject(TABLE_INJECTION_KEY),r=vue.ref(""),g=vue.ref(vue.h("div")),{nextZIndex:k}=useZIndex(),V=(Ie,ue,de)=>{var Ne;const he=n,pe=getCell(Ie);let ze;const Fe=(Ne=he==null?void 0:he.vnode.el)==null?void 0:Ne.dataset.prefix;pe&&(ze=getColumnByCell({columns:i.store.states.columns.value},pe,Fe),ze&&(he==null||he.emit(`cell-${de}`,ue,ze,pe,Ie))),he==null||he.emit(`row-${de}`,ue,ze,Ie)},$=(Ie,ue)=>{V(Ie,ue,"dblclick")},oe=(Ie,ue)=>{i.store.commit("setCurrentRow",ue),V(Ie,ue,"click")},re=(Ie,ue)=>{V(Ie,ue,"contextmenu")},Ce=debounce(Ie=>{i.store.commit("setHoverRow",Ie)},30),ie=debounce(()=>{i.store.commit("setHoverRow",null)},30);return{handleDoubleClick:$,handleClick:oe,handleContextMenu:re,handleMouseEnter:Ce,handleMouseLeave:ie,handleCellMouseEnter:(Ie,ue,de)=>{var Ne;const he=n,pe=getCell(Ie),ze=(Ne=he==null?void 0:he.vnode.el)==null?void 0:Ne.dataset.prefix;if(pe){const $e=getColumnByCell({columns:i.store.states.columns.value},pe,ze),Ue=he.hoverState={cell:pe,column:$e,row:ue};he==null||he.emit("cell-mouse-enter",Ue.row,Ue.column,Ue.cell,Ie)}if(!de)return;const Fe=Ie.target.querySelector(".cell");if(!(hasClass(Fe,`${ze}-tooltip`)&&Fe.childNodes.length))return;const xe=document.createRange();xe.setStart(Fe,0),xe.setEnd(Fe,Fe.childNodes.length);const _e=Math.round(xe.getBoundingClientRect().width),Dt=(Number.parseInt(getStyle$1(Fe,"paddingLeft"),10)||0)+(Number.parseInt(getStyle$1(Fe,"paddingRight"),10)||0);(_e+Dt>Fe.offsetWidth||Fe.scrollWidth>Fe.offsetWidth)&&createTablePopper(n==null?void 0:n.refs.tableWrapper,pe,pe.innerText||pe.textContent,k,de)},handleCellMouseLeave:Ie=>{if(!getCell(Ie))return;const de=n==null?void 0:n.hoverState;n==null||n.emit("cell-mouse-leave",de==null?void 0:de.row,de==null?void 0:de.column,de==null?void 0:de.cell,Ie)},tooltipContent:r,tooltipTrigger:g}}function useStyles(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getRowStyle:(Ce,ie)=>{const ae=n==null?void 0:n.props.rowStyle;return typeof ae=="function"?ae.call(null,{row:Ce,rowIndex:ie}):ae||null},getRowClass:(Ce,ie)=>{const ae=[r.e("row")];n!=null&&n.props.highlightCurrentRow&&Ce===i.store.states.currentRow.value&&ae.push("current-row"),i.stripe&&ie%2===1&&ae.push(r.em("row","striped"));const le=n==null?void 0:n.props.rowClassName;return typeof le=="string"?ae.push(le):typeof le=="function"&&ae.push(le.call(null,{row:Ce,rowIndex:ie})),ae},getCellStyle:(Ce,ie,ae,le)=>{const Ie=n==null?void 0:n.props.cellStyle;let ue=Ie??{};typeof Ie=="function"&&(ue=Ie.call(null,{rowIndex:Ce,columnIndex:ie,row:ae,column:le}));const de=getFixedColumnOffset(ie,i==null?void 0:i.fixed,i.store);return ensurePosition(de,"left"),ensurePosition(de,"right"),Object.assign({},ue,de)},getCellClass:(Ce,ie,ae,le,Ie)=>{const ue=getFixedColumnsClass(r.b(),ie,i==null?void 0:i.fixed,i.store,void 0,Ie),de=[le.id,le.align,le.className,...ue],Ne=n==null?void 0:n.props.cellClassName;return typeof Ne=="string"?de.push(Ne):typeof Ne=="function"&&de.push(Ne.call(null,{rowIndex:Ce,columnIndex:ie,row:ae,column:le})),de.push(r.e("cell")),de.filter(he=>!!he).join(" ")},getSpan:(Ce,ie,ae,le)=>{let Ie=1,ue=1;const de=n==null?void 0:n.props.spanMethod;if(typeof de=="function"){const Ne=de({row:Ce,column:ie,rowIndex:ae,columnIndex:le});Array.isArray(Ne)?(Ie=Ne[0],ue=Ne[1]):typeof Ne=="object"&&(Ie=Ne.rowspan,ue=Ne.colspan)}return{rowspan:Ie,colspan:ue}},getColspanRealWidth:(Ce,ie,ae)=>{if(ie<1)return Ce[ae].realWidth;const le=Ce.map(({realWidth:Ie,width:ue})=>Ie||ue).slice(ae,ae+ie);return Number(le.reduce((Ie,ue)=>Number(Ie)+Number(ue),-1))}}}function useRender$1(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table"),{handleDoubleClick:g,handleClick:k,handleContextMenu:V,handleMouseEnter:$,handleMouseLeave:oe,handleCellMouseEnter:re,handleCellMouseLeave:Ce,tooltipContent:ie,tooltipTrigger:ae}=useEvents(i),{getRowStyle:le,getRowClass:Ie,getCellStyle:ue,getCellClass:de,getSpan:Ne,getColspanRealWidth:he}=useStyles(i),pe=vue.computed(()=>i.store.states.columns.value.findIndex(({type:Dt})=>Dt==="default")),ze=(Dt,$e)=>{const Ue=n.props.rowKey;return Ue?getRowIdentity(Dt,Ue):$e},Fe=(Dt,$e,Ue,Ve=!1)=>{const{tooltipEffect:Oe,tooltipOptions:At,store:qe}=i,{indent:Lt,columns:kt}=qe.states,jt=Ie(Dt,$e);let ti=!0;Ue&&(jt.push(r.em("row",`level-${Ue.level}`)),ti=Ue.display);const ei=ti?null:{display:"none"};return vue.h("tr",{style:[ei,le(Dt,$e)],class:jt,key:ze(Dt,$e),onDblclick:Pt=>g(Pt,Dt),onClick:Pt=>k(Pt,Dt),onContextmenu:Pt=>V(Pt,Dt),onMouseenter:()=>$($e),onMouseleave:oe},kt.value.map((Pt,ni)=>{const{rowspan:gi,colspan:di}=Ne(Dt,Pt,$e,ni);if(!gi||!di)return null;const li={...Pt};li.realWidth=he(kt.value,di,ni);const ai={store:i.store,_self:i.context||n,column:li,row:Dt,$index:$e,cellIndex:ni,expanded:Ve};ni===pe.value&&Ue&&(ai.treeNode={indent:Ue.level*Lt.value,level:Ue.level},typeof Ue.expanded=="boolean"&&(ai.treeNode.expanded=Ue.expanded,"loading"in Ue&&(ai.treeNode.loading=Ue.loading),"noLazyChildren"in Ue&&(ai.treeNode.noLazyChildren=Ue.noLazyChildren)));const ci=`${$e},${ni}`,pi=li.columnKey||li.rawColumnKey||"",yi=xe(ni,Pt,ai),Ai=Pt.showOverflowTooltip&&merge$2({effect:Oe},At,Pt.showOverflowTooltip);return vue.h("td",{style:ue($e,ni,Dt,Pt),class:de($e,ni,Dt,Pt,di-1),key:`${pi}${ci}`,rowspan:gi,colspan:di,onMouseenter:hi=>re(hi,Dt,Ai),onMouseleave:Ce},[yi])}))},xe=(Dt,$e,Ue)=>$e.renderCell(Ue);return{wrappedRowRender:(Dt,$e)=>{const Ue=i.store,{isRowExpanded:Ve,assertRowKey:Oe}=Ue,{treeData:At,lazyTreeNodeMap:qe,childrenColumnName:Lt,rowKey:kt}=Ue.states,jt=Ue.states.columns.value;if(jt.some(({type:ei})=>ei==="expand")){const ei=Ve(Dt),Pt=Fe(Dt,$e,void 0,ei),ni=n.renderExpanded;return ei?ni?[[Pt,vue.h("tr",{key:`expanded-row__${Pt.key}`},[vue.h("td",{colspan:jt.length,class:`${r.e("cell")} ${r.e("expanded-cell")}`},[ni({row:Dt,$index:$e,store:Ue,expanded:ei})])])]]:(console.error("[Element Error]renderExpanded is required."),Pt):[[Pt]]}else if(Object.keys(At.value).length){Oe();const ei=getRowIdentity(Dt,kt.value);let Pt=At.value[ei],ni=null;Pt&&(ni={expanded:Pt.expanded,level:Pt.level,display:!0},typeof Pt.lazy=="boolean"&&(typeof Pt.loaded=="boolean"&&Pt.loaded&&(ni.noLazyChildren=!(Pt.children&&Pt.children.length)),ni.loading=Pt.loading));const gi=[Fe(Dt,$e,ni)];if(Pt){let di=0;const li=(ci,pi)=>{ci&&ci.length&&pi&&ci.forEach(yi=>{const Ai={display:pi.display&&pi.expanded,level:pi.level+1,expanded:!1,noLazyChildren:!1,loading:!1},hi=getRowIdentity(yi,kt.value);if(hi==null)throw new Error("For nested data item, row-key is required.");if(Pt={...At.value[hi]},Pt&&(Ai.expanded=Pt.expanded,Pt.level=Pt.level||Ai.level,Pt.display=!!(Pt.expanded&&Ai.display),typeof Pt.lazy=="boolean"&&(typeof Pt.loaded=="boolean"&&Pt.loaded&&(Ai.noLazyChildren=!(Pt.children&&Pt.children.length)),Ai.loading=Pt.loading)),di++,gi.push(Fe(yi,$e+di,Ai)),Pt){const wi=qe.value[hi]||yi[Lt.value];li(wi,Pt)}})};Pt.display=!0;const ai=qe.value[ei]||Dt[Lt.value];li(ai,Pt)}return gi}else return Fe(Dt,$e,void 0)},tooltipContent:ie,tooltipTrigger:ae}}const defaultProps$2={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean};var TableBody=vue.defineComponent({name:"ElTableBody",props:defaultProps$2,setup(i){const n=vue.getCurrentInstance(),r=vue.inject(TABLE_INJECTION_KEY),g=useNamespace("table"),{wrappedRowRender:k,tooltipContent:V,tooltipTrigger:$}=useRender$1(i),{onColumnsChange:oe,onScrollableChange:re}=useLayoutObserver(r);return vue.watch(i.store.states.hoverRow,(Ce,ie)=>{if(!i.store.states.isComplex.value||!isClient)return;let ae=window.requestAnimationFrame;ae||(ae=le=>window.setTimeout(le,16)),ae(()=>{const le=n==null?void 0:n.vnode.el,Ie=Array.from((le==null?void 0:le.children)||[]).filter(Ne=>Ne==null?void 0:Ne.classList.contains(`${g.e("row")}`)),ue=Ie[ie],de=Ie[Ce];ue&&removeClass(ue,"hover-row"),de&&addClass(de,"hover-row")})}),vue.onUnmounted(()=>{var Ce;(Ce=removePopper)==null||Ce()}),{ns:g,onColumnsChange:oe,onScrollableChange:re,wrappedRowRender:k,tooltipContent:V,tooltipTrigger:$}},render(){const{wrappedRowRender:i,store:n}=this,r=n.states.data.value||[];return vue.h("tbody",{},[r.reduce((g,k)=>g.concat(i(k,g.length)),[])])}});function hColgroup(i){const n=i.tableLayout==="auto";let r=i.columns||[];n&&r.every(k=>k.width===void 0)&&(r=[]);const g=k=>{const V={key:`${i.tableLayout}_${k.id}`,style:{},name:void 0};return n?V.style={width:`${k.width}px`}:V.name=k.id,V};return vue.h("colgroup",{},r.map(k=>vue.h("col",g(k))))}hColgroup.props=["columns","tableLayout"];function useMapState(){const i=vue.inject(TABLE_INJECTION_KEY),n=i==null?void 0:i.store,r=vue.computed(()=>n.states.fixedLeafColumnsLength.value),g=vue.computed(()=>n.states.rightFixedColumns.value.length),k=vue.computed(()=>n.states.columns.value.length),V=vue.computed(()=>n.states.fixedColumns.value.length),$=vue.computed(()=>n.states.rightFixedColumns.value.length);return{leftFixedLeafCount:r,rightFixedLeafCount:g,columnsCount:k,leftFixedCount:V,rightFixedCount:$,columns:n.states.columns}}function useStyle$1(i){const{columns:n}=useMapState(),r=useNamespace("table");return{getCellClasses:(V,$)=>{const oe=V[$],re=[r.e("cell"),oe.id,oe.align,oe.labelClassName,...getFixedColumnsClass(r.b(),$,oe.fixed,i.store)];return oe.className&&re.push(oe.className),oe.children||re.push(r.is("leaf")),re},getCellStyles:(V,$)=>{const oe=getFixedColumnOffset($,V.fixed,i.store);return ensurePosition(oe,"left"),ensurePosition(oe,"right"),oe},columns:n}}var TableFooter=vue.defineComponent({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(i){const{getCellClasses:n,getCellStyles:r,columns:g}=useStyle$1(i);return{ns:useNamespace("table"),getCellClasses:n,getCellStyles:r,columns:g}},render(){const{columns:i,getCellStyles:n,getCellClasses:r,summaryMethod:g,sumText:k,ns:V}=this,$=this.store.states.data.value;let oe=[];return g?oe=g({columns:i,data:$}):i.forEach((re,Ce)=>{if(Ce===0){oe[Ce]=k;return}const ie=$.map(ue=>Number(ue[re.property])),ae=[];let le=!0;ie.forEach(ue=>{if(!Number.isNaN(+ue)){le=!1;const de=`${ue}`.split(".")[1];ae.push(de?de.length:0)}});const Ie=Math.max.apply(null,ae);le?oe[Ce]="":oe[Ce]=ie.reduce((ue,de)=>{const Ne=Number(de);return Number.isNaN(+Ne)?ue:Number.parseFloat((ue+de).toFixed(Math.min(Ie,20)))},0)}),vue.h("table",{class:V.e("footer"),cellspacing:"0",cellpadding:"0",border:"0"},[hColgroup({columns:i}),vue.h("tbody",[vue.h("tr",{},[...i.map((re,Ce)=>vue.h("td",{key:Ce,colspan:re.colSpan,rowspan:re.rowSpan,class:r(i,Ce),style:n(re,Ce)},[vue.h("div",{class:["cell",re.labelClassName]},[oe[Ce]])]))])])])}});function useUtils(i){return{setCurrentRow:ie=>{i.commit("setCurrentRow",ie)},getSelectionRows:()=>i.getSelectionRows(),toggleRowSelection:(ie,ae)=>{i.toggleRowSelection(ie,ae,!1),i.updateAllSelected()},clearSelection:()=>{i.clearSelection()},clearFilter:ie=>{i.clearFilter(ie)},toggleAllSelection:()=>{i.commit("toggleAllSelection")},toggleRowExpansion:(ie,ae)=>{i.toggleRowExpansionAdapter(ie,ae)},clearSort:()=>{i.clearSort()},sort:(ie,ae)=>{i.commit("sort",{prop:ie,order:ae})}}}function useStyle(i,n,r,g){const k=vue.ref(!1),V=vue.ref(null),$=vue.ref(!1),oe=Pt=>{$.value=Pt},re=vue.ref({width:null,height:null,headerHeight:null}),Ce=vue.ref(!1),ie={display:"inline-block",verticalAlign:"middle"},ae=vue.ref(),le=vue.ref(0),Ie=vue.ref(0),ue=vue.ref(0),de=vue.ref(0),Ne=vue.ref(0);vue.watchEffect(()=>{n.setHeight(i.height)}),vue.watchEffect(()=>{n.setMaxHeight(i.maxHeight)}),vue.watch(()=>[i.currentRowKey,r.states.rowKey],([Pt,ni])=>{!vue.unref(ni)||!vue.unref(Pt)||r.setCurrentRowKey(`${Pt}`)},{immediate:!0}),vue.watch(()=>i.data,Pt=>{g.store.commit("setData",Pt)},{immediate:!0,deep:!0}),vue.watchEffect(()=>{i.expandRowKeys&&r.setExpandRowKeysAdapter(i.expandRowKeys)});const he=()=>{g.store.commit("setHoverRow",null),g.hoverState&&(g.hoverState=null)},pe=(Pt,ni)=>{const{pixelX:gi,pixelY:di}=ni;Math.abs(gi)>=Math.abs(di)&&(g.refs.bodyWrapper.scrollLeft+=ni.pixelX/5)},ze=vue.computed(()=>i.height||i.maxHeight||r.states.fixedColumns.value.length>0||r.states.rightFixedColumns.value.length>0),Fe=vue.computed(()=>({width:n.bodyWidth.value?`${n.bodyWidth.value}px`:""})),xe=()=>{ze.value&&n.updateElsHeight(),n.updateColumnsWidth(),requestAnimationFrame(Ue)};vue.onMounted(async()=>{await vue.nextTick(),r.updateColumns(),Ve(),requestAnimationFrame(xe);const Pt=g.vnode.el,ni=g.refs.headerWrapper;i.flexible&&Pt&&Pt.parentElement&&(Pt.parentElement.style.minWidth="0"),re.value={width:ae.value=Pt.offsetWidth,height:Pt.offsetHeight,headerHeight:i.showHeader&&ni?ni.offsetHeight:null},r.states.columns.value.forEach(gi=>{gi.filteredValue&&gi.filteredValue.length&&g.store.commit("filterChange",{column:gi,values:gi.filteredValue,silent:!0})}),g.$ready=!0});const _e=(Pt,ni)=>{if(!Pt)return;const gi=Array.from(Pt.classList).filter(di=>!di.startsWith("is-scrolling-"));gi.push(n.scrollX.value?ni:"is-scrolling-none"),Pt.className=gi.join(" ")},Dt=Pt=>{const{tableWrapper:ni}=g.refs;_e(ni,Pt)},$e=Pt=>{const{tableWrapper:ni}=g.refs;return!!(ni&&ni.classList.contains(Pt))},Ue=function(){if(!g.refs.scrollBarRef)return;if(!n.scrollX.value){const pi="is-scrolling-none";$e(pi)||Dt(pi);return}const Pt=g.refs.scrollBarRef.wrapRef;if(!Pt)return;const{scrollLeft:ni,offsetWidth:gi,scrollWidth:di}=Pt,{headerWrapper:li,footerWrapper:ai}=g.refs;li&&(li.scrollLeft=ni),ai&&(ai.scrollLeft=ni);const ci=di-gi-1;ni>=ci?Dt("is-scrolling-right"):Dt(ni===0?"is-scrolling-left":"is-scrolling-middle")},Ve=()=>{g.refs.scrollBarRef&&(g.refs.scrollBarRef.wrapRef&&useEventListener(g.refs.scrollBarRef.wrapRef,"scroll",Ue,{passive:!0}),i.fit?useResizeObserver(g.vnode.el,Oe):useEventListener(window,"resize",Oe),useResizeObserver(g.refs.bodyWrapper,()=>{var Pt,ni;Oe(),(ni=(Pt=g.refs)==null?void 0:Pt.scrollBarRef)==null||ni.update()}))},Oe=()=>{var Pt,ni,gi,di;const li=g.vnode.el;if(!g.$ready||!li)return;let ai=!1;const{width:ci,height:pi,headerHeight:yi}=re.value,Ai=ae.value=li.offsetWidth;ci!==Ai&&(ai=!0);const hi=li.offsetHeight;(i.height||ze.value)&&pi!==hi&&(ai=!0);const wi=i.tableLayout==="fixed"?g.refs.headerWrapper:(Pt=g.refs.tableHeaderRef)==null?void 0:Pt.$el;i.showHeader&&(wi==null?void 0:wi.offsetHeight)!==yi&&(ai=!0),le.value=((ni=g.refs.tableWrapper)==null?void 0:ni.scrollHeight)||0,ue.value=(wi==null?void 0:wi.scrollHeight)||0,de.value=((gi=g.refs.footerWrapper)==null?void 0:gi.offsetHeight)||0,Ne.value=((di=g.refs.appendWrapper)==null?void 0:di.offsetHeight)||0,Ie.value=le.value-ue.value-de.value-Ne.value,ai&&(re.value={width:Ai,height:hi,headerHeight:i.showHeader&&(wi==null?void 0:wi.offsetHeight)||0},xe())},At=useFormSize(),qe=vue.computed(()=>{const{bodyWidth:Pt,scrollY:ni,gutterWidth:gi}=n;return Pt.value?`${Pt.value-(ni.value?gi:0)}px`:""}),Lt=vue.computed(()=>i.maxHeight?"fixed":i.tableLayout),kt=vue.computed(()=>{if(i.data&&i.data.length)return null;let Pt="100%";i.height&&Ie.value&&(Pt=`${Ie.value}px`);const ni=ae.value;return{width:ni?`${ni}px`:"",height:Pt}}),jt=vue.computed(()=>i.height?{height:Number.isNaN(Number(i.height))?i.height:`${i.height}px`}:i.maxHeight?{maxHeight:Number.isNaN(Number(i.maxHeight))?i.maxHeight:`${i.maxHeight}px`}:{}),ti=vue.computed(()=>i.height?{height:"100%"}:i.maxHeight?Number.isNaN(Number(i.maxHeight))?{maxHeight:`calc(${i.maxHeight} - ${ue.value+de.value}px)`}:{maxHeight:`${i.maxHeight-ue.value-de.value}px`}:{});return{isHidden:k,renderExpanded:V,setDragVisible:oe,isGroup:Ce,handleMouseLeave:he,handleHeaderFooterMousewheel:pe,tableSize:At,emptyBlockStyle:kt,handleFixedMousewheel:(Pt,ni)=>{const gi=g.refs.bodyWrapper;if(Math.abs(ni.spinY)>0){const di=gi.scrollTop;ni.pixelY<0&&di!==0&&Pt.preventDefault(),ni.pixelY>0&&gi.scrollHeight-gi.clientHeight>di&&Pt.preventDefault(),gi.scrollTop+=Math.ceil(ni.pixelY/5)}else gi.scrollLeft+=Math.ceil(ni.pixelX/5)},resizeProxyVisible:$,bodyWidth:qe,resizeState:re,doLayout:xe,tableBodyStyles:Fe,tableLayout:Lt,scrollbarViewStyle:ie,tableInnerStyle:jt,scrollbarStyle:ti}}function useKeyRender(i){const n=vue.ref(),r=()=>{const k=i.vnode.el.querySelector(".hidden-columns"),V={childList:!0,subtree:!0},$=i.store.states.updateOrderFns;n.value=new MutationObserver(()=>{$.forEach(oe=>oe())}),n.value.observe(k,V)};vue.onMounted(()=>{r()}),vue.onUnmounted(()=>{var g;(g=n.value)==null||g.disconnect()})}var defaultProps$1={data:{type:Array,default:()=>[]},size:useSizeProp,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:{type:Boolean,default:!1},flexible:Boolean,showOverflowTooltip:[Boolean,Object]};const useScrollbar=()=>{const i=vue.ref(),n=(V,$)=>{const oe=i.value;oe&&oe.scrollTo(V,$)},r=(V,$)=>{const oe=i.value;oe&&isNumber$1($)&&["Top","Left"].includes(V)&&oe[`setScroll${V}`]($)};return{scrollBarRef:i,scrollTo:n,setScrollTop:V=>r("Top",V),setScrollLeft:V=>r("Left",V)}};let tableIdSeed=1;const _sfc_main$C=vue.defineComponent({name:"ElTable",directives:{Mousewheel},components:{TableHeader,TableBody,TableFooter,ElScrollbar,hColgroup},props:defaultProps$1,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(i){const{t:n}=useLocale(),r=useNamespace("table"),g=vue.getCurrentInstance();vue.provide(TABLE_INJECTION_KEY,g);const k=createStore(g,i);g.store=k;const V=new TableLayout({store:g.store,table:g,fit:i.fit,showHeader:i.showHeader});g.layout=V;const $=vue.computed(()=>(k.states.data.value||[]).length===0),{setCurrentRow:oe,getSelectionRows:re,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,sort:de}=useUtils(k),{isHidden:Ne,renderExpanded:he,setDragVisible:pe,isGroup:ze,handleMouseLeave:Fe,handleHeaderFooterMousewheel:xe,tableSize:_e,emptyBlockStyle:Dt,handleFixedMousewheel:$e,resizeProxyVisible:Ue,bodyWidth:Ve,resizeState:Oe,doLayout:At,tableBodyStyles:qe,tableLayout:Lt,scrollbarViewStyle:kt,tableInnerStyle:jt,scrollbarStyle:ti}=useStyle(i,V,k,g),{scrollBarRef:ei,scrollTo:Pt,setScrollLeft:ni,setScrollTop:gi}=useScrollbar(),di=debounce(At,50),li=`${r.namespace.value}-table_${tableIdSeed++}`;g.tableId=li,g.state={isGroup:ze,resizeState:Oe,doLayout:At,debouncedUpdateLayout:di};const ai=vue.computed(()=>i.sumText||n("el.table.sumText")),ci=vue.computed(()=>i.emptyText||n("el.table.emptyText"));return useKeyRender(g),{ns:r,layout:V,store:k,handleHeaderFooterMousewheel:xe,handleMouseLeave:Fe,tableId:li,tableSize:_e,isHidden:Ne,isEmpty:$,renderExpanded:he,resizeProxyVisible:Ue,resizeState:Oe,isGroup:ze,bodyWidth:Ve,tableBodyStyles:qe,emptyBlockStyle:Dt,debouncedUpdateLayout:di,handleFixedMousewheel:$e,setCurrentRow:oe,getSelectionRows:re,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,doLayout:At,sort:de,t:n,setDragVisible:pe,context:g,computedSumText:ai,computedEmptyText:ci,tableLayout:Lt,scrollbarViewStyle:kt,tableInnerStyle:jt,scrollbarStyle:ti,scrollBarRef:ei,scrollTo:Pt,setScrollLeft:ni,setScrollTop:gi}}}),_hoisted_1$r=["data-prefix"],_hoisted_2$l={ref:"hiddenColumns",class:"hidden-columns"};function _sfc_render$4(i,n,r,g,k,V){const $=vue.resolveComponent("hColgroup"),oe=vue.resolveComponent("table-header"),re=vue.resolveComponent("table-body"),Ce=vue.resolveComponent("el-scrollbar"),ie=vue.resolveComponent("table-footer"),ae=vue.resolveDirective("mousewheel");return vue.openBlock(),vue.createElementBlock("div",{ref:"tableWrapper",class:vue.normalizeClass([{[i.ns.m("fit")]:i.fit,[i.ns.m("striped")]:i.stripe,[i.ns.m("border")]:i.border||i.isGroup,[i.ns.m("hidden")]:i.isHidden,[i.ns.m("group")]:i.isGroup,[i.ns.m("fluid-height")]:i.maxHeight,[i.ns.m("scrollable-x")]:i.layout.scrollX.value,[i.ns.m("scrollable-y")]:i.layout.scrollY.value,[i.ns.m("enable-row-hover")]:!i.store.states.isComplex.value,[i.ns.m("enable-row-transition")]:(i.store.states.data.value||[]).length!==0&&(i.store.states.data.value||[]).length<100,"has-footer":i.showSummary},i.ns.m(i.tableSize),i.className,i.ns.b(),i.ns.m(`layout-${i.tableLayout}`)]),style:vue.normalizeStyle(i.style),"data-prefix":i.ns.namespace.value,onMouseleave:n[0]||(n[0]=(...le)=>i.handleMouseLeave&&i.handleMouseLeave(...le))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("inner-wrapper")),style:vue.normalizeStyle(i.tableInnerStyle)},[vue.createElementVNode("div",_hoisted_2$l,[vue.renderSlot(i.$slots,"default")],512),i.showHeader&&i.tableLayout==="fixed"?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"headerWrapper",class:vue.normalizeClass(i.ns.e("header-wrapper"))},[vue.createElementVNode("table",{ref:"tableHeader",class:vue.normalizeClass(i.ns.e("header")),style:vue.normalizeStyle(i.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[vue.createVNode($,{columns:i.store.states.columns.value,"table-layout":i.tableLayout},null,8,["columns","table-layout"]),vue.createVNode(oe,{ref:"tableHeaderRef",border:i.border,"default-sort":i.defaultSort,store:i.store,onSetDragVisible:i.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[ae,i.handleHeaderFooterMousewheel]]):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{ref:"bodyWrapper",class:vue.normalizeClass(i.ns.e("body-wrapper"))},[vue.createVNode(Ce,{ref:"scrollBarRef","view-style":i.scrollbarViewStyle,"wrap-style":i.scrollbarStyle,always:i.scrollbarAlwaysOn},{default:vue.withCtx(()=>[vue.createElementVNode("table",{ref:"tableBody",class:vue.normalizeClass(i.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:vue.normalizeStyle({width:i.bodyWidth,tableLayout:i.tableLayout})},[vue.createVNode($,{columns:i.store.states.columns.value,"table-layout":i.tableLayout},null,8,["columns","table-layout"]),i.showHeader&&i.tableLayout==="auto"?(vue.openBlock(),vue.createBlock(oe,{key:0,ref:"tableHeaderRef",border:i.border,"default-sort":i.defaultSort,store:i.store,onSetDragVisible:i.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])):vue.createCommentVNode("v-if",!0),vue.createVNode(re,{context:i.context,highlight:i.highlightCurrentRow,"row-class-name":i.rowClassName,"tooltip-effect":i.tooltipEffect,"tooltip-options":i.tooltipOptions,"row-style":i.rowStyle,store:i.store,stripe:i.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"])],6),i.isEmpty?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"emptyBlock",style:vue.normalizeStyle(i.emptyBlockStyle),class:vue.normalizeClass(i.ns.e("empty-block"))},[vue.createElementVNode("span",{class:vue.normalizeClass(i.ns.e("empty-text"))},[vue.renderSlot(i.$slots,"empty",{},()=>[vue.createTextVNode(vue.toDisplayString(i.computedEmptyText),1)])],2)],6)):vue.createCommentVNode("v-if",!0),i.$slots.append?(vue.openBlock(),vue.createElementBlock("div",{key:1,ref:"appendWrapper",class:vue.normalizeClass(i.ns.e("append-wrapper"))},[vue.renderSlot(i.$slots,"append")],2)):vue.createCommentVNode("v-if",!0)]),_:3},8,["view-style","wrap-style","always"])],2),i.showSummary?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:1,ref:"footerWrapper",class:vue.normalizeClass(i.ns.e("footer-wrapper"))},[vue.createVNode(ie,{border:i.border,"default-sort":i.defaultSort,store:i.store,style:vue.normalizeStyle(i.tableBodyStyles),"sum-text":i.computedSumText,"summary-method":i.summaryMethod},null,8,["border","default-sort","store","style","sum-text","summary-method"])],2)),[[vue.vShow,!i.isEmpty],[ae,i.handleHeaderFooterMousewheel]]):vue.createCommentVNode("v-if",!0),i.border||i.isGroup?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(i.ns.e("border-left-patch"))},null,2)):vue.createCommentVNode("v-if",!0)],6),vue.withDirectives(vue.createElementVNode("div",{ref:"resizeProxy",class:vue.normalizeClass(i.ns.e("column-resize-proxy"))},null,2),[[vue.vShow,i.resizeProxyVisible]])],46,_hoisted_1$r)}var Table=_export_sfc$1(_sfc_main$C,[["render",_sfc_render$4],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/table.vue"]]);const defaultClassNames={selection:"table-column--selection",expand:"table__expand-column"},cellStarts={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},getDefaultClassName=i=>defaultClassNames[i]||"",cellForced={selection:{renderHeader({store:i}){function n(){return i.states.data.value&&i.states.data.value.length===0}return vue.h(ElCheckbox,{disabled:n(),size:i.states.tableSize.value,indeterminate:i.states.selection.value.length>0&&!i.states.isAllSelected.value,"onUpdate:modelValue":i.toggleAllSelection,modelValue:i.states.isAllSelected.value})},renderCell({row:i,column:n,store:r,$index:g}){return vue.h(ElCheckbox,{disabled:n.selectable?!n.selectable.call(null,i,g):!1,size:r.states.tableSize.value,onChange:()=>{r.commit("rowSelectedChanged",i)},onClick:k=>k.stopPropagation(),modelValue:r.isSelected(i)})},sortable:!1,resizable:!1},index:{renderHeader({column:i}){return i.label||"#"},renderCell({column:i,$index:n}){let r=n+1;const g=i.index;return typeof g=="number"?r=n+g:typeof g=="function"&&(r=g(n)),vue.h("div",{},[r])},sortable:!1},expand:{renderHeader({column:i}){return i.label||""},renderCell({row:i,store:n,expanded:r}){const{ns:g}=n,k=[g.e("expand-icon")];r&&k.push(g.em("expand-icon","expanded"));const V=function($){$.stopPropagation(),n.toggleRowExpansion(i)};return vue.h("div",{class:k,onClick:V},{default:()=>[vue.h(ElIcon,null,{default:()=>[vue.h(arrow_right_default)]})]})},sortable:!1,resizable:!1}};function defaultRenderCell({row:i,column:n,$index:r}){var g;const k=n.property,V=k&&getProp(i,k).value;return n&&n.formatter?n.formatter(i,n,V,r):((g=V==null?void 0:V.toString)==null?void 0:g.call(V))||""}function treeCellPrefix({row:i,treeNode:n,store:r},g=!1){const{ns:k}=r;if(!n)return g?[vue.h("span",{class:k.e("placeholder")})]:null;const V=[],$=function(oe){oe.stopPropagation(),!n.loading&&r.loadOrToggle(i)};if(n.indent&&V.push(vue.h("span",{class:k.e("indent"),style:{"padding-left":`${n.indent}px`}})),typeof n.expanded=="boolean"&&!n.noLazyChildren){const oe=[k.e("expand-icon"),n.expanded?k.em("expand-icon","expanded"):""];let re=arrow_right_default;n.loading&&(re=loading_default),V.push(vue.h("div",{class:oe,onClick:$},{default:()=>[vue.h(ElIcon,{class:{[k.is("loading")]:n.loading}},{default:()=>[vue.h(re)]})]}))}else V.push(vue.h("span",{class:k.e("placeholder")}));return V}function getAllAliases(i,n){return i.reduce((r,g)=>(r[g]=g,r),n)}function useWatcher(i,n){const r=vue.getCurrentInstance();return{registerComplexWatchers:()=>{const V=["fixed"],$={realWidth:"width",realMinWidth:"minWidth"},oe=getAllAliases(V,$);Object.keys(oe).forEach(re=>{const Ce=$[re];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{let ae=ie;Ce==="width"&&re==="realWidth"&&(ae=parseWidth(ie)),Ce==="minWidth"&&re==="realMinWidth"&&(ae=parseMinWidth(ie)),r.columnConfig.value[Ce]=ae,r.columnConfig.value[re]=ae;const le=Ce==="fixed";i.value.store.scheduleLayout(le)})})},registerNormalWatchers:()=>{const V=["label","filters","filterMultiple","sortable","index","formatter","className","labelClassName","showOverflowTooltip"],$={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},oe=getAllAliases(V,$);Object.keys(oe).forEach(re=>{const Ce=$[re];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{r.columnConfig.value[re]=ie})})}}}function useRender(i,n,r){const g=vue.getCurrentInstance(),k=vue.ref(""),V=vue.ref(!1),$=vue.ref(),oe=vue.ref(),re=useNamespace("table");vue.watchEffect(()=>{$.value=i.align?`is-${i.align}`:null,$.value}),vue.watchEffect(()=>{oe.value=i.headerAlign?`is-${i.headerAlign}`:$.value,oe.value});const Ce=vue.computed(()=>{let Fe=g.vnode.vParent||g.parent;for(;Fe&&!Fe.tableId&&!Fe.columnId;)Fe=Fe.vnode.vParent||Fe.parent;return Fe}),ie=vue.computed(()=>{const{store:Fe}=g.parent;if(!Fe)return!1;const{treeData:xe}=Fe.states,_e=xe.value;return _e&&Object.keys(_e).length>0}),ae=vue.ref(parseWidth(i.width)),le=vue.ref(parseMinWidth(i.minWidth)),Ie=Fe=>(ae.value&&(Fe.width=ae.value),le.value&&(Fe.minWidth=le.value),!ae.value&&le.value&&(Fe.width=void 0),Fe.minWidth||(Fe.minWidth=80),Fe.realWidth=Number(Fe.width===void 0?Fe.minWidth:Fe.width),Fe),ue=Fe=>{const xe=Fe.type,_e=cellForced[xe]||{};Object.keys(_e).forEach($e=>{const Ue=_e[$e];$e!=="className"&&Ue!==void 0&&(Fe[$e]=Ue)});const Dt=getDefaultClassName(xe);if(Dt){const $e=`${vue.unref(re.namespace)}-${Dt}`;Fe.className=Fe.className?`${Fe.className} ${$e}`:$e}return Fe},de=Fe=>{Array.isArray(Fe)?Fe.forEach(_e=>xe(_e)):xe(Fe);function xe(_e){var Dt;((Dt=_e==null?void 0:_e.type)==null?void 0:Dt.name)==="ElTableColumn"&&(_e.vParent=g)}};return{columnId:k,realAlign:$,isSubColumn:V,realHeaderAlign:oe,columnOrTableParent:Ce,setColumnWidth:Ie,setColumnForcedProps:ue,setColumnRenders:Fe=>{i.renderHeader?debugWarn("TableColumn","Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."):Fe.type!=="selection"&&(Fe.renderHeader=_e=>{g.columnConfig.value.label;const Dt=n.header;return Dt?Dt(_e):Fe.label});let xe=Fe.renderCell;return Fe.type==="expand"?(Fe.renderCell=_e=>vue.h("div",{class:"cell"},[xe(_e)]),r.value.renderExpanded=_e=>n.default?n.default(_e):n.default):(xe=xe||defaultRenderCell,Fe.renderCell=_e=>{let Dt=null;if(n.default){const qe=n.default(_e);Dt=qe.some(Lt=>Lt.type!==vue.Comment)?qe:xe(_e)}else Dt=xe(_e);const{columns:$e}=r.value.store.states,Ue=$e.value.findIndex(qe=>qe.type==="default"),Ve=ie.value&&_e.cellIndex===Ue,Oe=treeCellPrefix(_e,Ve),At={class:"cell",style:{}};return Fe.showOverflowTooltip&&(At.class=`${At.class} ${vue.unref(re.namespace)}-tooltip`,At.style={width:`${(_e.column.realWidth||Number(_e.column.width))-1}px`}),de(Dt),vue.h("div",At,[Oe,Dt])}),Fe},getPropsData:(...Fe)=>Fe.reduce((xe,_e)=>(Array.isArray(_e)&&_e.forEach(Dt=>{xe[Dt]=i[Dt]}),xe),{}),getColumnElIndex:(Fe,xe)=>Array.prototype.indexOf.call(Fe,xe),updateColumnOrder:()=>{r.value.store.commit("updateColumnOrder",g.columnConfig.value)}}}var defaultProps={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:i=>i.every(n=>["ascending","descending",null].includes(n))}};let columnIdSeed=1;var ElTableColumn$1=vue.defineComponent({name:"ElTableColumn",components:{ElCheckbox},props:defaultProps,setup(i,{slots:n}){const r=vue.getCurrentInstance(),g=vue.ref({}),k=vue.computed(()=>{let ze=r.parent;for(;ze&&!ze.tableId;)ze=ze.parent;return ze}),{registerNormalWatchers:V,registerComplexWatchers:$}=useWatcher(k,i),{columnId:oe,isSubColumn:re,realHeaderAlign:Ce,columnOrTableParent:ie,setColumnWidth:ae,setColumnForcedProps:le,setColumnRenders:Ie,getPropsData:ue,getColumnElIndex:de,realAlign:Ne,updateColumnOrder:he}=useRender(i,n,k),pe=ie.value;oe.value=`${pe.tableId||pe.columnId}_column_${columnIdSeed++}`,vue.onBeforeMount(()=>{re.value=k.value!==pe;const ze=i.type||"default",Fe=i.sortable===""?!0:i.sortable,xe=isUndefined(i.showOverflowTooltip)?pe.props.showOverflowTooltip:i.showOverflowTooltip,_e={...cellStarts[ze],id:oe.value,type:ze,property:i.prop||i.property,align:Ne,headerAlign:Ce,showOverflowTooltip:xe,filterable:i.filters||i.filterMethod,filteredValue:[],filterPlacement:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:Fe,index:i.index,rawColumnKey:r.vnode.key};let Oe=ue(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement"]);Oe=mergeOptions(_e,Oe),Oe=compose(Ie,ae,le)(Oe),g.value=Oe,V(),$()}),vue.onMounted(()=>{var ze;const Fe=ie.value,xe=re.value?Fe.vnode.el.children:(ze=Fe.refs.hiddenColumns)==null?void 0:ze.children,_e=()=>de(xe||[],r.vnode.el);g.value.getColumnIndex=_e,_e()>-1&&k.value.store.commit("insertColumn",g.value,re.value?Fe.columnConfig.value:null,he)}),vue.onBeforeUnmount(()=>{k.value.store.commit("removeColumn",g.value,re.value?pe.columnConfig.value:null,he)}),r.columnId=oe.value,r.columnConfig=g},render(){var i,n,r;try{const g=(n=(i=this.$slots).default)==null?void 0:n.call(i,{row:{},column:{},$index:-1}),k=[];if(Array.isArray(g))for(const $ of g)((r=$.type)==null?void 0:r.name)==="ElTableColumn"||$.shapeFlag&2?k.push($):$.type===vue.Fragment&&Array.isArray($.children)&&$.children.forEach(oe=>{(oe==null?void 0:oe.patchFlag)!==1024&&!isString$1(oe==null?void 0:oe.children)&&k.push(oe)});return vue.h("div",k)}catch{return vue.h("div",[])}}});const ElTable=withInstall(Table,{TableColumn:ElTableColumn$1}),ElTableColumn=withNoopInstall(ElTableColumn$1),tabsRootContextKey=Symbol("tabsRootContextKey"),tabBarProps=buildProps({tabs:{type:definePropType(Array),default:()=>mutable([])}}),COMPONENT_NAME$3="ElTabBar",__default__$6=vue.defineComponent({name:COMPONENT_NAME$3}),_sfc_main$B=vue.defineComponent({...__default__$6,props:tabBarProps,setup(i,{expose:n}){const r=i,g=vue.getCurrentInstance(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$3,"<el-tabs><el-tab-bar /></el-tabs>");const V=useNamespace("tabs"),$=vue.ref(),oe=vue.ref(),re=()=>{let ie=0,ae=0;const le=["top","bottom"].includes(k.props.tabPosition)?"width":"height",Ie=le==="width"?"x":"y",ue=Ie==="x"?"left":"top";return r.tabs.every(de=>{var Ne,he;const pe=(he=(Ne=g.parent)==null?void 0:Ne.refs)==null?void 0:he[`tab-${de.uid}`];if(!pe)return!1;if(!de.active)return!0;ie=pe[`offset${capitalize(ue)}`],ae=pe[`client${capitalize(le)}`];const ze=window.getComputedStyle(pe);return le==="width"&&(r.tabs.length>1&&(ae-=Number.parseFloat(ze.paddingLeft)+Number.parseFloat(ze.paddingRight)),ie+=Number.parseFloat(ze.paddingLeft)),!1}),{[le]:`${ae}px`,transform:`translate${capitalize(Ie)}(${ie}px)`}},Ce=()=>oe.value=re();return vue.watch(()=>r.tabs,async()=>{await vue.nextTick(),Ce()},{immediate:!0}),useResizeObserver($,()=>Ce()),n({ref:$,update:Ce}),(ie,ae)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"barRef",ref:$,class:vue.normalizeClass([vue.unref(V).e("active-bar"),vue.unref(V).is(vue.unref(k).props.tabPosition)]),style:vue.normalizeStyle(oe.value)},null,6))}});var TabBar=_export_sfc$1(_sfc_main$B,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-bar.vue"]]);const tabNavProps=buildProps({panes:{type:definePropType(Array),default:()=>mutable([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),tabNavEmits={tabClick:(i,n,r)=>r instanceof Event,tabRemove:(i,n)=>n instanceof Event},COMPONENT_NAME$2="ElTabNav",TabNav=vue.defineComponent({name:COMPONENT_NAME$2,props:tabNavProps,emits:tabNavEmits,setup(i,{expose:n,emit:r}){const g=vue.getCurrentInstance(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$2,"<el-tabs><tab-nav /></el-tabs>");const V=useNamespace("tabs"),$=useDocumentVisibility(),oe=useWindowFocus(),re=vue.ref(),Ce=vue.ref(),ie=vue.ref(),ae=vue.ref(),le=vue.ref(!1),Ie=vue.ref(0),ue=vue.ref(!1),de=vue.ref(!0),Ne=vue.computed(()=>["top","bottom"].includes(k.props.tabPosition)?"width":"height"),he=vue.computed(()=>({transform:`translate${Ne.value==="width"?"X":"Y"}(-${Ie.value}px)`})),pe=()=>{if(!re.value)return;const Ue=re.value[`offset${capitalize(Ne.value)}`],Ve=Ie.value;if(!Ve)return;const Oe=Ve>Ue?Ve-Ue:0;Ie.value=Oe},ze=()=>{if(!re.value||!Ce.value)return;const Ue=Ce.value[`offset${capitalize(Ne.value)}`],Ve=re.value[`offset${capitalize(Ne.value)}`],Oe=Ie.value;if(Ue-Oe<=Ve)return;const At=Ue-Oe>Ve*2?Oe+Ve:Ue-Ve;Ie.value=At},Fe=async()=>{const Ue=Ce.value;if(!le.value||!ie.value||!re.value||!Ue)return;await vue.nextTick();const Ve=ie.value.querySelector(".is-active");if(!Ve)return;const Oe=re.value,At=["top","bottom"].includes(k.props.tabPosition),qe=Ve.getBoundingClientRect(),Lt=Oe.getBoundingClientRect(),kt=At?Ue.offsetWidth-Lt.width:Ue.offsetHeight-Lt.height,jt=Ie.value;let ti=jt;At?(qe.left<Lt.left&&(ti=jt-(Lt.left-qe.left)),qe.right>Lt.right&&(ti=jt+qe.right-Lt.right)):(qe.top<Lt.top&&(ti=jt-(Lt.top-qe.top)),qe.bottom>Lt.bottom&&(ti=jt+(qe.bottom-Lt.bottom))),ti=Math.max(ti,0),Ie.value=Math.min(ti,kt)},xe=()=>{var Ue;if(!Ce.value||!re.value)return;i.stretch&&((Ue=ae.value)==null||Ue.update());const Ve=Ce.value[`offset${capitalize(Ne.value)}`],Oe=re.value[`offset${capitalize(Ne.value)}`],At=Ie.value;Oe<Ve?(le.value=le.value||{},le.value.prev=At,le.value.next=At+Oe<Ve,Ve-At<Oe&&(Ie.value=Ve-Oe)):(le.value=!1,At>0&&(Ie.value=0))},_e=Ue=>{const Ve=Ue.code,{up:Oe,down:At,left:qe,right:Lt}=EVENT_CODE;if(![Oe,At,qe,Lt].includes(Ve))return;const kt=Array.from(Ue.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),jt=kt.indexOf(Ue.target);let ti;Ve===qe||Ve===Oe?jt===0?ti=kt.length-1:ti=jt-1:jt<kt.length-1?ti=jt+1:ti=0,kt[ti].focus({preventScroll:!0}),kt[ti].click(),Dt()},Dt=()=>{de.value&&(ue.value=!0)},$e=()=>ue.value=!1;return vue.watch($,Ue=>{Ue==="hidden"?de.value=!1:Ue==="visible"&&setTimeout(()=>de.value=!0,50)}),vue.watch(oe,Ue=>{Ue?setTimeout(()=>de.value=!0,50):de.value=!1}),useResizeObserver(ie,xe),vue.onMounted(()=>setTimeout(()=>Fe(),0)),vue.onUpdated(()=>xe()),n({scrollToActiveTab:Fe,removeFocus:$e}),vue.watch(()=>i.panes,()=>g.update(),{flush:"post",deep:!0}),()=>{const Ue=le.value?[vue.createVNode("span",{class:[V.e("nav-prev"),V.is("disabled",!le.value.prev)],onClick:pe},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_left_default,null,null)]})]),vue.createVNode("span",{class:[V.e("nav-next"),V.is("disabled",!le.value.next)],onClick:ze},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_right_default,null,null)]})])]:null,Ve=i.panes.map((Oe,At)=>{var qe,Lt,kt,jt;const ti=Oe.uid,ei=Oe.props.disabled,Pt=(Lt=(qe=Oe.props.name)!=null?qe:Oe.index)!=null?Lt:`${At}`,ni=!ei&&(Oe.isClosable||i.editable);Oe.index=`${At}`;const gi=ni?vue.createVNode(ElIcon,{class:"is-icon-close",onClick:ai=>r("tabRemove",Oe,ai)},{default:()=>[vue.createVNode(close_default,null,null)]}):null,di=((jt=(kt=Oe.slots).label)==null?void 0:jt.call(kt))||Oe.props.label,li=!ei&&Oe.active?0:-1;return vue.createVNode("div",{ref:`tab-${ti}`,class:[V.e("item"),V.is(k.props.tabPosition),V.is("active",Oe.active),V.is("disabled",ei),V.is("closable",ni),V.is("focus",ue.value)],id:`tab-${Pt}`,key:`tab-${ti}`,"aria-controls":`pane-${Pt}`,role:"tab","aria-selected":Oe.active,tabindex:li,onFocus:()=>Dt(),onBlur:()=>$e(),onClick:ai=>{$e(),r("tabClick",Oe,Pt,ai)},onKeydown:ai=>{ni&&(ai.code===EVENT_CODE.delete||ai.code===EVENT_CODE.backspace)&&r("tabRemove",Oe,ai)}},[di,gi])});return vue.createVNode("div",{ref:ie,class:[V.e("nav-wrap"),V.is("scrollable",!!le.value),V.is(k.props.tabPosition)]},[Ue,vue.createVNode("div",{class:V.e("nav-scroll"),ref:re},[vue.createVNode("div",{class:[V.e("nav"),V.is(k.props.tabPosition),V.is("stretch",i.stretch&&["top","bottom"].includes(k.props.tabPosition))],ref:Ce,style:he.value,role:"tablist",onKeydown:_e},[i.type?null:vue.createVNode(TabBar,{ref:ae,tabs:[...i.panes]},null),Ve])])])}}}),tabsProps=buildProps({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:definePropType(Function),default:()=>!0},stretch:Boolean}),isPaneName=i=>isString$1(i)||isNumber$1(i),tabsEmits={[UPDATE_MODEL_EVENT]:i=>isPaneName(i),tabClick:(i,n)=>n instanceof Event,tabChange:i=>isPaneName(i),edit:(i,n)=>["remove","add"].includes(n),tabRemove:i=>isPaneName(i),tabAdd:()=>!0};var Tabs=vue.defineComponent({name:"ElTabs",props:tabsProps,emits:tabsEmits,setup(i,{emit:n,slots:r,expose:g}){var k,V;const $=useNamespace("tabs"),{children:oe,addChild:re,removeChild:Ce}=useOrderedChildren(vue.getCurrentInstance(),"ElTabPane"),ie=vue.ref(),ae=vue.ref((V=(k=i.modelValue)!=null?k:i.activeName)!=null?V:"0"),le=he=>{ae.value=he,n(UPDATE_MODEL_EVENT,he),n("tabChange",he)},Ie=async he=>{var pe,ze,Fe;if(!(ae.value===he||isUndefined(he)))try{await((pe=i.beforeLeave)==null?void 0:pe.call(i,he,ae.value))!==!1&&(le(he),(Fe=(ze=ie.value)==null?void 0:ze.removeFocus)==null||Fe.call(ze))}catch{}},ue=(he,pe,ze)=>{he.props.disabled||(Ie(pe),n("tabClick",he,ze))},de=(he,pe)=>{he.props.disabled||isUndefined(he.props.name)||(pe.stopPropagation(),n("edit",he.props.name,"remove"),n("tabRemove",he.props.name))},Ne=()=>{n("edit",void 0,"add"),n("tabAdd")};return useDeprecated({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},vue.computed(()=>!!i.activeName)),vue.watch(()=>i.activeName,he=>Ie(he)),vue.watch(()=>i.modelValue,he=>Ie(he)),vue.watch(ae,async()=>{var he;await vue.nextTick(),(he=ie.value)==null||he.scrollToActiveTab()}),vue.provide(tabsRootContextKey,{props:i,currentName:ae,registerPane:re,unregisterPane:Ce}),g({currentName:ae}),()=>{const he=i.editable||i.addable?vue.createVNode("span",{class:$.e("new-tab"),tabindex:"0",onClick:Ne,onKeydown:Fe=>{Fe.code===EVENT_CODE.enter&&Ne()}},[vue.createVNode(ElIcon,{class:$.is("icon-plus")},{default:()=>[vue.createVNode(plus_default,null,null)]})]):null,pe=vue.createVNode("div",{class:[$.e("header"),$.is(i.tabPosition)]},[he,vue.createVNode(TabNav,{ref:ie,currentName:ae.value,editable:i.editable,type:i.type,panes:oe.value,stretch:i.stretch,onTabClick:ue,onTabRemove:de},null)]),ze=vue.createVNode("div",{class:$.e("content")},[vue.renderSlot(r,"default")]);return vue.createVNode("div",{class:[$.b(),$.m(i.tabPosition),{[$.m("card")]:i.type==="card",[$.m("border-card")]:i.type==="border-card"}]},[...i.tabPosition!=="bottom"?[pe,ze]:[ze,pe]])}}});const tabPaneProps=buildProps({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),_hoisted_1$q=["id","aria-hidden","aria-labelledby"],COMPONENT_NAME$1="ElTabPane",__default__$5=vue.defineComponent({name:COMPONENT_NAME$1}),_sfc_main$A=vue.defineComponent({...__default__$5,props:tabPaneProps,setup(i){const n=i,r=vue.getCurrentInstance(),g=vue.useSlots(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$1,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const V=useNamespace("tab-pane"),$=vue.ref(),oe=vue.computed(()=>n.closable||k.props.closable),re=computedEager(()=>{var Ie;return k.currentName.value===((Ie=n.name)!=null?Ie:$.value)}),Ce=vue.ref(re.value),ie=vue.computed(()=>{var Ie;return(Ie=n.name)!=null?Ie:$.value}),ae=computedEager(()=>!n.lazy||Ce.value||re.value);vue.watch(re,Ie=>{Ie&&(Ce.value=!0)});const le=vue.reactive({uid:r.uid,slots:g,props:n,paneName:ie,active:re,index:$,isClosable:oe});return vue.onMounted(()=>{k.registerPane(le)}),vue.onUnmounted(()=>{k.unregisterPane(le.uid)}),(Ie,ue)=>vue.unref(ae)?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,id:`pane-${vue.unref(ie)}`,class:vue.normalizeClass(vue.unref(V).b()),role:"tabpanel","aria-hidden":!vue.unref(re),"aria-labelledby":`tab-${vue.unref(ie)}`},[vue.renderSlot(Ie.$slots,"default")],10,_hoisted_1$q)),[[vue.vShow,vue.unref(re)]]):vue.createCommentVNode("v-if",!0)}});var TabPane=_export_sfc$1(_sfc_main$A,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-pane.vue"]]);const ElTabs=withInstall(Tabs,{TabPane}),ElTabPane=withNoopInstall(TabPane),NODE_KEY="$treeNodeId",markNodeData=function(i,n){!n||n[NODE_KEY]||Object.defineProperty(n,NODE_KEY,{value:i.id,enumerable:!1,configurable:!1,writable:!1})},getNodeKey=function(i,n){return i?n[i]:n[NODE_KEY]},handleCurrentChange=(i,n,r)=>{const g=i.value.currentNode;r();const k=i.value.currentNode;g!==k&&n("current-change",k?k.data:null,k)},getChildState=i=>{let n=!0,r=!0,g=!0;for(let k=0,V=i.length;k<V;k++){const $=i[k];($.checked!==!0||$.indeterminate)&&(n=!1,$.disabled||(g=!1)),($.checked!==!1||$.indeterminate)&&(r=!1)}return{all:n,none:r,allWithoutDisable:g,half:!n&&!r}},reInitChecked=function(i){if(i.childNodes.length===0||i.loading)return;const{all:n,none:r,half:g}=getChildState(i.childNodes);n?(i.checked=!0,i.indeterminate=!1):g?(i.checked=!1,i.indeterminate=!0):r&&(i.checked=!1,i.indeterminate=!1);const k=i.parent;!k||k.level===0||i.store.checkStrictly||reInitChecked(k)},getPropertyFromData=function(i,n){const r=i.store.props,g=i.data||{},k=r[n];if(typeof k=="function")return k(g,i);if(typeof k=="string")return g[k];if(typeof k>"u"){const V=g[n];return V===void 0?"":V}};let nodeIdSeed=0;class Node{constructor(n){this.id=nodeIdSeed++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in n)hasOwn$1(n,r)&&(this[r]=n[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const n=this.store;if(!n)throw new Error("[Node]store is required!");n.registerNode(this);const r=n.props;if(r&&typeof r.isLeaf<"u"){const V=getPropertyFromData(this,"isLeaf");typeof V=="boolean"&&(this.isLeafByUser=V)}if(n.lazy!==!0&&this.data?(this.setData(this.data),n.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&n.lazy&&n.defaultExpandAll&&this.expand(),Array.isArray(this.data)||markNodeData(this,this.data),!this.data)return;const g=n.defaultExpandedKeys,k=n.key;k&&g&&g.includes(this.key)&&this.expand(null,n.autoExpandParent),k&&n.currentNodeKey!==void 0&&this.key===n.currentNodeKey&&(n.currentNode=this,n.currentNode.isCurrent=!0),n.lazy&&n._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(n){Array.isArray(n)||markNodeData(this,n),this.data=n,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=getPropertyFromData(this,"children")||[];for(let g=0,k=r.length;g<k;g++)this.insertChild({data:r[g]})}get label(){return getPropertyFromData(this,"label")}get key(){const n=this.store.key;return this.data?this.data[n]:null}get disabled(){return getPropertyFromData(this,"disabled")}get nextSibling(){const n=this.parent;if(n){const r=n.childNodes.indexOf(this);if(r>-1)return n.childNodes[r+1]}return null}get previousSibling(){const n=this.parent;if(n){const r=n.childNodes.indexOf(this);if(r>-1)return r>0?n.childNodes[r-1]:null}return null}contains(n,r=!0){return(this.childNodes||[]).some(g=>g===n||r&&g.contains(n))}remove(){const n=this.parent;n&&n.removeChild(this)}insertChild(n,r,g){if(!n)throw new Error("InsertChild error: child is required.");if(!(n instanceof Node)){if(!g){const k=this.getChildren(!0);k.includes(n.data)||(typeof r>"u"||r<0?k.push(n.data):k.splice(r,0,n.data))}Object.assign(n,{parent:this,store:this.store}),n=vue.reactive(new Node(n)),n instanceof Node&&n.initialize()}n.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),this.updateLeafState()}insertBefore(n,r){let g;r&&(g=this.childNodes.indexOf(r)),this.insertChild(n,g)}insertAfter(n,r){let g;r&&(g=this.childNodes.indexOf(r),g!==-1&&(g+=1)),this.insertChild(n,g)}removeChild(n){const r=this.getChildren()||[],g=r.indexOf(n.data);g>-1&&r.splice(g,1);const k=this.childNodes.indexOf(n);k>-1&&(this.store&&this.store.deregisterNode(n),n.parent=null,this.childNodes.splice(k,1)),this.updateLeafState()}removeChildByData(n){let r=null;for(let g=0;g<this.childNodes.length;g++)if(this.childNodes[g].data===n){r=this.childNodes[g];break}r&&this.removeChild(r)}expand(n,r){const g=()=>{if(r){let k=this.parent;for(;k.level>0;)k.expanded=!0,k=k.parent}this.expanded=!0,n&&n(),this.childNodes.forEach(k=>{k.canFocus=!0})};this.shouldLoadData()?this.loadData(k=>{Array.isArray(k)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||reInitChecked(this),g())}):g()}doCreateChildren(n,r={}){n.forEach(g=>{this.insertChild(Object.assign({data:g},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(n=>{n.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const n=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!n||n.length===0;return}this.isLeaf=!1}setChecked(n,r,g,k){if(this.indeterminate=n==="half",this.checked=n===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:$,allWithoutDisable:oe}=getChildState(this.childNodes);!this.isLeaf&&!$&&oe&&(this.checked=!1,n=!1);const re=()=>{if(r){const Ce=this.childNodes;for(let le=0,Ie=Ce.length;le<Ie;le++){const ue=Ce[le];k=k||n!==!1;const de=ue.disabled?ue.checked:k;ue.setChecked(de,r,!0,k)}const{half:ie,all:ae}=getChildState(Ce);ae||(this.checked=ae,this.indeterminate=ie)}};if(this.shouldLoadData()){this.loadData(()=>{re(),reInitChecked(this)},{checked:n!==!1});return}else re()}const V=this.parent;!V||V.level===0||g||reInitChecked(V)}getChildren(n=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const g=this.store.props;let k="children";return g&&(k=g.children||"children"),r[k]===void 0&&(r[k]=null),n&&!r[k]&&(r[k]=[]),r[k]}updateChildren(){const n=this.getChildren()||[],r=this.childNodes.map(V=>V.data),g={},k=[];n.forEach((V,$)=>{const oe=V[NODE_KEY];!!oe&&r.findIndex(Ce=>Ce[NODE_KEY]===oe)>=0?g[oe]={index:$,data:V}:k.push({index:$,data:V})}),this.store.lazy||r.forEach(V=>{g[V[NODE_KEY]]||this.removeChildByData(V)}),k.forEach(({index:V,data:$})=>{this.insertChild({data:$},V)}),this.updateLeafState()}loadData(n,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const g=k=>{this.childNodes=[],this.doCreateChildren(k,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),n&&n.call(this,k)};this.store.load(this,g)}else n&&n.call(this)}}class TreeStore{constructor(n){this.currentNode=null,this.currentNodeKey=null;for(const r in n)hasOwn$1(n,r)&&(this[r]=n[r]);this.nodesMap={}}initialize(){if(this.root=new Node({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const n=this.load;n(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(n){const r=this.filterNodeMethod,g=this.lazy,k=function(V){const $=V.root?V.root.childNodes:V.childNodes;if($.forEach(oe=>{oe.visible=r.call(oe,n,oe.data,oe),k(oe)}),!V.visible&&$.length){let oe=!0;oe=!$.some(re=>re.visible),V.root?V.root.visible=oe===!1:V.visible=oe===!1}n&&V.visible&&!V.isLeaf&&!g&&V.expand()};k(this)}setData(n){n!==this.root.data?(this.root.setData(n),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(n){if(n instanceof Node)return n;const r=isObject$4(n)?getNodeKey(this.key,n):n;return this.nodesMap[r]||null}insertBefore(n,r){const g=this.getNode(r);g.parent.insertBefore({data:n},g)}insertAfter(n,r){const g=this.getNode(r);g.parent.insertAfter({data:n},g)}remove(n){const r=this.getNode(n);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(n,r){const g=r?this.getNode(r):this.root;g&&g.insertChild({data:n})}_initDefaultCheckedNodes(){const n=this.defaultCheckedKeys||[],r=this.nodesMap;n.forEach(g=>{const k=r[g];k&&k.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(n){(this.defaultCheckedKeys||[]).includes(n.key)&&n.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(n){n!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=n,this._initDefaultCheckedNodes())}registerNode(n){const r=this.key;!n||!n.data||(r?n.key!==void 0&&(this.nodesMap[n.key]=n):this.nodesMap[n.id]=n)}deregisterNode(n){!this.key||!n||!n.data||(n.childNodes.forEach(g=>{this.deregisterNode(g)}),delete this.nodesMap[n.key])}getCheckedNodes(n=!1,r=!1){const g=[],k=function(V){(V.root?V.root.childNodes:V.childNodes).forEach(oe=>{(oe.checked||r&&oe.indeterminate)&&(!n||n&&oe.isLeaf)&&g.push(oe.data),k(oe)})};return k(this),g}getCheckedKeys(n=!1){return this.getCheckedNodes(n).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const n=[],r=function(g){(g.root?g.root.childNodes:g.childNodes).forEach(V=>{V.indeterminate&&n.push(V.data),r(V)})};return r(this),n}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(n=>(n||{})[this.key])}_getAllNodes(){const n=[],r=this.nodesMap;for(const g in r)hasOwn$1(r,g)&&n.push(r[g]);return n}updateChildren(n,r){const g=this.nodesMap[n];if(!g)return;const k=g.childNodes;for(let V=k.length-1;V>=0;V--){const $=k[V];this.remove($.data)}for(let V=0,$=r.length;V<$;V++){const oe=r[V];this.append(oe,g.data)}}_setCheckedKeys(n,r=!1,g){const k=this._getAllNodes().sort((oe,re)=>re.level-oe.level),V=Object.create(null),$=Object.keys(g);k.forEach(oe=>oe.setChecked(!1,!1));for(let oe=0,re=k.length;oe<re;oe++){const Ce=k[oe],ie=Ce.data[n].toString();if(!$.includes(ie)){Ce.checked&&!V[ie]&&Ce.setChecked(!1,!1);continue}let le=Ce.parent;for(;le&&le.level>0;)V[le.data[n]]=!0,le=le.parent;if(Ce.isLeaf||this.checkStrictly){Ce.setChecked(!0,!1);continue}if(Ce.setChecked(!0,!0),r){Ce.setChecked(!1,!1);const Ie=function(ue){ue.childNodes.forEach(Ne=>{Ne.isLeaf||Ne.setChecked(!1,!1),Ie(Ne)})};Ie(Ce)}}}setCheckedNodes(n,r=!1){const g=this.key,k={};n.forEach(V=>{k[(V||{})[g]]=!0}),this._setCheckedKeys(g,r,k)}setCheckedKeys(n,r=!1){this.defaultCheckedKeys=n;const g=this.key,k={};n.forEach(V=>{k[V]=!0}),this._setCheckedKeys(g,r,k)}setDefaultExpandedKeys(n){n=n||[],this.defaultExpandedKeys=n,n.forEach(r=>{const g=this.getNode(r);g&&g.expand(null,this.autoExpandParent)})}setChecked(n,r,g){const k=this.getNode(n);k&&k.setChecked(!!r,g)}getCurrentNode(){return this.currentNode}setCurrentNode(n){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=n,this.currentNode.isCurrent=!0}setUserCurrentNode(n,r=!0){const g=n[this.key],k=this.nodesMap[g];this.setCurrentNode(k),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(n,r=!0){if(n==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const g=this.getNode(n);g&&(this.setCurrentNode(g),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const _sfc_main$z=vue.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(i){const n=useNamespace("tree"),r=vue.inject("NodeInstance"),g=vue.inject("RootTree");return()=>{const k=i.node,{data:V,store:$}=k;return i.renderContent?i.renderContent(vue.h,{_self:r,node:k,data:V,store:$}):g.ctx.slots.default?g.ctx.slots.default({node:k,data:V}):vue.h("span",{class:n.be("node","label")},[k.label])}}});var NodeContent=_export_sfc$1(_sfc_main$z,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node-content.vue"]]);function useNodeExpandEventBroadcast(i){const n=vue.inject("TreeNodeMap",null),r={treeNodeExpand:g=>{i.node!==g&&i.node.collapse()},children:[]};return n&&n.children.push(r),vue.provide("TreeNodeMap",r),{broadcastExpanded:g=>{if(i.accordion)for(const k of r.children)k.treeNodeExpand(g)}}}const dragEventsKey=Symbol("dragEvents");function useDragNodeHandler({props:i,ctx:n,el$:r,dropIndicator$:g,store:k}){const V=useNamespace("tree"),$=vue.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),oe=({event:ie,treeNode:ae})=>{if(typeof i.allowDrag=="function"&&!i.allowDrag(ae.node))return ie.preventDefault(),!1;ie.dataTransfer.effectAllowed="move";try{ie.dataTransfer.setData("text/plain","")}catch{}$.value.draggingNode=ae,n.emit("node-drag-start",ae.node,ie)},re=({event:ie,treeNode:ae})=>{const le=ae,Ie=$.value.dropNode;Ie&&Ie.node.id!==le.node.id&&removeClass(Ie.$el,V.is("drop-inner"));const ue=$.value.draggingNode;if(!ue||!le)return;let de=!0,Ne=!0,he=!0,pe=!0;typeof i.allowDrop=="function"&&(de=i.allowDrop(ue.node,le.node,"prev"),pe=Ne=i.allowDrop(ue.node,le.node,"inner"),he=i.allowDrop(ue.node,le.node,"next")),ie.dataTransfer.dropEffect=Ne||de||he?"move":"none",(de||Ne||he)&&(Ie==null?void 0:Ie.node.id)!==le.node.id&&(Ie&&n.emit("node-drag-leave",ue.node,Ie.node,ie),n.emit("node-drag-enter",ue.node,le.node,ie)),(de||Ne||he)&&($.value.dropNode=le),le.node.nextSibling===ue.node&&(he=!1),le.node.previousSibling===ue.node&&(de=!1),le.node.contains(ue.node,!1)&&(Ne=!1),(ue.node===le.node||ue.node.contains(le.node))&&(de=!1,Ne=!1,he=!1);const ze=le.$el.getBoundingClientRect(),Fe=r.value.getBoundingClientRect();let xe;const _e=de?Ne?.25:he?.45:1:-1,Dt=he?Ne?.75:de?.55:0:1;let $e=-9999;const Ue=ie.clientY-ze.top;Ue<ze.height*_e?xe="before":Ue>ze.height*Dt?xe="after":Ne?xe="inner":xe="none";const Ve=le.$el.querySelector(`.${V.be("node","expand-icon")}`).getBoundingClientRect(),Oe=g.value;xe==="before"?$e=Ve.top-Fe.top:xe==="after"&&($e=Ve.bottom-Fe.top),Oe.style.top=`${$e}px`,Oe.style.left=`${Ve.right-Fe.left}px`,xe==="inner"?addClass(le.$el,V.is("drop-inner")):removeClass(le.$el,V.is("drop-inner")),$.value.showDropIndicator=xe==="before"||xe==="after",$.value.allowDrop=$.value.showDropIndicator||pe,$.value.dropType=xe,n.emit("node-drag-over",ue.node,le.node,ie)},Ce=ie=>{const{draggingNode:ae,dropType:le,dropNode:Ie}=$.value;if(ie.preventDefault(),ie.dataTransfer.dropEffect="move",ae&&Ie){const ue={data:ae.node.data};le!=="none"&&ae.node.remove(),le==="before"?Ie.node.parent.insertBefore(ue,Ie.node):le==="after"?Ie.node.parent.insertAfter(ue,Ie.node):le==="inner"&&Ie.node.insertChild(ue),le!=="none"&&k.value.registerNode(ue),removeClass(Ie.$el,V.is("drop-inner")),n.emit("node-drag-end",ae.node,Ie.node,le,ie),le!=="none"&&n.emit("node-drop",ae.node,Ie.node,le,ie)}ae&&!Ie&&n.emit("node-drag-end",ae.node,null,le,ie),$.value.showDropIndicator=!1,$.value.draggingNode=null,$.value.dropNode=null,$.value.allowDrop=!0};return vue.provide(dragEventsKey,{treeNodeDragStart:oe,treeNodeDragOver:re,treeNodeDragEnd:Ce}),{dragState:$}}const _sfc_main$y=vue.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:_CollapseTransition,ElCheckbox,NodeContent,ElIcon,Loading:loading_default},props:{node:{type:Node,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(i,n){const r=useNamespace("tree"),{broadcastExpanded:g}=useNodeExpandEventBroadcast(i),k=vue.inject("RootTree"),V=vue.ref(!1),$=vue.ref(!1),oe=vue.ref(null),re=vue.ref(null),Ce=vue.ref(null),ie=vue.inject(dragEventsKey),ae=vue.getCurrentInstance();vue.provide("NodeInstance",ae),k||debugWarn("Tree","Can not find node's tree."),i.node.expanded&&(V.value=!0,$.value=!0);const le=k.props.children||"children";vue.watch(()=>{const Ue=i.node.data[le];return Ue&&[...Ue]},()=>{i.node.updateChildren()}),vue.watch(()=>i.node.indeterminate,Ue=>{de(i.node.checked,Ue)}),vue.watch(()=>i.node.checked,Ue=>{de(Ue,i.node.indeterminate)}),vue.watch(()=>i.node.expanded,Ue=>{vue.nextTick(()=>V.value=Ue),Ue&&($.value=!0)});const Ie=Ue=>getNodeKey(k.props.nodeKey,Ue.data),ue=Ue=>{const Ve=i.props.class;if(!Ve)return{};let Oe;if(isFunction$2(Ve)){const{data:At}=Ue;Oe=Ve(At,Ue)}else Oe=Ve;return isString$1(Oe)?{[Oe]:!0}:Oe},de=(Ue,Ve)=>{(oe.value!==Ue||re.value!==Ve)&&k.ctx.emit("check-change",i.node.data,Ue,Ve),oe.value=Ue,re.value=Ve},Ne=Ue=>{handleCurrentChange(k.store,k.ctx.emit,()=>k.store.value.setCurrentNode(i.node)),k.currentNode.value=i.node,k.props.expandOnClickNode&&pe(),k.props.checkOnClickNode&&!i.node.disabled&&ze(null,{target:{checked:!i.node.checked}}),k.ctx.emit("node-click",i.node.data,i.node,ae,Ue)},he=Ue=>{k.instance.vnode.props.onNodeContextmenu&&(Ue.stopPropagation(),Ue.preventDefault()),k.ctx.emit("node-contextmenu",Ue,i.node.data,i.node,ae)},pe=()=>{i.node.isLeaf||(V.value?(k.ctx.emit("node-collapse",i.node.data,i.node,ae),i.node.collapse()):(i.node.expand(),n.emit("node-expand",i.node.data,i.node,ae)))},ze=(Ue,Ve)=>{i.node.setChecked(Ve.target.checked,!k.props.checkStrictly),vue.nextTick(()=>{const Oe=k.store.value;k.ctx.emit("check",i.node.data,{checkedNodes:Oe.getCheckedNodes(),checkedKeys:Oe.getCheckedKeys(),halfCheckedNodes:Oe.getHalfCheckedNodes(),halfCheckedKeys:Oe.getHalfCheckedKeys()})})};return{ns:r,node$:Ce,tree:k,expanded:V,childNodeRendered:$,oldChecked:oe,oldIndeterminate:re,getNodeKey:Ie,getNodeClass:ue,handleSelectChange:de,handleClick:Ne,handleContextMenu:he,handleExpandIconClick:pe,handleCheckChange:ze,handleChildNodeExpand:(Ue,Ve,Oe)=>{g(Ve),k.ctx.emit("node-expand",Ue,Ve,Oe)},handleDragStart:Ue=>{k.props.draggable&&ie.treeNodeDragStart({event:Ue,treeNode:i})},handleDragOver:Ue=>{Ue.preventDefault(),k.props.draggable&&ie.treeNodeDragOver({event:Ue,treeNode:{$el:Ce.value,node:i.node}})},handleDrop:Ue=>{Ue.preventDefault()},handleDragEnd:Ue=>{k.props.draggable&&ie.treeNodeDragEnd(Ue)},CaretRight:caret_right_default}}}),_hoisted_1$p=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],_hoisted_2$k=["aria-expanded"];function _sfc_render$3(i,n,r,g,k,V){const $=vue.resolveComponent("el-icon"),oe=vue.resolveComponent("el-checkbox"),re=vue.resolveComponent("loading"),Ce=vue.resolveComponent("node-content"),ie=vue.resolveComponent("el-tree-node"),ae=vue.resolveComponent("el-collapse-transition");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{ref:"node$",class:vue.normalizeClass([i.ns.b("node"),i.ns.is("expanded",i.expanded),i.ns.is("current",i.node.isCurrent),i.ns.is("hidden",!i.node.visible),i.ns.is("focusable",!i.node.disabled),i.ns.is("checked",!i.node.disabled&&i.node.checked),i.getNodeClass(i.node)]),role:"treeitem",tabindex:"-1","aria-expanded":i.expanded,"aria-disabled":i.node.disabled,"aria-checked":i.node.checked,draggable:i.tree.props.draggable,"data-key":i.getNodeKey(i.node),onClick:n[1]||(n[1]=vue.withModifiers((...le)=>i.handleClick&&i.handleClick(...le),["stop"])),onContextmenu:n[2]||(n[2]=(...le)=>i.handleContextMenu&&i.handleContextMenu(...le)),onDragstart:n[3]||(n[3]=vue.withModifiers((...le)=>i.handleDragStart&&i.handleDragStart(...le),["stop"])),onDragover:n[4]||(n[4]=vue.withModifiers((...le)=>i.handleDragOver&&i.handleDragOver(...le),["stop"])),onDragend:n[5]||(n[5]=vue.withModifiers((...le)=>i.handleDragEnd&&i.handleDragEnd(...le),["stop"])),onDrop:n[6]||(n[6]=vue.withModifiers((...le)=>i.handleDrop&&i.handleDrop(...le),["stop"]))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.be("node","content")),style:vue.normalizeStyle({paddingLeft:(i.node.level-1)*i.tree.props.indent+"px"})},[i.tree.props.icon||i.CaretRight?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.be("node","expand-icon"),i.ns.is("leaf",i.node.isLeaf),{expanded:!i.node.isLeaf&&i.expanded}]),onClick:vue.withModifiers(i.handleExpandIconClick,["stop"])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.tree.props.icon||i.CaretRight)))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0),i.showCheckbox?(vue.openBlock(),vue.createBlock(oe,{key:1,"model-value":i.node.checked,indeterminate:i.node.indeterminate,disabled:!!i.node.disabled,onClick:n[0]||(n[0]=vue.withModifiers(()=>{},["stop"])),onChange:i.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):vue.createCommentVNode("v-if",!0),i.node.loading?(vue.openBlock(),vue.createBlock($,{key:2,class:vue.normalizeClass([i.ns.be("node","loading-icon"),i.ns.is("loading")])},{default:vue.withCtx(()=>[vue.createVNode(re)]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createVNode(Ce,{node:i.node,"render-content":i.renderContent},null,8,["node","render-content"])],6),vue.createVNode(ae,null,{default:vue.withCtx(()=>[!i.renderAfterExpand||i.childNodeRendered?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.ns.be("node","children")),role:"group","aria-expanded":i.expanded},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.node.childNodes,le=>(vue.openBlock(),vue.createBlock(ie,{key:i.getNodeKey(le),"render-content":i.renderContent,"render-after-expand":i.renderAfterExpand,"show-checkbox":i.showCheckbox,node:le,accordion:i.accordion,props:i.props,onNodeExpand:i.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,_hoisted_2$k)),[[vue.vShow,i.expanded]]):vue.createCommentVNode("v-if",!0)]),_:1})],42,_hoisted_1$p)),[[vue.vShow,i.node.visible]])}var ElTreeNode=_export_sfc$1(_sfc_main$y,[["render",_sfc_render$3],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node.vue"]]);function useKeydown({el$:i},n){const r=useNamespace("tree"),g=vue.shallowRef([]),k=vue.shallowRef([]);vue.onMounted(()=>{$()}),vue.onUpdated(()=>{g.value=Array.from(i.value.querySelectorAll("[role=treeitem]")),k.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"))}),vue.watch(k,oe=>{oe.forEach(re=>{re.setAttribute("tabindex","-1")})}),useEventListener(i,"keydown",oe=>{const re=oe.target;if(!re.className.includes(r.b("node")))return;const Ce=oe.code;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const ie=g.value.indexOf(re);let ae;if([EVENT_CODE.up,EVENT_CODE.down].includes(Ce)){if(oe.preventDefault(),Ce===EVENT_CODE.up){ae=ie===-1?0:ie!==0?ie-1:g.value.length-1;const Ie=ae;for(;!n.value.getNode(g.value[ae].dataset.key).canFocus;){if(ae--,ae===Ie){ae=-1;break}ae<0&&(ae=g.value.length-1)}}else{ae=ie===-1?0:ie<g.value.length-1?ie+1:0;const Ie=ae;for(;!n.value.getNode(g.value[ae].dataset.key).canFocus;){if(ae++,ae===Ie){ae=-1;break}ae>=g.value.length&&(ae=0)}}ae!==-1&&g.value[ae].focus()}[EVENT_CODE.left,EVENT_CODE.right].includes(Ce)&&(oe.preventDefault(),re.click());const le=re.querySelector('[type="checkbox"]');[EVENT_CODE.enter,EVENT_CODE.space].includes(Ce)&&le&&(oe.preventDefault(),le.click())});const $=()=>{var oe;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),k.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"));const re=i.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(re.length){re[0].setAttribute("tabindex","0");return}(oe=g.value[0])==null||oe.setAttribute("tabindex","0")}}const _sfc_main$x=vue.defineComponent({name:"ElTree",components:{ElTreeNode},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:iconPropType}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(i,n){const{t:r}=useLocale(),g=useNamespace("tree"),k=vue.ref(new TreeStore({key:i.nodeKey,data:i.data,lazy:i.lazy,props:i.props,load:i.load,currentNodeKey:i.currentNodeKey,checkStrictly:i.checkStrictly,checkDescendants:i.checkDescendants,defaultCheckedKeys:i.defaultCheckedKeys,defaultExpandedKeys:i.defaultExpandedKeys,autoExpandParent:i.autoExpandParent,defaultExpandAll:i.defaultExpandAll,filterNodeMethod:i.filterNodeMethod}));k.value.initialize();const V=vue.ref(k.value.root),$=vue.ref(null),oe=vue.ref(null),re=vue.ref(null),{broadcastExpanded:Ce}=useNodeExpandEventBroadcast(i),{dragState:ie}=useDragNodeHandler({props:i,ctx:n,el$:oe,dropIndicator$:re,store:k});useKeydown({el$:oe},k);const ae=vue.computed(()=>{const{childNodes:ti}=V.value;return!ti||ti.length===0||ti.every(({visible:ei})=>!ei)});vue.watch(()=>i.currentNodeKey,ti=>{k.value.setCurrentNodeKey(ti)}),vue.watch(()=>i.defaultCheckedKeys,ti=>{k.value.setDefaultCheckedKey(ti)}),vue.watch(()=>i.defaultExpandedKeys,ti=>{k.value.setDefaultExpandedKeys(ti)}),vue.watch(()=>i.data,ti=>{k.value.setData(ti)},{deep:!0}),vue.watch(()=>i.checkStrictly,ti=>{k.value.checkStrictly=ti});const le=ti=>{if(!i.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");k.value.filter(ti)},Ie=ti=>getNodeKey(i.nodeKey,ti.data),ue=ti=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const ei=k.value.getNode(ti);if(!ei)return[];const Pt=[ei.data];let ni=ei.parent;for(;ni&&ni!==V.value;)Pt.push(ni.data),ni=ni.parent;return Pt.reverse()},de=(ti,ei)=>k.value.getCheckedNodes(ti,ei),Ne=ti=>k.value.getCheckedKeys(ti),he=()=>{const ti=k.value.getCurrentNode();return ti?ti.data:null},pe=()=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const ti=he();return ti?ti[i.nodeKey]:null},ze=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");k.value.setCheckedNodes(ti,ei)},Fe=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");k.value.setCheckedKeys(ti,ei)},xe=(ti,ei,Pt)=>{k.value.setChecked(ti,ei,Pt)},_e=()=>k.value.getHalfCheckedNodes(),Dt=()=>k.value.getHalfCheckedKeys(),$e=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");handleCurrentChange(k,n.emit,()=>k.value.setUserCurrentNode(ti,ei))},Ue=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");handleCurrentChange(k,n.emit,()=>k.value.setCurrentNodeKey(ti,ei))},Ve=ti=>k.value.getNode(ti),Oe=ti=>{k.value.remove(ti)},At=(ti,ei)=>{k.value.append(ti,ei)},qe=(ti,ei)=>{k.value.insertBefore(ti,ei)},Lt=(ti,ei)=>{k.value.insertAfter(ti,ei)},kt=(ti,ei,Pt)=>{Ce(ei),n.emit("node-expand",ti,ei,Pt)},jt=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");k.value.updateChildren(ti,ei)};return vue.provide("RootTree",{ctx:n,props:i,store:k,root:V,currentNode:$,instance:vue.getCurrentInstance()}),vue.provide(formItemContextKey,void 0),{ns:g,store:k,root:V,currentNode:$,dragState:ie,el$:oe,dropIndicator$:re,isEmpty:ae,filter:le,getNodeKey:Ie,getNodePath:ue,getCheckedNodes:de,getCheckedKeys:Ne,getCurrentNode:he,getCurrentKey:pe,setCheckedNodes:ze,setCheckedKeys:Fe,setChecked:xe,getHalfCheckedNodes:_e,getHalfCheckedKeys:Dt,setCurrentNode:$e,setCurrentKey:Ue,t:r,getNode:Ve,remove:Oe,append:At,insertBefore:qe,insertAfter:Lt,handleNodeExpand:kt,updateKeyChildren:jt}}});function _sfc_render$2(i,n,r,g,k,V){const $=vue.resolveComponent("el-tree-node");return vue.openBlock(),vue.createElementBlock("div",{ref:"el$",class:vue.normalizeClass([i.ns.b(),i.ns.is("dragging",!!i.dragState.draggingNode),i.ns.is("drop-not-allow",!i.dragState.allowDrop),i.ns.is("drop-inner",i.dragState.dropType==="inner"),{[i.ns.m("highlight-current")]:i.highlightCurrent}]),role:"tree"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.root.childNodes,oe=>(vue.openBlock(),vue.createBlock($,{key:i.getNodeKey(oe),node:oe,props:i.props,accordion:i.accordion,"render-after-expand":i.renderAfterExpand,"show-checkbox":i.showCheckbox,"render-content":i.renderContent,onNodeExpand:i.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),i.isEmpty?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.ns.e("empty-block"))},[vue.renderSlot(i.$slots,"empty",{},()=>{var oe;return[vue.createElementVNode("span",{class:vue.normalizeClass(i.ns.e("empty-text"))},vue.toDisplayString((oe=i.emptyText)!=null?oe:i.t("el.tree.emptyText")),3)]})],2)):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createElementVNode("div",{ref:"dropIndicator$",class:vue.normalizeClass(i.ns.e("drop-indicator"))},null,2),[[vue.vShow,i.dragState.showDropIndicator]])],2)}var Tree=_export_sfc$1(_sfc_main$x,[["render",_sfc_render$2],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree.vue"]]);Tree.install=i=>{i.component(Tree.name,Tree)};const _Tree=Tree,ElTree=_Tree,uploadContextKey=Symbol("uploadContextKey"),SCOPE$1="ElUpload";class UploadAjaxError extends Error{constructor(n,r,g,k){super(n),this.name="UploadAjaxError",this.status=r,this.method=g,this.url=k}}function getError(i,n,r){let g;return r.response?g=`${r.response.error||r.response}`:r.responseText?g=`${r.responseText}`:g=`fail to ${n.method} ${i} ${r.status}`,new UploadAjaxError(g,r.status,n.method,i)}function getBody(i){const n=i.responseText||i.response;if(!n)return n;try{return JSON.parse(n)}catch{return n}}const ajaxUpload=i=>{typeof XMLHttpRequest>"u"&&throwError$1(SCOPE$1,"XMLHttpRequest is undefined");const n=new XMLHttpRequest,r=i.action;n.upload&&n.upload.addEventListener("progress",V=>{const $=V;$.percent=V.total>0?V.loaded/V.total*100:0,i.onProgress($)});const g=new FormData;if(i.data)for(const[V,$]of Object.entries(i.data))Array.isArray($)?g.append(V,...$):g.append(V,$);g.append(i.filename,i.file,i.file.name),n.addEventListener("error",()=>{i.onError(getError(r,i,n))}),n.addEventListener("load",()=>{if(n.status<200||n.status>=300)return i.onError(getError(r,i,n));i.onSuccess(getBody(n))}),n.open(i.method,r,!0),i.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);const k=i.headers||{};if(k instanceof Headers)k.forEach((V,$)=>n.setRequestHeader($,V));else for(const[V,$]of Object.entries(k))isNil($)||n.setRequestHeader(V,String($));return n.send(g),n},uploadListTypes=["text","picture","picture-card"];let fileId=1;const genFileId=()=>Date.now()+fileId++,uploadBaseProps=buildProps({action:{type:String,default:"#"},headers:{type:definePropType(Object)},method:{type:String,default:"post"},data:{type:Object,default:()=>mutable({})},multiple:{type:Boolean,default:!1},name:{type:String,default:"file"},drag:{type:Boolean,default:!1},withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},type:{type:String,default:"select"},fileList:{type:definePropType(Array),default:()=>mutable([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:uploadListTypes,default:"text"},httpRequest:{type:definePropType(Function),default:ajaxUpload},disabled:Boolean,limit:Number}),uploadProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},beforeRemove:{type:definePropType(Function)},onRemove:{type:definePropType(Function),default:NOOP},onChange:{type:definePropType(Function),default:NOOP},onPreview:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),uploadListProps=buildProps({files:{type:definePropType(Array),default:()=>mutable([])},disabled:{type:Boolean,default:!1},handlePreview:{type:definePropType(Function),default:NOOP},listType:{type:String,values:uploadListTypes,default:"text"}}),uploadListEmits={remove:i=>!!i},_hoisted_1$o=["onKeydown"],_hoisted_2$j=["src"],_hoisted_3$f=["onClick"],_hoisted_4$b=["title"],_hoisted_5$a=["onClick"],_hoisted_6$7=["onClick"],__default__$4=vue.defineComponent({name:"ElUploadList"}),_sfc_main$w=vue.defineComponent({...__default__$4,props:uploadListProps,emits:uploadListEmits,setup(i,{emit:n}){const{t:r}=useLocale(),g=useNamespace("upload"),k=useNamespace("icon"),V=useNamespace("list"),$=useFormDisabled(),oe=vue.ref(!1),re=Ce=>{n("remove",Ce)};return(Ce,ie)=>(vue.openBlock(),vue.createBlock(vue.TransitionGroup,{tag:"ul",class:vue.normalizeClass([vue.unref(g).b("list"),vue.unref(g).bm("list",Ce.listType),vue.unref(g).is("disabled",vue.unref($))]),name:vue.unref(V).b()},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ce.files,ae=>(vue.openBlock(),vue.createElementBlock("li",{key:ae.uid||ae.name,class:vue.normalizeClass([vue.unref(g).be("list","item"),vue.unref(g).is(ae.status),{focusing:oe.value}]),tabindex:"0",onKeydown:vue.withKeys(le=>!vue.unref($)&&re(ae),["delete"]),onFocus:ie[0]||(ie[0]=le=>oe.value=!0),onBlur:ie[1]||(ie[1]=le=>oe.value=!1),onClick:ie[2]||(ie[2]=le=>oe.value=!1)},[vue.renderSlot(Ce.$slots,"default",{file:ae},()=>[Ce.listType==="picture"||ae.status!=="uploading"&&Ce.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:vue.normalizeClass(vue.unref(g).be("list","item-thumbnail")),src:ae.url,alt:""},null,10,_hoisted_2$j)):vue.createCommentVNode("v-if",!0),ae.status==="uploading"||Ce.listType!=="picture-card"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(g).be("list","item-info"))},[vue.createElementVNode("a",{class:vue.normalizeClass(vue.unref(g).be("list","item-name")),onClick:vue.withModifiers(le=>Ce.handlePreview(ae),["prevent"])},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("document"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(document_default))]),_:1},8,["class"]),vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(g).be("list","item-file-name")),title:ae.name},vue.toDisplayString(ae.name),11,_hoisted_4$b)],10,_hoisted_3$f),ae.status==="uploading"?(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{key:0,type:Ce.listType==="picture-card"?"circle":"line","stroke-width":Ce.listType==="picture-card"?6:2,percentage:Number(ae.percentage),style:vue.normalizeStyle(Ce.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("label",{class:vue.normalizeClass(vue.unref(g).be("list","item-status-label"))},[Ce.listType==="text"?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass([vue.unref(k).m("upload-success"),vue.unref(k).m("circle-check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(circle_check_default))]),_:1},8,["class"])):["picture-card","picture"].includes(Ce.listType)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(k).m("upload-success"),vue.unref(k).m("check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(check_default))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(k).m("close")),onClick:le=>re(ae)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:2},1032,["class","onClick"])),vue.createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),vue.createCommentVNode(" This is a bug which needs to be fixed "),vue.createCommentVNode(" TODO: Fix the incorrect navigation interaction "),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("i",{key:3,class:vue.normalizeClass(vue.unref(k).m("close-tip"))},vue.toDisplayString(vue.unref(r)("el.upload.deleteTip")),3)),Ce.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("span",{key:4,class:vue.normalizeClass(vue.unref(g).be("list","item-actions"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(g).be("list","item-preview")),onClick:le=>Ce.handlePreview(ae)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("zoom-in"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(zoom_in_default))]),_:1},8,["class"])],10,_hoisted_5$a),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(g).be("list","item-delete")),onClick:le=>re(ae)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("delete"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(delete_default))]),_:1},8,["class"])],10,_hoisted_6$7))],2)):vue.createCommentVNode("v-if",!0)])],42,_hoisted_1$o))),128)),vue.renderSlot(Ce.$slots,"append")]),_:3},8,["class","name"]))}});var UploadList=_export_sfc$1(_sfc_main$w,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-list.vue"]]);const uploadDraggerProps=buildProps({disabled:{type:Boolean,default:!1}}),uploadDraggerEmits={file:i=>isArray$3(i)},_hoisted_1$n=["onDrop","onDragover"],COMPONENT_NAME="ElUploadDrag",__default__$3=vue.defineComponent({name:COMPONENT_NAME}),_sfc_main$v=vue.defineComponent({...__default__$3,props:uploadDraggerProps,emits:uploadDraggerEmits,setup(i,{emit:n}){const r=vue.inject(uploadContextKey);r||throwError$1(COMPONENT_NAME,"usage: <el-upload><el-upload-dragger /></el-upload>");const g=useNamespace("upload"),k=vue.ref(!1),V=useFormDisabled(),$=re=>{if(V.value)return;k.value=!1,re.stopPropagation();const Ce=Array.from(re.dataTransfer.files),ie=r.accept.value;if(!ie){n("file",Ce);return}const ae=Ce.filter(le=>{const{type:Ie,name:ue}=le,de=ue.includes(".")?`.${ue.split(".").pop()}`:"",Ne=Ie.replace(/\/.*$/,"");return ie.split(",").map(he=>he.trim()).filter(he=>he).some(he=>he.startsWith(".")?de===he:/\/\*$/.test(he)?Ne===he.replace(/\/\*$/,""):/^[^/]+\/[^/]+$/.test(he)?Ie===he:!1)});n("file",ae)},oe=()=>{V.value||(k.value=!0)};return(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(g).b("dragger"),vue.unref(g).is("dragover",k.value)]),onDrop:vue.withModifiers($,["prevent"]),onDragover:vue.withModifiers(oe,["prevent"]),onDragleave:Ce[0]||(Ce[0]=vue.withModifiers(ie=>k.value=!1,["prevent"]))},[vue.renderSlot(re.$slots,"default")],42,_hoisted_1$n))}});var UploadDragger=_export_sfc$1(_sfc_main$v,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-dragger.vue"]]);const uploadContentProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},onRemove:{type:definePropType(Function),default:NOOP},onStart:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),_hoisted_1$m=["onKeydown"],_hoisted_2$i=["name","multiple","accept"],__default__$2=vue.defineComponent({name:"ElUploadContent",inheritAttrs:!1}),_sfc_main$u=vue.defineComponent({...__default__$2,props:uploadContentProps,setup(i,{expose:n}){const r=i,g=useNamespace("upload"),k=useFormDisabled(),V=vue.shallowRef({}),$=vue.shallowRef(),oe=ue=>{if(ue.length===0)return;const{autoUpload:de,limit:Ne,fileList:he,multiple:pe,onStart:ze,onExceed:Fe}=r;if(Ne&&he.length+ue.length>Ne){Fe(ue,he);return}pe||(ue=ue.slice(0,1));for(const xe of ue){const _e=xe;_e.uid=genFileId(),ze(_e),de&&re(_e)}},re=async ue=>{if($.value.value="",!r.beforeUpload)return Ce(ue);let de,Ne={};try{const pe=r.data,ze=r.beforeUpload(ue);Ne=isObject$4(r.data)?cloneDeep(r.data):r.data,de=await ze,isObject$4(r.data)&&isEqual(pe,Ne)&&(Ne=cloneDeep(r.data))}catch{de=!1}if(de===!1){r.onRemove(ue);return}let he=ue;de instanceof Blob&&(de instanceof File?he=de:he=new File([de],ue.name,{type:ue.type})),Ce(Object.assign(he,{uid:ue.uid}),Ne)},Ce=(ue,de)=>{const{headers:Ne,data:he,method:pe,withCredentials:ze,name:Fe,action:xe,onProgress:_e,onSuccess:Dt,onError:$e,httpRequest:Ue}=r,{uid:Ve}=ue,Oe={headers:Ne||{},withCredentials:ze,file:ue,data:de??he,method:pe,filename:Fe,action:xe,onProgress:qe=>{_e(qe,ue)},onSuccess:qe=>{Dt(qe,ue),delete V.value[Ve]},onError:qe=>{$e(qe,ue),delete V.value[Ve]}},At=Ue(Oe);V.value[Ve]=At,At instanceof Promise&&At.then(Oe.onSuccess,Oe.onError)},ie=ue=>{const de=ue.target.files;de&&oe(Array.from(de))},ae=()=>{k.value||($.value.value="",$.value.click())},le=()=>{ae()};return n({abort:ue=>{entriesOf(V.value).filter(ue?([Ne])=>String(ue.uid)===Ne:()=>!0).forEach(([Ne,he])=>{he instanceof XMLHttpRequest&&he.abort(),delete V.value[Ne]})},upload:re}),(ue,de)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(g).b(),vue.unref(g).m(ue.listType),vue.unref(g).is("drag",ue.drag)]),tabindex:"0",onClick:ae,onKeydown:vue.withKeys(vue.withModifiers(le,["self"]),["enter","space"])},[ue.drag?(vue.openBlock(),vue.createBlock(UploadDragger,{key:0,disabled:vue.unref(k),onFile:oe},{default:vue.withCtx(()=>[vue.renderSlot(ue.$slots,"default")]),_:3},8,["disabled"])):vue.renderSlot(ue.$slots,"default",{key:1}),vue.createElementVNode("input",{ref_key:"inputRef",ref:$,class:vue.normalizeClass(vue.unref(g).e("input")),name:ue.name,multiple:ue.multiple,accept:ue.accept,type:"file",onChange:ie,onClick:de[0]||(de[0]=vue.withModifiers(()=>{},["stop"]))},null,42,_hoisted_2$i)],42,_hoisted_1$m))}});var UploadContent=_export_sfc$1(_sfc_main$u,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-content.vue"]]);const SCOPE="ElUpload",revokeObjectURL=i=>{var n;(n=i.url)!=null&&n.startsWith("blob:")&&URL.revokeObjectURL(i.url)},useHandlers=(i,n)=>{const r=useVModel(i,"fileList",void 0,{passive:!0}),g=le=>r.value.find(Ie=>Ie.uid===le.uid);function k(le){var Ie;(Ie=n.value)==null||Ie.abort(le)}function V(le=["ready","uploading","success","fail"]){r.value=r.value.filter(Ie=>!le.includes(Ie.status))}const $=(le,Ie)=>{const ue=g(Ie);ue&&(console.error(le),ue.status="fail",r.value.splice(r.value.indexOf(ue),1),i.onError(le,ue,r.value),i.onChange(ue,r.value))},oe=(le,Ie)=>{const ue=g(Ie);ue&&(i.onProgress(le,ue,r.value),ue.status="uploading",ue.percentage=Math.round(le.percent))},re=(le,Ie)=>{const ue=g(Ie);ue&&(ue.status="success",ue.response=le,i.onSuccess(le,ue,r.value),i.onChange(ue,r.value))},Ce=le=>{isNil(le.uid)&&(le.uid=genFileId());const Ie={name:le.name,percentage:0,status:"ready",size:le.size,raw:le,uid:le.uid};if(i.listType==="picture-card"||i.listType==="picture")try{Ie.url=URL.createObjectURL(le)}catch(ue){debugWarn(SCOPE,ue.message),i.onError(ue,Ie,r.value)}r.value=[...r.value,Ie],i.onChange(Ie,r.value)},ie=async le=>{const Ie=le instanceof File?g(le):le;Ie||throwError$1(SCOPE,"file to be removed not found");const ue=de=>{k(de);const Ne=r.value;Ne.splice(Ne.indexOf(de),1),i.onRemove(de,Ne),revokeObjectURL(de)};i.beforeRemove?await i.beforeRemove(Ie,r.value)!==!1&&ue(Ie):ue(Ie)};function ae(){r.value.filter(({status:le})=>le==="ready").forEach(({raw:le})=>{var Ie;return le&&((Ie=n.value)==null?void 0:Ie.upload(le))})}return vue.watch(()=>i.listType,le=>{le!=="picture-card"&&le!=="picture"||(r.value=r.value.map(Ie=>{const{raw:ue,url:de}=Ie;if(!de&&ue)try{Ie.url=URL.createObjectURL(ue)}catch(Ne){i.onError(Ne,Ie,r.value)}return Ie}))}),vue.watch(r,le=>{for(const Ie of le)Ie.uid||(Ie.uid=genFileId()),Ie.status||(Ie.status="success")},{immediate:!0,deep:!0}),{uploadFiles:r,abort:k,clearFiles:V,handleError:$,handleProgress:oe,handleStart:Ce,handleSuccess:re,handleRemove:ie,submit:ae}},__default__$1=vue.defineComponent({name:"ElUpload"}),_sfc_main$t=vue.defineComponent({...__default__$1,props:uploadProps,setup(i,{expose:n}){const r=i,g=vue.useSlots(),k=useFormDisabled(),V=vue.shallowRef(),{abort:$,submit:oe,clearFiles:re,uploadFiles:Ce,handleStart:ie,handleError:ae,handleRemove:le,handleSuccess:Ie,handleProgress:ue}=useHandlers(r,V),de=vue.computed(()=>r.listType==="picture-card"),Ne=vue.computed(()=>({...r,fileList:Ce.value,onStart:ie,onProgress:ue,onSuccess:Ie,onError:ae,onRemove:le}));return vue.onBeforeUnmount(()=>{Ce.value.forEach(({url:he})=>{he!=null&&he.startsWith("blob:")&&URL.revokeObjectURL(he)})}),vue.provide(uploadContextKey,{accept:vue.toRef(r,"accept")}),n({abort:$,submit:oe,clearFiles:re,handleStart:ie,handleRemove:le}),(he,pe)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.unref(de)&&he.showFileList?(vue.openBlock(),vue.createBlock(UploadList,{key:0,disabled:vue.unref(k),"list-type":he.listType,files:vue.unref(Ce),"handle-preview":he.onPreview,onRemove:vue.unref(le)},vue.createSlots({append:vue.withCtx(()=>[vue.createVNode(UploadContent,vue.mergeProps({ref_key:"uploadRef",ref:V},vue.unref(Ne)),{default:vue.withCtx(()=>[vue.unref(g).trigger?vue.renderSlot(he.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!vue.unref(g).trigger&&vue.unref(g).default?vue.renderSlot(he.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)]),_:2},[he.$slots.file?{name:"default",fn:vue.withCtx(({file:ze})=>[vue.renderSlot(he.$slots,"file",{file:ze})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0),!vue.unref(de)||vue.unref(de)&&!he.showFileList?(vue.openBlock(),vue.createBlock(UploadContent,vue.mergeProps({key:1,ref_key:"uploadRef",ref:V},vue.unref(Ne)),{default:vue.withCtx(()=>[vue.unref(g).trigger?vue.renderSlot(he.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!vue.unref(g).trigger&&vue.unref(g).default?vue.renderSlot(he.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)):vue.createCommentVNode("v-if",!0),he.$slots.trigger?vue.renderSlot(he.$slots,"default",{key:2}):vue.createCommentVNode("v-if",!0),vue.renderSlot(he.$slots,"tip"),!vue.unref(de)&&he.showFileList?(vue.openBlock(),vue.createBlock(UploadList,{key:3,disabled:vue.unref(k),"list-type":he.listType,files:vue.unref(Ce),"handle-preview":he.onPreview,onRemove:vue.unref(le)},vue.createSlots({_:2},[he.$slots.file?{name:"default",fn:vue.withCtx(({file:ze})=>[vue.renderSlot(he.$slots,"file",{file:ze})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0)]))}});var Upload=_export_sfc$1(_sfc_main$t,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload.vue"]]);const ElUpload=withInstall(Upload),messageTypes=["success","info","warning","error"],messageDefaults=mutable({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:isClient?document.body:void 0}),messageProps=buildProps({customClass:{type:String,default:messageDefaults.customClass},center:{type:Boolean,default:messageDefaults.center},dangerouslyUseHTMLString:{type:Boolean,default:messageDefaults.dangerouslyUseHTMLString},duration:{type:Number,default:messageDefaults.duration},icon:{type:iconPropType,default:messageDefaults.icon},id:{type:String,default:messageDefaults.id},message:{type:definePropType([String,Object,Function]),default:messageDefaults.message},onClose:{type:definePropType(Function),required:!1},showClose:{type:Boolean,default:messageDefaults.showClose},type:{type:String,values:messageTypes,default:messageDefaults.type},offset:{type:Number,default:messageDefaults.offset},zIndex:{type:Number,default:messageDefaults.zIndex},grouping:{type:Boolean,default:messageDefaults.grouping},repeatNum:{type:Number,default:messageDefaults.repeatNum}}),messageEmits={destroy:()=>!0},instances$2=vue.shallowReactive([]),getInstance=i=>{const n=instances$2.findIndex(k=>k.id===i),r=instances$2[n];let g;return n>0&&(g=instances$2[n-1]),{current:r,prev:g}},getLastOffset=i=>{const{prev:n}=getInstance(i);return n?n.vm.exposed.bottom.value:0},getOffsetOrSpace=(i,n)=>instances$2.findIndex(g=>g.id===i)>0?20:n,_hoisted_1$l=["id"],_hoisted_2$h=["innerHTML"],__default__=vue.defineComponent({name:"ElMessage"}),_sfc_main$s=vue.defineComponent({...__default__,props:messageProps,emits:messageEmits,setup(i,{expose:n}){const r=i,{Close:g}=TypeComponents,{ns:k,zIndex:V}=useGlobalComponentSettings("message"),{currentZIndex:$,nextZIndex:oe}=V,re=vue.ref(),Ce=vue.ref(!1),ie=vue.ref(0);let ae;const le=vue.computed(()=>r.type?r.type==="error"?"danger":r.type:"info"),Ie=vue.computed(()=>{const Dt=r.type;return{[k.bm("icon",Dt)]:Dt&&TypeComponentsMap[Dt]}}),ue=vue.computed(()=>r.icon||TypeComponentsMap[r.type]||""),de=vue.computed(()=>getLastOffset(r.id)),Ne=vue.computed(()=>getOffsetOrSpace(r.id,r.offset)+de.value),he=vue.computed(()=>ie.value+Ne.value),pe=vue.computed(()=>({top:`${Ne.value}px`,zIndex:$.value}));function ze(){r.duration!==0&&({stop:ae}=useTimeoutFn(()=>{xe()},r.duration))}function Fe(){ae==null||ae()}function xe(){Ce.value=!1}function _e({code:Dt}){Dt===EVENT_CODE.esc&&xe()}return vue.onMounted(()=>{ze(),oe(),Ce.value=!0}),vue.watch(()=>r.repeatNum,()=>{Fe(),ze()}),useEventListener(document,"keydown",_e),useResizeObserver(re,()=>{ie.value=re.value.getBoundingClientRect().height}),n({visible:Ce,bottom:he,close:xe}),(Dt,$e)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(k).b("fade"),onBeforeLeave:Dt.onClose,onAfterLeave:$e[0]||($e[0]=Ue=>Dt.$emit("destroy")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:Dt.id,ref_key:"messageRef",ref:re,class:vue.normalizeClass([vue.unref(k).b(),{[vue.unref(k).m(Dt.type)]:Dt.type&&!Dt.icon},vue.unref(k).is("center",Dt.center),vue.unref(k).is("closable",Dt.showClose),Dt.customClass]),style:vue.normalizeStyle(vue.unref(pe)),role:"alert",onMouseenter:Fe,onMouseleave:ze},[Dt.repeatNum>1?(vue.openBlock(),vue.createBlock(vue.unref(ElBadge),{key:0,value:Dt.repeatNum,type:vue.unref(le),class:vue.normalizeClass(vue.unref(k).e("badge"))},null,8,["value","type","class"])):vue.createCommentVNode("v-if",!0),vue.unref(ue)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(k).e("icon"),vue.unref(Ie)])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(ue))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.renderSlot(Dt.$slots,"default",{},()=>[Dt.dangerouslyUseHTMLString?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),vue.createElementVNode("p",{class:vue.normalizeClass(vue.unref(k).e("content")),innerHTML:Dt.message},null,10,_hoisted_2$h)],2112)):(vue.openBlock(),vue.createElementBlock("p",{key:0,class:vue.normalizeClass(vue.unref(k).e("content"))},vue.toDisplayString(Dt.message),3))]),Dt.showClose?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(k).e("closeBtn")),onClick:vue.withModifiers(xe,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(g))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],46,_hoisted_1$l),[[vue.vShow,Ce.value]])]),_:3},8,["name","onBeforeLeave"]))}});var MessageConstructor=_export_sfc$1(_sfc_main$s,[["__file","/home/runner/work/element-plus/element-plus/packages/components/message/src/message.vue"]]);let seed=1;const normalizeOptions=i=>{const n=!i||isString$1(i)||vue.isVNode(i)||isFunction$2(i)?{message:i}:i,r={...messageDefaults,...n};if(!r.appendTo)r.appendTo=document.body;else if(isString$1(r.appendTo)){let g=document.querySelector(r.appendTo);isElement(g)||(debugWarn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),g=document.body),r.appendTo=g}return r},closeMessage=i=>{const n=instances$2.indexOf(i);if(n===-1)return;instances$2.splice(n,1);const{handler:r}=i;r.close()},createMessage=({appendTo:i,...n},r)=>{const g=`message_${seed++}`,k=n.onClose,V=document.createElement("div"),$={...n,id:g,onClose:()=>{k==null||k(),closeMessage(ie)},onDestroy:()=>{vue.render(null,V)}},oe=vue.createVNode(MessageConstructor,$,isFunction$2($.message)||vue.isVNode($.message)?{default:isFunction$2($.message)?$.message:()=>$.message}:null);oe.appContext=r||message._context,vue.render(oe,V),i.appendChild(V.firstElementChild);const re=oe.component,ie={id:g,vnode:oe,vm:re,handler:{close:()=>{re.exposed.visible.value=!1}},props:oe.component.props};return ie},message=(i={},n)=>{if(!isClient)return{close:()=>{}};if(isNumber$1(messageConfig.max)&&instances$2.length>=messageConfig.max)return{close:()=>{}};const r=normalizeOptions(i);if(r.grouping&&instances$2.length){const k=instances$2.find(({vnode:V})=>{var $;return(($=V.props)==null?void 0:$.message)===r.message});if(k)return k.props.repeatNum+=1,k.props.type=r.type,k.handler}const g=createMessage(r,n);return instances$2.push(g),g.handler};messageTypes.forEach(i=>{message[i]=(n={},r)=>{const g=normalizeOptions(n);return message({...g,type:i},r)}});function closeAll(i){for(const n of instances$2)(!i||i===n.props.type)&&n.handler.close()}message.closeAll=closeAll,message._context=null;const ElMessage=withInstallFunction(message,"$message"),_sfc_main$r=vue.defineComponent({name:"ElMessageBox",directives:{TrapFocus},components:{ElButton,ElFocusTrap,ElInput,ElOverlay,ElIcon,...TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:isValidComponentSize},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(i,{emit:n}){const{locale:r,zIndex:g,ns:k,size:V}=useGlobalComponentSettings("message-box",vue.computed(()=>i.buttonSize)),{t:$}=r,{nextZIndex:oe}=g,re=vue.ref(!1),Ce=vue.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:oe()}),ie=vue.computed(()=>{const kt=Ce.type;return{[k.bm("icon",kt)]:kt&&TypeComponentsMap[kt]}}),ae=useId(),le=useId(),Ie=vue.computed(()=>Ce.icon||TypeComponentsMap[Ce.type]||""),ue=vue.computed(()=>!!Ce.message),de=vue.ref(),Ne=vue.ref(),he=vue.ref(),pe=vue.ref(),ze=vue.ref(),Fe=vue.computed(()=>Ce.confirmButtonClass);vue.watch(()=>Ce.inputValue,async kt=>{await vue.nextTick(),i.boxType==="prompt"&&kt!==null&&Oe()},{immediate:!0}),vue.watch(()=>re.value,kt=>{var jt,ti;kt&&(i.boxType!=="prompt"&&(Ce.autofocus?he.value=(ti=(jt=ze.value)==null?void 0:jt.$el)!=null?ti:de.value:he.value=de.value),Ce.zIndex=oe()),i.boxType==="prompt"&&(kt?vue.nextTick().then(()=>{var ei;pe.value&&pe.value.$el&&(Ce.autofocus?he.value=(ei=At())!=null?ei:de.value:he.value=de.value)}):(Ce.editorErrorMessage="",Ce.validateError=!1))});const xe=vue.computed(()=>i.draggable);useDraggable(de,Ne,xe),vue.onMounted(async()=>{await vue.nextTick(),i.closeOnHashChange&&window.addEventListener("hashchange",_e)}),vue.onBeforeUnmount(()=>{i.closeOnHashChange&&window.removeEventListener("hashchange",_e)});function _e(){re.value&&(re.value=!1,vue.nextTick(()=>{Ce.action&&n("action",Ce.action)}))}const Dt=()=>{i.closeOnClickModal&&Ve(Ce.distinguishCancelAndClose?"close":"cancel")},$e=useSameTarget(Dt),Ue=kt=>{if(Ce.inputType!=="textarea")return kt.preventDefault(),Ve("confirm")},Ve=kt=>{var jt;i.boxType==="prompt"&&kt==="confirm"&&!Oe()||(Ce.action=kt,Ce.beforeClose?(jt=Ce.beforeClose)==null||jt.call(Ce,kt,Ce,_e):_e())},Oe=()=>{if(i.boxType==="prompt"){const kt=Ce.inputPattern;if(kt&&!kt.test(Ce.inputValue||""))return Ce.editorErrorMessage=Ce.inputErrorMessage||$("el.messagebox.error"),Ce.validateError=!0,!1;const jt=Ce.inputValidator;if(typeof jt=="function"){const ti=jt(Ce.inputValue);if(ti===!1)return Ce.editorErrorMessage=Ce.inputErrorMessage||$("el.messagebox.error"),Ce.validateError=!0,!1;if(typeof ti=="string")return Ce.editorErrorMessage=ti,Ce.validateError=!0,!1}}return Ce.editorErrorMessage="",Ce.validateError=!1,!0},At=()=>{const kt=pe.value.$refs;return kt.input||kt.textarea},qe=()=>{Ve("close")},Lt=()=>{i.closeOnPressEscape&&qe()};return i.lockScroll&&useLockscreen(re),{...vue.toRefs(Ce),ns:k,overlayEvent:$e,visible:re,hasMessage:ue,typeClass:ie,contentId:ae,inputId:le,btnSize:V,iconComponent:Ie,confirmButtonClasses:Fe,rootRef:de,focusStartRef:he,headerRef:Ne,inputRef:pe,confirmRef:ze,doClose:_e,handleClose:qe,onCloseRequested:Lt,handleWrapperClick:Dt,handleInputEnter:Ue,handleAction:Ve,t:$}}}),_hoisted_1$k=["aria-label","aria-describedby"],_hoisted_2$g=["aria-label"],_hoisted_3$e=["id"];function _sfc_render$1(i,n,r,g,k,V){const $=vue.resolveComponent("el-icon"),oe=vue.resolveComponent("close"),re=vue.resolveComponent("el-input"),Ce=vue.resolveComponent("el-button"),ie=vue.resolveComponent("el-focus-trap"),ae=vue.resolveComponent("el-overlay");return vue.openBlock(),vue.createBlock(vue.Transition,{name:"fade-in-linear",onAfterLeave:n[11]||(n[11]=le=>i.$emit("vanish")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createVNode(ae,{"z-index":i.zIndex,"overlay-class":[i.ns.is("message-box"),i.modalClass],mask:i.modal},{default:vue.withCtx(()=>[vue.createElementVNode("div",{role:"dialog","aria-label":i.title,"aria-modal":"true","aria-describedby":i.showInput?void 0:i.contentId,class:vue.normalizeClass(`${i.ns.namespace.value}-overlay-message-box`),onClick:n[8]||(n[8]=(...le)=>i.overlayEvent.onClick&&i.overlayEvent.onClick(...le)),onMousedown:n[9]||(n[9]=(...le)=>i.overlayEvent.onMousedown&&i.overlayEvent.onMousedown(...le)),onMouseup:n[10]||(n[10]=(...le)=>i.overlayEvent.onMouseup&&i.overlayEvent.onMouseup(...le))},[vue.createVNode(ie,{loop:"",trapped:i.visible,"focus-trap-el":i.rootRef,"focus-start-el":i.focusStartRef,onReleaseRequested:i.onCloseRequested},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"rootRef",class:vue.normalizeClass([i.ns.b(),i.customClass,i.ns.is("draggable",i.draggable),{[i.ns.m("center")]:i.center}]),style:vue.normalizeStyle(i.customStyle),tabindex:"-1",onClick:n[7]||(n[7]=vue.withModifiers(()=>{},["stop"]))},[i.title!==null&&i.title!==void 0?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"headerRef",class:vue.normalizeClass(i.ns.e("header"))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("title"))},[i.iconComponent&&i.center?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.e("status"),i.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("span",null,vue.toDisplayString(i.title),1)],2),i.showClose?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",class:vue.normalizeClass(i.ns.e("headerbtn")),"aria-label":i.t("el.messagebox.close"),onClick:n[0]||(n[0]=le=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel")),onKeydown:n[1]||(n[1]=vue.withKeys(vue.withModifiers(le=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[vue.createVNode($,{class:vue.normalizeClass(i.ns.e("close"))},{default:vue.withCtx(()=>[vue.createVNode(oe)]),_:1},8,["class"])],42,_hoisted_2$g)):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{id:i.contentId,class:vue.normalizeClass(i.ns.e("content"))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("container"))},[i.iconComponent&&!i.center&&i.hasMessage?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.e("status"),i.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),i.hasMessage?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(i.ns.e("message"))},[vue.renderSlot(i.$slots,"default",{},()=>[i.dangerouslyUseHTMLString?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.showInput?"label":"p"),{key:1,for:i.showInput?i.inputId:void 0,innerHTML:i.message},null,8,["for","innerHTML"])):(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.showInput?"label":"p"),{key:0,for:i.showInput?i.inputId:void 0},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.dangerouslyUseHTMLString?"":i.message),1)]),_:1},8,["for"]))])],2)):vue.createCommentVNode("v-if",!0)],2),vue.withDirectives(vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("input"))},[vue.createVNode(re,{id:i.inputId,ref:"inputRef",modelValue:i.inputValue,"onUpdate:modelValue":n[2]||(n[2]=le=>i.inputValue=le),type:i.inputType,placeholder:i.inputPlaceholder,"aria-invalid":i.validateError,class:vue.normalizeClass({invalid:i.validateError}),onKeydown:vue.withKeys(i.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("errormsg")),style:vue.normalizeStyle({visibility:i.editorErrorMessage?"visible":"hidden"})},vue.toDisplayString(i.editorErrorMessage),7)],2),[[vue.vShow,i.showInput]])],10,_hoisted_3$e),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("btns"))},[i.showCancelButton?(vue.openBlock(),vue.createBlock(Ce,{key:0,loading:i.cancelButtonLoading,class:vue.normalizeClass([i.cancelButtonClass]),round:i.roundButton,size:i.btnSize,onClick:n[3]||(n[3]=le=>i.handleAction("cancel")),onKeydown:n[4]||(n[4]=vue.withKeys(vue.withModifiers(le=>i.handleAction("cancel"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.cancelButtonText||i.t("el.messagebox.cancel")),1)]),_:1},8,["loading","class","round","size"])):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createVNode(Ce,{ref:"confirmRef",type:"primary",loading:i.confirmButtonLoading,class:vue.normalizeClass([i.confirmButtonClasses]),round:i.roundButton,disabled:i.confirmButtonDisabled,size:i.btnSize,onClick:n[5]||(n[5]=le=>i.handleAction("confirm")),onKeydown:n[6]||(n[6]=vue.withKeys(vue.withModifiers(le=>i.handleAction("confirm"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.confirmButtonText||i.t("el.messagebox.confirm")),1)]),_:1},8,["loading","class","round","disabled","size"]),[[vue.vShow,i.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,_hoisted_1$k)]),_:3},8,["z-index","overlay-class","mask"]),[[vue.vShow,i.visible]])]),_:3})}var MessageBoxConstructor=_export_sfc$1(_sfc_main$r,[["render",_sfc_render$1],["__file","/home/runner/work/element-plus/element-plus/packages/components/message-box/src/index.vue"]]);const messageInstance=new Map,getAppendToElement=i=>{let n=document.body;return i.appendTo&&(isString$1(i.appendTo)&&(n=document.querySelector(i.appendTo)),isElement(i.appendTo)&&(n=i.appendTo),isElement(n)||(debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),n=document.body)),n},initInstance=(i,n,r=null)=>{const g=vue.createVNode(MessageBoxConstructor,i,isFunction$2(i.message)||vue.isVNode(i.message)?{default:isFunction$2(i.message)?i.message:()=>i.message}:null);return g.appContext=r,vue.render(g,n),getAppendToElement(i).appendChild(n.firstElementChild),g.component},genContainer=()=>document.createElement("div"),showMessage=(i,n)=>{const r=genContainer();i.onVanish=()=>{vue.render(null,r),messageInstance.delete(k)},i.onAction=V=>{const $=messageInstance.get(k);let oe;i.showInput?oe={value:k.inputValue,action:V}:oe=V,i.callback?i.callback(oe,g.proxy):V==="cancel"||V==="close"?i.distinguishCancelAndClose&&V!=="cancel"?$.reject("close"):$.reject("cancel"):$.resolve(oe)};const g=initInstance(i,r,n),k=g.proxy;for(const V in i)hasOwn$1(i,V)&&!hasOwn$1(k.$props,V)&&(k[V]=i[V]);return k.visible=!0,k};function MessageBox(i,n=null){if(!isClient)return Promise.reject();let r;return isString$1(i)||vue.isVNode(i)?i={message:i}:r=i.callback,new Promise((g,k)=>{const V=showMessage(i,n??MessageBox._context);messageInstance.set(V,{options:i,callback:r,resolve:g,reject:k})})}const MESSAGE_BOX_VARIANTS=["alert","confirm","prompt"],MESSAGE_BOX_DEFAULT_OPTS={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};MESSAGE_BOX_VARIANTS.forEach(i=>{MessageBox[i]=messageBoxFactory(i)});function messageBoxFactory(i){return(n,r,g,k)=>{let V="";return isObject$4(r)?(g=r,V=""):isUndefined(r)?V="":V=r,MessageBox(Object.assign({title:V,message:n,type:"",...MESSAGE_BOX_DEFAULT_OPTS[i]},g,{boxType:i}),k)}}MessageBox.close=()=>{messageInstance.forEach((i,n)=>{n.doClose()}),messageInstance.clear()},MessageBox._context=null;const _MessageBox=MessageBox;_MessageBox.install=i=>{_MessageBox._context=i._context,i.config.globalProperties.$msgbox=_MessageBox,i.config.globalProperties.$messageBox=_MessageBox,i.config.globalProperties.$alert=_MessageBox.alert,i.config.globalProperties.$confirm=_MessageBox.confirm,i.config.globalProperties.$prompt=_MessageBox.prompt};const ElMessageBox=_MessageBox,index$3="",animate="";var ELineBindAnchors=(i=>(i.TopCenter="TopCenter",i.Left="Left",i.Right="Right",i.BottomCenter="BottomCenter",i))(ELineBindAnchors||{}),EConfigAnimationsType=(i=>(i.None="None",i.Electricity="Electricity",i.WaterDrop="WaterDrop",i.Track="Track",i))(EConfigAnimationsType||{}),EConfigItemPropsType=(i=>(i.Input="Input",i.Color="Color",i.InputNumber="InputNumber",i.Switch="Switch",i.JsonEdit="JsonEdit",i.Select="Select",i))(EConfigItemPropsType||{}),EDoneJsonType=(i=>(i.File="File",i.StraightLine="StraightLine",i.ConnectionLine="ConnectionLine",i.CustomSvg="CustomSvg",i.Vue="Vue",i))(EDoneJsonType||{}),EEventType=(i=>(i.Click="Click",i.Change="Change",i.Null="",i))(EEventType||{}),EEventAction=(i=>(i.ChangeAttr="ChangeAttr",i.JavaScript="JavaScript",i.Null="",i))(EEventAction||{}),EConditionType=(i=>(i.None="None",i.Relation="Relation",i))(EConditionType||{});const randomString=i=>{i=i||10;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=n.length;let g="";for(let k=0;k<i;k++){let V=r;k===0&&(V=r-10),g+=n.charAt(Math.floor(Math.random()*V))}return g},isOfType=(i,n)=>i[n]!==void 0,getCoordinateOffset=(i,n)=>i/2*(n-1),angleToRadian=i=>i*Math.PI/180,calculateRotatedPointCoordinate=(i,n,r)=>({x:(i.x-n.x)*Math.cos(angleToRadian(r))-(i.y-n.y)*Math.sin(angleToRadian(r))+n.x,y:(i.x-n.x)*Math.sin(angleToRadian(r))+(i.y-n.y)*Math.cos(angleToRadian(r))+n.y}),getCenterPoint=(i,n)=>({x:i.x+(n.x-i.x)/2,y:i.y+(n.y-i.y)/2}),positionArrToPath=i=>{let n="";for(let r=0;r<i.length;r++)r===0?n+=`M ${i[r].x} ${i[r].y}`:n+=` L ${i[r].x} ${i[r].y}`;return n},getSvgNowPosition=(i,n,r)=>r+(n-i),objectDeepClone=(i,n={})=>i?JSON.parse(JSON.stringify(i)):n,setSvgActualInfo=(i,n)=>{const r=document.querySelector(`#${i.id}`),g=document.querySelector(`#rect${i.id}`);if(r){let k=0,V=0,$=0,oe=0;if(i.type!==EDoneJsonType.Vue){const re=r.getBBox();console.log(re),k=re.x,V=re.y,$=re.width,oe=re.height}else{$=r.offsetWidth,oe=r.offsetHeight,$=$===0?100:$,oe=oe===0?100:oe,k=50-$/2,V=50-oe/2;const re=document.querySelector(`#foreign-object${i.id}`);re&&re.getAttribute("x")==="0"&&re.getAttribute("y")==="0"&&re.getAttribute("width")==="0"&&re.getAttribute("height")==="0"&&(re.setAttribute("x",k.toString()),re.setAttribute("y",V.toString()),re.setAttribute("width",$.toString()),re.setAttribute("height",oe.toString()))}g&&g.getAttribute("x")==="0"&&g.getAttribute("y")==="0"&&g.getAttribute("width")==="0"&&g.getAttribute("height")==="0"&&(g.setAttribute("x",k.toString()),g.setAttribute("y",V.toString()),g.setAttribute("width",$.toString()),g.setAttribute("height",oe.toString())),(i.actual_bound.x===0&&i.actual_bound.y===0&&i.actual_bound.width===0&&i.actual_bound.height===0||n)&&(i.actual_bound={x:k,y:V,width:$,height:oe}),i.point_coordinate.tl={x:i.x-$*i.scale_x/2,y:i.y-oe*i.scale_y/2},i.point_coordinate.tc={x:i.x,y:i.y-oe*i.scale_y/2},i.point_coordinate.tr={x:i.x+$*i.scale_x/2,y:i.y-oe*i.scale_y/2},i.point_coordinate.l={x:i.x-$*i.scale_x/2,y:i.y},i.point_coordinate.r={x:i.x+$*i.scale_x/2,y:i.y},i.point_coordinate.bl={x:i.x-$*i.scale_x/2,y:i.y+oe*i.scale_y/2},i.point_coordinate.bc={x:i.x,y:i.y+oe*i.scale_y/2},i.point_coordinate.br={x:i.x+$*i.scale_x/2,y:i.y+oe*i.scale_y/2},i.rotate!==0&&setAfterRotationPointCoordinate(i)}},getAnchorPosByAnchorType=(i,n)=>i===ELineBindAnchors.BottomCenter?n.point_coordinate.bc:i===ELineBindAnchors.Left?n.point_coordinate.l:i===ELineBindAnchors.Right?n.point_coordinate.r:n.point_coordinate.tc,setAfterRotationPointCoordinate=i=>{i.point_coordinate={tl:calculateRotatedPointCoordinate(i.point_coordinate.tl,{x:i.x,y:i.y},i.rotate),tc:calculateRotatedPointCoordinate(i.point_coordinate.tc,{x:i.x,y:i.y},i.rotate),tr:calculateRotatedPointCoordinate(i.point_coordinate.tr,{x:i.x,y:i.y},i.rotate),l:calculateRotatedPointCoordinate(i.point_coordinate.l,{x:i.x,y:i.y},i.rotate),r:calculateRotatedPointCoordinate(i.point_coordinate.r,{x:i.x,y:i.y},i.rotate),bl:calculateRotatedPointCoordinate(i.point_coordinate.bl,{x:i.x,y:i.y},i.rotate),bc:calculateRotatedPointCoordinate(i.point_coordinate.bc,{x:i.x,y:i.y},i.rotate),br:calculateRotatedPointCoordinate(i.point_coordinate.br,{x:i.x,y:i.y},i.rotate)}},prosToVBind=i=>{var r,g,k,V;let n={};if(i.state){for(const $ in i.state)if($==="OnOff")for(const oe in(r=i.state[$])==null?void 0:r.props)n={...n,[oe]:(g=i.state[$])!=null&&g.default?(k=i.state[$])==null?void 0:k.props[oe].openVal:(V=i.state[$])==null?void 0:V.props[oe].closeVal}}for(const $ in i.props)n={...n,[$]:i.props[$].val};return n},setArrItemByID=(id,key,val,json_arr)=>new Promise(res=>{const find_item=json_arr.find(i=>i.id===id);find_item||res({status:!1,msg:"要设置的id不存在"}),eval(`find_item.${key} = val;`),res({status:!0,msg:"操作成功"})}),getCommonClass=i=>!i.common_animations||!i.common_animations.val?"":`common-ani animate__animated animate__${i.common_animations.val} animate__${i.common_animations.speed} animate__${i.common_animations.repeat} animate__${i.common_animations.delay}`,numberArray=i=>{let n=[];for(let r=0;r<i;r++)n.push(r);return n},getStringWidth=(i,n=12)=>{if(i.length>0){let r=document.createElement("span");r.style.fontSize=n+"px",r.style.fontFamily="inherit",r.innerHTML=i,r.style.opacity="0",r.style.position="fixed",r.style.top="3000px",document.body.append(r);const g=r.clientWidth;return document.body.removeChild(r),g}return 0},valFormat=i=>/false|true/.test(i)?i!=="false":/^\d+(\.\d+)?$/.test(i)?Number(i):i,straight_line_system=Object.seal({name:"straight-line",title:"直线",type:EDoneJsonType.StraightLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"},start_x:{title:"起点x坐标",type:EConfigItemPropsType.InputNumber,val:0},start_y:{title:"起点y坐标",type:EConfigItemPropsType.InputNumber,val:0},end_x:{title:"终点x坐标",type:EConfigItemPropsType.InputNumber,val:0},end_y:{title:"终点y坐标",type:EConfigItemPropsType.InputNumber,val:0}},bind_anchors:{start:null,end:null},events:[]}),connection_line_system={name:"connection_line",title:"连接线",type:EDoneJsonType.ConnectionLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{stroke:{title:"线条颜色",type:EConfigItemPropsType.Color,val:"#ff0000"},"stroke-width":{title:"线条宽度",type:EConfigItemPropsType.InputNumber,val:2},point_position:{title:"点坐标",type:EConfigItemPropsType.JsonEdit,val:[]}},animations:{type:{title:"动画类型",type:EConfigItemPropsType.Select,val:EConfigAnimationsType.None,options:[{label:"无",value:EConfigAnimationsType.None},{label:"电流",value:EConfigAnimationsType.Electricity},{label:"轨迹",value:EConfigAnimationsType.Track},{label:"水珠",value:EConfigAnimationsType.WaterDrop}]},dur:{title:"持续时间",type:EConfigItemPropsType.InputNumber,val:20},repeatCount:{title:"循环次数",type:EConfigItemPropsType.Input,val:"indefinite",disabled:!0},color:{title:"颜色",type:EConfigItemPropsType.Color,val:"#0a7ae2"},reverse:{title:"反转动画",type:EConfigItemPropsType.Switch,val:!1}},bind_anchors:{start:null,end:null},events:[]},common_animate_list=[{label:"进入",children:[{label:"渐显",value:"fadeIn"},{label:"向右进入",value:"fadeInLeft"},{label:"向左进入",value:"fadeInRight"},{label:"向上进入",value:"fadeInUp"},{label:"向下进入",value:"fadeInDown"},{label:"向右长距进入",value:"fadeInLeftBig"},{label:"向左长距进入",value:"fadeInRightBig"},{label:"向上长距进入",value:"fadeInUpBig"},{label:"向下长距进入",value:"fadeInDownBig"},{label:"旋转进入",value:"rotateIn"},{label:"左顺时针旋转",value:"rotateInDownLeft"},{label:"右逆时针旋转",value:"rotateInDownRight"},{label:"左逆时针旋转",value:"rotateInUpLeft"},{label:"右逆时针旋转",value:"rotateInUpRight"},{label:"弹入",value:"bounceIn"},{label:"向右弹入",value:"bounceInLeft"},{label:"向左弹入",value:"bounceInRight"},{label:"向上弹入",value:"bounceInUp"},{label:"向下弹入",value:"bounceInDown"},{label:"光速从右进入",value:"lightSpeedInRight"},{label:"光速从左进入",value:"lightSpeedInLeft"},{label:"光速从右退出",value:"lightSpeedOutRight"},{label:"光速从左退出",value:"lightSpeedOutLeft"},{label:"Y轴旋转",value:"flip"},{label:"中心X轴旋转",value:"flipInX"},{label:"中心Y轴旋转",value:"flipInY"},{label:"左长半径旋转",value:"rollIn"},{label:"由小变大进入",value:"zoomIn"},{label:"左变大进入",value:"zoomInLeft"},{label:"右变大进入",value:"zoomInRight"},{label:"向上变大进入",value:"zoomInUp"},{label:"向下变大进入",value:"zoomInDown"},{label:"向右滑动展开",value:"slideInLeft"},{label:"向左滑动展开",value:"slideInRight"},{label:"向上滑动展开",value:"slideInUp"},{label:"向下滑动展开",value:"slideInDown"}]},{label:"强调",children:[{label:"弹跳",value:"bounce"},{label:"闪烁",value:"flash"},{label:"放大缩小",value:"pulse"},{label:"放大缩小弹簧",value:"rubberBand"},{label:"左右晃动",value:"headShake"},{label:"左右扇形摇摆",value:"swing"},{label:"放大晃动缩小",value:"tada"},{label:"扇形摇摆",value:"wobble"},{label:"左右上下晃动",value:"jello"},{label:"Y轴旋转",value:"flip"}]},{label:"退出",children:[{label:"渐隐",value:"fadeOut"},{label:"向左退出",value:"fadeOutLeft"},{label:"向右退出",value:"fadeOutRight"},{label:"向上退出",value:"fadeOutUp"},{label:"向下退出",value:"fadeOutDown"},{label:"向左长距退出",value:"fadeOutLeftBig"},{label:"向右长距退出",value:"fadeOutRightBig"},{label:"向上长距退出",value:"fadeOutUpBig"},{label:"向下长距退出",value:"fadeOutDownBig"},{label:"旋转退出",value:"rotateOut"},{label:"左顺时针旋转",value:"rotateOutDownLeft"},{label:"右逆时针旋转",value:"rotateOutDownRight"},{label:"左逆时针旋转",value:"rotateOutUpLeft"},{label:"右逆时针旋转",value:"rotateOutUpRight"},{label:"弹出",value:"bounceOut"},{label:"向左弹出",value:"bounceOutLeft"},{label:"向右弹出",value:"bounceOutRight"},{label:"向上弹出",value:"bounceOutUp"},{label:"向下弹出",value:"bounceOutDown"},{label:"中心X轴旋转",value:"flipOutX"},{label:"中心Y轴旋转",value:"flipOutY"},{label:"左长半径旋转",value:"rollOut"},{label:"由小变大退出",value:"zoomOut"},{label:"左变大退出",value:"zoomOutLeft"},{label:"右变大退出",value:"zoomOutRight"},{label:"向上变大退出",value:"zoomOutUp"},{label:"向下变大退出",value:"zoomOutDown"},{label:"向左滑动收起",value:"slideOutLeft"},{label:"向右滑动收起",value:"slideOutRight"},{label:"向上滑动收起",value:"slideOutUp"},{label:"向下滑动收起",value:"slideOutDown"}]}];let l=localStorage.getItem("svg-editor-config"),s,t;if(l){let i=JSON.parse(l);t=i.connection_line,s=i.svg}else t=objectDeepClone(connection_line_system),s={background_color:"#fff",scale:1,position_center:{x:-333,y:-113},svg_position_center:{x:50,y:50},grid:!0,ruler:!0};const useConfigStore=pinia$1.defineStore("config-store",{state:()=>({svg:s,connection_line:t,net:{mqtt:{url:"",user:"",pwd:"",topics:""}}}),getters:{},actions:{}}),circuit_breaker_svg_file={name:"circuit-breaker",title:"断路器",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},state:{OnOff:{title:"开关",default:!1,props:{fill:{openVal:"#00ff00",closeVal:"#ff0000"},"fill-opacity":{openVal:"0",closeVal:"1"}}}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateful_group={groupType:"stateful",title:"状态图标",list:[circuit_breaker_svg_file]},alternator_svg_file={name:"alternator",title:"发电机",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#00ff00"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},traction_transformer_svg_file={name:"traction-transformer",title:"牵引变",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_house={name:"house",title:"房子",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_car={name:"car",title:"轿车",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_hospital={name:"hospital",title:"医院",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_package={name:"package",title:"组装线",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_2={name:"bot-2",title:"2号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_3={name:"bot-3",title:"3号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_7={name:"bot-7",title:"7号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_9={name:"bot-9",title:"9号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_12={name:"bot-12",title:"12号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateless_group={groupType:"stateless",title:"静态图标",list:[alternator_svg_file,traction_transformer_svg_file,svg_house,svg_car,svg_hospital,svg_package,svg_bot_2,svg_bot_3,svg_bot_7,svg_bot_9,svg_bot_12]},reservoir={name:"reservoir",title:"蓄水池",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"水流颜色",type:EConfigItemPropsType.Color,val:"#37cfe7"},stroke:{title:"边框颜色",type:EConfigItemPropsType.Color,val:"#000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},animation_group={groupType:"have_animation",title:"动画图标",list:[reservoir]},svg_text={name:"svg-text",title:"文字",tag:"svg-text",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{text:{title:"文字内容",type:EConfigItemPropsType.Input,val:"文字"},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:15},fill:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},switch_a={name:"switch-a",title:"开关",tag:"switch-a",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!0}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},light_a={name:"light",tag:"light-a",title:"灯",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},clock_a={name:"clock-a",title:"时钟",tag:"clock-a",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},custom_svg_group={groupType:"custom_svg_group",title:"SVG组件",list:[svg_text,switch_a,light_a,clock_a]},svg_config_center=Object.seal([stateless_group,stateful_group,animation_group,custom_svg_group]),el_button={name:"el-button",tag:"el-button",title:"按钮",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},type:{title:"类型",type:EConfigItemPropsType.Select,val:"primary",options:[{label:"主要按钮",value:"primary"},{label:"成功按钮",value:"success"},{label:"警告按钮",value:"warning"},{label:"危险按钮",value:"danger"},{label:"信息按钮",value:"info"}]},plain:{title:"朴素按钮",type:EConfigItemPropsType.Switch,val:!1},text:{title:"文字按钮",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"按钮",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},common_table={name:"common-table",title:"通用表格",tag:"common-table",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{"col-config":{title:"列配置",type:EConfigItemPropsType.JsonEdit,val:[{prop:"date",label:"第一列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"name",label:"第二列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"address",label:"第三列测试",width:"280px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1}]},data:{title:"表格数据",type:EConfigItemPropsType.JsonEdit,val:[{date:"2016-05-03",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-02",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-04",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-01",name:"Tom",address:"No. 189, Grove St, Los Angeles"}]},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:null},"max-height":{title:"最大高度",type:EConfigItemPropsType.InputNumber,val:null},stripe:{title:"斑马纹",type:EConfigItemPropsType.Switch,val:!1},border:{title:"纵向边框",type:EConfigItemPropsType.Switch,val:!1},size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},fit:{title:"列宽自撑开",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},now_time={name:"now-time",title:"当前时间",tag:"now-time",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!1,actual_rect:!0},display:!0,props:{fontColor:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},el_tag={name:"el-tag",tag:"el-tag",title:"标签",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{type:{title:"类型",type:EConfigItemPropsType.Select,val:"success",options:[{label:"成功",value:"success"},{label:"警告",value:"warning"},{label:"危险",value:"danger"},{label:"信息",value:"info"}]},closable:{title:"可关闭",type:EConfigItemPropsType.Switch,val:!0},"disable-transitions":{title:"渐变",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"标签",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},progress_a={name:"progress-a",tag:"progress-a",title:"进度条",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{percentage:{title:"进度",type:EConfigItemPropsType.InputNumber,val:10}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},components={groupType:"custom-vue",title:"VUE组件",list:[el_button,progress_a,common_table,now_time,el_tag]},pie_charts={name:"pie-charts",tag:"pie-charts",title:"饼图",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{title:{title:"标题",type:EConfigItemPropsType.Input,val:"默认标题"},seriesName:{title:"详情",type:EConfigItemPropsType.Input,val:"详情标题"},seriesData:{title:"legendData",type:EConfigItemPropsType.JsonEdit,val:[{value:1048,name:"办公楼A"},{value:735,name:"办公楼B"},{value:580,name:"保安室"},{value:484,name:"地下车库"},{value:300,name:"食堂"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},echarts_group={groupType:"echarts",title:"图表",list:[pie_charts]},vue_config_center=Object.seal([components,echarts_group]),_sfc_main$q=vue.defineComponent({__name:"progress",props:{percentage:{default:10}},emits:["onChange"],setup(i,{emit:n}){const r=i,g=[{color:"#f56c6c",percentage:20},{color:"#e6a23c",percentage:40},{color:"#5cb87a",percentage:60},{color:"#1989fa",percentage:80},{color:"#6f7ad3",percentage:100}];return vue.watch(()=>r.percentage,()=>{n("onChange")}),(k,V)=>(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{type:"dashboard",percentage:Number(r.percentage),color:g},null,8,["percentage"]))}}),_hoisted_1$j=["id"],_hoisted_2$f=["id"],_hoisted_3$d=vue.createElementVNode("path",{d:"M735.2 792.4H287.6C136.9 792.4 14.2 669.8 14.2 519c0-150.9 122.6-273.5 273.4-273.5h447.6c150.7 0 273.4 122.6 273.4 273.4 0 150.9-122.7 273.5-273.4 273.5zM287.6 300.2c-120.6 0-218.7 98.1-218.7 218.7 0 120.8 98.1 218.9 218.7 218.9h447.6c120.6 0 218.7-98.1 218.7-218.7 0-120.8-98.1-218.9-218.7-218.9H287.6z",fill:"#666666"},null,-1),_hoisted_4$a=vue.createElementVNode("path",{d:"M724.7 687.1c-92.7 0-168.1-75.4-168.1-168.1S632 350.9 724.7 350.9 892.8 426.3 892.8 519s-75.4 168.1-168.1 168.1z m0-278.6c-60.9 0-110.5 49.6-110.5 110.5s49.5 110.5 110.5 110.5S835.1 579.9 835.1 519s-49.5-110.5-110.4-110.5z",fill:"#666666"},null,-1),_hoisted_5$9=[_hoisted_3$d,_hoisted_4$a],_hoisted_6$6=["id"],_hoisted_7$6=vue.createElementVNode("path",{d:"M704 224H320C161.216 224 32 353.216 32 512c0 158.816 129.216 288 288 288h384c158.816 0 288-129.184 288-288 0-158.784-129.184-288-288-288z m0 512H320C196.48 736 96 635.488 96 512c0-123.52 100.48-224 224-224h384c123.488 0 224 100.48 224 224 0 123.488-100.512 224-224 224z"},null,-1),_hoisted_8$5=vue.createElementVNode("path",{d:"M320 320c-105.888 0-192 86.112-192 192s86.112 192 192 192 192-86.112 192-192-86.112-192-192-192z m0 320c-70.592 0-128-57.408-128-128s57.408-128 128-128 128 57.408 128 128-57.408 128-128 128z"},null,-1),_hoisted_9$4=[_hoisted_7$6,_hoisted_8$5],_hoisted_10$4=["xlink:href"],_hoisted_11$4=["xlink:href"],_sfc_main$p=vue.defineComponent({__name:"switch-a",props:{id:{type:String,default:""},isOpen:{type:Boolean,default:!0}},emits:["onChange"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.isOpen,()=>{n("onChange")}),(g,k)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id},[vue.createElementVNode("symbol",{viewBox:"0 0 1024 1024",id:`${r.id}switch-demo-open`},_hoisted_5$9,8,_hoisted_2$f),vue.createElementVNode("symbol",{viewBox:"0 0 1024 1024",id:`${r.id}switch-demo-close`},_hoisted_9$4,8,_hoisted_6$6),r.isOpen?(vue.openBlock(),vue.createElementBlock("use",{key:0,"xlink:href":`#${r.id}switch-demo-open`,width:"100",height:"100"},null,8,_hoisted_10$4)):(vue.openBlock(),vue.createElementBlock("use",{key:1,"xlink:href":`#${r.id}switch-demo-close`,width:"100",height:"100"},null,8,_hoisted_11$4))],8,_hoisted_1$j))}}),_hoisted_1$i=["font-family","font-size","fill"],_sfc_main$o=vue.defineComponent({__name:"svg-text",props:{fontFamily:{type:String,default:""},fontSize:{type:Number,default:15},text:{type:String,default:""},fill:{type:String,default:""}},emits:["resize"],setup(i,{emit:n}){const r=i;return vue.watch(()=>[r.text,r.fontSize,r.fontFamily],()=>{vue.nextTick(function(){n("resize")})}),(g,k)=>(vue.openBlock(),vue.createElementBlock("text",{x:"50",y:"55","font-family":r.fontFamily,"font-size":r.fontSize,fill:r.fill},vue.toDisplayString(r.text),9,_hoisted_1$i))}}),_sfc_main$n=vue.defineComponent({__name:"common-table",props:{colConfig:{default:()=>[]},data:{default:()=>[]},height:{},maxHeight:{},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1},size:{},fit:{type:Boolean,default:!1},operateDisplay:{type:Boolean,default:!1},selectionData:{default:()=>[]}},setup(i){const n=i,r=vue.ref({});return vue.watchEffect(()=>{const{colConfig:g,...k}=n;r.value=k}),(g,k)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTable),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.colConfig,V=>(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),vue.mergeProps({key:V.prop},V),null,16))),128))]),_:1},16))}}),_hoisted_1$h={class:"flex mt-5px"},_sfc_main$m=vue.defineComponent({__name:"now-time",props:{fontColor:{type:String,default:"#000000"}},setup(i){const n=i,r=vue.ref(new Date),g=vue.ref(),k=vue.computed(()=>{const oe=r.value.getFullYear(),re=r.value.getMonth()+1,Ce=r.value.getDate();return oe.toString()+"年"+re.toString()+"月"+Ce.toString()+"日"}),V=vue.computed(()=>{const oe=r.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][oe]}),$=vue.computed(()=>{const oe=r.value.getHours(),re=r.value.getMinutes(),Ce=r.value.getSeconds();return(oe<10?"0"+oe.toString():oe.toString())+":"+(re<10?"0"+re.toString():re.toString())+":"+(Ce<10?"0"+Ce.toString():Ce.toString())});return vue.onMounted(()=>{g.value=setInterval(()=>{r.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(g.value)}),(oe,re)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",{class:"text-12px font-bold",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString(k.value),5),vue.createElementVNode("div",_hoisted_1$h,[vue.createElementVNode("div",{class:"text-12px font-bold",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString(V.value),5),vue.createElementVNode("div",{class:"text-12px font-bold ml-5px",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString($.value),5)])]))}});/*! *****************************************************************************
292
+ */var matchHtmlRegExp=/["'&<>]/,escapeHtml_1=escapeHtml;function escapeHtml(i){var n=""+i,r=matchHtmlRegExp.exec(n);if(!r)return n;var g,k="",V=0,$=0;for(V=r.index;V<n.length;V++){switch(n.charCodeAt(V)){case 34:g="&quot;";break;case 38:g="&amp;";break;case 39:g="&#39;";break;case 60:g="&lt;";break;case 62:g="&gt;";break;default:continue}$!==V&&(k+=n.substring($,V)),$=V+1,k+=g}return $!==V?k+n.substring($,V):k}const escapeHtml$1=getDefaultExportFromCjs(escapeHtml_1),getCell=function(i){var n;return(n=i.target)==null?void 0:n.closest("td")},orderBy=function(i,n,r,g,k){if(!n&&!g&&(!k||Array.isArray(k)&&!k.length))return i;typeof r=="string"?r=r==="descending"?-1:1:r=r&&r<0?-1:1;const V=g?null:function(oe,re){return k?(Array.isArray(k)||(k=[k]),k.map(Ce=>typeof Ce=="string"?get$1(oe,Ce):Ce(oe,re,i))):(n!=="$key"&&isObject$4(oe)&&"$value"in oe&&(oe=oe.$value),[isObject$4(oe)?get$1(oe,n):oe])},$=function(oe,re){if(g)return g(oe.value,re.value);for(let Ce=0,ie=oe.key.length;Ce<ie;Ce++){if(oe.key[Ce]<re.key[Ce])return-1;if(oe.key[Ce]>re.key[Ce])return 1}return 0};return i.map((oe,re)=>({value:oe,index:re,key:V?V(oe,re):null})).sort((oe,re)=>{let Ce=$(oe,re);return Ce||(Ce=oe.index-re.index),Ce*+r}).map(oe=>oe.value)},getColumnById=function(i,n){let r=null;return i.columns.forEach(g=>{g.id===n&&(r=g)}),r},getColumnByKey=function(i,n){let r=null;for(let g=0;g<i.columns.length;g++){const k=i.columns[g];if(k.columnKey===n){r=k;break}}return r||throwError$1("ElTable",`No column matching with column-key: ${n}`),r},getColumnByCell=function(i,n,r){const g=(n.className||"").match(new RegExp(`${r}-table_[^\\s]+`,"gm"));return g?getColumnById(i,g[0]):null},getRowIdentity=(i,n)=>{if(!i)throw new Error("Row is required when get row identity");if(typeof n=="string"){if(!n.includes("."))return`${i[n]}`;const r=n.split(".");let g=i;for(const k of r)g=g[k];return`${g}`}else if(typeof n=="function")return n.call(null,i)},getKeysMap=function(i,n){const r={};return(i||[]).forEach((g,k)=>{r[getRowIdentity(g,n)]={row:g,index:k}}),r};function mergeOptions(i,n){const r={};let g;for(g in i)r[g]=i[g];for(g in n)if(hasOwn$1(n,g)){const k=n[g];typeof k<"u"&&(r[g]=k)}return r}function parseWidth(i){return i===""||i!==void 0&&(i=Number.parseInt(i,10),Number.isNaN(i)&&(i="")),i}function parseMinWidth(i){return i===""||i!==void 0&&(i=parseWidth(i),Number.isNaN(i)&&(i=80)),i}function parseHeight(i){return typeof i=="number"?i:typeof i=="string"?/^\d+(?:px)?$/.test(i)?Number.parseInt(i,10):i:null}function compose(...i){return i.length===0?n=>n:i.length===1?i[0]:i.reduce((n,r)=>(...g)=>n(r(...g)))}function toggleRowStatus(i,n,r){let g=!1;const k=i.indexOf(n),V=k!==-1,$=oe=>{oe==="add"?i.push(n):i.splice(k,1),g=!0,isArray$3(n.children)&&n.children.forEach(re=>{toggleRowStatus(i,re,r??!V)})};return isBoolean(r)?r&&!V?$("add"):!r&&V&&$("remove"):$(V?"remove":"add"),g}function walkTreeNode(i,n,r="children",g="hasChildren"){const k=$=>!(Array.isArray($)&&$.length);function V($,oe,re){n($,oe,re),oe.forEach(Ce=>{if(Ce[g]){n(Ce,null,re+1);return}const ie=Ce[r];k(ie)||V(Ce,ie,re+1)})}i.forEach($=>{if($[g]){n($,null,0);return}const oe=$[r];k(oe)||V($,oe,0)})}let removePopper;function createTablePopper(i,n,r,g,k){k=merge$2({enterable:!0,showArrow:!0},k);const V=i==null?void 0:i.dataset.prefix,$=i==null?void 0:i.querySelector(`.${V}-scrollbar__wrap`);function oe(){const Ne=k.effect==="light",he=document.createElement("div");return he.className=[`${V}-popper`,Ne?"is-light":"is-dark",k.popperClass||""].join(" "),r=escapeHtml$1(r),he.innerHTML=r,he.style.zIndex=String(g()),i==null||i.appendChild(he),he}function re(){const Ne=document.createElement("div");return Ne.className=`${V}-popper__arrow`,Ne}function Ce(){ie&&ie.update()}removePopper==null||removePopper(),removePopper=()=>{try{ie&&ie.destroy(),Ie&&(i==null||i.removeChild(Ie)),n.removeEventListener("mouseenter",ae),n.removeEventListener("mouseleave",le),$==null||$.removeEventListener("scroll",removePopper),removePopper=void 0}catch{}};let ie=null,ae=Ce,le=removePopper;k.enterable&&({onOpen:ae,onClose:le}=useDelayedToggle({showAfter:k.showAfter,hideAfter:k.hideAfter,open:Ce,close:removePopper}));const Ie=oe();Ie.onmouseenter=ae,Ie.onmouseleave=le;const ue=[];if(k.offset&&ue.push({name:"offset",options:{offset:[0,k.offset]}}),k.showArrow){const Ne=Ie.appendChild(re());ue.push({name:"arrow",options:{element:Ne,padding:10}})}const de=k.popperOptions||{};return ie=yn(n,Ie,{placement:k.placement||"top",strategy:"fixed",...de,modifiers:de.modifiers?ue.concat(de.modifiers):ue}),n.addEventListener("mouseenter",ae),n.addEventListener("mouseleave",le),$==null||$.addEventListener("scroll",removePopper),ie}function getCurrentColumns(i){return i.children?flatMap(i.children,getCurrentColumns):[i]}function getColSpan(i,n){return i+n.colSpan}const isFixedColumn=(i,n,r,g)=>{let k=0,V=i;const $=r.states.columns.value;if(g){const re=getCurrentColumns(g[i]);k=$.slice(0,$.indexOf(re[0])).reduce(getColSpan,0),V=k+re.reduce(getColSpan,0)-1}else k=i;let oe;switch(n){case"left":V<r.states.fixedLeafColumnsLength.value&&(oe="left");break;case"right":k>=$.length-r.states.rightFixedLeafColumnsLength.value&&(oe="right");break;default:V<r.states.fixedLeafColumnsLength.value?oe="left":k>=$.length-r.states.rightFixedLeafColumnsLength.value&&(oe="right")}return oe?{direction:oe,start:k,after:V}:{}},getFixedColumnsClass=(i,n,r,g,k,V=0)=>{const $=[],{direction:oe,start:re,after:Ce}=isFixedColumn(n,r,g,k);if(oe){const ie=oe==="left";$.push(`${i}-fixed-column--${oe}`),ie&&Ce+V===g.states.fixedLeafColumnsLength.value-1?$.push("is-last-column"):!ie&&re-V===g.states.columns.value.length-g.states.rightFixedLeafColumnsLength.value&&$.push("is-first-column")}return $};function getOffset(i,n){return i+(n.realWidth===null||Number.isNaN(n.realWidth)?Number(n.width):n.realWidth)}const getFixedColumnOffset=(i,n,r,g)=>{const{direction:k,start:V=0,after:$=0}=isFixedColumn(i,n,r,g);if(!k)return;const oe={},re=k==="left",Ce=r.states.columns.value;return re?oe.left=Ce.slice(0,V).reduce(getOffset,0):oe.right=Ce.slice($+1).reverse().reduce(getOffset,0),oe},ensurePosition=(i,n)=>{i&&(Number.isNaN(i[n])||(i[n]=`${i[n]}px`))};function useExpand(i){const n=vue.getCurrentInstance(),r=vue.ref(!1),g=vue.ref([]);return{updateExpandRows:()=>{const re=i.data.value||[],Ce=i.rowKey.value;if(r.value)g.value=re.slice();else if(Ce){const ie=getKeysMap(g.value,Ce);g.value=re.reduce((ae,le)=>{const Ie=getRowIdentity(le,Ce);return ie[Ie]&&ae.push(le),ae},[])}else g.value=[]},toggleRowExpansion:(re,Ce)=>{toggleRowStatus(g.value,re,Ce)&&n.emit("expand-change",re,g.value.slice())},setExpandRowKeys:re=>{n.store.assertRowKey();const Ce=i.data.value||[],ie=i.rowKey.value,ae=getKeysMap(Ce,ie);g.value=re.reduce((le,Ie)=>{const ue=ae[Ie];return ue&&le.push(ue.row),le},[])},isRowExpanded:re=>{const Ce=i.rowKey.value;return Ce?!!getKeysMap(g.value,Ce)[getRowIdentity(re,Ce)]:g.value.includes(re)},states:{expandRows:g,defaultExpandAll:r}}}function useCurrent(i){const n=vue.getCurrentInstance(),r=vue.ref(null),g=vue.ref(null),k=Ce=>{n.store.assertRowKey(),r.value=Ce,$(Ce)},V=()=>{r.value=null},$=Ce=>{const{data:ie,rowKey:ae}=i;let le=null;ae.value&&(le=(vue.unref(ie)||[]).find(Ie=>getRowIdentity(Ie,ae.value)===Ce)),g.value=le,n.emit("current-change",g.value,null)};return{setCurrentRowKey:k,restoreCurrentRowKey:V,setCurrentRowByKey:$,updateCurrentRow:Ce=>{const ie=g.value;if(Ce&&Ce!==ie){g.value=Ce,n.emit("current-change",g.value,ie);return}!Ce&&ie&&(g.value=null,n.emit("current-change",null,ie))},updateCurrentRowData:()=>{const Ce=i.rowKey.value,ie=i.data.value||[],ae=g.value;if(!ie.includes(ae)&&ae){if(Ce){const le=getRowIdentity(ae,Ce);$(le)}else g.value=null;g.value===null&&n.emit("current-change",null,ae)}else r.value&&($(r.value),V())},states:{_currentRowKey:r,currentRow:g}}}function useTree(i){const n=vue.ref([]),r=vue.ref({}),g=vue.ref(16),k=vue.ref(!1),V=vue.ref({}),$=vue.ref("hasChildren"),oe=vue.ref("children"),re=vue.getCurrentInstance(),Ce=vue.computed(()=>{if(!i.rowKey.value)return{};const he=i.data.value||[];return ae(he)}),ie=vue.computed(()=>{const he=i.rowKey.value,pe=Object.keys(V.value),ze={};return pe.length&&pe.forEach(Fe=>{if(V.value[Fe].length){const xe={children:[]};V.value[Fe].forEach(_e=>{const Dt=getRowIdentity(_e,he);xe.children.push(Dt),_e[$.value]&&!ze[Dt]&&(ze[Dt]={children:[]})}),ze[Fe]=xe}}),ze}),ae=he=>{const pe=i.rowKey.value,ze={};return walkTreeNode(he,(Fe,xe,_e)=>{const Dt=getRowIdentity(Fe,pe);Array.isArray(xe)?ze[Dt]={children:xe.map($e=>getRowIdentity($e,pe)),level:_e}:k.value&&(ze[Dt]={children:[],lazy:!0,level:_e})},oe.value,$.value),ze},le=(he=!1,pe=(ze=>(ze=re.store)==null?void 0:ze.states.defaultExpandAll.value)())=>{var ze;const Fe=Ce.value,xe=ie.value,_e=Object.keys(Fe),Dt={};if(_e.length){const $e=vue.unref(r),Ue=[],Ve=(At,qe)=>{if(he)return n.value?pe||n.value.includes(qe):!!(pe||At!=null&&At.expanded);{const Lt=pe||n.value&&n.value.includes(qe);return!!(At!=null&&At.expanded||Lt)}};_e.forEach(At=>{const qe=$e[At],Lt={...Fe[At]};if(Lt.expanded=Ve(qe,At),Lt.lazy){const{loaded:kt=!1,loading:jt=!1}=qe||{};Lt.loaded=!!kt,Lt.loading=!!jt,Ue.push(At)}Dt[At]=Lt});const Oe=Object.keys(xe);k.value&&Oe.length&&Ue.length&&Oe.forEach(At=>{const qe=$e[At],Lt=xe[At].children;if(Ue.includes(At)){if(Dt[At].children.length!==0)throw new Error("[ElTable]children must be an empty array.");Dt[At].children=Lt}else{const{loaded:kt=!1,loading:jt=!1}=qe||{};Dt[At]={lazy:!0,loaded:!!kt,loading:!!jt,expanded:Ve(qe,At),children:Lt,level:""}}})}r.value=Dt,(ze=re.store)==null||ze.updateTableScrollY()};vue.watch(()=>n.value,()=>{le(!0)}),vue.watch(()=>Ce.value,()=>{le()}),vue.watch(()=>ie.value,()=>{le()});const Ie=he=>{n.value=he,le()},ue=(he,pe)=>{re.store.assertRowKey();const ze=i.rowKey.value,Fe=getRowIdentity(he,ze),xe=Fe&&r.value[Fe];if(Fe&&xe&&"expanded"in xe){const _e=xe.expanded;pe=typeof pe>"u"?!xe.expanded:pe,r.value[Fe].expanded=pe,_e!==pe&&re.emit("expand-change",he,pe),re.store.updateTableScrollY()}},de=he=>{re.store.assertRowKey();const pe=i.rowKey.value,ze=getRowIdentity(he,pe),Fe=r.value[ze];k.value&&Fe&&"loaded"in Fe&&!Fe.loaded?Ne(he,ze,Fe):ue(he,void 0)},Ne=(he,pe,ze)=>{const{load:Fe}=re.props;Fe&&!r.value[pe].loaded&&(r.value[pe].loading=!0,Fe(he,ze,xe=>{if(!Array.isArray(xe))throw new TypeError("[ElTable] data must be an array");r.value[pe].loading=!1,r.value[pe].loaded=!0,r.value[pe].expanded=!0,xe.length&&(V.value[pe]=xe),re.emit("expand-change",he,!0)}))};return{loadData:Ne,loadOrToggle:de,toggleTreeExpansion:ue,updateTreeExpandKeys:Ie,updateTreeData:le,normalize:ae,states:{expandRowKeys:n,treeData:r,indent:g,lazy:k,lazyTreeNodeMap:V,lazyColumnIdentifier:$,childrenColumnName:oe}}}const sortData=(i,n)=>{const r=n.sortingColumn;return!r||typeof r.sortable=="string"?i:orderBy(i,n.sortProp,n.sortOrder,r.sortMethod,r.sortBy)},doFlattenColumns=i=>{const n=[];return i.forEach(r=>{r.children&&r.children.length>0?n.push.apply(n,doFlattenColumns(r.children)):n.push(r)}),n};function useWatcher$1(){var i;const n=vue.getCurrentInstance(),{size:r}=vue.toRefs((i=n.proxy)==null?void 0:i.$props),g=vue.ref(null),k=vue.ref([]),V=vue.ref([]),$=vue.ref(!1),oe=vue.ref([]),re=vue.ref([]),Ce=vue.ref([]),ie=vue.ref([]),ae=vue.ref([]),le=vue.ref([]),Ie=vue.ref([]),ue=vue.ref([]),de=[],Ne=vue.ref(0),he=vue.ref(0),pe=vue.ref(0),ze=vue.ref(!1),Fe=vue.ref([]),xe=vue.ref(!1),_e=vue.ref(!1),Dt=vue.ref(null),$e=vue.ref({}),Ue=vue.ref(null),Ve=vue.ref(null),Oe=vue.ref(null),At=vue.ref(null),qe=vue.ref(null);vue.watch(k,()=>n.state&&ti(!1),{deep:!0});const Lt=()=>{if(!g.value)throw new Error("[ElTable] prop row-key is required")},kt=Oi=>{var xi;(xi=Oi.children)==null||xi.forEach(Li=>{Li.fixed=Oi.fixed,kt(Li)})},jt=()=>{oe.value.forEach(ki=>{kt(ki)}),ie.value=oe.value.filter(ki=>ki.fixed===!0||ki.fixed==="left"),ae.value=oe.value.filter(ki=>ki.fixed==="right"),ie.value.length>0&&oe.value[0]&&oe.value[0].type==="selection"&&!oe.value[0].fixed&&(oe.value[0].fixed=!0,ie.value.unshift(oe.value[0]));const Oi=oe.value.filter(ki=>!ki.fixed);re.value=[].concat(ie.value).concat(Oi).concat(ae.value);const xi=doFlattenColumns(Oi),Li=doFlattenColumns(ie.value),Wi=doFlattenColumns(ae.value);Ne.value=xi.length,he.value=Li.length,pe.value=Wi.length,Ce.value=[].concat(Li).concat(xi).concat(Wi),$.value=ie.value.length>0||ae.value.length>0},ti=(Oi,xi=!1)=>{Oi&&jt(),xi?n.state.doLayout():n.state.debouncedUpdateLayout()},ei=Oi=>Fe.value.includes(Oi),Pt=()=>{ze.value=!1,Fe.value.length&&(Fe.value=[],n.emit("selection-change",[]))},ni=()=>{let Oi;if(g.value){Oi=[];const xi=getKeysMap(Fe.value,g.value),Li=getKeysMap(k.value,g.value);for(const Wi in xi)hasOwn$1(xi,Wi)&&!Li[Wi]&&Oi.push(xi[Wi].row)}else Oi=Fe.value.filter(xi=>!k.value.includes(xi));if(Oi.length){const xi=Fe.value.filter(Li=>!Oi.includes(Li));Fe.value=xi,n.emit("selection-change",xi.slice())}},gi=()=>(Fe.value||[]).slice(),di=(Oi,xi=void 0,Li=!0)=>{if(toggleRowStatus(Fe.value,Oi,xi)){const ki=(Fe.value||[]).slice();Li&&n.emit("select",ki,Oi),n.emit("selection-change",ki)}},li=()=>{var Oi,xi;const Li=_e.value?!ze.value:!(ze.value||Fe.value.length);ze.value=Li;let Wi=!1,ki=0;const Ri=(xi=(Oi=n==null?void 0:n.store)==null?void 0:Oi.states)==null?void 0:xi.rowKey.value;k.value.forEach((Ki,Ti)=>{const Di=Ti+ki;Dt.value?Dt.value.call(null,Ki,Di)&&toggleRowStatus(Fe.value,Ki,Li)&&(Wi=!0):toggleRowStatus(Fe.value,Ki,Li)&&(Wi=!0),ki+=pi(getRowIdentity(Ki,Ri))}),Wi&&n.emit("selection-change",Fe.value?Fe.value.slice():[]),n.emit("select-all",Fe.value)},ai=()=>{const Oi=getKeysMap(Fe.value,g.value);k.value.forEach(xi=>{const Li=getRowIdentity(xi,g.value),Wi=Oi[Li];Wi&&(Fe.value[Wi.index]=xi)})},ci=()=>{var Oi,xi,Li;if(((Oi=k.value)==null?void 0:Oi.length)===0){ze.value=!1;return}let Wi;g.value&&(Wi=getKeysMap(Fe.value,g.value));const ki=function(Di){return Wi?!!Wi[getRowIdentity(Di,g.value)]:Fe.value.includes(Di)};let Ri=!0,Ki=0,Ti=0;for(let Di=0,Bi=(k.value||[]).length;Di<Bi;Di++){const Vi=(Li=(xi=n==null?void 0:n.store)==null?void 0:xi.states)==null?void 0:Li.rowKey.value,Ei=Di+Ti,ji=k.value[Di],Ui=Dt.value&&Dt.value.call(null,ji,Ei);if(ki(ji))Ki++;else if(!Dt.value||Ui){Ri=!1;break}Ti+=pi(getRowIdentity(ji,Vi))}Ki===0&&(Ri=!1),ze.value=Ri},pi=Oi=>{var xi;if(!n||!n.store)return 0;const{treeData:Li}=n.store.states;let Wi=0;const ki=(xi=Li.value[Oi])==null?void 0:xi.children;return ki&&(Wi+=ki.length,ki.forEach(Ri=>{Wi+=pi(Ri)})),Wi},yi=(Oi,xi)=>{Array.isArray(Oi)||(Oi=[Oi]);const Li={};return Oi.forEach(Wi=>{$e.value[Wi.id]=xi,Li[Wi.columnKey||Wi.id]=xi}),Li},Ai=(Oi,xi,Li)=>{Ve.value&&Ve.value!==Oi&&(Ve.value.order=null),Ve.value=Oi,Oe.value=xi,At.value=Li},hi=()=>{let Oi=vue.unref(V);Object.keys($e.value).forEach(xi=>{const Li=$e.value[xi];if(!Li||Li.length===0)return;const Wi=getColumnById({columns:Ce.value},xi);Wi&&Wi.filterMethod&&(Oi=Oi.filter(ki=>Li.some(Ri=>Wi.filterMethod.call(null,Ri,ki,Wi))))}),Ue.value=Oi},wi=()=>{k.value=sortData(Ue.value,{sortingColumn:Ve.value,sortProp:Oe.value,sortOrder:At.value})},Ci=(Oi=void 0)=>{Oi&&Oi.filter||hi(),wi()},mi=Oi=>{const{tableHeaderRef:xi}=n.refs;if(!xi)return;const Li=Object.assign({},xi.filterPanels),Wi=Object.keys(Li);if(Wi.length)if(typeof Oi=="string"&&(Oi=[Oi]),Array.isArray(Oi)){const ki=Oi.map(Ri=>getColumnByKey({columns:Ce.value},Ri));Wi.forEach(Ri=>{const Ki=ki.find(Ti=>Ti.id===Ri);Ki&&(Ki.filteredValue=[])}),n.store.commit("filterChange",{column:ki,values:[],silent:!0,multi:!0})}else Wi.forEach(ki=>{const Ri=Ce.value.find(Ki=>Ki.id===ki);Ri&&(Ri.filteredValue=[])}),$e.value={},n.store.commit("filterChange",{column:{},values:[],silent:!0})},Ni=()=>{Ve.value&&(Ai(null,null,null),n.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:Mi,toggleRowExpansion:fi,updateExpandRows:zi,states:Si,isRowExpanded:si}=useExpand({data:k,rowKey:g}),{updateTreeExpandKeys:Ii,toggleTreeExpansion:oi,updateTreeData:Et,loadOrToggle:ii,states:ri}=useTree({data:k,rowKey:g}),{updateCurrentRowData:ui,updateCurrentRow:vi,setCurrentRowKey:bi,states:Zi}=useCurrent({data:k,rowKey:g});return{assertRowKey:Lt,updateColumns:jt,scheduleLayout:ti,isSelected:ei,clearSelection:Pt,cleanSelection:ni,getSelectionRows:gi,toggleRowSelection:di,_toggleAllSelection:li,toggleAllSelection:null,updateSelectionByRowKey:ai,updateAllSelected:ci,updateFilters:yi,updateCurrentRow:vi,updateSort:Ai,execFilter:hi,execSort:wi,execQuery:Ci,clearFilter:mi,clearSort:Ni,toggleRowExpansion:fi,setExpandRowKeysAdapter:Oi=>{Mi(Oi),Ii(Oi)},setCurrentRowKey:bi,toggleRowExpansionAdapter:(Oi,xi)=>{Ce.value.some(({type:Wi})=>Wi==="expand")?fi(Oi,xi):oi(Oi,xi)},isRowExpanded:si,updateExpandRows:zi,updateCurrentRowData:ui,loadOrToggle:ii,updateTreeData:Et,states:{tableSize:r,rowKey:g,data:k,_data:V,isComplex:$,_columns:oe,originColumns:re,columns:Ce,fixedColumns:ie,rightFixedColumns:ae,leafColumns:le,fixedLeafColumns:Ie,rightFixedLeafColumns:ue,updateOrderFns:de,leafColumnsLength:Ne,fixedLeafColumnsLength:he,rightFixedLeafColumnsLength:pe,isAllSelected:ze,selection:Fe,reserveSelection:xe,selectOnIndeterminate:_e,selectable:Dt,filters:$e,filteredData:Ue,sortingColumn:Ve,sortProp:Oe,sortOrder:At,hoverRow:qe,...Si,...ri,...Zi}}}function replaceColumn(i,n){return i.map(r=>{var g;return r.id===n.id?n:((g=r.children)!=null&&g.length&&(r.children=replaceColumn(r.children,n)),r)})}function sortColumn(i){i.forEach(n=>{var r,g;n.no=(r=n.getColumnIndex)==null?void 0:r.call(n),(g=n.children)!=null&&g.length&&sortColumn(n.children)}),i.sort((n,r)=>n.no-r.no)}function useStore(){const i=vue.getCurrentInstance(),n=useWatcher$1();return{ns:useNamespace("table"),...n,mutations:{setData($,oe){const re=vue.unref($._data)!==oe;$.data.value=oe,$._data.value=oe,i.store.execQuery(),i.store.updateCurrentRowData(),i.store.updateExpandRows(),i.store.updateTreeData(i.store.states.defaultExpandAll.value),vue.unref($.reserveSelection)?(i.store.assertRowKey(),i.store.updateSelectionByRowKey()):re?i.store.clearSelection():i.store.cleanSelection(),i.store.updateAllSelected(),i.$ready&&i.store.scheduleLayout()},insertColumn($,oe,re,Ce){const ie=vue.unref($._columns);let ae=[];re?(re&&!re.children&&(re.children=[]),re.children.push(oe),ae=replaceColumn(ie,re)):(ie.push(oe),ae=ie),sortColumn(ae),$._columns.value=ae,$.updateOrderFns.push(Ce),oe.type==="selection"&&($.selectable.value=oe.selectable,$.reserveSelection.value=oe.reserveSelection),i.$ready&&(i.store.updateColumns(),i.store.scheduleLayout())},updateColumnOrder($,oe){var re;((re=oe.getColumnIndex)==null?void 0:re.call(oe))!==oe.no&&(sortColumn($._columns.value),i.$ready&&i.store.updateColumns())},removeColumn($,oe,re,Ce){const ie=vue.unref($._columns)||[];if(re)re.children.splice(re.children.findIndex(le=>le.id===oe.id),1),vue.nextTick(()=>{var le;((le=re.children)==null?void 0:le.length)===0&&delete re.children}),$._columns.value=replaceColumn(ie,re);else{const le=ie.indexOf(oe);le>-1&&(ie.splice(le,1),$._columns.value=ie)}const ae=$.updateOrderFns.indexOf(Ce);ae>-1&&$.updateOrderFns.splice(ae,1),i.$ready&&(i.store.updateColumns(),i.store.scheduleLayout())},sort($,oe){const{prop:re,order:Ce,init:ie}=oe;if(re){const ae=vue.unref($.columns).find(le=>le.property===re);ae&&(ae.order=Ce,i.store.updateSort(ae,re,Ce),i.store.commit("changeSortCondition",{init:ie}))}},changeSortCondition($,oe){const{sortingColumn:re,sortProp:Ce,sortOrder:ie}=$,ae=vue.unref(re),le=vue.unref(Ce),Ie=vue.unref(ie);Ie===null&&($.sortingColumn.value=null,$.sortProp.value=null);const ue={filter:!0};i.store.execQuery(ue),(!oe||!(oe.silent||oe.init))&&i.emit("sort-change",{column:ae,prop:le,order:Ie}),i.store.updateTableScrollY()},filterChange($,oe){const{column:re,values:Ce,silent:ie}=oe,ae=i.store.updateFilters(re,Ce);i.store.execQuery(),ie||i.emit("filter-change",ae),i.store.updateTableScrollY()},toggleAllSelection(){i.store.toggleAllSelection()},rowSelectedChanged($,oe){i.store.toggleRowSelection(oe),i.store.updateAllSelected()},setHoverRow($,oe){$.hoverRow.value=oe},setCurrentRow($,oe){i.store.updateCurrentRow(oe)}},commit:function($,...oe){const re=i.store.mutations;if(re[$])re[$].apply(i,[i.store.states].concat(oe));else throw new Error(`Action not found: ${$}`)},updateTableScrollY:function(){vue.nextTick(()=>i.layout.updateScrollY.apply(i.layout))}}}const InitialStateMap={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data",["treeProps.hasChildren"]:{key:"lazyColumnIdentifier",default:"hasChildren"},["treeProps.children"]:{key:"childrenColumnName",default:"children"}};function createStore(i,n){if(!i)throw new Error("Table is required.");const r=useStore();return r.toggleAllSelection=debounce(r._toggleAllSelection,10),Object.keys(InitialStateMap).forEach(g=>{handleValue(getArrKeysValue(n,g),g,r)}),proxyTableProps(r,n),r}function proxyTableProps(i,n){Object.keys(InitialStateMap).forEach(r=>{vue.watch(()=>getArrKeysValue(n,r),g=>{handleValue(g,r,i)})})}function handleValue(i,n,r){let g=i,k=InitialStateMap[n];typeof InitialStateMap[n]=="object"&&(k=k.key,g=g||InitialStateMap[n].default),r.states[k].value=g}function getArrKeysValue(i,n){if(n.includes(".")){const r=n.split(".");let g=i;return r.forEach(k=>{g=g[k]}),g}else return i[n]}class TableLayout{constructor(n){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=vue.ref(null),this.scrollX=vue.ref(!1),this.scrollY=vue.ref(!1),this.bodyWidth=vue.ref(null),this.fixedWidth=vue.ref(null),this.rightFixedWidth=vue.ref(null),this.gutterWidth=0;for(const r in n)hasOwn$1(n,r)&&(vue.isRef(this[r])?this[r].value=n[r]:this[r]=n[r]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){if(this.height.value===null)return!1;const r=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(r!=null&&r.wrapRef)){let g=!0;const k=this.scrollY.value;return g=r.wrapRef.scrollHeight>r.wrapRef.clientHeight,this.scrollY.value=g,k!==g}return!1}setHeight(n,r="height"){if(!isClient)return;const g=this.table.vnode.el;if(n=parseHeight(n),this.height.value=Number(n),!g&&(n||n===0))return vue.nextTick(()=>this.setHeight(n,r));typeof n=="number"?(g.style[r]=`${n}px`,this.updateElsHeight()):typeof n=="string"&&(g.style[r]=n,this.updateElsHeight())}setMaxHeight(n){this.setHeight(n,"max-height")}getFlattenColumns(){const n=[];return this.table.store.states.columns.value.forEach(g=>{g.isColumnGroup?n.push.apply(n,g.columns):n.push(g)}),n}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(n){if(!n)return!0;let r=n;for(;r.tagName!=="DIV";){if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}updateColumnsWidth(){if(!isClient)return;const n=this.fit,r=this.table.vnode.el.clientWidth;let g=0;const k=this.getFlattenColumns(),V=k.filter(re=>typeof re.width!="number");if(k.forEach(re=>{typeof re.width=="number"&&re.realWidth&&(re.realWidth=null)}),V.length>0&&n){if(k.forEach(re=>{g+=Number(re.width||re.minWidth||80)}),g<=r){this.scrollX.value=!1;const re=r-g;if(V.length===1)V[0].realWidth=Number(V[0].minWidth||80)+re;else{const Ce=V.reduce((le,Ie)=>le+Number(Ie.minWidth||80),0),ie=re/Ce;let ae=0;V.forEach((le,Ie)=>{if(Ie===0)return;const ue=Math.floor(Number(le.minWidth||80)*ie);ae+=ue,le.realWidth=Number(le.minWidth||80)+ue}),V[0].realWidth=Number(V[0].minWidth||80)+re-ae}}else this.scrollX.value=!0,V.forEach(re=>{re.realWidth=Number(re.minWidth)});this.bodyWidth.value=Math.max(g,r),this.table.state.resizeState.value.width=this.bodyWidth.value}else k.forEach(re=>{!re.width&&!re.minWidth?re.realWidth=80:re.realWidth=Number(re.width||re.minWidth),g+=re.realWidth}),this.scrollX.value=g>r,this.bodyWidth.value=g;const $=this.store.states.fixedColumns.value;if($.length>0){let re=0;$.forEach(Ce=>{re+=Number(Ce.realWidth||Ce.width)}),this.fixedWidth.value=re}const oe=this.store.states.rightFixedColumns.value;if(oe.length>0){let re=0;oe.forEach(Ce=>{re+=Number(Ce.realWidth||Ce.width)}),this.rightFixedWidth.value=re}this.notifyObservers("columns")}addObserver(n){this.observers.push(n)}removeObserver(n){const r=this.observers.indexOf(n);r!==-1&&this.observers.splice(r,1)}notifyObservers(n){this.observers.forEach(g=>{var k,V;switch(n){case"columns":(k=g.state)==null||k.onColumnsChange(this);break;case"scrollable":(V=g.state)==null||V.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${n}.`)}})}}const{CheckboxGroup:ElCheckboxGroup}=ElCheckbox,_sfc_main$D=vue.defineComponent({name:"ElTableFilterPanel",components:{ElCheckbox,ElCheckboxGroup,ElScrollbar,ElTooltip,ElIcon,ArrowDown:arrow_down_default,ArrowUp:arrow_up_default},directives:{ClickOutside},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(i){const n=vue.getCurrentInstance(),{t:r}=useLocale(),g=useNamespace("table-filter"),k=n==null?void 0:n.parent;k.filterPanels.value[i.column.id]||(k.filterPanels.value[i.column.id]=n);const V=vue.ref(!1),$=vue.ref(null),oe=vue.computed(()=>i.column&&i.column.filters),re=vue.computed({get:()=>{var Fe;return(((Fe=i.column)==null?void 0:Fe.filteredValue)||[])[0]},set:Fe=>{Ce.value&&(typeof Fe<"u"&&Fe!==null?Ce.value.splice(0,1,Fe):Ce.value.splice(0,1))}}),Ce=vue.computed({get(){return i.column?i.column.filteredValue||[]:[]},set(Fe){i.column&&i.upDataColumn("filteredValue",Fe)}}),ie=vue.computed(()=>i.column?i.column.filterMultiple:!0),ae=Fe=>Fe.value===re.value,le=()=>{V.value=!1},Ie=Fe=>{Fe.stopPropagation(),V.value=!V.value},ue=()=>{V.value=!1},de=()=>{pe(Ce.value),le()},Ne=()=>{Ce.value=[],pe(Ce.value),le()},he=Fe=>{re.value=Fe,pe(typeof Fe<"u"&&Fe!==null?Ce.value:[]),le()},pe=Fe=>{i.store.commit("filterChange",{column:i.column,values:Fe}),i.store.updateAllSelected()};vue.watch(V,Fe=>{i.column&&i.upDataColumn("filterOpened",Fe)},{immediate:!0});const ze=vue.computed(()=>{var Fe,xe;return(xe=(Fe=$.value)==null?void 0:Fe.popperRef)==null?void 0:xe.contentRef});return{tooltipVisible:V,multiple:ie,filteredValue:Ce,filterValue:re,filters:oe,handleConfirm:de,handleReset:Ne,handleSelect:he,isActive:ae,t:r,ns:g,showFilterPanel:Ie,hideFilterPanel:ue,popperPaneRef:ze,tooltip:$}}}),_hoisted_1$s={key:0},_hoisted_2$m=["disabled"],_hoisted_3$g=["label","onClick"];function _sfc_render$5(i,n,r,g,k,V){const $=vue.resolveComponent("el-checkbox"),oe=vue.resolveComponent("el-checkbox-group"),re=vue.resolveComponent("el-scrollbar"),Ce=vue.resolveComponent("arrow-up"),ie=vue.resolveComponent("arrow-down"),ae=vue.resolveComponent("el-icon"),le=vue.resolveComponent("el-tooltip"),Ie=vue.resolveDirective("click-outside");return vue.openBlock(),vue.createBlock(le,{ref:"tooltip",visible:i.tooltipVisible,offset:0,placement:i.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":i.ns.b(),persistent:""},{content:vue.withCtx(()=>[i.multiple?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$s,[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("content"))},[vue.createVNode(re,{"wrap-class":i.ns.e("wrap")},{default:vue.withCtx(()=>[vue.createVNode(oe,{modelValue:i.filteredValue,"onUpdate:modelValue":n[0]||(n[0]=ue=>i.filteredValue=ue),class:vue.normalizeClass(i.ns.e("checkbox-group"))},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.filters,ue=>(vue.openBlock(),vue.createBlock($,{key:ue.value,label:ue.value},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ue.text),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["wrap-class"])],2),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("bottom"))},[vue.createElementVNode("button",{class:vue.normalizeClass({[i.ns.is("disabled")]:i.filteredValue.length===0}),disabled:i.filteredValue.length===0,type:"button",onClick:n[1]||(n[1]=(...ue)=>i.handleConfirm&&i.handleConfirm(...ue))},vue.toDisplayString(i.t("el.table.confirmFilter")),11,_hoisted_2$m),vue.createElementVNode("button",{type:"button",onClick:n[2]||(n[2]=(...ue)=>i.handleReset&&i.handleReset(...ue))},vue.toDisplayString(i.t("el.table.resetFilter")),1)],2)])):(vue.openBlock(),vue.createElementBlock("ul",{key:1,class:vue.normalizeClass(i.ns.e("list"))},[vue.createElementVNode("li",{class:vue.normalizeClass([i.ns.e("list-item"),{[i.ns.is("active")]:i.filterValue===void 0||i.filterValue===null}]),onClick:n[3]||(n[3]=ue=>i.handleSelect(null))},vue.toDisplayString(i.t("el.table.clearFilter")),3),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.filters,ue=>(vue.openBlock(),vue.createElementBlock("li",{key:ue.value,class:vue.normalizeClass([i.ns.e("list-item"),i.ns.is("active",i.isActive(ue))]),label:ue.value,onClick:de=>i.handleSelect(ue.value)},vue.toDisplayString(ue.text),11,_hoisted_3$g))),128))],2))]),default:vue.withCtx(()=>[vue.withDirectives((vue.openBlock(),vue.createElementBlock("span",{class:vue.normalizeClass([`${i.ns.namespace.value}-table__column-filter-trigger`,`${i.ns.namespace.value}-none-outline`]),onClick:n[4]||(n[4]=(...ue)=>i.showFilterPanel&&i.showFilterPanel(...ue))},[vue.createVNode(ae,null,{default:vue.withCtx(()=>[i.column.filterOpened?(vue.openBlock(),vue.createBlock(Ce,{key:0})):(vue.openBlock(),vue.createBlock(ie,{key:1}))]),_:1})],2)),[[Ie,i.hideFilterPanel,i.popperPaneRef]])]),_:1},8,["visible","placement","popper-class"])}var FilterPanel=_export_sfc$1(_sfc_main$D,[["render",_sfc_render$5],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/filter-panel.vue"]]);function useLayoutObserver(i){const n=vue.getCurrentInstance();vue.onBeforeMount(()=>{r.value.addObserver(n)}),vue.onMounted(()=>{g(r.value),k(r.value)}),vue.onUpdated(()=>{g(r.value),k(r.value)}),vue.onUnmounted(()=>{r.value.removeObserver(n)});const r=vue.computed(()=>{const V=i.layout;if(!V)throw new Error("Can not find table layout.");return V}),g=V=>{var $;const oe=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col"))||[];if(!oe.length)return;const re=V.getFlattenColumns(),Ce={};re.forEach(ie=>{Ce[ie.id]=ie});for(let ie=0,ae=oe.length;ie<ae;ie++){const le=oe[ie],Ie=le.getAttribute("name"),ue=Ce[Ie];ue&&le.setAttribute("width",ue.realWidth||ue.width)}},k=V=>{var $,oe;const re=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let ie=0,ae=re.length;ie<ae;ie++)re[ie].setAttribute("width",V.scrollY.value?V.gutterWidth:"0");const Ce=((oe=i.vnode.el)==null?void 0:oe.querySelectorAll("th.gutter"))||[];for(let ie=0,ae=Ce.length;ie<ae;ie++){const le=Ce[ie];le.style.width=V.scrollY.value?`${V.gutterWidth}px`:"0",le.style.display=V.scrollY.value?"":"none"}};return{tableLayout:r.value,onColumnsChange:g,onScrollableChange:k}}const TABLE_INJECTION_KEY=Symbol("ElTable");function useEvent(i,n){const r=vue.getCurrentInstance(),g=vue.inject(TABLE_INJECTION_KEY),k=de=>{de.stopPropagation()},V=(de,Ne)=>{!Ne.filters&&Ne.sortable?ue(de,Ne,!1):Ne.filterable&&!Ne.sortable&&k(de),g==null||g.emit("header-click",Ne,de)},$=(de,Ne)=>{g==null||g.emit("header-contextmenu",Ne,de)},oe=vue.ref(null),re=vue.ref(!1),Ce=vue.ref({}),ie=(de,Ne)=>{if(isClient&&!(Ne.children&&Ne.children.length>0)&&oe.value&&i.border){re.value=!0;const he=g;n("set-drag-visible",!0);const ze=(he==null?void 0:he.vnode.el).getBoundingClientRect().left,Fe=r.vnode.el.querySelector(`th.${Ne.id}`),xe=Fe.getBoundingClientRect(),_e=xe.left-ze+30;addClass(Fe,"noclick"),Ce.value={startMouseLeft:de.clientX,startLeft:xe.right-ze,startColumnLeft:xe.left-ze,tableLeft:ze};const Dt=he==null?void 0:he.refs.resizeProxy;Dt.style.left=`${Ce.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const $e=Ve=>{const Oe=Ve.clientX-Ce.value.startMouseLeft,At=Ce.value.startLeft+Oe;Dt.style.left=`${Math.max(_e,At)}px`},Ue=()=>{if(re.value){const{startColumnLeft:Ve,startLeft:Oe}=Ce.value,qe=Number.parseInt(Dt.style.left,10)-Ve;Ne.width=Ne.realWidth=qe,he==null||he.emit("header-dragend",Ne.width,Oe-Ve,Ne,de),requestAnimationFrame(()=>{i.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",re.value=!1,oe.value=null,Ce.value={},n("set-drag-visible",!1)}document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",Ue),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{removeClass(Fe,"noclick")},0)};document.addEventListener("mousemove",$e),document.addEventListener("mouseup",Ue)}},ae=(de,Ne)=>{if(Ne.children&&Ne.children.length>0)return;const he=de.target;if(!isElement(he))return;const pe=he==null?void 0:he.closest("th");if(!(!Ne||!Ne.resizable)&&!re.value&&i.border){const ze=pe.getBoundingClientRect(),Fe=document.body.style;ze.width>12&&ze.right-de.pageX<8?(Fe.cursor="col-resize",hasClass(pe,"is-sortable")&&(pe.style.cursor="col-resize"),oe.value=Ne):re.value||(Fe.cursor="",hasClass(pe,"is-sortable")&&(pe.style.cursor="pointer"),oe.value=null)}},le=()=>{isClient&&(document.body.style.cursor="")},Ie=({order:de,sortOrders:Ne})=>{if(de==="")return Ne[0];const he=Ne.indexOf(de||null);return Ne[he>Ne.length-2?0:he+1]},ue=(de,Ne,he)=>{var pe;de.stopPropagation();const ze=Ne.order===he?null:he||Ie(Ne),Fe=(pe=de.target)==null?void 0:pe.closest("th");if(Fe&&hasClass(Fe,"noclick")){removeClass(Fe,"noclick");return}if(!Ne.sortable)return;const xe=i.store.states;let _e=xe.sortProp.value,Dt;const $e=xe.sortingColumn.value;($e!==Ne||$e===Ne&&$e.order===null)&&($e&&($e.order=null),xe.sortingColumn.value=Ne,_e=Ne.property),ze?Dt=Ne.order=ze:Dt=Ne.order=null,xe.sortProp.value=_e,xe.sortOrder.value=Dt,g==null||g.store.commit("changeSortCondition")};return{handleHeaderClick:V,handleHeaderContextMenu:$,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:ue,handleFilterClick:k}}function useStyle$2(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getHeaderRowStyle:oe=>{const re=n==null?void 0:n.props.headerRowStyle;return typeof re=="function"?re.call(null,{rowIndex:oe}):re},getHeaderRowClass:oe=>{const re=[],Ce=n==null?void 0:n.props.headerRowClassName;return typeof Ce=="string"?re.push(Ce):typeof Ce=="function"&&re.push(Ce.call(null,{rowIndex:oe})),re.join(" ")},getHeaderCellStyle:(oe,re,Ce,ie)=>{var ae;let le=(ae=n==null?void 0:n.props.headerCellStyle)!=null?ae:{};typeof le=="function"&&(le=le.call(null,{rowIndex:oe,columnIndex:re,row:Ce,column:ie}));const Ie=getFixedColumnOffset(re,ie.fixed,i.store,Ce);return ensurePosition(Ie,"left"),ensurePosition(Ie,"right"),Object.assign({},le,Ie)},getHeaderCellClass:(oe,re,Ce,ie)=>{const ae=getFixedColumnsClass(r.b(),re,ie.fixed,i.store,Ce),le=[ie.id,ie.order,ie.headerAlign,ie.className,ie.labelClassName,...ae];ie.children||le.push("is-leaf"),ie.sortable&&le.push("is-sortable");const Ie=n==null?void 0:n.props.headerCellClassName;return typeof Ie=="string"?le.push(Ie):typeof Ie=="function"&&le.push(Ie.call(null,{rowIndex:oe,columnIndex:re,row:Ce,column:ie})),le.push(r.e("cell")),le.filter(ue=>!!ue).join(" ")}}}const getAllColumns=i=>{const n=[];return i.forEach(r=>{r.children?(n.push(r),n.push.apply(n,getAllColumns(r.children))):n.push(r)}),n},convertToRows=i=>{let n=1;const r=(V,$)=>{if($&&(V.level=$.level+1,n<V.level&&(n=V.level)),V.children){let oe=0;V.children.forEach(re=>{r(re,V),oe+=re.colSpan}),V.colSpan=oe}else V.colSpan=1};i.forEach(V=>{V.level=1,r(V,void 0)});const g=[];for(let V=0;V<n;V++)g.push([]);return getAllColumns(i).forEach(V=>{V.children?(V.rowSpan=1,V.children.forEach($=>$.isSubColumn=!0)):V.rowSpan=n-V.level+1,g[V.level-1].push(V)}),g};function useUtils$1(i){const n=vue.inject(TABLE_INJECTION_KEY),r=vue.computed(()=>convertToRows(i.store.states.originColumns.value));return{isGroup:vue.computed(()=>{const V=r.value.length>1;return V&&n&&(n.state.isGroup.value=!0),V}),toggleAllSelection:V=>{V.stopPropagation(),n==null||n.store.commit("toggleAllSelection")},columnRows:r}}var TableHeader=vue.defineComponent({name:"ElTableHeader",components:{ElCheckbox},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(i,{emit:n}){const r=vue.getCurrentInstance(),g=vue.inject(TABLE_INJECTION_KEY),k=useNamespace("table"),V=vue.ref({}),{onColumnsChange:$,onScrollableChange:oe}=useLayoutObserver(g);vue.onMounted(async()=>{await vue.nextTick(),await vue.nextTick();const{prop:_e,order:Dt}=i.defaultSort;g==null||g.store.commit("sort",{prop:_e,order:Dt,init:!0})});const{handleHeaderClick:re,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue}=useEvent(i,n),{getHeaderRowStyle:de,getHeaderRowClass:Ne,getHeaderCellStyle:he,getHeaderCellClass:pe}=useStyle$2(i),{isGroup:ze,toggleAllSelection:Fe,columnRows:xe}=useUtils$1(i);return r.state={onColumnsChange:$,onScrollableChange:oe},r.filterPanels=V,{ns:k,filterPanels:V,onColumnsChange:$,onScrollableChange:oe,columnRows:xe,getHeaderRowClass:Ne,getHeaderRowStyle:de,getHeaderCellClass:pe,getHeaderCellStyle:he,handleHeaderClick:re,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue,isGroup:ze,toggleAllSelection:Fe}},render(){const{ns:i,isGroup:n,columnRows:r,getHeaderCellStyle:g,getHeaderCellClass:k,getHeaderRowClass:V,getHeaderRowStyle:$,handleHeaderClick:oe,handleHeaderContextMenu:re,handleMouseDown:Ce,handleMouseMove:ie,handleSortClick:ae,handleMouseOut:le,store:Ie,$parent:ue}=this;let de=1;return vue.h("thead",{class:{[i.is("group")]:n}},r.map((Ne,he)=>vue.h("tr",{class:V(he),key:he,style:$(he)},Ne.map((pe,ze)=>(pe.rowSpan>de&&(de=pe.rowSpan),vue.h("th",{class:k(he,ze,Ne,pe),colspan:pe.colSpan,key:`${pe.id}-thead`,rowspan:pe.rowSpan,style:g(he,ze,Ne,pe),onClick:Fe=>oe(Fe,pe),onContextmenu:Fe=>re(Fe,pe),onMousedown:Fe=>Ce(Fe,pe),onMousemove:Fe=>ie(Fe,pe),onMouseout:le},[vue.h("div",{class:["cell",pe.filteredValue&&pe.filteredValue.length>0?"highlight":""]},[pe.renderHeader?pe.renderHeader({column:pe,$index:ze,store:Ie,_self:ue}):pe.label,pe.sortable&&vue.h("span",{onClick:Fe=>ae(Fe,pe),class:"caret-wrapper"},[vue.h("i",{onClick:Fe=>ae(Fe,pe,"ascending"),class:"sort-caret ascending"}),vue.h("i",{onClick:Fe=>ae(Fe,pe,"descending"),class:"sort-caret descending"})]),pe.filterable&&vue.h(FilterPanel,{store:Ie,placement:pe.filterPlacement||"bottom-start",column:pe,upDataColumn:(Fe,xe)=>{pe[Fe]=xe}})])]))))))}});function useEvents(i){const n=vue.inject(TABLE_INJECTION_KEY),r=vue.ref(""),g=vue.ref(vue.h("div")),{nextZIndex:k}=useZIndex(),V=(Ie,ue,de)=>{var Ne;const he=n,pe=getCell(Ie);let ze;const Fe=(Ne=he==null?void 0:he.vnode.el)==null?void 0:Ne.dataset.prefix;pe&&(ze=getColumnByCell({columns:i.store.states.columns.value},pe,Fe),ze&&(he==null||he.emit(`cell-${de}`,ue,ze,pe,Ie))),he==null||he.emit(`row-${de}`,ue,ze,Ie)},$=(Ie,ue)=>{V(Ie,ue,"dblclick")},oe=(Ie,ue)=>{i.store.commit("setCurrentRow",ue),V(Ie,ue,"click")},re=(Ie,ue)=>{V(Ie,ue,"contextmenu")},Ce=debounce(Ie=>{i.store.commit("setHoverRow",Ie)},30),ie=debounce(()=>{i.store.commit("setHoverRow",null)},30);return{handleDoubleClick:$,handleClick:oe,handleContextMenu:re,handleMouseEnter:Ce,handleMouseLeave:ie,handleCellMouseEnter:(Ie,ue,de)=>{var Ne;const he=n,pe=getCell(Ie),ze=(Ne=he==null?void 0:he.vnode.el)==null?void 0:Ne.dataset.prefix;if(pe){const $e=getColumnByCell({columns:i.store.states.columns.value},pe,ze),Ue=he.hoverState={cell:pe,column:$e,row:ue};he==null||he.emit("cell-mouse-enter",Ue.row,Ue.column,Ue.cell,Ie)}if(!de)return;const Fe=Ie.target.querySelector(".cell");if(!(hasClass(Fe,`${ze}-tooltip`)&&Fe.childNodes.length))return;const xe=document.createRange();xe.setStart(Fe,0),xe.setEnd(Fe,Fe.childNodes.length);const _e=Math.round(xe.getBoundingClientRect().width),Dt=(Number.parseInt(getStyle$1(Fe,"paddingLeft"),10)||0)+(Number.parseInt(getStyle$1(Fe,"paddingRight"),10)||0);(_e+Dt>Fe.offsetWidth||Fe.scrollWidth>Fe.offsetWidth)&&createTablePopper(n==null?void 0:n.refs.tableWrapper,pe,pe.innerText||pe.textContent,k,de)},handleCellMouseLeave:Ie=>{if(!getCell(Ie))return;const de=n==null?void 0:n.hoverState;n==null||n.emit("cell-mouse-leave",de==null?void 0:de.row,de==null?void 0:de.column,de==null?void 0:de.cell,Ie)},tooltipContent:r,tooltipTrigger:g}}function useStyles(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getRowStyle:(Ce,ie)=>{const ae=n==null?void 0:n.props.rowStyle;return typeof ae=="function"?ae.call(null,{row:Ce,rowIndex:ie}):ae||null},getRowClass:(Ce,ie)=>{const ae=[r.e("row")];n!=null&&n.props.highlightCurrentRow&&Ce===i.store.states.currentRow.value&&ae.push("current-row"),i.stripe&&ie%2===1&&ae.push(r.em("row","striped"));const le=n==null?void 0:n.props.rowClassName;return typeof le=="string"?ae.push(le):typeof le=="function"&&ae.push(le.call(null,{row:Ce,rowIndex:ie})),ae},getCellStyle:(Ce,ie,ae,le)=>{const Ie=n==null?void 0:n.props.cellStyle;let ue=Ie??{};typeof Ie=="function"&&(ue=Ie.call(null,{rowIndex:Ce,columnIndex:ie,row:ae,column:le}));const de=getFixedColumnOffset(ie,i==null?void 0:i.fixed,i.store);return ensurePosition(de,"left"),ensurePosition(de,"right"),Object.assign({},ue,de)},getCellClass:(Ce,ie,ae,le,Ie)=>{const ue=getFixedColumnsClass(r.b(),ie,i==null?void 0:i.fixed,i.store,void 0,Ie),de=[le.id,le.align,le.className,...ue],Ne=n==null?void 0:n.props.cellClassName;return typeof Ne=="string"?de.push(Ne):typeof Ne=="function"&&de.push(Ne.call(null,{rowIndex:Ce,columnIndex:ie,row:ae,column:le})),de.push(r.e("cell")),de.filter(he=>!!he).join(" ")},getSpan:(Ce,ie,ae,le)=>{let Ie=1,ue=1;const de=n==null?void 0:n.props.spanMethod;if(typeof de=="function"){const Ne=de({row:Ce,column:ie,rowIndex:ae,columnIndex:le});Array.isArray(Ne)?(Ie=Ne[0],ue=Ne[1]):typeof Ne=="object"&&(Ie=Ne.rowspan,ue=Ne.colspan)}return{rowspan:Ie,colspan:ue}},getColspanRealWidth:(Ce,ie,ae)=>{if(ie<1)return Ce[ae].realWidth;const le=Ce.map(({realWidth:Ie,width:ue})=>Ie||ue).slice(ae,ae+ie);return Number(le.reduce((Ie,ue)=>Number(Ie)+Number(ue),-1))}}}function useRender$1(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table"),{handleDoubleClick:g,handleClick:k,handleContextMenu:V,handleMouseEnter:$,handleMouseLeave:oe,handleCellMouseEnter:re,handleCellMouseLeave:Ce,tooltipContent:ie,tooltipTrigger:ae}=useEvents(i),{getRowStyle:le,getRowClass:Ie,getCellStyle:ue,getCellClass:de,getSpan:Ne,getColspanRealWidth:he}=useStyles(i),pe=vue.computed(()=>i.store.states.columns.value.findIndex(({type:Dt})=>Dt==="default")),ze=(Dt,$e)=>{const Ue=n.props.rowKey;return Ue?getRowIdentity(Dt,Ue):$e},Fe=(Dt,$e,Ue,Ve=!1)=>{const{tooltipEffect:Oe,tooltipOptions:At,store:qe}=i,{indent:Lt,columns:kt}=qe.states,jt=Ie(Dt,$e);let ti=!0;Ue&&(jt.push(r.em("row",`level-${Ue.level}`)),ti=Ue.display);const ei=ti?null:{display:"none"};return vue.h("tr",{style:[ei,le(Dt,$e)],class:jt,key:ze(Dt,$e),onDblclick:Pt=>g(Pt,Dt),onClick:Pt=>k(Pt,Dt),onContextmenu:Pt=>V(Pt,Dt),onMouseenter:()=>$($e),onMouseleave:oe},kt.value.map((Pt,ni)=>{const{rowspan:gi,colspan:di}=Ne(Dt,Pt,$e,ni);if(!gi||!di)return null;const li={...Pt};li.realWidth=he(kt.value,di,ni);const ai={store:i.store,_self:i.context||n,column:li,row:Dt,$index:$e,cellIndex:ni,expanded:Ve};ni===pe.value&&Ue&&(ai.treeNode={indent:Ue.level*Lt.value,level:Ue.level},typeof Ue.expanded=="boolean"&&(ai.treeNode.expanded=Ue.expanded,"loading"in Ue&&(ai.treeNode.loading=Ue.loading),"noLazyChildren"in Ue&&(ai.treeNode.noLazyChildren=Ue.noLazyChildren)));const ci=`${$e},${ni}`,pi=li.columnKey||li.rawColumnKey||"",yi=xe(ni,Pt,ai),Ai=Pt.showOverflowTooltip&&merge$2({effect:Oe},At,Pt.showOverflowTooltip);return vue.h("td",{style:ue($e,ni,Dt,Pt),class:de($e,ni,Dt,Pt,di-1),key:`${pi}${ci}`,rowspan:gi,colspan:di,onMouseenter:hi=>re(hi,Dt,Ai),onMouseleave:Ce},[yi])}))},xe=(Dt,$e,Ue)=>$e.renderCell(Ue);return{wrappedRowRender:(Dt,$e)=>{const Ue=i.store,{isRowExpanded:Ve,assertRowKey:Oe}=Ue,{treeData:At,lazyTreeNodeMap:qe,childrenColumnName:Lt,rowKey:kt}=Ue.states,jt=Ue.states.columns.value;if(jt.some(({type:ei})=>ei==="expand")){const ei=Ve(Dt),Pt=Fe(Dt,$e,void 0,ei),ni=n.renderExpanded;return ei?ni?[[Pt,vue.h("tr",{key:`expanded-row__${Pt.key}`},[vue.h("td",{colspan:jt.length,class:`${r.e("cell")} ${r.e("expanded-cell")}`},[ni({row:Dt,$index:$e,store:Ue,expanded:ei})])])]]:(console.error("[Element Error]renderExpanded is required."),Pt):[[Pt]]}else if(Object.keys(At.value).length){Oe();const ei=getRowIdentity(Dt,kt.value);let Pt=At.value[ei],ni=null;Pt&&(ni={expanded:Pt.expanded,level:Pt.level,display:!0},typeof Pt.lazy=="boolean"&&(typeof Pt.loaded=="boolean"&&Pt.loaded&&(ni.noLazyChildren=!(Pt.children&&Pt.children.length)),ni.loading=Pt.loading));const gi=[Fe(Dt,$e,ni)];if(Pt){let di=0;const li=(ci,pi)=>{ci&&ci.length&&pi&&ci.forEach(yi=>{const Ai={display:pi.display&&pi.expanded,level:pi.level+1,expanded:!1,noLazyChildren:!1,loading:!1},hi=getRowIdentity(yi,kt.value);if(hi==null)throw new Error("For nested data item, row-key is required.");if(Pt={...At.value[hi]},Pt&&(Ai.expanded=Pt.expanded,Pt.level=Pt.level||Ai.level,Pt.display=!!(Pt.expanded&&Ai.display),typeof Pt.lazy=="boolean"&&(typeof Pt.loaded=="boolean"&&Pt.loaded&&(Ai.noLazyChildren=!(Pt.children&&Pt.children.length)),Ai.loading=Pt.loading)),di++,gi.push(Fe(yi,$e+di,Ai)),Pt){const wi=qe.value[hi]||yi[Lt.value];li(wi,Pt)}})};Pt.display=!0;const ai=qe.value[ei]||Dt[Lt.value];li(ai,Pt)}return gi}else return Fe(Dt,$e,void 0)},tooltipContent:ie,tooltipTrigger:ae}}const defaultProps$2={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean};var TableBody=vue.defineComponent({name:"ElTableBody",props:defaultProps$2,setup(i){const n=vue.getCurrentInstance(),r=vue.inject(TABLE_INJECTION_KEY),g=useNamespace("table"),{wrappedRowRender:k,tooltipContent:V,tooltipTrigger:$}=useRender$1(i),{onColumnsChange:oe,onScrollableChange:re}=useLayoutObserver(r);return vue.watch(i.store.states.hoverRow,(Ce,ie)=>{if(!i.store.states.isComplex.value||!isClient)return;let ae=window.requestAnimationFrame;ae||(ae=le=>window.setTimeout(le,16)),ae(()=>{const le=n==null?void 0:n.vnode.el,Ie=Array.from((le==null?void 0:le.children)||[]).filter(Ne=>Ne==null?void 0:Ne.classList.contains(`${g.e("row")}`)),ue=Ie[ie],de=Ie[Ce];ue&&removeClass(ue,"hover-row"),de&&addClass(de,"hover-row")})}),vue.onUnmounted(()=>{var Ce;(Ce=removePopper)==null||Ce()}),{ns:g,onColumnsChange:oe,onScrollableChange:re,wrappedRowRender:k,tooltipContent:V,tooltipTrigger:$}},render(){const{wrappedRowRender:i,store:n}=this,r=n.states.data.value||[];return vue.h("tbody",{},[r.reduce((g,k)=>g.concat(i(k,g.length)),[])])}});function hColgroup(i){const n=i.tableLayout==="auto";let r=i.columns||[];n&&r.every(k=>k.width===void 0)&&(r=[]);const g=k=>{const V={key:`${i.tableLayout}_${k.id}`,style:{},name:void 0};return n?V.style={width:`${k.width}px`}:V.name=k.id,V};return vue.h("colgroup",{},r.map(k=>vue.h("col",g(k))))}hColgroup.props=["columns","tableLayout"];function useMapState(){const i=vue.inject(TABLE_INJECTION_KEY),n=i==null?void 0:i.store,r=vue.computed(()=>n.states.fixedLeafColumnsLength.value),g=vue.computed(()=>n.states.rightFixedColumns.value.length),k=vue.computed(()=>n.states.columns.value.length),V=vue.computed(()=>n.states.fixedColumns.value.length),$=vue.computed(()=>n.states.rightFixedColumns.value.length);return{leftFixedLeafCount:r,rightFixedLeafCount:g,columnsCount:k,leftFixedCount:V,rightFixedCount:$,columns:n.states.columns}}function useStyle$1(i){const{columns:n}=useMapState(),r=useNamespace("table");return{getCellClasses:(V,$)=>{const oe=V[$],re=[r.e("cell"),oe.id,oe.align,oe.labelClassName,...getFixedColumnsClass(r.b(),$,oe.fixed,i.store)];return oe.className&&re.push(oe.className),oe.children||re.push(r.is("leaf")),re},getCellStyles:(V,$)=>{const oe=getFixedColumnOffset($,V.fixed,i.store);return ensurePosition(oe,"left"),ensurePosition(oe,"right"),oe},columns:n}}var TableFooter=vue.defineComponent({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(i){const{getCellClasses:n,getCellStyles:r,columns:g}=useStyle$1(i);return{ns:useNamespace("table"),getCellClasses:n,getCellStyles:r,columns:g}},render(){const{columns:i,getCellStyles:n,getCellClasses:r,summaryMethod:g,sumText:k,ns:V}=this,$=this.store.states.data.value;let oe=[];return g?oe=g({columns:i,data:$}):i.forEach((re,Ce)=>{if(Ce===0){oe[Ce]=k;return}const ie=$.map(ue=>Number(ue[re.property])),ae=[];let le=!0;ie.forEach(ue=>{if(!Number.isNaN(+ue)){le=!1;const de=`${ue}`.split(".")[1];ae.push(de?de.length:0)}});const Ie=Math.max.apply(null,ae);le?oe[Ce]="":oe[Ce]=ie.reduce((ue,de)=>{const Ne=Number(de);return Number.isNaN(+Ne)?ue:Number.parseFloat((ue+de).toFixed(Math.min(Ie,20)))},0)}),vue.h("table",{class:V.e("footer"),cellspacing:"0",cellpadding:"0",border:"0"},[hColgroup({columns:i}),vue.h("tbody",[vue.h("tr",{},[...i.map((re,Ce)=>vue.h("td",{key:Ce,colspan:re.colSpan,rowspan:re.rowSpan,class:r(i,Ce),style:n(re,Ce)},[vue.h("div",{class:["cell",re.labelClassName]},[oe[Ce]])]))])])])}});function useUtils(i){return{setCurrentRow:ie=>{i.commit("setCurrentRow",ie)},getSelectionRows:()=>i.getSelectionRows(),toggleRowSelection:(ie,ae)=>{i.toggleRowSelection(ie,ae,!1),i.updateAllSelected()},clearSelection:()=>{i.clearSelection()},clearFilter:ie=>{i.clearFilter(ie)},toggleAllSelection:()=>{i.commit("toggleAllSelection")},toggleRowExpansion:(ie,ae)=>{i.toggleRowExpansionAdapter(ie,ae)},clearSort:()=>{i.clearSort()},sort:(ie,ae)=>{i.commit("sort",{prop:ie,order:ae})}}}function useStyle(i,n,r,g){const k=vue.ref(!1),V=vue.ref(null),$=vue.ref(!1),oe=Pt=>{$.value=Pt},re=vue.ref({width:null,height:null,headerHeight:null}),Ce=vue.ref(!1),ie={display:"inline-block",verticalAlign:"middle"},ae=vue.ref(),le=vue.ref(0),Ie=vue.ref(0),ue=vue.ref(0),de=vue.ref(0),Ne=vue.ref(0);vue.watchEffect(()=>{n.setHeight(i.height)}),vue.watchEffect(()=>{n.setMaxHeight(i.maxHeight)}),vue.watch(()=>[i.currentRowKey,r.states.rowKey],([Pt,ni])=>{!vue.unref(ni)||!vue.unref(Pt)||r.setCurrentRowKey(`${Pt}`)},{immediate:!0}),vue.watch(()=>i.data,Pt=>{g.store.commit("setData",Pt)},{immediate:!0,deep:!0}),vue.watchEffect(()=>{i.expandRowKeys&&r.setExpandRowKeysAdapter(i.expandRowKeys)});const he=()=>{g.store.commit("setHoverRow",null),g.hoverState&&(g.hoverState=null)},pe=(Pt,ni)=>{const{pixelX:gi,pixelY:di}=ni;Math.abs(gi)>=Math.abs(di)&&(g.refs.bodyWrapper.scrollLeft+=ni.pixelX/5)},ze=vue.computed(()=>i.height||i.maxHeight||r.states.fixedColumns.value.length>0||r.states.rightFixedColumns.value.length>0),Fe=vue.computed(()=>({width:n.bodyWidth.value?`${n.bodyWidth.value}px`:""})),xe=()=>{ze.value&&n.updateElsHeight(),n.updateColumnsWidth(),requestAnimationFrame(Ue)};vue.onMounted(async()=>{await vue.nextTick(),r.updateColumns(),Ve(),requestAnimationFrame(xe);const Pt=g.vnode.el,ni=g.refs.headerWrapper;i.flexible&&Pt&&Pt.parentElement&&(Pt.parentElement.style.minWidth="0"),re.value={width:ae.value=Pt.offsetWidth,height:Pt.offsetHeight,headerHeight:i.showHeader&&ni?ni.offsetHeight:null},r.states.columns.value.forEach(gi=>{gi.filteredValue&&gi.filteredValue.length&&g.store.commit("filterChange",{column:gi,values:gi.filteredValue,silent:!0})}),g.$ready=!0});const _e=(Pt,ni)=>{if(!Pt)return;const gi=Array.from(Pt.classList).filter(di=>!di.startsWith("is-scrolling-"));gi.push(n.scrollX.value?ni:"is-scrolling-none"),Pt.className=gi.join(" ")},Dt=Pt=>{const{tableWrapper:ni}=g.refs;_e(ni,Pt)},$e=Pt=>{const{tableWrapper:ni}=g.refs;return!!(ni&&ni.classList.contains(Pt))},Ue=function(){if(!g.refs.scrollBarRef)return;if(!n.scrollX.value){const pi="is-scrolling-none";$e(pi)||Dt(pi);return}const Pt=g.refs.scrollBarRef.wrapRef;if(!Pt)return;const{scrollLeft:ni,offsetWidth:gi,scrollWidth:di}=Pt,{headerWrapper:li,footerWrapper:ai}=g.refs;li&&(li.scrollLeft=ni),ai&&(ai.scrollLeft=ni);const ci=di-gi-1;ni>=ci?Dt("is-scrolling-right"):Dt(ni===0?"is-scrolling-left":"is-scrolling-middle")},Ve=()=>{g.refs.scrollBarRef&&(g.refs.scrollBarRef.wrapRef&&useEventListener(g.refs.scrollBarRef.wrapRef,"scroll",Ue,{passive:!0}),i.fit?useResizeObserver(g.vnode.el,Oe):useEventListener(window,"resize",Oe),useResizeObserver(g.refs.bodyWrapper,()=>{var Pt,ni;Oe(),(ni=(Pt=g.refs)==null?void 0:Pt.scrollBarRef)==null||ni.update()}))},Oe=()=>{var Pt,ni,gi,di;const li=g.vnode.el;if(!g.$ready||!li)return;let ai=!1;const{width:ci,height:pi,headerHeight:yi}=re.value,Ai=ae.value=li.offsetWidth;ci!==Ai&&(ai=!0);const hi=li.offsetHeight;(i.height||ze.value)&&pi!==hi&&(ai=!0);const wi=i.tableLayout==="fixed"?g.refs.headerWrapper:(Pt=g.refs.tableHeaderRef)==null?void 0:Pt.$el;i.showHeader&&(wi==null?void 0:wi.offsetHeight)!==yi&&(ai=!0),le.value=((ni=g.refs.tableWrapper)==null?void 0:ni.scrollHeight)||0,ue.value=(wi==null?void 0:wi.scrollHeight)||0,de.value=((gi=g.refs.footerWrapper)==null?void 0:gi.offsetHeight)||0,Ne.value=((di=g.refs.appendWrapper)==null?void 0:di.offsetHeight)||0,Ie.value=le.value-ue.value-de.value-Ne.value,ai&&(re.value={width:Ai,height:hi,headerHeight:i.showHeader&&(wi==null?void 0:wi.offsetHeight)||0},xe())},At=useFormSize(),qe=vue.computed(()=>{const{bodyWidth:Pt,scrollY:ni,gutterWidth:gi}=n;return Pt.value?`${Pt.value-(ni.value?gi:0)}px`:""}),Lt=vue.computed(()=>i.maxHeight?"fixed":i.tableLayout),kt=vue.computed(()=>{if(i.data&&i.data.length)return null;let Pt="100%";i.height&&Ie.value&&(Pt=`${Ie.value}px`);const ni=ae.value;return{width:ni?`${ni}px`:"",height:Pt}}),jt=vue.computed(()=>i.height?{height:Number.isNaN(Number(i.height))?i.height:`${i.height}px`}:i.maxHeight?{maxHeight:Number.isNaN(Number(i.maxHeight))?i.maxHeight:`${i.maxHeight}px`}:{}),ti=vue.computed(()=>i.height?{height:"100%"}:i.maxHeight?Number.isNaN(Number(i.maxHeight))?{maxHeight:`calc(${i.maxHeight} - ${ue.value+de.value}px)`}:{maxHeight:`${i.maxHeight-ue.value-de.value}px`}:{});return{isHidden:k,renderExpanded:V,setDragVisible:oe,isGroup:Ce,handleMouseLeave:he,handleHeaderFooterMousewheel:pe,tableSize:At,emptyBlockStyle:kt,handleFixedMousewheel:(Pt,ni)=>{const gi=g.refs.bodyWrapper;if(Math.abs(ni.spinY)>0){const di=gi.scrollTop;ni.pixelY<0&&di!==0&&Pt.preventDefault(),ni.pixelY>0&&gi.scrollHeight-gi.clientHeight>di&&Pt.preventDefault(),gi.scrollTop+=Math.ceil(ni.pixelY/5)}else gi.scrollLeft+=Math.ceil(ni.pixelX/5)},resizeProxyVisible:$,bodyWidth:qe,resizeState:re,doLayout:xe,tableBodyStyles:Fe,tableLayout:Lt,scrollbarViewStyle:ie,tableInnerStyle:jt,scrollbarStyle:ti}}function useKeyRender(i){const n=vue.ref(),r=()=>{const k=i.vnode.el.querySelector(".hidden-columns"),V={childList:!0,subtree:!0},$=i.store.states.updateOrderFns;n.value=new MutationObserver(()=>{$.forEach(oe=>oe())}),n.value.observe(k,V)};vue.onMounted(()=>{r()}),vue.onUnmounted(()=>{var g;(g=n.value)==null||g.disconnect()})}var defaultProps$1={data:{type:Array,default:()=>[]},size:useSizeProp,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:{type:Boolean,default:!1},flexible:Boolean,showOverflowTooltip:[Boolean,Object]};const useScrollbar=()=>{const i=vue.ref(),n=(V,$)=>{const oe=i.value;oe&&oe.scrollTo(V,$)},r=(V,$)=>{const oe=i.value;oe&&isNumber$1($)&&["Top","Left"].includes(V)&&oe[`setScroll${V}`]($)};return{scrollBarRef:i,scrollTo:n,setScrollTop:V=>r("Top",V),setScrollLeft:V=>r("Left",V)}};let tableIdSeed=1;const _sfc_main$C=vue.defineComponent({name:"ElTable",directives:{Mousewheel},components:{TableHeader,TableBody,TableFooter,ElScrollbar,hColgroup},props:defaultProps$1,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(i){const{t:n}=useLocale(),r=useNamespace("table"),g=vue.getCurrentInstance();vue.provide(TABLE_INJECTION_KEY,g);const k=createStore(g,i);g.store=k;const V=new TableLayout({store:g.store,table:g,fit:i.fit,showHeader:i.showHeader});g.layout=V;const $=vue.computed(()=>(k.states.data.value||[]).length===0),{setCurrentRow:oe,getSelectionRows:re,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,sort:de}=useUtils(k),{isHidden:Ne,renderExpanded:he,setDragVisible:pe,isGroup:ze,handleMouseLeave:Fe,handleHeaderFooterMousewheel:xe,tableSize:_e,emptyBlockStyle:Dt,handleFixedMousewheel:$e,resizeProxyVisible:Ue,bodyWidth:Ve,resizeState:Oe,doLayout:At,tableBodyStyles:qe,tableLayout:Lt,scrollbarViewStyle:kt,tableInnerStyle:jt,scrollbarStyle:ti}=useStyle(i,V,k,g),{scrollBarRef:ei,scrollTo:Pt,setScrollLeft:ni,setScrollTop:gi}=useScrollbar(),di=debounce(At,50),li=`${r.namespace.value}-table_${tableIdSeed++}`;g.tableId=li,g.state={isGroup:ze,resizeState:Oe,doLayout:At,debouncedUpdateLayout:di};const ai=vue.computed(()=>i.sumText||n("el.table.sumText")),ci=vue.computed(()=>i.emptyText||n("el.table.emptyText"));return useKeyRender(g),{ns:r,layout:V,store:k,handleHeaderFooterMousewheel:xe,handleMouseLeave:Fe,tableId:li,tableSize:_e,isHidden:Ne,isEmpty:$,renderExpanded:he,resizeProxyVisible:Ue,resizeState:Oe,isGroup:ze,bodyWidth:Ve,tableBodyStyles:qe,emptyBlockStyle:Dt,debouncedUpdateLayout:di,handleFixedMousewheel:$e,setCurrentRow:oe,getSelectionRows:re,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,doLayout:At,sort:de,t:n,setDragVisible:pe,context:g,computedSumText:ai,computedEmptyText:ci,tableLayout:Lt,scrollbarViewStyle:kt,tableInnerStyle:jt,scrollbarStyle:ti,scrollBarRef:ei,scrollTo:Pt,setScrollLeft:ni,setScrollTop:gi}}}),_hoisted_1$r=["data-prefix"],_hoisted_2$l={ref:"hiddenColumns",class:"hidden-columns"};function _sfc_render$4(i,n,r,g,k,V){const $=vue.resolveComponent("hColgroup"),oe=vue.resolveComponent("table-header"),re=vue.resolveComponent("table-body"),Ce=vue.resolveComponent("el-scrollbar"),ie=vue.resolveComponent("table-footer"),ae=vue.resolveDirective("mousewheel");return vue.openBlock(),vue.createElementBlock("div",{ref:"tableWrapper",class:vue.normalizeClass([{[i.ns.m("fit")]:i.fit,[i.ns.m("striped")]:i.stripe,[i.ns.m("border")]:i.border||i.isGroup,[i.ns.m("hidden")]:i.isHidden,[i.ns.m("group")]:i.isGroup,[i.ns.m("fluid-height")]:i.maxHeight,[i.ns.m("scrollable-x")]:i.layout.scrollX.value,[i.ns.m("scrollable-y")]:i.layout.scrollY.value,[i.ns.m("enable-row-hover")]:!i.store.states.isComplex.value,[i.ns.m("enable-row-transition")]:(i.store.states.data.value||[]).length!==0&&(i.store.states.data.value||[]).length<100,"has-footer":i.showSummary},i.ns.m(i.tableSize),i.className,i.ns.b(),i.ns.m(`layout-${i.tableLayout}`)]),style:vue.normalizeStyle(i.style),"data-prefix":i.ns.namespace.value,onMouseleave:n[0]||(n[0]=(...le)=>i.handleMouseLeave&&i.handleMouseLeave(...le))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("inner-wrapper")),style:vue.normalizeStyle(i.tableInnerStyle)},[vue.createElementVNode("div",_hoisted_2$l,[vue.renderSlot(i.$slots,"default")],512),i.showHeader&&i.tableLayout==="fixed"?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"headerWrapper",class:vue.normalizeClass(i.ns.e("header-wrapper"))},[vue.createElementVNode("table",{ref:"tableHeader",class:vue.normalizeClass(i.ns.e("header")),style:vue.normalizeStyle(i.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[vue.createVNode($,{columns:i.store.states.columns.value,"table-layout":i.tableLayout},null,8,["columns","table-layout"]),vue.createVNode(oe,{ref:"tableHeaderRef",border:i.border,"default-sort":i.defaultSort,store:i.store,onSetDragVisible:i.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[ae,i.handleHeaderFooterMousewheel]]):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{ref:"bodyWrapper",class:vue.normalizeClass(i.ns.e("body-wrapper"))},[vue.createVNode(Ce,{ref:"scrollBarRef","view-style":i.scrollbarViewStyle,"wrap-style":i.scrollbarStyle,always:i.scrollbarAlwaysOn},{default:vue.withCtx(()=>[vue.createElementVNode("table",{ref:"tableBody",class:vue.normalizeClass(i.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:vue.normalizeStyle({width:i.bodyWidth,tableLayout:i.tableLayout})},[vue.createVNode($,{columns:i.store.states.columns.value,"table-layout":i.tableLayout},null,8,["columns","table-layout"]),i.showHeader&&i.tableLayout==="auto"?(vue.openBlock(),vue.createBlock(oe,{key:0,ref:"tableHeaderRef",border:i.border,"default-sort":i.defaultSort,store:i.store,onSetDragVisible:i.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])):vue.createCommentVNode("v-if",!0),vue.createVNode(re,{context:i.context,highlight:i.highlightCurrentRow,"row-class-name":i.rowClassName,"tooltip-effect":i.tooltipEffect,"tooltip-options":i.tooltipOptions,"row-style":i.rowStyle,store:i.store,stripe:i.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"])],6),i.isEmpty?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"emptyBlock",style:vue.normalizeStyle(i.emptyBlockStyle),class:vue.normalizeClass(i.ns.e("empty-block"))},[vue.createElementVNode("span",{class:vue.normalizeClass(i.ns.e("empty-text"))},[vue.renderSlot(i.$slots,"empty",{},()=>[vue.createTextVNode(vue.toDisplayString(i.computedEmptyText),1)])],2)],6)):vue.createCommentVNode("v-if",!0),i.$slots.append?(vue.openBlock(),vue.createElementBlock("div",{key:1,ref:"appendWrapper",class:vue.normalizeClass(i.ns.e("append-wrapper"))},[vue.renderSlot(i.$slots,"append")],2)):vue.createCommentVNode("v-if",!0)]),_:3},8,["view-style","wrap-style","always"])],2),i.showSummary?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:1,ref:"footerWrapper",class:vue.normalizeClass(i.ns.e("footer-wrapper"))},[vue.createVNode(ie,{border:i.border,"default-sort":i.defaultSort,store:i.store,style:vue.normalizeStyle(i.tableBodyStyles),"sum-text":i.computedSumText,"summary-method":i.summaryMethod},null,8,["border","default-sort","store","style","sum-text","summary-method"])],2)),[[vue.vShow,!i.isEmpty],[ae,i.handleHeaderFooterMousewheel]]):vue.createCommentVNode("v-if",!0),i.border||i.isGroup?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(i.ns.e("border-left-patch"))},null,2)):vue.createCommentVNode("v-if",!0)],6),vue.withDirectives(vue.createElementVNode("div",{ref:"resizeProxy",class:vue.normalizeClass(i.ns.e("column-resize-proxy"))},null,2),[[vue.vShow,i.resizeProxyVisible]])],46,_hoisted_1$r)}var Table=_export_sfc$1(_sfc_main$C,[["render",_sfc_render$4],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/table.vue"]]);const defaultClassNames={selection:"table-column--selection",expand:"table__expand-column"},cellStarts={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},getDefaultClassName=i=>defaultClassNames[i]||"",cellForced={selection:{renderHeader({store:i}){function n(){return i.states.data.value&&i.states.data.value.length===0}return vue.h(ElCheckbox,{disabled:n(),size:i.states.tableSize.value,indeterminate:i.states.selection.value.length>0&&!i.states.isAllSelected.value,"onUpdate:modelValue":i.toggleAllSelection,modelValue:i.states.isAllSelected.value})},renderCell({row:i,column:n,store:r,$index:g}){return vue.h(ElCheckbox,{disabled:n.selectable?!n.selectable.call(null,i,g):!1,size:r.states.tableSize.value,onChange:()=>{r.commit("rowSelectedChanged",i)},onClick:k=>k.stopPropagation(),modelValue:r.isSelected(i)})},sortable:!1,resizable:!1},index:{renderHeader({column:i}){return i.label||"#"},renderCell({column:i,$index:n}){let r=n+1;const g=i.index;return typeof g=="number"?r=n+g:typeof g=="function"&&(r=g(n)),vue.h("div",{},[r])},sortable:!1},expand:{renderHeader({column:i}){return i.label||""},renderCell({row:i,store:n,expanded:r}){const{ns:g}=n,k=[g.e("expand-icon")];r&&k.push(g.em("expand-icon","expanded"));const V=function($){$.stopPropagation(),n.toggleRowExpansion(i)};return vue.h("div",{class:k,onClick:V},{default:()=>[vue.h(ElIcon,null,{default:()=>[vue.h(arrow_right_default)]})]})},sortable:!1,resizable:!1}};function defaultRenderCell({row:i,column:n,$index:r}){var g;const k=n.property,V=k&&getProp(i,k).value;return n&&n.formatter?n.formatter(i,n,V,r):((g=V==null?void 0:V.toString)==null?void 0:g.call(V))||""}function treeCellPrefix({row:i,treeNode:n,store:r},g=!1){const{ns:k}=r;if(!n)return g?[vue.h("span",{class:k.e("placeholder")})]:null;const V=[],$=function(oe){oe.stopPropagation(),!n.loading&&r.loadOrToggle(i)};if(n.indent&&V.push(vue.h("span",{class:k.e("indent"),style:{"padding-left":`${n.indent}px`}})),typeof n.expanded=="boolean"&&!n.noLazyChildren){const oe=[k.e("expand-icon"),n.expanded?k.em("expand-icon","expanded"):""];let re=arrow_right_default;n.loading&&(re=loading_default),V.push(vue.h("div",{class:oe,onClick:$},{default:()=>[vue.h(ElIcon,{class:{[k.is("loading")]:n.loading}},{default:()=>[vue.h(re)]})]}))}else V.push(vue.h("span",{class:k.e("placeholder")}));return V}function getAllAliases(i,n){return i.reduce((r,g)=>(r[g]=g,r),n)}function useWatcher(i,n){const r=vue.getCurrentInstance();return{registerComplexWatchers:()=>{const V=["fixed"],$={realWidth:"width",realMinWidth:"minWidth"},oe=getAllAliases(V,$);Object.keys(oe).forEach(re=>{const Ce=$[re];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{let ae=ie;Ce==="width"&&re==="realWidth"&&(ae=parseWidth(ie)),Ce==="minWidth"&&re==="realMinWidth"&&(ae=parseMinWidth(ie)),r.columnConfig.value[Ce]=ae,r.columnConfig.value[re]=ae;const le=Ce==="fixed";i.value.store.scheduleLayout(le)})})},registerNormalWatchers:()=>{const V=["label","filters","filterMultiple","sortable","index","formatter","className","labelClassName","showOverflowTooltip"],$={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},oe=getAllAliases(V,$);Object.keys(oe).forEach(re=>{const Ce=$[re];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{r.columnConfig.value[re]=ie})})}}}function useRender(i,n,r){const g=vue.getCurrentInstance(),k=vue.ref(""),V=vue.ref(!1),$=vue.ref(),oe=vue.ref(),re=useNamespace("table");vue.watchEffect(()=>{$.value=i.align?`is-${i.align}`:null,$.value}),vue.watchEffect(()=>{oe.value=i.headerAlign?`is-${i.headerAlign}`:$.value,oe.value});const Ce=vue.computed(()=>{let Fe=g.vnode.vParent||g.parent;for(;Fe&&!Fe.tableId&&!Fe.columnId;)Fe=Fe.vnode.vParent||Fe.parent;return Fe}),ie=vue.computed(()=>{const{store:Fe}=g.parent;if(!Fe)return!1;const{treeData:xe}=Fe.states,_e=xe.value;return _e&&Object.keys(_e).length>0}),ae=vue.ref(parseWidth(i.width)),le=vue.ref(parseMinWidth(i.minWidth)),Ie=Fe=>(ae.value&&(Fe.width=ae.value),le.value&&(Fe.minWidth=le.value),!ae.value&&le.value&&(Fe.width=void 0),Fe.minWidth||(Fe.minWidth=80),Fe.realWidth=Number(Fe.width===void 0?Fe.minWidth:Fe.width),Fe),ue=Fe=>{const xe=Fe.type,_e=cellForced[xe]||{};Object.keys(_e).forEach($e=>{const Ue=_e[$e];$e!=="className"&&Ue!==void 0&&(Fe[$e]=Ue)});const Dt=getDefaultClassName(xe);if(Dt){const $e=`${vue.unref(re.namespace)}-${Dt}`;Fe.className=Fe.className?`${Fe.className} ${$e}`:$e}return Fe},de=Fe=>{Array.isArray(Fe)?Fe.forEach(_e=>xe(_e)):xe(Fe);function xe(_e){var Dt;((Dt=_e==null?void 0:_e.type)==null?void 0:Dt.name)==="ElTableColumn"&&(_e.vParent=g)}};return{columnId:k,realAlign:$,isSubColumn:V,realHeaderAlign:oe,columnOrTableParent:Ce,setColumnWidth:Ie,setColumnForcedProps:ue,setColumnRenders:Fe=>{i.renderHeader?debugWarn("TableColumn","Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."):Fe.type!=="selection"&&(Fe.renderHeader=_e=>{g.columnConfig.value.label;const Dt=n.header;return Dt?Dt(_e):Fe.label});let xe=Fe.renderCell;return Fe.type==="expand"?(Fe.renderCell=_e=>vue.h("div",{class:"cell"},[xe(_e)]),r.value.renderExpanded=_e=>n.default?n.default(_e):n.default):(xe=xe||defaultRenderCell,Fe.renderCell=_e=>{let Dt=null;if(n.default){const qe=n.default(_e);Dt=qe.some(Lt=>Lt.type!==vue.Comment)?qe:xe(_e)}else Dt=xe(_e);const{columns:$e}=r.value.store.states,Ue=$e.value.findIndex(qe=>qe.type==="default"),Ve=ie.value&&_e.cellIndex===Ue,Oe=treeCellPrefix(_e,Ve),At={class:"cell",style:{}};return Fe.showOverflowTooltip&&(At.class=`${At.class} ${vue.unref(re.namespace)}-tooltip`,At.style={width:`${(_e.column.realWidth||Number(_e.column.width))-1}px`}),de(Dt),vue.h("div",At,[Oe,Dt])}),Fe},getPropsData:(...Fe)=>Fe.reduce((xe,_e)=>(Array.isArray(_e)&&_e.forEach(Dt=>{xe[Dt]=i[Dt]}),xe),{}),getColumnElIndex:(Fe,xe)=>Array.prototype.indexOf.call(Fe,xe),updateColumnOrder:()=>{r.value.store.commit("updateColumnOrder",g.columnConfig.value)}}}var defaultProps={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:i=>i.every(n=>["ascending","descending",null].includes(n))}};let columnIdSeed=1;var ElTableColumn$1=vue.defineComponent({name:"ElTableColumn",components:{ElCheckbox},props:defaultProps,setup(i,{slots:n}){const r=vue.getCurrentInstance(),g=vue.ref({}),k=vue.computed(()=>{let ze=r.parent;for(;ze&&!ze.tableId;)ze=ze.parent;return ze}),{registerNormalWatchers:V,registerComplexWatchers:$}=useWatcher(k,i),{columnId:oe,isSubColumn:re,realHeaderAlign:Ce,columnOrTableParent:ie,setColumnWidth:ae,setColumnForcedProps:le,setColumnRenders:Ie,getPropsData:ue,getColumnElIndex:de,realAlign:Ne,updateColumnOrder:he}=useRender(i,n,k),pe=ie.value;oe.value=`${pe.tableId||pe.columnId}_column_${columnIdSeed++}`,vue.onBeforeMount(()=>{re.value=k.value!==pe;const ze=i.type||"default",Fe=i.sortable===""?!0:i.sortable,xe=isUndefined(i.showOverflowTooltip)?pe.props.showOverflowTooltip:i.showOverflowTooltip,_e={...cellStarts[ze],id:oe.value,type:ze,property:i.prop||i.property,align:Ne,headerAlign:Ce,showOverflowTooltip:xe,filterable:i.filters||i.filterMethod,filteredValue:[],filterPlacement:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:Fe,index:i.index,rawColumnKey:r.vnode.key};let Oe=ue(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement"]);Oe=mergeOptions(_e,Oe),Oe=compose(Ie,ae,le)(Oe),g.value=Oe,V(),$()}),vue.onMounted(()=>{var ze;const Fe=ie.value,xe=re.value?Fe.vnode.el.children:(ze=Fe.refs.hiddenColumns)==null?void 0:ze.children,_e=()=>de(xe||[],r.vnode.el);g.value.getColumnIndex=_e,_e()>-1&&k.value.store.commit("insertColumn",g.value,re.value?Fe.columnConfig.value:null,he)}),vue.onBeforeUnmount(()=>{k.value.store.commit("removeColumn",g.value,re.value?pe.columnConfig.value:null,he)}),r.columnId=oe.value,r.columnConfig=g},render(){var i,n,r;try{const g=(n=(i=this.$slots).default)==null?void 0:n.call(i,{row:{},column:{},$index:-1}),k=[];if(Array.isArray(g))for(const $ of g)((r=$.type)==null?void 0:r.name)==="ElTableColumn"||$.shapeFlag&2?k.push($):$.type===vue.Fragment&&Array.isArray($.children)&&$.children.forEach(oe=>{(oe==null?void 0:oe.patchFlag)!==1024&&!isString$1(oe==null?void 0:oe.children)&&k.push(oe)});return vue.h("div",k)}catch{return vue.h("div",[])}}});const ElTable=withInstall(Table,{TableColumn:ElTableColumn$1}),ElTableColumn=withNoopInstall(ElTableColumn$1),tabsRootContextKey=Symbol("tabsRootContextKey"),tabBarProps=buildProps({tabs:{type:definePropType(Array),default:()=>mutable([])}}),COMPONENT_NAME$3="ElTabBar",__default__$6=vue.defineComponent({name:COMPONENT_NAME$3}),_sfc_main$B=vue.defineComponent({...__default__$6,props:tabBarProps,setup(i,{expose:n}){const r=i,g=vue.getCurrentInstance(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$3,"<el-tabs><el-tab-bar /></el-tabs>");const V=useNamespace("tabs"),$=vue.ref(),oe=vue.ref(),re=()=>{let ie=0,ae=0;const le=["top","bottom"].includes(k.props.tabPosition)?"width":"height",Ie=le==="width"?"x":"y",ue=Ie==="x"?"left":"top";return r.tabs.every(de=>{var Ne,he;const pe=(he=(Ne=g.parent)==null?void 0:Ne.refs)==null?void 0:he[`tab-${de.uid}`];if(!pe)return!1;if(!de.active)return!0;ie=pe[`offset${capitalize(ue)}`],ae=pe[`client${capitalize(le)}`];const ze=window.getComputedStyle(pe);return le==="width"&&(r.tabs.length>1&&(ae-=Number.parseFloat(ze.paddingLeft)+Number.parseFloat(ze.paddingRight)),ie+=Number.parseFloat(ze.paddingLeft)),!1}),{[le]:`${ae}px`,transform:`translate${capitalize(Ie)}(${ie}px)`}},Ce=()=>oe.value=re();return vue.watch(()=>r.tabs,async()=>{await vue.nextTick(),Ce()},{immediate:!0}),useResizeObserver($,()=>Ce()),n({ref:$,update:Ce}),(ie,ae)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"barRef",ref:$,class:vue.normalizeClass([vue.unref(V).e("active-bar"),vue.unref(V).is(vue.unref(k).props.tabPosition)]),style:vue.normalizeStyle(oe.value)},null,6))}});var TabBar=_export_sfc$1(_sfc_main$B,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-bar.vue"]]);const tabNavProps=buildProps({panes:{type:definePropType(Array),default:()=>mutable([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),tabNavEmits={tabClick:(i,n,r)=>r instanceof Event,tabRemove:(i,n)=>n instanceof Event},COMPONENT_NAME$2="ElTabNav",TabNav=vue.defineComponent({name:COMPONENT_NAME$2,props:tabNavProps,emits:tabNavEmits,setup(i,{expose:n,emit:r}){const g=vue.getCurrentInstance(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$2,"<el-tabs><tab-nav /></el-tabs>");const V=useNamespace("tabs"),$=useDocumentVisibility(),oe=useWindowFocus(),re=vue.ref(),Ce=vue.ref(),ie=vue.ref(),ae=vue.ref(),le=vue.ref(!1),Ie=vue.ref(0),ue=vue.ref(!1),de=vue.ref(!0),Ne=vue.computed(()=>["top","bottom"].includes(k.props.tabPosition)?"width":"height"),he=vue.computed(()=>({transform:`translate${Ne.value==="width"?"X":"Y"}(-${Ie.value}px)`})),pe=()=>{if(!re.value)return;const Ue=re.value[`offset${capitalize(Ne.value)}`],Ve=Ie.value;if(!Ve)return;const Oe=Ve>Ue?Ve-Ue:0;Ie.value=Oe},ze=()=>{if(!re.value||!Ce.value)return;const Ue=Ce.value[`offset${capitalize(Ne.value)}`],Ve=re.value[`offset${capitalize(Ne.value)}`],Oe=Ie.value;if(Ue-Oe<=Ve)return;const At=Ue-Oe>Ve*2?Oe+Ve:Ue-Ve;Ie.value=At},Fe=async()=>{const Ue=Ce.value;if(!le.value||!ie.value||!re.value||!Ue)return;await vue.nextTick();const Ve=ie.value.querySelector(".is-active");if(!Ve)return;const Oe=re.value,At=["top","bottom"].includes(k.props.tabPosition),qe=Ve.getBoundingClientRect(),Lt=Oe.getBoundingClientRect(),kt=At?Ue.offsetWidth-Lt.width:Ue.offsetHeight-Lt.height,jt=Ie.value;let ti=jt;At?(qe.left<Lt.left&&(ti=jt-(Lt.left-qe.left)),qe.right>Lt.right&&(ti=jt+qe.right-Lt.right)):(qe.top<Lt.top&&(ti=jt-(Lt.top-qe.top)),qe.bottom>Lt.bottom&&(ti=jt+(qe.bottom-Lt.bottom))),ti=Math.max(ti,0),Ie.value=Math.min(ti,kt)},xe=()=>{var Ue;if(!Ce.value||!re.value)return;i.stretch&&((Ue=ae.value)==null||Ue.update());const Ve=Ce.value[`offset${capitalize(Ne.value)}`],Oe=re.value[`offset${capitalize(Ne.value)}`],At=Ie.value;Oe<Ve?(le.value=le.value||{},le.value.prev=At,le.value.next=At+Oe<Ve,Ve-At<Oe&&(Ie.value=Ve-Oe)):(le.value=!1,At>0&&(Ie.value=0))},_e=Ue=>{const Ve=Ue.code,{up:Oe,down:At,left:qe,right:Lt}=EVENT_CODE;if(![Oe,At,qe,Lt].includes(Ve))return;const kt=Array.from(Ue.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),jt=kt.indexOf(Ue.target);let ti;Ve===qe||Ve===Oe?jt===0?ti=kt.length-1:ti=jt-1:jt<kt.length-1?ti=jt+1:ti=0,kt[ti].focus({preventScroll:!0}),kt[ti].click(),Dt()},Dt=()=>{de.value&&(ue.value=!0)},$e=()=>ue.value=!1;return vue.watch($,Ue=>{Ue==="hidden"?de.value=!1:Ue==="visible"&&setTimeout(()=>de.value=!0,50)}),vue.watch(oe,Ue=>{Ue?setTimeout(()=>de.value=!0,50):de.value=!1}),useResizeObserver(ie,xe),vue.onMounted(()=>setTimeout(()=>Fe(),0)),vue.onUpdated(()=>xe()),n({scrollToActiveTab:Fe,removeFocus:$e}),vue.watch(()=>i.panes,()=>g.update(),{flush:"post",deep:!0}),()=>{const Ue=le.value?[vue.createVNode("span",{class:[V.e("nav-prev"),V.is("disabled",!le.value.prev)],onClick:pe},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_left_default,null,null)]})]),vue.createVNode("span",{class:[V.e("nav-next"),V.is("disabled",!le.value.next)],onClick:ze},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_right_default,null,null)]})])]:null,Ve=i.panes.map((Oe,At)=>{var qe,Lt,kt,jt;const ti=Oe.uid,ei=Oe.props.disabled,Pt=(Lt=(qe=Oe.props.name)!=null?qe:Oe.index)!=null?Lt:`${At}`,ni=!ei&&(Oe.isClosable||i.editable);Oe.index=`${At}`;const gi=ni?vue.createVNode(ElIcon,{class:"is-icon-close",onClick:ai=>r("tabRemove",Oe,ai)},{default:()=>[vue.createVNode(close_default,null,null)]}):null,di=((jt=(kt=Oe.slots).label)==null?void 0:jt.call(kt))||Oe.props.label,li=!ei&&Oe.active?0:-1;return vue.createVNode("div",{ref:`tab-${ti}`,class:[V.e("item"),V.is(k.props.tabPosition),V.is("active",Oe.active),V.is("disabled",ei),V.is("closable",ni),V.is("focus",ue.value)],id:`tab-${Pt}`,key:`tab-${ti}`,"aria-controls":`pane-${Pt}`,role:"tab","aria-selected":Oe.active,tabindex:li,onFocus:()=>Dt(),onBlur:()=>$e(),onClick:ai=>{$e(),r("tabClick",Oe,Pt,ai)},onKeydown:ai=>{ni&&(ai.code===EVENT_CODE.delete||ai.code===EVENT_CODE.backspace)&&r("tabRemove",Oe,ai)}},[di,gi])});return vue.createVNode("div",{ref:ie,class:[V.e("nav-wrap"),V.is("scrollable",!!le.value),V.is(k.props.tabPosition)]},[Ue,vue.createVNode("div",{class:V.e("nav-scroll"),ref:re},[vue.createVNode("div",{class:[V.e("nav"),V.is(k.props.tabPosition),V.is("stretch",i.stretch&&["top","bottom"].includes(k.props.tabPosition))],ref:Ce,style:he.value,role:"tablist",onKeydown:_e},[i.type?null:vue.createVNode(TabBar,{ref:ae,tabs:[...i.panes]},null),Ve])])])}}}),tabsProps=buildProps({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:definePropType(Function),default:()=>!0},stretch:Boolean}),isPaneName=i=>isString$1(i)||isNumber$1(i),tabsEmits={[UPDATE_MODEL_EVENT]:i=>isPaneName(i),tabClick:(i,n)=>n instanceof Event,tabChange:i=>isPaneName(i),edit:(i,n)=>["remove","add"].includes(n),tabRemove:i=>isPaneName(i),tabAdd:()=>!0};var Tabs=vue.defineComponent({name:"ElTabs",props:tabsProps,emits:tabsEmits,setup(i,{emit:n,slots:r,expose:g}){var k,V;const $=useNamespace("tabs"),{children:oe,addChild:re,removeChild:Ce}=useOrderedChildren(vue.getCurrentInstance(),"ElTabPane"),ie=vue.ref(),ae=vue.ref((V=(k=i.modelValue)!=null?k:i.activeName)!=null?V:"0"),le=he=>{ae.value=he,n(UPDATE_MODEL_EVENT,he),n("tabChange",he)},Ie=async he=>{var pe,ze,Fe;if(!(ae.value===he||isUndefined(he)))try{await((pe=i.beforeLeave)==null?void 0:pe.call(i,he,ae.value))!==!1&&(le(he),(Fe=(ze=ie.value)==null?void 0:ze.removeFocus)==null||Fe.call(ze))}catch{}},ue=(he,pe,ze)=>{he.props.disabled||(Ie(pe),n("tabClick",he,ze))},de=(he,pe)=>{he.props.disabled||isUndefined(he.props.name)||(pe.stopPropagation(),n("edit",he.props.name,"remove"),n("tabRemove",he.props.name))},Ne=()=>{n("edit",void 0,"add"),n("tabAdd")};return useDeprecated({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},vue.computed(()=>!!i.activeName)),vue.watch(()=>i.activeName,he=>Ie(he)),vue.watch(()=>i.modelValue,he=>Ie(he)),vue.watch(ae,async()=>{var he;await vue.nextTick(),(he=ie.value)==null||he.scrollToActiveTab()}),vue.provide(tabsRootContextKey,{props:i,currentName:ae,registerPane:re,unregisterPane:Ce}),g({currentName:ae}),()=>{const he=i.editable||i.addable?vue.createVNode("span",{class:$.e("new-tab"),tabindex:"0",onClick:Ne,onKeydown:Fe=>{Fe.code===EVENT_CODE.enter&&Ne()}},[vue.createVNode(ElIcon,{class:$.is("icon-plus")},{default:()=>[vue.createVNode(plus_default,null,null)]})]):null,pe=vue.createVNode("div",{class:[$.e("header"),$.is(i.tabPosition)]},[he,vue.createVNode(TabNav,{ref:ie,currentName:ae.value,editable:i.editable,type:i.type,panes:oe.value,stretch:i.stretch,onTabClick:ue,onTabRemove:de},null)]),ze=vue.createVNode("div",{class:$.e("content")},[vue.renderSlot(r,"default")]);return vue.createVNode("div",{class:[$.b(),$.m(i.tabPosition),{[$.m("card")]:i.type==="card",[$.m("border-card")]:i.type==="border-card"}]},[...i.tabPosition!=="bottom"?[pe,ze]:[ze,pe]])}}});const tabPaneProps=buildProps({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),_hoisted_1$q=["id","aria-hidden","aria-labelledby"],COMPONENT_NAME$1="ElTabPane",__default__$5=vue.defineComponent({name:COMPONENT_NAME$1}),_sfc_main$A=vue.defineComponent({...__default__$5,props:tabPaneProps,setup(i){const n=i,r=vue.getCurrentInstance(),g=vue.useSlots(),k=vue.inject(tabsRootContextKey);k||throwError$1(COMPONENT_NAME$1,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const V=useNamespace("tab-pane"),$=vue.ref(),oe=vue.computed(()=>n.closable||k.props.closable),re=computedEager(()=>{var Ie;return k.currentName.value===((Ie=n.name)!=null?Ie:$.value)}),Ce=vue.ref(re.value),ie=vue.computed(()=>{var Ie;return(Ie=n.name)!=null?Ie:$.value}),ae=computedEager(()=>!n.lazy||Ce.value||re.value);vue.watch(re,Ie=>{Ie&&(Ce.value=!0)});const le=vue.reactive({uid:r.uid,slots:g,props:n,paneName:ie,active:re,index:$,isClosable:oe});return vue.onMounted(()=>{k.registerPane(le)}),vue.onUnmounted(()=>{k.unregisterPane(le.uid)}),(Ie,ue)=>vue.unref(ae)?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,id:`pane-${vue.unref(ie)}`,class:vue.normalizeClass(vue.unref(V).b()),role:"tabpanel","aria-hidden":!vue.unref(re),"aria-labelledby":`tab-${vue.unref(ie)}`},[vue.renderSlot(Ie.$slots,"default")],10,_hoisted_1$q)),[[vue.vShow,vue.unref(re)]]):vue.createCommentVNode("v-if",!0)}});var TabPane=_export_sfc$1(_sfc_main$A,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-pane.vue"]]);const ElTabs=withInstall(Tabs,{TabPane}),ElTabPane=withNoopInstall(TabPane),NODE_KEY="$treeNodeId",markNodeData=function(i,n){!n||n[NODE_KEY]||Object.defineProperty(n,NODE_KEY,{value:i.id,enumerable:!1,configurable:!1,writable:!1})},getNodeKey=function(i,n){return i?n[i]:n[NODE_KEY]},handleCurrentChange=(i,n,r)=>{const g=i.value.currentNode;r();const k=i.value.currentNode;g!==k&&n("current-change",k?k.data:null,k)},getChildState=i=>{let n=!0,r=!0,g=!0;for(let k=0,V=i.length;k<V;k++){const $=i[k];($.checked!==!0||$.indeterminate)&&(n=!1,$.disabled||(g=!1)),($.checked!==!1||$.indeterminate)&&(r=!1)}return{all:n,none:r,allWithoutDisable:g,half:!n&&!r}},reInitChecked=function(i){if(i.childNodes.length===0||i.loading)return;const{all:n,none:r,half:g}=getChildState(i.childNodes);n?(i.checked=!0,i.indeterminate=!1):g?(i.checked=!1,i.indeterminate=!0):r&&(i.checked=!1,i.indeterminate=!1);const k=i.parent;!k||k.level===0||i.store.checkStrictly||reInitChecked(k)},getPropertyFromData=function(i,n){const r=i.store.props,g=i.data||{},k=r[n];if(typeof k=="function")return k(g,i);if(typeof k=="string")return g[k];if(typeof k>"u"){const V=g[n];return V===void 0?"":V}};let nodeIdSeed=0;class Node{constructor(n){this.id=nodeIdSeed++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in n)hasOwn$1(n,r)&&(this[r]=n[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const n=this.store;if(!n)throw new Error("[Node]store is required!");n.registerNode(this);const r=n.props;if(r&&typeof r.isLeaf<"u"){const V=getPropertyFromData(this,"isLeaf");typeof V=="boolean"&&(this.isLeafByUser=V)}if(n.lazy!==!0&&this.data?(this.setData(this.data),n.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&n.lazy&&n.defaultExpandAll&&this.expand(),Array.isArray(this.data)||markNodeData(this,this.data),!this.data)return;const g=n.defaultExpandedKeys,k=n.key;k&&g&&g.includes(this.key)&&this.expand(null,n.autoExpandParent),k&&n.currentNodeKey!==void 0&&this.key===n.currentNodeKey&&(n.currentNode=this,n.currentNode.isCurrent=!0),n.lazy&&n._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(n){Array.isArray(n)||markNodeData(this,n),this.data=n,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=getPropertyFromData(this,"children")||[];for(let g=0,k=r.length;g<k;g++)this.insertChild({data:r[g]})}get label(){return getPropertyFromData(this,"label")}get key(){const n=this.store.key;return this.data?this.data[n]:null}get disabled(){return getPropertyFromData(this,"disabled")}get nextSibling(){const n=this.parent;if(n){const r=n.childNodes.indexOf(this);if(r>-1)return n.childNodes[r+1]}return null}get previousSibling(){const n=this.parent;if(n){const r=n.childNodes.indexOf(this);if(r>-1)return r>0?n.childNodes[r-1]:null}return null}contains(n,r=!0){return(this.childNodes||[]).some(g=>g===n||r&&g.contains(n))}remove(){const n=this.parent;n&&n.removeChild(this)}insertChild(n,r,g){if(!n)throw new Error("InsertChild error: child is required.");if(!(n instanceof Node)){if(!g){const k=this.getChildren(!0);k.includes(n.data)||(typeof r>"u"||r<0?k.push(n.data):k.splice(r,0,n.data))}Object.assign(n,{parent:this,store:this.store}),n=vue.reactive(new Node(n)),n instanceof Node&&n.initialize()}n.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(n):this.childNodes.splice(r,0,n),this.updateLeafState()}insertBefore(n,r){let g;r&&(g=this.childNodes.indexOf(r)),this.insertChild(n,g)}insertAfter(n,r){let g;r&&(g=this.childNodes.indexOf(r),g!==-1&&(g+=1)),this.insertChild(n,g)}removeChild(n){const r=this.getChildren()||[],g=r.indexOf(n.data);g>-1&&r.splice(g,1);const k=this.childNodes.indexOf(n);k>-1&&(this.store&&this.store.deregisterNode(n),n.parent=null,this.childNodes.splice(k,1)),this.updateLeafState()}removeChildByData(n){let r=null;for(let g=0;g<this.childNodes.length;g++)if(this.childNodes[g].data===n){r=this.childNodes[g];break}r&&this.removeChild(r)}expand(n,r){const g=()=>{if(r){let k=this.parent;for(;k.level>0;)k.expanded=!0,k=k.parent}this.expanded=!0,n&&n(),this.childNodes.forEach(k=>{k.canFocus=!0})};this.shouldLoadData()?this.loadData(k=>{Array.isArray(k)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||reInitChecked(this),g())}):g()}doCreateChildren(n,r={}){n.forEach(g=>{this.insertChild(Object.assign({data:g},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(n=>{n.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const n=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!n||n.length===0;return}this.isLeaf=!1}setChecked(n,r,g,k){if(this.indeterminate=n==="half",this.checked=n===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:$,allWithoutDisable:oe}=getChildState(this.childNodes);!this.isLeaf&&!$&&oe&&(this.checked=!1,n=!1);const re=()=>{if(r){const Ce=this.childNodes;for(let le=0,Ie=Ce.length;le<Ie;le++){const ue=Ce[le];k=k||n!==!1;const de=ue.disabled?ue.checked:k;ue.setChecked(de,r,!0,k)}const{half:ie,all:ae}=getChildState(Ce);ae||(this.checked=ae,this.indeterminate=ie)}};if(this.shouldLoadData()){this.loadData(()=>{re(),reInitChecked(this)},{checked:n!==!1});return}else re()}const V=this.parent;!V||V.level===0||g||reInitChecked(V)}getChildren(n=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const g=this.store.props;let k="children";return g&&(k=g.children||"children"),r[k]===void 0&&(r[k]=null),n&&!r[k]&&(r[k]=[]),r[k]}updateChildren(){const n=this.getChildren()||[],r=this.childNodes.map(V=>V.data),g={},k=[];n.forEach((V,$)=>{const oe=V[NODE_KEY];!!oe&&r.findIndex(Ce=>Ce[NODE_KEY]===oe)>=0?g[oe]={index:$,data:V}:k.push({index:$,data:V})}),this.store.lazy||r.forEach(V=>{g[V[NODE_KEY]]||this.removeChildByData(V)}),k.forEach(({index:V,data:$})=>{this.insertChild({data:$},V)}),this.updateLeafState()}loadData(n,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const g=k=>{this.childNodes=[],this.doCreateChildren(k,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),n&&n.call(this,k)};this.store.load(this,g)}else n&&n.call(this)}}class TreeStore{constructor(n){this.currentNode=null,this.currentNodeKey=null;for(const r in n)hasOwn$1(n,r)&&(this[r]=n[r]);this.nodesMap={}}initialize(){if(this.root=new Node({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const n=this.load;n(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(n){const r=this.filterNodeMethod,g=this.lazy,k=function(V){const $=V.root?V.root.childNodes:V.childNodes;if($.forEach(oe=>{oe.visible=r.call(oe,n,oe.data,oe),k(oe)}),!V.visible&&$.length){let oe=!0;oe=!$.some(re=>re.visible),V.root?V.root.visible=oe===!1:V.visible=oe===!1}n&&V.visible&&!V.isLeaf&&!g&&V.expand()};k(this)}setData(n){n!==this.root.data?(this.root.setData(n),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(n){if(n instanceof Node)return n;const r=isObject$4(n)?getNodeKey(this.key,n):n;return this.nodesMap[r]||null}insertBefore(n,r){const g=this.getNode(r);g.parent.insertBefore({data:n},g)}insertAfter(n,r){const g=this.getNode(r);g.parent.insertAfter({data:n},g)}remove(n){const r=this.getNode(n);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(n,r){const g=r?this.getNode(r):this.root;g&&g.insertChild({data:n})}_initDefaultCheckedNodes(){const n=this.defaultCheckedKeys||[],r=this.nodesMap;n.forEach(g=>{const k=r[g];k&&k.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(n){(this.defaultCheckedKeys||[]).includes(n.key)&&n.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(n){n!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=n,this._initDefaultCheckedNodes())}registerNode(n){const r=this.key;!n||!n.data||(r?n.key!==void 0&&(this.nodesMap[n.key]=n):this.nodesMap[n.id]=n)}deregisterNode(n){!this.key||!n||!n.data||(n.childNodes.forEach(g=>{this.deregisterNode(g)}),delete this.nodesMap[n.key])}getCheckedNodes(n=!1,r=!1){const g=[],k=function(V){(V.root?V.root.childNodes:V.childNodes).forEach(oe=>{(oe.checked||r&&oe.indeterminate)&&(!n||n&&oe.isLeaf)&&g.push(oe.data),k(oe)})};return k(this),g}getCheckedKeys(n=!1){return this.getCheckedNodes(n).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const n=[],r=function(g){(g.root?g.root.childNodes:g.childNodes).forEach(V=>{V.indeterminate&&n.push(V.data),r(V)})};return r(this),n}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(n=>(n||{})[this.key])}_getAllNodes(){const n=[],r=this.nodesMap;for(const g in r)hasOwn$1(r,g)&&n.push(r[g]);return n}updateChildren(n,r){const g=this.nodesMap[n];if(!g)return;const k=g.childNodes;for(let V=k.length-1;V>=0;V--){const $=k[V];this.remove($.data)}for(let V=0,$=r.length;V<$;V++){const oe=r[V];this.append(oe,g.data)}}_setCheckedKeys(n,r=!1,g){const k=this._getAllNodes().sort((oe,re)=>re.level-oe.level),V=Object.create(null),$=Object.keys(g);k.forEach(oe=>oe.setChecked(!1,!1));for(let oe=0,re=k.length;oe<re;oe++){const Ce=k[oe],ie=Ce.data[n].toString();if(!$.includes(ie)){Ce.checked&&!V[ie]&&Ce.setChecked(!1,!1);continue}let le=Ce.parent;for(;le&&le.level>0;)V[le.data[n]]=!0,le=le.parent;if(Ce.isLeaf||this.checkStrictly){Ce.setChecked(!0,!1);continue}if(Ce.setChecked(!0,!0),r){Ce.setChecked(!1,!1);const Ie=function(ue){ue.childNodes.forEach(Ne=>{Ne.isLeaf||Ne.setChecked(!1,!1),Ie(Ne)})};Ie(Ce)}}}setCheckedNodes(n,r=!1){const g=this.key,k={};n.forEach(V=>{k[(V||{})[g]]=!0}),this._setCheckedKeys(g,r,k)}setCheckedKeys(n,r=!1){this.defaultCheckedKeys=n;const g=this.key,k={};n.forEach(V=>{k[V]=!0}),this._setCheckedKeys(g,r,k)}setDefaultExpandedKeys(n){n=n||[],this.defaultExpandedKeys=n,n.forEach(r=>{const g=this.getNode(r);g&&g.expand(null,this.autoExpandParent)})}setChecked(n,r,g){const k=this.getNode(n);k&&k.setChecked(!!r,g)}getCurrentNode(){return this.currentNode}setCurrentNode(n){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=n,this.currentNode.isCurrent=!0}setUserCurrentNode(n,r=!0){const g=n[this.key],k=this.nodesMap[g];this.setCurrentNode(k),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(n,r=!0){if(n==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const g=this.getNode(n);g&&(this.setCurrentNode(g),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const _sfc_main$z=vue.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(i){const n=useNamespace("tree"),r=vue.inject("NodeInstance"),g=vue.inject("RootTree");return()=>{const k=i.node,{data:V,store:$}=k;return i.renderContent?i.renderContent(vue.h,{_self:r,node:k,data:V,store:$}):g.ctx.slots.default?g.ctx.slots.default({node:k,data:V}):vue.h("span",{class:n.be("node","label")},[k.label])}}});var NodeContent=_export_sfc$1(_sfc_main$z,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node-content.vue"]]);function useNodeExpandEventBroadcast(i){const n=vue.inject("TreeNodeMap",null),r={treeNodeExpand:g=>{i.node!==g&&i.node.collapse()},children:[]};return n&&n.children.push(r),vue.provide("TreeNodeMap",r),{broadcastExpanded:g=>{if(i.accordion)for(const k of r.children)k.treeNodeExpand(g)}}}const dragEventsKey=Symbol("dragEvents");function useDragNodeHandler({props:i,ctx:n,el$:r,dropIndicator$:g,store:k}){const V=useNamespace("tree"),$=vue.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),oe=({event:ie,treeNode:ae})=>{if(typeof i.allowDrag=="function"&&!i.allowDrag(ae.node))return ie.preventDefault(),!1;ie.dataTransfer.effectAllowed="move";try{ie.dataTransfer.setData("text/plain","")}catch{}$.value.draggingNode=ae,n.emit("node-drag-start",ae.node,ie)},re=({event:ie,treeNode:ae})=>{const le=ae,Ie=$.value.dropNode;Ie&&Ie.node.id!==le.node.id&&removeClass(Ie.$el,V.is("drop-inner"));const ue=$.value.draggingNode;if(!ue||!le)return;let de=!0,Ne=!0,he=!0,pe=!0;typeof i.allowDrop=="function"&&(de=i.allowDrop(ue.node,le.node,"prev"),pe=Ne=i.allowDrop(ue.node,le.node,"inner"),he=i.allowDrop(ue.node,le.node,"next")),ie.dataTransfer.dropEffect=Ne||de||he?"move":"none",(de||Ne||he)&&(Ie==null?void 0:Ie.node.id)!==le.node.id&&(Ie&&n.emit("node-drag-leave",ue.node,Ie.node,ie),n.emit("node-drag-enter",ue.node,le.node,ie)),(de||Ne||he)&&($.value.dropNode=le),le.node.nextSibling===ue.node&&(he=!1),le.node.previousSibling===ue.node&&(de=!1),le.node.contains(ue.node,!1)&&(Ne=!1),(ue.node===le.node||ue.node.contains(le.node))&&(de=!1,Ne=!1,he=!1);const ze=le.$el.getBoundingClientRect(),Fe=r.value.getBoundingClientRect();let xe;const _e=de?Ne?.25:he?.45:1:-1,Dt=he?Ne?.75:de?.55:0:1;let $e=-9999;const Ue=ie.clientY-ze.top;Ue<ze.height*_e?xe="before":Ue>ze.height*Dt?xe="after":Ne?xe="inner":xe="none";const Ve=le.$el.querySelector(`.${V.be("node","expand-icon")}`).getBoundingClientRect(),Oe=g.value;xe==="before"?$e=Ve.top-Fe.top:xe==="after"&&($e=Ve.bottom-Fe.top),Oe.style.top=`${$e}px`,Oe.style.left=`${Ve.right-Fe.left}px`,xe==="inner"?addClass(le.$el,V.is("drop-inner")):removeClass(le.$el,V.is("drop-inner")),$.value.showDropIndicator=xe==="before"||xe==="after",$.value.allowDrop=$.value.showDropIndicator||pe,$.value.dropType=xe,n.emit("node-drag-over",ue.node,le.node,ie)},Ce=ie=>{const{draggingNode:ae,dropType:le,dropNode:Ie}=$.value;if(ie.preventDefault(),ie.dataTransfer.dropEffect="move",ae&&Ie){const ue={data:ae.node.data};le!=="none"&&ae.node.remove(),le==="before"?Ie.node.parent.insertBefore(ue,Ie.node):le==="after"?Ie.node.parent.insertAfter(ue,Ie.node):le==="inner"&&Ie.node.insertChild(ue),le!=="none"&&k.value.registerNode(ue),removeClass(Ie.$el,V.is("drop-inner")),n.emit("node-drag-end",ae.node,Ie.node,le,ie),le!=="none"&&n.emit("node-drop",ae.node,Ie.node,le,ie)}ae&&!Ie&&n.emit("node-drag-end",ae.node,null,le,ie),$.value.showDropIndicator=!1,$.value.draggingNode=null,$.value.dropNode=null,$.value.allowDrop=!0};return vue.provide(dragEventsKey,{treeNodeDragStart:oe,treeNodeDragOver:re,treeNodeDragEnd:Ce}),{dragState:$}}const _sfc_main$y=vue.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:_CollapseTransition,ElCheckbox,NodeContent,ElIcon,Loading:loading_default},props:{node:{type:Node,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(i,n){const r=useNamespace("tree"),{broadcastExpanded:g}=useNodeExpandEventBroadcast(i),k=vue.inject("RootTree"),V=vue.ref(!1),$=vue.ref(!1),oe=vue.ref(null),re=vue.ref(null),Ce=vue.ref(null),ie=vue.inject(dragEventsKey),ae=vue.getCurrentInstance();vue.provide("NodeInstance",ae),k||debugWarn("Tree","Can not find node's tree."),i.node.expanded&&(V.value=!0,$.value=!0);const le=k.props.children||"children";vue.watch(()=>{const Ue=i.node.data[le];return Ue&&[...Ue]},()=>{i.node.updateChildren()}),vue.watch(()=>i.node.indeterminate,Ue=>{de(i.node.checked,Ue)}),vue.watch(()=>i.node.checked,Ue=>{de(Ue,i.node.indeterminate)}),vue.watch(()=>i.node.expanded,Ue=>{vue.nextTick(()=>V.value=Ue),Ue&&($.value=!0)});const Ie=Ue=>getNodeKey(k.props.nodeKey,Ue.data),ue=Ue=>{const Ve=i.props.class;if(!Ve)return{};let Oe;if(isFunction$2(Ve)){const{data:At}=Ue;Oe=Ve(At,Ue)}else Oe=Ve;return isString$1(Oe)?{[Oe]:!0}:Oe},de=(Ue,Ve)=>{(oe.value!==Ue||re.value!==Ve)&&k.ctx.emit("check-change",i.node.data,Ue,Ve),oe.value=Ue,re.value=Ve},Ne=Ue=>{handleCurrentChange(k.store,k.ctx.emit,()=>k.store.value.setCurrentNode(i.node)),k.currentNode.value=i.node,k.props.expandOnClickNode&&pe(),k.props.checkOnClickNode&&!i.node.disabled&&ze(null,{target:{checked:!i.node.checked}}),k.ctx.emit("node-click",i.node.data,i.node,ae,Ue)},he=Ue=>{k.instance.vnode.props.onNodeContextmenu&&(Ue.stopPropagation(),Ue.preventDefault()),k.ctx.emit("node-contextmenu",Ue,i.node.data,i.node,ae)},pe=()=>{i.node.isLeaf||(V.value?(k.ctx.emit("node-collapse",i.node.data,i.node,ae),i.node.collapse()):(i.node.expand(),n.emit("node-expand",i.node.data,i.node,ae)))},ze=(Ue,Ve)=>{i.node.setChecked(Ve.target.checked,!k.props.checkStrictly),vue.nextTick(()=>{const Oe=k.store.value;k.ctx.emit("check",i.node.data,{checkedNodes:Oe.getCheckedNodes(),checkedKeys:Oe.getCheckedKeys(),halfCheckedNodes:Oe.getHalfCheckedNodes(),halfCheckedKeys:Oe.getHalfCheckedKeys()})})};return{ns:r,node$:Ce,tree:k,expanded:V,childNodeRendered:$,oldChecked:oe,oldIndeterminate:re,getNodeKey:Ie,getNodeClass:ue,handleSelectChange:de,handleClick:Ne,handleContextMenu:he,handleExpandIconClick:pe,handleCheckChange:ze,handleChildNodeExpand:(Ue,Ve,Oe)=>{g(Ve),k.ctx.emit("node-expand",Ue,Ve,Oe)},handleDragStart:Ue=>{k.props.draggable&&ie.treeNodeDragStart({event:Ue,treeNode:i})},handleDragOver:Ue=>{Ue.preventDefault(),k.props.draggable&&ie.treeNodeDragOver({event:Ue,treeNode:{$el:Ce.value,node:i.node}})},handleDrop:Ue=>{Ue.preventDefault()},handleDragEnd:Ue=>{k.props.draggable&&ie.treeNodeDragEnd(Ue)},CaretRight:caret_right_default}}}),_hoisted_1$p=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],_hoisted_2$k=["aria-expanded"];function _sfc_render$3(i,n,r,g,k,V){const $=vue.resolveComponent("el-icon"),oe=vue.resolveComponent("el-checkbox"),re=vue.resolveComponent("loading"),Ce=vue.resolveComponent("node-content"),ie=vue.resolveComponent("el-tree-node"),ae=vue.resolveComponent("el-collapse-transition");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{ref:"node$",class:vue.normalizeClass([i.ns.b("node"),i.ns.is("expanded",i.expanded),i.ns.is("current",i.node.isCurrent),i.ns.is("hidden",!i.node.visible),i.ns.is("focusable",!i.node.disabled),i.ns.is("checked",!i.node.disabled&&i.node.checked),i.getNodeClass(i.node)]),role:"treeitem",tabindex:"-1","aria-expanded":i.expanded,"aria-disabled":i.node.disabled,"aria-checked":i.node.checked,draggable:i.tree.props.draggable,"data-key":i.getNodeKey(i.node),onClick:n[1]||(n[1]=vue.withModifiers((...le)=>i.handleClick&&i.handleClick(...le),["stop"])),onContextmenu:n[2]||(n[2]=(...le)=>i.handleContextMenu&&i.handleContextMenu(...le)),onDragstart:n[3]||(n[3]=vue.withModifiers((...le)=>i.handleDragStart&&i.handleDragStart(...le),["stop"])),onDragover:n[4]||(n[4]=vue.withModifiers((...le)=>i.handleDragOver&&i.handleDragOver(...le),["stop"])),onDragend:n[5]||(n[5]=vue.withModifiers((...le)=>i.handleDragEnd&&i.handleDragEnd(...le),["stop"])),onDrop:n[6]||(n[6]=vue.withModifiers((...le)=>i.handleDrop&&i.handleDrop(...le),["stop"]))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.be("node","content")),style:vue.normalizeStyle({paddingLeft:(i.node.level-1)*i.tree.props.indent+"px"})},[i.tree.props.icon||i.CaretRight?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.be("node","expand-icon"),i.ns.is("leaf",i.node.isLeaf),{expanded:!i.node.isLeaf&&i.expanded}]),onClick:vue.withModifiers(i.handleExpandIconClick,["stop"])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.tree.props.icon||i.CaretRight)))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0),i.showCheckbox?(vue.openBlock(),vue.createBlock(oe,{key:1,"model-value":i.node.checked,indeterminate:i.node.indeterminate,disabled:!!i.node.disabled,onClick:n[0]||(n[0]=vue.withModifiers(()=>{},["stop"])),onChange:i.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):vue.createCommentVNode("v-if",!0),i.node.loading?(vue.openBlock(),vue.createBlock($,{key:2,class:vue.normalizeClass([i.ns.be("node","loading-icon"),i.ns.is("loading")])},{default:vue.withCtx(()=>[vue.createVNode(re)]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createVNode(Ce,{node:i.node,"render-content":i.renderContent},null,8,["node","render-content"])],6),vue.createVNode(ae,null,{default:vue.withCtx(()=>[!i.renderAfterExpand||i.childNodeRendered?vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.ns.be("node","children")),role:"group","aria-expanded":i.expanded},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.node.childNodes,le=>(vue.openBlock(),vue.createBlock(ie,{key:i.getNodeKey(le),"render-content":i.renderContent,"render-after-expand":i.renderAfterExpand,"show-checkbox":i.showCheckbox,node:le,accordion:i.accordion,props:i.props,onNodeExpand:i.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,_hoisted_2$k)),[[vue.vShow,i.expanded]]):vue.createCommentVNode("v-if",!0)]),_:1})],42,_hoisted_1$p)),[[vue.vShow,i.node.visible]])}var ElTreeNode=_export_sfc$1(_sfc_main$y,[["render",_sfc_render$3],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node.vue"]]);function useKeydown({el$:i},n){const r=useNamespace("tree"),g=vue.shallowRef([]),k=vue.shallowRef([]);vue.onMounted(()=>{$()}),vue.onUpdated(()=>{g.value=Array.from(i.value.querySelectorAll("[role=treeitem]")),k.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"))}),vue.watch(k,oe=>{oe.forEach(re=>{re.setAttribute("tabindex","-1")})}),useEventListener(i,"keydown",oe=>{const re=oe.target;if(!re.className.includes(r.b("node")))return;const Ce=oe.code;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const ie=g.value.indexOf(re);let ae;if([EVENT_CODE.up,EVENT_CODE.down].includes(Ce)){if(oe.preventDefault(),Ce===EVENT_CODE.up){ae=ie===-1?0:ie!==0?ie-1:g.value.length-1;const Ie=ae;for(;!n.value.getNode(g.value[ae].dataset.key).canFocus;){if(ae--,ae===Ie){ae=-1;break}ae<0&&(ae=g.value.length-1)}}else{ae=ie===-1?0:ie<g.value.length-1?ie+1:0;const Ie=ae;for(;!n.value.getNode(g.value[ae].dataset.key).canFocus;){if(ae++,ae===Ie){ae=-1;break}ae>=g.value.length&&(ae=0)}}ae!==-1&&g.value[ae].focus()}[EVENT_CODE.left,EVENT_CODE.right].includes(Ce)&&(oe.preventDefault(),re.click());const le=re.querySelector('[type="checkbox"]');[EVENT_CODE.enter,EVENT_CODE.space].includes(Ce)&&le&&(oe.preventDefault(),le.click())});const $=()=>{var oe;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),k.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"));const re=i.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(re.length){re[0].setAttribute("tabindex","0");return}(oe=g.value[0])==null||oe.setAttribute("tabindex","0")}}const _sfc_main$x=vue.defineComponent({name:"ElTree",components:{ElTreeNode},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:iconPropType}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(i,n){const{t:r}=useLocale(),g=useNamespace("tree"),k=vue.ref(new TreeStore({key:i.nodeKey,data:i.data,lazy:i.lazy,props:i.props,load:i.load,currentNodeKey:i.currentNodeKey,checkStrictly:i.checkStrictly,checkDescendants:i.checkDescendants,defaultCheckedKeys:i.defaultCheckedKeys,defaultExpandedKeys:i.defaultExpandedKeys,autoExpandParent:i.autoExpandParent,defaultExpandAll:i.defaultExpandAll,filterNodeMethod:i.filterNodeMethod}));k.value.initialize();const V=vue.ref(k.value.root),$=vue.ref(null),oe=vue.ref(null),re=vue.ref(null),{broadcastExpanded:Ce}=useNodeExpandEventBroadcast(i),{dragState:ie}=useDragNodeHandler({props:i,ctx:n,el$:oe,dropIndicator$:re,store:k});useKeydown({el$:oe},k);const ae=vue.computed(()=>{const{childNodes:ti}=V.value;return!ti||ti.length===0||ti.every(({visible:ei})=>!ei)});vue.watch(()=>i.currentNodeKey,ti=>{k.value.setCurrentNodeKey(ti)}),vue.watch(()=>i.defaultCheckedKeys,ti=>{k.value.setDefaultCheckedKey(ti)}),vue.watch(()=>i.defaultExpandedKeys,ti=>{k.value.setDefaultExpandedKeys(ti)}),vue.watch(()=>i.data,ti=>{k.value.setData(ti)},{deep:!0}),vue.watch(()=>i.checkStrictly,ti=>{k.value.checkStrictly=ti});const le=ti=>{if(!i.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");k.value.filter(ti)},Ie=ti=>getNodeKey(i.nodeKey,ti.data),ue=ti=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const ei=k.value.getNode(ti);if(!ei)return[];const Pt=[ei.data];let ni=ei.parent;for(;ni&&ni!==V.value;)Pt.push(ni.data),ni=ni.parent;return Pt.reverse()},de=(ti,ei)=>k.value.getCheckedNodes(ti,ei),Ne=ti=>k.value.getCheckedKeys(ti),he=()=>{const ti=k.value.getCurrentNode();return ti?ti.data:null},pe=()=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const ti=he();return ti?ti[i.nodeKey]:null},ze=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");k.value.setCheckedNodes(ti,ei)},Fe=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");k.value.setCheckedKeys(ti,ei)},xe=(ti,ei,Pt)=>{k.value.setChecked(ti,ei,Pt)},_e=()=>k.value.getHalfCheckedNodes(),Dt=()=>k.value.getHalfCheckedKeys(),$e=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");handleCurrentChange(k,n.emit,()=>k.value.setUserCurrentNode(ti,ei))},Ue=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");handleCurrentChange(k,n.emit,()=>k.value.setCurrentNodeKey(ti,ei))},Ve=ti=>k.value.getNode(ti),Oe=ti=>{k.value.remove(ti)},At=(ti,ei)=>{k.value.append(ti,ei)},qe=(ti,ei)=>{k.value.insertBefore(ti,ei)},Lt=(ti,ei)=>{k.value.insertAfter(ti,ei)},kt=(ti,ei,Pt)=>{Ce(ei),n.emit("node-expand",ti,ei,Pt)},jt=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");k.value.updateChildren(ti,ei)};return vue.provide("RootTree",{ctx:n,props:i,store:k,root:V,currentNode:$,instance:vue.getCurrentInstance()}),vue.provide(formItemContextKey,void 0),{ns:g,store:k,root:V,currentNode:$,dragState:ie,el$:oe,dropIndicator$:re,isEmpty:ae,filter:le,getNodeKey:Ie,getNodePath:ue,getCheckedNodes:de,getCheckedKeys:Ne,getCurrentNode:he,getCurrentKey:pe,setCheckedNodes:ze,setCheckedKeys:Fe,setChecked:xe,getHalfCheckedNodes:_e,getHalfCheckedKeys:Dt,setCurrentNode:$e,setCurrentKey:Ue,t:r,getNode:Ve,remove:Oe,append:At,insertBefore:qe,insertAfter:Lt,handleNodeExpand:kt,updateKeyChildren:jt}}});function _sfc_render$2(i,n,r,g,k,V){const $=vue.resolveComponent("el-tree-node");return vue.openBlock(),vue.createElementBlock("div",{ref:"el$",class:vue.normalizeClass([i.ns.b(),i.ns.is("dragging",!!i.dragState.draggingNode),i.ns.is("drop-not-allow",!i.dragState.allowDrop),i.ns.is("drop-inner",i.dragState.dropType==="inner"),{[i.ns.m("highlight-current")]:i.highlightCurrent}]),role:"tree"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.root.childNodes,oe=>(vue.openBlock(),vue.createBlock($,{key:i.getNodeKey(oe),node:oe,props:i.props,accordion:i.accordion,"render-after-expand":i.renderAfterExpand,"show-checkbox":i.showCheckbox,"render-content":i.renderContent,onNodeExpand:i.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),i.isEmpty?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.ns.e("empty-block"))},[vue.renderSlot(i.$slots,"empty",{},()=>{var oe;return[vue.createElementVNode("span",{class:vue.normalizeClass(i.ns.e("empty-text"))},vue.toDisplayString((oe=i.emptyText)!=null?oe:i.t("el.tree.emptyText")),3)]})],2)):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createElementVNode("div",{ref:"dropIndicator$",class:vue.normalizeClass(i.ns.e("drop-indicator"))},null,2),[[vue.vShow,i.dragState.showDropIndicator]])],2)}var Tree=_export_sfc$1(_sfc_main$x,[["render",_sfc_render$2],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree.vue"]]);Tree.install=i=>{i.component(Tree.name,Tree)};const _Tree=Tree,ElTree=_Tree,uploadContextKey=Symbol("uploadContextKey"),SCOPE$1="ElUpload";class UploadAjaxError extends Error{constructor(n,r,g,k){super(n),this.name="UploadAjaxError",this.status=r,this.method=g,this.url=k}}function getError(i,n,r){let g;return r.response?g=`${r.response.error||r.response}`:r.responseText?g=`${r.responseText}`:g=`fail to ${n.method} ${i} ${r.status}`,new UploadAjaxError(g,r.status,n.method,i)}function getBody(i){const n=i.responseText||i.response;if(!n)return n;try{return JSON.parse(n)}catch{return n}}const ajaxUpload=i=>{typeof XMLHttpRequest>"u"&&throwError$1(SCOPE$1,"XMLHttpRequest is undefined");const n=new XMLHttpRequest,r=i.action;n.upload&&n.upload.addEventListener("progress",V=>{const $=V;$.percent=V.total>0?V.loaded/V.total*100:0,i.onProgress($)});const g=new FormData;if(i.data)for(const[V,$]of Object.entries(i.data))Array.isArray($)?g.append(V,...$):g.append(V,$);g.append(i.filename,i.file,i.file.name),n.addEventListener("error",()=>{i.onError(getError(r,i,n))}),n.addEventListener("load",()=>{if(n.status<200||n.status>=300)return i.onError(getError(r,i,n));i.onSuccess(getBody(n))}),n.open(i.method,r,!0),i.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);const k=i.headers||{};if(k instanceof Headers)k.forEach((V,$)=>n.setRequestHeader($,V));else for(const[V,$]of Object.entries(k))isNil($)||n.setRequestHeader(V,String($));return n.send(g),n},uploadListTypes=["text","picture","picture-card"];let fileId=1;const genFileId=()=>Date.now()+fileId++,uploadBaseProps=buildProps({action:{type:String,default:"#"},headers:{type:definePropType(Object)},method:{type:String,default:"post"},data:{type:Object,default:()=>mutable({})},multiple:{type:Boolean,default:!1},name:{type:String,default:"file"},drag:{type:Boolean,default:!1},withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},type:{type:String,default:"select"},fileList:{type:definePropType(Array),default:()=>mutable([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:uploadListTypes,default:"text"},httpRequest:{type:definePropType(Function),default:ajaxUpload},disabled:Boolean,limit:Number}),uploadProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},beforeRemove:{type:definePropType(Function)},onRemove:{type:definePropType(Function),default:NOOP},onChange:{type:definePropType(Function),default:NOOP},onPreview:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),uploadListProps=buildProps({files:{type:definePropType(Array),default:()=>mutable([])},disabled:{type:Boolean,default:!1},handlePreview:{type:definePropType(Function),default:NOOP},listType:{type:String,values:uploadListTypes,default:"text"}}),uploadListEmits={remove:i=>!!i},_hoisted_1$o=["onKeydown"],_hoisted_2$j=["src"],_hoisted_3$f=["onClick"],_hoisted_4$b=["title"],_hoisted_5$a=["onClick"],_hoisted_6$7=["onClick"],__default__$4=vue.defineComponent({name:"ElUploadList"}),_sfc_main$w=vue.defineComponent({...__default__$4,props:uploadListProps,emits:uploadListEmits,setup(i,{emit:n}){const{t:r}=useLocale(),g=useNamespace("upload"),k=useNamespace("icon"),V=useNamespace("list"),$=useFormDisabled(),oe=vue.ref(!1),re=Ce=>{n("remove",Ce)};return(Ce,ie)=>(vue.openBlock(),vue.createBlock(vue.TransitionGroup,{tag:"ul",class:vue.normalizeClass([vue.unref(g).b("list"),vue.unref(g).bm("list",Ce.listType),vue.unref(g).is("disabled",vue.unref($))]),name:vue.unref(V).b()},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ce.files,ae=>(vue.openBlock(),vue.createElementBlock("li",{key:ae.uid||ae.name,class:vue.normalizeClass([vue.unref(g).be("list","item"),vue.unref(g).is(ae.status),{focusing:oe.value}]),tabindex:"0",onKeydown:vue.withKeys(le=>!vue.unref($)&&re(ae),["delete"]),onFocus:ie[0]||(ie[0]=le=>oe.value=!0),onBlur:ie[1]||(ie[1]=le=>oe.value=!1),onClick:ie[2]||(ie[2]=le=>oe.value=!1)},[vue.renderSlot(Ce.$slots,"default",{file:ae},()=>[Ce.listType==="picture"||ae.status!=="uploading"&&Ce.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:vue.normalizeClass(vue.unref(g).be("list","item-thumbnail")),src:ae.url,alt:""},null,10,_hoisted_2$j)):vue.createCommentVNode("v-if",!0),ae.status==="uploading"||Ce.listType!=="picture-card"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(g).be("list","item-info"))},[vue.createElementVNode("a",{class:vue.normalizeClass(vue.unref(g).be("list","item-name")),onClick:vue.withModifiers(le=>Ce.handlePreview(ae),["prevent"])},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("document"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(document_default))]),_:1},8,["class"]),vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(g).be("list","item-file-name")),title:ae.name},vue.toDisplayString(ae.name),11,_hoisted_4$b)],10,_hoisted_3$f),ae.status==="uploading"?(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{key:0,type:Ce.listType==="picture-card"?"circle":"line","stroke-width":Ce.listType==="picture-card"?6:2,percentage:Number(ae.percentage),style:vue.normalizeStyle(Ce.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("label",{class:vue.normalizeClass(vue.unref(g).be("list","item-status-label"))},[Ce.listType==="text"?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass([vue.unref(k).m("upload-success"),vue.unref(k).m("circle-check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(circle_check_default))]),_:1},8,["class"])):["picture-card","picture"].includes(Ce.listType)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(k).m("upload-success"),vue.unref(k).m("check")])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(check_default))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(k).m("close")),onClick:le=>re(ae)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:2},1032,["class","onClick"])),vue.createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),vue.createCommentVNode(" This is a bug which needs to be fixed "),vue.createCommentVNode(" TODO: Fix the incorrect navigation interaction "),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("i",{key:3,class:vue.normalizeClass(vue.unref(k).m("close-tip"))},vue.toDisplayString(vue.unref(r)("el.upload.deleteTip")),3)),Ce.listType==="picture-card"?(vue.openBlock(),vue.createElementBlock("span",{key:4,class:vue.normalizeClass(vue.unref(g).be("list","item-actions"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(g).be("list","item-preview")),onClick:le=>Ce.handlePreview(ae)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("zoom-in"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(zoom_in_default))]),_:1},8,["class"])],10,_hoisted_5$a),vue.unref($)?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(g).be("list","item-delete")),onClick:le=>re(ae)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(k).m("delete"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(delete_default))]),_:1},8,["class"])],10,_hoisted_6$7))],2)):vue.createCommentVNode("v-if",!0)])],42,_hoisted_1$o))),128)),vue.renderSlot(Ce.$slots,"append")]),_:3},8,["class","name"]))}});var UploadList=_export_sfc$1(_sfc_main$w,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-list.vue"]]);const uploadDraggerProps=buildProps({disabled:{type:Boolean,default:!1}}),uploadDraggerEmits={file:i=>isArray$3(i)},_hoisted_1$n=["onDrop","onDragover"],COMPONENT_NAME="ElUploadDrag",__default__$3=vue.defineComponent({name:COMPONENT_NAME}),_sfc_main$v=vue.defineComponent({...__default__$3,props:uploadDraggerProps,emits:uploadDraggerEmits,setup(i,{emit:n}){const r=vue.inject(uploadContextKey);r||throwError$1(COMPONENT_NAME,"usage: <el-upload><el-upload-dragger /></el-upload>");const g=useNamespace("upload"),k=vue.ref(!1),V=useFormDisabled(),$=re=>{if(V.value)return;k.value=!1,re.stopPropagation();const Ce=Array.from(re.dataTransfer.files),ie=r.accept.value;if(!ie){n("file",Ce);return}const ae=Ce.filter(le=>{const{type:Ie,name:ue}=le,de=ue.includes(".")?`.${ue.split(".").pop()}`:"",Ne=Ie.replace(/\/.*$/,"");return ie.split(",").map(he=>he.trim()).filter(he=>he).some(he=>he.startsWith(".")?de===he:/\/\*$/.test(he)?Ne===he.replace(/\/\*$/,""):/^[^/]+\/[^/]+$/.test(he)?Ie===he:!1)});n("file",ae)},oe=()=>{V.value||(k.value=!0)};return(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(g).b("dragger"),vue.unref(g).is("dragover",k.value)]),onDrop:vue.withModifiers($,["prevent"]),onDragover:vue.withModifiers(oe,["prevent"]),onDragleave:Ce[0]||(Ce[0]=vue.withModifiers(ie=>k.value=!1,["prevent"]))},[vue.renderSlot(re.$slots,"default")],42,_hoisted_1$n))}});var UploadDragger=_export_sfc$1(_sfc_main$v,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-dragger.vue"]]);const uploadContentProps=buildProps({...uploadBaseProps,beforeUpload:{type:definePropType(Function),default:NOOP},onRemove:{type:definePropType(Function),default:NOOP},onStart:{type:definePropType(Function),default:NOOP},onSuccess:{type:definePropType(Function),default:NOOP},onProgress:{type:definePropType(Function),default:NOOP},onError:{type:definePropType(Function),default:NOOP},onExceed:{type:definePropType(Function),default:NOOP}}),_hoisted_1$m=["onKeydown"],_hoisted_2$i=["name","multiple","accept"],__default__$2=vue.defineComponent({name:"ElUploadContent",inheritAttrs:!1}),_sfc_main$u=vue.defineComponent({...__default__$2,props:uploadContentProps,setup(i,{expose:n}){const r=i,g=useNamespace("upload"),k=useFormDisabled(),V=vue.shallowRef({}),$=vue.shallowRef(),oe=ue=>{if(ue.length===0)return;const{autoUpload:de,limit:Ne,fileList:he,multiple:pe,onStart:ze,onExceed:Fe}=r;if(Ne&&he.length+ue.length>Ne){Fe(ue,he);return}pe||(ue=ue.slice(0,1));for(const xe of ue){const _e=xe;_e.uid=genFileId(),ze(_e),de&&re(_e)}},re=async ue=>{if($.value.value="",!r.beforeUpload)return Ce(ue);let de,Ne={};try{const pe=r.data,ze=r.beforeUpload(ue);Ne=isObject$4(r.data)?cloneDeep(r.data):r.data,de=await ze,isObject$4(r.data)&&isEqual(pe,Ne)&&(Ne=cloneDeep(r.data))}catch{de=!1}if(de===!1){r.onRemove(ue);return}let he=ue;de instanceof Blob&&(de instanceof File?he=de:he=new File([de],ue.name,{type:ue.type})),Ce(Object.assign(he,{uid:ue.uid}),Ne)},Ce=(ue,de)=>{const{headers:Ne,data:he,method:pe,withCredentials:ze,name:Fe,action:xe,onProgress:_e,onSuccess:Dt,onError:$e,httpRequest:Ue}=r,{uid:Ve}=ue,Oe={headers:Ne||{},withCredentials:ze,file:ue,data:de??he,method:pe,filename:Fe,action:xe,onProgress:qe=>{_e(qe,ue)},onSuccess:qe=>{Dt(qe,ue),delete V.value[Ve]},onError:qe=>{$e(qe,ue),delete V.value[Ve]}},At=Ue(Oe);V.value[Ve]=At,At instanceof Promise&&At.then(Oe.onSuccess,Oe.onError)},ie=ue=>{const de=ue.target.files;de&&oe(Array.from(de))},ae=()=>{k.value||($.value.value="",$.value.click())},le=()=>{ae()};return n({abort:ue=>{entriesOf(V.value).filter(ue?([Ne])=>String(ue.uid)===Ne:()=>!0).forEach(([Ne,he])=>{he instanceof XMLHttpRequest&&he.abort(),delete V.value[Ne]})},upload:re}),(ue,de)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(g).b(),vue.unref(g).m(ue.listType),vue.unref(g).is("drag",ue.drag)]),tabindex:"0",onClick:ae,onKeydown:vue.withKeys(vue.withModifiers(le,["self"]),["enter","space"])},[ue.drag?(vue.openBlock(),vue.createBlock(UploadDragger,{key:0,disabled:vue.unref(k),onFile:oe},{default:vue.withCtx(()=>[vue.renderSlot(ue.$slots,"default")]),_:3},8,["disabled"])):vue.renderSlot(ue.$slots,"default",{key:1}),vue.createElementVNode("input",{ref_key:"inputRef",ref:$,class:vue.normalizeClass(vue.unref(g).e("input")),name:ue.name,multiple:ue.multiple,accept:ue.accept,type:"file",onChange:ie,onClick:de[0]||(de[0]=vue.withModifiers(()=>{},["stop"]))},null,42,_hoisted_2$i)],42,_hoisted_1$m))}});var UploadContent=_export_sfc$1(_sfc_main$u,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-content.vue"]]);const SCOPE="ElUpload",revokeObjectURL=i=>{var n;(n=i.url)!=null&&n.startsWith("blob:")&&URL.revokeObjectURL(i.url)},useHandlers=(i,n)=>{const r=useVModel(i,"fileList",void 0,{passive:!0}),g=le=>r.value.find(Ie=>Ie.uid===le.uid);function k(le){var Ie;(Ie=n.value)==null||Ie.abort(le)}function V(le=["ready","uploading","success","fail"]){r.value=r.value.filter(Ie=>!le.includes(Ie.status))}const $=(le,Ie)=>{const ue=g(Ie);ue&&(console.error(le),ue.status="fail",r.value.splice(r.value.indexOf(ue),1),i.onError(le,ue,r.value),i.onChange(ue,r.value))},oe=(le,Ie)=>{const ue=g(Ie);ue&&(i.onProgress(le,ue,r.value),ue.status="uploading",ue.percentage=Math.round(le.percent))},re=(le,Ie)=>{const ue=g(Ie);ue&&(ue.status="success",ue.response=le,i.onSuccess(le,ue,r.value),i.onChange(ue,r.value))},Ce=le=>{isNil(le.uid)&&(le.uid=genFileId());const Ie={name:le.name,percentage:0,status:"ready",size:le.size,raw:le,uid:le.uid};if(i.listType==="picture-card"||i.listType==="picture")try{Ie.url=URL.createObjectURL(le)}catch(ue){debugWarn(SCOPE,ue.message),i.onError(ue,Ie,r.value)}r.value=[...r.value,Ie],i.onChange(Ie,r.value)},ie=async le=>{const Ie=le instanceof File?g(le):le;Ie||throwError$1(SCOPE,"file to be removed not found");const ue=de=>{k(de);const Ne=r.value;Ne.splice(Ne.indexOf(de),1),i.onRemove(de,Ne),revokeObjectURL(de)};i.beforeRemove?await i.beforeRemove(Ie,r.value)!==!1&&ue(Ie):ue(Ie)};function ae(){r.value.filter(({status:le})=>le==="ready").forEach(({raw:le})=>{var Ie;return le&&((Ie=n.value)==null?void 0:Ie.upload(le))})}return vue.watch(()=>i.listType,le=>{le!=="picture-card"&&le!=="picture"||(r.value=r.value.map(Ie=>{const{raw:ue,url:de}=Ie;if(!de&&ue)try{Ie.url=URL.createObjectURL(ue)}catch(Ne){i.onError(Ne,Ie,r.value)}return Ie}))}),vue.watch(r,le=>{for(const Ie of le)Ie.uid||(Ie.uid=genFileId()),Ie.status||(Ie.status="success")},{immediate:!0,deep:!0}),{uploadFiles:r,abort:k,clearFiles:V,handleError:$,handleProgress:oe,handleStart:Ce,handleSuccess:re,handleRemove:ie,submit:ae}},__default__$1=vue.defineComponent({name:"ElUpload"}),_sfc_main$t=vue.defineComponent({...__default__$1,props:uploadProps,setup(i,{expose:n}){const r=i,g=vue.useSlots(),k=useFormDisabled(),V=vue.shallowRef(),{abort:$,submit:oe,clearFiles:re,uploadFiles:Ce,handleStart:ie,handleError:ae,handleRemove:le,handleSuccess:Ie,handleProgress:ue}=useHandlers(r,V),de=vue.computed(()=>r.listType==="picture-card"),Ne=vue.computed(()=>({...r,fileList:Ce.value,onStart:ie,onProgress:ue,onSuccess:Ie,onError:ae,onRemove:le}));return vue.onBeforeUnmount(()=>{Ce.value.forEach(({url:he})=>{he!=null&&he.startsWith("blob:")&&URL.revokeObjectURL(he)})}),vue.provide(uploadContextKey,{accept:vue.toRef(r,"accept")}),n({abort:$,submit:oe,clearFiles:re,handleStart:ie,handleRemove:le}),(he,pe)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.unref(de)&&he.showFileList?(vue.openBlock(),vue.createBlock(UploadList,{key:0,disabled:vue.unref(k),"list-type":he.listType,files:vue.unref(Ce),"handle-preview":he.onPreview,onRemove:vue.unref(le)},vue.createSlots({append:vue.withCtx(()=>[vue.createVNode(UploadContent,vue.mergeProps({ref_key:"uploadRef",ref:V},vue.unref(Ne)),{default:vue.withCtx(()=>[vue.unref(g).trigger?vue.renderSlot(he.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!vue.unref(g).trigger&&vue.unref(g).default?vue.renderSlot(he.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)]),_:2},[he.$slots.file?{name:"default",fn:vue.withCtx(({file:ze})=>[vue.renderSlot(he.$slots,"file",{file:ze})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0),!vue.unref(de)||vue.unref(de)&&!he.showFileList?(vue.openBlock(),vue.createBlock(UploadContent,vue.mergeProps({key:1,ref_key:"uploadRef",ref:V},vue.unref(Ne)),{default:vue.withCtx(()=>[vue.unref(g).trigger?vue.renderSlot(he.$slots,"trigger",{key:0}):vue.createCommentVNode("v-if",!0),!vue.unref(g).trigger&&vue.unref(g).default?vue.renderSlot(he.$slots,"default",{key:1}):vue.createCommentVNode("v-if",!0)]),_:3},16)):vue.createCommentVNode("v-if",!0),he.$slots.trigger?vue.renderSlot(he.$slots,"default",{key:2}):vue.createCommentVNode("v-if",!0),vue.renderSlot(he.$slots,"tip"),!vue.unref(de)&&he.showFileList?(vue.openBlock(),vue.createBlock(UploadList,{key:3,disabled:vue.unref(k),"list-type":he.listType,files:vue.unref(Ce),"handle-preview":he.onPreview,onRemove:vue.unref(le)},vue.createSlots({_:2},[he.$slots.file?{name:"default",fn:vue.withCtx(({file:ze})=>[vue.renderSlot(he.$slots,"file",{file:ze})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0)]))}});var Upload=_export_sfc$1(_sfc_main$t,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload.vue"]]);const ElUpload=withInstall(Upload),messageTypes=["success","info","warning","error"],messageDefaults=mutable({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:isClient?document.body:void 0}),messageProps=buildProps({customClass:{type:String,default:messageDefaults.customClass},center:{type:Boolean,default:messageDefaults.center},dangerouslyUseHTMLString:{type:Boolean,default:messageDefaults.dangerouslyUseHTMLString},duration:{type:Number,default:messageDefaults.duration},icon:{type:iconPropType,default:messageDefaults.icon},id:{type:String,default:messageDefaults.id},message:{type:definePropType([String,Object,Function]),default:messageDefaults.message},onClose:{type:definePropType(Function),required:!1},showClose:{type:Boolean,default:messageDefaults.showClose},type:{type:String,values:messageTypes,default:messageDefaults.type},offset:{type:Number,default:messageDefaults.offset},zIndex:{type:Number,default:messageDefaults.zIndex},grouping:{type:Boolean,default:messageDefaults.grouping},repeatNum:{type:Number,default:messageDefaults.repeatNum}}),messageEmits={destroy:()=>!0},instances$2=vue.shallowReactive([]),getInstance=i=>{const n=instances$2.findIndex(k=>k.id===i),r=instances$2[n];let g;return n>0&&(g=instances$2[n-1]),{current:r,prev:g}},getLastOffset=i=>{const{prev:n}=getInstance(i);return n?n.vm.exposed.bottom.value:0},getOffsetOrSpace=(i,n)=>instances$2.findIndex(g=>g.id===i)>0?20:n,_hoisted_1$l=["id"],_hoisted_2$h=["innerHTML"],__default__=vue.defineComponent({name:"ElMessage"}),_sfc_main$s=vue.defineComponent({...__default__,props:messageProps,emits:messageEmits,setup(i,{expose:n}){const r=i,{Close:g}=TypeComponents,{ns:k,zIndex:V}=useGlobalComponentSettings("message"),{currentZIndex:$,nextZIndex:oe}=V,re=vue.ref(),Ce=vue.ref(!1),ie=vue.ref(0);let ae;const le=vue.computed(()=>r.type?r.type==="error"?"danger":r.type:"info"),Ie=vue.computed(()=>{const Dt=r.type;return{[k.bm("icon",Dt)]:Dt&&TypeComponentsMap[Dt]}}),ue=vue.computed(()=>r.icon||TypeComponentsMap[r.type]||""),de=vue.computed(()=>getLastOffset(r.id)),Ne=vue.computed(()=>getOffsetOrSpace(r.id,r.offset)+de.value),he=vue.computed(()=>ie.value+Ne.value),pe=vue.computed(()=>({top:`${Ne.value}px`,zIndex:$.value}));function ze(){r.duration!==0&&({stop:ae}=useTimeoutFn(()=>{xe()},r.duration))}function Fe(){ae==null||ae()}function xe(){Ce.value=!1}function _e({code:Dt}){Dt===EVENT_CODE.esc&&xe()}return vue.onMounted(()=>{ze(),oe(),Ce.value=!0}),vue.watch(()=>r.repeatNum,()=>{Fe(),ze()}),useEventListener(document,"keydown",_e),useResizeObserver(re,()=>{ie.value=re.value.getBoundingClientRect().height}),n({visible:Ce,bottom:he,close:xe}),(Dt,$e)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(k).b("fade"),onBeforeLeave:Dt.onClose,onAfterLeave:$e[0]||($e[0]=Ue=>Dt.$emit("destroy")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:Dt.id,ref_key:"messageRef",ref:re,class:vue.normalizeClass([vue.unref(k).b(),{[vue.unref(k).m(Dt.type)]:Dt.type&&!Dt.icon},vue.unref(k).is("center",Dt.center),vue.unref(k).is("closable",Dt.showClose),Dt.customClass]),style:vue.normalizeStyle(vue.unref(pe)),role:"alert",onMouseenter:Fe,onMouseleave:ze},[Dt.repeatNum>1?(vue.openBlock(),vue.createBlock(vue.unref(ElBadge),{key:0,value:Dt.repeatNum,type:vue.unref(le),class:vue.normalizeClass(vue.unref(k).e("badge"))},null,8,["value","type","class"])):vue.createCommentVNode("v-if",!0),vue.unref(ue)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(k).e("icon"),vue.unref(Ie)])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(ue))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.renderSlot(Dt.$slots,"default",{},()=>[Dt.dangerouslyUseHTMLString?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),vue.createElementVNode("p",{class:vue.normalizeClass(vue.unref(k).e("content")),innerHTML:Dt.message},null,10,_hoisted_2$h)],2112)):(vue.openBlock(),vue.createElementBlock("p",{key:0,class:vue.normalizeClass(vue.unref(k).e("content"))},vue.toDisplayString(Dt.message),3))]),Dt.showClose?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(k).e("closeBtn")),onClick:vue.withModifiers(xe,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(g))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],46,_hoisted_1$l),[[vue.vShow,Ce.value]])]),_:3},8,["name","onBeforeLeave"]))}});var MessageConstructor=_export_sfc$1(_sfc_main$s,[["__file","/home/runner/work/element-plus/element-plus/packages/components/message/src/message.vue"]]);let seed=1;const normalizeOptions=i=>{const n=!i||isString$1(i)||vue.isVNode(i)||isFunction$2(i)?{message:i}:i,r={...messageDefaults,...n};if(!r.appendTo)r.appendTo=document.body;else if(isString$1(r.appendTo)){let g=document.querySelector(r.appendTo);isElement(g)||(debugWarn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),g=document.body),r.appendTo=g}return r},closeMessage=i=>{const n=instances$2.indexOf(i);if(n===-1)return;instances$2.splice(n,1);const{handler:r}=i;r.close()},createMessage=({appendTo:i,...n},r)=>{const g=`message_${seed++}`,k=n.onClose,V=document.createElement("div"),$={...n,id:g,onClose:()=>{k==null||k(),closeMessage(ie)},onDestroy:()=>{vue.render(null,V)}},oe=vue.createVNode(MessageConstructor,$,isFunction$2($.message)||vue.isVNode($.message)?{default:isFunction$2($.message)?$.message:()=>$.message}:null);oe.appContext=r||message._context,vue.render(oe,V),i.appendChild(V.firstElementChild);const re=oe.component,ie={id:g,vnode:oe,vm:re,handler:{close:()=>{re.exposed.visible.value=!1}},props:oe.component.props};return ie},message=(i={},n)=>{if(!isClient)return{close:()=>{}};if(isNumber$1(messageConfig.max)&&instances$2.length>=messageConfig.max)return{close:()=>{}};const r=normalizeOptions(i);if(r.grouping&&instances$2.length){const k=instances$2.find(({vnode:V})=>{var $;return(($=V.props)==null?void 0:$.message)===r.message});if(k)return k.props.repeatNum+=1,k.props.type=r.type,k.handler}const g=createMessage(r,n);return instances$2.push(g),g.handler};messageTypes.forEach(i=>{message[i]=(n={},r)=>{const g=normalizeOptions(n);return message({...g,type:i},r)}});function closeAll(i){for(const n of instances$2)(!i||i===n.props.type)&&n.handler.close()}message.closeAll=closeAll,message._context=null;const ElMessage=withInstallFunction(message,"$message"),_sfc_main$r=vue.defineComponent({name:"ElMessageBox",directives:{TrapFocus},components:{ElButton,ElFocusTrap,ElInput,ElOverlay,ElIcon,...TypeComponents},inheritAttrs:!1,props:{buttonSize:{type:String,validator:isValidComponentSize},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(i,{emit:n}){const{locale:r,zIndex:g,ns:k,size:V}=useGlobalComponentSettings("message-box",vue.computed(()=>i.buttonSize)),{t:$}=r,{nextZIndex:oe}=g,re=vue.ref(!1),Ce=vue.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:oe()}),ie=vue.computed(()=>{const kt=Ce.type;return{[k.bm("icon",kt)]:kt&&TypeComponentsMap[kt]}}),ae=useId(),le=useId(),Ie=vue.computed(()=>Ce.icon||TypeComponentsMap[Ce.type]||""),ue=vue.computed(()=>!!Ce.message),de=vue.ref(),Ne=vue.ref(),he=vue.ref(),pe=vue.ref(),ze=vue.ref(),Fe=vue.computed(()=>Ce.confirmButtonClass);vue.watch(()=>Ce.inputValue,async kt=>{await vue.nextTick(),i.boxType==="prompt"&&kt!==null&&Oe()},{immediate:!0}),vue.watch(()=>re.value,kt=>{var jt,ti;kt&&(i.boxType!=="prompt"&&(Ce.autofocus?he.value=(ti=(jt=ze.value)==null?void 0:jt.$el)!=null?ti:de.value:he.value=de.value),Ce.zIndex=oe()),i.boxType==="prompt"&&(kt?vue.nextTick().then(()=>{var ei;pe.value&&pe.value.$el&&(Ce.autofocus?he.value=(ei=At())!=null?ei:de.value:he.value=de.value)}):(Ce.editorErrorMessage="",Ce.validateError=!1))});const xe=vue.computed(()=>i.draggable);useDraggable(de,Ne,xe),vue.onMounted(async()=>{await vue.nextTick(),i.closeOnHashChange&&window.addEventListener("hashchange",_e)}),vue.onBeforeUnmount(()=>{i.closeOnHashChange&&window.removeEventListener("hashchange",_e)});function _e(){re.value&&(re.value=!1,vue.nextTick(()=>{Ce.action&&n("action",Ce.action)}))}const Dt=()=>{i.closeOnClickModal&&Ve(Ce.distinguishCancelAndClose?"close":"cancel")},$e=useSameTarget(Dt),Ue=kt=>{if(Ce.inputType!=="textarea")return kt.preventDefault(),Ve("confirm")},Ve=kt=>{var jt;i.boxType==="prompt"&&kt==="confirm"&&!Oe()||(Ce.action=kt,Ce.beforeClose?(jt=Ce.beforeClose)==null||jt.call(Ce,kt,Ce,_e):_e())},Oe=()=>{if(i.boxType==="prompt"){const kt=Ce.inputPattern;if(kt&&!kt.test(Ce.inputValue||""))return Ce.editorErrorMessage=Ce.inputErrorMessage||$("el.messagebox.error"),Ce.validateError=!0,!1;const jt=Ce.inputValidator;if(typeof jt=="function"){const ti=jt(Ce.inputValue);if(ti===!1)return Ce.editorErrorMessage=Ce.inputErrorMessage||$("el.messagebox.error"),Ce.validateError=!0,!1;if(typeof ti=="string")return Ce.editorErrorMessage=ti,Ce.validateError=!0,!1}}return Ce.editorErrorMessage="",Ce.validateError=!1,!0},At=()=>{const kt=pe.value.$refs;return kt.input||kt.textarea},qe=()=>{Ve("close")},Lt=()=>{i.closeOnPressEscape&&qe()};return i.lockScroll&&useLockscreen(re),{...vue.toRefs(Ce),ns:k,overlayEvent:$e,visible:re,hasMessage:ue,typeClass:ie,contentId:ae,inputId:le,btnSize:V,iconComponent:Ie,confirmButtonClasses:Fe,rootRef:de,focusStartRef:he,headerRef:Ne,inputRef:pe,confirmRef:ze,doClose:_e,handleClose:qe,onCloseRequested:Lt,handleWrapperClick:Dt,handleInputEnter:Ue,handleAction:Ve,t:$}}}),_hoisted_1$k=["aria-label","aria-describedby"],_hoisted_2$g=["aria-label"],_hoisted_3$e=["id"];function _sfc_render$1(i,n,r,g,k,V){const $=vue.resolveComponent("el-icon"),oe=vue.resolveComponent("close"),re=vue.resolveComponent("el-input"),Ce=vue.resolveComponent("el-button"),ie=vue.resolveComponent("el-focus-trap"),ae=vue.resolveComponent("el-overlay");return vue.openBlock(),vue.createBlock(vue.Transition,{name:"fade-in-linear",onAfterLeave:n[11]||(n[11]=le=>i.$emit("vanish")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createVNode(ae,{"z-index":i.zIndex,"overlay-class":[i.ns.is("message-box"),i.modalClass],mask:i.modal},{default:vue.withCtx(()=>[vue.createElementVNode("div",{role:"dialog","aria-label":i.title,"aria-modal":"true","aria-describedby":i.showInput?void 0:i.contentId,class:vue.normalizeClass(`${i.ns.namespace.value}-overlay-message-box`),onClick:n[8]||(n[8]=(...le)=>i.overlayEvent.onClick&&i.overlayEvent.onClick(...le)),onMousedown:n[9]||(n[9]=(...le)=>i.overlayEvent.onMousedown&&i.overlayEvent.onMousedown(...le)),onMouseup:n[10]||(n[10]=(...le)=>i.overlayEvent.onMouseup&&i.overlayEvent.onMouseup(...le))},[vue.createVNode(ie,{loop:"",trapped:i.visible,"focus-trap-el":i.rootRef,"focus-start-el":i.focusStartRef,onReleaseRequested:i.onCloseRequested},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"rootRef",class:vue.normalizeClass([i.ns.b(),i.customClass,i.ns.is("draggable",i.draggable),{[i.ns.m("center")]:i.center}]),style:vue.normalizeStyle(i.customStyle),tabindex:"-1",onClick:n[7]||(n[7]=vue.withModifiers(()=>{},["stop"]))},[i.title!==null&&i.title!==void 0?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"headerRef",class:vue.normalizeClass(i.ns.e("header"))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("title"))},[i.iconComponent&&i.center?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.e("status"),i.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.createElementVNode("span",null,vue.toDisplayString(i.title),1)],2),i.showClose?(vue.openBlock(),vue.createElementBlock("button",{key:0,type:"button",class:vue.normalizeClass(i.ns.e("headerbtn")),"aria-label":i.t("el.messagebox.close"),onClick:n[0]||(n[0]=le=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel")),onKeydown:n[1]||(n[1]=vue.withKeys(vue.withModifiers(le=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[vue.createVNode($,{class:vue.normalizeClass(i.ns.e("close"))},{default:vue.withCtx(()=>[vue.createVNode(oe)]),_:1},8,["class"])],42,_hoisted_2$g)):vue.createCommentVNode("v-if",!0)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{id:i.contentId,class:vue.normalizeClass(i.ns.e("content"))},[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("container"))},[i.iconComponent&&!i.center&&i.hasMessage?(vue.openBlock(),vue.createBlock($,{key:0,class:vue.normalizeClass([i.ns.e("status"),i.typeClass])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),i.hasMessage?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(i.ns.e("message"))},[vue.renderSlot(i.$slots,"default",{},()=>[i.dangerouslyUseHTMLString?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.showInput?"label":"p"),{key:1,for:i.showInput?i.inputId:void 0,innerHTML:i.message},null,8,["for","innerHTML"])):(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.showInput?"label":"p"),{key:0,for:i.showInput?i.inputId:void 0},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.dangerouslyUseHTMLString?"":i.message),1)]),_:1},8,["for"]))])],2)):vue.createCommentVNode("v-if",!0)],2),vue.withDirectives(vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("input"))},[vue.createVNode(re,{id:i.inputId,ref:"inputRef",modelValue:i.inputValue,"onUpdate:modelValue":n[2]||(n[2]=le=>i.inputValue=le),type:i.inputType,placeholder:i.inputPlaceholder,"aria-invalid":i.validateError,class:vue.normalizeClass({invalid:i.validateError}),onKeydown:vue.withKeys(i.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("errormsg")),style:vue.normalizeStyle({visibility:i.editorErrorMessage?"visible":"hidden"})},vue.toDisplayString(i.editorErrorMessage),7)],2),[[vue.vShow,i.showInput]])],10,_hoisted_3$e),vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("btns"))},[i.showCancelButton?(vue.openBlock(),vue.createBlock(Ce,{key:0,loading:i.cancelButtonLoading,class:vue.normalizeClass([i.cancelButtonClass]),round:i.roundButton,size:i.btnSize,onClick:n[3]||(n[3]=le=>i.handleAction("cancel")),onKeydown:n[4]||(n[4]=vue.withKeys(vue.withModifiers(le=>i.handleAction("cancel"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.cancelButtonText||i.t("el.messagebox.cancel")),1)]),_:1},8,["loading","class","round","size"])):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createVNode(Ce,{ref:"confirmRef",type:"primary",loading:i.confirmButtonLoading,class:vue.normalizeClass([i.confirmButtonClasses]),round:i.roundButton,disabled:i.confirmButtonDisabled,size:i.btnSize,onClick:n[5]||(n[5]=le=>i.handleAction("confirm")),onKeydown:n[6]||(n[6]=vue.withKeys(vue.withModifiers(le=>i.handleAction("confirm"),["prevent"]),["enter"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.confirmButtonText||i.t("el.messagebox.confirm")),1)]),_:1},8,["loading","class","round","disabled","size"]),[[vue.vShow,i.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,_hoisted_1$k)]),_:3},8,["z-index","overlay-class","mask"]),[[vue.vShow,i.visible]])]),_:3})}var MessageBoxConstructor=_export_sfc$1(_sfc_main$r,[["render",_sfc_render$1],["__file","/home/runner/work/element-plus/element-plus/packages/components/message-box/src/index.vue"]]);const messageInstance=new Map,getAppendToElement=i=>{let n=document.body;return i.appendTo&&(isString$1(i.appendTo)&&(n=document.querySelector(i.appendTo)),isElement(i.appendTo)&&(n=i.appendTo),isElement(n)||(debugWarn("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),n=document.body)),n},initInstance=(i,n,r=null)=>{const g=vue.createVNode(MessageBoxConstructor,i,isFunction$2(i.message)||vue.isVNode(i.message)?{default:isFunction$2(i.message)?i.message:()=>i.message}:null);return g.appContext=r,vue.render(g,n),getAppendToElement(i).appendChild(n.firstElementChild),g.component},genContainer=()=>document.createElement("div"),showMessage=(i,n)=>{const r=genContainer();i.onVanish=()=>{vue.render(null,r),messageInstance.delete(k)},i.onAction=V=>{const $=messageInstance.get(k);let oe;i.showInput?oe={value:k.inputValue,action:V}:oe=V,i.callback?i.callback(oe,g.proxy):V==="cancel"||V==="close"?i.distinguishCancelAndClose&&V!=="cancel"?$.reject("close"):$.reject("cancel"):$.resolve(oe)};const g=initInstance(i,r,n),k=g.proxy;for(const V in i)hasOwn$1(i,V)&&!hasOwn$1(k.$props,V)&&(k[V]=i[V]);return k.visible=!0,k};function MessageBox(i,n=null){if(!isClient)return Promise.reject();let r;return isString$1(i)||vue.isVNode(i)?i={message:i}:r=i.callback,new Promise((g,k)=>{const V=showMessage(i,n??MessageBox._context);messageInstance.set(V,{options:i,callback:r,resolve:g,reject:k})})}const MESSAGE_BOX_VARIANTS=["alert","confirm","prompt"],MESSAGE_BOX_DEFAULT_OPTS={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};MESSAGE_BOX_VARIANTS.forEach(i=>{MessageBox[i]=messageBoxFactory(i)});function messageBoxFactory(i){return(n,r,g,k)=>{let V="";return isObject$4(r)?(g=r,V=""):isUndefined(r)?V="":V=r,MessageBox(Object.assign({title:V,message:n,type:"",...MESSAGE_BOX_DEFAULT_OPTS[i]},g,{boxType:i}),k)}}MessageBox.close=()=>{messageInstance.forEach((i,n)=>{n.doClose()}),messageInstance.clear()},MessageBox._context=null;const _MessageBox=MessageBox;_MessageBox.install=i=>{_MessageBox._context=i._context,i.config.globalProperties.$msgbox=_MessageBox,i.config.globalProperties.$messageBox=_MessageBox,i.config.globalProperties.$alert=_MessageBox.alert,i.config.globalProperties.$confirm=_MessageBox.confirm,i.config.globalProperties.$prompt=_MessageBox.prompt};const ElMessageBox=_MessageBox,index$3="",animate="";var ELineBindAnchors=(i=>(i.TopCenter="TopCenter",i.Left="Left",i.Right="Right",i.BottomCenter="BottomCenter",i))(ELineBindAnchors||{}),EConfigAnimationsType=(i=>(i.None="None",i.Electricity="Electricity",i.WaterDrop="WaterDrop",i.Track="Track",i))(EConfigAnimationsType||{}),EConfigItemPropsType=(i=>(i.Input="Input",i.Color="Color",i.InputNumber="InputNumber",i.Switch="Switch",i.JsonEdit="JsonEdit",i.Select="Select",i))(EConfigItemPropsType||{}),EDoneJsonType=(i=>(i.File="File",i.StraightLine="StraightLine",i.ConnectionLine="ConnectionLine",i.CustomSvg="CustomSvg",i.Vue="Vue",i))(EDoneJsonType||{}),EEventType=(i=>(i.Click="Click",i.Change="Change",i.Null="",i))(EEventType||{}),EEventAction=(i=>(i.ChangeAttr="ChangeAttr",i.JavaScript="JavaScript",i.Null="",i))(EEventAction||{}),EConditionType=(i=>(i.None="None",i.Relation="Relation",i))(EConditionType||{});const randomString=i=>{i=i||10;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=n.length;let g="";for(let k=0;k<i;k++){let V=r;k===0&&(V=r-10),g+=n.charAt(Math.floor(Math.random()*V))}return g},isOfType=(i,n)=>i[n]!==void 0,getCoordinateOffset=(i,n)=>i/2*(n-1),angleToRadian=i=>i*Math.PI/180,calculateRotatedPointCoordinate=(i,n,r)=>({x:(i.x-n.x)*Math.cos(angleToRadian(r))-(i.y-n.y)*Math.sin(angleToRadian(r))+n.x,y:(i.x-n.x)*Math.sin(angleToRadian(r))+(i.y-n.y)*Math.cos(angleToRadian(r))+n.y}),getCenterPoint=(i,n)=>({x:i.x+(n.x-i.x)/2,y:i.y+(n.y-i.y)/2}),positionArrToPath=i=>{let n="";for(let r=0;r<i.length;r++)r===0?n+=`M ${i[r].x} ${i[r].y}`:n+=` L ${i[r].x} ${i[r].y}`;return n},getSvgNowPosition=(i,n,r)=>r+(n-i),objectDeepClone=(i,n={})=>i?JSON.parse(JSON.stringify(i)):n,setSvgActualInfo=(i,n)=>{const r=document.querySelector(`#${i.id}`),g=document.querySelector(`#rect${i.id}`);if(r){let k=0,V=0,$=0,oe=0;if(i.type!==EDoneJsonType.Vue){const re=r.getBBox();console.log(re),k=re.x,V=re.y,$=re.width,oe=re.height}else{$=r.offsetWidth,oe=r.offsetHeight,$=$===0?100:$,oe=oe===0?100:oe,k=50-$/2,V=50-oe/2;const re=document.querySelector(`#foreign-object${i.id}`);re&&re.getAttribute("x")==="0"&&re.getAttribute("y")==="0"&&re.getAttribute("width")==="0"&&re.getAttribute("height")==="0"&&(re.setAttribute("x",k.toString()),re.setAttribute("y",V.toString()),re.setAttribute("width",$.toString()),re.setAttribute("height",oe.toString()))}g&&g.getAttribute("x")==="0"&&g.getAttribute("y")==="0"&&g.getAttribute("width")==="0"&&g.getAttribute("height")==="0"&&(g.setAttribute("x",k.toString()),g.setAttribute("y",V.toString()),g.setAttribute("width",$.toString()),g.setAttribute("height",oe.toString())),(i.actual_bound.x===0&&i.actual_bound.y===0&&i.actual_bound.width===0&&i.actual_bound.height===0||n)&&(i.actual_bound={x:k,y:V,width:$,height:oe}),i.point_coordinate.tl={x:i.x-$*i.scale_x/2,y:i.y-oe*i.scale_y/2},i.point_coordinate.tc={x:i.x,y:i.y-oe*i.scale_y/2},i.point_coordinate.tr={x:i.x+$*i.scale_x/2,y:i.y-oe*i.scale_y/2},i.point_coordinate.l={x:i.x-$*i.scale_x/2,y:i.y},i.point_coordinate.r={x:i.x+$*i.scale_x/2,y:i.y},i.point_coordinate.bl={x:i.x-$*i.scale_x/2,y:i.y+oe*i.scale_y/2},i.point_coordinate.bc={x:i.x,y:i.y+oe*i.scale_y/2},i.point_coordinate.br={x:i.x+$*i.scale_x/2,y:i.y+oe*i.scale_y/2},i.rotate!==0&&setAfterRotationPointCoordinate(i)}},getAnchorPosByAnchorType=(i,n)=>i===ELineBindAnchors.BottomCenter?n.point_coordinate.bc:i===ELineBindAnchors.Left?n.point_coordinate.l:i===ELineBindAnchors.Right?n.point_coordinate.r:n.point_coordinate.tc,setAfterRotationPointCoordinate=i=>{i.point_coordinate={tl:calculateRotatedPointCoordinate(i.point_coordinate.tl,{x:i.x,y:i.y},i.rotate),tc:calculateRotatedPointCoordinate(i.point_coordinate.tc,{x:i.x,y:i.y},i.rotate),tr:calculateRotatedPointCoordinate(i.point_coordinate.tr,{x:i.x,y:i.y},i.rotate),l:calculateRotatedPointCoordinate(i.point_coordinate.l,{x:i.x,y:i.y},i.rotate),r:calculateRotatedPointCoordinate(i.point_coordinate.r,{x:i.x,y:i.y},i.rotate),bl:calculateRotatedPointCoordinate(i.point_coordinate.bl,{x:i.x,y:i.y},i.rotate),bc:calculateRotatedPointCoordinate(i.point_coordinate.bc,{x:i.x,y:i.y},i.rotate),br:calculateRotatedPointCoordinate(i.point_coordinate.br,{x:i.x,y:i.y},i.rotate)}},prosToVBind=i=>{var r,g,k,V;let n={};if(i.state){for(const $ in i.state)if($==="OnOff")for(const oe in(r=i.state[$])==null?void 0:r.props)n={...n,[oe]:(g=i.state[$])!=null&&g.default?(k=i.state[$])==null?void 0:k.props[oe].openVal:(V=i.state[$])==null?void 0:V.props[oe].closeVal}}for(const $ in i.props)n={...n,[$]:i.props[$].val};return n},setArrItemByID=(id,key,val,json_arr)=>new Promise(res=>{const find_item=json_arr.find(i=>i.id===id);find_item||res({status:!1,msg:"要设置的id不存在"}),eval(`find_item.${key} = val;`),res({status:!0,msg:"操作成功"})}),getCommonClass=i=>!i.common_animations||!i.common_animations.val?"":`common-ani animate__animated animate__${i.common_animations.val} animate__${i.common_animations.speed} animate__${i.common_animations.repeat} animate__${i.common_animations.delay}`,numberArray=i=>{let n=[];for(let r=0;r<i;r++)n.push(r);return n},getStringWidth=(i,n=12)=>{if(i.length>0){let r=document.createElement("span");r.style.fontSize=n+"px",r.style.fontFamily="inherit",r.innerHTML=i,r.style.opacity="0",r.style.position="fixed",r.style.top="3000px",document.body.append(r);const g=r.clientWidth;return document.body.removeChild(r),g}return 0},valFormat=i=>/false|true/.test(i)?i!=="false":/^\d+(\.\d+)?$/.test(i)?Number(i):i,straight_line_system=Object.seal({name:"straight-line",title:"直线",type:EDoneJsonType.StraightLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"},start_x:{title:"起点x坐标",type:EConfigItemPropsType.InputNumber,val:0},start_y:{title:"起点y坐标",type:EConfigItemPropsType.InputNumber,val:0},end_x:{title:"终点x坐标",type:EConfigItemPropsType.InputNumber,val:0},end_y:{title:"终点y坐标",type:EConfigItemPropsType.InputNumber,val:0}},bind_anchors:{start:null,end:null},events:[]}),connection_line_system={name:"connection_line",title:"连接线",type:EDoneJsonType.ConnectionLine,config:{can_zoom:!1,have_anchor:!1,actual_rect:!1},display:!0,props:{stroke:{title:"线条颜色",type:EConfigItemPropsType.Color,val:"#ff0000"},"stroke-width":{title:"线条宽度",type:EConfigItemPropsType.InputNumber,val:2},point_position:{title:"点坐标",type:EConfigItemPropsType.JsonEdit,val:[]}},animations:{type:{title:"动画类型",type:EConfigItemPropsType.Select,val:EConfigAnimationsType.None,options:[{label:"无",value:EConfigAnimationsType.None},{label:"电流",value:EConfigAnimationsType.Electricity},{label:"轨迹",value:EConfigAnimationsType.Track},{label:"水珠",value:EConfigAnimationsType.WaterDrop}]},dur:{title:"持续时间",type:EConfigItemPropsType.InputNumber,val:20},repeatCount:{title:"循环次数",type:EConfigItemPropsType.Input,val:"indefinite",disabled:!0},color:{title:"颜色",type:EConfigItemPropsType.Color,val:"#0a7ae2"},reverse:{title:"反转动画",type:EConfigItemPropsType.Switch,val:!1}},bind_anchors:{start:null,end:null},events:[]},common_animate_list=[{label:"进入",children:[{label:"渐显",value:"fadeIn"},{label:"向右进入",value:"fadeInLeft"},{label:"向左进入",value:"fadeInRight"},{label:"向上进入",value:"fadeInUp"},{label:"向下进入",value:"fadeInDown"},{label:"向右长距进入",value:"fadeInLeftBig"},{label:"向左长距进入",value:"fadeInRightBig"},{label:"向上长距进入",value:"fadeInUpBig"},{label:"向下长距进入",value:"fadeInDownBig"},{label:"旋转进入",value:"rotateIn"},{label:"左顺时针旋转",value:"rotateInDownLeft"},{label:"右逆时针旋转",value:"rotateInDownRight"},{label:"左逆时针旋转",value:"rotateInUpLeft"},{label:"右逆时针旋转",value:"rotateInUpRight"},{label:"弹入",value:"bounceIn"},{label:"向右弹入",value:"bounceInLeft"},{label:"向左弹入",value:"bounceInRight"},{label:"向上弹入",value:"bounceInUp"},{label:"向下弹入",value:"bounceInDown"},{label:"光速从右进入",value:"lightSpeedInRight"},{label:"光速从左进入",value:"lightSpeedInLeft"},{label:"光速从右退出",value:"lightSpeedOutRight"},{label:"光速从左退出",value:"lightSpeedOutLeft"},{label:"Y轴旋转",value:"flip"},{label:"中心X轴旋转",value:"flipInX"},{label:"中心Y轴旋转",value:"flipInY"},{label:"左长半径旋转",value:"rollIn"},{label:"由小变大进入",value:"zoomIn"},{label:"左变大进入",value:"zoomInLeft"},{label:"右变大进入",value:"zoomInRight"},{label:"向上变大进入",value:"zoomInUp"},{label:"向下变大进入",value:"zoomInDown"},{label:"向右滑动展开",value:"slideInLeft"},{label:"向左滑动展开",value:"slideInRight"},{label:"向上滑动展开",value:"slideInUp"},{label:"向下滑动展开",value:"slideInDown"}]},{label:"强调",children:[{label:"弹跳",value:"bounce"},{label:"闪烁",value:"flash"},{label:"放大缩小",value:"pulse"},{label:"放大缩小弹簧",value:"rubberBand"},{label:"左右晃动",value:"headShake"},{label:"左右扇形摇摆",value:"swing"},{label:"放大晃动缩小",value:"tada"},{label:"扇形摇摆",value:"wobble"},{label:"左右上下晃动",value:"jello"},{label:"Y轴旋转",value:"flip"}]},{label:"退出",children:[{label:"渐隐",value:"fadeOut"},{label:"向左退出",value:"fadeOutLeft"},{label:"向右退出",value:"fadeOutRight"},{label:"向上退出",value:"fadeOutUp"},{label:"向下退出",value:"fadeOutDown"},{label:"向左长距退出",value:"fadeOutLeftBig"},{label:"向右长距退出",value:"fadeOutRightBig"},{label:"向上长距退出",value:"fadeOutUpBig"},{label:"向下长距退出",value:"fadeOutDownBig"},{label:"旋转退出",value:"rotateOut"},{label:"左顺时针旋转",value:"rotateOutDownLeft"},{label:"右逆时针旋转",value:"rotateOutDownRight"},{label:"左逆时针旋转",value:"rotateOutUpLeft"},{label:"右逆时针旋转",value:"rotateOutUpRight"},{label:"弹出",value:"bounceOut"},{label:"向左弹出",value:"bounceOutLeft"},{label:"向右弹出",value:"bounceOutRight"},{label:"向上弹出",value:"bounceOutUp"},{label:"向下弹出",value:"bounceOutDown"},{label:"中心X轴旋转",value:"flipOutX"},{label:"中心Y轴旋转",value:"flipOutY"},{label:"左长半径旋转",value:"rollOut"},{label:"由小变大退出",value:"zoomOut"},{label:"左变大退出",value:"zoomOutLeft"},{label:"右变大退出",value:"zoomOutRight"},{label:"向上变大退出",value:"zoomOutUp"},{label:"向下变大退出",value:"zoomOutDown"},{label:"向左滑动收起",value:"slideOutLeft"},{label:"向右滑动收起",value:"slideOutRight"},{label:"向上滑动收起",value:"slideOutUp"},{label:"向下滑动收起",value:"slideOutDown"}]}];let l=localStorage.getItem("svg-editor-config"),s,t;if(l){let i=JSON.parse(l);t=i.connection_line,s=i.svg}else t=objectDeepClone(connection_line_system),s={background_color:"#fff",scale:1,position_center:{x:-333,y:-113},svg_position_center:{x:50,y:50},grid:!0,ruler:!0};const useConfigStore=pinia$1.defineStore("config-store",{state:()=>({svg:s,connection_line:t,net:{mqtt:{url:"",user:"",pwd:"",topics:""}}}),getters:{},actions:{}}),circuit_breaker_svg_file={name:"circuit-breaker",title:"断路器",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},state:{OnOff:{title:"开关",default:!1,props:{fill:{openVal:"#00ff00",closeVal:"#ff0000"},"fill-opacity":{openVal:"0",closeVal:"1"}}}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateful_group={groupType:"stateful",title:"状态图标",list:[circuit_breaker_svg_file]},alternator_svg_file={name:"alternator",title:"发电机",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#00ff00"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},traction_transformer_svg_file={name:"traction-transformer",title:"牵引变",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"填充色",type:EConfigItemPropsType.Color,val:"#ff0000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_house={name:"house",title:"房子",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_car={name:"car",title:"轿车",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_hospital={name:"hospital",title:"医院",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_package={name:"package",title:"组装线",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_2={name:"bot-2",title:"2号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_3={name:"bot-3",title:"3号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_7={name:"bot-7",title:"7号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_9={name:"bot-9",title:"9号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},svg_bot_12={name:"bot-12",title:"12号机",type:EDoneJsonType.File,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateless_group={groupType:"stateless",title:"静态图标",list:[alternator_svg_file,traction_transformer_svg_file,svg_house,svg_car,svg_hospital,svg_package,svg_bot_2,svg_bot_3,svg_bot_7,svg_bot_9,svg_bot_12]},reservoir={name:"reservoir",title:"蓄水池",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{fill:{title:"水流颜色",type:EConfigItemPropsType.Color,val:"#37cfe7"},stroke:{title:"边框颜色",type:EConfigItemPropsType.Color,val:"#000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},animation_group={groupType:"have_animation",title:"动画图标",list:[reservoir]},svg_text={name:"svg-text",title:"文字",tag:"svg-text",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{text:{title:"文字内容",type:EConfigItemPropsType.Input,val:"文字"},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:15},fill:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},switch_a={name:"switch-a",title:"开关",tag:"switch-a",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!0}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},light_a={name:"light",tag:"light-a",title:"灯",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},clock_a={name:"clock-a",title:"时钟",tag:"clock-a",type:EDoneJsonType.CustomSvg,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},custom_svg_group={groupType:"custom_svg_group",title:"SVG组件",list:[svg_text,switch_a,light_a,clock_a]},svg_config=Object.seal([stateless_group,stateful_group,animation_group,custom_svg_group]),el_button={name:"el-button",tag:"el-button",title:"按钮",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},type:{title:"类型",type:EConfigItemPropsType.Select,val:"primary",options:[{label:"主要按钮",value:"primary"},{label:"成功按钮",value:"success"},{label:"警告按钮",value:"warning"},{label:"危险按钮",value:"danger"},{label:"信息按钮",value:"info"}]},plain:{title:"朴素按钮",type:EConfigItemPropsType.Switch,val:!1},text:{title:"文字按钮",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"按钮",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},common_table={name:"common-table",title:"通用表格",tag:"common-table",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{"col-config":{title:"列配置",type:EConfigItemPropsType.JsonEdit,val:[{prop:"date",label:"第一列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"name",label:"第二列",width:"120px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1},{prop:"address",label:"第三列测试",width:"280px",fixed:!1,sortable:!1,"show-overflow-tooltip":!1}]},data:{title:"表格数据",type:EConfigItemPropsType.JsonEdit,val:[{date:"2016-05-03",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-02",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-04",name:"Tom",address:"No. 189, Grove St, Los Angeles"},{date:"2016-05-01",name:"Tom",address:"No. 189, Grove St, Los Angeles"}]},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:null},"max-height":{title:"最大高度",type:EConfigItemPropsType.InputNumber,val:null},stripe:{title:"斑马纹",type:EConfigItemPropsType.Switch,val:!1},border:{title:"纵向边框",type:EConfigItemPropsType.Switch,val:!1},size:{title:"尺寸",type:EConfigItemPropsType.Select,val:"default",options:[{label:"大",value:"large"},{label:"默认",value:"default"},{label:"小",value:"small"}]},fit:{title:"列宽自撑开",type:EConfigItemPropsType.Switch,val:!1}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},now_time={name:"now-time",title:"当前时间",tag:"now-time",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!1,actual_rect:!0},display:!0,props:{fontColor:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000000"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},el_tag={name:"el-tag",tag:"el-tag",title:"标签",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{type:{title:"类型",type:EConfigItemPropsType.Select,val:"success",options:[{label:"成功",value:"success"},{label:"警告",value:"warning"},{label:"危险",value:"danger"},{label:"信息",value:"info"}]},closable:{title:"可关闭",type:EConfigItemPropsType.Switch,val:!0},"disable-transitions":{title:"渐变",type:EConfigItemPropsType.Switch,val:!1}},tag_slot:"标签",common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},progress_a={name:"progress-a",tag:"progress-a",title:"进度条",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{percentage:{title:"进度",type:EConfigItemPropsType.InputNumber,val:10}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},components={groupType:"custom-vue",title:"VUE组件",list:[el_button,progress_a,common_table,now_time,el_tag]},pie_charts={name:"pie-charts",tag:"pie-charts",title:"饼图",type:EDoneJsonType.Vue,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{title:{title:"标题",type:EConfigItemPropsType.Input,val:"默认标题"},seriesName:{title:"详情",type:EConfigItemPropsType.Input,val:"详情标题"},seriesData:{title:"legendData",type:EConfigItemPropsType.JsonEdit,val:[{value:1048,name:"办公楼A"},{value:735,name:"办公楼B"},{value:580,name:"保安室"},{value:484,name:"地下车库"},{value:300,name:"食堂"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},echarts_group={groupType:"echarts",title:"图表",list:[pie_charts]},vue_config=Object.seal([components,echarts_group]),_sfc_main$q=vue.defineComponent({__name:"progress",props:{percentage:{default:10}},emits:["onChange"],setup(i,{emit:n}){const r=i,g=[{color:"#f56c6c",percentage:20},{color:"#e6a23c",percentage:40},{color:"#5cb87a",percentage:60},{color:"#1989fa",percentage:80},{color:"#6f7ad3",percentage:100}];return vue.watch(()=>r.percentage,()=>{n("onChange")}),(k,V)=>(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{type:"dashboard",percentage:Number(r.percentage),color:g},null,8,["percentage"]))}}),_hoisted_1$j=["id"],_hoisted_2$f=["id"],_hoisted_3$d=vue.createElementVNode("path",{d:"M735.2 792.4H287.6C136.9 792.4 14.2 669.8 14.2 519c0-150.9 122.6-273.5 273.4-273.5h447.6c150.7 0 273.4 122.6 273.4 273.4 0 150.9-122.7 273.5-273.4 273.5zM287.6 300.2c-120.6 0-218.7 98.1-218.7 218.7 0 120.8 98.1 218.9 218.7 218.9h447.6c120.6 0 218.7-98.1 218.7-218.7 0-120.8-98.1-218.9-218.7-218.9H287.6z",fill:"#666666"},null,-1),_hoisted_4$a=vue.createElementVNode("path",{d:"M724.7 687.1c-92.7 0-168.1-75.4-168.1-168.1S632 350.9 724.7 350.9 892.8 426.3 892.8 519s-75.4 168.1-168.1 168.1z m0-278.6c-60.9 0-110.5 49.6-110.5 110.5s49.5 110.5 110.5 110.5S835.1 579.9 835.1 519s-49.5-110.5-110.4-110.5z",fill:"#666666"},null,-1),_hoisted_5$9=[_hoisted_3$d,_hoisted_4$a],_hoisted_6$6=["id"],_hoisted_7$6=vue.createElementVNode("path",{d:"M704 224H320C161.216 224 32 353.216 32 512c0 158.816 129.216 288 288 288h384c158.816 0 288-129.184 288-288 0-158.784-129.184-288-288-288z m0 512H320C196.48 736 96 635.488 96 512c0-123.52 100.48-224 224-224h384c123.488 0 224 100.48 224 224 0 123.488-100.512 224-224 224z"},null,-1),_hoisted_8$5=vue.createElementVNode("path",{d:"M320 320c-105.888 0-192 86.112-192 192s86.112 192 192 192 192-86.112 192-192-86.112-192-192-192z m0 320c-70.592 0-128-57.408-128-128s57.408-128 128-128 128 57.408 128 128-57.408 128-128 128z"},null,-1),_hoisted_9$4=[_hoisted_7$6,_hoisted_8$5],_hoisted_10$4=["xlink:href"],_hoisted_11$4=["xlink:href"],_sfc_main$p=vue.defineComponent({__name:"switch-a",props:{id:{type:String,default:""},isOpen:{type:Boolean,default:!0}},emits:["onChange"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.isOpen,()=>{n("onChange")}),(g,k)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id},[vue.createElementVNode("symbol",{viewBox:"0 0 1024 1024",id:`${r.id}switch-demo-open`},_hoisted_5$9,8,_hoisted_2$f),vue.createElementVNode("symbol",{viewBox:"0 0 1024 1024",id:`${r.id}switch-demo-close`},_hoisted_9$4,8,_hoisted_6$6),r.isOpen?(vue.openBlock(),vue.createElementBlock("use",{key:0,"xlink:href":`#${r.id}switch-demo-open`,width:"100",height:"100"},null,8,_hoisted_10$4)):(vue.openBlock(),vue.createElementBlock("use",{key:1,"xlink:href":`#${r.id}switch-demo-close`,width:"100",height:"100"},null,8,_hoisted_11$4))],8,_hoisted_1$j))}}),_hoisted_1$i=["font-family","font-size","fill"],_sfc_main$o=vue.defineComponent({__name:"svg-text",props:{fontFamily:{type:String,default:""},fontSize:{type:Number,default:15},text:{type:String,default:""},fill:{type:String,default:""}},emits:["resize"],setup(i,{emit:n}){const r=i;return vue.watch(()=>[r.text,r.fontSize,r.fontFamily],()=>{vue.nextTick(function(){n("resize")})}),(g,k)=>(vue.openBlock(),vue.createElementBlock("text",{x:"50",y:"55","font-family":r.fontFamily,"font-size":r.fontSize,fill:r.fill},vue.toDisplayString(r.text),9,_hoisted_1$i))}}),_sfc_main$n=vue.defineComponent({__name:"common-table",props:{colConfig:{default:()=>[]},data:{default:()=>[]},height:{},maxHeight:{},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1},size:{},fit:{type:Boolean,default:!1},operateDisplay:{type:Boolean,default:!1},selectionData:{default:()=>[]}},setup(i){const n=i,r=vue.ref({});return vue.watchEffect(()=>{const{colConfig:g,...k}=n;r.value=k}),(g,k)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTable),vue.normalizeProps(vue.guardReactiveProps(r.value)),{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.colConfig,V=>(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),vue.mergeProps({key:V.prop},V),null,16))),128))]),_:1},16))}}),_hoisted_1$h={class:"flex mt-5px"},_sfc_main$m=vue.defineComponent({__name:"now-time",props:{fontColor:{type:String,default:"#000000"}},setup(i){const n=i,r=vue.ref(new Date),g=vue.ref(),k=vue.computed(()=>{const oe=r.value.getFullYear(),re=r.value.getMonth()+1,Ce=r.value.getDate();return oe.toString()+"年"+re.toString()+"月"+Ce.toString()+"日"}),V=vue.computed(()=>{const oe=r.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][oe]}),$=vue.computed(()=>{const oe=r.value.getHours(),re=r.value.getMinutes(),Ce=r.value.getSeconds();return(oe<10?"0"+oe.toString():oe.toString())+":"+(re<10?"0"+re.toString():re.toString())+":"+(Ce<10?"0"+Ce.toString():Ce.toString())});return vue.onMounted(()=>{g.value=setInterval(()=>{r.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(g.value)}),(oe,re)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createElementVNode("div",{class:"text-12px font-bold",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString(k.value),5),vue.createElementVNode("div",_hoisted_1$h,[vue.createElementVNode("div",{class:"text-12px font-bold",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString(V.value),5),vue.createElementVNode("div",{class:"text-12px font-bold ml-5px",style:vue.normalizeStyle({color:n.fontColor})},vue.toDisplayString($.value),5)])]))}});/*! *****************************************************************************
293
293
  Copyright (c) Microsoft Corporation.
294
294
 
295
295
  Permission to use, copy, modify, and/or distribute this software for any
@@ -350,8 +350,8 @@ echarts.use([`+At+"]);":"Unknown series "+Oe))}return}if(ae==="tooltip"){if(ze){
350
350
  if (customElements.get(tag) == null) {
351
351
  customElements.define(tag, EChartsElement);
352
352
  }
353
- `)("x-vue-echarts")}catch{return w=!1}return w=!0}(),U="ecTheme",S=vue.defineComponent({name:"echarts",props:O(O({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},_),L),emits:{},inheritAttrs:!1,setup:function(i,n){var r=n.attrs,g=vue.shallowRef(),k=vue.shallowRef(),V=vue.shallowRef(),$=vue.inject("ecTheme",null),oe=vue.inject("ecInitOptions",null),re=vue.inject("ecUpdateOptions",null),Ce=vue.toRefs(i),ie=Ce.autoresize,ae=Ce.manualUpdate,le=Ce.loading,Ie=Ce.loadingOptions,ue=vue.computed(function(){return V.value||i.option||null}),de=vue.computed(function(){return i.theme||j($,{})}),Ne=vue.computed(function(){return i.initOptions||j(oe,{})}),he=vue.computed(function(){return i.updateOptions||j(re,{})}),pe=vue.computed(function(){return function($e){var Ue={};for(var Ve in $e)x(Ve)||(Ue[Ve]=$e[Ve]);return Ue}(r)}),ze=vue.getCurrentInstance().proxy.$listeners;function Fe($e){if(g.value){var Ue=k.value=init(g.value,de.value,Ne.value);i.group&&(Ue.group=i.group);var Ve=ze;Ve||(Ve={},Object.keys(r).filter(function(At){return At.indexOf("on")===0&&At.length>2}).forEach(function(At){var qe=At.charAt(2).toLowerCase()+At.slice(3);qe.substring(qe.length-4)==="Once"&&(qe="~".concat(qe.substring(0,qe.length-4))),Ve[qe]=r[At]})),Object.keys(Ve).forEach(function(At){var qe=Ve[At];if(qe){var Lt=At.toLowerCase();Lt.charAt(0)==="~"&&(Lt=Lt.substring(1),qe.__once__=!0);var kt=Ue;if(Lt.indexOf("zr:")===0&&(kt=Ue.getZr(),Lt=Lt.substring(3)),qe.__once__){delete qe.__once__;var jt=qe;qe=function(){for(var ti=[],ei=0;ei<arguments.length;ei++)ti[ei]=arguments[ei];jt.apply(void 0,ti),kt.off(Lt,qe)}}kt.on(Lt,qe)}}),ie.value?vue.nextTick(function(){Ue&&!Ue.isDisposed()&&Ue.resize(),Oe()}):Oe()}function Oe(){var At=$e||ue.value;At&&Ue.setOption(At,he.value)}}function xe(){k.value&&(k.value.dispose(),k.value=void 0)}var _e=null;vue.watch(ae,function($e){typeof _e=="function"&&(_e(),_e=null),$e||(_e=vue.watch(function(){return i.option},function(Ue,Ve){Ue&&(k.value?k.value.setOption(Ue,O({notMerge:Ue.value!==(Ve==null?void 0:Ve.value)},he.value)):Fe())},{deep:!0}))},{immediate:!0}),vue.watch([de,Ne],function(){xe(),Fe()},{deep:!0}),vue.watchEffect(function(){i.group&&k.value&&(k.value.group=i.group)});var Dt=y(k);return function($e,Ue,Ve){var Oe=vue.inject("ecLoadingOptions",{}),At=vue.computed(function(){return O(O({},j(Oe,{})),Ve==null?void 0:Ve.value)});vue.watchEffect(function(){var qe=$e.value;qe&&(Ue.value?qe.showLoading(At.value):qe.hideLoading())})}(k,le,Ie),function($e,Ue,Ve){var Oe=null;vue.watch([Ve,$e,Ue],function(At,qe,Lt){var kt=At[0],jt=At[1],ti=At[2];kt&&jt&&ti&&(Oe=throttle$1(function(){jt.resize()},100),addListener(kt,Oe)),Lt(function(){Oe&&kt&&removeListener(kt,Oe)})})}(k,ie,g),vue.onMounted(function(){Fe()}),vue.onBeforeUnmount(function(){T&&g.value?g.value.__dispose=xe:xe()}),O({chart:k,root:g,setOption:function($e,Ue){i.manualUpdate&&(V.value=$e),k.value?k.value.setOption($e,Ue||{}):Fe($e)},nonEventAttrs:pe},Dt)},render:function(){var i=O({},this.nonEventAttrs);return i.ref="root",i.class=i.class?["echarts"].concat(i.class):"echarts",vue.h("x-vue-echarts",i)}});const _sfc_main$l=vue.defineComponent({__name:"pie-charts",props:{title:{type:String,default:"标题"},seriesName:{type:String,default:"详情"},seriesData:{type:Array,default:()=>[]}},setup(i){const n=i;use([install$7,install$6,install$3,install$4,install]),vue.provide(U,"dark");const r=vue.reactive({title:{text:n.title,left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:n.seriesName,type:"pie",radius:"55%",center:["50%","60%"],data:n.seriesData,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]});return vue.watch(n,g=>{r.title.text=g.title,r.series[0].name=g.seriesName,r.series[0].data=g.seriesData}),(g,k)=>(vue.openBlock(),vue.createBlock(vue.unref(S),{class:"chart",option:r,autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_702730c3_lang="",_export_sfc=(i,n)=>{const r=i.__vccOpts||i;for(const[g,k]of n)r[g]=k;return r},PieCharts=_export_sfc(_sfc_main$l,[["__scopeId","data-v-702730c3"]]),_hoisted_1$g=["id"],_hoisted_2$e=["id"],_hoisted_3$c=["fill"],_hoisted_4$9=["fill"],_hoisted_5$8=["fill"],_hoisted_6$5=vue.createElementVNode("path",{d:"M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",fill:"#2D4375"},null,-1),_hoisted_7$5=vue.createElementVNode("path",{d:"M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z",fill:"#1E2D4F"},null,-1),_hoisted_8$4=["fill-opacity"],_hoisted_9$3=["fill-opacity"],_hoisted_10$3=["fill-opacity"],_hoisted_11$3=vue.createElementVNode("path",{d:"M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z",fill:"#CEEFF6"},null,-1),_hoisted_12$1=vue.createElementVNode("path",{d:"M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z",fill:"#FFFFFF"},null,-1),_hoisted_13$1=vue.createElementVNode("path",{d:"M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",fill:"#CEEFF6"},null,-1),_hoisted_14$1=["xlink:href"],_sfc_main$k=vue.defineComponent({__name:"light-a",props:{id:{default:""},isOpen:{type:Boolean,default:!1}},emits:["onChange"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.isOpen,()=>{n("onChange")}),(g,k)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id,style:{cursor:"pointer"}},[vue.createElementVNode("symbol",{id:`${r.id}light-121`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z",fill:r.isOpen?"#FDB813":"#cccccc"},null,8,_hoisted_3$c),vue.createElementVNode("path",{d:"M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z",fill:r.isOpen?"#FD9B13":"#bbbbbb"},null,8,_hoisted_4$9),vue.createElementVNode("path",{d:"M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z",fill:r.isOpen?"#F12A3F":"#666666"},null,8,_hoisted_5$8),_hoisted_6$5,_hoisted_7$5,vue.createElementVNode("path",{d:"M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_8$4),vue.createElementVNode("path",{d:"M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_9$3),vue.createElementVNode("path",{d:"M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_10$3),_hoisted_11$3,_hoisted_12$1,_hoisted_13$1],8,_hoisted_2$e),vue.createElementVNode("use",{"xlink:href":`#${r.id}light-121`,width:"100",height:"100"},null,8,_hoisted_14$1)],8,_hoisted_1$g))}}),_hoisted_1$f=["id"],_hoisted_2$d=["id"],_hoisted_3$b=vue.createElementVNode("path",{d:"M512.3 518.9m-469.2 0a469.2 469.2 0 1 0 938.4 0 469.2 469.2 0 1 0-938.4 0Z",fill:"#429BCF"},null,-1),_hoisted_4$8=vue.createElementVNode("path",{d:"M512.3 518.9m-392.5 0a392.5 392.5 0 1 0 785 0 392.5 392.5 0 1 0-785 0Z",fill:"#FFFFFF"},null,-1),_hoisted_5$7={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1-6.8-6.8-6.8-17.9 0-24.8l130.8-130.8c6.8-6.8 17.9-6.8 24.8 0 6.8 6.8 6.8 17.9 0 24.8L524.7 518.7c-3.5 3.4-7.9 5.1-12.4 5.1z",fill:"#2D416C"},_hoisted_6$4=["from","to"],_hoisted_7$4={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1L318.3 337.1c-6.8-6.8-6.8-17.9 0-24.8 6.8-6.8 17.9-6.8 24.8 0L524.7 494c6.8 6.8 6.8 17.9 0 24.8-3.5 3.3-7.9 5-12.4 5z",fill:"#365087"},_hoisted_8$3=["from","to"],_hoisted_9$2=vue.createElementVNode("path",{d:"M512.3 506.3m-47.5 0a47.5 47.5 0 1 0 95 0 47.5 47.5 0 1 0-95 0Z",fill:"#365087"},null,-1),_hoisted_10$2=vue.createElementVNode("path",{d:"M512.3 218.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM512.3 880.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM812.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3zM150.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3z",fill:"#2D416C"},null,-1),_hoisted_11$2={d:"M296.9 733.5c-2.2 0-4.5-0.9-6.2-2.6-3.4-3.4-3.4-9 0-12.4L540 469.2c3.4-3.4 9-3.4 12.4 0 3.4 3.4 3.4 9 0 12.4L303.1 731c-1.7 1.7-4 2.5-6.2 2.5z",fill:"#C11B16"},_hoisted_12=["from","to"],_hoisted_13=vue.createElementVNode("path",{d:"M512.3 506.3m-22.8 0a22.8 22.8 0 1 0 45.6 0 22.8 22.8 0 1 0-45.6 0Z",fill:"#fff"},null,-1),_hoisted_14=["xlink:href"],_sfc_main$j=vue.defineComponent({__name:"clock-a",props:{id:{default:""}},setup(i){const n=i,r=vue.ref(new Date),g=r.value.getSeconds(),k=r.value.getMinutes(),V=Math.floor((r.value.getHours()+(k+g/60)/60)*30);return($,oe)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[_hoisted_3$b,_hoisted_4$8,vue.createElementVNode("path",_hoisted_5$7,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(V)} 512.3 506.3`,to:`${315+vue.unref(V)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_6$4)]),vue.createElementVNode("path",_hoisted_7$4,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(k)*6} 512.3 506.3`,to:`${405+vue.unref(k)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_8$3)]),_hoisted_9$2,_hoisted_10$2,vue.createElementVNode("path",_hoisted_11$2,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+vue.unref(g)*6} 512.3 506.3`,to:`${495.5+vue.unref(g)*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12)]),_hoisted_13],8,_hoisted_2$d),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"200",height:"200"},null,8,_hoisted_14)],8,_hoisted_1$f))}}),vueComp={"svg-text":_sfc_main$o,"el-button":ElButton,"progress-a":_sfc_main$q,"el-tag":ElTag,"common-table":_sfc_main$n,"pie-charts":PieCharts,"switch-a":_sfc_main$p,"now-time":_sfc_main$m,"light-a":_sfc_main$k,"clock-a":_sfc_main$j},configCenter=[...svg_config_center,...vue_config_center];var EGlobalStoreIntention=(i=>(i.None="None",i.Create="Create",i.Move="Move",i.MoveCanvas="MoveCanvas",i.Select="Select",i.Zoom="Zoom",i.Rotate="Rotate",i.Connection="Connection",i.SetConnectionLineNode="SetConnectionLineNode",i.ContextMenu="ContextMenu",i))(EGlobalStoreIntention||{}),EMouseInfoState=(i=>(i.Down="Down",i.Up="Up",i))(EMouseInfoState||{}),EScaleInfoType=(i=>(i.None="",i.TopLeft="TopLeft",i.TopCenter="TopCenter",i.TopRight="TopRight",i.Left="Left",i.Right="Right",i.BottomLeft="BottomLeft",i.BottomCenter="BottomCenter",i.BottomRight="BottomRight",i))(EScaleInfoType||{});const useGlobalStore=pinia$1.defineStore("global-store",{state:()=>({config_center:configCenter,intention:EGlobalStoreIntention.None,create_svg_info:null,done_json:[],mouse_info:{state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},handle_svg_info:null,scale_info:{type:EScaleInfoType.None,scale_times:{x:1,y:1},scale_item_info:{x:0,y:0},symmetric_point:{x:0,y:0}},rotate_info:{angle:0},connection_line_node_info:{init_pos:{x:0,y:0},point_index:0}}),getters:{},actions:{setCreateInfo(i){this.intention=EGlobalStoreIntention.Create,this.create_svg_info=i},setDoneJson(i){isOfType(i,"id")?(this.done_json.push(i),vue.nextTick(()=>{setSvgActualInfo(i)})):this.done_json=objectDeepClone(i),vue.nextTick(()=>{useHistoryRecord(objectDeepClone(this.done_json))})},setMouseInfo(i){this.mouse_info=i},setHandleSvgInfo(i,n){let r=n;i?(!r&&r!=0&&(r=this.done_json.findIndex(g=>g.id===i.id)??-1),this.handle_svg_info={info:i,index:r}):this.handle_svg_info=i},setScaleInfo(i){this.scale_info=i},spliceDoneJson(i){const n=useGlobalStore();n.done_json.splice(i,1),useHistoryRecord(n.done_json)}}}),useSvgEditLayoutStore=pinia$1.defineStore("svg-edit-layout-store",{state:()=>({left_nav:!0,right_nav:!0,center_offset:{x:0,y:0}})});var EContextMenuInfoType=(i=>(i.Copy="Copy",i.Delete="Delete",i.MoveUpOneLevel="MoveUpOneLevel",i.MoveDownOneLevel="MoveDownOneLevel",i.MoveUpTopLevel="MoveUpTopLevel",i.MoveDownTopLevel="MoveDownTopLevel",i))(EContextMenuInfoType||{});const useEditPrivateStore=pinia$1.defineStore("edit-private-store",{state:()=>({old_done_components:[],history_doneComponent:[],history_now_index:0,is_record_history:!0,max_record_times:10}),getters:{getTopBtnUndoStatus(i){return i.history_now_index>=1},getTopBtnRedoStatus(i){return i.history_now_index+1!=i.history_doneComponent.length}},actions:{topUndoBtnClick(){if(console.log("撤销"),this.history_now_index<1)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index-=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])},topRedoBtnClick(){if(console.log("重做"),this.history_now_index+1==this.history_doneComponent.length)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index+=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])}}}),useContextMenuStore=pinia$1.defineStore("context-menu-store",{state:()=>({display:!1,info:{[EContextMenuInfoType.Copy]:{title:"复制",hot_key:"Ctrl+C",enable:!0},[EContextMenuInfoType.Delete]:{title:"删除",hot_key:"Delete",enable:!0},[EContextMenuInfoType.MoveUpTopLevel]:{title:"置于顶层",hot_key:"Ctrl+→",enable:!0},[EContextMenuInfoType.MoveDownTopLevel]:{title:"置于底层",hot_key:"Ctrl+←",enable:!0},[EContextMenuInfoType.MoveUpOneLevel]:{title:"置于上一层",hot_key:"Ctrl+↑",enable:!0},[EContextMenuInfoType.MoveDownOneLevel]:{title:"置于下一层",hot_key:"Ctrl+↓",enable:!0}}}),actions:{onContextMenuClick(i){const n=useGlobalStore();if(n.handle_svg_info)switch(n.intention=EGlobalStoreIntention.Select,i){case EContextMenuInfoType.Copy:const r=objectDeepClone(n.handle_svg_info.info);r.id=r.name+randomString(),r.title+="-copy",r.x+=10,r.y+=10,n.setDoneJson(r),this.display=!1,n.setHandleSvgInfo(r,n.done_json.length);break;case EContextMenuInfoType.Delete:n.spliceDoneJson(n.handle_svg_info.index),this.display=!1,n.setHandleSvgInfo(null),n.intention=EGlobalStoreIntention.None;break;case EContextMenuInfoType.MoveUpOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length-1)return;const g=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index+1],n.done_json[n.handle_svg_info.index+1]=g,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(g,n.handle_svg_info.index+1);break;case EContextMenuInfoType.MoveDownOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const k=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index-1],n.done_json[n.handle_svg_info.index-1]=k,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(k,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const V=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(V),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(V,0);break;case EContextMenuInfoType.MoveUpTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length)return;const $=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.push($),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo($,n.done_json.length-1);break}}}}),pinia=pinia$1.createPinia(),useHistoryRecord=i=>{const n=useEditPrivateStore();n.is_record_history&&(n.history_now_index+1<n.history_doneComponent.length&&n.history_doneComponent.splice(n.history_now_index+1),n.history_doneComponent.push(i),n.history_now_index=n.history_doneComponent.length-1,n.history_doneComponent.length>n.max_record_times&&(n.history_doneComponent.shift(),n.history_now_index=n.history_doneComponent.length-1)),n.is_record_history=!0},useImportDataModel=i=>{try{const n=JSON.parse(i);if(!n.config||!n.layout_center||!n.done_json)return ElMessage.error("请导入正确的数据模型!"),!1;const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=useConfigStore(pinia);return k.$state=n.config,g.center_offset=n.layout_center,r.setDoneJson(n.done_json),!0}catch(n){return ElMessage.error("请导入正确的数据模型!"),console.error(n),!1}},_hoisted_1$e={"aria-hidden":"true"},_hoisted_2$c=["xlink:href"],_sfc_main$i=vue.defineComponent({__name:"index",props:{name:{type:String,required:!0},props:{type:Object,default:()=>{}}},setup(i){const n=i,r=vue.computed(()=>`#svg-${n.name}`);return(g,k)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$e,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":r.value},n.props),null,16,_hoisted_2$c)]))}});var EVisibleConfKey=(i=>(i.ImportJson="ImportJson",i.ExportJson="ExportJson",i.ImportFile="ImportFile",i))(EVisibleConfKey||{});const _withScopeId$3=i=>(vue.pushScopeId("data-v-b0ad1445"),i=i(),vue.popScopeId(),i),_hoisted_1$d={class:"flex justify-between",style:{width:"100%"}},_hoisted_2$b={class:"flex items-center justify-between",style:{width:"220px"}},_hoisted_3$a=_withScopeId$3(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"组态编辑器")],-1)),_hoisted_4$7={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$3={class:"flex items-center mr-20px"},_hoisted_7$3={class:"flex items-center",style:{width:"220px"}},_sfc_main$h=vue.defineComponent({__name:"index",emits:["changeVisible","onReturn","onPreview","onSave"],setup(i,{emit:n}){const r=useSvgEditLayoutStore(pinia),g=useGlobalStore(pinia),k=useEditPrivateStore(pinia),V=useConfigStore(pinia),$=()=>{g.done_json.length<=0||g.setDoneJson([]),g.intention=EGlobalStoreIntention.None},oe=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onPreview",Ce)},re=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onSave",Ce)};return(Ce,ie)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$b,[_hoisted_3$a,vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[0]||(ie[0]=ae=>vue.unref(r).left_nav=!vue.unref(r).left_nav)},{default:vue.withCtx(()=>[vue.unref(r).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-fold"}))]),_:1})]),vue.createElementVNode("div",_hoisted_4$7,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(ElIcon),{title:"撤销 ctrl+z",size:20,class:vue.normalizeClass(`${vue.unref(k).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:ie[1]||(ie[1]=()=>vue.unref(k).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"undo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(k).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:20,onClick:ie[2]||(ie[2]=()=>vue.unref(k).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"redo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"清空 ctrl+delete",class:vue.normalizeClass(`${vue.unref(g).done_json.length>0?"bt-Icon":"icon-disable"}`),size:20,onClick:$},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"导入数据模型",class:"bt-Icon",size:20,onClick:ie[3]||(ie[3]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"import"})]),_:1}),vue.createVNode(vue.unref(ElIcon),{title:"导出数据模型",size:20,class:"bt-Icon ml-5px",onClick:ie[4]||(ie[4]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"export"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$3,[vue.createVNode(vue.unref(ElIcon),{title:"返回",class:"bt-Icon",size:20,onClick:ie[5]||(ie[5]=ae=>n("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"return"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"保存",class:"bt-Icon",size:20,onClick:re},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"save"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:oe},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$3,[vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[6]||(ie[6]=ae=>vue.unref(r).right_nav=!vue.unref(r).right_nav)},{default:vue.withCtx(()=>[vue.unref(r).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-unfold"}))]),_:1})])]))}}),index_vue_vue_type_style_index_0_scoped_b0ad1445_lang="",TopPanel=_export_sfc(_sfc_main$h,[["__scopeId","data-v-b0ad1445"]]),_hoisted_1$c={style:{"font-weight":"bold"}},_hoisted_2$a={class:"component-group flex flex-wrap"},_hoisted_3$9=["onDragstart","title"],_sfc_main$g=vue.defineComponent({__name:"index",props:{customToolBar:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=vue.ref(n.customToolBar&&Object.keys(n.customToolBar).length>0?n.customToolBar:r.config_center),k=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),V=oe=>{r.setCreateInfo(oe)},$=oe=>{var re;if(((re=oe.dataTransfer)==null?void 0:re.dropEffect)!=="copy"){ElMessage.warning("请将组件拖到画布中!"),r.intention=EGlobalStoreIntention.None;return}};return(oe,re)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElCollapse),{modelValue:k.value,"onUpdate:modelValue":re[0]||(re[0]=Ce=>k.value=Ce)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(g.value,Ce=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:Ce.groupType,key:Ce.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$c,vue.toDisplayString(Ce.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$a,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ce.list,ie=>(vue.openBlock(),vue.createElementBlock("div",{class:"ideal",key:ie.name,draggable:"true",onDragstart:ae=>V(ie),onDragend:$,title:ie.title},[vue.createVNode(vue.unref(ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:ie.name,props:vue.unref(prosToVBind)(ie)},null,8,["name","props"])]),_:2},1024)],40,_hoisted_3$9))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_e50f27fa_lang="",LeftPanel=_export_sfc(_sfc_main$g,[["__scopeId","data-v-e50f27fa"]]),calculateLeftTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateTop=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateRight=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateLeft=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},_hoisted_1$b={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$9=["fill","x","y"],_hoisted_3$8=["cx","cy"],_hoisted_4$6=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$2=["fill","x","y"],_hoisted_7$2=["fill","x","y"],_hoisted_8$2=["fill","x","y"],_hoisted_9$1=["fill","x","y"],_hoisted_10$1=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$f=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i;vue.useCssVars(ie=>({d86744e2:V.value}));const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=[{start:338,end:23,cursor:"nw",type:EScaleInfoType.TopLeft},{start:23,end:68,cursor:"n",type:EScaleInfoType.TopCenter},{start:68,end:113,cursor:"ne",type:EScaleInfoType.TopRight},{start:293,end:338,cursor:"w",type:EScaleInfoType.Left},{start:113,end:158,cursor:"e",type:EScaleInfoType.Right},{start:248,end:293,cursor:"sw",type:EScaleInfoType.BottomLeft},{start:203,end:248,cursor:"s",type:EScaleInfoType.BottomCenter},{start:158,end:203,cursor:"se",type:EScaleInfoType.BottomRight}],oe=(ie,ae)=>{console.log("onHandleMouseDown",ae);const{clientX:le,clientY:Ie}=ae;ae.stopPropagation(),r.intention=EGlobalStoreIntention.Zoom,r.setMouseInfo({state:EMouseInfoState.Down,position_x:le-g.center_offset.x,position_y:Ie-g.center_offset.y,now_position_x:le-g.center_offset.x,now_position_y:Ie-g.center_offset.y,new_position_x:0,new_position_y:0}),r.setScaleInfo({type:ie,scale_times:{x:n.itemInfo.scale_x,y:n.itemInfo.scale_y},scale_item_info:{x:n.itemInfo.x,y:n.itemInfo.y},symmetric_point:{x:n.itemInfo.client.x+Math.abs(le-g.center_offset.x-n.itemInfo.client.x)*(le-g.center_offset.x<n.itemInfo.client.x?1:-1),y:n.itemInfo.client.y+Math.abs(Ie-g.center_offset.y-n.itemInfo.client.y)*(Ie-g.center_offset.y<n.itemInfo.client.y?1:-1)}})},re=ie=>{const{clientX:ae,clientY:le}=ie;ie.stopPropagation(),r.intention=EGlobalStoreIntention.Rotate,r.rotate_info={angle:n.itemInfo.rotate},r.setMouseInfo({state:EMouseInfoState.Down,position_x:ae-g.center_offset.x,position_y:le-g.center_offset.y,now_position_x:ae-g.center_offset.x,now_position_y:le-g.center_offset.y,new_position_x:0,new_position_y:0})},Ce=ie=>{const ae=(ie+n.itemInfo.rotate)%360,le=$.find(Ie=>Ie.start<=ae&&Ie.end>ae);return le?{cursor:le.cursor+"-resize",type:le.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(ie,ae)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$b,[vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[0]||(ae[0]=le=>oe(vue.unref(EScaleInfoType).TopLeft,le))},null,44,_hoisted_2$9),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:re},null,40,_hoisted_3$8),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),x2:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y2:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:V.value,"stroke-width":2})},null,12,_hoisted_4$6),vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value,y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[1]||(ae[1]=le=>oe(vue.unref(EScaleInfoType).TopCenter,le))},null,44,_hoisted_5$5),vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-k.value+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[2]||(ae[2]=le=>oe(vue.unref(EScaleInfoType).TopRight,le))},null,44,_hoisted_6$2),vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[3]||(ae[3]=le=>oe(vue.unref(EScaleInfoType).Left,le))},null,44,_hoisted_7$2),vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[4]||(ae[4]=le=>oe(vue.unref(EScaleInfoType).Right,le))},null,44,_hoisted_8$2),vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[5]||(ae[5]=le=>oe(vue.unref(EScaleInfoType).BottomLeft,le))},null,44,_hoisted_9$1),vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[6]||(ae[6]=le=>oe(vue.unref(EScaleInfoType).BottomCenter,le))},null,44,_hoisted_10$1),vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[7]||(ae[7]=le=>oe(vue.unref(EScaleInfoType).BottomRight,le))},null,44,_hoisted_11$1)]))}}),index_vue_vue_type_style_index_0_scoped_450fe66d_lang="",HandlePanel=_export_sfc(_sfc_main$f,[["__scopeId","data-v-450fe66d"]]),_hoisted_1$a={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$8=["cx","cy","r","fill"],_hoisted_3$7=["cx","cy","r","fill"],_hoisted_4$5=["cx","cy","r","fill"],_hoisted_5$4=["cx","cy","r","fill"],_sfc_main$e=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=useConfigStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=vue.ref(4),oe=(re,Ce)=>{Ce.preventDefault();const{clientX:ie,clientY:ae}=Ce;let le=objectDeepClone(g.connection_line);console.log("onConnectionMouseDown",g.connection_line,Ce),le.bind_anchors.start={type:re,target_id:n.itemInfo.id};const{x:Ie,y:ue}=getAnchorPosByAnchorType(re,n.itemInfo),de={id:straight_line_system.name+randomString(),x:Ie,y:ue,client:{x:ie,y:ae},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...le};de.props.point_position.val.push({x:g.svg.svg_position_center.x,y:g.svg.svg_position_center.y}),r.setHandleSvgInfo(de,r.done_json.length),r.setDoneJson(de),r.intention=EGlobalStoreIntention.Connection,r.setMouseInfo({state:EMouseInfoState.Down,position_x:ie,position_y:ae,now_position_x:ie,now_position_y:ae,new_position_x:0,new_position_y:0})};return(re,Ce)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$a,[vue.createElementVNode("circle",{id:"connection_tc",cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value+$.value,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[0]||(Ce[0]=ie=>oe(vue.unref(ELineBindAnchors).TopCenter,ie))},null,40,_hoisted_2$8),vue.createElementVNode("circle",{id:"connection_l",cx:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[1]||(Ce[1]=ie=>oe(vue.unref(ELineBindAnchors).Left,ie))},null,40,_hoisted_3$7),vue.createElementVNode("circle",{id:"connection_r",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[2]||(Ce[2]=ie=>oe(vue.unref(ELineBindAnchors).Right,ie))},null,40,_hoisted_4$5),vue.createElementVNode("circle",{id:"connection_bc",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[3]||(Ce[3]=ie=>oe(vue.unref(ELineBindAnchors).BottomCenter,ie))},null,40,_hoisted_5$4)]))}}),_hoisted_1$9=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_2$7=["from","to","dur","repeatCount"],_hoisted_3$6=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$4=["from","to","dur","repeatCount"],_hoisted_5$3=["r","fill"],_hoisted_6$1=["path","dur","repeatCount"],_hoisted_7$1={key:2},_hoisted_8$1=["cx","cy","stroke","onMousedown"],_sfc_main$d=vue.defineComponent({__name:"index",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(i){const n=i,r=useGlobalStore(pinia),g=(k,V,$,oe)=>{if(r.intention===EGlobalStoreIntention.Connection)return;r.setHandleSvgInfo(n.itemInfo);const{clientX:re,clientY:Ce}=V;V.stopPropagation(),r.connection_line_node_info={init_pos:{x:$,y:oe},point_index:k},r.intention=EGlobalStoreIntention.SetConnectionLineNode,r.setMouseInfo({state:EMouseInfoState.Down,position_x:re,position_y:Ce,now_position_x:re,now_position_y:Ce,new_position_x:0,new_position_y:0})};return(k,V)=>{var $,oe,re,Ce,ie;return vue.openBlock(),vue.createElementBlock("g",null,[vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:(($=n.itemInfo.animations)==null?void 0:$.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","stroke-dasharray":((oe=n.itemInfo.animations)==null?void 0:oe.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0},[((re=n.itemInfo.animations)==null?void 0:re.type.val)===vue.unref(EConfigAnimationsType).Electricity?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_2$7)):vue.createCommentVNode("",!0)],8,_hoisted_1$9),((Ce=n.itemInfo.animations)==null?void 0:Ce.type.val)===vue.unref(EConfigAnimationsType).WaterDrop?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:n.itemInfo.animations.color.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dasharray":n.itemInfo.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val,fill:"freeze"},null,8,_hoisted_4$4)],8,_hoisted_3$6)):((ie=n.itemInfo.animations)==null?void 0:ie.type.val)===vue.unref(EConfigAnimationsType).Track?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:n.itemInfo.props["stroke-width"].val*2,fill:n.itemInfo.animations.color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrToPath)(n.itemInfo.animations.reverse.val?[...n.itemInfo.props.point_position.val].reverse():n.itemInfo.props.point_position.val),dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_6$1)],8,_hoisted_5$3)):vue.createCommentVNode("",!0),n.pointVisible?(vue.openBlock(),vue.createElementBlock("g",_hoisted_7$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(ae,le)=>(vue.openBlock(),vue.createElementBlock("circle",{key:le,cx:ae.x,cy:ae.y,r:"6","stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:Ie=>g(le,Ie,ae.x,ae.y)},null,40,_hoisted_8$1))),128))])):vue.createCommentVNode("",!0)])}}}),_withScopeId$2=i=>(vue.pushScopeId("data-v-cc758a32"),i=i(),vue.popScopeId(),i),_hoisted_1$8=_withScopeId$2(()=>vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",{id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"10",height:"10"},[vue.createElementVNode("rect",{width:"1",height:"1",rx:"1",ry:"1",fill:"#aaaaaa"})])],-1)),_hoisted_2$6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_3$5=["transform"],_hoisted_4$3=["transform"],_hoisted_5$2=["transform","onMousedown","onMouseenter","onMouseleave","onContextmenu"],_hoisted_6=["xlink:href","id","transform"],_hoisted_7=["id"],_hoisted_8=["id","x1","y1","x2","y2"],_hoisted_9=["id"],_hoisted_10=["onClick"],_hoisted_11={class:"shortcut"},_sfc_main$c=vue.defineComponent({__name:"index",setup(i){vue.useCssVars(Ue=>({"4438ab04":Ce.value}));const n=vue.getCurrentInstance();Object.keys(vueComp).forEach(Ue=>{var Ve;Object.keys((Ve=n==null?void 0:n.appContext)==null?void 0:Ve.components).includes(Ue)||n==null||n.appContext.app.component(Ue,vueComp[Ue])});const r=useGlobalStore(pinia),g=useConfigStore(pinia),k=useSvgEditLayoutStore(pinia),V=useEditPrivateStore(pinia),$=useContextMenuStore(pinia),oe=vue.ref(),re=vue.ref(),Ce=vue.computed(()=>r.intention==EGlobalStoreIntention.MoveCanvas?"grab":r.intention==EGlobalStoreIntention.Rotate?"url('/src/assets/icons/rotate.svg') 12 12, auto":"default"),ie=vue.reactive({handle_panel:vue.computed(()=>r.intention===EGlobalStoreIntention.Select||r.intention===EGlobalStoreIntention.Zoom||r.intention===EGlobalStoreIntention.Rotate),connection_panel:!1,connection_line:!1,select_item:{info:null,index:-1}}),ae=Ue=>{var Ve;if(r.intention!=EGlobalStoreIntention.None){if(r.intention==EGlobalStoreIntention.Create){if(!r.create_svg_info){console.error("要创建的数据获取失败");return}const Oe=Math.floor(Ue.clientX-k.center_offset.x),At=Math.floor(Ue.clientY-k.center_offset.y),qe={id:randomString(),x:Oe,y:At,client:{x:Oe,y:At},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...objectDeepClone(r.create_svg_info)};r.setHandleSvgInfo(qe,r.done_json.length),r.setDoneJson(qe),r.intention=EGlobalStoreIntention.None}(Ve=re.value)==null||Ve.focus()}},le=Ue=>{Ue.preventDefault()},Ie=Ue=>{Ue.preventDefault()},ue=(Ue,Ve,Oe)=>{var At;(At=re.value)==null||At.focus(),r.intention!==EGlobalStoreIntention.Connection&&(Oe.preventDefault(),Oe.stopPropagation(),r.intention=EGlobalStoreIntention.Select,r.setHandleSvgInfo(Ue,Ve),r.setMouseInfo({state:EMouseInfoState.Down,position_x:Oe.clientX,position_y:Oe.clientY,now_position_x:Ue.x,now_position_y:Ue.y,new_position_x:Ue.x,new_position_y:Ue.y}))},de=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),ie.connection_panel=!0,ie.connection_line=!0,!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.select_item.info=Ue,ie.select_item.index=Ve)},Ne=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.connection_panel=!1,ie.connection_line=!1,ie.select_item.info=null,ie.select_item.index=-1)},he=Ue=>{var At,qe,Lt,kt;if(r.mouse_info.state!=EMouseInfoState.Down&&r.intention!==EGlobalStoreIntention.Connection)return;const{clientX:Ve,clientY:Oe}=Ue;if(r.mouse_info.new_position_x=r.mouse_info.now_position_x+Ve-r.mouse_info.position_x,r.mouse_info.new_position_y=r.mouse_info.now_position_y+Oe-r.mouse_info.position_y,(At=r.handle_svg_info)!=null&&At.info&&(r.intention==EGlobalStoreIntention.Select||r.intention==EGlobalStoreIntention.Move))r.handle_svg_info.info.x=r.mouse_info.new_position_x,r.handle_svg_info.info.y=r.mouse_info.new_position_y,r.handle_svg_info.info.client={x:r.mouse_info.new_position_x,y:r.mouse_info.new_position_y},r.intention=EGlobalStoreIntention.Move;else if(r.intention==EGlobalStoreIntention.MoveCanvas)k.center_offset.x=r.mouse_info.new_position_x,k.center_offset.y=r.mouse_info.new_position_y;else if(r.intention===EGlobalStoreIntention.Zoom){if(!r.handle_svg_info)return;const jt={x:Ue.clientX-k.center_offset.x,y:Ue.clientY-k.center_offset.y};let ti={width:0,height:0,is_old_width:!1,is_old_height:!1};if(r.scale_info.type===EScaleInfoType.TopLeft?ti=calculateLeftTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopRight?ti=calculateRightTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomRight?ti=calculateRightBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomLeft?ti=calculateLeftBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopCenter?ti=calculateTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Right?ti=calculateRight(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.BottomCenter?ti=calculateBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Left&&(ti=calculateLeft(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client)),r.handle_svg_info&&ti.width>0&&ti.height>0){const ei=ti.is_old_width?1:ti.width/r.handle_svg_info.info.actual_bound.width,Pt=ti.is_old_height?1:ti.height/r.handle_svg_info.info.actual_bound.height,ni=getCenterPoint(jt,r.scale_info.symmetric_point);ei>0&&r.scale_info.type!==EScaleInfoType.TopCenter&&r.scale_info.type!==EScaleInfoType.BottomCenter&&(r.handle_svg_info.info.scale_x=ei,r.handle_svg_info.info.x=getSvgNowPosition(r.handle_svg_info.info.client.x,ni.x,r.scale_info.scale_item_info.x)),Pt>0&&r.scale_info.type!==EScaleInfoType.Left&&r.scale_info.type!==EScaleInfoType.Right&&(r.handle_svg_info.info.scale_y=Pt,r.handle_svg_info.info.y=getSvgNowPosition(r.handle_svg_info.info.client.y,ni.y,r.scale_info.scale_item_info.y))}}else if(r.intention===EGlobalStoreIntention.Rotate){if(!r.handle_svg_info)return;const jt=Math.atan2(r.mouse_info.position_y-r.handle_svg_info.info.client.y,r.mouse_info.position_x-r.handle_svg_info.info.client.x)/(Math.PI/180),ti=Math.atan2(Oe-k.center_offset.y-r.handle_svg_info.info.client.y,Ve-k.center_offset.x-r.handle_svg_info.info.client.x)/(Math.PI/180);r.handle_svg_info.info.rotate=r.rotate_info.angle+ti-jt}else r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info?r.handle_svg_info.info.props.point_position.val[((qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val.length)-1]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,(Lt=r.handle_svg_info)==null?void 0:Lt.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(kt=r.handle_svg_info)==null?void 0:kt.info.props.point_position.val[0].y)}:r.intention===EGlobalStoreIntention.SetConnectionLineNode&&r.handle_svg_info&&(r.handle_svg_info.info.props.point_position.val[r.connection_line_node_info.point_index]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,r.connection_line_node_info.init_pos.x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,r.connection_line_node_info.init_pos.y)})},pe=()=>{var Ue,Ve,Oe;if(r.mouse_info.state==EMouseInfoState.Down){if((Ue=r.handle_svg_info)!=null&&Ue.info&&r.intention==EGlobalStoreIntention.Move)r.done_json[r.handle_svg_info.index].x=r.mouse_info.new_position_x,r.done_json[r.handle_svg_info.index].y=r.mouse_info.new_position_y,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.intention=EGlobalStoreIntention.None,r.setDoneJson(r.done_json);else if((Ve=r.handle_svg_info)!=null&&Ve.info&&r.intention==EGlobalStoreIntention.Zoom)r.handle_svg_info.info.client={x:r.handle_svg_info.info.x,y:r.handle_svg_info.info.y},r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else if(r.intention===EGlobalStoreIntention.Rotate&&((Oe=r.handle_svg_info)!=null&&Oe.info))setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else{if(r.intention===EGlobalStoreIntention.Connection)return;r.intention!=EGlobalStoreIntention.Select&&(r.intention=EGlobalStoreIntention.None)}r.setMouseInfo({state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}),$.display=!1}},ze=Ue=>{var At,qe;const{clientX:Ve,clientY:Oe}=Ue;if(r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info){Ue.button===0&&r.handle_svg_info.info.props.point_position.val.push({x:getSvgNowPosition(r.mouse_info.position_x,Ve,(At=r.handle_svg_info)==null?void 0:At.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val[0].y)}),Ue.button===2&&(r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]));return}r.intention=EGlobalStoreIntention.MoveCanvas,r.setMouseInfo({state:EMouseInfoState.Down,position_x:Ve,position_y:Oe,now_position_x:k.center_offset.x,now_position_y:k.center_offset.y,new_position_x:k.center_offset.x,new_position_y:k.center_offset.y})},Fe=Ue=>{Ue.stopPropagation(),Ue.preventDefault()},xe=(Ue,Ve,Oe)=>{console.log(r.intention),r.intention!==EGlobalStoreIntention.Connection&&oe.value&&(r.intention=EGlobalStoreIntention.ContextMenu,r.setHandleSvgInfo(Ue,Ve),oe.value.style.left=Oe.pageX+"px",oe.value.style.top=Oe.pageY+"px",$.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=$.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!0,Ve===r.done_json.length-1&&($.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=!1),Ve===0&&($.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!1),$.display=!0)},_e=(Ue,Ve,Oe)=>({x:Ue.x-Ue.width/2*Ve+Ue.width/2,y:Ue.y-Ue.height/2*Oe+Ue.height/2,width:Ue.width*Ve,height:Ue.height*Oe}),Dt=Ue=>{console.log(Ue,733),Ue.preventDefault(),r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowUp"?(r.done_json[r.handle_svg_info.index].y-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowDown"?(r.handle_svg_info.info.y+=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowLeft"?(r.handle_svg_info.info.x-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowRight"?(r.handle_svg_info.info.x+=1,useHistoryRecord(r.done_json)):Ue.ctrlKey&&Ue.key.toLowerCase()=="c"?$.onContextMenuClick(EContextMenuInfoType.Copy):!Ue.ctrlKey&&Ue.key=="Delete"?$.onContextMenuClick(EContextMenuInfoType.Delete):Ue.ctrlKey&&Ue.key=="ArrowUp"?$.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):Ue.ctrlKey&&Ue.key=="ArrowDown"?$.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):Ue.ctrlKey&&Ue.key=="ArrowLeft"?$.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):Ue.ctrlKey&&Ue.key=="ArrowRight"?$.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):Ue.ctrlKey&&Ue.shiftKey&&Ue.key.toLowerCase()=="z"?V.topRedoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="z"?V.topUndoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="delete"&&(r.done_json.length<=0||r.setDoneJson([]))},$e=()=>{setSvgActualInfo(r.done_json[r.handle_svg_info.index],!0)};return vue.onMounted(()=>{var Ue;(Ue=re.value)==null||Ue.focus()}),(Ue,Ve)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:re,onDrop:ae,onDragenter:le,onDragover:Ie,onMousedown:ze,onMousemove:he,onMouseup:pe,onContextmenu:Fe,onKeydown:Dt},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(g).svg.background_color}),width:"100%",height:"100%"},[_hoisted_1$8,vue.unref(g).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_2$6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(g).svg.position_center.x+vue.unref(k).center_offset.x},${vue.unref(g).svg.position_center.y+vue.unref(k).center_offset.y})rotate(0)scale(${vue.unref(g).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).done_json,(Oe,At)=>{var qe,Lt,kt,jt,ti,ei;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Oe.id,transform:`translate(${Oe.x},${Oe.y})rotate(0)scale(1)`},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Oe)}`)},[vue.createElementVNode("g",{transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2})rotate(${Oe.rotate}) scale(1) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`,onMousedown:Pt=>ue(Oe,At,Pt),onMouseenter:Pt=>de(Oe,At,Pt),onMouseleave:Pt=>Ne(Oe,At,Pt),onContextmenu:Pt=>xe(Oe,At,Pt)},[Oe.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$d,{key:0,"item-info":Oe,"point-visible":ie.connection_line&&((qe=ie.select_item.info)==null?void 0:qe.id)==Oe.id},null,8,["item-info","point-visible"])):Oe.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Oe.name}`},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,_hoisted_6)):Oe.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,onResize:$e,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,["id","transform"])):Oe.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{id:`foreign-object${Oe.id}`}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps(vue.unref(prosToVBind)(Oe),{id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Oe.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_7)):Oe.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:Oe.id,x1:Oe.props.start_x.val,y1:Oe.props.start_y.val,x2:Oe.props.end_x.val,y2:Oe.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_8)):vue.createCommentVNode("",!0),Oe.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${Oe.id}`,fill:"black","fill-opacity":"0"},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:`${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select?"svg-item-none":""}
354
- ${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Move&&((Lt=vue.unref(r).handle_svg_info)==null?void 0:Lt.info.id)==Oe.id?"svg-item-move":""} ${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&((kt=vue.unref(r).handle_svg_info)==null?void 0:kt.info.id)==Oe.id?"svg-item-select":""}`}),null,16,_hoisted_9)):vue.createCommentVNode("",!0),((jt=vue.unref(r).handle_svg_info)==null?void 0:jt.info.id)===Oe.id&&ie.handle_panel&&Oe.config.can_zoom?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":Oe},null,8,["item-info"])):vue.createCommentVNode("",!0),((ti=ie.select_item.info)==null?void 0:ti.id)==Oe.id&&ie.connection_panel&&Oe.config.have_anchor&&(vue.unref(r).intention!==vue.unref(EGlobalStoreIntention).Select||Oe.id!==((ei=vue.unref(r).handle_svg_info)==null?void 0:ei.info.id))?(vue.openBlock(),vue.createBlock(_sfc_main$e,{key:7,"item-info":Oe},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_5$2)],2)],8,_hoisted_4$3)),[[vue.vShow,Oe.display]])}),128))],8,_hoisted_3$5)],4)),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:oe,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref($).info,(Oe,At)=>(vue.openBlock(),vue.createElementBlock("li",{key:Oe.title,onClick:qe=>vue.unref($).onContextMenuClick(At)},[vue.createElementVNode("p",{class:vue.normalizeClass(Oe.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(Oe.title)+" ",1),vue.createElementVNode("span",_hoisted_11,vue.toDisplayString(Oe.hot_key),1)],2)],8,_hoisted_10))),128))],512),[[vue.vShow,vue.unref($).display]])],544))}}),index_vue_vue_type_style_index_0_scoped_cc758a32_lang="",CenterPanel=_export_sfc(_sfc_main$c,[["__scopeId","data-v-cc758a32"]]);var ace$2={exports:{}};(function(i,n){(function(){var r="ace",g=function(){return this}();!g&&typeof window<"u"&&(g=window);var k=function(ie,ae,le){if(typeof ie!="string"){k.original?k.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(le=ae),k.modules[ie]||(k.payloads[ie]=le,k.modules[ie]=null)};k.modules={},k.payloads={};var V=function(ie,ae,le){if(typeof ae=="string"){var Ie=re(ie,ae);if(Ie!=null)return le&&le(),Ie}else if(Object.prototype.toString.call(ae)==="[object Array]"){for(var ue=[],de=0,Ne=ae.length;de<Ne;++de){var he=re(ie,ae[de]);if(he==null&&$.original)return;ue.push(he)}return le&&le.apply(null,ue)||!0}},$=function(ie,ae){var le=V("",ie,ae);return le==null&&$.original?$.original.apply(this,arguments):le},oe=function(ie,ae){if(ae.indexOf("!")!==-1){var le=ae.split("!");return oe(ie,le[0])+"!"+oe(ie,le[1])}if(ae.charAt(0)=="."){var Ie=ie.split("/").slice(0,-1).join("/");for(ae=Ie+"/"+ae;ae.indexOf(".")!==-1&&ue!=ae;){var ue=ae;ae=ae.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return ae},re=function(ie,ae){ae=oe(ie,ae);var le=k.modules[ae];if(!le){if(le=k.payloads[ae],typeof le=="function"){var Ie={},ue={id:ae,uri:"",exports:Ie,packaged:!0},de=function(he,pe){return V(ae,he,pe)},Ne=le(de,Ie,ue);Ie=Ne||ue.exports,k.modules[ae]=Ie,delete k.payloads[ae]}le=k.modules[ae]=Ie||le}return le};function Ce(ie){var ae=g;ie&&(g[ie]||(g[ie]={}),ae=g[ie]),(!ae.define||!ae.define.packaged)&&(k.original=ae.define,ae.define=k,ae.define.packaged=!0),(!ae.require||!ae.require.packaged)&&($.original=ae.require,ae.require=$,ae.require.packaged=!0)}Ce(r)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(r,g,k){function V($,oe,re){Object.defineProperty($,oe,{value:re,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||V(String.prototype,"startsWith",function($,oe){return oe=oe||0,this.lastIndexOf($,oe)===oe}),String.prototype.endsWith||V(String.prototype,"endsWith",function($,oe){var re=this;(oe===void 0||oe>re.length)&&(oe=re.length),oe-=$.length;var Ce=re.indexOf($,oe);return Ce!==-1&&Ce===oe}),String.prototype.repeat||V(String.prototype,"repeat",function($){for(var oe="",re=this;$>0;)$&1&&(oe+=re),($>>=1)&&(re+=re);return oe}),String.prototype.includes||V(String.prototype,"includes",function($,oe){return this.indexOf($,oe)!=-1}),Object.assign||(Object.assign=function($){if($==null)throw new TypeError("Cannot convert undefined or null to object");for(var oe=Object($),re=1;re<arguments.length;re++){var Ce=arguments[re];Ce!=null&&Object.keys(Ce).forEach(function(ie){oe[ie]=Ce[ie]})}return oe}),Object.values||(Object.values=function($){return Object.keys($).map(function(oe){return $[oe]})}),Array.prototype.find||V(Array.prototype,"find",function($){for(var oe=this.length,re=arguments[1],Ce=0;Ce<oe;Ce++){var ie=this[Ce];if($.call(re,ie,Ce,this))return ie}}),Array.prototype.findIndex||V(Array.prototype,"findIndex",function($){for(var oe=this.length,re=arguments[1],Ce=0;Ce<oe;Ce++){var ie=this[Ce];if($.call(re,ie,Ce,this))return Ce}}),Array.prototype.includes||V(Array.prototype,"includes",function($,oe){return this.indexOf($,oe)!=-1}),Array.prototype.fill||V(Array.prototype,"fill",function($){for(var oe=this,re=oe.length>>>0,Ce=arguments[1],ie=Ce>>0,ae=ie<0?Math.max(re+ie,0):Math.min(ie,re),le=arguments[2],Ie=le===void 0?re:le>>0,ue=Ie<0?Math.max(re+Ie,0):Math.min(Ie,re);ae<ue;)oe[ae]=$,ae++;return oe}),Array.of||V(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(r,g,k){r("./es6-shim")}),ace.define("ace/lib/lang",["require","exports","module"],function(r,g,k){g.last=function(oe){return oe[oe.length-1]},g.stringReverse=function(oe){return oe.split("").reverse().join("")},g.stringRepeat=function(oe,re){for(var Ce="";re>0;)re&1&&(Ce+=oe),(re>>=1)&&(oe+=oe);return Ce};var V=/^\s\s*/,$=/\s\s*$/;g.stringTrimLeft=function(oe){return oe.replace(V,"")},g.stringTrimRight=function(oe){return oe.replace($,"")},g.copyObject=function(oe){var re={};for(var Ce in oe)re[Ce]=oe[Ce];return re},g.copyArray=function(oe){for(var re=[],Ce=0,ie=oe.length;Ce<ie;Ce++)oe[Ce]&&typeof oe[Ce]=="object"?re[Ce]=this.copyObject(oe[Ce]):re[Ce]=oe[Ce];return re},g.deepCopy=function oe(re){if(typeof re!="object"||!re)return re;var Ce;if(Array.isArray(re)){Ce=[];for(var ie=0;ie<re.length;ie++)Ce[ie]=oe(re[ie]);return Ce}if(Object.prototype.toString.call(re)!=="[object Object]")return re;Ce={};for(var ie in re)Ce[ie]=oe(re[ie]);return Ce},g.arrayToMap=function(oe){for(var re={},Ce=0;Ce<oe.length;Ce++)re[oe[Ce]]=1;return re},g.createMap=function(oe){var re=Object.create(null);for(var Ce in oe)re[Ce]=oe[Ce];return re},g.arrayRemove=function(oe,re){for(var Ce=0;Ce<=oe.length;Ce++)re===oe[Ce]&&oe.splice(Ce,1)},g.escapeRegExp=function(oe){return oe.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},g.escapeHTML=function(oe){return(""+oe).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},g.getMatchOffsets=function(oe,re){var Ce=[];return oe.replace(re,function(ie){Ce.push({offset:arguments[arguments.length-2],length:ie.length})}),Ce},g.deferredCall=function(oe){var re=null,Ce=function(){re=null,oe()},ie=function(ae){return ie.cancel(),re=setTimeout(Ce,ae||0),ie};return ie.schedule=ie,ie.call=function(){return this.cancel(),oe(),ie},ie.cancel=function(){return clearTimeout(re),re=null,ie},ie.isPending=function(){return re},ie},g.delayedCall=function(oe,re){var Ce=null,ie=function(){Ce=null,oe()},ae=function(le){Ce==null&&(Ce=setTimeout(ie,le||re))};return ae.delay=function(le){Ce&&clearTimeout(Ce),Ce=setTimeout(ie,le||re)},ae.schedule=ae,ae.call=function(){this.cancel(),oe()},ae.cancel=function(){Ce&&clearTimeout(Ce),Ce=null},ae.isPending=function(){return Ce},ae}}),ace.define("ace/lib/oop",["require","exports","module"],function(r,g,k){g.inherits=function(V,$){V.super_=$,V.prototype=Object.create($.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}})},g.mixin=function(V,$){for(var oe in $)V[oe]=$[oe];return V},g.implement=function(V,$){g.mixin(V,$)}}),ace.define("ace/lib/useragent",["require","exports","module"],function(r,g,k){g.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},g.getOS=function(){return g.isMac?g.OS.MAC:g.isLinux?g.OS.LINUX:g.OS.WINDOWS};var V=typeof navigator=="object"?navigator:{},$=(/mac|win|linux/i.exec(V.platform)||["other"])[0].toLowerCase(),oe=V.userAgent||"",re=V.appName||"";g.isWin=$=="win",g.isMac=$=="mac",g.isLinux=$=="linux",g.isIE=re=="Microsoft Internet Explorer"||re.indexOf("MSAppHost")>=0?parseFloat((oe.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((oe.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),g.isOldIE=g.isIE&&g.isIE<9,g.isGecko=g.isMozilla=oe.match(/ Gecko\/\d+/),g.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",g.isWebKit=parseFloat(oe.split("WebKit/")[1])||void 0,g.isChrome=parseFloat(oe.split(" Chrome/")[1])||void 0,g.isEdge=parseFloat(oe.split(" Edge/")[1])||void 0,g.isAIR=oe.indexOf("AdobeAIR")>=0,g.isAndroid=oe.indexOf("Android")>=0,g.isChromeOS=oe.indexOf(" CrOS ")>=0,g.isIOS=/iPad|iPhone|iPod/.test(oe)&&!window.MSStream,g.isIOS&&(g.isMac=!0),g.isMobile=g.isIOS||g.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(r,g,k){var V=r("./useragent"),$="http://www.w3.org/1999/xhtml";g.buildDom=function le(Ie,ue,de){if(typeof Ie=="string"&&Ie){var Ne=document.createTextNode(Ie);return ue&&ue.appendChild(Ne),Ne}if(!Array.isArray(Ie))return Ie&&Ie.appendChild&&ue&&ue.appendChild(Ie),Ie;if(typeof Ie[0]!="string"||!Ie[0]){for(var he=[],pe=0;pe<Ie.length;pe++){var ze=le(Ie[pe],ue,de);ze&&he.push(ze)}return he}var Fe=document.createElement(Ie[0]),xe=Ie[1],_e=1;xe&&typeof xe=="object"&&!Array.isArray(xe)&&(_e=2);for(var pe=_e;pe<Ie.length;pe++)le(Ie[pe],Fe,de);return _e==2&&Object.keys(xe).forEach(function(Dt){var $e=xe[Dt];Dt==="class"?Fe.className=Array.isArray($e)?$e.join(" "):$e:typeof $e=="function"||Dt=="value"||Dt[0]=="$"?Fe[Dt]=$e:Dt==="ref"?de&&(de[$e]=Fe):Dt==="style"?typeof $e=="string"&&(Fe.style.cssText=$e):$e!=null&&Fe.setAttribute(Dt,$e)}),ue&&ue.appendChild(Fe),Fe},g.getDocumentHead=function(le){return le||(le=document),le.head||le.getElementsByTagName("head")[0]||le.documentElement},g.createElement=function(le,Ie){return document.createElementNS?document.createElementNS(Ie||$,le):document.createElement(le)},g.removeChildren=function(le){le.innerHTML=""},g.createTextNode=function(le,Ie){var ue=Ie?Ie.ownerDocument:document;return ue.createTextNode(le)},g.createFragment=function(le){var Ie=le?le.ownerDocument:document;return Ie.createDocumentFragment()},g.hasCssClass=function(le,Ie){var ue=(le.className+"").split(/\s+/g);return ue.indexOf(Ie)!==-1},g.addCssClass=function(le,Ie){g.hasCssClass(le,Ie)||(le.className+=" "+Ie)},g.removeCssClass=function(le,Ie){for(var ue=le.className.split(/\s+/g);;){var de=ue.indexOf(Ie);if(de==-1)break;ue.splice(de,1)}le.className=ue.join(" ")},g.toggleCssClass=function(le,Ie){for(var ue=le.className.split(/\s+/g),de=!0;;){var Ne=ue.indexOf(Ie);if(Ne==-1)break;de=!1,ue.splice(Ne,1)}return de&&ue.push(Ie),le.className=ue.join(" "),de},g.setCssClass=function(le,Ie,ue){ue?g.addCssClass(le,Ie):g.removeCssClass(le,Ie)},g.hasCssString=function(le,Ie){var ue=0,de;if(Ie=Ie||document,de=Ie.querySelectorAll("style")){for(;ue<de.length;)if(de[ue++].id===le)return!0}},g.removeElementById=function(le,Ie){Ie=Ie||document,Ie.getElementById(le)&&Ie.getElementById(le).remove()};var oe,re=[];g.useStrictCSP=function(le){oe=le,le==!1?Ce():re||(re=[])};function Ce(){var le=re;re=null,le&&le.forEach(function(Ie){ie(Ie[0],Ie[1])})}function ie(le,Ie,ue){if(!(typeof document>"u")){if(re){if(ue)Ce();else if(ue===!1)return re.push([le,Ie])}if(!oe){var de=ue;!ue||!ue.getRootNode?de=document:(de=ue.getRootNode(),(!de||de==ue)&&(de=document));var Ne=de.ownerDocument||de;if(Ie&&g.hasCssString(Ie,de))return null;Ie&&(le+=`
353
+ `)("x-vue-echarts")}catch{return w=!1}return w=!0}(),U="ecTheme",S=vue.defineComponent({name:"echarts",props:O(O({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},_),L),emits:{},inheritAttrs:!1,setup:function(i,n){var r=n.attrs,g=vue.shallowRef(),k=vue.shallowRef(),V=vue.shallowRef(),$=vue.inject("ecTheme",null),oe=vue.inject("ecInitOptions",null),re=vue.inject("ecUpdateOptions",null),Ce=vue.toRefs(i),ie=Ce.autoresize,ae=Ce.manualUpdate,le=Ce.loading,Ie=Ce.loadingOptions,ue=vue.computed(function(){return V.value||i.option||null}),de=vue.computed(function(){return i.theme||j($,{})}),Ne=vue.computed(function(){return i.initOptions||j(oe,{})}),he=vue.computed(function(){return i.updateOptions||j(re,{})}),pe=vue.computed(function(){return function($e){var Ue={};for(var Ve in $e)x(Ve)||(Ue[Ve]=$e[Ve]);return Ue}(r)}),ze=vue.getCurrentInstance().proxy.$listeners;function Fe($e){if(g.value){var Ue=k.value=init(g.value,de.value,Ne.value);i.group&&(Ue.group=i.group);var Ve=ze;Ve||(Ve={},Object.keys(r).filter(function(At){return At.indexOf("on")===0&&At.length>2}).forEach(function(At){var qe=At.charAt(2).toLowerCase()+At.slice(3);qe.substring(qe.length-4)==="Once"&&(qe="~".concat(qe.substring(0,qe.length-4))),Ve[qe]=r[At]})),Object.keys(Ve).forEach(function(At){var qe=Ve[At];if(qe){var Lt=At.toLowerCase();Lt.charAt(0)==="~"&&(Lt=Lt.substring(1),qe.__once__=!0);var kt=Ue;if(Lt.indexOf("zr:")===0&&(kt=Ue.getZr(),Lt=Lt.substring(3)),qe.__once__){delete qe.__once__;var jt=qe;qe=function(){for(var ti=[],ei=0;ei<arguments.length;ei++)ti[ei]=arguments[ei];jt.apply(void 0,ti),kt.off(Lt,qe)}}kt.on(Lt,qe)}}),ie.value?vue.nextTick(function(){Ue&&!Ue.isDisposed()&&Ue.resize(),Oe()}):Oe()}function Oe(){var At=$e||ue.value;At&&Ue.setOption(At,he.value)}}function xe(){k.value&&(k.value.dispose(),k.value=void 0)}var _e=null;vue.watch(ae,function($e){typeof _e=="function"&&(_e(),_e=null),$e||(_e=vue.watch(function(){return i.option},function(Ue,Ve){Ue&&(k.value?k.value.setOption(Ue,O({notMerge:Ue.value!==(Ve==null?void 0:Ve.value)},he.value)):Fe())},{deep:!0}))},{immediate:!0}),vue.watch([de,Ne],function(){xe(),Fe()},{deep:!0}),vue.watchEffect(function(){i.group&&k.value&&(k.value.group=i.group)});var Dt=y(k);return function($e,Ue,Ve){var Oe=vue.inject("ecLoadingOptions",{}),At=vue.computed(function(){return O(O({},j(Oe,{})),Ve==null?void 0:Ve.value)});vue.watchEffect(function(){var qe=$e.value;qe&&(Ue.value?qe.showLoading(At.value):qe.hideLoading())})}(k,le,Ie),function($e,Ue,Ve){var Oe=null;vue.watch([Ve,$e,Ue],function(At,qe,Lt){var kt=At[0],jt=At[1],ti=At[2];kt&&jt&&ti&&(Oe=throttle$1(function(){jt.resize()},100),addListener(kt,Oe)),Lt(function(){Oe&&kt&&removeListener(kt,Oe)})})}(k,ie,g),vue.onMounted(function(){Fe()}),vue.onBeforeUnmount(function(){T&&g.value?g.value.__dispose=xe:xe()}),O({chart:k,root:g,setOption:function($e,Ue){i.manualUpdate&&(V.value=$e),k.value?k.value.setOption($e,Ue||{}):Fe($e)},nonEventAttrs:pe},Dt)},render:function(){var i=O({},this.nonEventAttrs);return i.ref="root",i.class=i.class?["echarts"].concat(i.class):"echarts",vue.h("x-vue-echarts",i)}});const _sfc_main$l=vue.defineComponent({__name:"pie-charts",props:{title:{type:String,default:"标题"},seriesName:{type:String,default:"详情"},seriesData:{type:Array,default:()=>[]}},setup(i){const n=i;use([install$7,install$6,install$3,install$4,install]),vue.provide(U,"dark");const r=vue.reactive({title:{text:n.title,left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:n.seriesName,type:"pie",radius:"55%",center:["50%","60%"],data:n.seriesData,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]});return vue.watch(n,g=>{r.title.text=g.title,r.series[0].name=g.seriesName,r.series[0].data=g.seriesData}),(g,k)=>(vue.openBlock(),vue.createBlock(vue.unref(S),{class:"chart",option:r,autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_2dc3e6cb_lang="",_export_sfc=(i,n)=>{const r=i.__vccOpts||i;for(const[g,k]of n)r[g]=k;return r},PieCharts=_export_sfc(_sfc_main$l,[["__scopeId","data-v-2dc3e6cb"]]),_hoisted_1$g=["id"],_hoisted_2$e=["id"],_hoisted_3$c=["fill"],_hoisted_4$9=["fill"],_hoisted_5$8=["fill"],_hoisted_6$5=vue.createElementVNode("path",{d:"M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",fill:"#2D4375"},null,-1),_hoisted_7$5=vue.createElementVNode("path",{d:"M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z",fill:"#1E2D4F"},null,-1),_hoisted_8$4=["fill-opacity"],_hoisted_9$3=["fill-opacity"],_hoisted_10$3=["fill-opacity"],_hoisted_11$3=vue.createElementVNode("path",{d:"M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z",fill:"#CEEFF6"},null,-1),_hoisted_12$1=vue.createElementVNode("path",{d:"M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z",fill:"#FFFFFF"},null,-1),_hoisted_13$1=vue.createElementVNode("path",{d:"M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",fill:"#CEEFF6"},null,-1),_hoisted_14$1=["xlink:href"],_sfc_main$k=vue.defineComponent({__name:"light-a",props:{id:{default:""},isOpen:{type:Boolean,default:!1}},emits:["onChange"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.isOpen,()=>{n("onChange")}),(g,k)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id,style:{cursor:"pointer"}},[vue.createElementVNode("symbol",{id:`${r.id}light-121`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z",fill:r.isOpen?"#FDB813":"#cccccc"},null,8,_hoisted_3$c),vue.createElementVNode("path",{d:"M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z",fill:r.isOpen?"#FD9B13":"#bbbbbb"},null,8,_hoisted_4$9),vue.createElementVNode("path",{d:"M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z",fill:r.isOpen?"#F12A3F":"#666666"},null,8,_hoisted_5$8),_hoisted_6$5,_hoisted_7$5,vue.createElementVNode("path",{d:"M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_8$4),vue.createElementVNode("path",{d:"M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_9$3),vue.createElementVNode("path",{d:"M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_10$3),_hoisted_11$3,_hoisted_12$1,_hoisted_13$1],8,_hoisted_2$e),vue.createElementVNode("use",{"xlink:href":`#${r.id}light-121`,width:"100",height:"100"},null,8,_hoisted_14$1)],8,_hoisted_1$g))}}),_hoisted_1$f=["id"],_hoisted_2$d=["id"],_hoisted_3$b=vue.createElementVNode("path",{d:"M512.3 518.9m-469.2 0a469.2 469.2 0 1 0 938.4 0 469.2 469.2 0 1 0-938.4 0Z",fill:"#429BCF"},null,-1),_hoisted_4$8=vue.createElementVNode("path",{d:"M512.3 518.9m-392.5 0a392.5 392.5 0 1 0 785 0 392.5 392.5 0 1 0-785 0Z",fill:"#FFFFFF"},null,-1),_hoisted_5$7={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1-6.8-6.8-6.8-17.9 0-24.8l130.8-130.8c6.8-6.8 17.9-6.8 24.8 0 6.8 6.8 6.8 17.9 0 24.8L524.7 518.7c-3.5 3.4-7.9 5.1-12.4 5.1z",fill:"#2D416C"},_hoisted_6$4=["from","to"],_hoisted_7$4={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1L318.3 337.1c-6.8-6.8-6.8-17.9 0-24.8 6.8-6.8 17.9-6.8 24.8 0L524.7 494c6.8 6.8 6.8 17.9 0 24.8-3.5 3.3-7.9 5-12.4 5z",fill:"#365087"},_hoisted_8$3=["from","to"],_hoisted_9$2=vue.createElementVNode("path",{d:"M512.3 506.3m-47.5 0a47.5 47.5 0 1 0 95 0 47.5 47.5 0 1 0-95 0Z",fill:"#365087"},null,-1),_hoisted_10$2=vue.createElementVNode("path",{d:"M512.3 218.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM512.3 880.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM812.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3zM150.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3z",fill:"#2D416C"},null,-1),_hoisted_11$2={d:"M296.9 733.5c-2.2 0-4.5-0.9-6.2-2.6-3.4-3.4-3.4-9 0-12.4L540 469.2c3.4-3.4 9-3.4 12.4 0 3.4 3.4 3.4 9 0 12.4L303.1 731c-1.7 1.7-4 2.5-6.2 2.5z",fill:"#C11B16"},_hoisted_12=["from","to"],_hoisted_13=vue.createElementVNode("path",{d:"M512.3 506.3m-22.8 0a22.8 22.8 0 1 0 45.6 0 22.8 22.8 0 1 0-45.6 0Z",fill:"#fff"},null,-1),_hoisted_14=["xlink:href"],_sfc_main$j=vue.defineComponent({__name:"clock-a",props:{id:{default:""}},setup(i){const n=i,r=vue.ref(new Date),g=r.value.getSeconds(),k=r.value.getMinutes(),V=Math.floor((r.value.getHours()+(k+g/60)/60)*30);return($,oe)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[_hoisted_3$b,_hoisted_4$8,vue.createElementVNode("path",_hoisted_5$7,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(V)} 512.3 506.3`,to:`${315+vue.unref(V)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_6$4)]),vue.createElementVNode("path",_hoisted_7$4,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(k)*6} 512.3 506.3`,to:`${405+vue.unref(k)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_8$3)]),_hoisted_9$2,_hoisted_10$2,vue.createElementVNode("path",_hoisted_11$2,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+vue.unref(g)*6} 512.3 506.3`,to:`${495.5+vue.unref(g)*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12)]),_hoisted_13],8,_hoisted_2$d),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"200",height:"200"},null,8,_hoisted_14)],8,_hoisted_1$f))}}),vueComp={"svg-text":_sfc_main$o,"el-button":ElButton,"progress-a":_sfc_main$q,"el-tag":ElTag,"common-table":_sfc_main$n,"pie-charts":PieCharts,"switch-a":_sfc_main$p,"now-time":_sfc_main$m,"light-a":_sfc_main$k,"clock-a":_sfc_main$j},config=[...svg_config,...vue_config];var EGlobalStoreIntention=(i=>(i.None="None",i.Create="Create",i.Move="Move",i.MoveCanvas="MoveCanvas",i.Select="Select",i.Zoom="Zoom",i.Rotate="Rotate",i.Connection="Connection",i.SetConnectionLineNode="SetConnectionLineNode",i.ContextMenu="ContextMenu",i))(EGlobalStoreIntention||{}),EMouseInfoState=(i=>(i.Down="Down",i.Up="Up",i))(EMouseInfoState||{}),EScaleInfoType=(i=>(i.None="",i.TopLeft="TopLeft",i.TopCenter="TopCenter",i.TopRight="TopRight",i.Left="Left",i.Right="Right",i.BottomLeft="BottomLeft",i.BottomCenter="BottomCenter",i.BottomRight="BottomRight",i))(EScaleInfoType||{});const useGlobalStore=pinia$1.defineStore("global-store",{state:()=>({config_center:config,intention:EGlobalStoreIntention.None,create_svg_info:null,done_json:[],mouse_info:{state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},handle_svg_info:null,scale_info:{type:EScaleInfoType.None,scale_times:{x:1,y:1},scale_item_info:{x:0,y:0},symmetric_point:{x:0,y:0}},rotate_info:{angle:0},connection_line_node_info:{init_pos:{x:0,y:0},point_index:0}}),getters:{},actions:{setCreateInfo(i){this.intention=EGlobalStoreIntention.Create,this.create_svg_info=i},setDoneJson(i){isOfType(i,"id")?(this.done_json.push(i),vue.nextTick(()=>{setSvgActualInfo(i)})):this.done_json=objectDeepClone(i),vue.nextTick(()=>{useHistoryRecord(objectDeepClone(this.done_json))})},setMouseInfo(i){this.mouse_info=i},setHandleSvgInfo(i,n){let r=n;i?(!r&&r!=0&&(r=this.done_json.findIndex(g=>g.id===i.id)??-1),this.handle_svg_info={info:i,index:r}):this.handle_svg_info=i},setScaleInfo(i){this.scale_info=i},spliceDoneJson(i){const n=useGlobalStore();n.done_json.splice(i,1),useHistoryRecord(n.done_json)}}}),useSvgEditLayoutStore=pinia$1.defineStore("svg-edit-layout-store",{state:()=>({left_nav:!0,right_nav:!0,center_offset:{x:0,y:0}})});var EContextMenuInfoType=(i=>(i.Copy="Copy",i.Delete="Delete",i.MoveUpOneLevel="MoveUpOneLevel",i.MoveDownOneLevel="MoveDownOneLevel",i.MoveUpTopLevel="MoveUpTopLevel",i.MoveDownTopLevel="MoveDownTopLevel",i))(EContextMenuInfoType||{});const useEditPrivateStore=pinia$1.defineStore("edit-private-store",{state:()=>({old_done_components:[],history_doneComponent:[],history_now_index:0,is_record_history:!0,max_record_times:10}),getters:{getTopBtnUndoStatus(i){return i.history_now_index>=1},getTopBtnRedoStatus(i){return i.history_now_index+1!=i.history_doneComponent.length}},actions:{topUndoBtnClick(){if(console.log("撤销"),this.history_now_index<1)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index-=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])},topRedoBtnClick(){if(console.log("重做"),this.history_now_index+1==this.history_doneComponent.length)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index+=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])}}}),useContextMenuStore=pinia$1.defineStore("context-menu-store",{state:()=>({display:!1,info:{[EContextMenuInfoType.Copy]:{title:"复制",hot_key:"Ctrl+C",enable:!0},[EContextMenuInfoType.Delete]:{title:"删除",hot_key:"Delete",enable:!0},[EContextMenuInfoType.MoveUpTopLevel]:{title:"置于顶层",hot_key:"Ctrl+→",enable:!0},[EContextMenuInfoType.MoveDownTopLevel]:{title:"置于底层",hot_key:"Ctrl+←",enable:!0},[EContextMenuInfoType.MoveUpOneLevel]:{title:"置于上一层",hot_key:"Ctrl+↑",enable:!0},[EContextMenuInfoType.MoveDownOneLevel]:{title:"置于下一层",hot_key:"Ctrl+↓",enable:!0}}}),actions:{onContextMenuClick(i){const n=useGlobalStore();if(n.handle_svg_info)switch(n.intention=EGlobalStoreIntention.Select,i){case EContextMenuInfoType.Copy:const r=objectDeepClone(n.handle_svg_info.info);r.id=r.name+randomString(),r.title+="-copy",r.x+=10,r.y+=10,n.setDoneJson(r),this.display=!1,n.setHandleSvgInfo(r,n.done_json.length);break;case EContextMenuInfoType.Delete:n.spliceDoneJson(n.handle_svg_info.index),this.display=!1,n.setHandleSvgInfo(null),n.intention=EGlobalStoreIntention.None;break;case EContextMenuInfoType.MoveUpOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length-1)return;const g=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index+1],n.done_json[n.handle_svg_info.index+1]=g,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(g,n.handle_svg_info.index+1);break;case EContextMenuInfoType.MoveDownOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const k=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index-1],n.done_json[n.handle_svg_info.index-1]=k,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(k,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const V=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(V),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(V,0);break;case EContextMenuInfoType.MoveUpTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length)return;const $=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.push($),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo($,n.done_json.length-1);break}}}}),pinia=pinia$1.createPinia(),useHistoryRecord=i=>{const n=useEditPrivateStore();n.is_record_history&&(n.history_now_index+1<n.history_doneComponent.length&&n.history_doneComponent.splice(n.history_now_index+1),n.history_doneComponent.push(i),n.history_now_index=n.history_doneComponent.length-1,n.history_doneComponent.length>n.max_record_times&&(n.history_doneComponent.shift(),n.history_now_index=n.history_doneComponent.length-1)),n.is_record_history=!0},useImportDataModel=i=>{try{const n=JSON.parse(i);if(!n.config||!n.layout_center||!n.done_json)return ElMessage.error("请导入正确的数据模型!"),!1;const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=useConfigStore(pinia);return k.$state=n.config,g.center_offset=n.layout_center,r.setDoneJson(n.done_json),!0}catch(n){return ElMessage.error("请导入正确的数据模型!"),console.error(n),!1}},_hoisted_1$e={"aria-hidden":"true"},_hoisted_2$c=["xlink:href"],_sfc_main$i=vue.defineComponent({__name:"index",props:{name:{},props:{default:()=>({})}},setup(i){const n=i,r=vue.computed(()=>`#svg-${n.name}`);return(g,k)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$e,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":r.value},n.props),null,16,_hoisted_2$c)]))}});var EVisibleConfKey=(i=>(i.ImportJson="ImportJson",i.ExportJson="ExportJson",i.ImportFile="ImportFile",i))(EVisibleConfKey||{});const _withScopeId$3=i=>(vue.pushScopeId("data-v-b0ad1445"),i=i(),vue.popScopeId(),i),_hoisted_1$d={class:"flex justify-between",style:{width:"100%"}},_hoisted_2$b={class:"flex items-center justify-between",style:{width:"220px"}},_hoisted_3$a=_withScopeId$3(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"组态编辑器")],-1)),_hoisted_4$7={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$3={class:"flex items-center mr-20px"},_hoisted_7$3={class:"flex items-center",style:{width:"220px"}},_sfc_main$h=vue.defineComponent({__name:"index",emits:["changeVisible","onReturn","onPreview","onSave"],setup(i,{emit:n}){const r=useSvgEditLayoutStore(pinia),g=useGlobalStore(pinia),k=useEditPrivateStore(pinia),V=useConfigStore(pinia),$=()=>{g.done_json.length<=0||g.setDoneJson([]),g.intention=EGlobalStoreIntention.None},oe=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onPreview",Ce)},re=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onSave",Ce)};return(Ce,ie)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$b,[_hoisted_3$a,vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[0]||(ie[0]=ae=>vue.unref(r).left_nav=!vue.unref(r).left_nav)},{default:vue.withCtx(()=>[vue.unref(r).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-fold"}))]),_:1})]),vue.createElementVNode("div",_hoisted_4$7,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(ElIcon),{title:"撤销 ctrl+z",size:20,class:vue.normalizeClass(`${vue.unref(k).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:ie[1]||(ie[1]=()=>vue.unref(k).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"undo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(k).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:20,onClick:ie[2]||(ie[2]=()=>vue.unref(k).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"redo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"清空 ctrl+delete",class:vue.normalizeClass(`${vue.unref(g).done_json.length>0?"bt-Icon":"icon-disable"}`),size:20,onClick:$},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"导入数据模型",class:"bt-Icon",size:20,onClick:ie[3]||(ie[3]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"import"})]),_:1}),vue.createVNode(vue.unref(ElIcon),{title:"导出数据模型",size:20,class:"bt-Icon ml-5px",onClick:ie[4]||(ie[4]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"export"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$3,[vue.createVNode(vue.unref(ElIcon),{title:"返回",class:"bt-Icon",size:20,onClick:ie[5]||(ie[5]=ae=>n("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"return"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"保存",class:"bt-Icon",size:20,onClick:re},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"save"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:oe},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$3,[vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[6]||(ie[6]=ae=>vue.unref(r).right_nav=!vue.unref(r).right_nav)},{default:vue.withCtx(()=>[vue.unref(r).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-unfold"}))]),_:1})])]))}}),index_vue_vue_type_style_index_0_scoped_b0ad1445_lang="",TopPanel=_export_sfc(_sfc_main$h,[["__scopeId","data-v-b0ad1445"]]),_hoisted_1$c={style:{"font-weight":"bold"}},_hoisted_2$a={class:"component-group flex flex-wrap"},_hoisted_3$9=["onDragstart","title"],_sfc_main$g=vue.defineComponent({__name:"index",props:{customToolbar:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=vue.ref(n.customToolbar&&Object.keys(n.customToolbar).length>0?n.customToolbar:r.config_center),k=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),V=oe=>{r.setCreateInfo(oe)},$=oe=>{var re;if(((re=oe.dataTransfer)==null?void 0:re.dropEffect)!=="copy"){ElMessage.warning("请将组件拖到画布中!"),r.intention=EGlobalStoreIntention.None;return}};return(oe,re)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElCollapse),{modelValue:k.value,"onUpdate:modelValue":re[0]||(re[0]=Ce=>k.value=Ce)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(g.value,Ce=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:Ce.groupType,key:Ce.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$c,vue.toDisplayString(Ce.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$a,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ce.list,ie=>(vue.openBlock(),vue.createElementBlock("div",{class:"ideal",key:ie.name,draggable:"true",onDragstart:ae=>V(ie),onDragend:$,title:ie.title},[vue.createVNode(vue.unref(ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:ie.name,props:vue.unref(prosToVBind)(ie)},null,8,["name","props"])]),_:2},1024)],40,_hoisted_3$9))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_e00305dc_lang="",LeftPanel=_export_sfc(_sfc_main$g,[["__scopeId","data-v-e00305dc"]]),calculateLeftTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateTop=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateRight=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateLeft=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},_hoisted_1$b={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$9=["fill","x","y"],_hoisted_3$8=["cx","cy"],_hoisted_4$6=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$2=["fill","x","y"],_hoisted_7$2=["fill","x","y"],_hoisted_8$2=["fill","x","y"],_hoisted_9$1=["fill","x","y"],_hoisted_10$1=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$f=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i;vue.useCssVars(ie=>({d86744e2:V.value}));const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=[{start:338,end:23,cursor:"nw",type:EScaleInfoType.TopLeft},{start:23,end:68,cursor:"n",type:EScaleInfoType.TopCenter},{start:68,end:113,cursor:"ne",type:EScaleInfoType.TopRight},{start:293,end:338,cursor:"w",type:EScaleInfoType.Left},{start:113,end:158,cursor:"e",type:EScaleInfoType.Right},{start:248,end:293,cursor:"sw",type:EScaleInfoType.BottomLeft},{start:203,end:248,cursor:"s",type:EScaleInfoType.BottomCenter},{start:158,end:203,cursor:"se",type:EScaleInfoType.BottomRight}],oe=(ie,ae)=>{console.log("onHandleMouseDown",ae);const{clientX:le,clientY:Ie}=ae;ae.stopPropagation(),r.intention=EGlobalStoreIntention.Zoom,r.setMouseInfo({state:EMouseInfoState.Down,position_x:le-g.center_offset.x,position_y:Ie-g.center_offset.y,now_position_x:le-g.center_offset.x,now_position_y:Ie-g.center_offset.y,new_position_x:0,new_position_y:0}),r.setScaleInfo({type:ie,scale_times:{x:n.itemInfo.scale_x,y:n.itemInfo.scale_y},scale_item_info:{x:n.itemInfo.x,y:n.itemInfo.y},symmetric_point:{x:n.itemInfo.client.x+Math.abs(le-g.center_offset.x-n.itemInfo.client.x)*(le-g.center_offset.x<n.itemInfo.client.x?1:-1),y:n.itemInfo.client.y+Math.abs(Ie-g.center_offset.y-n.itemInfo.client.y)*(Ie-g.center_offset.y<n.itemInfo.client.y?1:-1)}})},re=ie=>{const{clientX:ae,clientY:le}=ie;ie.stopPropagation(),r.intention=EGlobalStoreIntention.Rotate,r.rotate_info={angle:n.itemInfo.rotate},r.setMouseInfo({state:EMouseInfoState.Down,position_x:ae-g.center_offset.x,position_y:le-g.center_offset.y,now_position_x:ae-g.center_offset.x,now_position_y:le-g.center_offset.y,new_position_x:0,new_position_y:0})},Ce=ie=>{const ae=(ie+n.itemInfo.rotate)%360,le=$.find(Ie=>Ie.start<=ae&&Ie.end>ae);return le?{cursor:le.cursor+"-resize",type:le.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(ie,ae)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$b,[vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[0]||(ae[0]=le=>oe(vue.unref(EScaleInfoType).TopLeft,le))},null,44,_hoisted_2$9),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:re},null,40,_hoisted_3$8),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),x2:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y2:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:V.value,"stroke-width":2})},null,12,_hoisted_4$6),vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value,y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[1]||(ae[1]=le=>oe(vue.unref(EScaleInfoType).TopCenter,le))},null,44,_hoisted_5$5),vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-k.value+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[2]||(ae[2]=le=>oe(vue.unref(EScaleInfoType).TopRight,le))},null,44,_hoisted_6$2),vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[3]||(ae[3]=le=>oe(vue.unref(EScaleInfoType).Left,le))},null,44,_hoisted_7$2),vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[4]||(ae[4]=le=>oe(vue.unref(EScaleInfoType).Right,le))},null,44,_hoisted_8$2),vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[5]||(ae[5]=le=>oe(vue.unref(EScaleInfoType).BottomLeft,le))},null,44,_hoisted_9$1),vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[6]||(ae[6]=le=>oe(vue.unref(EScaleInfoType).BottomCenter,le))},null,44,_hoisted_10$1),vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[7]||(ae[7]=le=>oe(vue.unref(EScaleInfoType).BottomRight,le))},null,44,_hoisted_11$1)]))}}),index_vue_vue_type_style_index_0_scoped_450fe66d_lang="",HandlePanel=_export_sfc(_sfc_main$f,[["__scopeId","data-v-450fe66d"]]),_hoisted_1$a={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$8=["cx","cy","r","fill"],_hoisted_3$7=["cx","cy","r","fill"],_hoisted_4$5=["cx","cy","r","fill"],_hoisted_5$4=["cx","cy","r","fill"],_sfc_main$e=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=useConfigStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=vue.ref(4),oe=(re,Ce)=>{Ce.preventDefault();const{clientX:ie,clientY:ae}=Ce;let le=objectDeepClone(g.connection_line);console.log("onConnectionMouseDown",g.connection_line,Ce),le.bind_anchors.start={type:re,target_id:n.itemInfo.id};const{x:Ie,y:ue}=getAnchorPosByAnchorType(re,n.itemInfo),de={id:straight_line_system.name+randomString(),x:Ie,y:ue,client:{x:ie,y:ae},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...le};de.props.point_position.val.push({x:g.svg.svg_position_center.x,y:g.svg.svg_position_center.y}),r.setHandleSvgInfo(de,r.done_json.length),r.setDoneJson(de),r.intention=EGlobalStoreIntention.Connection,r.setMouseInfo({state:EMouseInfoState.Down,position_x:ie,position_y:ae,now_position_x:ie,now_position_y:ae,new_position_x:0,new_position_y:0})};return(re,Ce)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$a,[vue.createElementVNode("circle",{id:"connection_tc",cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value+$.value,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[0]||(Ce[0]=ie=>oe(vue.unref(ELineBindAnchors).TopCenter,ie))},null,40,_hoisted_2$8),vue.createElementVNode("circle",{id:"connection_l",cx:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[1]||(Ce[1]=ie=>oe(vue.unref(ELineBindAnchors).Left,ie))},null,40,_hoisted_3$7),vue.createElementVNode("circle",{id:"connection_r",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[2]||(Ce[2]=ie=>oe(vue.unref(ELineBindAnchors).Right,ie))},null,40,_hoisted_4$5),vue.createElementVNode("circle",{id:"connection_bc",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[3]||(Ce[3]=ie=>oe(vue.unref(ELineBindAnchors).BottomCenter,ie))},null,40,_hoisted_5$4)]))}}),_hoisted_1$9=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_2$7=["from","to","dur","repeatCount"],_hoisted_3$6=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$4=["from","to","dur","repeatCount"],_hoisted_5$3=["r","fill"],_hoisted_6$1=["path","dur","repeatCount"],_hoisted_7$1={key:2},_hoisted_8$1=["cx","cy","stroke","onMousedown"],_sfc_main$d=vue.defineComponent({__name:"index",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(i){const n=i,r=useGlobalStore(pinia),g=(k,V,$,oe)=>{if(r.intention===EGlobalStoreIntention.Connection)return;r.setHandleSvgInfo(n.itemInfo);const{clientX:re,clientY:Ce}=V;V.stopPropagation(),r.connection_line_node_info={init_pos:{x:$,y:oe},point_index:k},r.intention=EGlobalStoreIntention.SetConnectionLineNode,r.setMouseInfo({state:EMouseInfoState.Down,position_x:re,position_y:Ce,now_position_x:re,now_position_y:Ce,new_position_x:0,new_position_y:0})};return(k,V)=>{var $,oe,re,Ce,ie;return vue.openBlock(),vue.createElementBlock("g",null,[vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:(($=n.itemInfo.animations)==null?void 0:$.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","stroke-dasharray":((oe=n.itemInfo.animations)==null?void 0:oe.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0},[((re=n.itemInfo.animations)==null?void 0:re.type.val)===vue.unref(EConfigAnimationsType).Electricity?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_2$7)):vue.createCommentVNode("",!0)],8,_hoisted_1$9),((Ce=n.itemInfo.animations)==null?void 0:Ce.type.val)===vue.unref(EConfigAnimationsType).WaterDrop?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:n.itemInfo.animations.color.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dasharray":n.itemInfo.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val,fill:"freeze"},null,8,_hoisted_4$4)],8,_hoisted_3$6)):((ie=n.itemInfo.animations)==null?void 0:ie.type.val)===vue.unref(EConfigAnimationsType).Track?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:n.itemInfo.props["stroke-width"].val*2,fill:n.itemInfo.animations.color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrToPath)(n.itemInfo.animations.reverse.val?[...n.itemInfo.props.point_position.val].reverse():n.itemInfo.props.point_position.val),dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_6$1)],8,_hoisted_5$3)):vue.createCommentVNode("",!0),n.pointVisible?(vue.openBlock(),vue.createElementBlock("g",_hoisted_7$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(ae,le)=>(vue.openBlock(),vue.createElementBlock("circle",{key:le,cx:ae.x,cy:ae.y,r:"6","stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:Ie=>g(le,Ie,ae.x,ae.y)},null,40,_hoisted_8$1))),128))])):vue.createCommentVNode("",!0)])}}}),_withScopeId$2=i=>(vue.pushScopeId("data-v-b0d244b1"),i=i(),vue.popScopeId(),i),_hoisted_1$8=_withScopeId$2(()=>vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",{id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"10",height:"10"},[vue.createElementVNode("rect",{width:"1",height:"1",rx:"1",ry:"1",fill:"#aaaaaa"})])],-1)),_hoisted_2$6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_3$5=["transform"],_hoisted_4$3=["transform"],_hoisted_5$2=["transform","onMousedown","onMouseenter","onMouseleave","onContextmenu"],_hoisted_6=["xlink:href","id","transform"],_hoisted_7=["id"],_hoisted_8=["id","x1","y1","x2","y2"],_hoisted_9=["id"],_hoisted_10=["onClick"],_hoisted_11={class:"shortcut"},_sfc_main$c=vue.defineComponent({__name:"index",setup(i){vue.useCssVars(Ue=>({"36a85969":Ce.value}));const n=vue.getCurrentInstance();Object.keys(vueComp).forEach(Ue=>{var Ve;Object.keys((Ve=n==null?void 0:n.appContext)==null?void 0:Ve.components).includes(Ue)||n==null||n.appContext.app.component(Ue,vueComp[Ue])});const r=useGlobalStore(pinia),g=useConfigStore(pinia),k=useSvgEditLayoutStore(pinia),V=useEditPrivateStore(pinia),$=useContextMenuStore(pinia),oe=vue.ref(),re=vue.ref(),Ce=vue.computed(()=>r.intention==EGlobalStoreIntention.MoveCanvas?"grab":r.intention==EGlobalStoreIntention.Rotate?"url('/src/assets/icons/rotate.svg') 12 12, auto":"default"),ie=vue.reactive({handle_panel:vue.computed(()=>r.intention===EGlobalStoreIntention.Select||r.intention===EGlobalStoreIntention.Zoom||r.intention===EGlobalStoreIntention.Rotate),connection_panel:!1,connection_line:!1,select_item:{info:null,index:-1}}),ae=Ue=>{var Ve;if(r.intention!=EGlobalStoreIntention.None){if(r.intention==EGlobalStoreIntention.Create){if(!r.create_svg_info){console.error("要创建的数据获取失败");return}const Oe=Math.floor(Ue.clientX-k.center_offset.x),At=Math.floor(Ue.clientY-k.center_offset.y),qe={id:randomString(),x:Oe,y:At,client:{x:Oe,y:At},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...objectDeepClone(r.create_svg_info)};r.setHandleSvgInfo(qe,r.done_json.length),r.setDoneJson(qe),r.intention=EGlobalStoreIntention.None}(Ve=re.value)==null||Ve.focus()}},le=Ue=>{Ue.preventDefault()},Ie=Ue=>{Ue.preventDefault()},ue=(Ue,Ve,Oe)=>{var At;(At=re.value)==null||At.focus(),r.intention!==EGlobalStoreIntention.Connection&&(Oe.preventDefault(),Oe.stopPropagation(),r.intention=EGlobalStoreIntention.Select,r.setHandleSvgInfo(Ue,Ve),r.setMouseInfo({state:EMouseInfoState.Down,position_x:Oe.clientX,position_y:Oe.clientY,now_position_x:Ue.x,now_position_y:Ue.y,new_position_x:Ue.x,new_position_y:Ue.y}))},de=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),ie.connection_panel=!0,ie.connection_line=!0,!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.select_item.info=Ue,ie.select_item.index=Ve)},Ne=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.connection_panel=!1,ie.connection_line=!1,ie.select_item.info=null,ie.select_item.index=-1)},he=Ue=>{var At,qe,Lt,kt;if(r.mouse_info.state!=EMouseInfoState.Down&&r.intention!==EGlobalStoreIntention.Connection)return;const{clientX:Ve,clientY:Oe}=Ue;if(r.mouse_info.new_position_x=r.mouse_info.now_position_x+Ve-r.mouse_info.position_x,r.mouse_info.new_position_y=r.mouse_info.now_position_y+Oe-r.mouse_info.position_y,(At=r.handle_svg_info)!=null&&At.info&&(r.intention==EGlobalStoreIntention.Select||r.intention==EGlobalStoreIntention.Move))r.handle_svg_info.info.x=r.mouse_info.new_position_x,r.handle_svg_info.info.y=r.mouse_info.new_position_y,r.handle_svg_info.info.client={x:r.mouse_info.new_position_x,y:r.mouse_info.new_position_y},r.intention=EGlobalStoreIntention.Move;else if(r.intention==EGlobalStoreIntention.MoveCanvas)k.center_offset.x=r.mouse_info.new_position_x,k.center_offset.y=r.mouse_info.new_position_y;else if(r.intention===EGlobalStoreIntention.Zoom){if(!r.handle_svg_info)return;const jt={x:Ue.clientX-k.center_offset.x,y:Ue.clientY-k.center_offset.y};let ti={width:0,height:0,is_old_width:!1,is_old_height:!1};if(r.scale_info.type===EScaleInfoType.TopLeft?ti=calculateLeftTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopRight?ti=calculateRightTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomRight?ti=calculateRightBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomLeft?ti=calculateLeftBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopCenter?ti=calculateTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Right?ti=calculateRight(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.BottomCenter?ti=calculateBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Left&&(ti=calculateLeft(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client)),r.handle_svg_info&&ti.width>0&&ti.height>0){const ei=ti.is_old_width?1:ti.width/r.handle_svg_info.info.actual_bound.width,Pt=ti.is_old_height?1:ti.height/r.handle_svg_info.info.actual_bound.height,ni=getCenterPoint(jt,r.scale_info.symmetric_point);ei>0&&r.scale_info.type!==EScaleInfoType.TopCenter&&r.scale_info.type!==EScaleInfoType.BottomCenter&&(r.handle_svg_info.info.scale_x=ei,r.handle_svg_info.info.x=getSvgNowPosition(r.handle_svg_info.info.client.x,ni.x,r.scale_info.scale_item_info.x)),Pt>0&&r.scale_info.type!==EScaleInfoType.Left&&r.scale_info.type!==EScaleInfoType.Right&&(r.handle_svg_info.info.scale_y=Pt,r.handle_svg_info.info.y=getSvgNowPosition(r.handle_svg_info.info.client.y,ni.y,r.scale_info.scale_item_info.y))}}else if(r.intention===EGlobalStoreIntention.Rotate){if(!r.handle_svg_info)return;const jt=Math.atan2(r.mouse_info.position_y-r.handle_svg_info.info.client.y,r.mouse_info.position_x-r.handle_svg_info.info.client.x)/(Math.PI/180),ti=Math.atan2(Oe-k.center_offset.y-r.handle_svg_info.info.client.y,Ve-k.center_offset.x-r.handle_svg_info.info.client.x)/(Math.PI/180);r.handle_svg_info.info.rotate=r.rotate_info.angle+ti-jt}else r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info?r.handle_svg_info.info.props.point_position.val[((qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val.length)-1]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,(Lt=r.handle_svg_info)==null?void 0:Lt.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(kt=r.handle_svg_info)==null?void 0:kt.info.props.point_position.val[0].y)}:r.intention===EGlobalStoreIntention.SetConnectionLineNode&&r.handle_svg_info&&(r.handle_svg_info.info.props.point_position.val[r.connection_line_node_info.point_index]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,r.connection_line_node_info.init_pos.x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,r.connection_line_node_info.init_pos.y)})},pe=()=>{var Ue,Ve,Oe;if(r.mouse_info.state==EMouseInfoState.Down){if((Ue=r.handle_svg_info)!=null&&Ue.info&&r.intention==EGlobalStoreIntention.Move)r.done_json[r.handle_svg_info.index].x=r.mouse_info.new_position_x,r.done_json[r.handle_svg_info.index].y=r.mouse_info.new_position_y,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.intention=EGlobalStoreIntention.None,r.setDoneJson(r.done_json);else if((Ve=r.handle_svg_info)!=null&&Ve.info&&r.intention==EGlobalStoreIntention.Zoom)r.handle_svg_info.info.client={x:r.handle_svg_info.info.x,y:r.handle_svg_info.info.y},r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else if(r.intention===EGlobalStoreIntention.Rotate&&((Oe=r.handle_svg_info)!=null&&Oe.info))setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else{if(r.intention===EGlobalStoreIntention.Connection)return;r.intention!=EGlobalStoreIntention.Select&&(r.intention=EGlobalStoreIntention.None)}r.setMouseInfo({state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}),$.display=!1}},ze=Ue=>{var At,qe;const{clientX:Ve,clientY:Oe}=Ue;if(r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info){Ue.button===0&&r.handle_svg_info.info.props.point_position.val.push({x:getSvgNowPosition(r.mouse_info.position_x,Ve,(At=r.handle_svg_info)==null?void 0:At.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val[0].y)}),Ue.button===2&&(r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]));return}r.intention=EGlobalStoreIntention.MoveCanvas,r.setMouseInfo({state:EMouseInfoState.Down,position_x:Ve,position_y:Oe,now_position_x:k.center_offset.x,now_position_y:k.center_offset.y,new_position_x:k.center_offset.x,new_position_y:k.center_offset.y})},Fe=Ue=>{Ue.stopPropagation(),Ue.preventDefault()},xe=(Ue,Ve,Oe)=>{console.log(r.intention),r.intention!==EGlobalStoreIntention.Connection&&oe.value&&(r.intention=EGlobalStoreIntention.ContextMenu,r.setHandleSvgInfo(Ue,Ve),oe.value.style.left=Oe.pageX+"px",oe.value.style.top=Oe.pageY+"px",$.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=$.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!0,Ve===r.done_json.length-1&&($.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=!1),Ve===0&&($.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!1),$.display=!0)},_e=(Ue,Ve,Oe)=>({x:Ue.x-Ue.width/2*Ve+Ue.width/2,y:Ue.y-Ue.height/2*Oe+Ue.height/2,width:Ue.width*Ve,height:Ue.height*Oe}),Dt=Ue=>{console.log(Ue,733),Ue.preventDefault(),r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowUp"?(r.done_json[r.handle_svg_info.index].y-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowDown"?(r.handle_svg_info.info.y+=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowLeft"?(r.handle_svg_info.info.x-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowRight"?(r.handle_svg_info.info.x+=1,useHistoryRecord(r.done_json)):Ue.ctrlKey&&Ue.key.toLowerCase()=="c"?$.onContextMenuClick(EContextMenuInfoType.Copy):!Ue.ctrlKey&&Ue.key=="Delete"?$.onContextMenuClick(EContextMenuInfoType.Delete):Ue.ctrlKey&&Ue.key=="ArrowUp"?$.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):Ue.ctrlKey&&Ue.key=="ArrowDown"?$.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):Ue.ctrlKey&&Ue.key=="ArrowLeft"?$.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):Ue.ctrlKey&&Ue.key=="ArrowRight"?$.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):Ue.ctrlKey&&Ue.shiftKey&&Ue.key.toLowerCase()=="z"?V.topRedoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="z"?V.topUndoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="delete"&&(r.done_json.length<=0||r.setDoneJson([]))},$e=()=>{setSvgActualInfo(r.done_json[r.handle_svg_info.index],!0)};return vue.onMounted(()=>{var Ue;(Ue=re.value)==null||Ue.focus()}),(Ue,Ve)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:re,onDrop:ae,onDragenter:le,onDragover:Ie,onMousedown:ze,onMousemove:he,onMouseup:pe,onContextmenu:Fe,onKeydown:Dt},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(g).svg.background_color}),width:"100%",height:"100%"},[_hoisted_1$8,vue.unref(g).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_2$6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(g).svg.position_center.x+vue.unref(k).center_offset.x},${vue.unref(g).svg.position_center.y+vue.unref(k).center_offset.y})rotate(0)scale(${vue.unref(g).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).done_json,(Oe,At)=>{var qe,Lt,kt,jt,ti,ei;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Oe.id,transform:`translate(${Oe.x},${Oe.y})rotate(0)scale(1)`},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Oe)}`)},[vue.createElementVNode("g",{transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2})rotate(${Oe.rotate}) scale(1) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`,onMousedown:Pt=>ue(Oe,At,Pt),onMouseenter:Pt=>de(Oe,At,Pt),onMouseleave:Pt=>Ne(Oe,At,Pt),onContextmenu:Pt=>xe(Oe,At,Pt)},[Oe.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$d,{key:0,"item-info":Oe,"point-visible":ie.connection_line&&((qe=ie.select_item.info)==null?void 0:qe.id)==Oe.id},null,8,["item-info","point-visible"])):Oe.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Oe.name}`},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,_hoisted_6)):Oe.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,onResize:$e,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,["id","transform"])):Oe.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{id:`foreign-object${Oe.id}`}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps(vue.unref(prosToVBind)(Oe),{id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Oe.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_7)):Oe.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:Oe.id,x1:Oe.props.start_x.val,y1:Oe.props.start_y.val,x2:Oe.props.end_x.val,y2:Oe.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_8)):vue.createCommentVNode("",!0),Oe.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${Oe.id}`,fill:"black","fill-opacity":"0"},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:`${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select?"svg-item-none":""}
354
+ ${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Move&&((Lt=vue.unref(r).handle_svg_info)==null?void 0:Lt.info.id)==Oe.id?"svg-item-move":""} ${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&((kt=vue.unref(r).handle_svg_info)==null?void 0:kt.info.id)==Oe.id?"svg-item-select":""}`}),null,16,_hoisted_9)):vue.createCommentVNode("",!0),((jt=vue.unref(r).handle_svg_info)==null?void 0:jt.info.id)===Oe.id&&ie.handle_panel&&Oe.config.can_zoom?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":Oe},null,8,["item-info"])):vue.createCommentVNode("",!0),((ti=ie.select_item.info)==null?void 0:ti.id)==Oe.id&&ie.connection_panel&&Oe.config.have_anchor&&(vue.unref(r).intention!==vue.unref(EGlobalStoreIntention).Select||Oe.id!==((ei=vue.unref(r).handle_svg_info)==null?void 0:ei.info.id))?(vue.openBlock(),vue.createBlock(_sfc_main$e,{key:7,"item-info":Oe},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_5$2)],2)],8,_hoisted_4$3)),[[vue.vShow,Oe.display]])}),128))],8,_hoisted_3$5)],4)),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:oe,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref($).info,(Oe,At)=>(vue.openBlock(),vue.createElementBlock("li",{key:Oe.title,onClick:qe=>vue.unref($).onContextMenuClick(At)},[vue.createElementVNode("p",{class:vue.normalizeClass(Oe.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(Oe.title)+" ",1),vue.createElementVNode("span",_hoisted_11,vue.toDisplayString(Oe.hot_key),1)],2)],8,_hoisted_10))),128))],512),[[vue.vShow,vue.unref($).display]])],544))}}),index_vue_vue_type_style_index_0_scoped_b0d244b1_lang="",CenterPanel=_export_sfc(_sfc_main$c,[["__scopeId","data-v-b0d244b1"]]);var ace$2={exports:{}};(function(i,n){(function(){var r="ace",g=function(){return this}();!g&&typeof window<"u"&&(g=window);var k=function(ie,ae,le){if(typeof ie!="string"){k.original?k.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(le=ae),k.modules[ie]||(k.payloads[ie]=le,k.modules[ie]=null)};k.modules={},k.payloads={};var V=function(ie,ae,le){if(typeof ae=="string"){var Ie=re(ie,ae);if(Ie!=null)return le&&le(),Ie}else if(Object.prototype.toString.call(ae)==="[object Array]"){for(var ue=[],de=0,Ne=ae.length;de<Ne;++de){var he=re(ie,ae[de]);if(he==null&&$.original)return;ue.push(he)}return le&&le.apply(null,ue)||!0}},$=function(ie,ae){var le=V("",ie,ae);return le==null&&$.original?$.original.apply(this,arguments):le},oe=function(ie,ae){if(ae.indexOf("!")!==-1){var le=ae.split("!");return oe(ie,le[0])+"!"+oe(ie,le[1])}if(ae.charAt(0)=="."){var Ie=ie.split("/").slice(0,-1).join("/");for(ae=Ie+"/"+ae;ae.indexOf(".")!==-1&&ue!=ae;){var ue=ae;ae=ae.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return ae},re=function(ie,ae){ae=oe(ie,ae);var le=k.modules[ae];if(!le){if(le=k.payloads[ae],typeof le=="function"){var Ie={},ue={id:ae,uri:"",exports:Ie,packaged:!0},de=function(he,pe){return V(ae,he,pe)},Ne=le(de,Ie,ue);Ie=Ne||ue.exports,k.modules[ae]=Ie,delete k.payloads[ae]}le=k.modules[ae]=Ie||le}return le};function Ce(ie){var ae=g;ie&&(g[ie]||(g[ie]={}),ae=g[ie]),(!ae.define||!ae.define.packaged)&&(k.original=ae.define,ae.define=k,ae.define.packaged=!0),(!ae.require||!ae.require.packaged)&&($.original=ae.require,ae.require=$,ae.require.packaged=!0)}Ce(r)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(r,g,k){function V($,oe,re){Object.defineProperty($,oe,{value:re,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||V(String.prototype,"startsWith",function($,oe){return oe=oe||0,this.lastIndexOf($,oe)===oe}),String.prototype.endsWith||V(String.prototype,"endsWith",function($,oe){var re=this;(oe===void 0||oe>re.length)&&(oe=re.length),oe-=$.length;var Ce=re.indexOf($,oe);return Ce!==-1&&Ce===oe}),String.prototype.repeat||V(String.prototype,"repeat",function($){for(var oe="",re=this;$>0;)$&1&&(oe+=re),($>>=1)&&(re+=re);return oe}),String.prototype.includes||V(String.prototype,"includes",function($,oe){return this.indexOf($,oe)!=-1}),Object.assign||(Object.assign=function($){if($==null)throw new TypeError("Cannot convert undefined or null to object");for(var oe=Object($),re=1;re<arguments.length;re++){var Ce=arguments[re];Ce!=null&&Object.keys(Ce).forEach(function(ie){oe[ie]=Ce[ie]})}return oe}),Object.values||(Object.values=function($){return Object.keys($).map(function(oe){return $[oe]})}),Array.prototype.find||V(Array.prototype,"find",function($){for(var oe=this.length,re=arguments[1],Ce=0;Ce<oe;Ce++){var ie=this[Ce];if($.call(re,ie,Ce,this))return ie}}),Array.prototype.findIndex||V(Array.prototype,"findIndex",function($){for(var oe=this.length,re=arguments[1],Ce=0;Ce<oe;Ce++){var ie=this[Ce];if($.call(re,ie,Ce,this))return Ce}}),Array.prototype.includes||V(Array.prototype,"includes",function($,oe){return this.indexOf($,oe)!=-1}),Array.prototype.fill||V(Array.prototype,"fill",function($){for(var oe=this,re=oe.length>>>0,Ce=arguments[1],ie=Ce>>0,ae=ie<0?Math.max(re+ie,0):Math.min(ie,re),le=arguments[2],Ie=le===void 0?re:le>>0,ue=Ie<0?Math.max(re+Ie,0):Math.min(Ie,re);ae<ue;)oe[ae]=$,ae++;return oe}),Array.of||V(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(r,g,k){r("./es6-shim")}),ace.define("ace/lib/lang",["require","exports","module"],function(r,g,k){g.last=function(oe){return oe[oe.length-1]},g.stringReverse=function(oe){return oe.split("").reverse().join("")},g.stringRepeat=function(oe,re){for(var Ce="";re>0;)re&1&&(Ce+=oe),(re>>=1)&&(oe+=oe);return Ce};var V=/^\s\s*/,$=/\s\s*$/;g.stringTrimLeft=function(oe){return oe.replace(V,"")},g.stringTrimRight=function(oe){return oe.replace($,"")},g.copyObject=function(oe){var re={};for(var Ce in oe)re[Ce]=oe[Ce];return re},g.copyArray=function(oe){for(var re=[],Ce=0,ie=oe.length;Ce<ie;Ce++)oe[Ce]&&typeof oe[Ce]=="object"?re[Ce]=this.copyObject(oe[Ce]):re[Ce]=oe[Ce];return re},g.deepCopy=function oe(re){if(typeof re!="object"||!re)return re;var Ce;if(Array.isArray(re)){Ce=[];for(var ie=0;ie<re.length;ie++)Ce[ie]=oe(re[ie]);return Ce}if(Object.prototype.toString.call(re)!=="[object Object]")return re;Ce={};for(var ie in re)Ce[ie]=oe(re[ie]);return Ce},g.arrayToMap=function(oe){for(var re={},Ce=0;Ce<oe.length;Ce++)re[oe[Ce]]=1;return re},g.createMap=function(oe){var re=Object.create(null);for(var Ce in oe)re[Ce]=oe[Ce];return re},g.arrayRemove=function(oe,re){for(var Ce=0;Ce<=oe.length;Ce++)re===oe[Ce]&&oe.splice(Ce,1)},g.escapeRegExp=function(oe){return oe.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},g.escapeHTML=function(oe){return(""+oe).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},g.getMatchOffsets=function(oe,re){var Ce=[];return oe.replace(re,function(ie){Ce.push({offset:arguments[arguments.length-2],length:ie.length})}),Ce},g.deferredCall=function(oe){var re=null,Ce=function(){re=null,oe()},ie=function(ae){return ie.cancel(),re=setTimeout(Ce,ae||0),ie};return ie.schedule=ie,ie.call=function(){return this.cancel(),oe(),ie},ie.cancel=function(){return clearTimeout(re),re=null,ie},ie.isPending=function(){return re},ie},g.delayedCall=function(oe,re){var Ce=null,ie=function(){Ce=null,oe()},ae=function(le){Ce==null&&(Ce=setTimeout(ie,le||re))};return ae.delay=function(le){Ce&&clearTimeout(Ce),Ce=setTimeout(ie,le||re)},ae.schedule=ae,ae.call=function(){this.cancel(),oe()},ae.cancel=function(){Ce&&clearTimeout(Ce),Ce=null},ae.isPending=function(){return Ce},ae}}),ace.define("ace/lib/oop",["require","exports","module"],function(r,g,k){g.inherits=function(V,$){V.super_=$,V.prototype=Object.create($.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}})},g.mixin=function(V,$){for(var oe in $)V[oe]=$[oe];return V},g.implement=function(V,$){g.mixin(V,$)}}),ace.define("ace/lib/useragent",["require","exports","module"],function(r,g,k){g.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},g.getOS=function(){return g.isMac?g.OS.MAC:g.isLinux?g.OS.LINUX:g.OS.WINDOWS};var V=typeof navigator=="object"?navigator:{},$=(/mac|win|linux/i.exec(V.platform)||["other"])[0].toLowerCase(),oe=V.userAgent||"",re=V.appName||"";g.isWin=$=="win",g.isMac=$=="mac",g.isLinux=$=="linux",g.isIE=re=="Microsoft Internet Explorer"||re.indexOf("MSAppHost")>=0?parseFloat((oe.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((oe.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),g.isOldIE=g.isIE&&g.isIE<9,g.isGecko=g.isMozilla=oe.match(/ Gecko\/\d+/),g.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",g.isWebKit=parseFloat(oe.split("WebKit/")[1])||void 0,g.isChrome=parseFloat(oe.split(" Chrome/")[1])||void 0,g.isEdge=parseFloat(oe.split(" Edge/")[1])||void 0,g.isAIR=oe.indexOf("AdobeAIR")>=0,g.isAndroid=oe.indexOf("Android")>=0,g.isChromeOS=oe.indexOf(" CrOS ")>=0,g.isIOS=/iPad|iPhone|iPod/.test(oe)&&!window.MSStream,g.isIOS&&(g.isMac=!0),g.isMobile=g.isIOS||g.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(r,g,k){var V=r("./useragent"),$="http://www.w3.org/1999/xhtml";g.buildDom=function le(Ie,ue,de){if(typeof Ie=="string"&&Ie){var Ne=document.createTextNode(Ie);return ue&&ue.appendChild(Ne),Ne}if(!Array.isArray(Ie))return Ie&&Ie.appendChild&&ue&&ue.appendChild(Ie),Ie;if(typeof Ie[0]!="string"||!Ie[0]){for(var he=[],pe=0;pe<Ie.length;pe++){var ze=le(Ie[pe],ue,de);ze&&he.push(ze)}return he}var Fe=document.createElement(Ie[0]),xe=Ie[1],_e=1;xe&&typeof xe=="object"&&!Array.isArray(xe)&&(_e=2);for(var pe=_e;pe<Ie.length;pe++)le(Ie[pe],Fe,de);return _e==2&&Object.keys(xe).forEach(function(Dt){var $e=xe[Dt];Dt==="class"?Fe.className=Array.isArray($e)?$e.join(" "):$e:typeof $e=="function"||Dt=="value"||Dt[0]=="$"?Fe[Dt]=$e:Dt==="ref"?de&&(de[$e]=Fe):Dt==="style"?typeof $e=="string"&&(Fe.style.cssText=$e):$e!=null&&Fe.setAttribute(Dt,$e)}),ue&&ue.appendChild(Fe),Fe},g.getDocumentHead=function(le){return le||(le=document),le.head||le.getElementsByTagName("head")[0]||le.documentElement},g.createElement=function(le,Ie){return document.createElementNS?document.createElementNS(Ie||$,le):document.createElement(le)},g.removeChildren=function(le){le.innerHTML=""},g.createTextNode=function(le,Ie){var ue=Ie?Ie.ownerDocument:document;return ue.createTextNode(le)},g.createFragment=function(le){var Ie=le?le.ownerDocument:document;return Ie.createDocumentFragment()},g.hasCssClass=function(le,Ie){var ue=(le.className+"").split(/\s+/g);return ue.indexOf(Ie)!==-1},g.addCssClass=function(le,Ie){g.hasCssClass(le,Ie)||(le.className+=" "+Ie)},g.removeCssClass=function(le,Ie){for(var ue=le.className.split(/\s+/g);;){var de=ue.indexOf(Ie);if(de==-1)break;ue.splice(de,1)}le.className=ue.join(" ")},g.toggleCssClass=function(le,Ie){for(var ue=le.className.split(/\s+/g),de=!0;;){var Ne=ue.indexOf(Ie);if(Ne==-1)break;de=!1,ue.splice(Ne,1)}return de&&ue.push(Ie),le.className=ue.join(" "),de},g.setCssClass=function(le,Ie,ue){ue?g.addCssClass(le,Ie):g.removeCssClass(le,Ie)},g.hasCssString=function(le,Ie){var ue=0,de;if(Ie=Ie||document,de=Ie.querySelectorAll("style")){for(;ue<de.length;)if(de[ue++].id===le)return!0}},g.removeElementById=function(le,Ie){Ie=Ie||document,Ie.getElementById(le)&&Ie.getElementById(le).remove()};var oe,re=[];g.useStrictCSP=function(le){oe=le,le==!1?Ce():re||(re=[])};function Ce(){var le=re;re=null,le&&le.forEach(function(Ie){ie(Ie[0],Ie[1])})}function ie(le,Ie,ue){if(!(typeof document>"u")){if(re){if(ue)Ce();else if(ue===!1)return re.push([le,Ie])}if(!oe){var de=ue;!ue||!ue.getRootNode?de=document:(de=ue.getRootNode(),(!de||de==ue)&&(de=document));var Ne=de.ownerDocument||de;if(Ie&&g.hasCssString(Ie,de))return null;Ie&&(le+=`
355
355
  /*# sourceURL=ace/css/`+Ie+" */");var he=g.createElement("style");he.appendChild(Ne.createTextNode(le)),Ie&&(he.id=Ie),de==Ne&&(de=g.getDocumentHead(Ne)),de.insertBefore(he,de.firstChild)}}}if(g.importCssString=ie,g.importCssStylsheet=function(le,Ie){g.buildDom(["link",{rel:"stylesheet",href:le}],g.getDocumentHead(Ie))},g.scrollbarWidth=function(le){var Ie=g.createElement("ace_inner");Ie.style.width="100%",Ie.style.minWidth="0px",Ie.style.height="200px",Ie.style.display="block";var ue=g.createElement("ace_outer"),de=ue.style;de.position="absolute",de.left="-10000px",de.overflow="hidden",de.width="200px",de.minWidth="0px",de.height="150px",de.display="block",ue.appendChild(Ie);var Ne=le&&le.documentElement||document&&document.documentElement;if(!Ne)return 0;Ne.appendChild(ue);var he=Ie.offsetWidth;de.overflow="scroll";var pe=Ie.offsetWidth;return he===pe&&(pe=ue.clientWidth),Ne.removeChild(ue),he-pe},g.computedStyle=function(le,Ie){return window.getComputedStyle(le,"")||{}},g.setStyle=function(le,Ie,ue){le[Ie]!==ue&&(le[Ie]=ue)},g.HAS_CSS_ANIMATION=!1,g.HAS_CSS_TRANSFORMS=!1,g.HI_DPI=V.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,V.isChromeOS&&(g.HI_DPI=!1),typeof document<"u"){var ae=document.createElement("div");g.HI_DPI&&ae.style.transform!==void 0&&(g.HAS_CSS_TRANSFORMS=!0),!V.isEdge&&typeof ae.style.animationName<"u"&&(g.HAS_CSS_ANIMATION=!0),ae=null}g.HAS_CSS_TRANSFORMS?g.translate=function(le,Ie,ue){le.style.transform="translate("+Math.round(Ie)+"px, "+Math.round(ue)+"px)"}:g.translate=function(le,Ie,ue){le.style.top=Math.round(ue)+"px",le.style.left=Math.round(Ie)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(r,g,k){/*
356
356
  * based on code from:
357
357
  *
@@ -1299,5 +1299,5 @@ styles.join("\\n")
1299
1299
  line-height: 1.4;
1300
1300
  background: #25282c;
1301
1301
  color: #c1c1c1;
1302
- }`,"autocompletion.css",!1),g.AcePopup=Ie,g.$singleLineEditor=le,g.getAriaId=ae}),ace.define("ace/autocomplete/util",["require","exports","module"],function(r,g,k){g.parForEach=function($,oe,re){var Ce=0,ie=$.length;ie===0&&re();for(var ae=0;ae<ie;ae++)oe($[ae],function(le,Ie){Ce++,Ce===ie&&re(le,Ie)})};var V=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;g.retrievePrecedingIdentifier=function($,oe,re){re=re||V;for(var Ce=[],ie=oe-1;ie>=0&&re.test($[ie]);ie--)Ce.push($[ie]);return Ce.reverse().join("")},g.retrieveFollowingIdentifier=function($,oe,re){re=re||V;for(var Ce=[],ie=oe;ie<$.length&&re.test($[ie]);ie++)Ce.push($[ie]);return Ce},g.getCompletionPrefix=function($){var oe=$.getCursorPosition(),re=$.session.getLine(oe.row),Ce;return $.completers.forEach(function(ie){ie.identifierRegexps&&ie.identifierRegexps.forEach(function(ae){!Ce&&ae&&(Ce=this.retrievePrecedingIdentifier(re,oe.column,ae))}.bind(this))}.bind(this)),Ce||this.retrievePrecedingIdentifier(re,oe.column)}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],function(r,g,k){var V=r("./keyboard/hash_handler").HashHandler,$=r("./autocomplete/popup").AcePopup,oe=r("./autocomplete/popup").getAriaId,re=r("./autocomplete/util"),Ce=r("./lib/lang"),ie=r("./lib/dom"),ae=r("./snippets").snippetManager,le=r("./config"),Ie=function(){this.autoInsert=!1,this.autoSelect=!0,this.exactMatch=!1,this.gatherCompletionsId=0,this.keyboardHandler=new V,this.keyboardHandler.bindKeys(this.commands),this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.changeTimer=Ce.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=Ce.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){return this.popup=new $(document.body||document.documentElement),this.popup.on("click",function(de){this.insertMatch(),de.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.tooltipTimer.bind(null,null)),this.popup.on("select",this.tooltipTimer.bind(null,null)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},this.getPopup=function(){return this.popup||this.$init()},this.openPopup=function(de,Ne,he){this.popup||this.$init(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions({activeDescendant:oe(this.popup.getRow())}),de.keyBinding.addKeyboardHandler(this.keyboardHandler);var pe=de.renderer;if(this.popup.setRow(this.autoSelect?0:-1),he)he&&!Ne&&this.detach();else{this.popup.setTheme(de.getTheme()),this.popup.setFontSize(de.getFontSize());var ze=pe.layerConfig.lineHeight,Fe=pe.$cursorLayer.getPixelPosition(this.base,!0);Fe.left-=this.popup.getTextLeftOffset();var xe=de.container.getBoundingClientRect();Fe.top+=xe.top-pe.layerConfig.offset,Fe.left+=xe.left-de.renderer.scrollLeft,Fe.left+=pe.gutterWidth,this.popup.show(Fe,ze)}this.changeTimer.cancel()},this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener),this.changeTimer.cancel(),this.hideDocTooltip(),this.gatherCompletionsId+=1,this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completions=this.base=null},this.changeListener=function(de){var Ne=this.editor.selection.lead;(Ne.row!=this.base.row||Ne.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},this.blurListener=function(de){var Ne=document.activeElement,he=this.editor.textInput.getElement(),pe=de.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(de.relatedTarget),ze=this.popup&&this.popup.container;Ne!=he&&Ne.parentNode!=ze&&!pe&&Ne!=this.tooltipNode&&de.relatedTarget!=he&&this.detach()},this.mousedownListener=function(de){this.detach()},this.mousewheelListener=function(de){this.detach()},this.goTo=function(de){this.popup.goTo(de)},this.insertMatch=function(de,Ne){if(de||(de=this.popup.getData(this.popup.getRow())),!de)return!1;var he=this.completions;if(this.editor.startOperation({command:{name:"insertMatch"}}),de.completer&&de.completer.insertMatch)de.completer.insertMatch(this.editor,de);else{if(!he)return!1;if(he.filterText)for(var pe=this.editor.selection.getAllRanges(),ze=0,Fe;Fe=pe[ze];ze++)Fe.start.column-=he.filterText.length,this.editor.session.remove(Fe);de.snippet?ae.insertSnippet(this.editor,de.snippet):this.editor.execCommand("insertstring",de.value||de)}this.completions==he&&this.detach(),this.editor.endOperation()},this.commands={Up:function(de){de.completer.goTo("up")},Down:function(de){de.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(de){de.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(de){de.completer.goTo("end")},Esc:function(de){de.completer.detach()},Return:function(de){return de.completer.insertMatch()},"Shift-Return":function(de){de.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(de){var Ne=de.completer.insertMatch();if(!Ne&&!de.tabstopManager)de.completer.goTo("down");else return Ne},PageUp:function(de){de.completer.popup.gotoPageUp()},PageDown:function(de){de.completer.popup.gotoPageDown()}},this.gatherCompletions=function(de,Ne){var he=de.getSession(),pe=de.getCursorPosition(),ze=re.getCompletionPrefix(de);this.base=he.doc.createAnchor(pe.row,pe.column-ze.length),this.base.$insertRight=!0;var Fe=[],xe=de.completers.length;return de.completers.forEach(function(_e,Dt){_e.getCompletions(de,he,pe,ze,function($e,Ue){!$e&&Ue&&(Fe=Fe.concat(Ue)),Ne(null,{prefix:re.getCompletionPrefix(de),matches:Fe,finished:--xe===0})})}),!0},this.showPopup=function(de,Ne){this.editor&&this.detach(),this.activated=!0,this.editor=de,de.completer!=this&&(de.completer&&de.completer.detach(),de.completer=this),de.on("changeSelection",this.changeListener),de.on("blur",this.blurListener),de.on("mousedown",this.mousedownListener),de.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,Ne)},this.updateCompletions=function(de,Ne){if(de&&this.base&&this.completions){var he=this.editor.getCursorPosition(),pe=this.editor.session.getTextRange({start:this.base,end:he});if(pe==this.completions.filterText)return;if(this.completions.setFilter(pe),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==pe&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,pe,de);return}if(Ne&&Ne.matches){var he=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(he.row,he.column),this.base.$insertRight=!0,this.completions=new ue(Ne.matches),this.openPopup(this.editor,"",de)}var ze=this.gatherCompletionsId,Fe=function(Ue){if(Ue.finished)return this.detach()}.bind(this),xe=function(Ue){var Ve=Ue.prefix,Oe=Ue.matches;this.completions=new ue(Oe),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(Ve);var At=this.completions.filtered;if(!At.length||At.length==1&&At[0].value==Ve&&!At[0].snippet)return Fe(Ue);if(this.autoInsert&&At.length==1&&Ue.finished)return this.insertMatch(At[0]);this.openPopup(this.editor,Ve,de)}.bind(this),_e=!0,Dt=null;if(this.gatherCompletions(this.editor,function(Ue,Ve){var Oe=Ve.prefix,At=Ve&&Ve.matches;if(!At||!At.length)return Fe(Ve);if(!(Oe.indexOf(Ve.prefix)!==0||ze!=this.gatherCompletionsId)){if(_e){Dt=Ve;return}xe(Ve)}}.bind(this)),_e=!1,Dt){var $e=Dt;Dt=null,xe($e)}},this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},this.updateDocTooltip=function(){var de=this.popup,Ne=de.data,he=Ne&&(Ne[de.getHoveredRow()]||Ne[de.getRow()]),pe=null;if(!he||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();if(this.editor.completers.some(function(ze){return ze.getDocTooltip&&(pe=ze.getDocTooltip(he)),pe}),!pe&&typeof he!="string"&&(pe=he),typeof pe=="string"&&(pe={docText:pe}),!pe||!(pe.docHTML||pe.docText))return this.hideDocTooltip();this.showDocTooltip(pe)},this.showDocTooltip=function(de){this.tooltipNode||(this.tooltipNode=ie.createElement("div"),this.tooltipNode.className="ace_tooltip ace_doc-tooltip",this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this));var Ne=this.tooltipNode;de.docHTML?Ne.innerHTML=de.docHTML:de.docText&&(Ne.textContent=de.docText),Ne.parentNode||document.body.appendChild(Ne);var he=this.popup,pe=he.container.getBoundingClientRect();Ne.style.top=he.container.style.top,Ne.style.bottom=he.container.style.bottom,Ne.style.display="block",window.innerWidth-pe.right<320?pe.left<320?he.isTopdown?(Ne.style.top=pe.bottom+"px",Ne.style.left=pe.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.top=he.container.offsetTop-Ne.offsetHeight+"px",Ne.style.left=pe.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.right=window.innerWidth-pe.left+"px",Ne.style.left=""):(Ne.style.left=pe.right+1+"px",Ne.style.right="")},this.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var de=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==de&&this.editor.focus(),this.tooltipNode=null,de.parentNode&&de.parentNode.removeChild(de)}},this.onTooltipClick=function(de){for(var Ne=de.target;Ne&&Ne!=this.tooltipNode;){if(Ne.nodeName=="A"&&Ne.href){Ne.rel="noreferrer",Ne.target="_blank";break}Ne=Ne.parentNode}},this.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var de=this.popup.container;de&&de.parentNode&&de.parentNode.removeChild(de)}this.editor&&this.editor.completer==this&&this.editor.completer==null,this.popup=null}}).call(Ie.prototype),Ie.for=function(de){return de.completer||(le.get("sharedPopups")?(Ie.$shared||(Ie.$sharedInstance=new Ie),de.completer=Ie.$sharedInstance):(de.completer=new Ie,de.once("destroy",function(Ne,he){he.completer.destroy()}))),de.completer},Ie.startCommand={name:"startAutocomplete",exec:function(de,Ne){var he=Ie.for(de);he.autoInsert=!1,he.autoSelect=!0,he.showPopup(de,Ne),he.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var ue=function(de,Ne){this.all=de,this.filtered=de,this.filterText=Ne||"",this.exactMatch=!1};(function(){this.setFilter=function(de){if(de.length>this.filterText&&de.lastIndexOf(this.filterText,0)===0)var Ne=this.filtered;else var Ne=this.all;this.filterText=de,Ne=this.filterCompletions(Ne,this.filterText),Ne=Ne.sort(function(pe,ze){return ze.exactMatch-pe.exactMatch||ze.$score-pe.$score||(pe.caption||pe.value).localeCompare(ze.caption||ze.value)});var he=null;Ne=Ne.filter(function(pe){var ze=pe.snippet||pe.caption||pe.value;return ze===he?!1:(he=ze,!0)}),this.filtered=Ne},this.filterCompletions=function(de,Ne){var he=[],pe=Ne.toUpperCase(),ze=Ne.toLowerCase();e:for(var Fe=0,xe;xe=de[Fe];Fe++){var _e=xe.caption||xe.value||xe.snippet;if(_e){var Dt=-1,$e=0,Ue=0,Ve,Oe;if(this.exactMatch){if(Ne!==_e.substr(0,Ne.length))continue e}else{var At=_e.toLowerCase().indexOf(ze);if(At>-1)Ue=At;else for(var qe=0;qe<Ne.length;qe++){var Lt=_e.indexOf(ze[qe],Dt+1),kt=_e.indexOf(pe[qe],Dt+1);if(Ve=Lt>=0&&(kt<0||Lt<kt)?Lt:kt,Ve<0)continue e;Oe=Ve-Dt-1,Oe>0&&(Dt===-1&&(Ue+=10),Ue+=Oe,$e=$e|1<<qe),Dt=Ve}}xe.matchMask=$e,xe.exactMatch=Ue?0:1,xe.$score=(xe.score||0)-Ue,he.push(xe)}}return he}}).call(ue.prototype),g.Autocomplete=Ie,g.FilteredList=ue}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(r,g,k){var V=r("../range").Range,$=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function oe(Ce,ie){var ae=Ce.getTextRange(V.fromPoints({row:0,column:0},ie));return ae.split($).length-1}function re(Ce,ie){var ae=oe(Ce,ie),le=Ce.getValue().split($),Ie=Object.create(null),ue=le[ae];return le.forEach(function(de,Ne){if(!(!de||de===ue)){var he=Math.abs(ae-Ne),pe=le.length-he;Ie[de]?Ie[de]=Math.max(pe,Ie[de]):Ie[de]=pe}}),Ie}g.getCompletions=function(Ce,ie,ae,le,Ie){var ue=re(ie,ae),de=Object.keys(ue);Ie(null,de.map(function(Ne){return{caption:Ne,value:Ne,score:ue[Ne],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(r,g,k){var V=r("../snippets").snippetManager,$=r("../autocomplete").Autocomplete,oe=r("../config"),re=r("../lib/lang"),Ce=r("../autocomplete/util"),ie=r("../autocomplete/text_completer"),ae={getCompletions:function(xe,_e,Dt,$e,Ue){if(_e.$mode.completer)return _e.$mode.completer.getCompletions(xe,_e,Dt,$e,Ue);var Ve=xe.session.getState(Dt.row),Oe=_e.$mode.getCompletions(Ve,_e,Dt,$e);Ue(null,Oe)}},le=function(xe){var _e={};return xe.replace(/\${(\d+)(:(.*?))?}/g,function(Dt,$e,Ue,Ve){return _e[$e]=Ve||""}).replace(/\$(\d+?)/g,function(Dt,$e){return _e[$e]})},Ie={getCompletions:function(xe,_e,Dt,$e,Ue){var Ve=[],Oe=_e.getTokenAt(Dt.row,Dt.column);Oe&&Oe.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?Ve.push("html-tag"):Ve=V.getActiveScopes(xe);var At=V.snippetMap,qe=[];Ve.forEach(function(Lt){for(var kt=At[Lt]||[],jt=kt.length;jt--;){var ti=kt[jt],ei=ti.name||ti.tabTrigger;ei&&qe.push({caption:ei,snippet:ti.content,meta:ti.tabTrigger&&!ti.name?ti.tabTrigger+"⇥ ":"snippet",type:"snippet"})}},this),Ue(null,qe)},getDocTooltip:function(xe){xe.type=="snippet"&&!xe.docHTML&&(xe.docHTML=["<b>",re.escapeHTML(xe.caption),"</b>","<hr></hr>",re.escapeHTML(le(xe.snippet))].join(""))}},ue=[Ie,ie,ae];g.setCompleters=function(xe){ue.length=0,xe&&ue.push.apply(ue,xe)},g.addCompleter=function(xe){ue.push(xe)},g.textCompleter=ie,g.keyWordCompleter=ae,g.snippetCompleter=Ie;var de={name:"expandSnippet",exec:function(xe){return V.expandWithTab(xe)},bindKey:"Tab"},Ne=function(xe,_e){he(_e.session.$mode)},he=function(xe){typeof xe=="string"&&(xe=oe.$modes[xe]),xe&&(V.files||(V.files={}),pe(xe.$id,xe.snippetFileId),xe.modes&&xe.modes.forEach(he))},pe=function(xe,_e){!_e||!xe||V.files[xe]||(V.files[xe]={},oe.loadModule(_e,function(Dt){Dt&&(V.files[xe]=Dt,!Dt.snippets&&Dt.snippetText&&(Dt.snippets=V.parseSnippetFile(Dt.snippetText)),V.register(Dt.snippets||[],Dt.scope),Dt.includeScopes&&(V.snippetMap[Dt.scope].includeScopes=Dt.includeScopes,Dt.includeScopes.forEach(function($e){he("ace/mode/"+$e)})))}))},ze=function(xe){var _e=xe.editor,Dt=_e.completer&&_e.completer.activated;if(xe.command.name==="backspace")Dt&&!Ce.getCompletionPrefix(_e)&&_e.completer.detach();else if(xe.command.name==="insertstring"){var $e=Ce.getCompletionPrefix(_e);if($e&&!Dt){var Ue=$.for(_e);Ue.autoInsert=!1,Ue.showPopup(_e)}}},Fe=r("../editor").Editor;r("../config").defineOptions(Fe.prototype,"editor",{enableBasicAutocompletion:{set:function(xe){xe?(this.completers||(this.completers=Array.isArray(xe)?xe:ue),this.commands.addCommand($.startCommand)):this.commands.removeCommand($.startCommand)},value:!1},enableLiveAutocompletion:{set:function(xe){xe?(this.completers||(this.completers=Array.isArray(xe)?xe:ue),this.commands.on("afterExec",ze)):this.commands.removeListener("afterExec",ze)},value:!1},enableSnippets:{set:function(xe){xe?(this.commands.addCommand(de),this.on("changeMode",Ne),Ne(null,this)):(this.commands.removeCommand(de),this.off("changeMode",Ne))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(r){i&&(i.exports=r)})}()})(extLanguage_tools),ace$1.config.setModuleUrl("ace/theme/github",themeUrl),ace$1.config.setModuleUrl("ace/theme/kr_theme",themeUrl2),ace$1.config.setModuleUrl("ace/mode/base",workerBaseUrl),ace$1.config.setModuleUrl("ace/mode/json",modeJsonUrl),ace$1.config.setModuleUrl("ace/mode/json_worker",workerJsonUrl),ace$1.config.setModuleUrl("ace/snippets/json",snippetsJsonUrl),ace$1.config.setModuleUrl("ace/mode/javascript",modeJavascriptUrl),ace$1.config.setModuleUrl("ace/mode/javascript_worker",workerJavascriptUrl),ace$1.config.setModuleUrl("ace/snippets/javascript",snippetsJavascriptUrl),ace$1.require("ace/ext/language_tools");const _sfc_main$b=vue.defineComponent({__name:"code-edit-modal",props:{modelValue:{default:()=>({})},lang:{default:"json"},title:{default:"编辑"}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.ref(!1),k=vue.computed({get(){return r.lang==="json"?JSON.stringify(r.modelValue,null,2):r.modelValue},set(V){r.lang==="json"?n("update:modelValue",JSON.parse(V)):n("update:modelValue",V)}});return(V,$)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElButton),{onClick:$[0]||($[0]=oe=>g.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("···")]),_:1}),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:g.value,"onUpdate:modelValue":$[2]||($[2]=oe=>g.value=oe),title:r.title,width:"60%"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(VAceEditor),{value:k.value,"onUpdate:value":$[1]||($[1]=oe=>k.value=oe),lang:r.lang,theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value","lang"])]),_:1},8,["modelValue","title"])]))}}),_hoisted_1$7={class:"one-row-txt",style:{width:"78px"}},_hoisted_2$5={key:1},_hoisted_3$4={class:"one-row-txt",style:{width:"145px"}},_hoisted_4$2={key:1},_sfc_main$a=vue.defineComponent({__name:"dynamic-el-form-item",props:{objInfo:{default:()=>({})},hide:{default:()=>[]},code:{type:Boolean,default:!1}},setup(i){const n=i;return(r,g)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.objInfo,(k,V)=>(vue.openBlock(),vue.createElementBlock("div",{key:V},[n.code?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,class:"props-row",size:"small"},{label:vue.withCtx(()=>[vue.unref(getStringWidth)(String(V))>78?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:String(V),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$7,vue.toDisplayString(V),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$5,vue.toDisplayString(V),1))]),default:vue.withCtx(()=>[vue.unref(getStringWidth)(String(k.val))>145?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:k.val,placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$4,vue.toDisplayString(k.val),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$2,vue.toDisplayString(k.val),1))]),_:2},1024)):vue.createCommentVNode("",!0),n.hide.indexOf(String(V))<0?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:k.title,size:"small"},{default:vue.withCtx(()=>[k.type===vue.unref(EConfigItemPropsType).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElSelect),{key:0,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,placeholder:"Select",size:"small",disabled:!!(k!=null&&k.disabled)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.options,$=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:$.value,label:$.label,value:$.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).InputNumber?(vue.openBlock(),vue.createBlock(vue.unref(ElInputNumber),{key:1,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Input?(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:2,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Color?(vue.openBlock(),vue.createBlock(vue.unref(ElColorPicker),{key:3,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Switch?(vue.openBlock(),vue.createBlock(vue.unref(ElSwitch),{key:4,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).JsonEdit?(vue.openBlock(),vue.createBlock(_sfc_main$b,{key:5,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):vue.createCommentVNode("",!0)]),_:2},1032,["label"])):vue.createCommentVNode("",!0)]))),128))}}),dynamicElFormItem_vue_vue_type_style_index_0_scoped_fdc5f310_lang="",dynamicElFormItem_vue_vue_type_style_index_1_lang="",DynamicElFormItem=_export_sfc(_sfc_main$a,[["__scopeId","data-v-fdc5f310"]]),_hoisted_1$6={style:{height:"100%"}},_hoisted_2$4={class:"flex flex-wrap"},_hoisted_3$3=["onMouseenter","onClick"],_sfc_main$9=vue.defineComponent({__name:"common-animate",props:{val:{}},emits:["updateCommonAniVal"],setup(i,{emit:n}){const r=i,g=vue.ref(r.val),k=vue.ref(!1),V=vue.ref("进入"),$=vue.ref(null),oe=re=>{n("updateCommonAniVal",re),k.value=!1};return vue.watch(()=>r.val,re=>{g.value=re}),(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[g.value?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:0,closable:"",onClose:Ce[0]||(Ce[0]=ie=>oe("")),onClick:Ce[1]||(Ce[1]=ie=>k.value=!0),style:{cursor:"pointer"}},{default:vue.withCtx(()=>{var ie;return[vue.createTextVNode(vue.toDisplayString((ie=vue.unref(common_animate_list).map(ae=>ae.children).reduce((ae,le)=>ae.concat(le)).find(ae=>ae.value==g.value))==null?void 0:ie.label)+" ",1),vue.createVNode(vue.unref(ElIcon),{size:10},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"setting"})]),_:1})]}),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:1,type:"success",style:{cursor:"pointer"},onClick:Ce[2]||(Ce[2]=ie=>k.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("新增")]),_:1})),vue.createVNode(vue.unref(ElDrawer),{modelValue:k.value,"onUpdate:modelValue":Ce[5]||(Ce[5]=ie=>k.value=ie),title:"选择动画",direction:"ltr"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabs),{modelValue:V.value,"onUpdate:modelValue":Ce[4]||(Ce[4]=ie=>V.value=ie)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(common_animate_list),ie=>(vue.openBlock(),vue.createBlock(vue.unref(ElTabPane),{label:ie.label,name:ie.label,key:ie.label},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{height:"500px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$4,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(ie.children,(ae,le)=>(vue.openBlock(),vue.createElementBlock("div",{class:"animate",key:le,onMouseenter:Ie=>$.value=le,onMouseleave:Ce[3]||(Ce[3]=Ie=>$.value=null),onClick:Ie=>oe(ae.value)},[vue.createElementVNode("div",{class:vue.normalizeClass(`${$.value==le?`animate__animated animate__${ae.value} animate__slow animate__infinite`:""}`)},vue.toDisplayString(ae.label),3)],40,_hoisted_3$3))),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]))}}),commonAnimate_vue_vue_type_style_index_0_scoped_f7641a8c_lang="",CommonAnimate=_export_sfc(_sfc_main$9,[["__scopeId","data-v-f7641a8c"]]),_sfc_main$8=vue.defineComponent({__name:"index",setup(i){var V;const n=useGlobalStore(pinia),r=vue.ref(((V=n.handle_svg_info)==null?void 0:V.info.id)||""),g=$=>{n.intention=EGlobalStoreIntention.Select,n.setHandleSvgInfo($)},k={children:"children",label:"title"};return($,oe)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTree),{data:vue.unref(n).done_json,props:k,onNodeClick:g,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!0,"node-key":"id","current-node-key":r.value},null,8,["data","current-node-key"]))}}),_withScopeId$1=i=>(vue.pushScopeId("data-v-80b9cb5a"),i=i(),vue.popScopeId(),i),_hoisted_1$5={class:"wall-l"},_hoisted_2$3={class:"head-l"},_hoisted_3$2=_withScopeId$1(()=>vue.createElementVNode("span",null,"key",-1)),_hoisted_4$1=_withScopeId$1(()=>vue.createElementVNode("span",null,"value",-1)),_hoisted_5$1={class:"row-l"},_sfc_main$7=vue.defineComponent({__name:"list",props:{modelValue:{default:()=>[{key:"",val:""}]}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.computed({get(){return r.modelValue},set($){n("update:modelValue",$)}}),k=()=>{g.value.push({key:"",val:""})},V=$=>{g.value.splice($,1)};return($,oe)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.createElementVNode("div",_hoisted_2$3,[_hoisted_3$2,_hoisted_4$1,vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:k},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"add"})]),_:1})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(g.value,(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:re.key,"onUpdate:modelValue":ie=>re.key=ie,size:"small",placeholder:"key"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:re.val,"onUpdate:modelValue":ie=>re.val=ie,size:"small",placeholder:"value"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:ie=>V(Ce)},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:2},1032,["onClick"])]))),256))]))}}),list_vue_vue_type_style_index_0_scoped_80b9cb5a_lang="",List=_export_sfc(_sfc_main$7,[["__scopeId","data-v-80b9cb5a"]]),_hoisted_1$4={class:"c-wall-d"},_sfc_main$6=vue.defineComponent({__name:"condition",props:{modelValue:{default:()=>({type:EConditionType.None})}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.computed({get(){return r.modelValue},set($){n("update:modelValue",$)}}),k=[{label:"大于",val:"greater"},{label:"大于等于",val:">="},{label:"小于",val:"<"},{label:"小于等于",val:"<="},{label:"等于",val:"=="},{label:"不等于",val:"!="},{label:"介于",val:">=,=<"},{label:"不介于",val:"<,>"}],V=$=>{$!=="None"&&(g.value.Relation={key:"",relation:"",val:"",val2:""}),n("update:modelValue",g)};return($,oe)=>{var re,Ce;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElFormItem),{label:"条件",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:g.value.type,"onUpdate:modelValue":oe[0]||(oe[0]=ie=>g.value.type=ie),onChange:V},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"None",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"Relation",label:"关系运算"})]),_:1},8,["modelValue"])]),_:1}),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"属性",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.key,"onUpdate:modelValue":oe[1]||(oe[1]=ie=>g.value.Relation.key=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"关系",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:g.value.Relation.relation,"onUpdate:modelValue":oe[2]||(oe[2]=ie=>g.value.Relation.relation=ie)},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(k,(ie,ae)=>vue.createVNode(vue.unref(ElOption),{value:ie.val,label:ie.label,key:"rop"+ae},null,8,["value","label"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"值",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.val,"onUpdate:modelValue":oe[3]||(oe[3]=ie=>g.value.Relation.val=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"&&(((re=g.value.Relation)==null?void 0:re.relation)===">=,=<"||((Ce=g.value.Relation)==null?void 0:Ce.relation)==="<,>")?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:"值2",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.val2,"onUpdate:modelValue":oe[4]||(oe[4]=ie=>g.value.Relation.val2=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)])}}}),condition_vue_vue_type_style_index_0_scoped_78b20d94_lang="",Condition=_export_sfc(_sfc_main$6,[["__scopeId","data-v-78b20d94"]]),_withScopeId=i=>(vue.pushScopeId("data-v-2e831e17"),i=i(),vue.popScopeId(),i),_hoisted_1$3=_withScopeId(()=>vue.createElementVNode("span",{style:{"font-weight":"bold"}},"MQTT",-1)),_hoisted_2$2={class:"events-title"},_hoisted_3$1={key:1},_sfc_main$5=vue.defineComponent({__name:"index",setup(i){const n=useConfigStore(pinia),r=useGlobalStore(pinia),g=vue.ref("page"),k=vue.ref("style"),V=(ae,le)=>{ae!=null&&ae.common_animations&&(ae.common_animations.val=le)};n.$subscribe((ae,le)=>{ae.storeId==="config-store"&&localStorage.setItem("svg-editor-config",JSON.stringify(le))});const $=vue.ref(numberArray(20)),oe=vue.ref(["MQTT"]),re=vue.ref();re.value=()=>{var le,Ie;let ae={type:EEventType.Null,action:EEventAction.Null,target:"",scripts:"",condition:{type:EConditionType.None}};(Ie=(le=r.handle_svg_info)==null?void 0:le.info)==null||Ie.events.push(ae)};const Ce=(ae,le)=>{ae==="ChangeAttr"?le.attrs=[{key:"",val:""}]:delete le.attrs},ie=ae=>{var le,Ie;(Ie=(le=r.handle_svg_info)==null?void 0:le.info)==null||Ie.events.splice(ae,1)};return(ae,le)=>vue.unref(r).intention!=vue.unref(EGlobalStoreIntention).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElTabs),{key:0,class:"mx-2 rightTabs",modelValue:g.value,"onUpdate:modelValue":le[11]||(le[11]=Ie=>g.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabPane),{label:"图纸",name:"page"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"背景色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElColorPicker),{modelValue:vue.unref(n).svg.background_color,"onUpdate:modelValue":le[0]||(le[0]=Ie=>vue.unref(n).svg.background_color=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"x原点",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.position_center.x,"onUpdate:modelValue":le[1]||(le[1]=Ie=>vue.unref(n).svg.position_center.x=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"y原点",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.position_center.y,"onUpdate:modelValue":le[2]||(le[2]=Ie=>vue.unref(n).svg.position_center.y=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"网格",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(n).svg.grid,"onUpdate:modelValue":le[3]||(le[3]=Ie=>vue.unref(n).svg.grid=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"标尺",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(n).svg.ruler,"onUpdate:modelValue":le[4]||(le[4]=Ie=>vue.unref(n).svg.ruler=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.scale,"onUpdate:modelValue":le[5]||(le[5]=Ie=>vue.unref(n).svg.scale=Ie),step:.1,"step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"通信",name:"net"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapse),{modelValue:oe.value,"onUpdate:modelValue":le[10]||(le[10]=Ie=>oe.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapseItem),{name:"MQTT"},{title:vue.withCtx(()=>[_hoisted_1$3]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"URL",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.url,"onUpdate:modelValue":le[6]||(le[6]=Ie=>vue.unref(n).net.mqtt.url=Ie),placeholder:"如 ws://127.0.0.1:4500"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"用户名",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.user,"onUpdate:modelValue":le[7]||(le[7]=Ie=>vue.unref(n).net.mqtt.user=Ie),placeholder:"username"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"密码",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.pwd,"onUpdate:modelValue":le[8]||(le[8]=Ie=>vue.unref(n).net.mqtt.pwd=Ie),placeholder:"password"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"Topics",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.topics,"onUpdate:modelValue":le[9]||(le[9]=Ie=>vue.unref(n).net.mqtt.topics=Ie),placeholder:"topics"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"连线",name:"line"},{default:vue.withCtx(()=>[vue.unref(n).connection_line.props?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).connection_line.props,hide:["point_position"]},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(n).connection_line.animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).connection_line.animations},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0)]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$8)]),_:1})]),_:1},8,["modelValue"])):vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&vue.unref(r).handle_svg_info?(vue.openBlock(),vue.createBlock(vue.unref(ElTabs),{key:1,class:"mx-2 rightTabs",modelValue:k.value,"onUpdate:modelValue":le[24]||(le[24]=Ie=>k.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabPane),{label:"外观",name:"style"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"标题",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.title,"onUpdate:modelValue":le[12]||(le[12]=Ie=>vue.unref(r).handle_svg_info.info.title=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"x坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(r).handle_svg_info.info.x,"onUpdate:modelValue":le[13]||(le[13]=Ie=>vue.unref(r).handle_svg_info.info.x=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"y坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(r).handle_svg_info.info.y,"onUpdate:modelValue":le[14]||(le[14]=Ie=>vue.unref(r).handle_svg_info.info.y=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"显示",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(r).handle_svg_info.info.display,"onUpdate:modelValue":le[15]||(le[15]=Ie=>vue.unref(r).handle_svg_info.info.display=Ie)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"事件",name:"event"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{type:"primary",style:{width:"100%"},onClick:re.value},{default:vue.withCtx(()=>[vue.createTextVNode("添加事件")]),_:1},8,["onClick"]),vue.createVNode(vue.unref(ElCollapse),{modelValue:$.value,"onUpdate:modelValue":le[16]||(le[16]=Ie=>$.value=Ie)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).handle_svg_info.info.events,(Ie,ue)=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:ue,key:"event"+ue},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$2,[vue.createElementVNode("span",null,"事件"+vue.toDisplayString(ue+1),1),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:vue.withModifiers(de=>ie(ue),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:2},1032,["onClick"])])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"类型",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:Ie.type,"onUpdate:modelValue":de=>Ie.type=de},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"Click",label:"点击"}),vue.createVNode(vue.unref(ElOption),{value:"Change",label:"值改变"})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(ElFormItem),{label:"行为",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:Ie.action,"onUpdate:modelValue":de=>Ie.action=de,onChange:de=>Ce(de,Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"ChangeAttr",label:"改变属性"}),vue.createVNode(vue.unref(ElOption),{value:"JavaScript",label:"执行JavaScript"})]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),Ie.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"目标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:Ie.target,"onUpdate:modelValue":de=>Ie.target=de,placeholder:"默认自身"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),Ie.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(List,{key:1,modelValue:Ie.attrs,"onUpdate:modelValue":de=>Ie.attrs=de},null,8,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),Ie.action==="JavaScript"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"JavaScript",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$b,{modelValue:Ie.scripts,"onUpdate:modelValue":de=>Ie.scripts=de,lang:"javascript"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),vue.createVNode(Condition,{modelValue:Ie.condition,"onUpdate:modelValue":de=>Ie.condition=de},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"动效",name:"animation"},{default:vue.withCtx(()=>{var Ie;return[(Ie=vue.unref(r).handle_svg_info)!=null&&Ie.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).handle_svg_info.info.animations},null,8,["obj-info"])]),_:1})):vue.unref(r).handle_svg_info.info.common_animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"动画效果",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(CommonAnimate,{onUpdateCommonAniVal:le[17]||(le[17]=ue=>{var de;return V((de=vue.unref(r).handle_svg_info)==null?void 0:de.info,ue)}),val:vue.unref(r).handle_svg_info.info.common_animations.val},null,8,["val"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"延迟",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.delay,"onUpdate:modelValue":le[18]||(le[18]=ue=>vue.unref(r).handle_svg_info.info.common_animations.delay=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"delay-0s",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"delay-1s",label:"1秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-2s",label:"2秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-3s",label:"3秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-4s",label:"4秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-5s",label:"5秒"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"动画速度",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.speed,"onUpdate:modelValue":le[19]||(le[19]=ue=>vue.unref(r).handle_svg_info.info.common_animations.speed=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"slow",label:"慢"}),vue.createVNode(vue.unref(ElOption),{value:"slower",label:"最慢"}),vue.createVNode(vue.unref(ElOption),{value:"fast",label:"快"}),vue.createVNode(vue.unref(ElOption),{value:"faster",label:"最快"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"循环次数",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.repeat,"onUpdate:modelValue":le[20]||(le[20]=ue=>vue.unref(r).handle_svg_info.info.common_animations.repeat=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"repeat-1",label:"一次"}),vue.createVNode(vue.unref(ElOption),{value:"repeat-2",label:"两次"}),vue.createVNode(vue.unref(ElOption),{value:"repeat-3",label:"三次"}),vue.createVNode(vue.unref(ElOption),{value:"infinite",label:"无限次"})]),_:1},8,["modelValue"])]),_:1})]),_:1})):vue.createCommentVNode("",!0)]}),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"数据",name:"data"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>{var Ie;return[vue.createVNode(vue.unref(ElFormItem),{label:"ID",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.id,"onUpdate:modelValue":le[21]||(le[21]=ue=>vue.unref(r).handle_svg_info.info.id=ue)},null,8,["modelValue"])]),_:1}),vue.unref(r).handle_svg_info.info.state?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(vue.unref(r).handle_svg_info.info.state,(ue,de)=>{var Ne;return vue.openBlock(),vue.createElementBlock("div",{key:"state"+de},[vue.createVNode(vue.unref(ElFormItem),{class:"props-row",label:String(de),size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ue==null?void 0:ue.default),1)]),_:2},1032,["label"]),de==="OnOff"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:(Ne=vue.unref(r).handle_svg_info.info.state)==null?void 0:Ne.OnOff.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(r).handle_svg_info.info.state.OnOff.default,"onUpdate:modelValue":le[22]||(le[22]=he=>vue.unref(r).handle_svg_info.info.state.OnOff.default=he)},null,8,["modelValue"])]),_:1},8,["label"])):vue.createCommentVNode("",!0)])}),128)):vue.createCommentVNode("",!0),(Ie=vue.unref(r).handle_svg_info.info)!=null&&Ie.hasOwnProperty("tag_slot")?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$1,[vue.createVNode(vue.unref(ElFormItem),{class:"props-row",label:"tag_slot",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(r).handle_svg_info.info.tag_slot),1)]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"文字插槽",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.tag_slot,"onUpdate:modelValue":le[23]||(le[23]=ue=>vue.unref(r).handle_svg_info.info.tag_slot=ue)},null,8,["modelValue"])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).handle_svg_info.info.props,code:""},null,8,["obj-info"])]}),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$8)]),_:1})]),_:1},8,["modelValue"])):vue.createCommentVNode("",!0)}}),index_vue_vue_type_style_index_0_scoped_2e831e17_lang="",index_vue_vue_type_style_index_1_lang="",RightPanel=_export_sfc(_sfc_main$5,[["__scopeId","data-v-2e831e17"]]),_sfc_main$4=vue.defineComponent({__name:"index",setup(i){const n=vue.ref(""),r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=useConfigStore(pinia);return vue.onMounted(()=>{const V={layout_center:g.center_offset,config:k.$state,done_json:r.done_json};n.value=JSON.stringify(V,null,2)}),(V,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:n.value,"onUpdate:value":$[0]||($[0]=oe=>n.value=oe),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$3=vue.defineComponent({__name:"index",setup(i,{expose:n}){const r=vue.ref("");return n({setVal:V=>{r.value=V},onImportJson:()=>{useImportDataModel(r.value)&&ElMessage.success("导入成功")}}),(V,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:r.value,"onUpdate:value":$[0]||($[0]=oe=>r.value=oe),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$2=vue.defineComponent({name:"V3RulerComponent",props:{position:{type:String,default:"relative",validator:i=>["absolute","fixed","relative","static","inherit"].indexOf(i)!==-1},isHotKey:{type:Boolean,default:!0},isScaleRevise:{type:Boolean,default:!1},value:{type:Array,default:()=>[{type:"h",site:50},{type:"v",site:180}]},contentLayout:{type:Object,default:()=>({top:0,left:0})},parent:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},stepLength:{type:Number,default:50,validator:i=>i%10===0}},emits:["input","update:visible"],setup(i,n){const r=useSvgEditLayoutStore(pinia),g=function(){return function(Ai,hi,wi){Ai&&hi&&wi&&Ai.addEventListener(hi,wi,!1)}}(),k=function(){return function(Ai,hi,wi){Ai&&hi&&Ai.removeEventListener(hi,wi,!1)}}(),V=17;let $=18,oe=vue.ref(0),re=vue.ref(0),Ce=vue.ref([{id:0}]),ie=vue.ref([{id:0}]),ae=0,le=0,Ie=vue.ref(!1),ue="",de=vue.ref(-999),Ne=vue.ref(-999),he=0,pe=0,ze="";const Fe=vue.ref(null),xe=vue.ref(null),_e=vue.ref(null),Dt=vue.ref(null),$e=vue.computed(()=>({width:oe.value+"px",height:re.value+"px",position:i.position})),Ue=vue.computed(()=>({left:i.contentLayout.left+"px",top:i.contentLayout.top+"px",padding:$+"px 0px 0px "+$+"px"})),Ve=vue.computed(()=>{let Ai=0,hi=0;return i.value.map(wi=>{const Ci=wi.type==="h";return{id:`${wi.type}_${Ci?Ai++:hi++}`,type:wi.type,title:wi.site.toFixed(2)+"px",[Ci?"top":"left"]:wi.site/(i.stepLength/50)+V}})});r.$subscribe(Ai=>{Ai.storeId==="svg-edit-layout-store"&&window.setTimeout(Oe,420)}),vue.onMounted(()=>{g(document,"mousemove",gi),g(document,"mouseup",di),Oe(),g(window,"resize",At)}),vue.onBeforeUnmount(()=>{k(document,"mousemove",gi),k(document,"mouseup",di),k(window,"resize",At)});const Oe=()=>{kt(),ti()},At=()=>{Ce.value=[{id:0}],ie.value=[{id:0}],Oe()},qe=({type:Ai,top:hi,left:wi})=>Ai==="h"?{top:hi+"px"}:{left:wi+"px"},Lt=({type:Ai,id:hi})=>Ai==="h"?pi(hi):yi(hi),kt=()=>{if(i.isScaleRevise){const Ai=Fe.value.offsetLeft,hi=Fe.value.offsetTop;Pt(Ce.value,Ai),Pt(ie.value,hi)}if(i.parent){const Ai=window.getComputedStyle(xe.value.parentNode,null);oe.value=parseInt(Ai.getPropertyValue("width"),10),re.value=parseInt(Ai.getPropertyValue("height"),10)}else oe.value=document.documentElement.clientWidth-le,re.value=document.documentElement.clientHeight-ae;he=_e.value.clientWidth,pe=Dt.value.clientHeight,jt()},jt=()=>{ae=Dt.value.getBoundingClientRect().y,le=_e.value.getBoundingClientRect().x},ti=()=>{ei(Ce.value,oe.value),ei(ie.value,re.value)},ei=(Ai,hi)=>{for(let wi=0;wi<hi*i.stepLength/50;wi+=i.stepLength)wi%i.stepLength===0&&wi!=0&&Ai.push({id:wi})},Pt=(Ai,hi)=>{for(let wi=0;wi<hi;wi+=1)wi%i.stepLength===0&&wi+i.stepLength<=hi&&Ai.push({id:wi})},ni=Ai=>{Ie.value=!0,ue=Ai},gi=Ai=>{switch(jt(),ue){case"x":Ie.value&&(Ne.value=Ai.pageY-ae);break;case"y":Ie.value&&(de.value=Ai.pageX-le);break;case"h":Ie.value&&(Ne.value=Ai.pageY-ae);break;case"v":Ie.value&&(de.value=Ai.pageX-le);break}},di=Ai=>{if(jt(),Ie.value){Ie.value=!1;const hi=JSON.parse(JSON.stringify(i.value));switch(ue){case"x":hi.push({type:"h",site:(Ai.pageY-ae-V)*(i.stepLength/50)}),n.emit("input",hi);break;case"y":hi.push({type:"v",site:(Ai.pageX-le-V)*(i.stepLength/50)}),n.emit("input",hi);break;case"h":li(hi,Ai.pageY,ae,pe,"h"),n.emit("input",hi);break;case"v":li(hi,Ai.pageX,le,he,"v"),n.emit("input",hi);break}Ne.value=de.value=-10}},li=(Ai,hi,wi,Ci,mi)=>{if(hi-wi<Ci){let Ni;Ve.value.forEach((Mi,fi)=>{Mi.id===ze&&(Ni=fi)}),Ai.splice(Ni,1,{type:mi,site:-600})}else{let Ni;Ve.value.forEach((Mi,fi)=>{Mi.id===ze&&(Ni=fi)}),Ai.splice(Ni,1,{type:mi,site:(hi-wi-V)*(i.stepLength/50)})}},ai=()=>{ni("x")},ci=()=>{ni("y")},pi=Ai=>{Ie.value=!0,ue="h",ze=Ai},yi=Ai=>{Ie.value=!0,ue="v",ze=Ai};return{wrapperStyle:$e,horizontalDragRuler:ai,xScale:Ce,verticalDragRuler:ci,yScale:ie,verticalDottedTop:Ne,horizontalDottedLeft:de,lineList:Ve,getLineStyle:qe,handleDragLine:Lt,contentStyle:Ue,isDrag:Ie,content:Fe,el:xe,verticalRuler:_e,horizontalRuler:Dt}}}),index_vue_vue_type_style_index_0_lang="",_hoisted_1$2=["title","onMousedown"],_hoisted_2$1={class:"vue-ruler-content-mask"};function _sfc_render(i,n,r,g,k,V){return vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(i.wrapperStyle),class:"vue-ruler-wrapper",onselectStart:"return false;",ref:"el"},[vue.withDirectives(vue.createElementVNode("section",null,[vue.createElementVNode("div",{ref:"horizontalRuler",class:"vue-ruler-h",onMousedown:n[0]||(n[0]=vue.withModifiers((...$)=>i.horizontalDragRuler&&i.horizontalDragRuler(...$),["stop"]))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.xScale,($,oe)=>(vue.openBlock(),vue.createElementBlock("span",{key:oe,style:vue.normalizeStyle({left:oe*50+2+"px"}),class:"n"},vue.toDisplayString($.id),5))),128))],544),vue.createElementVNode("div",{ref:"verticalRuler",class:"vue-ruler-v",onMousedown:n[1]||(n[1]=vue.withModifiers((...$)=>i.verticalDragRuler&&i.verticalDragRuler(...$),["stop"]))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.yScale,($,oe)=>(vue.openBlock(),vue.createElementBlock("span",{key:oe,style:vue.normalizeStyle({top:oe*50+2+"px"}),class:"n"},vue.toDisplayString($.id),5))),128))],544),vue.createElementVNode("div",{style:vue.normalizeStyle({top:i.verticalDottedTop+"px"}),class:"vue-ruler-ref-dot-h"},null,4),vue.createElementVNode("div",{style:vue.normalizeStyle({left:i.horizontalDottedLeft+"px"}),class:"vue-ruler-ref-dot-v"},null,4),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.lineList,$=>(vue.openBlock(),vue.createElementBlock("div",{title:$.title,style:vue.normalizeStyle(i.getLineStyle($)),key:$.id,class:vue.normalizeClass(`vue-ruler-ref-line-${$.type}`),onMousedown:oe=>i.handleDragLine($)},null,46,_hoisted_1$2))),128))],512),[[vue.vShow,i.$props.visible]]),vue.createElementVNode("div",{ref:"content",class:"vue-ruler-content",style:vue.normalizeStyle(i.contentStyle)},[vue.renderSlot(i.$slots,"default")],4),vue.withDirectives(vue.createElementVNode("div",_hoisted_2$1,null,512),[[vue.vShow,i.isDrag]])],4)}const Vue3RulerTool=_export_sfc(_sfc_main$2,[["render",_sfc_render]]);function fileWrite(i,n=new Date(Date.now()).toLocaleString()){const r=JSON.stringify(i),g=new Blob([r]);let k=document.createElement("a");k.download=n+".json",k.style.display="none",k.href=URL.createObjectURL(g),document.body.appendChild(k),k.click(),document.body.removeChild(k)}function fileRead(i){return new Promise((n,r)=>{let g=new FileReader;g.readAsText(i,"UTF-8"),g.onload=function(k){k&&k.target?n(k.target.result):r("文件读取错误")}})}const _hoisted_1$1={class:"canvas-main-pc"},_sfc_main$1=vue.defineComponent({__name:"index",props:{customToolBar:{},data:{}},emits:["onReturn","onPreview","onSave"],setup(i,{expose:n,emit:r}){const g=i,k=vue.ref([]),V=he=>{k.value=he},$=useGlobalStore(pinia),oe=useSvgEditLayoutStore(pinia),re=useConfigStore(pinia),Ce=vue.ref(),ie=vue.reactive({[EVisibleConfKey.ExportJson]:!1,[EVisibleConfKey.ImportJson]:!1,[EVisibleConfKey.ImportFile]:!1}),ae=(he,pe)=>{ie[he]=pe},le=vue.ref();le.value=()=>{Ce.value.onImportJson(),ae(EVisibleConfKey.ImportJson,!1)};const Ie=he=>["text/plain","application/json"].indexOf(he.type)<0?(ElMessage.error("仅支持的格式:txt、json"),!1):(fileRead(he).then(pe=>{Ce.value.setVal(pe),ElMessage.success("文件读取成功!")}),!1),ue=he=>{$.setDoneJson(he)};vue.onMounted(()=>{g.data?useImportDataModel(g.data):$.setDoneJson([]),$.intention=EGlobalStoreIntention.None}),n({setGraphNodeJson:ue});const{appContext:de}=vue.getCurrentInstance();function Ne(he){ElMessageBox.prompt("请输入文件名","保存",{cancelButtonText:"取消",confirmButtonText:"保存"},de).then(pe=>{fileWrite(he,pe.value.trim()),r("onSave",he)}).catch(pe=>{console.log(pe)})}return(he,pe)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElContainer),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElHeader),{class:"top-el-header"},{default:vue.withCtx(()=>[vue.createVNode(TopPanel,{onChangeVisible:ae,onOnReturn:pe[0]||(pe[0]=ze=>r("onReturn")),onOnPreview:pe[1]||(pe[1]=ze=>r("onPreview",ze)),onOnSave:Ne})]),_:1}),vue.createVNode(vue.unref(ElContainer),{class:"middle"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(oe).left_nav?"show-nav":"hide-nav"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(LeftPanel,{class:"content-left","custom-tool-bar":g.customToolBar},null,8,["custom-tool-bar"])]),_:1})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElMain),{class:"middle main"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createVNode(Vue3RulerTool,{class:"canvas-main-pc",value:k.value,"step-length":50,parent:!0,"is-scale-revise":!1,visible:vue.unref(re).svg.ruler,"onUpdate:visible":pe[2]||(pe[2]=ze=>vue.unref(re).svg.ruler=ze),onInput:V},{default:vue.withCtx(()=>[vue.createVNode(CenterPanel)]),_:1},8,["value","visible"])])]),_:1}),vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(oe).right_nav?"show-nav":"hide-nav"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(RightPanel)]),_:1})]),_:1},8,["class"])]),_:1})]),_:1}),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:ie.ImportJson,"onUpdate:modelValue":pe[4]||(pe[4]=ze=>ie.ImportJson=ze),title:"导入数据",width:"60%","destroy-on-close":""},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(ElUpload),{beforeUpload:Ie,style:{display:"inline-flex","margin-right":"12px"},multiple:!1,"show-file-list":!1,limit:1},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{onClick:pe[3]||(pe[3]=ze=>ae(vue.unref(EVisibleConfKey).ImportFile,!0))},{default:vue.withCtx(()=>[vue.createTextVNode("读取文件")]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{type:"primary",onClick:le.value},{default:vue.withCtx(()=>[vue.createTextVNode("导入数据")]),_:1},8,["onClick"])]),default:vue.withCtx(()=>[vue.createVNode(_sfc_main$3,{ref_key:"importJsonRef",ref:Ce},null,512)]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:ie.ExportJson,"onUpdate:modelValue":pe[5]||(pe[5]=ze=>ie.ExportJson=ze),title:"导出",width:"60%","destroy-on-close":""},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$4)]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_4da50b34_lang="",index$1=_export_sfc(_sfc_main$1,[["__scopeId","data-v-4da50b34"]]);function commonjsRequire(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mqtt={exports:{}};(function(i,n){(function(r){i.exports=r()})(function(){return function(){function r(g,k,V){function $(Ce,ie){if(!k[Ce]){if(!g[Ce]){var ae=typeof commonjsRequire=="function"&&commonjsRequire;if(!ie&&ae)return ae(Ce,!0);if(oe)return oe(Ce,!0);var le=new Error("Cannot find module '"+Ce+"'");throw le.code="MODULE_NOT_FOUND",le}var Ie=k[Ce]={exports:{}};g[Ce][0].call(Ie.exports,function(ue){var de=g[Ce][1][ue];return $(de||ue)},Ie,Ie.exports,r,g,k,V)}return k[Ce].exports}for(var oe=typeof commonjsRequire=="function"&&commonjsRequire,re=0;re<V.length;re++)$(V[re]);return $}return r}()({1:[function(r,g,k){(function(V,$){(function(){const oe=r("events").EventEmitter,re=r("./store"),Ce=r("./topic-alias-recv"),ie=r("./topic-alias-send"),ae=r("mqtt-packet"),le=r("./default-message-id-provider"),Ie=r("readable-stream").Writable,ue=r("inherits"),de=r("reinterval"),Ne=r("rfdc/default"),he=r("./validations"),pe=r("xtend"),ze=r("debug")("mqttjs:client"),Fe=V?V.nextTick:function(ei){setTimeout(ei,0)},xe=$.setImmediate||function(ei){Fe(ei)},_e={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0},Dt=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],$e={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function Ue(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function Ve(ei,Pt){if(ei.options.protocolVersion===5&&Pt.cmd==="publish"){let ni;Pt.properties&&(ni=Pt.properties.topicAlias);const gi=Pt.topic.toString();if(ei.topicAliasSend)if(ni){if(gi.length!==0&&(ze("applyTopicAlias :: register topic: %s - alias: %d",gi,ni),!ei.topicAliasSend.put(gi,ni)))return ze("applyTopicAlias :: error out of range. topic: %s - alias: %d",gi,ni),new Error("Sending Topic Alias out of range")}else gi.length!==0&&(ei.options.autoAssignTopicAlias?(ni=ei.topicAliasSend.getAliasByTopic(gi),ni?(Pt.topic="",Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",gi,ni)):(ni=ei.topicAliasSend.getLruAlias(),ei.topicAliasSend.put(gi,ni),Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto assign topic: %s - alias: %d",gi,ni))):ei.options.autoUseTopicAlias&&(ni=ei.topicAliasSend.getAliasByTopic(gi),ni&&(Pt.topic="",Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto use topic: %s - alias: %d",gi,ni))));else if(ni)return ze("applyTopicAlias :: error out of range. topic: %s - alias: %d",gi,ni),new Error("Sending Topic Alias out of range")}}function Oe(ei,Pt){let ni;Pt.properties&&(ni=Pt.properties.topicAlias);let gi=Pt.topic.toString();if(gi.length===0){if(typeof ni>"u")return new Error("Unregistered Topic Alias");if(gi=ei.topicAliasSend.getTopicByAlias(ni),typeof gi>"u")return new Error("Unregistered Topic Alias");Pt.topic=gi}ni&&delete Pt.properties.topicAlias}function At(ei,Pt,ni){ze("sendPacket :: packet: %O",Pt),ze("sendPacket :: emitting `packetsend`"),ei.emit("packetsend",Pt),ze("sendPacket :: writing to stream");const gi=ae.writeToStream(Pt,ei.stream,ei.options);ze("sendPacket :: writeToStream result %s",gi),!gi&&ni&&ni!==jt?(ze("sendPacket :: handle events on `drain` once through callback."),ei.stream.once("drain",ni)):ni&&(ze("sendPacket :: invoking cb"),ni())}function qe(ei){ei&&(ze("flush: queue exists? %b",!!ei),Object.keys(ei).forEach(function(Pt){typeof ei[Pt].cb=="function"&&(ei[Pt].cb(new Error("Connection closed")),delete ei[Pt])}))}function Lt(ei){ei&&(ze("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(ei).forEach(function(Pt){ei[Pt].volatile&&typeof ei[Pt].cb=="function"&&(ei[Pt].cb(new Error("Connection closed")),delete ei[Pt])}))}function kt(ei,Pt,ni,gi){ze("storeAndSend :: store packet with cmd %s to outgoingStore",Pt.cmd);let di=Pt,li;if(di.cmd==="publish"&&(di=Ne(Pt),li=Oe(ei,di),li))return ni&&ni(li);ei.outgoingStore.put(di,function(ci){if(ci)return ni&&ni(ci);gi(),At(ei,Pt,ni)})}function jt(ei){ze("nop ::",ei)}function ti(ei,Pt){let ni;const gi=this;if(!(this instanceof ti))return new ti(ei,Pt);this.options=Pt||{};for(ni in _e)typeof this.options[ni]>"u"?this.options[ni]=_e[ni]:this.options[ni]=Pt[ni];ze("MqttClient :: options.protocol",Pt.protocol),ze("MqttClient :: options.protocolVersion",Pt.protocolVersion),ze("MqttClient :: options.username",Pt.username),ze("MqttClient :: options.keepalive",Pt.keepalive),ze("MqttClient :: options.reconnectPeriod",Pt.reconnectPeriod),ze("MqttClient :: options.rejectUnauthorized",Pt.rejectUnauthorized),ze("MqttClient :: options.topicAliasMaximum",Pt.topicAliasMaximum),this.options.clientId=typeof Pt.clientId=="string"?Pt.clientId:Ue(),ze("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=Pt.protocolVersion===5&&Pt.customHandleAcks?Pt.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=ei,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new le:this.options.messageIdProvider,this.outgoingStore=Pt.outgoingStore||new re,this.incomingStore=Pt.incomingStore||new re,this.queueQoSZero=Pt.queueQoSZero===void 0?!0:Pt.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,Pt.topicAliasMaximum>0&&(Pt.topicAliasMaximum>65535?ze("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new Ce(Pt.topicAliasMaximum)),this.on("connect",function(){const di=this.queue;function li(){const ai=di.shift();ze("deliver :: entry %o",ai);let ci=null;if(!ai){gi._resubscribe();return}ci=ai.packet,ze("deliver :: call _sendPacket for %o",ci);let pi=!0;ci.messageId&&ci.messageId!==0&&(gi.messageIdProvider.register(ci.messageId)||(pi=!1)),pi?gi._sendPacket(ci,function(yi){ai.cb&&ai.cb(yi),li()}):(ze("messageId: %d has already used. The message is skipped and removed.",ci.messageId),li())}ze("connect :: sending queued packets"),li()}),this.on("close",function(){ze("close :: connected set to `false`"),this.connected=!1,ze("close :: clearing connackTimer"),clearTimeout(this.connackTimer),ze("close :: clearing ping timer"),gi.pingTimer!==null&&(gi.pingTimer.clear(),gi.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),ze("close :: calling _setupReconnect"),this._setupReconnect()}),oe.call(this),ze("MqttClient :: setting up stream"),this._setupStream()}ue(ti,oe),ti.prototype._setupStream=function(){const ei=this,Pt=new Ie,ni=ae.parser(this.options);let gi=null;const di=[];ze("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),ze("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),ni.on("packet",function(yi){ze("parser :: on packet push to packets array."),di.push(yi)});function li(){if(di.length)Fe(ai);else{const yi=gi;gi=null,yi()}}function ai(){ze("work :: getting next packet in queue");const yi=di.shift();if(yi)ze("work :: packet pulled from queue"),ei._handlePacket(yi,li);else{ze("work :: no packets in queue");const Ai=gi;gi=null,ze("work :: done flag is %s",!!Ai),Ai&&Ai()}}Pt._write=function(yi,Ai,hi){gi=hi,ze("writable stream :: parsing buffer"),ni.parse(yi),ai()};function ci(yi){ze("streamErrorHandler :: error",yi.message),Dt.includes(yi.code)?(ze("streamErrorHandler :: emitting error"),ei.emit("error",yi)):jt(yi)}ze("_setupStream :: pipe stream to writable stream"),this.stream.pipe(Pt),this.stream.on("error",ci),this.stream.on("close",function(){ze("(%s)stream :: on close",ei.options.clientId),Lt(ei.outgoing),ze("stream: emit close to MqttClient"),ei.emit("close")}),ze("_setupStream: sending packet `connect`");const pi=Object.create(this.options);if(pi.cmd="connect",this.topicAliasRecv&&(pi.properties||(pi.properties={}),this.topicAliasRecv&&(pi.properties.topicAliasMaximum=this.topicAliasRecv.max)),At(this,pi),ni.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return ei.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){const yi=pe({cmd:"auth",reasonCode:0},this.options.authPacket);At(this,yi)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){ze("!!connectTimeout hit!! Calling _cleanUp with force `true`"),ei._cleanUp(!0)},this.options.connectTimeout)},ti.prototype._handlePacket=function(ei,Pt){const ni=this.options;if(ni.protocolVersion===5&&ni.properties&&ni.properties.maximumPacketSize&&ni.properties.maximumPacketSize<ei.length)return this.emit("error",new Error("exceeding packets size "+ei.cmd)),this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),this;switch(ze("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",ei),ei.cmd){case"publish":this._handlePublish(ei,Pt);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(ei),Pt();break;case"pubrel":this._handlePubrel(ei,Pt);break;case"connack":this._handleConnack(ei),Pt();break;case"auth":this._handleAuth(ei),Pt();break;case"pingresp":this._handlePingresp(ei),Pt();break;case"disconnect":this._handleDisconnect(ei),Pt();break}},ti.prototype._checkDisconnecting=function(ei){return this.disconnecting&&(ei&&ei!==jt?ei(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},ti.prototype.publish=function(ei,Pt,ni,gi){ze("publish :: message `%s` to topic `%s`",Pt,ei);const di=this.options;if(typeof ni=="function"&&(gi=ni,ni=null),ni=pe({qos:0,retain:!1,dup:!1},ni),this._checkDisconnecting(gi))return this;const ai=this,ci=function(){let pi=0;if((ni.qos===1||ni.qos===2)&&(pi=ai._nextId(),pi===null))return ze("No messageId left"),!1;const yi={cmd:"publish",topic:ei,payload:Pt,qos:ni.qos,retain:ni.retain,messageId:pi,dup:ni.dup};switch(di.protocolVersion===5&&(yi.properties=ni.properties),ze("publish :: qos",ni.qos),ni.qos){case 1:case 2:ai.outgoing[yi.messageId]={volatile:!1,cb:gi||jt},ze("MqttClient:publish: packet cmd: %s",yi.cmd),ai._sendPacket(yi,void 0,ni.cbStorePut);break;default:ze("MqttClient:publish: packet cmd: %s",yi.cmd),ai._sendPacket(yi,gi,ni.cbStorePut);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ci())&&this._storeProcessingQueue.push({invoke:ci,cbStorePut:ni.cbStorePut,callback:gi}),this},ti.prototype.subscribe=function(){const ei=this,Pt=new Array(arguments.length);for(let hi=0;hi<arguments.length;hi++)Pt[hi]=arguments[hi];const ni=[];let gi=Pt.shift();const di=gi.resubscribe;let li=Pt.pop()||jt,ai=Pt.pop();const ci=this.options.protocolVersion;delete gi.resubscribe,typeof gi=="string"&&(gi=[gi]),typeof li!="function"&&(ai=li,li=jt);const pi=he.validateTopics(gi);if(pi!==null)return xe(li,new Error("Invalid topic "+pi)),this;if(this._checkDisconnecting(li))return ze("subscribe: discconecting true"),this;const yi={qos:0};if(ci===5&&(yi.nl=!1,yi.rap=!1,yi.rh=0),ai=pe(yi,ai),Array.isArray(gi)?gi.forEach(function(hi){if(ze("subscribe: array topic %s",hi),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,hi)||ei._resubscribeTopics[hi].qos<ai.qos||di){const wi={topic:hi,qos:ai.qos};ci===5&&(wi.nl=ai.nl,wi.rap=ai.rap,wi.rh=ai.rh,wi.properties=ai.properties),ze("subscribe: pushing topic `%s` and qos `%s` to subs list",wi.topic,wi.qos),ni.push(wi)}}):Object.keys(gi).forEach(function(hi){if(ze("subscribe: object topic %s",hi),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,hi)||ei._resubscribeTopics[hi].qos<gi[hi].qos||di){const wi={topic:hi,qos:gi[hi].qos};ci===5&&(wi.nl=gi[hi].nl,wi.rap=gi[hi].rap,wi.rh=gi[hi].rh,wi.properties=ai.properties),ze("subscribe: pushing `%s` to subs list",wi),ni.push(wi)}}),!ni.length)return li(null,[]),this;const Ai=function(){const hi=ei._nextId();if(hi===null)return ze("No messageId left"),!1;const wi={cmd:"subscribe",subscriptions:ni,qos:1,retain:!1,dup:!1,messageId:hi};if(ai.properties&&(wi.properties=ai.properties),ei.options.resubscribe){ze("subscribe :: resubscribe true");const Ci=[];ni.forEach(function(mi){if(ei.options.reconnectPeriod>0){const Ni={qos:mi.qos};ci===5&&(Ni.nl=mi.nl||!1,Ni.rap=mi.rap||!1,Ni.rh=mi.rh||0,Ni.properties=mi.properties),ei._resubscribeTopics[mi.topic]=Ni,Ci.push(mi.topic)}}),ei.messageIdToTopic[wi.messageId]=Ci}return ei.outgoing[wi.messageId]={volatile:!0,cb:function(Ci,mi){if(!Ci){const Ni=mi.granted;for(let Mi=0;Mi<Ni.length;Mi+=1)ni[Mi].qos=Ni[Mi]}li(Ci,ni)}},ze("subscribe :: call _sendPacket"),ei._sendPacket(wi),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!Ai())&&this._storeProcessingQueue.push({invoke:Ai,callback:li}),this},ti.prototype.unsubscribe=function(){const ei=this,Pt=new Array(arguments.length);for(let ci=0;ci<arguments.length;ci++)Pt[ci]=arguments[ci];let ni=Pt.shift(),gi=Pt.pop()||jt,di=Pt.pop();typeof ni=="string"&&(ni=[ni]),typeof gi!="function"&&(di=gi,gi=jt);const li=he.validateTopics(ni);if(li!==null)return xe(gi,new Error("Invalid topic "+li)),this;if(ei._checkDisconnecting(gi))return this;const ai=function(){const ci=ei._nextId();if(ci===null)return ze("No messageId left"),!1;const pi={cmd:"unsubscribe",qos:1,messageId:ci};return typeof ni=="string"?pi.unsubscriptions=[ni]:Array.isArray(ni)&&(pi.unsubscriptions=ni),ei.options.resubscribe&&pi.unsubscriptions.forEach(function(yi){delete ei._resubscribeTopics[yi]}),typeof di=="object"&&di.properties&&(pi.properties=di.properties),ei.outgoing[pi.messageId]={volatile:!0,cb:gi},ze("unsubscribe: call _sendPacket"),ei._sendPacket(pi),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ai())&&this._storeProcessingQueue.push({invoke:ai,callback:gi}),this},ti.prototype.end=function(ei,Pt,ni){const gi=this;ze("end :: (%s)",this.options.clientId),(ei==null||typeof ei!="boolean")&&(ni=Pt||jt,Pt=ei,ei=!1,typeof Pt!="object"&&(ni=Pt,Pt=null,typeof ni!="function"&&(ni=jt))),typeof Pt!="object"&&(ni=Pt,Pt=null),ze("end :: cb? %s",!!ni),ni=ni||jt;function di(){ze("end :: closeStores: closing incoming and outgoing stores"),gi.disconnected=!0,gi.incomingStore.close(function(ai){gi.outgoingStore.close(function(ci){if(ze("end :: closeStores: emitting end"),gi.emit("end"),ni){const pi=ai||ci;ze("end :: closeStores: invoking callback with args"),ni(pi)}})}),gi._deferredReconnect&&gi._deferredReconnect()}function li(){ze("end :: (%s) :: finish :: calling _cleanUp with force %s",gi.options.clientId,ei),gi._cleanUp(ei,()=>{ze("end :: finish :: calling process.nextTick on closeStores"),Fe(di.bind(gi))},Pt)}return this.disconnecting?(ni(),this):(this._clearReconnect(),this.disconnecting=!0,!ei&&Object.keys(this.outgoing).length>0?(ze("end :: (%s) :: calling finish in 10ms once outgoing is empty",gi.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,li,10))):(ze("end :: (%s) :: immediately calling finish",gi.options.clientId),li()),this)},ti.prototype.removeOutgoingMessage=function(ei){const Pt=this.outgoing[ei]?this.outgoing[ei].cb:null;return delete this.outgoing[ei],this.outgoingStore.del({messageId:ei},function(){Pt(new Error("Message removed"))}),this},ti.prototype.reconnect=function(ei){ze("client reconnect");const Pt=this,ni=function(){ei?(Pt.options.incomingStore=ei.incomingStore,Pt.options.outgoingStore=ei.outgoingStore):(Pt.options.incomingStore=null,Pt.options.outgoingStore=null),Pt.incomingStore=Pt.options.incomingStore||new re,Pt.outgoingStore=Pt.options.outgoingStore||new re,Pt.disconnecting=!1,Pt.disconnected=!1,Pt._deferredReconnect=null,Pt._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=ni:ni(),this},ti.prototype._reconnect=function(){ze("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),ze("client already connected. disconnecting first.")):(ze("_reconnect: calling _setupStream"),this._setupStream())},ti.prototype._setupReconnect=function(){const ei=this;!ei.disconnecting&&!ei.reconnectTimer&&ei.options.reconnectPeriod>0?(this.reconnecting||(ze("_setupReconnect :: emit `offline` state"),this.emit("offline"),ze("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),ze("_setupReconnect :: setting reconnectTimer for %d ms",ei.options.reconnectPeriod),ei.reconnectTimer=setInterval(function(){ze("reconnectTimer :: reconnect triggered!"),ei._reconnect()},ei.options.reconnectPeriod)):ze("_setupReconnect :: doing nothing...")},ti.prototype._clearReconnect=function(){ze("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},ti.prototype._cleanUp=function(ei,Pt){const ni=arguments[2];if(Pt&&(ze("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",Pt)),ze("_cleanUp :: forced? %s",ei),ei)this.options.reconnectPeriod===0&&this.options.clean&&qe(this.outgoing),ze("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const gi=pe({cmd:"disconnect"},ni);ze("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(gi,xe.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(ze("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(ze("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),Pt&&!this.connected&&(ze("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",Pt),Pt())},ti.prototype._sendPacket=function(ei,Pt,ni){ze("_sendPacket :: (%s) :: start",this.options.clientId),ni=ni||jt,Pt=Pt||jt;const gi=Ve(this,ei);if(gi){Pt(gi);return}if(!this.connected){if(ei.cmd==="auth"){this._shiftPingInterval(),At(this,ei,Pt);return}ze("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(ei,Pt,ni);return}switch(this._shiftPingInterval(),ei.cmd){case"publish":break;case"pubrel":kt(this,ei,Pt,ni);return;default:At(this,ei,Pt);return}switch(ei.qos){case 2:case 1:kt(this,ei,Pt,ni);break;case 0:default:At(this,ei,Pt);break}ze("_sendPacket :: (%s) :: end",this.options.clientId)},ti.prototype._storePacket=function(ei,Pt,ni){ze("_storePacket :: packet: %o",ei),ze("_storePacket :: cb? %s",!!Pt),ni=ni||jt;let gi=ei;if(gi.cmd==="publish"){gi=Ne(ei);const di=Oe(this,gi);if(di)return Pt&&Pt(di)}(gi.qos||0)===0&&this.queueQoSZero||gi.cmd!=="publish"?this.queue.push({packet:gi,cb:Pt}):gi.qos>0?(Pt=this.outgoing[gi.messageId]?this.outgoing[gi.messageId].cb:null,this.outgoingStore.put(gi,function(di){if(di)return Pt&&Pt(di);ni()})):Pt&&Pt(new Error("No connection to broker"))},ti.prototype._setupPingTimer=function(){ze("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);const ei=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=de(function(){ei._checkPing()},this.options.keepalive*1e3))},ti.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)},ti.prototype._checkPing=function(){ze("_checkPing :: checking ping..."),this.pingResp?(ze("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(ze("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},ti.prototype._handlePingresp=function(){this.pingResp=!0},ti.prototype._handleConnack=function(ei){ze("_handleConnack");const Pt=this.options,gi=Pt.protocolVersion===5?ei.reasonCode:ei.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,ei.properties){if(ei.properties.topicAliasMaximum){if(ei.properties.topicAliasMaximum>65535){this.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}ei.properties.topicAliasMaximum>0&&(this.topicAliasSend=new ie(ei.properties.topicAliasMaximum))}ei.properties.serverKeepAlive&&Pt.keepalive&&(Pt.keepalive=ei.properties.serverKeepAlive,this._shiftPingInterval()),ei.properties.maximumPacketSize&&(Pt.properties||(Pt.properties={}),Pt.properties.maximumPacketSize=ei.properties.maximumPacketSize)}if(gi===0)this.reconnecting=!1,this._onConnect(ei);else if(gi>0){const di=new Error("Connection refused: "+$e[gi]);di.code=gi,this.emit("error",di)}},ti.prototype._handleAuth=function(ei){const ni=this.options.protocolVersion,gi=ni===5?ei.reasonCode:ei.returnCode;if(ni!==5){const li=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+ni);li.code=gi,this.emit("error",li);return}const di=this;this.handleAuth(ei,function(li,ai){if(li){di.emit("error",li);return}if(gi===24)di.reconnecting=!1,di._sendPacket(ai);else{const ci=new Error("Connection refused: "+$e[gi]);li.code=gi,di.emit("error",ci)}})},ti.prototype.handleAuth=function(ei,Pt){Pt()},ti.prototype._handlePublish=function(ei,Pt){ze("_handlePublish: packet %o",ei),Pt=typeof Pt<"u"?Pt:jt;let ni=ei.topic.toString();const gi=ei.payload,di=ei.qos,li=ei.messageId,ai=this,ci=this.options,pi=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){let yi;if(ei.properties&&(yi=ei.properties.topicAlias),typeof yi<"u")if(ni.length===0)if(yi>0&&yi<=65535){const Ai=this.topicAliasRecv.getTopicByAlias(yi);if(Ai)ni=Ai,ze("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",ni,yi);else{ze("_handlePublish :: unregistered topic alias. alias: %d",yi),this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{ze("_handlePublish :: topic alias out of range. alias: %d",yi),this.emit("error",new Error("Received Topic Alias is out of range"));return}else if(this.topicAliasRecv.put(ni,yi))ze("_handlePublish :: registered topic: %s - alias: %d",ni,yi);else{ze("_handlePublish :: topic alias out of range. alias: %d",yi),this.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(ze("_handlePublish: qos %d",di),di){case 2:{ci.customHandleAcks(ni,gi,ei,function(yi,Ai){if(yi instanceof Error||(Ai=yi,yi=null),yi)return ai.emit("error",yi);if(pi.indexOf(Ai)===-1)return ai.emit("error",new Error("Wrong reason code for pubrec"));Ai?ai._sendPacket({cmd:"pubrec",messageId:li,reasonCode:Ai},Pt):ai.incomingStore.put(ei,function(){ai._sendPacket({cmd:"pubrec",messageId:li},Pt)})});break}case 1:{ci.customHandleAcks(ni,gi,ei,function(yi,Ai){if(yi instanceof Error||(Ai=yi,yi=null),yi)return ai.emit("error",yi);if(pi.indexOf(Ai)===-1)return ai.emit("error",new Error("Wrong reason code for puback"));Ai||ai.emit("message",ni,gi,ei),ai.handleMessage(ei,function(hi){if(hi)return Pt&&Pt(hi);ai._sendPacket({cmd:"puback",messageId:li,reasonCode:Ai},Pt)})});break}case 0:this.emit("message",ni,gi,ei),this.handleMessage(ei,Pt);break;default:ze("_handlePublish: unknown QoS. Doing nothing.");break}},ti.prototype.handleMessage=function(ei,Pt){Pt()},ti.prototype._handleAck=function(ei){const Pt=ei.messageId,ni=ei.cmd;let gi=null;const di=this.outgoing[Pt]?this.outgoing[Pt].cb:null,li=this;let ai;if(!di){ze("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(ze("_handleAck :: packet type",ni),ni){case"pubcomp":case"puback":{const ci=ei.reasonCode;ci&&ci>0&&ci!==16&&(ai=new Error("Publish error: "+$e[ci]),ai.code=ci,di(ai,ei)),delete this.outgoing[Pt],this.outgoingStore.del(ei,di),this.messageIdProvider.deallocate(Pt),this._invokeStoreProcessingQueue();break}case"pubrec":{gi={cmd:"pubrel",qos:2,messageId:Pt};const ci=ei.reasonCode;ci&&ci>0&&ci!==16?(ai=new Error("Publish error: "+$e[ci]),ai.code=ci,di(ai,ei)):this._sendPacket(gi);break}case"suback":{delete this.outgoing[Pt],this.messageIdProvider.deallocate(Pt);for(let ci=0;ci<ei.granted.length;ci++)if(ei.granted[ci]&128){const pi=this.messageIdToTopic[Pt];pi&&pi.forEach(function(yi){delete li._resubscribeTopics[yi]})}this._invokeStoreProcessingQueue(),di(null,ei);break}case"unsuback":{delete this.outgoing[Pt],this.messageIdProvider.deallocate(Pt),this._invokeStoreProcessingQueue(),di(null);break}default:li.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&Object.keys(this.outgoing).length===0&&this.emit("outgoingEmpty")},ti.prototype._handlePubrel=function(ei,Pt){ze("handling pubrel packet"),Pt=typeof Pt<"u"?Pt:jt;const ni=ei.messageId,gi=this,di={cmd:"pubcomp",messageId:ni};gi.incomingStore.get(ei,function(li,ai){li?gi._sendPacket(di,Pt):(gi.emit("message",ai.topic,ai.payload,ai),gi.handleMessage(ai,function(ci){if(ci)return Pt(ci);gi.incomingStore.del(ai,jt),gi._sendPacket(di,Pt)}))})},ti.prototype._handleDisconnect=function(ei){this.emit("disconnect",ei)},ti.prototype._nextId=function(){return this.messageIdProvider.allocate()},ti.prototype.getLastMessageId=function(){return this.messageIdProvider.getLastAllocated()},ti.prototype._resubscribe=function(){ze("_resubscribe");const ei=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion===5&&!this.connackPacket.sessionPresent)&&ei.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){ze("_resubscribe: protocolVersion 5");for(let Pt=0;Pt<ei.length;Pt++){const ni={};ni[ei[Pt]]=this._resubscribeTopics[ei[Pt]],ni.resubscribe=!0,this.subscribe(ni,{properties:ni[ei[Pt]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1},ti.prototype._onConnect=function(ei){if(this.disconnected){this.emit("connect",ei);return}const Pt=this;this.connackPacket=ei,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;function ni(){let gi=Pt.outgoingStore.createStream();function di(){Pt._storeProcessing=!1,Pt._packetIdsDuringStoreProcessing={}}Pt.once("close",li),gi.on("error",function(ci){di(),Pt._flushStoreProcessingQueue(),Pt.removeListener("close",li),Pt.emit("error",ci)});function li(){gi.destroy(),gi=null,Pt._flushStoreProcessingQueue(),di()}function ai(){if(!gi)return;Pt._storeProcessing=!0;const ci=gi.read(1);let pi;if(!ci){gi.once("readable",ai);return}if(Pt._packetIdsDuringStoreProcessing[ci.messageId]){ai();return}!Pt.disconnecting&&!Pt.reconnectTimer?(pi=Pt.outgoing[ci.messageId]?Pt.outgoing[ci.messageId].cb:null,Pt.outgoing[ci.messageId]={volatile:!1,cb:function(yi,Ai){pi&&pi(yi,Ai),ai()}},Pt._packetIdsDuringStoreProcessing[ci.messageId]=!0,Pt.messageIdProvider.register(ci.messageId)?Pt._sendPacket(ci):ze("messageId: %d has already used.",ci.messageId)):gi.destroy&&gi.destroy()}gi.on("end",function(){let ci=!0;for(const pi in Pt._packetIdsDuringStoreProcessing)if(!Pt._packetIdsDuringStoreProcessing[pi]){ci=!1;break}ci?(di(),Pt.removeListener("close",li),Pt._invokeAllStoreProcessingQueue(),Pt.emit("connect",ei)):ni()}),ai()}ni()},ti.prototype._invokeStoreProcessingQueue=function(){if(this._storeProcessingQueue.length>0){const ei=this._storeProcessingQueue[0];if(ei&&ei.invoke())return this._storeProcessingQueue.shift(),!0}return!1},ti.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},ti.prototype._flushStoreProcessingQueue=function(){for(const ei of this._storeProcessingQueue)ei.cbStorePut&&ei.cbStorePut(new Error("Connection closed")),ei.callback&&ei.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},g.exports=ti}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"./default-message-id-provider":7,"./store":8,"./topic-alias-recv":9,"./topic-alias-send":10,"./validations":11,_process:50,debug:18,events:22,inherits:24,"mqtt-packet":40,"readable-stream":69,reinterval:70,"rfdc/default":71,xtend:81}],2:[function(r,g,k){const{Buffer:V}=r("buffer"),$=r("readable-stream").Transform,oe=r("duplexify");let re,Ce,ie,ae=!1;function le(){const he=new $;return he._write=function(pe,ze,Fe){re.sendSocketMessage({data:pe.buffer,success:function(){Fe()},fail:function(){Fe(new Error)}})},he._flush=function(ze){re.closeSocket({success:function(){ze()}})},he}function Ie(he){he.hostname||(he.hostname="localhost"),he.path||(he.path="/"),he.wsOptions||(he.wsOptions={})}function ue(he,pe){const ze=he.protocol==="alis"?"wss":"ws";let Fe=ze+"://"+he.hostname+he.path;return he.port&&he.port!==80&&he.port!==443&&(Fe=ze+"://"+he.hostname+":"+he.port+he.path),typeof he.transformWsUrl=="function"&&(Fe=he.transformWsUrl(Fe,he,pe)),Fe}function de(){ae||(ae=!0,re.onSocketOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),re.onSocketMessage(function(he){if(typeof he.data=="string"){const pe=V.from(he.data,"base64");Ce.push(pe)}else{const pe=new FileReader;pe.addEventListener("load",function(){let ze=pe.result;ze instanceof ArrayBuffer?ze=V.from(ze):ze=V.from(ze,"utf8"),Ce.push(ze)}),pe.readAsArrayBuffer(he.data)}}),re.onSocketClose(function(){ie.end(),ie.destroy()}),re.onSocketError(function(he){ie.destroy(he)}))}function Ne(he,pe){if(pe.hostname=pe.hostname||pe.host,!pe.hostname)throw new Error("Could not determine host. Specify host manually.");const ze=pe.protocolId==="MQIsdp"&&pe.protocolVersion===3?"mqttv3.1":"mqtt";Ie(pe);const Fe=ue(pe,he);return re=pe.my,re.connectSocket({url:Fe,protocols:ze}),Ce=le(),ie=oe.obj(),de(),ie}g.exports=Ne},{buffer:17,duplexify:20,"readable-stream":69}],3:[function(r,g,k){const V=r("net"),$=r("debug")("mqttjs:tcp");function oe(re,Ce){Ce.port=Ce.port||1883,Ce.hostname=Ce.hostname||Ce.host||"localhost";const ie=Ce.port,ae=Ce.hostname;return $("port %d and host %s",ie,ae),V.createConnection(ie,ae)}g.exports=oe},{debug:18,net:16}],4:[function(r,g,k){const V=r("tls"),$=r("net"),oe=r("debug")("mqttjs:tls");function re(Ce,ie){ie.port=ie.port||8883,ie.host=ie.hostname||ie.host||"localhost",$.isIP(ie.host)===0&&(ie.servername=ie.host),ie.rejectUnauthorized=ie.rejectUnauthorized!==!1,delete ie.path,oe("port %d host %s rejectUnauthorized %b",ie.port,ie.host,ie.rejectUnauthorized);const ae=V.connect(ie);ae.on("secureConnect",function(){ie.rejectUnauthorized&&!ae.authorized?ae.emit("error",new Error("TLS not authorized")):ae.removeListener("error",le)});function le(Ie){ie.rejectUnauthorized&&Ce.emit("error",Ie),ae.end()}return ae.on("error",le),ae}g.exports=re},{debug:18,net:16,tls:16}],5:[function(r,g,k){(function(V){(function(){const{Buffer:$}=r("buffer"),oe=r("ws"),re=r("debug")("mqttjs:ws"),Ce=r("duplexify"),ie=r("readable-stream").Transform,ae=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],le=typeof V<"u"&&V.title==="browser"||typeof __webpack_require__=="function";function Ie(Fe,xe){let _e=Fe.protocol+"://"+Fe.hostname+":"+Fe.port+Fe.path;return typeof Fe.transformWsUrl=="function"&&(_e=Fe.transformWsUrl(_e,Fe,xe)),_e}function ue(Fe){const xe=Fe;return Fe.hostname||(xe.hostname="localhost"),Fe.port||(Fe.protocol==="wss"?xe.port=443:xe.port=80),Fe.path||(xe.path="/"),Fe.wsOptions||(xe.wsOptions={}),!le&&Fe.protocol==="wss"&&ae.forEach(function(_e){Object.prototype.hasOwnProperty.call(Fe,_e)&&!Object.prototype.hasOwnProperty.call(Fe.wsOptions,_e)&&(xe.wsOptions[_e]=Fe[_e])}),xe}function de(Fe){const xe=ue(Fe);if(xe.hostname||(xe.hostname=xe.host),!xe.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");const _e=new URL(document.URL);xe.hostname=_e.hostname,xe.port||(xe.port=_e.port)}return xe.objectMode===void 0&&(xe.objectMode=!(xe.binary===!0||xe.binary===void 0)),xe}function Ne(Fe,xe,_e){re("createWebSocket"),re("protocol: "+_e.protocolId+" "+_e.protocolVersion);const Dt=_e.protocolId==="MQIsdp"&&_e.protocolVersion===3?"mqttv3.1":"mqtt";return re("creating new Websocket for url: "+xe+" and protocol: "+Dt),new oe(xe,[Dt],_e.wsOptions)}function he(Fe,xe){const _e=xe.protocolId==="MQIsdp"&&xe.protocolVersion===3?"mqttv3.1":"mqtt",Dt=Ie(xe,Fe),$e=new WebSocket(Dt,[_e]);return $e.binaryType="arraybuffer",$e}function pe(Fe,xe){re("streamBuilder");const _e=ue(xe),Dt=Ie(_e,Fe),$e=Ne(Fe,Dt,_e),Ue=oe.createWebSocketStream($e,_e.wsOptions);return Ue.url=Dt,$e.on("close",()=>{Ue.destroy()}),Ue}function ze(Fe,xe){re("browserStreamBuilder");let _e;const $e=de(xe).browserBufferSize||1024*512,Ue=xe.browserBufferTimeout||1e3,Ve=!xe.objectMode,Oe=he(Fe,xe),At=Lt(xe,ni,gi);xe.objectMode||(At._writev=Pt),At.on("close",()=>{Oe.close()});const qe=typeof Oe.addEventListener<"u";Oe.readyState===Oe.OPEN?_e=At:(_e=_e=Ce(void 0,void 0,xe),xe.objectMode||(_e._writev=Pt),qe?Oe.addEventListener("open",kt):Oe.onopen=kt),_e.socket=Oe,qe?(Oe.addEventListener("close",jt),Oe.addEventListener("error",ti),Oe.addEventListener("message",ei)):(Oe.onclose=jt,Oe.onerror=ti,Oe.onmessage=ei);function Lt(di,li,ai){const ci=new ie({objectModeMode:di.objectMode});return ci._write=li,ci._flush=ai,ci}function kt(){_e.setReadable(At),_e.setWritable(At),_e.emit("connect")}function jt(){_e.end(),_e.destroy()}function ti(di){_e.destroy(di)}function ei(di){let li=di.data;li instanceof ArrayBuffer?li=$.from(li):li=$.from(li,"utf8"),At.push(li)}function Pt(di,li){const ai=new Array(di.length);for(let ci=0;ci<di.length;ci++)typeof di[ci].chunk=="string"?ai[ci]=$.from(di[ci],"utf8"):ai[ci]=di[ci].chunk;this._write($.concat(ai),"binary",li)}function ni(di,li,ai){Oe.bufferedAmount>$e&&setTimeout(ni,Ue,di,li,ai),Ve&&typeof di=="string"&&(di=$.from(di,"utf8"));try{Oe.send(di)}catch(ci){return ai(ci)}ai()}function gi(di){Oe.close(),di()}return _e}le?g.exports=ze:g.exports=pe}).call(this)}).call(this,r("_process"))},{_process:50,buffer:17,debug:18,duplexify:20,"readable-stream":69,ws:80}],6:[function(r,g,k){const{Buffer:V}=r("buffer"),$=r("readable-stream").Transform,oe=r("duplexify");let re,Ce,ie;function ae(){const Ne=new $;return Ne._write=function(he,pe,ze){re.send({data:he.buffer,success:function(){ze()},fail:function(Fe){ze(new Error(Fe))}})},Ne._flush=function(pe){re.close({success:function(){pe()}})},Ne}function le(Ne){Ne.hostname||(Ne.hostname="localhost"),Ne.path||(Ne.path="/"),Ne.wsOptions||(Ne.wsOptions={})}function Ie(Ne,he){const pe=Ne.protocol==="wxs"?"wss":"ws";let ze=pe+"://"+Ne.hostname+Ne.path;return Ne.port&&Ne.port!==80&&Ne.port!==443&&(ze=pe+"://"+Ne.hostname+":"+Ne.port+Ne.path),typeof Ne.transformWsUrl=="function"&&(ze=Ne.transformWsUrl(ze,Ne,he)),ze}function ue(){re.onOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),re.onMessage(function(Ne){let he=Ne.data;he instanceof ArrayBuffer?he=V.from(he):he=V.from(he,"utf8"),Ce.push(he)}),re.onClose(function(){ie.end(),ie.destroy()}),re.onError(function(Ne){ie.destroy(new Error(Ne.errMsg))})}function de(Ne,he){if(he.hostname=he.hostname||he.host,!he.hostname)throw new Error("Could not determine host. Specify host manually.");const pe=he.protocolId==="MQIsdp"&&he.protocolVersion===3?"mqttv3.1":"mqtt";le(he);const ze=Ie(he,Ne);re=wx.connectSocket({url:ze,protocols:[pe]}),Ce=ae(),ie=oe.obj(),ie._destroy=function(xe,_e){re.close({success:function(){_e&&_e(xe)}})};const Fe=ie.destroy;return ie.destroy=function(){ie.destroy=Fe;const xe=this;setTimeout(function(){re.close({fail:function(){xe._destroy(new Error)}})},0)}.bind(ie),ue(),ie}g.exports=de},{buffer:17,duplexify:20,"readable-stream":69}],7:[function(r,g,k){function V(){if(!(this instanceof V))return new V;this.nextId=Math.max(1,Math.floor(Math.random()*65535))}V.prototype.allocate=function(){const $=this.nextId++;return this.nextId===65536&&(this.nextId=1),$},V.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1},V.prototype.register=function($){return!0},V.prototype.deallocate=function($){},V.prototype.clear=function(){},g.exports=V},{}],8:[function(r,g,k){const V=r("xtend"),$=r("readable-stream").Readable,oe={objectMode:!0},re={clean:!0};function Ce(ie){if(!(this instanceof Ce))return new Ce(ie);this.options=ie||{},this.options=V(re,ie),this._inflights=new Map}Ce.prototype.put=function(ie,ae){return this._inflights.set(ie.messageId,ie),ae&&ae(),this},Ce.prototype.createStream=function(){const ie=new $(oe),ae=[];let le=!1,Ie=0;return this._inflights.forEach(function(ue,de){ae.push(ue)}),ie._read=function(){!le&&Ie<ae.length?this.push(ae[Ie++]):this.push(null)},ie.destroy=function(){if(le)return;const ue=this;le=!0,setTimeout(function(){ue.emit("close")},0)},ie},Ce.prototype.del=function(ie,ae){return ie=this._inflights.get(ie.messageId),ie?(this._inflights.delete(ie.messageId),ae(null,ie)):ae&&ae(new Error("missing packet")),this},Ce.prototype.get=function(ie,ae){return ie=this._inflights.get(ie.messageId),ie?ae(null,ie):ae&&ae(new Error("missing packet")),this},Ce.prototype.close=function(ie){this.options.clean&&(this._inflights=null),ie&&ie()},g.exports=Ce},{"readable-stream":69,xtend:81}],9:[function(r,g,k){function V($){if(!(this instanceof V))return new V($);this.aliasToTopic={},this.max=$}V.prototype.put=function($,oe){return oe===0||oe>this.max?!1:(this.aliasToTopic[oe]=$,this.length=Object.keys(this.aliasToTopic).length,!0)},V.prototype.getTopicByAlias=function($){return this.aliasToTopic[$]},V.prototype.clear=function(){this.aliasToTopic={}},g.exports=V},{}],10:[function(r,g,k){const V=r("lru-cache"),$=r("number-allocator").NumberAllocator;function oe(re){if(!(this instanceof oe))return new oe(re);re>0&&(this.aliasToTopic=new V({max:re}),this.topicToAlias={},this.numberAllocator=new $(1,re),this.max=re,this.length=0)}oe.prototype.put=function(re,Ce){if(Ce===0||Ce>this.max)return!1;const ie=this.aliasToTopic.get(Ce);return ie&&delete this.topicToAlias[ie],this.aliasToTopic.set(Ce,re),this.topicToAlias[re]=Ce,this.numberAllocator.use(Ce),this.length=this.aliasToTopic.length,!0},oe.prototype.getTopicByAlias=function(re){return this.aliasToTopic.get(re)},oe.prototype.getAliasByTopic=function(re){const Ce=this.topicToAlias[re];return typeof Ce<"u"&&this.aliasToTopic.get(Ce),Ce},oe.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},oe.prototype.getLruAlias=function(){const re=this.numberAllocator.firstVacant();return re||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},g.exports=oe},{"lru-cache":37,"number-allocator":46}],11:[function(r,g,k){function V(oe){const re=oe.split("/");for(let Ce=0;Ce<re.length;Ce++)if(re[Ce]!=="+"){if(re[Ce]==="#")return Ce===re.length-1;if(re[Ce].indexOf("+")!==-1||re[Ce].indexOf("#")!==-1)return!1}return!0}function $(oe){if(oe.length===0)return"empty_topic_list";for(let re=0;re<oe.length;re++)if(!V(oe[re]))return oe[re];return null}g.exports={validateTopics:$}},{}],12:[function(r,g,k){(function(V){(function(){const $=r("../client"),oe=r("../store"),re=r("url"),Ce=r("xtend"),ie=r("debug")("mqttjs"),ae={};typeof V<"u"&&V.title!=="browser"||typeof __webpack_require__!="function"?(ae.mqtt=r("./tcp"),ae.tcp=r("./tcp"),ae.ssl=r("./tls"),ae.tls=r("./tls"),ae.mqtts=r("./tls")):(ae.wx=r("./wx"),ae.wxs=r("./wx"),ae.ali=r("./ali"),ae.alis=r("./ali")),ae.ws=r("./ws"),ae.wss=r("./ws");function le(ue){let de;ue.auth&&(de=ue.auth.match(/^(.+):(.+)$/),de?(ue.username=de[1],ue.password=de[2]):ue.username=ue.auth)}function Ie(ue,de){if(ie("connecting to an MQTT broker..."),typeof ue=="object"&&!de&&(de=ue,ue=null),de=de||{},ue){const pe=re.parse(ue,!0);if(pe.port!=null&&(pe.port=Number(pe.port)),de=Ce(pe,de),de.protocol===null)throw new Error("Missing protocol");de.protocol=de.protocol.replace(/:$/,"")}if(le(de),de.query&&typeof de.query.clientId=="string"&&(de.clientId=de.query.clientId),de.cert&&de.key)if(de.protocol){if(["mqtts","wss","wxs","alis"].indexOf(de.protocol)===-1)switch(de.protocol){case"mqtt":de.protocol="mqtts";break;case"ws":de.protocol="wss";break;case"wx":de.protocol="wxs";break;case"ali":de.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+de.protocol+'"!')}}else throw new Error("Missing secure protocol key");if(!ae[de.protocol]){const pe=["mqtts","wss"].indexOf(de.protocol)!==-1;de.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(ze,Fe){return pe&&Fe%2===0?!1:typeof ae[ze]=="function"})[0]}if(de.clean===!1&&!de.clientId)throw new Error("Missing clientId for unclean clients");de.protocol&&(de.defaultProtocol=de.protocol);function Ne(pe){return de.servers&&((!pe._reconnectCount||pe._reconnectCount===de.servers.length)&&(pe._reconnectCount=0),de.host=de.servers[pe._reconnectCount].host,de.port=de.servers[pe._reconnectCount].port,de.protocol=de.servers[pe._reconnectCount].protocol?de.servers[pe._reconnectCount].protocol:de.defaultProtocol,de.hostname=de.host,pe._reconnectCount++),ie("calling streambuilder for",de.protocol),ae[de.protocol](pe,de)}const he=new $(Ne,de);return he.on("error",function(){}),he}g.exports=Ie,g.exports.connect=Ie,g.exports.MqttClient=$,g.exports.Store=oe}).call(this)}).call(this,r("_process"))},{"../client":1,"../store":8,"./ali":2,"./tcp":3,"./tls":4,"./ws":5,"./wx":6,_process:50,debug:18,url:76,xtend:81}],13:[function(r,g,k){k.byteLength=le,k.toByteArray=ue,k.fromByteArray=he;for(var V=[],$=[],oe=typeof Uint8Array<"u"?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ce=0,ie=re.length;Ce<ie;++Ce)V[Ce]=re[Ce],$[re.charCodeAt(Ce)]=Ce;$["-".charCodeAt(0)]=62,$["_".charCodeAt(0)]=63;function ae(pe){var ze=pe.length;if(ze%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var Fe=pe.indexOf("=");Fe===-1&&(Fe=ze);var xe=Fe===ze?0:4-Fe%4;return[Fe,xe]}function le(pe){var ze=ae(pe),Fe=ze[0],xe=ze[1];return(Fe+xe)*3/4-xe}function Ie(pe,ze,Fe){return(ze+Fe)*3/4-Fe}function ue(pe){var ze,Fe=ae(pe),xe=Fe[0],_e=Fe[1],Dt=new oe(Ie(pe,xe,_e)),$e=0,Ue=_e>0?xe-4:xe,Ve;for(Ve=0;Ve<Ue;Ve+=4)ze=$[pe.charCodeAt(Ve)]<<18|$[pe.charCodeAt(Ve+1)]<<12|$[pe.charCodeAt(Ve+2)]<<6|$[pe.charCodeAt(Ve+3)],Dt[$e++]=ze>>16&255,Dt[$e++]=ze>>8&255,Dt[$e++]=ze&255;return _e===2&&(ze=$[pe.charCodeAt(Ve)]<<2|$[pe.charCodeAt(Ve+1)]>>4,Dt[$e++]=ze&255),_e===1&&(ze=$[pe.charCodeAt(Ve)]<<10|$[pe.charCodeAt(Ve+1)]<<4|$[pe.charCodeAt(Ve+2)]>>2,Dt[$e++]=ze>>8&255,Dt[$e++]=ze&255),Dt}function de(pe){return V[pe>>18&63]+V[pe>>12&63]+V[pe>>6&63]+V[pe&63]}function Ne(pe,ze,Fe){for(var xe,_e=[],Dt=ze;Dt<Fe;Dt+=3)xe=(pe[Dt]<<16&16711680)+(pe[Dt+1]<<8&65280)+(pe[Dt+2]&255),_e.push(de(xe));return _e.join("")}function he(pe){for(var ze,Fe=pe.length,xe=Fe%3,_e=[],Dt=16383,$e=0,Ue=Fe-xe;$e<Ue;$e+=Dt)_e.push(Ne(pe,$e,$e+Dt>Ue?Ue:$e+Dt));return xe===1?(ze=pe[Fe-1],_e.push(V[ze>>2]+V[ze<<4&63]+"==")):xe===2&&(ze=(pe[Fe-2]<<8)+pe[Fe-1],_e.push(V[ze>>10]+V[ze>>4&63]+V[ze<<2&63]+"=")),_e.join("")}},{}],14:[function(r,g,k){const{Buffer:V}=r("buffer"),$=Symbol.for("BufferList");function oe(re){if(!(this instanceof oe))return new oe(re);oe._init.call(this,re)}oe._init=function(Ce){Object.defineProperty(this,$,{value:!0}),this._bufs=[],this.length=0,Ce&&this.append(Ce)},oe.prototype._new=function(Ce){return new oe(Ce)},oe.prototype._offset=function(Ce){if(Ce===0)return[0,0];let ie=0;for(let ae=0;ae<this._bufs.length;ae++){const le=ie+this._bufs[ae].length;if(Ce<le||ae===this._bufs.length-1)return[ae,Ce-ie];ie=le}},oe.prototype._reverseOffset=function(re){const Ce=re[0];let ie=re[1];for(let ae=0;ae<Ce;ae++)ie+=this._bufs[ae].length;return ie},oe.prototype.get=function(Ce){if(Ce>this.length||Ce<0)return;const ie=this._offset(Ce);return this._bufs[ie[0]][ie[1]]},oe.prototype.slice=function(Ce,ie){return typeof Ce=="number"&&Ce<0&&(Ce+=this.length),typeof ie=="number"&&ie<0&&(ie+=this.length),this.copy(null,0,Ce,ie)},oe.prototype.copy=function(Ce,ie,ae,le){if((typeof ae!="number"||ae<0)&&(ae=0),(typeof le!="number"||le>this.length)&&(le=this.length),ae>=this.length||le<=0)return Ce||V.alloc(0);const Ie=!!Ce,ue=this._offset(ae),de=le-ae;let Ne=de,he=Ie&&ie||0,pe=ue[1];if(ae===0&&le===this.length){if(!Ie)return this._bufs.length===1?this._bufs[0]:V.concat(this._bufs,this.length);for(let ze=0;ze<this._bufs.length;ze++)this._bufs[ze].copy(Ce,he),he+=this._bufs[ze].length;return Ce}if(Ne<=this._bufs[ue[0]].length-pe)return Ie?this._bufs[ue[0]].copy(Ce,ie,pe,pe+Ne):this._bufs[ue[0]].slice(pe,pe+Ne);Ie||(Ce=V.allocUnsafe(de));for(let ze=ue[0];ze<this._bufs.length;ze++){const Fe=this._bufs[ze].length-pe;if(Ne>Fe)this._bufs[ze].copy(Ce,he,pe),he+=Fe;else{this._bufs[ze].copy(Ce,he,pe,pe+Ne),he+=Fe;break}Ne-=Fe,pe&&(pe=0)}return Ce.length>he?Ce.slice(0,he):Ce},oe.prototype.shallowSlice=function(Ce,ie){if(Ce=Ce||0,ie=typeof ie!="number"?this.length:ie,Ce<0&&(Ce+=this.length),ie<0&&(ie+=this.length),Ce===ie)return this._new();const ae=this._offset(Ce),le=this._offset(ie),Ie=this._bufs.slice(ae[0],le[0]+1);return le[1]===0?Ie.pop():Ie[Ie.length-1]=Ie[Ie.length-1].slice(0,le[1]),ae[1]!==0&&(Ie[0]=Ie[0].slice(ae[1])),this._new(Ie)},oe.prototype.toString=function(Ce,ie,ae){return this.slice(ie,ae).toString(Ce)},oe.prototype.consume=function(Ce){if(Ce=Math.trunc(Ce),Number.isNaN(Ce)||Ce<=0)return this;for(;this._bufs.length;)if(Ce>=this._bufs[0].length)Ce-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(Ce),this.length-=Ce;break}return this},oe.prototype.duplicate=function(){const Ce=this._new();for(let ie=0;ie<this._bufs.length;ie++)Ce.append(this._bufs[ie]);return Ce},oe.prototype.append=function(Ce){if(Ce==null)return this;if(Ce.buffer)this._appendBuffer(V.from(Ce.buffer,Ce.byteOffset,Ce.byteLength));else if(Array.isArray(Ce))for(let ie=0;ie<Ce.length;ie++)this.append(Ce[ie]);else if(this._isBufferList(Ce))for(let ie=0;ie<Ce._bufs.length;ie++)this.append(Ce._bufs[ie]);else typeof Ce=="number"&&(Ce=Ce.toString()),this._appendBuffer(V.from(Ce));return this},oe.prototype._appendBuffer=function(Ce){this._bufs.push(Ce),this.length+=Ce.length},oe.prototype.indexOf=function(re,Ce,ie){if(ie===void 0&&typeof Ce=="string"&&(ie=Ce,Ce=void 0),typeof re=="function"||Array.isArray(re))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof re=="number"?re=V.from([re]):typeof re=="string"?re=V.from(re,ie):this._isBufferList(re)?re=re.slice():Array.isArray(re.buffer)?re=V.from(re.buffer,re.byteOffset,re.byteLength):V.isBuffer(re)||(re=V.from(re)),Ce=Number(Ce||0),isNaN(Ce)&&(Ce=0),Ce<0&&(Ce=this.length+Ce),Ce<0&&(Ce=0),re.length===0)return Ce>this.length?this.length:Ce;const ae=this._offset(Ce);let le=ae[0],Ie=ae[1];for(;le<this._bufs.length;le++){const ue=this._bufs[le];for(;Ie<ue.length;)if(ue.length-Ie>=re.length){const Ne=ue.indexOf(re,Ie);if(Ne!==-1)return this._reverseOffset([le,Ne]);Ie=ue.length-re.length+1}else{const Ne=this._reverseOffset([le,Ie]);if(this._match(Ne,re))return Ne;Ie++}Ie=0}return-1},oe.prototype._match=function(re,Ce){if(this.length-re<Ce.length)return!1;for(let ie=0;ie<Ce.length;ie++)if(this.get(re+ie)!==Ce[ie])return!1;return!0},function(){const re={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const Ce in re)(function(ie){re[ie]===null?oe.prototype[ie]=function(ae,le){return this.slice(ae,ae+le)[ie](0,le)}:oe.prototype[ie]=function(ae=0){return this.slice(ae,ae+re[ie])[ie](0)}})(Ce)}(),oe.prototype._isBufferList=function(Ce){return Ce instanceof oe||oe.isBufferList(Ce)},oe.isBufferList=function(Ce){return Ce!=null&&Ce[$]},g.exports=oe},{buffer:17}],15:[function(r,g,k){const V=r("readable-stream").Duplex,$=r("inherits"),oe=r("./BufferList");function re(Ce){if(!(this instanceof re))return new re(Ce);if(typeof Ce=="function"){this._callback=Ce;const ie=function(le){this._callback&&(this._callback(le),this._callback=null)}.bind(this);this.on("pipe",function(le){le.on("error",ie)}),this.on("unpipe",function(le){le.removeListener("error",ie)}),Ce=null}oe._init.call(this,Ce),V.call(this)}$(re,V),Object.assign(re.prototype,oe.prototype),re.prototype._new=function(ie){return new re(ie)},re.prototype._write=function(ie,ae,le){this._appendBuffer(ie),typeof le=="function"&&le()},re.prototype._read=function(ie){if(!this.length)return this.push(null);ie=Math.min(ie,this.length),this.push(this.slice(0,ie)),this.consume(ie)},re.prototype.end=function(ie){V.prototype.end.call(this,ie),this._callback&&(this._callback(null,this.slice()),this._callback=null)},re.prototype._destroy=function(ie,ae){this._bufs.length=0,this.length=0,ae(ie)},re.prototype._isBufferList=function(ie){return ie instanceof re||ie instanceof oe||re.isBufferList(ie)},re.isBufferList=oe.isBufferList,g.exports=re,g.exports.BufferListStream=re,g.exports.BufferList=oe},{"./BufferList":14,inherits:24,"readable-stream":69}],16:[function(r,g,k){},{}],17:[function(r,g,k){(function(V){(function(){var $=r("base64-js"),oe=r("ieee754");k.Buffer=ae,k.SlowBuffer=xe,k.INSPECT_MAX_BYTES=50;var re=2147483647;k.kMaxLength=re,ae.TYPED_ARRAY_SUPPORT=Ce(),!ae.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ce(){try{var oi=new Uint8Array(1);return oi.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},oi.foo()===42}catch{return!1}}Object.defineProperty(ae.prototype,"parent",{enumerable:!0,get:function(){if(ae.isBuffer(this))return this.buffer}}),Object.defineProperty(ae.prototype,"offset",{enumerable:!0,get:function(){if(ae.isBuffer(this))return this.byteOffset}});function ie(oi){if(oi>re)throw new RangeError('The value "'+oi+'" is invalid for option "size"');var Et=new Uint8Array(oi);return Et.__proto__=ae.prototype,Et}function ae(oi,Et,ii){if(typeof oi=="number"){if(typeof Et=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return de(oi)}return le(oi,Et,ii)}typeof Symbol<"u"&&Symbol.species!=null&&ae[Symbol.species]===ae&&Object.defineProperty(ae,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),ae.poolSize=8192;function le(oi,Et,ii){if(typeof oi=="string")return Ne(oi,Et);if(ArrayBuffer.isView(oi))return he(oi);if(oi==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oi);if(si(oi,ArrayBuffer)||oi&&si(oi.buffer,ArrayBuffer))return pe(oi,Et,ii);if(typeof oi=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var ri=oi.valueOf&&oi.valueOf();if(ri!=null&&ri!==oi)return ae.from(ri,Et,ii);var ui=ze(oi);if(ui)return ui;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof oi[Symbol.toPrimitive]=="function")return ae.from(oi[Symbol.toPrimitive]("string"),Et,ii);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oi)}ae.from=function(oi,Et,ii){return le(oi,Et,ii)},ae.prototype.__proto__=Uint8Array.prototype,ae.__proto__=Uint8Array;function Ie(oi){if(typeof oi!="number")throw new TypeError('"size" argument must be of type number');if(oi<0)throw new RangeError('The value "'+oi+'" is invalid for option "size"')}function ue(oi,Et,ii){return Ie(oi),oi<=0?ie(oi):Et!==void 0?typeof ii=="string"?ie(oi).fill(Et,ii):ie(oi).fill(Et):ie(oi)}ae.alloc=function(oi,Et,ii){return ue(oi,Et,ii)};function de(oi){return Ie(oi),ie(oi<0?0:Fe(oi)|0)}ae.allocUnsafe=function(oi){return de(oi)},ae.allocUnsafeSlow=function(oi){return de(oi)};function Ne(oi,Et){if((typeof Et!="string"||Et==="")&&(Et="utf8"),!ae.isEncoding(Et))throw new TypeError("Unknown encoding: "+Et);var ii=_e(oi,Et)|0,ri=ie(ii),ui=ri.write(oi,Et);return ui!==ii&&(ri=ri.slice(0,ui)),ri}function he(oi){for(var Et=oi.length<0?0:Fe(oi.length)|0,ii=ie(Et),ri=0;ri<Et;ri+=1)ii[ri]=oi[ri]&255;return ii}function pe(oi,Et,ii){if(Et<0||oi.byteLength<Et)throw new RangeError('"offset" is outside of buffer bounds');if(oi.byteLength<Et+(ii||0))throw new RangeError('"length" is outside of buffer bounds');var ri;return Et===void 0&&ii===void 0?ri=new Uint8Array(oi):ii===void 0?ri=new Uint8Array(oi,Et):ri=new Uint8Array(oi,Et,ii),ri.__proto__=ae.prototype,ri}function ze(oi){if(ae.isBuffer(oi)){var Et=Fe(oi.length)|0,ii=ie(Et);return ii.length===0||oi.copy(ii,0,0,Et),ii}if(oi.length!==void 0)return typeof oi.length!="number"||Ii(oi.length)?ie(0):he(oi);if(oi.type==="Buffer"&&Array.isArray(oi.data))return he(oi.data)}function Fe(oi){if(oi>=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return oi|0}function xe(oi){return+oi!=oi&&(oi=0),ae.alloc(+oi)}ae.isBuffer=function(Et){return Et!=null&&Et._isBuffer===!0&&Et!==ae.prototype},ae.compare=function(Et,ii){if(si(Et,Uint8Array)&&(Et=ae.from(Et,Et.offset,Et.byteLength)),si(ii,Uint8Array)&&(ii=ae.from(ii,ii.offset,ii.byteLength)),!ae.isBuffer(Et)||!ae.isBuffer(ii))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Et===ii)return 0;for(var ri=Et.length,ui=ii.length,vi=0,bi=Math.min(ri,ui);vi<bi;++vi)if(Et[vi]!==ii[vi]){ri=Et[vi],ui=ii[vi];break}return ri<ui?-1:ui<ri?1:0},ae.isEncoding=function(Et){switch(String(Et).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ae.concat=function(Et,ii){if(!Array.isArray(Et))throw new TypeError('"list" argument must be an Array of Buffers');if(Et.length===0)return ae.alloc(0);var ri;if(ii===void 0)for(ii=0,ri=0;ri<Et.length;++ri)ii+=Et[ri].length;var ui=ae.allocUnsafe(ii),vi=0;for(ri=0;ri<Et.length;++ri){var bi=Et[ri];if(si(bi,Uint8Array)&&(bi=ae.from(bi)),!ae.isBuffer(bi))throw new TypeError('"list" argument must be an Array of Buffers');bi.copy(ui,vi),vi+=bi.length}return ui};function _e(oi,Et){if(ae.isBuffer(oi))return oi.length;if(ArrayBuffer.isView(oi)||si(oi,ArrayBuffer))return oi.byteLength;if(typeof oi!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof oi);var ii=oi.length,ri=arguments.length>2&&arguments[2]===!0;if(!ri&&ii===0)return 0;for(var ui=!1;;)switch(Et){case"ascii":case"latin1":case"binary":return ii;case"utf8":case"utf-8":return Ni(oi).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ii*2;case"hex":return ii>>>1;case"base64":return zi(oi).length;default:if(ui)return ri?-1:Ni(oi).length;Et=(""+Et).toLowerCase(),ui=!0}}ae.byteLength=_e;function Dt(oi,Et,ii){var ri=!1;if((Et===void 0||Et<0)&&(Et=0),Et>this.length||((ii===void 0||ii>this.length)&&(ii=this.length),ii<=0)||(ii>>>=0,Et>>>=0,ii<=Et))return"";for(oi||(oi="utf8");;)switch(oi){case"hex":return li(this,Et,ii);case"utf8":case"utf-8":return ei(this,Et,ii);case"ascii":return gi(this,Et,ii);case"latin1":case"binary":return di(this,Et,ii);case"base64":return ti(this,Et,ii);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ai(this,Et,ii);default:if(ri)throw new TypeError("Unknown encoding: "+oi);oi=(oi+"").toLowerCase(),ri=!0}}ae.prototype._isBuffer=!0;function $e(oi,Et,ii){var ri=oi[Et];oi[Et]=oi[ii],oi[ii]=ri}ae.prototype.swap16=function(){var Et=this.length;if(Et%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ii=0;ii<Et;ii+=2)$e(this,ii,ii+1);return this},ae.prototype.swap32=function(){var Et=this.length;if(Et%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var ii=0;ii<Et;ii+=4)$e(this,ii,ii+3),$e(this,ii+1,ii+2);return this},ae.prototype.swap64=function(){var Et=this.length;if(Et%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var ii=0;ii<Et;ii+=8)$e(this,ii,ii+7),$e(this,ii+1,ii+6),$e(this,ii+2,ii+5),$e(this,ii+3,ii+4);return this},ae.prototype.toString=function(){var Et=this.length;return Et===0?"":arguments.length===0?ei(this,0,Et):Dt.apply(this,arguments)},ae.prototype.toLocaleString=ae.prototype.toString,ae.prototype.equals=function(Et){if(!ae.isBuffer(Et))throw new TypeError("Argument must be a Buffer");return this===Et?!0:ae.compare(this,Et)===0},ae.prototype.inspect=function(){var Et="",ii=k.INSPECT_MAX_BYTES;return Et=this.toString("hex",0,ii).replace(/(.{2})/g,"$1 ").trim(),this.length>ii&&(Et+=" ... "),"<Buffer "+Et+">"},ae.prototype.compare=function(Et,ii,ri,ui,vi){if(si(Et,Uint8Array)&&(Et=ae.from(Et,Et.offset,Et.byteLength)),!ae.isBuffer(Et))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Et);if(ii===void 0&&(ii=0),ri===void 0&&(ri=Et?Et.length:0),ui===void 0&&(ui=0),vi===void 0&&(vi=this.length),ii<0||ri>Et.length||ui<0||vi>this.length)throw new RangeError("out of range index");if(ui>=vi&&ii>=ri)return 0;if(ui>=vi)return-1;if(ii>=ri)return 1;if(ii>>>=0,ri>>>=0,ui>>>=0,vi>>>=0,this===Et)return 0;for(var bi=vi-ui,Zi=ri-ii,Gi=Math.min(bi,Zi),Yi=this.slice(ui,vi),Oi=Et.slice(ii,ri),xi=0;xi<Gi;++xi)if(Yi[xi]!==Oi[xi]){bi=Yi[xi],Zi=Oi[xi];break}return bi<Zi?-1:Zi<bi?1:0};function Ue(oi,Et,ii,ri,ui){if(oi.length===0)return-1;if(typeof ii=="string"?(ri=ii,ii=0):ii>2147483647?ii=2147483647:ii<-2147483648&&(ii=-2147483648),ii=+ii,Ii(ii)&&(ii=ui?0:oi.length-1),ii<0&&(ii=oi.length+ii),ii>=oi.length){if(ui)return-1;ii=oi.length-1}else if(ii<0)if(ui)ii=0;else return-1;if(typeof Et=="string"&&(Et=ae.from(Et,ri)),ae.isBuffer(Et))return Et.length===0?-1:Ve(oi,Et,ii,ri,ui);if(typeof Et=="number")return Et=Et&255,typeof Uint8Array.prototype.indexOf=="function"?ui?Uint8Array.prototype.indexOf.call(oi,Et,ii):Uint8Array.prototype.lastIndexOf.call(oi,Et,ii):Ve(oi,[Et],ii,ri,ui);throw new TypeError("val must be string, number or Buffer")}function Ve(oi,Et,ii,ri,ui){var vi=1,bi=oi.length,Zi=Et.length;if(ri!==void 0&&(ri=String(ri).toLowerCase(),ri==="ucs2"||ri==="ucs-2"||ri==="utf16le"||ri==="utf-16le")){if(oi.length<2||Et.length<2)return-1;vi=2,bi/=2,Zi/=2,ii/=2}function Gi(Wi,ki){return vi===1?Wi[ki]:Wi.readUInt16BE(ki*vi)}var Yi;if(ui){var Oi=-1;for(Yi=ii;Yi<bi;Yi++)if(Gi(oi,Yi)===Gi(Et,Oi===-1?0:Yi-Oi)){if(Oi===-1&&(Oi=Yi),Yi-Oi+1===Zi)return Oi*vi}else Oi!==-1&&(Yi-=Yi-Oi),Oi=-1}else for(ii+Zi>bi&&(ii=bi-Zi),Yi=ii;Yi>=0;Yi--){for(var xi=!0,Li=0;Li<Zi;Li++)if(Gi(oi,Yi+Li)!==Gi(Et,Li)){xi=!1;break}if(xi)return Yi}return-1}ae.prototype.includes=function(Et,ii,ri){return this.indexOf(Et,ii,ri)!==-1},ae.prototype.indexOf=function(Et,ii,ri){return Ue(this,Et,ii,ri,!0)},ae.prototype.lastIndexOf=function(Et,ii,ri){return Ue(this,Et,ii,ri,!1)};function Oe(oi,Et,ii,ri){ii=Number(ii)||0;var ui=oi.length-ii;ri?(ri=Number(ri),ri>ui&&(ri=ui)):ri=ui;var vi=Et.length;ri>vi/2&&(ri=vi/2);for(var bi=0;bi<ri;++bi){var Zi=parseInt(Et.substr(bi*2,2),16);if(Ii(Zi))return bi;oi[ii+bi]=Zi}return bi}function At(oi,Et,ii,ri){return Si(Ni(Et,oi.length-ii),oi,ii,ri)}function qe(oi,Et,ii,ri){return Si(Mi(Et),oi,ii,ri)}function Lt(oi,Et,ii,ri){return qe(oi,Et,ii,ri)}function kt(oi,Et,ii,ri){return Si(zi(Et),oi,ii,ri)}function jt(oi,Et,ii,ri){return Si(fi(Et,oi.length-ii),oi,ii,ri)}ae.prototype.write=function(Et,ii,ri,ui){if(ii===void 0)ui="utf8",ri=this.length,ii=0;else if(ri===void 0&&typeof ii=="string")ui=ii,ri=this.length,ii=0;else if(isFinite(ii))ii=ii>>>0,isFinite(ri)?(ri=ri>>>0,ui===void 0&&(ui="utf8")):(ui=ri,ri=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var vi=this.length-ii;if((ri===void 0||ri>vi)&&(ri=vi),Et.length>0&&(ri<0||ii<0)||ii>this.length)throw new RangeError("Attempt to write outside buffer bounds");ui||(ui="utf8");for(var bi=!1;;)switch(ui){case"hex":return Oe(this,Et,ii,ri);case"utf8":case"utf-8":return At(this,Et,ii,ri);case"ascii":return qe(this,Et,ii,ri);case"latin1":case"binary":return Lt(this,Et,ii,ri);case"base64":return kt(this,Et,ii,ri);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jt(this,Et,ii,ri);default:if(bi)throw new TypeError("Unknown encoding: "+ui);ui=(""+ui).toLowerCase(),bi=!0}},ae.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ti(oi,Et,ii){return Et===0&&ii===oi.length?$.fromByteArray(oi):$.fromByteArray(oi.slice(Et,ii))}function ei(oi,Et,ii){ii=Math.min(oi.length,ii);for(var ri=[],ui=Et;ui<ii;){var vi=oi[ui],bi=null,Zi=vi>239?4:vi>223?3:vi>191?2:1;if(ui+Zi<=ii){var Gi,Yi,Oi,xi;switch(Zi){case 1:vi<128&&(bi=vi);break;case 2:Gi=oi[ui+1],(Gi&192)===128&&(xi=(vi&31)<<6|Gi&63,xi>127&&(bi=xi));break;case 3:Gi=oi[ui+1],Yi=oi[ui+2],(Gi&192)===128&&(Yi&192)===128&&(xi=(vi&15)<<12|(Gi&63)<<6|Yi&63,xi>2047&&(xi<55296||xi>57343)&&(bi=xi));break;case 4:Gi=oi[ui+1],Yi=oi[ui+2],Oi=oi[ui+3],(Gi&192)===128&&(Yi&192)===128&&(Oi&192)===128&&(xi=(vi&15)<<18|(Gi&63)<<12|(Yi&63)<<6|Oi&63,xi>65535&&xi<1114112&&(bi=xi))}}bi===null?(bi=65533,Zi=1):bi>65535&&(bi-=65536,ri.push(bi>>>10&1023|55296),bi=56320|bi&1023),ri.push(bi),ui+=Zi}return ni(ri)}var Pt=4096;function ni(oi){var Et=oi.length;if(Et<=Pt)return String.fromCharCode.apply(String,oi);for(var ii="",ri=0;ri<Et;)ii+=String.fromCharCode.apply(String,oi.slice(ri,ri+=Pt));return ii}function gi(oi,Et,ii){var ri="";ii=Math.min(oi.length,ii);for(var ui=Et;ui<ii;++ui)ri+=String.fromCharCode(oi[ui]&127);return ri}function di(oi,Et,ii){var ri="";ii=Math.min(oi.length,ii);for(var ui=Et;ui<ii;++ui)ri+=String.fromCharCode(oi[ui]);return ri}function li(oi,Et,ii){var ri=oi.length;(!Et||Et<0)&&(Et=0),(!ii||ii<0||ii>ri)&&(ii=ri);for(var ui="",vi=Et;vi<ii;++vi)ui+=mi(oi[vi]);return ui}function ai(oi,Et,ii){for(var ri=oi.slice(Et,ii),ui="",vi=0;vi<ri.length;vi+=2)ui+=String.fromCharCode(ri[vi]+ri[vi+1]*256);return ui}ae.prototype.slice=function(Et,ii){var ri=this.length;Et=~~Et,ii=ii===void 0?ri:~~ii,Et<0?(Et+=ri,Et<0&&(Et=0)):Et>ri&&(Et=ri),ii<0?(ii+=ri,ii<0&&(ii=0)):ii>ri&&(ii=ri),ii<Et&&(ii=Et);var ui=this.subarray(Et,ii);return ui.__proto__=ae.prototype,ui};function ci(oi,Et,ii){if(oi%1!==0||oi<0)throw new RangeError("offset is not uint");if(oi+Et>ii)throw new RangeError("Trying to access beyond buffer length")}ae.prototype.readUIntLE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et],vi=1,bi=0;++bi<ii&&(vi*=256);)ui+=this[Et+bi]*vi;return ui},ae.prototype.readUIntBE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et+--ii],vi=1;ii>0&&(vi*=256);)ui+=this[Et+--ii]*vi;return ui},ae.prototype.readUInt8=function(Et,ii){return Et=Et>>>0,ii||ci(Et,1,this.length),this[Et]},ae.prototype.readUInt16LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,2,this.length),this[Et]|this[Et+1]<<8},ae.prototype.readUInt16BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,2,this.length),this[Et]<<8|this[Et+1]},ae.prototype.readUInt32LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),(this[Et]|this[Et+1]<<8|this[Et+2]<<16)+this[Et+3]*16777216},ae.prototype.readUInt32BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]*16777216+(this[Et+1]<<16|this[Et+2]<<8|this[Et+3])},ae.prototype.readIntLE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et],vi=1,bi=0;++bi<ii&&(vi*=256);)ui+=this[Et+bi]*vi;return vi*=128,ui>=vi&&(ui-=Math.pow(2,8*ii)),ui},ae.prototype.readIntBE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=ii,vi=1,bi=this[Et+--ui];ui>0&&(vi*=256);)bi+=this[Et+--ui]*vi;return vi*=128,bi>=vi&&(bi-=Math.pow(2,8*ii)),bi},ae.prototype.readInt8=function(Et,ii){return Et=Et>>>0,ii||ci(Et,1,this.length),this[Et]&128?(255-this[Et]+1)*-1:this[Et]},ae.prototype.readInt16LE=function(Et,ii){Et=Et>>>0,ii||ci(Et,2,this.length);var ri=this[Et]|this[Et+1]<<8;return ri&32768?ri|4294901760:ri},ae.prototype.readInt16BE=function(Et,ii){Et=Et>>>0,ii||ci(Et,2,this.length);var ri=this[Et+1]|this[Et]<<8;return ri&32768?ri|4294901760:ri},ae.prototype.readInt32LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]|this[Et+1]<<8|this[Et+2]<<16|this[Et+3]<<24},ae.prototype.readInt32BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]<<24|this[Et+1]<<16|this[Et+2]<<8|this[Et+3]},ae.prototype.readFloatLE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),oe.read(this,Et,!0,23,4)},ae.prototype.readFloatBE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),oe.read(this,Et,!1,23,4)},ae.prototype.readDoubleLE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,8,this.length),oe.read(this,Et,!0,52,8)},ae.prototype.readDoubleBE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,8,this.length),oe.read(this,Et,!1,52,8)};function pi(oi,Et,ii,ri,ui,vi){if(!ae.isBuffer(oi))throw new TypeError('"buffer" argument must be a Buffer instance');if(Et>ui||Et<vi)throw new RangeError('"value" argument is out of bounds');if(ii+ri>oi.length)throw new RangeError("Index out of range")}ae.prototype.writeUIntLE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,ri=ri>>>0,!ui){var vi=Math.pow(2,8*ri)-1;pi(this,Et,ii,ri,vi,0)}var bi=1,Zi=0;for(this[ii]=Et&255;++Zi<ri&&(bi*=256);)this[ii+Zi]=Et/bi&255;return ii+ri},ae.prototype.writeUIntBE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,ri=ri>>>0,!ui){var vi=Math.pow(2,8*ri)-1;pi(this,Et,ii,ri,vi,0)}var bi=ri-1,Zi=1;for(this[ii+bi]=Et&255;--bi>=0&&(Zi*=256);)this[ii+bi]=Et/Zi&255;return ii+ri},ae.prototype.writeUInt8=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,1,255,0),this[ii]=Et&255,ii+1},ae.prototype.writeUInt16LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,65535,0),this[ii]=Et&255,this[ii+1]=Et>>>8,ii+2},ae.prototype.writeUInt16BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,65535,0),this[ii]=Et>>>8,this[ii+1]=Et&255,ii+2},ae.prototype.writeUInt32LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,4294967295,0),this[ii+3]=Et>>>24,this[ii+2]=Et>>>16,this[ii+1]=Et>>>8,this[ii]=Et&255,ii+4},ae.prototype.writeUInt32BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,4294967295,0),this[ii]=Et>>>24,this[ii+1]=Et>>>16,this[ii+2]=Et>>>8,this[ii+3]=Et&255,ii+4},ae.prototype.writeIntLE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,!ui){var vi=Math.pow(2,8*ri-1);pi(this,Et,ii,ri,vi-1,-vi)}var bi=0,Zi=1,Gi=0;for(this[ii]=Et&255;++bi<ri&&(Zi*=256);)Et<0&&Gi===0&&this[ii+bi-1]!==0&&(Gi=1),this[ii+bi]=(Et/Zi>>0)-Gi&255;return ii+ri},ae.prototype.writeIntBE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,!ui){var vi=Math.pow(2,8*ri-1);pi(this,Et,ii,ri,vi-1,-vi)}var bi=ri-1,Zi=1,Gi=0;for(this[ii+bi]=Et&255;--bi>=0&&(Zi*=256);)Et<0&&Gi===0&&this[ii+bi+1]!==0&&(Gi=1),this[ii+bi]=(Et/Zi>>0)-Gi&255;return ii+ri},ae.prototype.writeInt8=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,1,127,-128),Et<0&&(Et=255+Et+1),this[ii]=Et&255,ii+1},ae.prototype.writeInt16LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,32767,-32768),this[ii]=Et&255,this[ii+1]=Et>>>8,ii+2},ae.prototype.writeInt16BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,32767,-32768),this[ii]=Et>>>8,this[ii+1]=Et&255,ii+2},ae.prototype.writeInt32LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,2147483647,-2147483648),this[ii]=Et&255,this[ii+1]=Et>>>8,this[ii+2]=Et>>>16,this[ii+3]=Et>>>24,ii+4},ae.prototype.writeInt32BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,2147483647,-2147483648),Et<0&&(Et=4294967295+Et+1),this[ii]=Et>>>24,this[ii+1]=Et>>>16,this[ii+2]=Et>>>8,this[ii+3]=Et&255,ii+4};function yi(oi,Et,ii,ri,ui,vi){if(ii+ri>oi.length)throw new RangeError("Index out of range");if(ii<0)throw new RangeError("Index out of range")}function Ai(oi,Et,ii,ri,ui){return Et=+Et,ii=ii>>>0,ui||yi(oi,Et,ii,4),oe.write(oi,Et,ii,ri,23,4),ii+4}ae.prototype.writeFloatLE=function(Et,ii,ri){return Ai(this,Et,ii,!0,ri)},ae.prototype.writeFloatBE=function(Et,ii,ri){return Ai(this,Et,ii,!1,ri)};function hi(oi,Et,ii,ri,ui){return Et=+Et,ii=ii>>>0,ui||yi(oi,Et,ii,8),oe.write(oi,Et,ii,ri,52,8),ii+8}ae.prototype.writeDoubleLE=function(Et,ii,ri){return hi(this,Et,ii,!0,ri)},ae.prototype.writeDoubleBE=function(Et,ii,ri){return hi(this,Et,ii,!1,ri)},ae.prototype.copy=function(Et,ii,ri,ui){if(!ae.isBuffer(Et))throw new TypeError("argument should be a Buffer");if(ri||(ri=0),!ui&&ui!==0&&(ui=this.length),ii>=Et.length&&(ii=Et.length),ii||(ii=0),ui>0&&ui<ri&&(ui=ri),ui===ri||Et.length===0||this.length===0)return 0;if(ii<0)throw new RangeError("targetStart out of bounds");if(ri<0||ri>=this.length)throw new RangeError("Index out of range");if(ui<0)throw new RangeError("sourceEnd out of bounds");ui>this.length&&(ui=this.length),Et.length-ii<ui-ri&&(ui=Et.length-ii+ri);var vi=ui-ri;if(this===Et&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(ii,ri,ui);else if(this===Et&&ri<ii&&ii<ui)for(var bi=vi-1;bi>=0;--bi)Et[bi+ii]=this[bi+ri];else Uint8Array.prototype.set.call(Et,this.subarray(ri,ui),ii);return vi},ae.prototype.fill=function(Et,ii,ri,ui){if(typeof Et=="string"){if(typeof ii=="string"?(ui=ii,ii=0,ri=this.length):typeof ri=="string"&&(ui=ri,ri=this.length),ui!==void 0&&typeof ui!="string")throw new TypeError("encoding must be a string");if(typeof ui=="string"&&!ae.isEncoding(ui))throw new TypeError("Unknown encoding: "+ui);if(Et.length===1){var vi=Et.charCodeAt(0);(ui==="utf8"&&vi<128||ui==="latin1")&&(Et=vi)}}else typeof Et=="number"&&(Et=Et&255);if(ii<0||this.length<ii||this.length<ri)throw new RangeError("Out of range index");if(ri<=ii)return this;ii=ii>>>0,ri=ri===void 0?this.length:ri>>>0,Et||(Et=0);var bi;if(typeof Et=="number")for(bi=ii;bi<ri;++bi)this[bi]=Et;else{var Zi=ae.isBuffer(Et)?Et:ae.from(Et,ui),Gi=Zi.length;if(Gi===0)throw new TypeError('The value "'+Et+'" is invalid for argument "value"');for(bi=0;bi<ri-ii;++bi)this[bi+ii]=Zi[bi%Gi]}return this};var wi=/[^+/0-9A-Za-z-_]/g;function Ci(oi){if(oi=oi.split("=")[0],oi=oi.trim().replace(wi,""),oi.length<2)return"";for(;oi.length%4!==0;)oi=oi+"=";return oi}function mi(oi){return oi<16?"0"+oi.toString(16):oi.toString(16)}function Ni(oi,Et){Et=Et||1/0;for(var ii,ri=oi.length,ui=null,vi=[],bi=0;bi<ri;++bi){if(ii=oi.charCodeAt(bi),ii>55295&&ii<57344){if(!ui){if(ii>56319){(Et-=3)>-1&&vi.push(239,191,189);continue}else if(bi+1===ri){(Et-=3)>-1&&vi.push(239,191,189);continue}ui=ii;continue}if(ii<56320){(Et-=3)>-1&&vi.push(239,191,189),ui=ii;continue}ii=(ui-55296<<10|ii-56320)+65536}else ui&&(Et-=3)>-1&&vi.push(239,191,189);if(ui=null,ii<128){if((Et-=1)<0)break;vi.push(ii)}else if(ii<2048){if((Et-=2)<0)break;vi.push(ii>>6|192,ii&63|128)}else if(ii<65536){if((Et-=3)<0)break;vi.push(ii>>12|224,ii>>6&63|128,ii&63|128)}else if(ii<1114112){if((Et-=4)<0)break;vi.push(ii>>18|240,ii>>12&63|128,ii>>6&63|128,ii&63|128)}else throw new Error("Invalid code point")}return vi}function Mi(oi){for(var Et=[],ii=0;ii<oi.length;++ii)Et.push(oi.charCodeAt(ii)&255);return Et}function fi(oi,Et){for(var ii,ri,ui,vi=[],bi=0;bi<oi.length&&!((Et-=2)<0);++bi)ii=oi.charCodeAt(bi),ri=ii>>8,ui=ii%256,vi.push(ui),vi.push(ri);return vi}function zi(oi){return $.toByteArray(Ci(oi))}function Si(oi,Et,ii,ri){for(var ui=0;ui<ri&&!(ui+ii>=Et.length||ui>=oi.length);++ui)Et[ui+ii]=oi[ui];return ui}function si(oi,Et){return oi instanceof Et||oi!=null&&oi.constructor!=null&&oi.constructor.name!=null&&oi.constructor.name===Et.name}function Ii(oi){return oi!==oi}}).call(this)}).call(this,r("buffer").Buffer)},{"base64-js":13,buffer:17,ieee754:23}],18:[function(r,g,k){(function(V){(function(){k.formatArgs=oe,k.save=re,k.load=Ce,k.useColors=$,k.storage=ie(),k.destroy=(()=>{let le=!1;return()=>{le||(le=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),k.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function $(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function oe(le){if(le[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+le[0]+(this.useColors?"%c ":" ")+"+"+g.exports.humanize(this.diff),!this.useColors)return;const Ie="color: "+this.color;le.splice(1,0,Ie,"color: inherit");let ue=0,de=0;le[0].replace(/%[a-zA-Z%]/g,Ne=>{Ne!=="%%"&&(ue++,Ne==="%c"&&(de=ue))}),le.splice(de,0,Ie)}k.log=console.debug||console.log||(()=>{});function re(le){try{le?k.storage.setItem("debug",le):k.storage.removeItem("debug")}catch{}}function Ce(){let le;try{le=k.storage.getItem("debug")}catch{}return!le&&typeof V<"u"&&"env"in V&&(le=V.env.DEBUG),le}function ie(){try{return localStorage}catch{}}g.exports=r("./common")(k);const{formatters:ae}=g.exports;ae.j=function(le){try{return JSON.stringify(le)}catch(Ie){return"[UnexpectedJSONParseError]: "+Ie.message}}}).call(this)}).call(this,r("_process"))},{"./common":19,_process:50}],19:[function(r,g,k){function V($){re.debug=re,re.default=re,re.coerce=ue,re.disable=ae,re.enable=ie,re.enabled=le,re.humanize=r("ms"),re.destroy=de,Object.keys($).forEach(Ne=>{re[Ne]=$[Ne]}),re.names=[],re.skips=[],re.formatters={};function oe(Ne){let he=0;for(let pe=0;pe<Ne.length;pe++)he=(he<<5)-he+Ne.charCodeAt(pe),he|=0;return re.colors[Math.abs(he)%re.colors.length]}re.selectColor=oe;function re(Ne){let he,pe=null,ze,Fe;function xe(..._e){if(!xe.enabled)return;const Dt=xe,$e=Number(new Date),Ue=$e-(he||$e);Dt.diff=Ue,Dt.prev=he,Dt.curr=$e,he=$e,_e[0]=re.coerce(_e[0]),typeof _e[0]!="string"&&_e.unshift("%O");let Ve=0;_e[0]=_e[0].replace(/%([a-zA-Z%])/g,(At,qe)=>{if(At==="%%")return"%";Ve++;const Lt=re.formatters[qe];if(typeof Lt=="function"){const kt=_e[Ve];At=Lt.call(Dt,kt),_e.splice(Ve,1),Ve--}return At}),re.formatArgs.call(Dt,_e),(Dt.log||re.log).apply(Dt,_e)}return xe.namespace=Ne,xe.useColors=re.useColors(),xe.color=re.selectColor(Ne),xe.extend=Ce,xe.destroy=re.destroy,Object.defineProperty(xe,"enabled",{enumerable:!0,configurable:!1,get:()=>pe!==null?pe:(ze!==re.namespaces&&(ze=re.namespaces,Fe=re.enabled(Ne)),Fe),set:_e=>{pe=_e}}),typeof re.init=="function"&&re.init(xe),xe}function Ce(Ne,he){const pe=re(this.namespace+(typeof he>"u"?":":he)+Ne);return pe.log=this.log,pe}function ie(Ne){re.save(Ne),re.namespaces=Ne,re.names=[],re.skips=[];let he;const pe=(typeof Ne=="string"?Ne:"").split(/[\s,]+/),ze=pe.length;for(he=0;he<ze;he++)pe[he]&&(Ne=pe[he].replace(/\*/g,".*?"),Ne[0]==="-"?re.skips.push(new RegExp("^"+Ne.substr(1)+"$")):re.names.push(new RegExp("^"+Ne+"$")))}function ae(){const Ne=[...re.names.map(Ie),...re.skips.map(Ie).map(he=>"-"+he)].join(",");return re.enable(""),Ne}function le(Ne){if(Ne[Ne.length-1]==="*")return!0;let he,pe;for(he=0,pe=re.skips.length;he<pe;he++)if(re.skips[he].test(Ne))return!1;for(he=0,pe=re.names.length;he<pe;he++)if(re.names[he].test(Ne))return!0;return!1}function Ie(Ne){return Ne.toString().substring(2,Ne.toString().length-2).replace(/\.\*\?$/,"*")}function ue(Ne){return Ne instanceof Error?Ne.stack||Ne.message:Ne}function de(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return re.enable(re.load()),re}g.exports=V},{ms:45}],20:[function(r,g,k){(function(V,$){(function(){var oe=r("readable-stream"),re=r("end-of-stream"),Ce=r("inherits"),ie=r("stream-shift"),ae=$.from&&$.from!==Uint8Array.from?$.from([0]):new $([0]),le=function(ze,Fe){ze._corked?ze.once("uncork",Fe):Fe()},Ie=function(ze,Fe){ze._autoDestroy&&ze.destroy(Fe)},ue=function(ze,Fe){return function(xe){xe?Ie(ze,xe.message==="premature close"?null:xe):Fe&&!ze._ended&&ze.end()}},de=function(ze,Fe){if(!ze||ze._writableState&&ze._writableState.finished)return Fe();if(ze._writableState)return ze.end(Fe);ze.end(),Fe()},Ne=function(){},he=function(ze){return new oe.Readable({objectMode:!0,highWaterMark:16}).wrap(ze)},pe=function(ze,Fe,xe){if(!(this instanceof pe))return new pe(ze,Fe,xe);oe.Duplex.call(this,xe),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!xe||xe.autoDestroy!==!1,this._forwardDestroy=!xe||xe.destroy!==!1,this._forwardEnd=!xe||xe.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,ze&&this.setWritable(ze),Fe&&this.setReadable(Fe)};Ce(pe,oe.Duplex),pe.obj=function(ze,Fe,xe){return xe||(xe={}),xe.objectMode=!0,xe.highWaterMark=16,new pe(ze,Fe,xe)},pe.prototype.cork=function(){++this._corked===1&&this.emit("cork")},pe.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},pe.prototype.setWritable=function(ze){if(this._unwrite&&this._unwrite(),this.destroyed){ze&&ze.destroy&&ze.destroy();return}if(ze===null||ze===!1){this.end();return}var Fe=this,xe=re(ze,{writable:!0,readable:!1},ue(this,this._forwardEnd)),_e=function(){var $e=Fe._ondrain;Fe._ondrain=null,$e&&$e()},Dt=function(){Fe._writable.removeListener("drain",_e),xe()};this._unwrite&&V.nextTick(_e),this._writable=ze,this._writable.on("drain",_e),this._unwrite=Dt,this.uncork()},pe.prototype.setReadable=function(ze){if(this._unread&&this._unread(),this.destroyed){ze&&ze.destroy&&ze.destroy();return}if(ze===null||ze===!1){this.push(null),this.resume();return}var Fe=this,xe=re(ze,{writable:!1,readable:!0},ue(this)),_e=function(){Fe._forward()},Dt=function(){Fe.push(null)},$e=function(){Fe._readable2.removeListener("readable",_e),Fe._readable2.removeListener("end",Dt),xe()};this._drained=!0,this._readable=ze,this._readable2=ze._readableState?ze:he(ze),this._readable2.on("readable",_e),this._readable2.on("end",Dt),this._unread=$e,this._forward()},pe.prototype._read=function(){this._drained=!0,this._forward()},pe.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var ze;this._drained&&(ze=ie(this._readable2))!==null;)this.destroyed||(this._drained=this.push(ze));this._forwarding=!1}},pe.prototype.destroy=function(ze,Fe){if(Fe||(Fe=Ne),this.destroyed)return Fe(null);this.destroyed=!0;var xe=this;V.nextTick(function(){xe._destroy(ze),Fe(null)})},pe.prototype._destroy=function(ze){if(ze){var Fe=this._ondrain;this._ondrain=null,Fe?Fe(ze):this.emit("error",ze)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},pe.prototype._write=function(ze,Fe,xe){if(!this.destroyed){if(this._corked)return le(this,this._write.bind(this,ze,Fe,xe));if(ze===ae)return this._finish(xe);if(!this._writable)return xe();this._writable.write(ze)===!1?this._ondrain=xe:this.destroyed||xe()}},pe.prototype._finish=function(ze){var Fe=this;this.emit("preend"),le(this,function(){de(Fe._forwardEnd&&Fe._writable,function(){Fe._writableState.prefinished===!1&&(Fe._writableState.prefinished=!0),Fe.emit("prefinish"),le(Fe,ze)})})},pe.prototype.end=function(ze,Fe,xe){return typeof ze=="function"?this.end(null,null,ze):typeof Fe=="function"?this.end(ze,null,Fe):(this._ended=!0,ze&&this.write(ze),!this._writableState.ending&&!this._writableState.destroyed&&this.write(ae),oe.Writable.prototype.end.call(this,xe))},g.exports=pe}).call(this)}).call(this,r("_process"),r("buffer").Buffer)},{_process:50,buffer:17,"end-of-stream":21,inherits:24,"readable-stream":69,"stream-shift":74}],21:[function(r,g,k){(function(V){(function(){var $=r("once"),oe=function(){},re=function(ae){return ae.setHeader&&typeof ae.abort=="function"},Ce=function(ae){return ae.stdio&&Array.isArray(ae.stdio)&&ae.stdio.length===3},ie=function(ae,le,Ie){if(typeof le=="function")return ie(ae,null,le);le||(le={}),Ie=$(Ie||oe);var ue=ae._writableState,de=ae._readableState,Ne=le.readable||le.readable!==!1&&ae.readable,he=le.writable||le.writable!==!1&&ae.writable,pe=!1,ze=function(){ae.writable||Fe()},Fe=function(){he=!1,Ne||Ie.call(ae)},xe=function(){Ne=!1,he||Ie.call(ae)},_e=function(Oe){Ie.call(ae,Oe?new Error("exited with error code: "+Oe):null)},Dt=function(Oe){Ie.call(ae,Oe)},$e=function(){V.nextTick(Ue)},Ue=function(){if(!pe){if(Ne&&!(de&&de.ended&&!de.destroyed))return Ie.call(ae,new Error("premature close"));if(he&&!(ue&&ue.ended&&!ue.destroyed))return Ie.call(ae,new Error("premature close"))}},Ve=function(){ae.req.on("finish",Fe)};return re(ae)?(ae.on("complete",Fe),ae.on("abort",$e),ae.req?Ve():ae.on("request",Ve)):he&&!ue&&(ae.on("end",ze),ae.on("close",ze)),Ce(ae)&&ae.on("exit",_e),ae.on("end",xe),ae.on("finish",Fe),le.error!==!1&&ae.on("error",Dt),ae.on("close",$e),function(){pe=!0,ae.removeListener("complete",Fe),ae.removeListener("abort",$e),ae.removeListener("request",Ve),ae.req&&ae.req.removeListener("finish",Fe),ae.removeListener("end",ze),ae.removeListener("close",ze),ae.removeListener("finish",Fe),ae.removeListener("exit",_e),ae.removeListener("end",xe),ae.removeListener("error",Dt),ae.removeListener("close",$e)}};g.exports=ie}).call(this)}).call(this,r("_process"))},{_process:50,once:48}],22:[function(r,g,k){var V=Object.create||Ve,$=Object.keys||Oe,oe=Function.prototype.bind||At;function re(){(!this._events||!Object.prototype.hasOwnProperty.call(this,"_events"))&&(this._events=V(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}g.exports=re,re.EventEmitter=re,re.prototype._events=void 0,re.prototype._maxListeners=void 0;var Ce=10,ie;try{var ae={};Object.defineProperty&&Object.defineProperty(ae,"x",{value:0}),ie=ae.x===0}catch{ie=!1}ie?Object.defineProperty(re,"defaultMaxListeners",{enumerable:!0,get:function(){return Ce},set:function(qe){if(typeof qe!="number"||qe<0||qe!==qe)throw new TypeError('"defaultMaxListeners" must be a positive number');Ce=qe}}):re.defaultMaxListeners=Ce,re.prototype.setMaxListeners=function(Lt){if(typeof Lt!="number"||Lt<0||isNaN(Lt))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=Lt,this};function le(qe){return qe._maxListeners===void 0?re.defaultMaxListeners:qe._maxListeners}re.prototype.getMaxListeners=function(){return le(this)};function Ie(qe,Lt,kt){if(Lt)qe.call(kt);else for(var jt=qe.length,ti=$e(qe,jt),ei=0;ei<jt;++ei)ti[ei].call(kt)}function ue(qe,Lt,kt,jt){if(Lt)qe.call(kt,jt);else for(var ti=qe.length,ei=$e(qe,ti),Pt=0;Pt<ti;++Pt)ei[Pt].call(kt,jt)}function de(qe,Lt,kt,jt,ti){if(Lt)qe.call(kt,jt,ti);else for(var ei=qe.length,Pt=$e(qe,ei),ni=0;ni<ei;++ni)Pt[ni].call(kt,jt,ti)}function Ne(qe,Lt,kt,jt,ti,ei){if(Lt)qe.call(kt,jt,ti,ei);else for(var Pt=qe.length,ni=$e(qe,Pt),gi=0;gi<Pt;++gi)ni[gi].call(kt,jt,ti,ei)}function he(qe,Lt,kt,jt){if(Lt)qe.apply(kt,jt);else for(var ti=qe.length,ei=$e(qe,ti),Pt=0;Pt<ti;++Pt)ei[Pt].apply(kt,jt)}re.prototype.emit=function(Lt){var kt,jt,ti,ei,Pt,ni,gi=Lt==="error";if(ni=this._events,ni)gi=gi&&ni.error==null;else if(!gi)return!1;if(gi){if(arguments.length>1&&(kt=arguments[1]),kt instanceof Error)throw kt;var di=new Error('Unhandled "error" event. ('+kt+")");throw di.context=kt,di}if(jt=ni[Lt],!jt)return!1;var li=typeof jt=="function";switch(ti=arguments.length,ti){case 1:Ie(jt,li,this);break;case 2:ue(jt,li,this,arguments[1]);break;case 3:de(jt,li,this,arguments[1],arguments[2]);break;case 4:Ne(jt,li,this,arguments[1],arguments[2],arguments[3]);break;default:for(ei=new Array(ti-1),Pt=1;Pt<ti;Pt++)ei[Pt-1]=arguments[Pt];he(jt,li,this,ei)}return!0};function pe(qe,Lt,kt,jt){var ti,ei,Pt;if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');if(ei=qe._events,ei?(ei.newListener&&(qe.emit("newListener",Lt,kt.listener?kt.listener:kt),ei=qe._events),Pt=ei[Lt]):(ei=qe._events=V(null),qe._eventsCount=0),!Pt)Pt=ei[Lt]=kt,++qe._eventsCount;else if(typeof Pt=="function"?Pt=ei[Lt]=jt?[kt,Pt]:[Pt,kt]:jt?Pt.unshift(kt):Pt.push(kt),!Pt.warned&&(ti=le(qe),ti&&ti>0&&Pt.length>ti)){Pt.warned=!0;var ni=new Error("Possible EventEmitter memory leak detected. "+Pt.length+' "'+String(Lt)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');ni.name="MaxListenersExceededWarning",ni.emitter=qe,ni.type=Lt,ni.count=Pt.length,typeof console=="object"&&console.warn&&console.warn("%s: %s",ni.name,ni.message)}return qe}re.prototype.addListener=function(Lt,kt){return pe(this,Lt,kt,!1)},re.prototype.on=re.prototype.addListener,re.prototype.prependListener=function(Lt,kt){return pe(this,Lt,kt,!0)};function ze(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var qe=new Array(arguments.length),Lt=0;Lt<qe.length;++Lt)qe[Lt]=arguments[Lt];this.listener.apply(this.target,qe)}}function Fe(qe,Lt,kt){var jt={fired:!1,wrapFn:void 0,target:qe,type:Lt,listener:kt},ti=oe.call(ze,jt);return ti.listener=kt,jt.wrapFn=ti,ti}re.prototype.once=function(Lt,kt){if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');return this.on(Lt,Fe(this,Lt,kt)),this},re.prototype.prependOnceListener=function(Lt,kt){if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(Lt,Fe(this,Lt,kt)),this},re.prototype.removeListener=function(Lt,kt){var jt,ti,ei,Pt,ni;if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');if(ti=this._events,!ti)return this;if(jt=ti[Lt],!jt)return this;if(jt===kt||jt.listener===kt)--this._eventsCount===0?this._events=V(null):(delete ti[Lt],ti.removeListener&&this.emit("removeListener",Lt,jt.listener||kt));else if(typeof jt!="function"){for(ei=-1,Pt=jt.length-1;Pt>=0;Pt--)if(jt[Pt]===kt||jt[Pt].listener===kt){ni=jt[Pt].listener,ei=Pt;break}if(ei<0)return this;ei===0?jt.shift():Dt(jt,ei),jt.length===1&&(ti[Lt]=jt[0]),ti.removeListener&&this.emit("removeListener",Lt,ni||kt)}return this},re.prototype.removeAllListeners=function(Lt){var kt,jt,ti;if(jt=this._events,!jt)return this;if(!jt.removeListener)return arguments.length===0?(this._events=V(null),this._eventsCount=0):jt[Lt]&&(--this._eventsCount===0?this._events=V(null):delete jt[Lt]),this;if(arguments.length===0){var ei=$(jt),Pt;for(ti=0;ti<ei.length;++ti)Pt=ei[ti],Pt!=="removeListener"&&this.removeAllListeners(Pt);return this.removeAllListeners("removeListener"),this._events=V(null),this._eventsCount=0,this}if(kt=jt[Lt],typeof kt=="function")this.removeListener(Lt,kt);else if(kt)for(ti=kt.length-1;ti>=0;ti--)this.removeListener(Lt,kt[ti]);return this};function xe(qe,Lt,kt){var jt=qe._events;if(!jt)return[];var ti=jt[Lt];return ti?typeof ti=="function"?kt?[ti.listener||ti]:[ti]:kt?Ue(ti):$e(ti,ti.length):[]}re.prototype.listeners=function(Lt){return xe(this,Lt,!0)},re.prototype.rawListeners=function(Lt){return xe(this,Lt,!1)},re.listenerCount=function(qe,Lt){return typeof qe.listenerCount=="function"?qe.listenerCount(Lt):_e.call(qe,Lt)},re.prototype.listenerCount=_e;function _e(qe){var Lt=this._events;if(Lt){var kt=Lt[qe];if(typeof kt=="function")return 1;if(kt)return kt.length}return 0}re.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function Dt(qe,Lt){for(var kt=Lt,jt=kt+1,ti=qe.length;jt<ti;kt+=1,jt+=1)qe[kt]=qe[jt];qe.pop()}function $e(qe,Lt){for(var kt=new Array(Lt),jt=0;jt<Lt;++jt)kt[jt]=qe[jt];return kt}function Ue(qe){for(var Lt=new Array(qe.length),kt=0;kt<Lt.length;++kt)Lt[kt]=qe[kt].listener||qe[kt];return Lt}function Ve(qe){var Lt=function(){};return Lt.prototype=qe,new Lt}function Oe(qe){for(var Lt in qe)Object.prototype.hasOwnProperty.call(qe,Lt);return Lt}function At(qe){var Lt=this;return function(){return Lt.apply(qe,arguments)}}},{}],23:[function(r,g,k){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */k.read=function(V,$,oe,re,Ce){var ie,ae,le=Ce*8-re-1,Ie=(1<<le)-1,ue=Ie>>1,de=-7,Ne=oe?Ce-1:0,he=oe?-1:1,pe=V[$+Ne];for(Ne+=he,ie=pe&(1<<-de)-1,pe>>=-de,de+=le;de>0;ie=ie*256+V[$+Ne],Ne+=he,de-=8);for(ae=ie&(1<<-de)-1,ie>>=-de,de+=re;de>0;ae=ae*256+V[$+Ne],Ne+=he,de-=8);if(ie===0)ie=1-ue;else{if(ie===Ie)return ae?NaN:(pe?-1:1)*(1/0);ae=ae+Math.pow(2,re),ie=ie-ue}return(pe?-1:1)*ae*Math.pow(2,ie-re)},k.write=function(V,$,oe,re,Ce,ie){var ae,le,Ie,ue=ie*8-Ce-1,de=(1<<ue)-1,Ne=de>>1,he=Ce===23?Math.pow(2,-24)-Math.pow(2,-77):0,pe=re?0:ie-1,ze=re?1:-1,Fe=$<0||$===0&&1/$<0?1:0;for($=Math.abs($),isNaN($)||$===1/0?(le=isNaN($)?1:0,ae=de):(ae=Math.floor(Math.log($)/Math.LN2),$*(Ie=Math.pow(2,-ae))<1&&(ae--,Ie*=2),ae+Ne>=1?$+=he/Ie:$+=he*Math.pow(2,1-Ne),$*Ie>=2&&(ae++,Ie/=2),ae+Ne>=de?(le=0,ae=de):ae+Ne>=1?(le=($*Ie-1)*Math.pow(2,Ce),ae=ae+Ne):(le=$*Math.pow(2,Ne-1)*Math.pow(2,Ce),ae=0));Ce>=8;V[oe+pe]=le&255,pe+=ze,le/=256,Ce-=8);for(ae=ae<<Ce|le,ue+=Ce;ue>0;V[oe+pe]=ae&255,pe+=ze,ae/=256,ue-=8);V[oe+pe-ze]|=Fe*128}},{}],24:[function(r,g,k){typeof Object.create=="function"?g.exports=function($,oe){oe&&($.super_=oe,$.prototype=Object.create(oe.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}))}:g.exports=function($,oe){if(oe){$.super_=oe;var re=function(){};re.prototype=oe.prototype,$.prototype=new re,$.prototype.constructor=$}}},{}],25:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});var V=function(){function $(oe,re){this.color=!0,this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0,this.leftChild=void 0,this.rightChild=void 0,this.key=oe,this.value=re}return $.prototype.rotateLeft=function(){var oe=this.parent,re=this.brother,Ce=this.leftChild,ie=this.rightChild;if(!ie)throw new Error("unknown error");var ae=ie.leftChild,le=ie.rightChild;return oe&&(oe.leftChild===this?oe.leftChild=ie:oe.rightChild===this&&(oe.rightChild=ie)),ie.parent=oe,ie.brother=re,ie.leftChild=this,ie.rightChild=le,re&&(re.brother=ie),this.parent=ie,this.brother=le,this.leftChild=Ce,this.rightChild=ae,le&&(le.parent=ie,le.brother=this),Ce&&(Ce.parent=this,Ce.brother=ae),ae&&(ae.parent=this,ae.brother=Ce),ie},$.prototype.rotateRight=function(){var oe=this.parent,re=this.brother,Ce=this.leftChild;if(!Ce)throw new Error("unknown error");var ie=this.rightChild,ae=Ce.leftChild,le=Ce.rightChild;return oe&&(oe.leftChild===this?oe.leftChild=Ce:oe.rightChild===this&&(oe.rightChild=Ce)),Ce.parent=oe,Ce.brother=re,Ce.leftChild=ae,Ce.rightChild=this,re&&(re.brother=Ce),ae&&(ae.parent=Ce,ae.brother=this),this.parent=Ce,this.brother=ae,this.leftChild=le,this.rightChild=ie,le&&(le.parent=this,le.brother=ie),ie&&(ie.parent=this,ie.brother=le),Ce},$.prototype.remove=function(){if(this.leftChild||this.rightChild)throw new Error("can only remove leaf node");this.parent&&(this===this.parent.leftChild?this.parent.leftChild=void 0:this===this.parent.rightChild&&(this.parent.rightChild=void 0)),this.brother&&(this.brother.brother=void 0),this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0},$.TreeNodeColorType={red:!0,black:!1},$}();Object.freeze(V),k.default=V},{}],26:[function(r,g,k){var V=this&&this.__generator||function(oe,re){var Ce={label:0,sent:function(){if(le[0]&1)throw le[1];return le[1]},trys:[],ops:[]},ie,ae,le,Ie;return Ie={next:ue(0),throw:ue(1),return:ue(2)},typeof Symbol=="function"&&(Ie[Symbol.iterator]=function(){return this}),Ie;function ue(Ne){return function(he){return de([Ne,he])}}function de(Ne){if(ie)throw new TypeError("Generator is already executing.");for(;Ce;)try{if(ie=1,ae&&(le=Ne[0]&2?ae.return:Ne[0]?ae.throw||((le=ae.return)&&le.call(ae),0):ae.next)&&!(le=le.call(ae,Ne[1])).done)return le;switch(ae=0,le&&(Ne=[Ne[0]&2,le.value]),Ne[0]){case 0:case 1:le=Ne;break;case 4:return Ce.label++,{value:Ne[1],done:!1};case 5:Ce.label++,ae=Ne[1],Ne=[0];continue;case 7:Ne=Ce.ops.pop(),Ce.trys.pop();continue;default:if(le=Ce.trys,!(le=le.length>0&&le[le.length-1])&&(Ne[0]===6||Ne[0]===2)){Ce=0;continue}if(Ne[0]===3&&(!le||Ne[1]>le[0]&&Ne[1]<le[3])){Ce.label=Ne[1];break}if(Ne[0]===6&&Ce.label<le[1]){Ce.label=le[1],le=Ne;break}if(le&&Ce.label<le[2]){Ce.label=le[2],Ce.ops.push(Ne);break}le[2]&&Ce.ops.pop(),Ce.trys.pop();continue}Ne=re.call(oe,Ce)}catch(he){Ne=[6,he],ae=0}finally{ie=le=0}if(Ne[0]&5)throw Ne[1];return{value:Ne[0]?Ne[1]:void 0,done:!0}}};Object.defineProperty(k,"__esModule",{value:!0}),$.sigma=3,$.bucketSize=5e3;function $(oe){var re=this;oe===void 0&&(oe=[]);var Ce=[],ie=0,ae=0,le=0,Ie=0,ue=0,de=0;this.size=function(){return de},this.empty=function(){return de===0},this.clear=function(){ie=le=ae=Ie=ue=de=0,he.call(this,$.bucketSize),de=0},this.front=function(){return Ce[ie][ae]},this.back=function(){return Ce[le][Ie]},this.forEach=function(pe){if(!this.empty()){var ze=0;if(ie===le){for(var Fe=ae;Fe<=Ie;++Fe)pe(Ce[ie][Fe],ze++);return}for(var Fe=ae;Fe<$.bucketSize;++Fe)pe(Ce[ie][Fe],ze++);for(var Fe=ie+1;Fe<le;++Fe)for(var xe=0;xe<$.bucketSize;++xe)pe(Ce[Fe][xe],ze++);for(var Fe=0;Fe<=Ie;++Fe)pe(Ce[le][Fe],ze++)}};var Ne=function(pe){var ze=ie*$.bucketSize+ae,Fe=ze+pe,xe=le*$.bucketSize+Ie;if(Fe<ze||Fe>xe)throw new Error("pos should more than 0 and less than queue's size");var _e=Math.floor(Fe/$.bucketSize),Dt=Fe%$.bucketSize;return{curNodeBucketIndex:_e,curNodePointerIndex:Dt}};this.getElementByPos=function(pe){var ze=Ne(pe),Fe=ze.curNodeBucketIndex,xe=ze.curNodePointerIndex;return Ce[Fe][xe]},this.eraseElementByPos=function(pe){var ze=this;if(pe<0||pe>de)throw new Error("pos should more than 0 and less than queue's size");if(pe===0)this.popFront();else if(pe===this.size())this.popBack();else{for(var Fe=[],xe=pe+1;xe<de;++xe)Fe.push(this.getElementByPos(xe));this.cut(pe),this.popBack(),Fe.forEach(function(_e){return ze.pushBack(_e)})}},this.eraseElementByValue=function(pe){if(!this.empty()){var ze=[];this.forEach(function(_e){_e!==pe&&ze.push(_e)});for(var Fe=ze.length,xe=0;xe<Fe;++xe)this.setElementByPos(xe,ze[xe]);this.cut(Fe-1)}};var he=function(pe){for(var ze=[],Fe=pe*$.sigma,xe=Math.max(Math.ceil(Fe/$.bucketSize),2),_e=0;_e<xe;++_e)ze.push(new Array($.bucketSize));var Dt=Math.ceil(pe/$.bucketSize),$e=Math.floor(xe/2)-Math.floor(Dt/2),Ue=$e,Ve=0;if(this.size())for(var _e=0;_e<Dt;++_e){for(var Oe=0;Oe<$.bucketSize;++Oe)if(ze[$e+_e][Oe]=this.front(),this.popFront(),this.empty()){Ue=$e+_e,Ve=Oe;break}if(this.empty())break}Ce=ze,ie=$e,ae=0,le=Ue,Ie=Ve,ue=xe,de=pe};this.pushBack=function(pe){this.empty()||(le===ue-1&&Ie===$.bucketSize-1&&he.call(this,this.size()),Ie<$.bucketSize-1?++Ie:le<ue-1&&(++le,Ie=0)),++de,Ce[le][Ie]=pe},this.popBack=function(){this.empty()||(this.size()!==1&&(Ie>0?--Ie:ie<le&&(--le,Ie=$.bucketSize-1)),de>0&&--de)},this.setElementByPos=function(pe,ze){var Fe=Ne(pe),xe=Fe.curNodeBucketIndex,_e=Fe.curNodePointerIndex;Ce[xe][_e]=ze},this.insert=function(pe,ze,Fe){var xe=this;if(Fe===void 0&&(Fe=1),pe===0)for(;Fe--;)this.pushFront(ze);else if(pe===this.size())for(;Fe--;)this.pushBack(ze);else{for(var _e=[],Dt=pe;Dt<de;++Dt)_e.push(this.getElementByPos(Dt));this.cut(pe-1);for(var Dt=0;Dt<Fe;++Dt)this.pushBack(ze);_e.forEach(function($e){return xe.pushBack($e)})}},this.find=function(pe){if(ie===le){for(var ze=ae;ze<=Ie;++ze)if(Ce[ie][ze]===pe)return!0;return!1}for(var ze=ae;ze<$.bucketSize;++ze)if(Ce[ie][ze]===pe)return!0;for(var ze=ie+1;ze<le;++ze)for(var Fe=0;Fe<$.bucketSize;++Fe)if(Ce[ze][Fe]===pe)return!0;for(var ze=0;ze<=Ie;++ze)if(Ce[le][ze]===pe)return!0;return!1},this.reverse=function(){for(var pe=0,ze=de-1;pe<ze;){var Fe=this.getElementByPos(pe);this.setElementByPos(pe,this.getElementByPos(ze)),this.setElementByPos(ze,Fe),++pe,--ze}},this.unique=function(){if(!this.empty()){var pe=[],ze=this.front();this.forEach(function(xe,_e){(_e===0||xe!==ze)&&(pe.push(xe),ze=xe)});for(var Fe=0;Fe<de;++Fe)this.setElementByPos(Fe,pe[Fe]);this.cut(pe.length-1)}},this.sort=function(pe){var ze=[];this.forEach(function(xe){ze.push(xe)}),ze.sort(pe);for(var Fe=0;Fe<de;++Fe)this.setElementByPos(Fe,ze[Fe])},this.pushFront=function(pe){this.empty()||(ie===0&&ae===0&&he.call(this,this.size()),ae>0?--ae:ie>0&&(--ie,ae=$.bucketSize-1)),++de,Ce[ie][ae]=pe},this.popFront=function(){this.empty()||(this.size()!==1&&(ae<$.bucketSize-1?++ae:ie<le&&(++ie,ae=0)),de>0&&--de)},this.shrinkToFit=function(){var pe=this,ze=[];this.forEach(function(Dt){ze.push(Dt)});var Fe=ze.length;Ce=[];for(var xe=Math.ceil(Fe/$.bucketSize),_e=0;_e<xe;++_e)Ce.push(new Array($.bucketSize));this.clear(),ze.forEach(function(Dt){return pe.pushBack(Dt)})},this.cut=function(pe){if(pe<0){this.clear();return}var ze=Ne(pe),Fe=ze.curNodeBucketIndex,xe=ze.curNodePointerIndex;le=Fe,Ie=xe,de=pe+1},this[Symbol.iterator]=function(){return function(){var ze,ze,ze,pe,ze;return V(this,function(Fe){switch(Fe.label){case 0:if(de===0)return[2];if(ie!==le)return[3,5];ze=ae,Fe.label=1;case 1:return ze<=Ie?[4,Ce[ie][ze]]:[3,4];case 2:Fe.sent(),Fe.label=3;case 3:return++ze,[3,1];case 4:return[2];case 5:ze=ae,Fe.label=6;case 6:return ze<$.bucketSize?[4,Ce[ie][ze]]:[3,9];case 7:Fe.sent(),Fe.label=8;case 8:return++ze,[3,6];case 9:ze=ie+1,Fe.label=10;case 10:if(!(ze<le))return[3,15];pe=0,Fe.label=11;case 11:return pe<$.bucketSize?[4,Ce[ze][pe]]:[3,14];case 12:Fe.sent(),Fe.label=13;case 13:return++pe,[3,11];case 14:return++ze,[3,10];case 15:ze=0,Fe.label=16;case 16:return ze<=Ie?[4,Ce[le][ze]]:[3,19];case 17:Fe.sent(),Fe.label=18;case 18:return++ze,[3,16];case 19:return[2]}})}()},function(){var pe=$.bucketSize;oe.size?pe=oe.size():oe.length&&(pe=oe.length);var ze=pe*$.sigma;ue=Math.ceil(ze/$.bucketSize),ue=Math.max(ue,3);for(var Fe=0;Fe<ue;++Fe)Ce.push(new Array($.bucketSize));var xe=Math.ceil(pe/$.bucketSize);ie=Math.floor(ue/2)-Math.floor(xe/2),le=ie,oe.forEach(function(_e){return re.pushBack(_e)})}(),Object.freeze(this)}Object.freeze($),k.default=$},{}],27:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../LinkList/LinkList"),re=r("../Map/Map");Ce.initSize=16,Ce.maxSize=1<<30,Ce.sigma=.75,Ce.treeifyThreshold=8,Ce.untreeifyThreshold=6,Ce.minTreeifySize=64;function Ce(ie,ae,le){var Ie=this;if(ie===void 0&&(ie=[]),ae===void 0&&(ae=Ce.initSize),le=le||function(pe){var ze,Fe,xe=0,_e="";if(typeof pe=="number")xe=Math.floor(pe),xe=(xe<<5)-xe,xe=xe&xe;else{typeof pe!="string"?_e=JSON.stringify(pe):_e=pe;try{for(var Dt=$(_e),$e=Dt.next();!$e.done;$e=Dt.next()){var Ue=$e.value,Ve=Ue.charCodeAt(0);xe=(xe<<5)-xe+Ve,xe=xe&xe}}catch(Oe){ze={error:Oe}}finally{try{$e&&!$e.done&&(Fe=Dt.return)&&Fe.call(Dt)}finally{if(ze)throw ze.error}}}return xe^=xe>>>16,xe},ae&ae-1)throw new Error("initBucketNum must be 2 to the power of n");var ue=0,de=[],Ne=Math.max(Ce.initSize,Math.min(Ce.maxSize,ae));this.size=function(){return ue},this.empty=function(){return ue===0},this.clear=function(){ue=0,Ne=ae,de=[]},this.forEach=function(pe){var ze=0;de.forEach(function(Fe){Fe.forEach(function(xe){pe(xe,ze++)})})};var he=function(pe){if(!(pe>=Ce.maxSize)){Ne=pe*2;var ze=[];de.forEach(function(Fe,xe){if(!Fe.empty()){if(Fe instanceof oe.default&&Fe.size()===1){var _e=Fe.front(),Dt=_e.key,$e=_e.value;ze[le(Dt)&Ne-1]=new oe.default([{key:Dt,value:$e}])}else if(Fe instanceof re.default){var Ue=new oe.default,Ve=new oe.default;Fe.forEach(function(qe){var Lt=le(qe.key);Lt&pe?Ve.pushBack(qe):Ue.pushBack(qe)}),Ue.size()>Ce.untreeifyThreshold?ze[xe]=new re.default(Ue):Ue.size()&&(ze[xe]=Ue),Ve.size()>Ce.untreeifyThreshold?ze[xe+pe]=new re.default(Ve):Ve.size()&&(ze[xe+pe]=Ve)}else{var Oe=new oe.default,At=new oe.default;Fe.forEach(function(qe){var Lt=le(qe.key);Lt&pe?At.pushBack(qe):Oe.pushBack(qe)}),Oe.size()&&(ze[xe]=Oe),At.size()&&(ze[xe+pe]=At)}de[xe].clear()}}),de=ze}};this.setElement=function(pe,ze){var Fe,xe;if(pe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(ze==null){this.eraseElementByKey(pe);return}var _e=le(pe)&Ne-1;if(!de[_e])++ue,de[_e]=new oe.default([{key:pe,value:ze}]);else{var Dt=de[_e].size();if(de[_e]instanceof oe.default){try{for(var $e=$(de[_e]),Ue=$e.next();!Ue.done;Ue=$e.next()){var Ve=Ue.value;if(Ve.key===pe){Ve.value=ze;return}}}catch(At){Fe={error:At}}finally{try{Ue&&!Ue.done&&(xe=$e.return)&&xe.call($e)}finally{if(Fe)throw Fe.error}}de[_e].pushBack({key:pe,value:ze}),de[_e].size()>=Ce.treeifyThreshold&&(de[_e]=new re.default(de[_e]))}else de[_e].setElement(pe,ze);var Oe=de[_e].size();ue+=Oe-Dt}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.getElementByKey=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(de[xe]){if(de[xe]instanceof re.default)return de[xe].getElementByKey(pe);try{for(var _e=$(de[xe]),Dt=_e.next();!Dt.done;Dt=_e.next()){var $e=Dt.value;if($e.key===pe)return $e.value}}catch(Ue){ze={error:Ue}}finally{try{Dt&&!Dt.done&&(Fe=_e.return)&&Fe.call(_e)}finally{if(ze)throw ze.error}}}},this.eraseElementByKey=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(de[xe]){var _e=de[xe].size();if(de[xe]instanceof re.default)de[xe].eraseElementByKey(pe),de[xe].size()<=Ce.untreeifyThreshold&&(de[xe]=new oe.default(de[xe]));else{var Dt=-1;try{for(var $e=$(de[xe]),Ue=$e.next();!Ue.done;Ue=$e.next()){var Ve=Ue.value;if(++Dt,Ve.key===pe){de[xe].eraseElementByPos(Dt);break}}}catch(At){ze={error:At}}finally{try{Ue&&!Ue.done&&(Fe=$e.return)&&Fe.call($e)}finally{if(ze)throw ze.error}}}var Oe=de[xe].size();ue+=Oe-_e}},this.find=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(!de[xe])return!1;if(de[xe]instanceof re.default)return de[xe].find(pe);try{for(var _e=$(de[xe]),Dt=_e.next();!Dt.done;Dt=_e.next()){var $e=Dt.value;if($e.key===pe)return!0}}catch(Ue){ze={error:Ue}}finally{try{Dt&&!Dt.done&&(Fe=_e.return)&&Fe.call(_e)}finally{if(ze)throw ze.error}}return!1},this[Symbol.iterator]=function(){return function(){var pe,ze,Fe,xe,_e,Dt,$e;return V(this,function(Ue){switch(Ue.label){case 0:pe=0,Ue.label=1;case 1:if(!(pe<Ne))return[3,10];for(;pe<Ne&&!de[pe];)++pe;if(pe>=Ne)return[3,10];Ue.label=2;case 2:Ue.trys.push([2,7,8,9]),ze=(Dt=void 0,$(de[pe])),Fe=ze.next(),Ue.label=3;case 3:return Fe.done?[3,6]:(xe=Fe.value,[4,xe]);case 4:Ue.sent(),Ue.label=5;case 5:return Fe=ze.next(),[3,3];case 6:return[3,9];case 7:return _e=Ue.sent(),Dt={error:_e},[3,9];case 8:try{Fe&&!Fe.done&&($e=ze.return)&&$e.call(ze)}finally{if(Dt)throw Dt.error}return[7];case 9:return++pe,[3,1];case 10:return[2]}})}()},ie.forEach(function(pe){var ze=pe.key,Fe=pe.value;return Ie.setElement(ze,Fe)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{"../LinkList/LinkList":29,"../Map/Map":30}],28:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Set/Set"),re=r("../LinkList/LinkList");Ce.initSize=16,Ce.maxSize=1<<30,Ce.sigma=.75,Ce.treeifyThreshold=8,Ce.untreeifyThreshold=6,Ce.minTreeifySize=64;function Ce(ie,ae,le){var Ie=this;if(ie===void 0&&(ie=[]),ae===void 0&&(ae=Ce.initSize),le=le||function(pe){var ze=0,Fe="";if(typeof pe=="number")ze=Math.floor(pe),ze=(ze<<5)-ze,ze=ze&ze;else{typeof pe!="string"?Fe=JSON.stringify(pe):Fe=pe;for(var xe=0;xe<Fe.length;xe++){var _e=Fe.charCodeAt(xe);ze=(ze<<5)-ze+_e,ze=ze&ze}}return ze^=ze>>>16,ze},ae&ae-1)throw new Error("initBucketNum must be 2 to the power of n");var ue=0,de=[],Ne=Math.max(Ce.initSize,Math.min(Ce.maxSize,ae));this.size=function(){return ue},this.empty=function(){return ue===0},this.clear=function(){ue=0,Ne=ae,de=[]},this.forEach=function(pe){var ze=0;de.forEach(function(Fe){Fe.forEach(function(xe){pe(xe,ze++)})})};var he=function(pe){if(!(pe>=Ce.maxSize)){Ne=pe*2;var ze=[];de.forEach(function(Fe,xe){if(!Fe.empty()){if(Fe instanceof re.default&&Fe.size()===1){var _e=Fe.front();if(_e===void 0)throw new Error("unknown error");ze[le(_e)&Ne-1]=new re.default([_e])}else if(Fe instanceof oe.default){var Dt=new re.default,$e=new re.default;Fe.forEach(function(Oe){var At=le(Oe);At&pe?$e.pushBack(Oe):Dt.pushBack(Oe)}),Dt.size()>Ce.untreeifyThreshold?ze[xe]=new oe.default(Dt):Dt.size()&&(ze[xe]=Dt),$e.size()>Ce.untreeifyThreshold?ze[xe+pe]=new oe.default($e):$e.size()&&(ze[xe+pe]=$e)}else{var Ue=new re.default,Ve=new re.default;Fe.forEach(function(Oe){var At=le(Oe);At&pe?Ve.pushBack(Oe):Ue.pushBack(Oe)}),Ue.size()&&(ze[xe]=Ue),Ve.size()&&(ze[xe+pe]=Ve)}de[xe].clear()}}),de=ze}};this.insert=function(pe){if(pe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");var ze=le(pe)&Ne-1;if(!de[ze])de[ze]=new re.default([pe]),++ue;else{var Fe=de[ze].size();if(de[ze]instanceof re.default){if(de[ze].find(pe))return;de[ze].pushBack(pe),de[ze].size()>=Ce.treeifyThreshold&&(de[ze]=new oe.default(de[ze]))}else de[ze].insert(pe);var xe=de[ze].size();ue+=xe-Fe}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.eraseElementByValue=function(pe){var ze=le(pe)&Ne-1;if(de[ze]){var Fe=de[ze].size();de[ze].eraseElementByValue(pe),de[ze]instanceof oe.default&&de[ze].size()<=Ce.untreeifyThreshold&&(de[ze]=new re.default(de[ze]));var xe=de[ze].size();ue+=xe-Fe}},this.find=function(pe){var ze=le(pe)&Ne-1;return de[ze]?de[ze].find(pe):!1},this[Symbol.iterator]=function(){return function(){var pe,ze,Fe,xe,_e,Dt,$e;return V(this,function(Ue){switch(Ue.label){case 0:pe=0,Ue.label=1;case 1:if(!(pe<Ne))return[3,10];for(;pe<Ne&&!de[pe];)++pe;if(pe>=Ne)return[3,10];Ue.label=2;case 2:Ue.trys.push([2,7,8,9]),ze=(Dt=void 0,$(de[pe])),Fe=ze.next(),Ue.label=3;case 3:return Fe.done?[3,6]:(xe=Fe.value,[4,xe]);case 4:Ue.sent(),Ue.label=5;case 5:return Fe=ze.next(),[3,3];case 6:return[3,9];case 7:return _e=Ue.sent(),Dt={error:_e},[3,9];case 8:try{Fe&&!Fe.done&&($e=ze.return)&&$e.call(ze)}finally{if(Dt)throw Dt.error}return[7];case 9:return++pe,[3,1];case 10:return[2]}})}()},ie.forEach(function(pe){return Ie.insert(pe)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{"../LinkList/LinkList":29,"../Set/Set":33}],29:[function(r,g,k){var V=this&&this.__generator||function(re,Ce){var ie={label:0,sent:function(){if(Ie[0]&1)throw Ie[1];return Ie[1]},trys:[],ops:[]},ae,le,Ie,ue;return ue={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ue[Symbol.iterator]=function(){return this}),ue;function de(he){return function(pe){return Ne([he,pe])}}function Ne(he){if(ae)throw new TypeError("Generator is already executing.");for(;ie;)try{if(ae=1,le&&(Ie=he[0]&2?le.return:he[0]?le.throw||((Ie=le.return)&&Ie.call(le),0):le.next)&&!(Ie=Ie.call(le,he[1])).done)return Ie;switch(le=0,Ie&&(he=[he[0]&2,Ie.value]),he[0]){case 0:case 1:Ie=he;break;case 4:return ie.label++,{value:he[1],done:!1};case 5:ie.label++,le=he[1],he=[0];continue;case 7:he=ie.ops.pop(),ie.trys.pop();continue;default:if(Ie=ie.trys,!(Ie=Ie.length>0&&Ie[Ie.length-1])&&(he[0]===6||he[0]===2)){ie=0;continue}if(he[0]===3&&(!Ie||he[1]>Ie[0]&&he[1]<Ie[3])){ie.label=he[1];break}if(he[0]===6&&ie.label<Ie[1]){ie.label=Ie[1],Ie=he;break}if(Ie&&ie.label<Ie[2]){ie.label=Ie[2],ie.ops.push(he);break}Ie[2]&&ie.ops.pop(),ie.trys.pop();continue}he=Ce.call(re,ie)}catch(pe){he=[6,pe],le=0}finally{ae=Ie=0}if(he[0]&5)throw he[1];return{value:he[0]?he[1]:void 0,done:!0}}};Object.defineProperty(k,"__esModule",{value:!0});var $=function(){function re(Ce){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=Ce}return re}();function oe(re){var Ce=this;re===void 0&&(re=[]);var ie=0,ae=void 0,le=void 0;this.size=function(){return ie},this.empty=function(){return ie===0},this.clear=function(){ae=le=void 0,ie=0},this.front=function(){return ae==null?void 0:ae.value},this.back=function(){return le==null?void 0:le.value},this.forEach=function(Ie){for(var ue=ae,de=0;ue;){if(ue.value===void 0)throw new Error("unknown error");Ie(ue.value,de++),ue=ue.next}},this.getElementByPos=function(Ie){if(Ie<0||Ie>=ie)throw new Error("pos must more then 0 and less then the list length");for(var ue=ae;Ie--&&ue;)ue=ue.next;if(!ue||ue.value===void 0)throw new Error("unknown error");return ue.value},this.eraseElementByPos=function(Ie){if(Ie<0||Ie>=ie)throw new Error("erase pos must more then 0 and less then the list length");if(Ie===0)this.popFront();else if(Ie===ie-1)this.popBack();else{for(var ue=ae;Ie--;){if(!(ue!=null&&ue.next))throw new Error("unknown error");ue=ue.next}if(!ue||!ue.pre||!ue.next)throw new Error("unknown error");var de=ue.pre,Ne=ue.next;Ne.pre=de,de.next=Ne,ie>0&&--ie}},this.eraseElementByValue=function(Ie){for(;ae&&ae.value===Ie;)this.popFront();for(;le&&le.value===Ie;)this.popBack();if(ae)for(var ue=ae;ue;){if(ue.value===Ie){var de=ue.pre,Ne=ue.next;Ne&&(Ne.pre=de),de&&(de.next=Ne),ie>0&&--ie}ue=ue.next}},this.pushBack=function(Ie){if(Ie==null)throw new Error("you can't push null or undefined here");++ie;var ue=new $(Ie);le?(le.next=ue,ue.pre=le,le=ue):ae=le=ue},this.popBack=function(){le&&(ie>0&&--ie,le&&(ae===le?ae=le=void 0:(le=le.pre,le&&(le.next=void 0))))},this.setElementByPos=function(Ie,ue){if(ue==null)throw new Error("you can't set null or undefined here");if(Ie<0||Ie>=ie)throw new Error("pos must more then 0 and less then the list length");for(var de=ae;Ie--;){if(!de)throw new Error("unknown error");de=de.next}de&&(de.value=ue)},this.insert=function(Ie,ue,de){if(de===void 0&&(de=1),ue==null)throw new Error("you can't insert null or undefined here");if(Ie<0||Ie>ie)throw new Error("insert pos must more then 0 and less then or equal to the list length");if(de<0)throw new Error("insert size must more than 0");if(Ie===0)for(;de--;)this.pushFront(ue);else if(Ie===ie)for(;de--;)this.pushBack(ue);else{for(var Ne=ae,he=1;he<Ie;++he){if(!(Ne!=null&&Ne.next))throw new Error("unknown error");Ne=Ne==null?void 0:Ne.next}if(!Ne)throw new Error("unknown error");var pe=Ne.next;for(ie+=de;de--;)Ne.next=new $(ue),Ne.next.pre=Ne,Ne=Ne.next;Ne.next=pe,pe&&(pe.pre=Ne)}},this.find=function(Ie){for(var ue=ae;ue;){if(ue.value===Ie)return!0;ue=ue.next}return!1},this.reverse=function(){for(var Ie=ae,ue=le,de=0;Ie&&ue&&de*2<ie;){var Ne=Ie.value;Ie.value=ue.value,ue.value=Ne,Ie=Ie.next,ue=ue.pre,++de}},this.unique=function(){for(var Ie=ae;Ie;){for(var ue=Ie;ue&&ue.next&&ue.value===ue.next.value;)ue=ue.next,ie>0&&--ie;Ie.next=ue.next,Ie.next&&(Ie.next.pre=Ie),Ie=Ie.next}},this.sort=function(Ie){var ue=[];this.forEach(function(Ne){ue.push(Ne)}),ue.sort(Ie);var de=ae;ue.forEach(function(Ne){de&&(de.value=Ne,de=de.next)})},this.pushFront=function(Ie){if(Ie==null)throw new Error("you can't push null or undefined here");++ie;var ue=new $(Ie);ae?(ue.next=ae,ae.pre=ue,ae=ue):ae=le=ue},this.popFront=function(){ae&&(ie>0&&--ie,ae&&(ae===le?ae=le=void 0:(ae=ae.next,ae&&(ae.pre=void 0))))},this.merge=function(Ie){var ue=this,de=ae;Ie.forEach(function(Ne){for(;de&&de.value!==void 0&&de.value<=Ne;)de=de.next;if(de===void 0)ue.pushBack(Ne),de=le;else if(de===ae)ue.pushFront(Ne),de=ae;else{++ie;var he=de.pre;he&&(he.next=new $(Ne),he.next.pre=he,he.next.next=de,de&&(de.pre=he.next))}})},this[Symbol.iterator]=function(){return function(){var Ie;return V(this,function(ue){switch(ue.label){case 0:Ie=ae,ue.label=1;case 1:if(Ie===void 0)return[3,3];if(!Ie.value)throw new Error("unknown error");return[4,Ie.value];case 2:return ue.sent(),Ie=Ie.next,[3,1];case 3:return[2]}})}()},re.forEach(function(Ie){return Ce.pushBack(Ie)}),Object.freeze(this)}Object.freeze(oe),k.default=oe},{}],30:[function(r,g,k){var V=this&&this.__generator||function(Ce,ie){var ae={label:0,sent:function(){if(ue[0]&1)throw ue[1];return ue[1]},trys:[],ops:[]},le,Ie,ue,de;return de={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function Ne(pe){return function(ze){return he([pe,ze])}}function he(pe){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=pe[0]&2?Ie.return:pe[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,pe[1])).done)return ue;switch(Ie=0,ue&&(pe=[pe[0]&2,ue.value]),pe[0]){case 0:case 1:ue=pe;break;case 4:return ae.label++,{value:pe[1],done:!1};case 5:ae.label++,Ie=pe[1],pe=[0];continue;case 7:pe=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(pe[0]===6||pe[0]===2)){ae=0;continue}if(pe[0]===3&&(!ue||pe[1]>ue[0]&&pe[1]<ue[3])){ae.label=pe[1];break}if(pe[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=pe;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(pe);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}pe=ie.call(Ce,ae)}catch(ze){pe=[6,ze],Ie=0}finally{le=ue=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},$=this&&this.__values||function(Ce){var ie=typeof Symbol=="function"&&Symbol.iterator,ae=ie&&Ce[ie],le=0;if(ae)return ae.call(Ce);if(Ce&&typeof Ce.length=="number")return{next:function(){return Ce&&le>=Ce.length&&(Ce=void 0),{value:Ce&&Ce[le++],done:!Ce}}};throw new TypeError(ie?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Base/TreeNode");function re(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(Oe,At){return Oe<At?-1:Oe>At?1:0};var le=0,Ie=new oe.default;Ie.color=oe.default.TreeNodeColorType.black,this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.key=Ie.value=void 0,Ie.leftChild=Ie.rightChild=Ie.brother=void 0};var ue=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.leftChild?ue(Oe.leftChild):Oe},de=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.rightChild?de(Oe.rightChild):Oe};this.front=function(){if(!this.empty()){var Oe=ue(Ie);if(Oe.key===void 0||Oe.value===void 0)throw new Error("unknown error");return{key:Oe.key,value:Oe.value}}},this.back=function(){if(!this.empty()){var Oe=de(Ie);if(Oe.key===void 0||Oe.value===void 0)throw new Error("unknown error");return{key:Oe.key,value:Oe.value}}},this.forEach=function(Oe){var At,qe,Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;Oe(ti,Lt++)}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}},this.getElementByPos=function(Oe){var At,qe;if(Oe<0||Oe>=this.size())throw new Error("pos must more than 0 and less than set's size");var Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;if(Lt===Oe)return ti;++Lt}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}throw new Error("unknown Error")};var Ne=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe===0?{key:Oe.key,value:Oe.value}:qe<0?Ne(Oe.rightChild,At):Ne(Oe.leftChild,At)||{key:Oe.key,value:Oe.value}}};this.lowerBound=function(Oe){return Ne(Ie,Oe)};var he=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe<=0?he(Oe.rightChild,At):he(Oe.leftChild,At)||{key:Oe.key,value:Oe.value}}};this.upperBound=function(Oe){return he(Ie,Oe)};var pe=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe===0?{key:Oe.key,value:Oe.value}:qe>0?pe(Oe.leftChild,At):pe(Oe.rightChild,At)||{key:Oe.key,value:Oe.value}}};this.reverseLowerBound=function(Oe){return pe(Ie,Oe)};var ze=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe>=0?ze(Oe.leftChild,At):ze(Oe.rightChild,At)||{key:Oe.key,value:Oe.value}}};this.reverseUpperBound=function(Oe){return ze(Ie,Oe)};var Fe=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(Oe.color===oe.default.TreeNodeColorType.red){Oe.color=oe.default.TreeNodeColorType.black;return}var qe=Oe.brother;if(!qe)throw new Error("unknown error");if(Oe===At.leftChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Fe(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateRight();Ie===qe&&(Ie=Lt),Fe(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Fe(At))}else if(Oe===At.rightChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Fe(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateLeft();Ie===qe&&(Ie=Lt),Fe(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Fe(At))}},xe=function(Oe){for(var At=Oe;At.leftChild||At.rightChild;){if(At.rightChild){At=ue(At.rightChild);var qe=Oe.key;Oe.key=At.key,At.key=qe;var Lt=Oe.value;Oe.value=At.value,At.value=Lt,Oe=At}if(At.leftChild){At=de(At.leftChild);var qe=Oe.key;Oe.key=At.key,At.key=qe;var Lt=Oe.value;Oe.value=At.value,At.value=Lt,Oe=At}}Fe(At),At&&At.remove(),--le,Ie.color=oe.default.TreeNodeColorType.black},_e=function(Oe,At){if(!Oe||Oe.key===void 0)return!1;var qe=_e(Oe.leftChild,At);return qe||At(Oe)?!0:_e(Oe.rightChild,At)};this.eraseElementByPos=function(Oe){if(Oe<0||Oe>=le)throw new Error("pos must more than 0 and less than set's size");var At=0;_e(Ie,function(qe){return Oe===At?(xe(qe),!0):(++At,!1)})},this.eraseElementByKey=function(Oe){if(!this.empty()){var At=Ue(Ie,Oe);At===void 0||At.key===void 0||ie(At.key,Oe)!==0||xe(At)}};var Dt=function(Oe,At){if(!Oe||Oe.key===void 0)throw new Error("unknown error");var qe=ie(At,Oe.key);return qe<0?Oe.leftChild?Dt(Oe.leftChild,At):(Oe.leftChild=new oe.default,Oe.leftChild.parent=Oe,Oe.leftChild.brother=Oe.rightChild,Oe.rightChild&&(Oe.rightChild.brother=Oe.leftChild),Oe.leftChild):qe>0?Oe.rightChild?Dt(Oe.rightChild,At):(Oe.rightChild=new oe.default,Oe.rightChild.parent=Oe,Oe.rightChild.brother=Oe.leftChild,Oe.leftChild&&(Oe.leftChild.brother=Oe.rightChild),Oe.rightChild):Oe},$e=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(At.color!==oe.default.TreeNodeColorType.black&&At.color===oe.default.TreeNodeColorType.red){var qe=At.brother,Lt=At.parent;if(!Lt)throw new Error("unknown error");if(qe&&qe.color===oe.default.TreeNodeColorType.red)qe.color=At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red,$e(Lt);else if(!qe||qe.color===oe.default.TreeNodeColorType.black){if(At===Lt.leftChild){if(Oe===At.leftChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateRight();Lt===Ie&&(Ie=kt)}else if(Oe===At.rightChild){var kt=At.rotateLeft();Lt===Ie&&(Ie=kt),$e(At)}}else if(At===Lt.rightChild){if(Oe===At.leftChild){var kt=At.rotateRight();Lt===Ie&&(Ie=kt),$e(At)}else if(Oe===At.rightChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateLeft();Lt===Ie&&(Ie=kt)}}}}};this.setElement=function(Oe,At){if(Oe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(At==null){this.eraseElementByKey(Oe);return}if(this.empty()){++le,Ie.key=Oe,Ie.value=At,Ie.color=oe.default.TreeNodeColorType.black;return}var qe=Dt(Ie,Oe);if(qe.key!==void 0&&ie(qe.key,Oe)===0){qe.value=At;return}++le,qe.key=Oe,qe.value=At,$e(qe),Ie.color=oe.default.TreeNodeColorType.black};var Ue=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(At,Oe.key);return qe<0?Ue(Oe.leftChild,At):qe>0?Ue(Oe.rightChild,At):Oe}};this.find=function(Oe){return!!Ue(Ie,Oe)},this.getElementByKey=function(Oe){var At=Ue(Ie,Oe);if((At==null?void 0:At.key)===void 0||(At==null?void 0:At.value)===void 0)throw new Error("unknown error");return At.value},this.union=function(Oe){var At=this;Oe.forEach(function(qe){var Lt=qe.key,kt=qe.value;return At.setElement(Lt,kt)})},this.getHeight=function(){if(this.empty())return 0;var Oe=function(At){return At?Math.max(Oe(At.leftChild),Oe(At.rightChild))+1:1};return Oe(Ie)};var Ve=function(Oe){return V(this,function(At){switch(At.label){case 0:return!Oe||Oe.key===void 0||Oe.value===void 0?[2]:[5,$(Ve(Oe.leftChild))];case 1:return At.sent(),[4,{key:Oe.key,value:Oe.value}];case 2:return At.sent(),[5,$(Ve(Oe.rightChild))];case 3:return At.sent(),[2]}})};this[Symbol.iterator]=function(){return Ve(Ie)},Ce.forEach(function(Oe){var At=Oe.key,qe=Oe.value;return ae.setElement(At,qe)}),Object.freeze(this)}Object.freeze(re),k.default=re},{"../Base/TreeNode":25}],31:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});function V($,oe){$===void 0&&($=[]),oe=oe||function(le,Ie){return le>Ie?-1:le<Ie?1:0};var re=[];$.forEach(function(le){return re.push(le)});var Ce=re.length,ie=function(le,Ie){if(le<0||le>=Ce)throw new Error("unknown error");if(Ie<0||Ie>=Ce)throw new Error("unknown error");var ue=re[le];re[le]=re[Ie],re[Ie]=ue},ae=function(le){if(le<0||le>=Ce)throw new Error("unknown error");var Ie=le*2+1,ue=le*2+2;Ie<Ce&&oe(re[le],re[Ie])>0&&ie(le,Ie),ue<Ce&&oe(re[le],re[ue])>0&&ie(le,ue)};(function(){for(var le=Math.floor((Ce-1)/2);le>=0;--le)for(var Ie=le,ue=Ie*2+1;ue<Ce;){var de=ue,Ne=de+1,he=de;if(Ne<Ce&&oe(re[de],re[Ne])>0&&(he=Ne),oe(re[Ie],re[he])<=0)break;ie(Ie,he),Ie=he,ue=Ie*2+1}})(),this.size=function(){return Ce},this.empty=function(){return Ce===0},this.clear=function(){Ce=0,re.length=0},this.push=function(le){if(re.push(le),++Ce,Ce!==1)for(var Ie=Ce-1;Ie>0;){var ue=Math.floor((Ie-1)/2);if(oe(re[ue],le)<=0)break;ae(ue),Ie=ue}},this.pop=function(){if(!this.empty()){if(this.size()===1){--Ce;return}var le=re[Ce-1];--Ce;for(var Ie=0;Ie<this.size();){var ue=Ie*2+1,de=Ie*2+2;if(ue>=this.size())break;var Ne=ue;if(de<this.size()&&oe(re[ue],re[de])>0&&(Ne=de),oe(re[Ne],le)>=0)break;re[Ie]=re[Ne],Ie=Ne}re[Ie]=le}},this.top=function(){return re[0]},Object.freeze(this)}Object.freeze(V),k.default=V},{}],32:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});var V=r("../LinkList/LinkList");function $(oe){oe===void 0&&(oe=[]);var re=new V.default(oe);this.size=function(){return re.size()},this.empty=function(){return re.empty()},this.clear=function(){re.clear()},this.push=function(Ce){re.pushBack(Ce)},this.pop=function(){re.popFront()},this.front=function(){return re.front()},Object.freeze(this)}Object.freeze($),k.default=$},{"../LinkList/LinkList":29}],33:[function(r,g,k){var V=this&&this.__generator||function(Ce,ie){var ae={label:0,sent:function(){if(ue[0]&1)throw ue[1];return ue[1]},trys:[],ops:[]},le,Ie,ue,de;return de={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function Ne(pe){return function(ze){return he([pe,ze])}}function he(pe){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=pe[0]&2?Ie.return:pe[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,pe[1])).done)return ue;switch(Ie=0,ue&&(pe=[pe[0]&2,ue.value]),pe[0]){case 0:case 1:ue=pe;break;case 4:return ae.label++,{value:pe[1],done:!1};case 5:ae.label++,Ie=pe[1],pe=[0];continue;case 7:pe=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(pe[0]===6||pe[0]===2)){ae=0;continue}if(pe[0]===3&&(!ue||pe[1]>ue[0]&&pe[1]<ue[3])){ae.label=pe[1];break}if(pe[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=pe;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(pe);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}pe=ie.call(Ce,ae)}catch(ze){pe=[6,ze],Ie=0}finally{le=ue=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},$=this&&this.__values||function(Ce){var ie=typeof Symbol=="function"&&Symbol.iterator,ae=ie&&Ce[ie],le=0;if(ae)return ae.call(Ce);if(Ce&&typeof Ce.length=="number")return{next:function(){return Ce&&le>=Ce.length&&(Ce=void 0),{value:Ce&&Ce[le++],done:!Ce}}};throw new TypeError(ie?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Base/TreeNode");function re(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(Oe,At){return Oe<At?-1:Oe>At?1:0};var le=0,Ie=new oe.default;Ie.color=oe.default.TreeNodeColorType.black,this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.key=void 0,Ie.leftChild=Ie.rightChild=Ie.brother=Ie.parent=void 0,Ie.color=oe.default.TreeNodeColorType.black};var ue=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.leftChild?ue(Oe.leftChild):Oe},de=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.rightChild?de(Oe.rightChild):Oe};this.front=function(){if(!this.empty()){var Oe=ue(Ie);return Oe.key}},this.back=function(){if(!this.empty()){var Oe=de(Ie);return Oe.key}},this.forEach=function(Oe){var At,qe,Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;Oe(ti,Lt++)}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}},this.getElementByPos=function(Oe){var At,qe;if(Oe<0||Oe>=this.size())throw new Error("pos must more than 0 and less than set's size");var Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;if(Lt===Oe)return ti;++Lt}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}throw new Error("unknown error")};var Ne=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(Oe.color===oe.default.TreeNodeColorType.red){Oe.color=oe.default.TreeNodeColorType.black;return}var qe=Oe.brother;if(!qe)throw new Error("unknown error");if(Oe===At.leftChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Ne(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateRight();Ie===qe&&(Ie=Lt),Ne(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Ne(At))}else if(Oe===At.rightChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Ne(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateLeft();Ie===qe&&(Ie=Lt),Ne(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Ne(At))}},he=function(Oe){for(var At=Oe;At.leftChild||At.rightChild;){if(At.rightChild){At=ue(At.rightChild);var qe=Oe.key;Oe.key=At.key,At.key=qe,Oe=At}if(At.leftChild){At=de(At.leftChild);var qe=Oe.key;Oe.key=At.key,At.key=qe,Oe=At}}Ne(At),At&&At.remove(),--le,Ie.color=oe.default.TreeNodeColorType.black},pe=function(Oe,At){if(!Oe||Oe.key===void 0)return!1;var qe=pe(Oe.leftChild,At);return qe||At(Oe)?!0:pe(Oe.rightChild,At)};this.eraseElementByPos=function(Oe){if(Oe<0||Oe>=le)throw new Error("pos must more than 0 and less than set's size");var At=0;pe(Ie,function(qe){return Oe===At?(he(qe),!0):(++At,!1)})},this.eraseElementByValue=function(Oe){if(!this.empty()){var At=xe(Ie,Oe);At===void 0||At.key===void 0||ie(At.key,Oe)!==0||he(At)}};var ze=function(Oe,At){if(!Oe||Oe.key===void 0)throw new Error("unknown error");var qe=ie(At,Oe.key);return qe<0?Oe.leftChild?ze(Oe.leftChild,At):(Oe.leftChild=new oe.default,Oe.leftChild.parent=Oe,Oe.leftChild.brother=Oe.rightChild,Oe.rightChild&&(Oe.rightChild.brother=Oe.leftChild),Oe.leftChild):qe>0?Oe.rightChild?ze(Oe.rightChild,At):(Oe.rightChild=new oe.default,Oe.rightChild.parent=Oe,Oe.rightChild.brother=Oe.leftChild,Oe.leftChild&&(Oe.leftChild.brother=Oe.rightChild),Oe.rightChild):Oe},Fe=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(At.color!==oe.default.TreeNodeColorType.black&&At.color===oe.default.TreeNodeColorType.red){var qe=At.brother,Lt=At.parent;if(!Lt)throw new Error("unknown error");if(qe&&qe.color===oe.default.TreeNodeColorType.red)qe.color=At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red,Fe(Lt);else if(!qe||qe.color===oe.default.TreeNodeColorType.black){if(At===Lt.leftChild){if(Oe===At.leftChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateRight();Lt===Ie&&(Ie=kt)}else if(Oe===At.rightChild){var kt=At.rotateLeft();Lt===Ie&&(Ie=kt),Fe(At)}}else if(At===Lt.rightChild){if(Oe===At.leftChild){var kt=At.rotateRight();Lt===Ie&&(Ie=kt),Fe(At)}else if(Oe===At.rightChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateLeft();Lt===Ie&&(Ie=kt)}}}}};this.insert=function(Oe){if(Oe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(this.empty()){++le,Ie.key=Oe,Ie.color=oe.default.TreeNodeColorType.black;return}var At=ze(Ie,Oe);At.key!==void 0&&ie(At.key,Oe)===0||(++le,At.key=Oe,Fe(At),Ie.color=oe.default.TreeNodeColorType.black)};var xe=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(At,Oe.key);return qe<0?xe(Oe.leftChild,At):qe>0?xe(Oe.rightChild,At):Oe}};this.find=function(Oe){var At=xe(Ie,Oe);return At!==void 0&&At.key!==void 0&&ie(At.key,Oe)===0};var _e=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe===0)return Oe.key;if(qe<0)return _e(Oe.rightChild,At);var Lt=_e(Oe.leftChild,At);return Lt!==void 0?Lt:Oe.key}};this.lowerBound=function(Oe){return _e(Ie,Oe)};var Dt=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe<=0)return Dt(Oe.rightChild,At);var Lt=Dt(Oe.leftChild,At);return Lt!==void 0?Lt:Oe.key}};this.upperBound=function(Oe){return Dt(Ie,Oe)};var $e=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe===0)return Oe.key;if(qe>0)return $e(Oe.leftChild,At);var Lt=$e(Oe.rightChild,At);return Lt!==void 0?Lt:Oe.key}};this.reverseLowerBound=function(Oe){return $e(Ie,Oe)};var Ue=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe>=0)return Ue(Oe.leftChild,At);var Lt=Ue(Oe.rightChild,At);return Lt!==void 0?Lt:Oe.key}};this.reverseUpperBound=function(Oe){return Ue(Ie,Oe)},this.union=function(Oe){var At=this;Oe.forEach(function(qe){return At.insert(qe)})},this.getHeight=function(){if(this.empty())return 0;var Oe=function(At){return At?Math.max(Oe(At.leftChild),Oe(At.rightChild))+1:1};return Oe(Ie)};var Ve=function(Oe){return V(this,function(At){switch(At.label){case 0:return!Oe||Oe.key===void 0?[2]:[5,$(Ve(Oe.leftChild))];case 1:return At.sent(),[4,Oe.key];case 2:return At.sent(),[5,$(Ve(Oe.rightChild))];case 3:return At.sent(),[2]}})};this[Symbol.iterator]=function(){return Ve(Ie)},Ce.forEach(function(Oe){return ae.insert(Oe)}),Object.freeze(this)}Object.freeze(re),k.default=re},{"../Base/TreeNode":25}],34:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});function V($){var oe=this;$===void 0&&($=[]);var re=0,Ce=[];this.size=function(){return re},this.empty=function(){return re===0},this.clear=function(){re=0,Ce.length=0},this.push=function(ie){Ce.push(ie),++re},this.pop=function(){Ce.pop(),re>0&&--re},this.top=function(){return Ce[re-1]},$.forEach(function(ie){return oe.push(ie)}),Object.freeze(this)}Object.freeze(V),k.default=V},{}],35:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__read||function(ie,ae){var le=typeof Symbol=="function"&&ie[Symbol.iterator];if(!le)return ie;var Ie=le.call(ie),ue,de=[],Ne;try{for(;(ae===void 0||ae-- >0)&&!(ue=Ie.next()).done;)de.push(ue.value)}catch(he){Ne={error:he}}finally{try{ue&&!ue.done&&(le=Ie.return)&&le.call(Ie)}finally{if(Ne)throw Ne.error}}return de},oe=this&&this.__spreadArray||function(ie,ae,le){if(le||arguments.length===2)for(var Ie=0,ue=ae.length,de;Ie<ue;Ie++)(de||!(Ie in ae))&&(de||(de=Array.prototype.slice.call(ae,0,Ie)),de[Ie]=ae[Ie]);return ie.concat(de||Array.prototype.slice.call(ae))},re=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});function Ce(ie){var ae=this;ie===void 0&&(ie=[]);var le=0,Ie=[];this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.length=0},this.front=function(){if(!this.empty())return Ie[0]},this.back=function(){if(!this.empty())return Ie[le-1]},this.forEach=function(ue){Ie.forEach(ue)},this.getElementByPos=function(ue){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");return Ie[ue]},this.eraseElementByPos=function(ue){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");for(var de=ue;de<le-1;++de)Ie[de]=Ie[de+1];this.popBack()},this.eraseElementByValue=function(ue){var de=[];this.forEach(function(he){he!==ue&&de.push(he)}),de.forEach(function(he,pe){Ie[pe]=he});for(var Ne=de.length;le>Ne;)this.popBack()},this.pushBack=function(ue){Ie.push(ue),++le},this.popBack=function(){Ie.pop(),le>0&&--le},this.setElementByPos=function(ue,de){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");Ie[ue]=de},this.insert=function(ue,de,Ne){if(Ne===void 0&&(Ne=1),ue<0||ue>le)throw new Error("pos must more than 0 and less than or equal to vector's size");Ie.splice.apply(Ie,oe([ue,0],$(new Array(Ne).fill(de)),!1)),le+=Ne},this.find=function(ue){return Ie.includes(ue)},this.reverse=function(){Ie.reverse()},this.unique=function(){var ue,de=[];this.forEach(function(he,pe){(pe===0||he!==ue)&&(de.push(he),ue=he)}),de.forEach(function(he,pe){Ie[pe]=he});for(var Ne=de.length;le>Ne;)this.popBack()},this.sort=function(ue){Ie.sort(ue)},this[Symbol.iterator]=function(){return function(){return V(this,function(ue){switch(ue.label){case 0:return[5,re(Ie)];case 1:return[2,ue.sent()]}})}()},ie.forEach(function(ue){return ae.pushBack(ue)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{}],36:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0}),k.HashMap=k.HashSet=k.Map=k.Set=k.PriorityQueue=k.Deque=k.LinkList=k.Queue=k.Stack=k.Vector=void 0;var V=r("./Vector/Vector");k.Vector=V.default;var $=r("./Stack/Stack");k.Stack=$.default;var oe=r("./Queue/Queue");k.Queue=oe.default;var re=r("./LinkList/LinkList");k.LinkList=re.default;var Ce=r("./Deque/Deque");k.Deque=Ce.default;var ie=r("./PriorityQueue/PriorityQueue");k.PriorityQueue=ie.default;var ae=r("./Set/Set");k.Set=ae.default;var le=r("./Map/Map");k.Map=le.default;var Ie=r("./HashSet/HashSet");k.HashSet=Ie.default;var ue=r("./HashMap/HashMap");k.HashMap=ue.default},{"./Deque/Deque":26,"./HashMap/HashMap":27,"./HashSet/HashSet":28,"./LinkList/LinkList":29,"./Map/Map":30,"./PriorityQueue/PriorityQueue":31,"./Queue/Queue":32,"./Set/Set":33,"./Stack/Stack":34,"./Vector/Vector":35}],37:[function(r,g,k){const V=r("yallist"),$=Symbol("max"),oe=Symbol("length"),re=Symbol("lengthCalculator"),Ce=Symbol("allowStale"),ie=Symbol("maxAge"),ae=Symbol("dispose"),le=Symbol("noDisposeOnSet"),Ie=Symbol("lruList"),ue=Symbol("cache"),de=Symbol("updateAgeOnGet"),Ne=()=>1;class he{constructor(Ue){if(typeof Ue=="number"&&(Ue={max:Ue}),Ue||(Ue={}),Ue.max&&(typeof Ue.max!="number"||Ue.max<0))throw new TypeError("max must be a non-negative number");this[$]=Ue.max||1/0;const Ve=Ue.length||Ne;if(this[re]=typeof Ve!="function"?Ne:Ve,this[Ce]=Ue.stale||!1,Ue.maxAge&&typeof Ue.maxAge!="number")throw new TypeError("maxAge must be a number");this[ie]=Ue.maxAge||0,this[ae]=Ue.dispose,this[le]=Ue.noDisposeOnSet||!1,this[de]=Ue.updateAgeOnGet||!1,this.reset()}set max(Ue){if(typeof Ue!="number"||Ue<0)throw new TypeError("max must be a non-negative number");this[$]=Ue||1/0,Fe(this)}get max(){return this[$]}set allowStale(Ue){this[Ce]=!!Ue}get allowStale(){return this[Ce]}set maxAge(Ue){if(typeof Ue!="number")throw new TypeError("maxAge must be a non-negative number");this[ie]=Ue,Fe(this)}get maxAge(){return this[ie]}set lengthCalculator(Ue){typeof Ue!="function"&&(Ue=Ne),Ue!==this[re]&&(this[re]=Ue,this[oe]=0,this[Ie].forEach(Ve=>{Ve.length=this[re](Ve.value,Ve.key),this[oe]+=Ve.length})),Fe(this)}get lengthCalculator(){return this[re]}get length(){return this[oe]}get itemCount(){return this[Ie].length}rforEach(Ue,Ve){Ve=Ve||this;for(let Oe=this[Ie].tail;Oe!==null;){const At=Oe.prev;Dt(this,Ue,Oe,Ve),Oe=At}}forEach(Ue,Ve){Ve=Ve||this;for(let Oe=this[Ie].head;Oe!==null;){const At=Oe.next;Dt(this,Ue,Oe,Ve),Oe=At}}keys(){return this[Ie].toArray().map(Ue=>Ue.key)}values(){return this[Ie].toArray().map(Ue=>Ue.value)}reset(){this[ae]&&this[Ie]&&this[Ie].length&&this[Ie].forEach(Ue=>this[ae](Ue.key,Ue.value)),this[ue]=new Map,this[Ie]=new V,this[oe]=0}dump(){return this[Ie].map(Ue=>ze(this,Ue)?!1:{k:Ue.key,v:Ue.value,e:Ue.now+(Ue.maxAge||0)}).toArray().filter(Ue=>Ue)}dumpLru(){return this[Ie]}set(Ue,Ve,Oe){if(Oe=Oe||this[ie],Oe&&typeof Oe!="number")throw new TypeError("maxAge must be a number");const At=Oe?Date.now():0,qe=this[re](Ve,Ue);if(this[ue].has(Ue)){if(qe>this[$])return xe(this,this[ue].get(Ue)),!1;const jt=this[ue].get(Ue).value;return this[ae]&&(this[le]||this[ae](Ue,jt.value)),jt.now=At,jt.maxAge=Oe,jt.value=Ve,this[oe]+=qe-jt.length,jt.length=qe,this.get(Ue),Fe(this),!0}const Lt=new _e(Ue,Ve,qe,At,Oe);return Lt.length>this[$]?(this[ae]&&this[ae](Ue,Ve),!1):(this[oe]+=Lt.length,this[Ie].unshift(Lt),this[ue].set(Ue,this[Ie].head),Fe(this),!0)}has(Ue){if(!this[ue].has(Ue))return!1;const Ve=this[ue].get(Ue).value;return!ze(this,Ve)}get(Ue){return pe(this,Ue,!0)}peek(Ue){return pe(this,Ue,!1)}pop(){const Ue=this[Ie].tail;return Ue?(xe(this,Ue),Ue.value):null}del(Ue){xe(this,this[ue].get(Ue))}load(Ue){this.reset();const Ve=Date.now();for(let Oe=Ue.length-1;Oe>=0;Oe--){const At=Ue[Oe],qe=At.e||0;if(qe===0)this.set(At.k,At.v);else{const Lt=qe-Ve;Lt>0&&this.set(At.k,At.v,Lt)}}}prune(){this[ue].forEach((Ue,Ve)=>pe(this,Ve,!1))}}const pe=($e,Ue,Ve)=>{const Oe=$e[ue].get(Ue);if(Oe){const At=Oe.value;if(ze($e,At)){if(xe($e,Oe),!$e[Ce])return}else Ve&&($e[de]&&(Oe.value.now=Date.now()),$e[Ie].unshiftNode(Oe));return At.value}},ze=($e,Ue)=>{if(!Ue||!Ue.maxAge&&!$e[ie])return!1;const Ve=Date.now()-Ue.now;return Ue.maxAge?Ve>Ue.maxAge:$e[ie]&&Ve>$e[ie]},Fe=$e=>{if($e[oe]>$e[$])for(let Ue=$e[Ie].tail;$e[oe]>$e[$]&&Ue!==null;){const Ve=Ue.prev;xe($e,Ue),Ue=Ve}},xe=($e,Ue)=>{if(Ue){const Ve=Ue.value;$e[ae]&&$e[ae](Ve.key,Ve.value),$e[oe]-=Ve.length,$e[ue].delete(Ve.key),$e[Ie].removeNode(Ue)}};class _e{constructor(Ue,Ve,Oe,At,qe){this.key=Ue,this.value=Ve,this.length=Oe,this.now=At,this.maxAge=qe||0}}const Dt=($e,Ue,Ve,Oe)=>{let At=Ve.value;ze($e,At)&&(xe($e,Ve),$e[Ce]||(At=void 0)),At&&Ue.call(Oe,At.value,At.key,$e)};g.exports=he},{yallist:83}],38:[function(r,g,k){(function(V){(function(){const $=g.exports;$.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},$.codes={};for(const re in $.types){const Ce=$.types[re];$.codes[Ce]=re}$.CMD_SHIFT=4,$.CMD_MASK=240,$.DUP_MASK=8,$.QOS_MASK=3,$.QOS_SHIFT=1,$.RETAIN_MASK=1,$.VARBYTEINT_MASK=127,$.VARBYTEINT_FIN_MASK=128,$.VARBYTEINT_MAX=268435455,$.SESSIONPRESENT_MASK=1,$.SESSIONPRESENT_HEADER=V.from([$.SESSIONPRESENT_MASK]),$.CONNACK_HEADER=V.from([$.codes.connack<<$.CMD_SHIFT]),$.USERNAME_MASK=128,$.PASSWORD_MASK=64,$.WILL_RETAIN_MASK=32,$.WILL_QOS_MASK=24,$.WILL_QOS_SHIFT=3,$.WILL_FLAG_MASK=4,$.CLEAN_SESSION_MASK=2,$.CONNECT_HEADER=V.from([$.codes.connect<<$.CMD_SHIFT]),$.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},$.propertiesCodes={};for(const re in $.properties){const Ce=$.properties[re];$.propertiesCodes[Ce]=re}$.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function oe(re){return[0,1,2].map(Ce=>[0,1].map(ie=>[0,1].map(ae=>{const le=V.alloc(1);return le.writeUInt8($.codes[re]<<$.CMD_SHIFT|(ie?$.DUP_MASK:0)|Ce<<$.QOS_SHIFT|ae,0,!0),le})))}$.PUBLISH_HEADER=oe("publish"),$.SUBSCRIBE_HEADER=oe("subscribe"),$.SUBSCRIBE_OPTIONS_QOS_MASK=3,$.SUBSCRIBE_OPTIONS_NL_MASK=1,$.SUBSCRIBE_OPTIONS_NL_SHIFT=2,$.SUBSCRIBE_OPTIONS_RAP_MASK=1,$.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,$.SUBSCRIBE_OPTIONS_RH_MASK=3,$.SUBSCRIBE_OPTIONS_RH_SHIFT=4,$.SUBSCRIBE_OPTIONS_RH=[0,16,32],$.SUBSCRIBE_OPTIONS_NL=4,$.SUBSCRIBE_OPTIONS_RAP=8,$.SUBSCRIBE_OPTIONS_QOS=[0,1,2],$.UNSUBSCRIBE_HEADER=oe("unsubscribe"),$.ACKS={unsuback:oe("unsuback"),puback:oe("puback"),pubcomp:oe("pubcomp"),pubrel:oe("pubrel"),pubrec:oe("pubrec")},$.SUBACK_HEADER=V.from([$.codes.suback<<$.CMD_SHIFT]),$.VERSION3=V.from([3]),$.VERSION4=V.from([4]),$.VERSION5=V.from([5]),$.VERSION131=V.from([131]),$.VERSION132=V.from([132]),$.QOS=[0,1,2].map(re=>V.from([re])),$.EMPTY={pingreq:V.from([$.codes.pingreq<<4,0]),pingresp:V.from([$.codes.pingresp<<4,0]),disconnect:V.from([$.codes.disconnect<<4,0])}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],39:[function(r,g,k){(function(V){(function(){const $=r("./writeToStream"),oe=r("events");function re(ie,ae){const le=new Ce;return $(ie,le,ae),le.concat()}class Ce extends oe{constructor(){super(),this._array=new Array(20),this._i=0}write(ae){return this._array[this._i++]=ae,!0}concat(){let ae=0;const le=new Array(this._array.length),Ie=this._array;let ue=0,de;for(de=0;de<Ie.length&&Ie[de]!==void 0;de++)typeof Ie[de]!="string"?le[de]=Ie[de].length:le[de]=V.byteLength(Ie[de]),ae+=le[de];const Ne=V.allocUnsafe(ae);for(de=0;de<Ie.length&&Ie[de]!==void 0;de++)typeof Ie[de]!="string"?(Ie[de].copy(Ne,ue),ue+=le[de]):(Ne.write(Ie[de],ue),ue+=le[de]);return Ne}}g.exports=re}).call(this)}).call(this,r("buffer").Buffer)},{"./writeToStream":44,buffer:17,events:22}],40:[function(r,g,k){k.parser=r("./parser").parser,k.generate=r("./generate"),k.writeToStream=r("./writeToStream")},{"./generate":39,"./parser":43,"./writeToStream":44}],41:[function(r,g,k){(function(V){(function(){const oe={},re=V.isBuffer(V.from([1,2]).subarray(0,1));function Ce(Ie){const ue=V.allocUnsafe(2);return ue.writeUInt8(Ie>>8,0),ue.writeUInt8(Ie&255,0+1),ue}function ie(){for(let Ie=0;Ie<65536;Ie++)oe[Ie]=Ce(Ie)}function ae(Ie){let de=0,Ne=0;const he=V.allocUnsafe(4);do de=Ie%128|0,Ie=Ie/128|0,Ie>0&&(de=de|128),he.writeUInt8(de,Ne++);while(Ie>0&&Ne<4);return Ie>0&&(Ne=0),re?he.subarray(0,Ne):he.slice(0,Ne)}function le(Ie){const ue=V.allocUnsafe(4);return ue.writeUInt32BE(Ie,0),ue}g.exports={cache:oe,generateCache:ie,generateNumber:Ce,genBufVariableByteInt:ae,generate4ByteBuffer:le}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],42:[function(r,g,k){class V{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}g.exports=V},{}],43:[function(r,g,k){const V=r("bl"),$=r("events"),oe=r("./packet"),re=r("./constants"),Ce=r("debug")("mqtt-packet:parser");class ie extends ${constructor(){super(),this.parser=this.constructor.parser}static parser(le){return this instanceof ie?(this.settings=le||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new ie().parser(le)}_resetState(){Ce("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new oe,this.error=null,this._list=V(),this._stateCounter=0}parse(le){for(this.error&&this._resetState(),this._list.append(le),Ce("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,Ce("parse: state complete. _stateCounter is now: %d",this._stateCounter),Ce("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return Ce("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const le=this._list.readUInt8(0);return this.packet.cmd=re.types[le>>re.CMD_SHIFT],this.packet.retain=(le&re.RETAIN_MASK)!==0,this.packet.qos=le>>re.QOS_SHIFT&re.QOS_MASK,this.packet.dup=(le&re.DUP_MASK)!==0,Ce("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){const le=this._parseVarByteNum(!0);return le&&(this.packet.length=le.value,this._list.consume(le.bytes)),Ce("_parseLength %d",le.value),!!le}_parsePayload(){Ce("_parsePayload: payload %O",this._list);let le=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}le=!0}return Ce("_parsePayload complete result: %s",le),le}_parseConnect(){Ce("_parseConnect");let le,Ie,ue,de;const Ne={},he=this.packet,pe=this._parseString();if(pe===null)return this._emitError(new Error("Cannot parse protocolId"));if(pe!=="MQTT"&&pe!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(he.protocolId=pe,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(he.protocolVersion=this._list.readUInt8(this._pos),he.protocolVersion>=128&&(he.bridgeMode=!0,he.protocolVersion=he.protocolVersion-128),he.protocolVersion!==3&&he.protocolVersion!==4&&he.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(Ne.username=this._list.readUInt8(this._pos)&re.USERNAME_MASK,Ne.password=this._list.readUInt8(this._pos)&re.PASSWORD_MASK,Ne.will=this._list.readUInt8(this._pos)&re.WILL_FLAG_MASK,Ne.will&&(he.will={},he.will.retain=(this._list.readUInt8(this._pos)&re.WILL_RETAIN_MASK)!==0,he.will.qos=(this._list.readUInt8(this._pos)&re.WILL_QOS_MASK)>>re.WILL_QOS_SHIFT),he.clean=(this._list.readUInt8(this._pos)&re.CLEAN_SESSION_MASK)!==0,this._pos++,he.keepalive=this._parseNum(),he.keepalive===-1)return this._emitError(new Error("Packet too short"));if(he.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(he.properties=Fe)}const ze=this._parseString();if(ze===null)return this._emitError(new Error("Packet too short"));if(he.clientId=ze,Ce("_parseConnect: packet.clientId: %s",he.clientId),Ne.will){if(he.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(he.will.properties=Fe)}if(le=this._parseString(),le===null)return this._emitError(new Error("Cannot parse will topic"));if(he.will.topic=le,Ce("_parseConnect: packet.will.topic: %s",he.will.topic),Ie=this._parseBuffer(),Ie===null)return this._emitError(new Error("Cannot parse will payload"));he.will.payload=Ie,Ce("_parseConnect: packet.will.paylaod: %s",he.will.payload)}if(Ne.username){if(de=this._parseString(),de===null)return this._emitError(new Error("Cannot parse username"));he.username=de,Ce("_parseConnect: packet.username: %s",he.username)}if(Ne.password){if(ue=this._parseBuffer(),ue===null)return this._emitError(new Error("Cannot parse password"));he.password=ue}return this.settings=he,Ce("_parseConnect: complete"),he}_parseConnack(){Ce("_parseConnack");const le=this.packet;if(this._list.length<1)return null;if(le.sessionPresent=!!(this._list.readUInt8(this._pos++)&re.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?le.reasonCode=this._list.readUInt8(this._pos++):le.reasonCode=0;else{if(this._list.length<2)return null;le.returnCode=this._list.readUInt8(this._pos++)}if(le.returnCode===-1||le.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}Ce("_parseConnack: complete")}_parsePublish(){Ce("_parsePublish");const le=this.packet;if(le.topic=this._parseString(),le.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(le.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}le.payload=this._list.slice(this._pos,le.length),Ce("_parsePublish: payload from buffer list: %o",le.payload)}}_parseSubscribe(){Ce("_parseSubscribe");const le=this.packet;let Ie,ue,de,Ne,he,pe,ze;if(le.qos!==1)return this._emitError(new Error("Wrong subscribe header"));if(le.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(le.properties=Fe)}for(;this._pos<le.length;){if(Ie=this._parseString(),Ie===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=le.length)return this._emitError(new Error("Malformed Subscribe Payload"));ue=this._parseByte(),de=ue&re.SUBSCRIBE_OPTIONS_QOS_MASK,pe=(ue>>re.SUBSCRIBE_OPTIONS_NL_SHIFT&re.SUBSCRIBE_OPTIONS_NL_MASK)!==0,he=(ue>>re.SUBSCRIBE_OPTIONS_RAP_SHIFT&re.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,Ne=ue>>re.SUBSCRIBE_OPTIONS_RH_SHIFT&re.SUBSCRIBE_OPTIONS_RH_MASK,ze={topic:Ie,qos:de},this.settings.protocolVersion===5?(ze.nl=pe,ze.rap=he,ze.rh=Ne):this.settings.bridgeMode&&(ze.rh=0,ze.rap=!0,ze.nl=!0),Ce("_parseSubscribe: push subscription `%s` to subscription",ze),le.subscriptions.push(ze)}}}_parseSuback(){Ce("_parseSuback");const le=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseUnsubscribe(){Ce("_parseUnsubscribe");const le=this.packet;if(le.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}for(;this._pos<le.length;){const Ie=this._parseString();if(Ie===null)return this._emitError(new Error("Cannot parse topic"));Ce("_parseUnsubscribe: push topic `%s` to unsubscriptions",Ie),le.unsubscriptions.push(Ie)}}}_parseUnsuback(){Ce("_parseUnsuback");const le=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(this.settings.protocolVersion===5){const Ie=this._parseProperties();for(Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie),le.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseConfirmation(){Ce("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const le=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5&&(le.length>2?(le.reasonCode=this._parseByte(),Ce("_parseConfirmation: packet.reasonCode `%d`",le.reasonCode)):le.reasonCode=0,le.length>3)){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}return!0}_parseDisconnect(){const le=this.packet;if(Ce("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?le.reasonCode=this._parseByte():le.reasonCode=0;const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}return Ce("_parseDisconnect result: true"),!0}_parseAuth(){Ce("_parseAuth");const le=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));le.reasonCode=this._parseByte();const Ie=this._parseProperties();return Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie),Ce("_parseAuth: result: true"),!0}_parseMessageId(){const le=this.packet;return le.messageId=this._parseNum(),le.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(Ce("_parseMessageId: packet.messageId %d",le.messageId),!0)}_parseString(le){const Ie=this._parseNum(),ue=Ie+this._pos;if(Ie===-1||ue>this._list.length||ue>this.packet.length)return null;const de=this._list.toString("utf8",this._pos,ue);return this._pos+=Ie,Ce("_parseString: result: %s",de),de}_parseStringPair(){return Ce("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const le=this._parseNum(),Ie=le+this._pos;if(le===-1||Ie>this._list.length||Ie>this.packet.length)return null;const ue=this._list.slice(this._pos,Ie);return this._pos+=le,Ce("_parseBuffer: result: %o",ue),ue}_parseNum(){if(this._list.length-this._pos<2)return-1;const le=this._list.readUInt16BE(this._pos);return this._pos+=2,Ce("_parseNum: result: %s",le),le}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const le=this._list.readUInt32BE(this._pos);return this._pos+=4,Ce("_parse4ByteNum: result: %s",le),le}_parseVarByteNum(le){Ce("_parseVarByteNum");const Ie=4;let ue=0,de=1,Ne=0,he=!1,pe;const ze=this._pos?this._pos:0;for(;ue<Ie&&ze+ue<this._list.length;){if(pe=this._list.readUInt8(ze+ue++),Ne+=de*(pe&re.VARBYTEINT_MASK),de*=128,!(pe&re.VARBYTEINT_FIN_MASK)){he=!0;break}if(this._list.length<=ue)break}return!he&&ue===Ie&&this._list.length>=ue&&this._emitError(new Error("Invalid variable byte integer")),ze&&(this._pos+=ue),he=he?le?{bytes:ue,value:Ne}:Ne:!1,Ce("_parseVarByteNum: result: %o",he),he}_parseByte(){let le;return this._pos<this._list.length&&(le=this._list.readUInt8(this._pos),this._pos++),Ce("_parseByte: result: %o",le),le}_parseByType(le){switch(Ce("_parseByType: type: %s",le),le){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){Ce("_parseProperties");const le=this._parseVarByteNum(),ue=this._pos+le,de={};for(;this._pos<ue;){const Ne=this._parseByte();if(!Ne)return this._emitError(new Error("Cannot parse property code type")),!1;const he=re.propertiesCodes[Ne];if(!he)return this._emitError(new Error("Unknown property")),!1;if(he==="userProperties"){de[he]||(de[he]=Object.create(null));const pe=this._parseByType(re.propertiesTypes[he]);if(de[he][pe.name])if(Array.isArray(de[he][pe.name]))de[he][pe.name].push(pe.value);else{const ze=de[he][pe.name];de[he][pe.name]=[ze],de[he][pe.name].push(pe.value)}else de[he][pe.name]=pe.value;continue}de[he]?Array.isArray(de[he])?de[he].push(this._parseByType(re.propertiesTypes[he])):(de[he]=[de[he]],de[he].push(this._parseByType(re.propertiesTypes[he]))):de[he]=this._parseByType(re.propertiesTypes[he])}return de}_newPacket(){return Ce("_newPacket"),this.packet&&(this._list.consume(this.packet.length),Ce("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),Ce("_newPacket: new packet"),this.packet=new oe,this._pos=0,!0}_emitError(le){Ce("_emitError"),this.error=le,this.emit("error",le)}}g.exports=ie},{"./constants":38,"./packet":42,bl:15,debug:18,events:22}],44:[function(r,g,k){(function(V){(function(){const $=r("./constants"),oe=V.allocUnsafe(0),re=V.from([0]),Ce=r("./numbers"),ie=r("process-nextick-args").nextTick,ae=r("debug")("mqtt-packet:writeToStream"),le=Ce.cache,Ie=Ce.generateNumber,ue=Ce.generateCache,de=Ce.genBufVariableByteInt,Ne=Ce.generate4ByteBuffer;let he=ni,pe=!0;function ze(wi,Ci,mi){switch(ae("generate called"),Ci.cork&&(Ci.cork(),ie(Fe,Ci)),pe&&(pe=!1,ue()),ae("generate: packet.cmd: %s",wi.cmd),wi.cmd){case"connect":return xe(wi,Ci);case"connack":return _e(wi,Ci,mi);case"publish":return Dt(wi,Ci,mi);case"puback":case"pubrec":case"pubrel":case"pubcomp":return $e(wi,Ci,mi);case"subscribe":return Ue(wi,Ci,mi);case"suback":return Ve(wi,Ci,mi);case"unsubscribe":return Oe(wi,Ci,mi);case"unsuback":return At(wi,Ci,mi);case"pingreq":case"pingresp":return qe(wi,Ci);case"disconnect":return Lt(wi,Ci,mi);case"auth":return kt(wi,Ci,mi);default:return Ci.emit("error",new Error("Unknown command")),!1}}Object.defineProperty(ze,"cacheNumbers",{get(){return he===ni},set(wi){wi?((!le||Object.keys(le).length===0)&&(pe=!0),he=ni):(pe=!1,he=gi)}});function Fe(wi){wi.uncork()}function xe(wi,Ci,mi){const Ni=wi||{},Mi=Ni.protocolId||"MQTT";let fi=Ni.protocolVersion||4;const zi=Ni.will;let Si=Ni.clean;const si=Ni.keepalive||0,Ii=Ni.clientId||"",oi=Ni.username,Et=Ni.password,ii=Ni.properties;Si===void 0&&(Si=!0);let ri=0;if(!Mi||typeof Mi!="string"&&!V.isBuffer(Mi))return Ci.emit("error",new Error("Invalid protocolId")),!1;if(ri+=Mi.length+2,fi!==3&&fi!==4&&fi!==5)return Ci.emit("error",new Error("Invalid protocol version")),!1;if(ri+=1,(typeof Ii=="string"||V.isBuffer(Ii))&&(Ii||fi>=4)&&(Ii||Si))ri+=V.byteLength(Ii)+2;else{if(fi<4)return Ci.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(Si*1===0)return Ci.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof si!="number"||si<0||si>65535||si%1!==0)return Ci.emit("error",new Error("Invalid keepalive")),!1;if(ri+=2,ri+=1,fi===5){var ui=ai(Ci,ii);if(!ui)return!1;ri+=ui.length}if(zi){if(typeof zi!="object")return Ci.emit("error",new Error("Invalid will")),!1;if(!zi.topic||typeof zi.topic!="string")return Ci.emit("error",new Error("Invalid will topic")),!1;if(ri+=V.byteLength(zi.topic)+2,ri+=2,zi.payload)if(zi.payload.length>=0)typeof zi.payload=="string"?ri+=V.byteLength(zi.payload):ri+=zi.payload.length;else return Ci.emit("error",new Error("Invalid will payload")),!1;var vi={};if(fi===5){if(vi=ai(Ci,zi.properties),!vi)return!1;ri+=vi.length}}let bi=!1;if(oi!=null)if(hi(oi))bi=!0,ri+=V.byteLength(oi)+2;else return Ci.emit("error",new Error("Invalid username")),!1;if(Et!=null){if(!bi)return Ci.emit("error",new Error("Username is required to use password")),!1;if(hi(Et))ri+=Ai(Et)+2;else return Ci.emit("error",new Error("Invalid password")),!1}Ci.write($.CONNECT_HEADER),ti(Ci,ri),li(Ci,Mi),Ni.bridgeMode&&(fi+=128),Ci.write(fi===131?$.VERSION131:fi===132?$.VERSION132:fi===4?$.VERSION4:fi===5?$.VERSION5:$.VERSION3);let Zi=0;return Zi|=oi!=null?$.USERNAME_MASK:0,Zi|=Et!=null?$.PASSWORD_MASK:0,Zi|=zi&&zi.retain?$.WILL_RETAIN_MASK:0,Zi|=zi&&zi.qos?zi.qos<<$.WILL_QOS_SHIFT:0,Zi|=zi?$.WILL_FLAG_MASK:0,Zi|=Si?$.CLEAN_SESSION_MASK:0,Ci.write(V.from([Zi])),he(Ci,si),fi===5&&ui.write(),li(Ci,Ii),zi&&(fi===5&&vi.write(),ei(Ci,zi.topic),li(Ci,zi.payload)),oi!=null&&li(Ci,oi),Et!=null&&li(Ci,Et),!0}function _e(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Ni===5?Mi.reasonCode:Mi.returnCode,zi=Mi.properties;let Si=2;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid return code")),!1;let si=null;if(Ni===5){if(si=ai(Ci,zi),!si)return!1;Si+=si.length}return Ci.write($.CONNACK_HEADER),ti(Ci,Si),Ci.write(Mi.sessionPresent?$.SESSIONPRESENT_HEADER:re),Ci.write(V.from([fi])),si!=null&&si.write(),!0}function Dt(wi,Ci,mi){ae("publish: packet: %o",wi);const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.qos||0,zi=Mi.retain?$.RETAIN_MASK:0,Si=Mi.topic,si=Mi.payload||oe,Ii=Mi.messageId,oi=Mi.properties;let Et=0;if(typeof Si=="string")Et+=V.byteLength(Si)+2;else if(V.isBuffer(Si))Et+=Si.length+2;else return Ci.emit("error",new Error("Invalid topic")),!1;if(V.isBuffer(si)?Et+=si.length:Et+=V.byteLength(si),fi&&typeof Ii!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;fi&&(Et+=2);let ii=null;if(Ni===5){if(ii=ai(Ci,oi),!ii)return!1;Et+=ii.length}return Ci.write($.PUBLISH_HEADER[fi][Mi.dup?1:0][zi?1:0]),ti(Ci,Et),he(Ci,Ai(Si)),Ci.write(Si),fi>0&&he(Ci,Ii),ii!=null&&ii.write(),ae("publish: payload: %o",si),Ci.write(si)}function $e(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.cmd||"puback",zi=Mi.messageId,Si=Mi.dup&&fi==="pubrel"?$.DUP_MASK:0;let si=0;const Ii=Mi.reasonCode,oi=Mi.properties;let Et=Ni===5?3:2;if(fi==="pubrel"&&(si=1),typeof zi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;let ii=null;if(Ni===5&&typeof oi=="object"){if(ii=ci(Ci,oi,mi,Et),!ii)return!1;Et+=ii.length}return Ci.write($.ACKS[fi][si][Si][0]),ti(Ci,Et),he(Ci,zi),Ni===5&&Ci.write(V.from([Ii])),ii!==null&&ii.write(),!0}function Ue(wi,Ci,mi){ae("subscribe: packet: ");const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.dup?$.DUP_MASK:0,zi=Mi.messageId,Si=Mi.subscriptions,si=Mi.properties;let Ii=0;if(typeof zi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;Ii+=2;let oi=null;if(Ni===5){if(oi=ai(Ci,si),!oi)return!1;Ii+=oi.length}if(typeof Si=="object"&&Si.length)for(let ii=0;ii<Si.length;ii+=1){const ri=Si[ii].topic,ui=Si[ii].qos;if(typeof ri!="string")return Ci.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if(typeof ui!="number")return Ci.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(Ni===5){if(typeof(Si[ii].nl||!1)!="boolean")return Ci.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(Si[ii].rap||!1)!="boolean")return Ci.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;const Zi=Si[ii].rh||0;if(typeof Zi!="number"||Zi>2)return Ci.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}Ii+=V.byteLength(ri)+2+1}else return Ci.emit("error",new Error("Invalid subscriptions")),!1;ae("subscribe: writing to stream: %o",$.SUBSCRIBE_HEADER),Ci.write($.SUBSCRIBE_HEADER[1][fi?1:0][0]),ti(Ci,Ii),he(Ci,zi),oi!==null&&oi.write();let Et=!0;for(const ii of Si){const ri=ii.topic,ui=ii.qos,vi=+ii.nl,bi=+ii.rap,Zi=ii.rh;let Gi;ei(Ci,ri),Gi=$.SUBSCRIBE_OPTIONS_QOS[ui],Ni===5&&(Gi|=vi?$.SUBSCRIBE_OPTIONS_NL:0,Gi|=bi?$.SUBSCRIBE_OPTIONS_RAP:0,Gi|=Zi?$.SUBSCRIBE_OPTIONS_RH[Zi]:0),Et=Ci.write(V.from([Gi]))}return Et}function Ve(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.granted,Si=Mi.properties;let si=0;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(si+=2,typeof zi=="object"&&zi.length)for(let oi=0;oi<zi.length;oi+=1){if(typeof zi[oi]!="number")return Ci.emit("error",new Error("Invalid qos vector")),!1;si+=1}else return Ci.emit("error",new Error("Invalid qos vector")),!1;let Ii=null;if(Ni===5){if(Ii=ci(Ci,Si,mi,si),!Ii)return!1;si+=Ii.length}return Ci.write($.SUBACK_HEADER),ti(Ci,si),he(Ci,fi),Ii!==null&&Ii.write(),Ci.write(V.from(zi))}function Oe(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.dup?$.DUP_MASK:0,Si=Mi.unsubscriptions,si=Mi.properties;let Ii=0;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(Ii+=2,typeof Si=="object"&&Si.length)for(let ii=0;ii<Si.length;ii+=1){if(typeof Si[ii]!="string")return Ci.emit("error",new Error("Invalid unsubscriptions")),!1;Ii+=V.byteLength(Si[ii])+2}else return Ci.emit("error",new Error("Invalid unsubscriptions")),!1;let oi=null;if(Ni===5){if(oi=ai(Ci,si),!oi)return!1;Ii+=oi.length}Ci.write($.UNSUBSCRIBE_HEADER[1][zi?1:0][0]),ti(Ci,Ii),he(Ci,fi),oi!==null&&oi.write();let Et=!0;for(let ii=0;ii<Si.length;ii++)Et=ei(Ci,Si[ii]);return Et}function At(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.dup?$.DUP_MASK:0,Si=Mi.granted,si=Mi.properties,Ii=Mi.cmd,oi=0;let Et=2;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(Ni===5)if(typeof Si=="object"&&Si.length)for(let ri=0;ri<Si.length;ri+=1){if(typeof Si[ri]!="number")return Ci.emit("error",new Error("Invalid qos vector")),!1;Et+=1}else return Ci.emit("error",new Error("Invalid qos vector")),!1;let ii=null;if(Ni===5){if(ii=ci(Ci,si,mi,Et),!ii)return!1;Et+=ii.length}return Ci.write($.ACKS[Ii][oi][zi][0]),ti(Ci,Et),he(Ci,fi),ii!==null&&ii.write(),Ni===5&&Ci.write(V.from(Si)),!0}function qe(wi,Ci,mi){return Ci.write($.EMPTY[wi.cmd])}function Lt(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.reasonCode,zi=Mi.properties;let Si=Ni===5?1:0,si=null;if(Ni===5){if(si=ci(Ci,zi,mi,Si),!si)return!1;Si+=si.length}return Ci.write(V.from([$.codes.disconnect<<4])),ti(Ci,Si),Ni===5&&Ci.write(V.from([fi])),si!==null&&si.write(),!0}function kt(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.reasonCode,zi=Mi.properties;let Si=Ni===5?1:0;Ni!==5&&Ci.emit("error",new Error("Invalid mqtt version for auth packet"));const si=ci(Ci,zi,mi,Si);return si?(Si+=si.length,Ci.write(V.from([$.codes.auth<<4])),ti(Ci,Si),Ci.write(V.from([fi])),si!==null&&si.write(),!0):!1}const jt={};function ti(wi,Ci){if(Ci>$.VARBYTEINT_MAX)return wi.emit("error",new Error(`Invalid variable byte integer: ${Ci}`)),!1;let mi=jt[Ci];return mi||(mi=de(Ci),Ci<16384&&(jt[Ci]=mi)),ae("writeVarByteInt: writing to stream: %o",mi),wi.write(mi)}function ei(wi,Ci){const mi=V.byteLength(Ci);return he(wi,mi),ae("writeString: %s",Ci),wi.write(Ci,"utf8")}function Pt(wi,Ci,mi){ei(wi,Ci),ei(wi,mi)}function ni(wi,Ci){return ae("writeNumberCached: number: %d",Ci),ae("writeNumberCached: %o",le[Ci]),wi.write(le[Ci])}function gi(wi,Ci){const mi=Ie(Ci);return ae("writeNumberGenerated: %o",mi),wi.write(mi)}function di(wi,Ci){const mi=Ne(Ci);return ae("write4ByteNumber: %o",mi),wi.write(mi)}function li(wi,Ci){typeof Ci=="string"?ei(wi,Ci):Ci?(he(wi,Ci.length),wi.write(Ci)):he(wi,0)}function ai(wi,Ci){if(typeof Ci!="object"||Ci.length!=null)return{length:1,write(){yi(wi,{},0)}};let mi=0;function Ni(fi,zi){const Si=$.propertiesTypes[fi];let si=0;switch(Si){case"byte":{if(typeof zi!="boolean")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+1;break}case"int8":{if(typeof zi!="number"||zi<0||zi>255)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+1;break}case"binary":{if(zi&&zi===null)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+V.byteLength(zi)+2;break}case"int16":{if(typeof zi!="number"||zi<0||zi>65535)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+2;break}case"int32":{if(typeof zi!="number"||zi<0||zi>4294967295)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+4;break}case"var":{if(typeof zi!="number"||zi<0||zi>268435455)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+V.byteLength(de(zi));break}case"string":{if(typeof zi!="string")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+2+V.byteLength(zi.toString());break}case"pair":{if(typeof zi!="object")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=Object.getOwnPropertyNames(zi).reduce((Ii,oi)=>{const Et=zi[oi];return Array.isArray(Et)?Ii+=Et.reduce((ii,ri)=>(ii+=1+2+V.byteLength(oi.toString())+2+V.byteLength(ri.toString()),ii),0):Ii+=1+2+V.byteLength(oi.toString())+2+V.byteLength(zi[oi].toString()),Ii},0);break}default:return wi.emit("error",new Error(`Invalid property ${fi}: ${zi}`)),!1}return si}if(Ci)for(const fi in Ci){let zi=0,Si=0;const si=Ci[fi];if(Array.isArray(si))for(let Ii=0;Ii<si.length;Ii++){if(Si=Ni(fi,si[Ii]),!Si)return!1;zi+=Si}else{if(Si=Ni(fi,si),!Si)return!1;zi=Si}if(!zi)return!1;mi+=zi}return{length:V.byteLength(de(mi))+mi,write(){yi(wi,Ci,mi)}}}function ci(wi,Ci,mi,Ni){const Mi=["reasonString","userProperties"],fi=mi&&mi.properties&&mi.properties.maximumPacketSize?mi.properties.maximumPacketSize:0;let zi=ai(wi,Ci);if(fi)for(;Ni+zi.length>fi;){const Si=Mi.shift();if(Si&&Ci[Si])delete Ci[Si],zi=ai(wi,Ci);else return!1}return zi}function pi(wi,Ci,mi){switch($.propertiesTypes[Ci]){case"byte":{wi.write(V.from([$.properties[Ci]])),wi.write(V.from([+mi]));break}case"int8":{wi.write(V.from([$.properties[Ci]])),wi.write(V.from([mi]));break}case"binary":{wi.write(V.from([$.properties[Ci]])),li(wi,mi);break}case"int16":{wi.write(V.from([$.properties[Ci]])),he(wi,mi);break}case"int32":{wi.write(V.from([$.properties[Ci]])),di(wi,mi);break}case"var":{wi.write(V.from([$.properties[Ci]])),ti(wi,mi);break}case"string":{wi.write(V.from([$.properties[Ci]])),ei(wi,mi);break}case"pair":{Object.getOwnPropertyNames(mi).forEach(Mi=>{const fi=mi[Mi];Array.isArray(fi)?fi.forEach(zi=>{wi.write(V.from([$.properties[Ci]])),Pt(wi,Mi.toString(),zi.toString())}):(wi.write(V.from([$.properties[Ci]])),Pt(wi,Mi.toString(),fi.toString()))});break}default:return wi.emit("error",new Error(`Invalid property ${Ci} value: ${mi}`)),!1}}function yi(wi,Ci,mi){ti(wi,mi);for(const Ni in Ci)if(Object.prototype.hasOwnProperty.call(Ci,Ni)&&Ci[Ni]!==null){const Mi=Ci[Ni];if(Array.isArray(Mi))for(let fi=0;fi<Mi.length;fi++)pi(wi,Ni,Mi[fi]);else pi(wi,Ni,Mi)}}function Ai(wi){return wi?wi instanceof V?wi.length:V.byteLength(wi):0}function hi(wi){return typeof wi=="string"||wi instanceof V}g.exports=ze}).call(this)}).call(this,r("buffer").Buffer)},{"./constants":38,"./numbers":41,buffer:17,debug:18,"process-nextick-args":49}],45:[function(r,g,k){var V=1e3,$=V*60,oe=$*60,re=oe*24,Ce=re*7,ie=re*365.25;g.exports=function(de,Ne){Ne=Ne||{};var he=typeof de;if(he==="string"&&de.length>0)return ae(de);if(he==="number"&&isFinite(de))return Ne.long?Ie(de):le(de);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(de))};function ae(de){if(de=String(de),!(de.length>100)){var Ne=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(de);if(Ne){var he=parseFloat(Ne[1]),pe=(Ne[2]||"ms").toLowerCase();switch(pe){case"years":case"year":case"yrs":case"yr":case"y":return he*ie;case"weeks":case"week":case"w":return he*Ce;case"days":case"day":case"d":return he*re;case"hours":case"hour":case"hrs":case"hr":case"h":return he*oe;case"minutes":case"minute":case"mins":case"min":case"m":return he*$;case"seconds":case"second":case"secs":case"sec":case"s":return he*V;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return he;default:return}}}}function le(de){var Ne=Math.abs(de);return Ne>=re?Math.round(de/re)+"d":Ne>=oe?Math.round(de/oe)+"h":Ne>=$?Math.round(de/$)+"m":Ne>=V?Math.round(de/V)+"s":de+"ms"}function Ie(de){var Ne=Math.abs(de);return Ne>=re?ue(de,Ne,re,"day"):Ne>=oe?ue(de,Ne,oe,"hour"):Ne>=$?ue(de,Ne,$,"minute"):Ne>=V?ue(de,Ne,V,"second"):de+" ms"}function ue(de,Ne,he,pe){var ze=Ne>=he*1.5;return Math.round(de/he)+" "+pe+(ze?"s":"")}},{}],46:[function(r,g,k){const V=r("./lib/number-allocator.js");g.exports.NumberAllocator=V},{"./lib/number-allocator.js":47}],47:[function(r,g,k){const V=r("js-sdsl").Set,$=r("debug")("number-allocator:trace"),oe=r("debug")("number-allocator:error");function re(ie,ae){this.low=ie,this.high=ae}re.prototype.equals=function(ie){return this.low===ie.low&&this.high===ie.high},re.prototype.compare=function(ie){return this.low<ie.low&&this.high<ie.low?-1:ie.low<this.low&&ie.high<this.low?1:0};function Ce(ie,ae){if(!(this instanceof Ce))return new Ce(ie,ae);this.min=ie,this.max=ae,this.ss=new V([],(le,Ie)=>le.compare(Ie)),$("Create"),this.clear()}Ce.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},Ce.prototype.alloc=function(){if(this.ss.size()===0)return $("alloc():empty"),null;const ie=this.ss.front(),ae=ie.low;return ae+1<=ie.high?++ie.low:this.ss.eraseElementByPos(0),$("alloc():"+ae),ae},Ce.prototype.use=function(ie){const ae=new re(ie,ie),le=this.ss.lowerBound(ae);if(le){if(le.equals(ae))return this.ss.eraseElementByValue(le),$("use():"+ie),!0;if(le.low>ie)return!1;if(le.low===ie)return++le.low,$("use():"+ie),!0;if(le.high===ie)return--le.high,$("use():"+ie),!0;const Ie=le.low;return le.low=ie+1,this.ss.insert(new re(Ie,ie-1)),$("use():"+ie),!0}return $("use():failed"),!1},Ce.prototype.free=function(ie){if(ie<this.min||ie>this.max){oe("free():"+ie+" is out of range");return}const ae=new re(ie,ie),le=this.ss.lowerBound(ae);if(le){if(le.low<=ie&&ie<=le.high){oe("free():"+ie+" has already been vacant");return}if(le===this.ss.front())ie+1===le.low?--le.low:this.ss.insert(ae);else{const Ie=this.ss.reverseLowerBound(ae);Ie.high+1===ie?ie+1===le.low?(this.ss.eraseElementByValue(Ie),le.low=Ie.low):Ie.high=ie:ie+1===le.low?le.low=ie:this.ss.insert(ae)}}else{if(le===this.ss.front()){this.ss.insert(ae);return}const Ie=this.ss.reverseLowerBound(ae);Ie.high+1===ie?Ie.high=ie:this.ss.insert(ae)}$("free():"+ie)},Ce.prototype.clear=function(){$("clear()"),this.ss.clear(),this.ss.insert(new re(this.min,this.max))},Ce.prototype.intervalCount=function(){return this.ss.size()},Ce.prototype.dump=function(){console.log("length:"+this.ss.size());for(const ie of this.ss)console.log(ie)},g.exports=Ce},{debug:18,"js-sdsl":36}],48:[function(r,g,k){var V=r("wrappy");g.exports=V($),g.exports.strict=V(oe),$.proto=$(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return $(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return oe(this)},configurable:!0})});function $(re){var Ce=function(){return Ce.called?Ce.value:(Ce.called=!0,Ce.value=re.apply(this,arguments))};return Ce.called=!1,Ce}function oe(re){var Ce=function(){if(Ce.called)throw new Error(Ce.onceError);return Ce.called=!0,Ce.value=re.apply(this,arguments)},ie=re.name||"Function wrapped with `once`";return Ce.onceError=ie+" shouldn't be called more than once",Ce.called=!1,Ce}},{wrappy:79}],49:[function(r,g,k){(function(V){(function(){typeof V>"u"||!V.version||V.version.indexOf("v0.")===0||V.version.indexOf("v1.")===0&&V.version.indexOf("v1.8.")!==0?g.exports={nextTick:$}:g.exports=V;function $(oe,re,Ce,ie){if(typeof oe!="function")throw new TypeError('"callback" argument must be a function');var ae=arguments.length,le,Ie;switch(ae){case 0:case 1:return V.nextTick(oe);case 2:return V.nextTick(function(){oe.call(null,re)});case 3:return V.nextTick(function(){oe.call(null,re,Ce)});case 4:return V.nextTick(function(){oe.call(null,re,Ce,ie)});default:for(le=new Array(ae-1),Ie=0;Ie<le.length;)le[Ie++]=arguments[Ie];return V.nextTick(function(){oe.apply(null,le)})}}}).call(this)}).call(this,r("_process"))},{_process:50}],50:[function(r,g,k){var V=g.exports={},$,oe;function re(){throw new Error("setTimeout has not been defined")}function Ce(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?$=setTimeout:$=re}catch{$=re}try{typeof clearTimeout=="function"?oe=clearTimeout:oe=Ce}catch{oe=Ce}})();function ie(Fe){if($===setTimeout)return setTimeout(Fe,0);if(($===re||!$)&&setTimeout)return $=setTimeout,setTimeout(Fe,0);try{return $(Fe,0)}catch{try{return $.call(null,Fe,0)}catch{return $.call(this,Fe,0)}}}function ae(Fe){if(oe===clearTimeout)return clearTimeout(Fe);if((oe===Ce||!oe)&&clearTimeout)return oe=clearTimeout,clearTimeout(Fe);try{return oe(Fe)}catch{try{return oe.call(null,Fe)}catch{return oe.call(this,Fe)}}}var le=[],Ie=!1,ue,de=-1;function Ne(){!Ie||!ue||(Ie=!1,ue.length?le=ue.concat(le):de=-1,le.length&&he())}function he(){if(!Ie){var Fe=ie(Ne);Ie=!0;for(var xe=le.length;xe;){for(ue=le,le=[];++de<xe;)ue&&ue[de].run();de=-1,xe=le.length}ue=null,Ie=!1,ae(Fe)}}V.nextTick=function(Fe){var xe=new Array(arguments.length-1);if(arguments.length>1)for(var _e=1;_e<arguments.length;_e++)xe[_e-1]=arguments[_e];le.push(new pe(Fe,xe)),le.length===1&&!Ie&&ie(he)};function pe(Fe,xe){this.fun=Fe,this.array=xe}pe.prototype.run=function(){this.fun.apply(null,this.array)},V.title="browser",V.browser=!0,V.env={},V.argv=[],V.version="",V.versions={};function ze(){}V.on=ze,V.addListener=ze,V.once=ze,V.off=ze,V.removeListener=ze,V.removeAllListeners=ze,V.emit=ze,V.prependListener=ze,V.prependOnceListener=ze,V.listeners=function(Fe){return[]},V.binding=function(Fe){throw new Error("process.binding is not supported")},V.cwd=function(){return"/"},V.chdir=function(Fe){throw new Error("process.chdir is not supported")},V.umask=function(){return 0}},{}],51:[function(r,g,k){(function(V){(function(){(function($){var oe=typeof k=="object"&&k&&!k.nodeType&&k,re=typeof g=="object"&&g&&!g.nodeType&&g,Ce=typeof V=="object"&&V;(Ce.global===Ce||Ce.window===Ce||Ce.self===Ce)&&($=Ce);var ie,ae=2147483647,le=36,Ie=1,ue=26,de=38,Ne=700,he=72,pe=128,ze="-",Fe=/^xn--/,xe=/[^\x20-\x7E]/,_e=/[\x2E\u3002\uFF0E\uFF61]/g,Dt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$e=le-Ie,Ue=Math.floor,Ve=String.fromCharCode,Oe;function At(ai){throw new RangeError(Dt[ai])}function qe(ai,ci){for(var pi=ai.length,yi=[];pi--;)yi[pi]=ci(ai[pi]);return yi}function Lt(ai,ci){var pi=ai.split("@"),yi="";pi.length>1&&(yi=pi[0]+"@",ai=pi[1]),ai=ai.replace(_e,".");var Ai=ai.split("."),hi=qe(Ai,ci).join(".");return yi+hi}function kt(ai){for(var ci=[],pi=0,yi=ai.length,Ai,hi;pi<yi;)Ai=ai.charCodeAt(pi++),Ai>=55296&&Ai<=56319&&pi<yi?(hi=ai.charCodeAt(pi++),(hi&64512)==56320?ci.push(((Ai&1023)<<10)+(hi&1023)+65536):(ci.push(Ai),pi--)):ci.push(Ai);return ci}function jt(ai){return qe(ai,function(ci){var pi="";return ci>65535&&(ci-=65536,pi+=Ve(ci>>>10&1023|55296),ci=56320|ci&1023),pi+=Ve(ci),pi}).join("")}function ti(ai){return ai-48<10?ai-22:ai-65<26?ai-65:ai-97<26?ai-97:le}function ei(ai,ci){return ai+22+75*(ai<26)-((ci!=0)<<5)}function Pt(ai,ci,pi){var yi=0;for(ai=pi?Ue(ai/Ne):ai>>1,ai+=Ue(ai/ci);ai>$e*ue>>1;yi+=le)ai=Ue(ai/$e);return Ue(yi+($e+1)*ai/(ai+de))}function ni(ai){var ci=[],pi=ai.length,yi,Ai=0,hi=pe,wi=he,Ci,mi,Ni,Mi,fi,zi,Si,si,Ii;for(Ci=ai.lastIndexOf(ze),Ci<0&&(Ci=0),mi=0;mi<Ci;++mi)ai.charCodeAt(mi)>=128&&At("not-basic"),ci.push(ai.charCodeAt(mi));for(Ni=Ci>0?Ci+1:0;Ni<pi;){for(Mi=Ai,fi=1,zi=le;Ni>=pi&&At("invalid-input"),Si=ti(ai.charCodeAt(Ni++)),(Si>=le||Si>Ue((ae-Ai)/fi))&&At("overflow"),Ai+=Si*fi,si=zi<=wi?Ie:zi>=wi+ue?ue:zi-wi,!(Si<si);zi+=le)Ii=le-si,fi>Ue(ae/Ii)&&At("overflow"),fi*=Ii;yi=ci.length+1,wi=Pt(Ai-Mi,yi,Mi==0),Ue(Ai/yi)>ae-hi&&At("overflow"),hi+=Ue(Ai/yi),Ai%=yi,ci.splice(Ai++,0,hi)}return jt(ci)}function gi(ai){var ci,pi,yi,Ai,hi,wi,Ci,mi,Ni,Mi,fi,zi=[],Si,si,Ii,oi;for(ai=kt(ai),Si=ai.length,ci=pe,pi=0,hi=he,wi=0;wi<Si;++wi)fi=ai[wi],fi<128&&zi.push(Ve(fi));for(yi=Ai=zi.length,Ai&&zi.push(ze);yi<Si;){for(Ci=ae,wi=0;wi<Si;++wi)fi=ai[wi],fi>=ci&&fi<Ci&&(Ci=fi);for(si=yi+1,Ci-ci>Ue((ae-pi)/si)&&At("overflow"),pi+=(Ci-ci)*si,ci=Ci,wi=0;wi<Si;++wi)if(fi=ai[wi],fi<ci&&++pi>ae&&At("overflow"),fi==ci){for(mi=pi,Ni=le;Mi=Ni<=hi?Ie:Ni>=hi+ue?ue:Ni-hi,!(mi<Mi);Ni+=le)oi=mi-Mi,Ii=le-Mi,zi.push(Ve(ei(Mi+oi%Ii,0))),mi=Ue(oi/Ii);zi.push(Ve(ei(mi,0))),hi=Pt(pi,si,yi==Ai),pi=0,++yi}++pi,++ci}return zi.join("")}function di(ai){return Lt(ai,function(ci){return Fe.test(ci)?ni(ci.slice(4).toLowerCase()):ci})}function li(ai){return Lt(ai,function(ci){return xe.test(ci)?"xn--"+gi(ci):ci})}if(ie={version:"1.4.1",ucs2:{decode:kt,encode:jt},decode:ni,encode:gi,toASCII:li,toUnicode:di},oe&&re)if(g.exports==oe)re.exports=ie;else for(Oe in ie)ie.hasOwnProperty(Oe)&&(oe[Oe]=ie[Oe]);else $.punycode=ie})(this)}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],52:[function(r,g,k){function V(oe,re){return Object.prototype.hasOwnProperty.call(oe,re)}g.exports=function(oe,re,Ce,ie){re=re||"&",Ce=Ce||"=";var ae={};if(typeof oe!="string"||oe.length===0)return ae;var le=/\+/g;oe=oe.split(re);var Ie=1e3;ie&&typeof ie.maxKeys=="number"&&(Ie=ie.maxKeys);var ue=oe.length;Ie>0&&ue>Ie&&(ue=Ie);for(var de=0;de<ue;++de){var Ne=oe[de].replace(le,"%20"),he=Ne.indexOf(Ce),pe,ze,Fe,xe;he>=0?(pe=Ne.substr(0,he),ze=Ne.substr(he+1)):(pe=Ne,ze=""),Fe=decodeURIComponent(pe),xe=decodeURIComponent(ze),V(ae,Fe)?$(ae[Fe])?ae[Fe].push(xe):ae[Fe]=[ae[Fe],xe]:ae[Fe]=xe}return ae};var $=Array.isArray||function(oe){return Object.prototype.toString.call(oe)==="[object Array]"}},{}],53:[function(r,g,k){var V=function(Ce){switch(typeof Ce){case"string":return Ce;case"boolean":return Ce?"true":"false";case"number":return isFinite(Ce)?Ce:"";default:return""}};g.exports=function(Ce,ie,ae,le){return ie=ie||"&",ae=ae||"=",Ce===null&&(Ce=void 0),typeof Ce=="object"?oe(re(Ce),function(Ie){var ue=encodeURIComponent(V(Ie))+ae;return $(Ce[Ie])?oe(Ce[Ie],function(de){return ue+encodeURIComponent(V(de))}).join(ie):ue+encodeURIComponent(V(Ce[Ie]))}).join(ie):le?encodeURIComponent(V(le))+ae+encodeURIComponent(V(Ce)):""};var $=Array.isArray||function(Ce){return Object.prototype.toString.call(Ce)==="[object Array]"};function oe(Ce,ie){if(Ce.map)return Ce.map(ie);for(var ae=[],le=0;le<Ce.length;le++)ae.push(ie(Ce[le],le));return ae}var re=Object.keys||function(Ce){var ie=[];for(var ae in Ce)Object.prototype.hasOwnProperty.call(Ce,ae)&&ie.push(ae);return ie}},{}],54:[function(r,g,k){k.decode=k.parse=r("./decode"),k.encode=k.stringify=r("./encode")},{"./decode":52,"./encode":53}],55:[function(r,g,k){function V(le,Ie){le.prototype=Object.create(Ie.prototype),le.prototype.constructor=le,le.__proto__=Ie}var $={};function oe(le,Ie,ue){ue||(ue=Error);function de(he,pe,ze){return typeof Ie=="string"?Ie:Ie(he,pe,ze)}var Ne=function(he){V(pe,he);function pe(ze,Fe,xe){return he.call(this,de(ze,Fe,xe))||this}return pe}(ue);Ne.prototype.name=ue.name,Ne.prototype.code=le,$[le]=Ne}function re(le,Ie){if(Array.isArray(le)){var ue=le.length;return le=le.map(function(de){return String(de)}),ue>2?"one of ".concat(Ie," ").concat(le.slice(0,ue-1).join(", "),", or ")+le[ue-1]:ue===2?"one of ".concat(Ie," ").concat(le[0]," or ").concat(le[1]):"of ".concat(Ie," ").concat(le[0])}else return"of ".concat(Ie," ").concat(String(le))}function Ce(le,Ie,ue){return le.substr(!ue||ue<0?0:+ue,Ie.length)===Ie}function ie(le,Ie,ue){return(ue===void 0||ue>le.length)&&(ue=le.length),le.substring(ue-Ie.length,ue)===Ie}function ae(le,Ie,ue){return typeof ue!="number"&&(ue=0),ue+Ie.length>le.length?!1:le.indexOf(Ie,ue)!==-1}oe("ERR_INVALID_OPT_VALUE",function(le,Ie){return'The value "'+Ie+'" is invalid for option "'+le+'"'},TypeError),oe("ERR_INVALID_ARG_TYPE",function(le,Ie,ue){var de;typeof Ie=="string"&&Ce(Ie,"not ")?(de="must not be",Ie=Ie.replace(/^not /,"")):de="must be";var Ne;if(ie(le," argument"))Ne="The ".concat(le," ").concat(de," ").concat(re(Ie,"type"));else{var he=ae(le,".")?"property":"argument";Ne='The "'.concat(le,'" ').concat(he," ").concat(de," ").concat(re(Ie,"type"))}return Ne+=". Received type ".concat(typeof ue),Ne},TypeError),oe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),oe("ERR_METHOD_NOT_IMPLEMENTED",function(le){return"The "+le+" method is not implemented"}),oe("ERR_STREAM_PREMATURE_CLOSE","Premature close"),oe("ERR_STREAM_DESTROYED",function(le){return"Cannot call "+le+" after a stream was destroyed"}),oe("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),oe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),oe("ERR_STREAM_WRITE_AFTER_END","write after end"),oe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),oe("ERR_UNKNOWN_ENCODING",function(le){return"Unknown encoding: "+le},TypeError),oe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),g.exports.codes=$},{}],56:[function(r,g,k){(function(V){(function(){var $=Object.keys||function(de){var Ne=[];for(var he in de)Ne.push(he);return Ne};g.exports=le;var oe=r("./_stream_readable"),re=r("./_stream_writable");r("inherits")(le,oe);for(var Ce=$(re.prototype),ie=0;ie<Ce.length;ie++){var ae=Ce[ie];le.prototype[ae]||(le.prototype[ae]=re.prototype[ae])}function le(de){if(!(this instanceof le))return new le(de);oe.call(this,de),re.call(this,de),this.allowHalfOpen=!0,de&&(de.readable===!1&&(this.readable=!1),de.writable===!1&&(this.writable=!1),de.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Ie)))}Object.defineProperty(le.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(le.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(le.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Ie(){this._writableState.ended||V.nextTick(ue,this)}function ue(de){de.end()}Object.defineProperty(le.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(Ne){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=Ne,this._writableState.destroyed=Ne)}})}).call(this)}).call(this,r("_process"))},{"./_stream_readable":58,"./_stream_writable":60,_process:50,inherits:24}],57:[function(r,g,k){g.exports=$;var V=r("./_stream_transform");r("inherits")($,V);function $(oe){if(!(this instanceof $))return new $(oe);V.call(this,oe)}$.prototype._transform=function(oe,re,Ce){Ce(null,oe)}},{"./_stream_transform":59,inherits:24}],58:[function(r,g,k){(function(V,$){(function(){g.exports=jt;var oe;jt.ReadableState=kt,r("events").EventEmitter;var re=function(Ii,oi){return Ii.listeners(oi).length},Ce=r("./internal/streams/stream"),ie=r("buffer").Buffer,ae=$.Uint8Array||function(){};function le(si){return ie.from(si)}function Ie(si){return ie.isBuffer(si)||si instanceof ae}var ue=r("util"),de;ue&&ue.debuglog?de=ue.debuglog("stream"):de=function(){};var Ne=r("./internal/streams/buffer_list"),he=r("./internal/streams/destroy"),pe=r("./internal/streams/state"),ze=pe.getHighWaterMark,Fe=r("../errors").codes,xe=Fe.ERR_INVALID_ARG_TYPE,_e=Fe.ERR_STREAM_PUSH_AFTER_EOF,Dt=Fe.ERR_METHOD_NOT_IMPLEMENTED,$e=Fe.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ue,Ve,Oe;r("inherits")(jt,Ce);var At=he.errorOrDestroy,qe=["error","close","destroy","pause","resume"];function Lt(si,Ii,oi){if(typeof si.prependListener=="function")return si.prependListener(Ii,oi);!si._events||!si._events[Ii]?si.on(Ii,oi):Array.isArray(si._events[Ii])?si._events[Ii].unshift(oi):si._events[Ii]=[oi,si._events[Ii]]}function kt(si,Ii,oi){oe=oe||r("./_stream_duplex"),si=si||{},typeof oi!="boolean"&&(oi=Ii instanceof oe),this.objectMode=!!si.objectMode,oi&&(this.objectMode=this.objectMode||!!si.readableObjectMode),this.highWaterMark=ze(this,si,"readableHighWaterMark",oi),this.buffer=new Ne,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=si.emitClose!==!1,this.autoDestroy=!!si.autoDestroy,this.destroyed=!1,this.defaultEncoding=si.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,si.encoding&&(Ue||(Ue=r("string_decoder/").StringDecoder),this.decoder=new Ue(si.encoding),this.encoding=si.encoding)}function jt(si){if(oe=oe||r("./_stream_duplex"),!(this instanceof jt))return new jt(si);var Ii=this instanceof oe;this._readableState=new kt(si,this,Ii),this.readable=!0,si&&(typeof si.read=="function"&&(this._read=si.read),typeof si.destroy=="function"&&(this._destroy=si.destroy)),Ce.call(this)}Object.defineProperty(jt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Ii){this._readableState&&(this._readableState.destroyed=Ii)}}),jt.prototype.destroy=he.destroy,jt.prototype._undestroy=he.undestroy,jt.prototype._destroy=function(si,Ii){Ii(si)},jt.prototype.push=function(si,Ii){var oi=this._readableState,Et;return oi.objectMode?Et=!0:typeof si=="string"&&(Ii=Ii||oi.defaultEncoding,Ii!==oi.encoding&&(si=ie.from(si,Ii),Ii=""),Et=!0),ti(this,si,Ii,!1,Et)},jt.prototype.unshift=function(si){return ti(this,si,null,!0,!1)};function ti(si,Ii,oi,Et,ii){de("readableAddChunk",Ii);var ri=si._readableState;if(Ii===null)ri.reading=!1,li(si,ri);else{var ui;if(ii||(ui=Pt(ri,Ii)),ui)At(si,ui);else if(ri.objectMode||Ii&&Ii.length>0)if(typeof Ii!="string"&&!ri.objectMode&&Object.getPrototypeOf(Ii)!==ie.prototype&&(Ii=le(Ii)),Et)ri.endEmitted?At(si,new $e):ei(si,ri,Ii,!0);else if(ri.ended)At(si,new _e);else{if(ri.destroyed)return!1;ri.reading=!1,ri.decoder&&!oi?(Ii=ri.decoder.write(Ii),ri.objectMode||Ii.length!==0?ei(si,ri,Ii,!1):pi(si,ri)):ei(si,ri,Ii,!1)}else Et||(ri.reading=!1,pi(si,ri))}return!ri.ended&&(ri.length<ri.highWaterMark||ri.length===0)}function ei(si,Ii,oi,Et){Ii.flowing&&Ii.length===0&&!Ii.sync?(Ii.awaitDrain=0,si.emit("data",oi)):(Ii.length+=Ii.objectMode?1:oi.length,Et?Ii.buffer.unshift(oi):Ii.buffer.push(oi),Ii.needReadable&&ai(si)),pi(si,Ii)}function Pt(si,Ii){var oi;return!Ie(Ii)&&typeof Ii!="string"&&Ii!==void 0&&!si.objectMode&&(oi=new xe("chunk",["string","Buffer","Uint8Array"],Ii)),oi}jt.prototype.isPaused=function(){return this._readableState.flowing===!1},jt.prototype.setEncoding=function(si){Ue||(Ue=r("string_decoder/").StringDecoder);var Ii=new Ue(si);this._readableState.decoder=Ii,this._readableState.encoding=this._readableState.decoder.encoding;for(var oi=this._readableState.buffer.head,Et="";oi!==null;)Et+=Ii.write(oi.data),oi=oi.next;return this._readableState.buffer.clear(),Et!==""&&this._readableState.buffer.push(Et),this._readableState.length=Et.length,this};var ni=1073741824;function gi(si){return si>=ni?si=ni:(si--,si|=si>>>1,si|=si>>>2,si|=si>>>4,si|=si>>>8,si|=si>>>16,si++),si}function di(si,Ii){return si<=0||Ii.length===0&&Ii.ended?0:Ii.objectMode?1:si!==si?Ii.flowing&&Ii.length?Ii.buffer.head.data.length:Ii.length:(si>Ii.highWaterMark&&(Ii.highWaterMark=gi(si)),si<=Ii.length?si:Ii.ended?Ii.length:(Ii.needReadable=!0,0))}jt.prototype.read=function(si){de("read",si),si=parseInt(si,10);var Ii=this._readableState,oi=si;if(si!==0&&(Ii.emittedReadable=!1),si===0&&Ii.needReadable&&((Ii.highWaterMark!==0?Ii.length>=Ii.highWaterMark:Ii.length>0)||Ii.ended))return de("read: emitReadable",Ii.length,Ii.ended),Ii.length===0&&Ii.ended?fi(this):ai(this),null;if(si=di(si,Ii),si===0&&Ii.ended)return Ii.length===0&&fi(this),null;var Et=Ii.needReadable;de("need readable",Et),(Ii.length===0||Ii.length-si<Ii.highWaterMark)&&(Et=!0,de("length less than watermark",Et)),Ii.ended||Ii.reading?(Et=!1,de("reading or ended",Et)):Et&&(de("do read"),Ii.reading=!0,Ii.sync=!0,Ii.length===0&&(Ii.needReadable=!0),this._read(Ii.highWaterMark),Ii.sync=!1,Ii.reading||(si=di(oi,Ii)));var ii;return si>0?ii=Mi(si,Ii):ii=null,ii===null?(Ii.needReadable=Ii.length<=Ii.highWaterMark,si=0):(Ii.length-=si,Ii.awaitDrain=0),Ii.length===0&&(Ii.ended||(Ii.needReadable=!0),oi!==si&&Ii.ended&&fi(this)),ii!==null&&this.emit("data",ii),ii};function li(si,Ii){if(de("onEofChunk"),!Ii.ended){if(Ii.decoder){var oi=Ii.decoder.end();oi&&oi.length&&(Ii.buffer.push(oi),Ii.length+=Ii.objectMode?1:oi.length)}Ii.ended=!0,Ii.sync?ai(si):(Ii.needReadable=!1,Ii.emittedReadable||(Ii.emittedReadable=!0,ci(si)))}}function ai(si){var Ii=si._readableState;de("emitReadable",Ii.needReadable,Ii.emittedReadable),Ii.needReadable=!1,Ii.emittedReadable||(de("emitReadable",Ii.flowing),Ii.emittedReadable=!0,V.nextTick(ci,si))}function ci(si){var Ii=si._readableState;de("emitReadable_",Ii.destroyed,Ii.length,Ii.ended),!Ii.destroyed&&(Ii.length||Ii.ended)&&(si.emit("readable"),Ii.emittedReadable=!1),Ii.needReadable=!Ii.flowing&&!Ii.ended&&Ii.length<=Ii.highWaterMark,Ni(si)}function pi(si,Ii){Ii.readingMore||(Ii.readingMore=!0,V.nextTick(yi,si,Ii))}function yi(si,Ii){for(;!Ii.reading&&!Ii.ended&&(Ii.length<Ii.highWaterMark||Ii.flowing&&Ii.length===0);){var oi=Ii.length;if(de("maybeReadMore read 0"),si.read(0),oi===Ii.length)break}Ii.readingMore=!1}jt.prototype._read=function(si){At(this,new Dt("_read()"))},jt.prototype.pipe=function(si,Ii){var oi=this,Et=this._readableState;switch(Et.pipesCount){case 0:Et.pipes=si;break;case 1:Et.pipes=[Et.pipes,si];break;default:Et.pipes.push(si);break}Et.pipesCount+=1,de("pipe count=%d opts=%j",Et.pipesCount,Ii);var ii=(!Ii||Ii.end!==!1)&&si!==V.stdout&&si!==V.stderr,ri=ii?vi:Wi;Et.endEmitted?V.nextTick(ri):oi.once("end",ri),si.on("unpipe",ui);function ui(ki,Ri){de("onunpipe"),ki===oi&&Ri&&Ri.hasUnpiped===!1&&(Ri.hasUnpiped=!0,Gi())}function vi(){de("onend"),si.end()}var bi=Ai(oi);si.on("drain",bi);var Zi=!1;function Gi(){de("cleanup"),si.removeListener("close",xi),si.removeListener("finish",Li),si.removeListener("drain",bi),si.removeListener("error",Oi),si.removeListener("unpipe",ui),oi.removeListener("end",vi),oi.removeListener("end",Wi),oi.removeListener("data",Yi),Zi=!0,Et.awaitDrain&&(!si._writableState||si._writableState.needDrain)&&bi()}oi.on("data",Yi);function Yi(ki){de("ondata");var Ri=si.write(ki);de("dest.write",Ri),Ri===!1&&((Et.pipesCount===1&&Et.pipes===si||Et.pipesCount>1&&Si(Et.pipes,si)!==-1)&&!Zi&&(de("false write response, pause",Et.awaitDrain),Et.awaitDrain++),oi.pause())}function Oi(ki){de("onerror",ki),Wi(),si.removeListener("error",Oi),re(si,"error")===0&&At(si,ki)}Lt(si,"error",Oi);function xi(){si.removeListener("finish",Li),Wi()}si.once("close",xi);function Li(){de("onfinish"),si.removeListener("close",xi),Wi()}si.once("finish",Li);function Wi(){de("unpipe"),oi.unpipe(si)}return si.emit("pipe",oi),Et.flowing||(de("pipe resume"),oi.resume()),si};function Ai(si){return function(){var oi=si._readableState;de("pipeOnDrain",oi.awaitDrain),oi.awaitDrain&&oi.awaitDrain--,oi.awaitDrain===0&&re(si,"data")&&(oi.flowing=!0,Ni(si))}}jt.prototype.unpipe=function(si){var Ii=this._readableState,oi={hasUnpiped:!1};if(Ii.pipesCount===0)return this;if(Ii.pipesCount===1)return si&&si!==Ii.pipes?this:(si||(si=Ii.pipes),Ii.pipes=null,Ii.pipesCount=0,Ii.flowing=!1,si&&si.emit("unpipe",this,oi),this);if(!si){var Et=Ii.pipes,ii=Ii.pipesCount;Ii.pipes=null,Ii.pipesCount=0,Ii.flowing=!1;for(var ri=0;ri<ii;ri++)Et[ri].emit("unpipe",this,{hasUnpiped:!1});return this}var ui=Si(Ii.pipes,si);return ui===-1?this:(Ii.pipes.splice(ui,1),Ii.pipesCount-=1,Ii.pipesCount===1&&(Ii.pipes=Ii.pipes[0]),si.emit("unpipe",this,oi),this)},jt.prototype.on=function(si,Ii){var oi=Ce.prototype.on.call(this,si,Ii),Et=this._readableState;return si==="data"?(Et.readableListening=this.listenerCount("readable")>0,Et.flowing!==!1&&this.resume()):si==="readable"&&!Et.endEmitted&&!Et.readableListening&&(Et.readableListening=Et.needReadable=!0,Et.flowing=!1,Et.emittedReadable=!1,de("on readable",Et.length,Et.reading),Et.length?ai(this):Et.reading||V.nextTick(wi,this)),oi},jt.prototype.addListener=jt.prototype.on,jt.prototype.removeListener=function(si,Ii){var oi=Ce.prototype.removeListener.call(this,si,Ii);return si==="readable"&&V.nextTick(hi,this),oi},jt.prototype.removeAllListeners=function(si){var Ii=Ce.prototype.removeAllListeners.apply(this,arguments);return(si==="readable"||si===void 0)&&V.nextTick(hi,this),Ii};function hi(si){var Ii=si._readableState;Ii.readableListening=si.listenerCount("readable")>0,Ii.resumeScheduled&&!Ii.paused?Ii.flowing=!0:si.listenerCount("data")>0&&si.resume()}function wi(si){de("readable nexttick read 0"),si.read(0)}jt.prototype.resume=function(){var si=this._readableState;return si.flowing||(de("resume"),si.flowing=!si.readableListening,Ci(this,si)),si.paused=!1,this};function Ci(si,Ii){Ii.resumeScheduled||(Ii.resumeScheduled=!0,V.nextTick(mi,si,Ii))}function mi(si,Ii){de("resume",Ii.reading),Ii.reading||si.read(0),Ii.resumeScheduled=!1,si.emit("resume"),Ni(si),Ii.flowing&&!Ii.reading&&si.read(0)}jt.prototype.pause=function(){return de("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(de("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ni(si){var Ii=si._readableState;for(de("flow",Ii.flowing);Ii.flowing&&si.read()!==null;);}jt.prototype.wrap=function(si){var Ii=this,oi=this._readableState,Et=!1;si.on("end",function(){if(de("wrapped end"),oi.decoder&&!oi.ended){var ui=oi.decoder.end();ui&&ui.length&&Ii.push(ui)}Ii.push(null)}),si.on("data",function(ui){if(de("wrapped data"),oi.decoder&&(ui=oi.decoder.write(ui)),!(oi.objectMode&&ui==null)&&!(!oi.objectMode&&(!ui||!ui.length))){var vi=Ii.push(ui);vi||(Et=!0,si.pause())}});for(var ii in si)this[ii]===void 0&&typeof si[ii]=="function"&&(this[ii]=function(vi){return function(){return si[vi].apply(si,arguments)}}(ii));for(var ri=0;ri<qe.length;ri++)si.on(qe[ri],this.emit.bind(this,qe[ri]));return this._read=function(ui){de("wrapped _read",ui),Et&&(Et=!1,si.resume())},this},typeof Symbol=="function"&&(jt.prototype[Symbol.asyncIterator]=function(){return Ve===void 0&&(Ve=r("./internal/streams/async_iterator")),Ve(this)}),Object.defineProperty(jt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(jt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(jt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Ii){this._readableState&&(this._readableState.flowing=Ii)}}),jt._fromList=Mi,Object.defineProperty(jt.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Mi(si,Ii){if(Ii.length===0)return null;var oi;return Ii.objectMode?oi=Ii.buffer.shift():!si||si>=Ii.length?(Ii.decoder?oi=Ii.buffer.join(""):Ii.buffer.length===1?oi=Ii.buffer.first():oi=Ii.buffer.concat(Ii.length),Ii.buffer.clear()):oi=Ii.buffer.consume(si,Ii.decoder),oi}function fi(si){var Ii=si._readableState;de("endReadable",Ii.endEmitted),Ii.endEmitted||(Ii.ended=!0,V.nextTick(zi,Ii,si))}function zi(si,Ii){if(de("endReadableNT",si.endEmitted,si.length),!si.endEmitted&&si.length===0&&(si.endEmitted=!0,Ii.readable=!1,Ii.emit("end"),si.autoDestroy)){var oi=Ii._writableState;(!oi||oi.autoDestroy&&oi.finished)&&Ii.destroy()}}typeof Symbol=="function"&&(jt.from=function(si,Ii){return Oe===void 0&&(Oe=r("./internal/streams/from")),Oe(jt,si,Ii)});function Si(si,Ii){for(var oi=0,Et=si.length;oi<Et;oi++)if(si[oi]===Ii)return oi;return-1}}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/async_iterator":61,"./internal/streams/buffer_list":62,"./internal/streams/destroy":63,"./internal/streams/from":65,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,events:22,inherits:24,"string_decoder/":75,util:16}],59:[function(r,g,k){g.exports=le;var V=r("../errors").codes,$=V.ERR_METHOD_NOT_IMPLEMENTED,oe=V.ERR_MULTIPLE_CALLBACK,re=V.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ce=V.ERR_TRANSFORM_WITH_LENGTH_0,ie=r("./_stream_duplex");r("inherits")(le,ie);function ae(de,Ne){var he=this._transformState;he.transforming=!1;var pe=he.writecb;if(pe===null)return this.emit("error",new oe);he.writechunk=null,he.writecb=null,Ne!=null&&this.push(Ne),pe(de);var ze=this._readableState;ze.reading=!1,(ze.needReadable||ze.length<ze.highWaterMark)&&this._read(ze.highWaterMark)}function le(de){if(!(this instanceof le))return new le(de);ie.call(this,de),this._transformState={afterTransform:ae.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,de&&(typeof de.transform=="function"&&(this._transform=de.transform),typeof de.flush=="function"&&(this._flush=de.flush)),this.on("prefinish",Ie)}function Ie(){var de=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(Ne,he){ue(de,Ne,he)}):ue(this,null,null)}le.prototype.push=function(de,Ne){return this._transformState.needTransform=!1,ie.prototype.push.call(this,de,Ne)},le.prototype._transform=function(de,Ne,he){he(new $("_transform()"))},le.prototype._write=function(de,Ne,he){var pe=this._transformState;if(pe.writecb=he,pe.writechunk=de,pe.writeencoding=Ne,!pe.transforming){var ze=this._readableState;(pe.needTransform||ze.needReadable||ze.length<ze.highWaterMark)&&this._read(ze.highWaterMark)}},le.prototype._read=function(de){var Ne=this._transformState;Ne.writechunk!==null&&!Ne.transforming?(Ne.transforming=!0,this._transform(Ne.writechunk,Ne.writeencoding,Ne.afterTransform)):Ne.needTransform=!0},le.prototype._destroy=function(de,Ne){ie.prototype._destroy.call(this,de,function(he){Ne(he)})};function ue(de,Ne,he){if(Ne)return de.emit("error",Ne);if(he!=null&&de.push(he),de._writableState.length)throw new Ce;if(de._transformState.transforming)throw new re;return de.push(null)}},{"../errors":55,"./_stream_duplex":56,inherits:24}],60:[function(r,g,k){(function(V,$){(function(){g.exports=kt;function oe(Ni){var Mi=this;this.next=null,this.entry=null,this.finish=function(){mi(Mi,Ni)}}var re;kt.WritableState=qe;var Ce={deprecate:r("util-deprecate")},ie=r("./internal/streams/stream"),ae=r("buffer").Buffer,le=$.Uint8Array||function(){};function Ie(Ni){return ae.from(Ni)}function ue(Ni){return ae.isBuffer(Ni)||Ni instanceof le}var de=r("./internal/streams/destroy"),Ne=r("./internal/streams/state"),he=Ne.getHighWaterMark,pe=r("../errors").codes,ze=pe.ERR_INVALID_ARG_TYPE,Fe=pe.ERR_METHOD_NOT_IMPLEMENTED,xe=pe.ERR_MULTIPLE_CALLBACK,_e=pe.ERR_STREAM_CANNOT_PIPE,Dt=pe.ERR_STREAM_DESTROYED,$e=pe.ERR_STREAM_NULL_VALUES,Ue=pe.ERR_STREAM_WRITE_AFTER_END,Ve=pe.ERR_UNKNOWN_ENCODING,Oe=de.errorOrDestroy;r("inherits")(kt,ie);function At(){}function qe(Ni,Mi,fi){re=re||r("./_stream_duplex"),Ni=Ni||{},typeof fi!="boolean"&&(fi=Mi instanceof re),this.objectMode=!!Ni.objectMode,fi&&(this.objectMode=this.objectMode||!!Ni.writableObjectMode),this.highWaterMark=he(this,Ni,"writableHighWaterMark",fi),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var zi=Ni.decodeStrings===!1;this.decodeStrings=!zi,this.defaultEncoding=Ni.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Si){li(Mi,Si)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Ni.emitClose!==!1,this.autoDestroy=!!Ni.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new oe(this)}qe.prototype.getBuffer=function(){for(var Mi=this.bufferedRequest,fi=[];Mi;)fi.push(Mi),Mi=Mi.next;return fi},function(){try{Object.defineProperty(qe.prototype,"buffer",{get:Ce.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Lt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Lt=Function.prototype[Symbol.hasInstance],Object.defineProperty(kt,Symbol.hasInstance,{value:function(Mi){return Lt.call(this,Mi)?!0:this!==kt?!1:Mi&&Mi._writableState instanceof qe}})):Lt=function(Mi){return Mi instanceof this};function kt(Ni){re=re||r("./_stream_duplex");var Mi=this instanceof re;if(!Mi&&!Lt.call(kt,this))return new kt(Ni);this._writableState=new qe(Ni,this,Mi),this.writable=!0,Ni&&(typeof Ni.write=="function"&&(this._write=Ni.write),typeof Ni.writev=="function"&&(this._writev=Ni.writev),typeof Ni.destroy=="function"&&(this._destroy=Ni.destroy),typeof Ni.final=="function"&&(this._final=Ni.final)),ie.call(this)}kt.prototype.pipe=function(){Oe(this,new _e)};function jt(Ni,Mi){var fi=new Ue;Oe(Ni,fi),V.nextTick(Mi,fi)}function ti(Ni,Mi,fi,zi){var Si;return fi===null?Si=new $e:typeof fi!="string"&&!Mi.objectMode&&(Si=new ze("chunk",["string","Buffer"],fi)),Si?(Oe(Ni,Si),V.nextTick(zi,Si),!1):!0}kt.prototype.write=function(Ni,Mi,fi){var zi=this._writableState,Si=!1,si=!zi.objectMode&&ue(Ni);return si&&!ae.isBuffer(Ni)&&(Ni=Ie(Ni)),typeof Mi=="function"&&(fi=Mi,Mi=null),si?Mi="buffer":Mi||(Mi=zi.defaultEncoding),typeof fi!="function"&&(fi=At),zi.ending?jt(this,fi):(si||ti(this,zi,Ni,fi))&&(zi.pendingcb++,Si=Pt(this,zi,si,Ni,Mi,fi)),Si},kt.prototype.cork=function(){this._writableState.corked++},kt.prototype.uncork=function(){var Ni=this._writableState;Ni.corked&&(Ni.corked--,!Ni.writing&&!Ni.corked&&!Ni.bufferProcessing&&Ni.bufferedRequest&&pi(this,Ni))},kt.prototype.setDefaultEncoding=function(Mi){if(typeof Mi=="string"&&(Mi=Mi.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Mi+"").toLowerCase())>-1))throw new Ve(Mi);return this._writableState.defaultEncoding=Mi,this},Object.defineProperty(kt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ei(Ni,Mi,fi){return!Ni.objectMode&&Ni.decodeStrings!==!1&&typeof Mi=="string"&&(Mi=ae.from(Mi,fi)),Mi}Object.defineProperty(kt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Pt(Ni,Mi,fi,zi,Si,si){if(!fi){var Ii=ei(Mi,zi,Si);zi!==Ii&&(fi=!0,Si="buffer",zi=Ii)}var oi=Mi.objectMode?1:zi.length;Mi.length+=oi;var Et=Mi.length<Mi.highWaterMark;if(Et||(Mi.needDrain=!0),Mi.writing||Mi.corked){var ii=Mi.lastBufferedRequest;Mi.lastBufferedRequest={chunk:zi,encoding:Si,isBuf:fi,callback:si,next:null},ii?ii.next=Mi.lastBufferedRequest:Mi.bufferedRequest=Mi.lastBufferedRequest,Mi.bufferedRequestCount+=1}else ni(Ni,Mi,!1,oi,zi,Si,si);return Et}function ni(Ni,Mi,fi,zi,Si,si,Ii){Mi.writelen=zi,Mi.writecb=Ii,Mi.writing=!0,Mi.sync=!0,Mi.destroyed?Mi.onwrite(new Dt("write")):fi?Ni._writev(Si,Mi.onwrite):Ni._write(Si,si,Mi.onwrite),Mi.sync=!1}function gi(Ni,Mi,fi,zi,Si){--Mi.pendingcb,fi?(V.nextTick(Si,zi),V.nextTick(wi,Ni,Mi),Ni._writableState.errorEmitted=!0,Oe(Ni,zi)):(Si(zi),Ni._writableState.errorEmitted=!0,Oe(Ni,zi),wi(Ni,Mi))}function di(Ni){Ni.writing=!1,Ni.writecb=null,Ni.length-=Ni.writelen,Ni.writelen=0}function li(Ni,Mi){var fi=Ni._writableState,zi=fi.sync,Si=fi.writecb;if(typeof Si!="function")throw new xe;if(di(fi),Mi)gi(Ni,fi,zi,Mi,Si);else{var si=yi(fi)||Ni.destroyed;!si&&!fi.corked&&!fi.bufferProcessing&&fi.bufferedRequest&&pi(Ni,fi),zi?V.nextTick(ai,Ni,fi,si,Si):ai(Ni,fi,si,Si)}}function ai(Ni,Mi,fi,zi){fi||ci(Ni,Mi),Mi.pendingcb--,zi(),wi(Ni,Mi)}function ci(Ni,Mi){Mi.length===0&&Mi.needDrain&&(Mi.needDrain=!1,Ni.emit("drain"))}function pi(Ni,Mi){Mi.bufferProcessing=!0;var fi=Mi.bufferedRequest;if(Ni._writev&&fi&&fi.next){var zi=Mi.bufferedRequestCount,Si=new Array(zi),si=Mi.corkedRequestsFree;si.entry=fi;for(var Ii=0,oi=!0;fi;)Si[Ii]=fi,fi.isBuf||(oi=!1),fi=fi.next,Ii+=1;Si.allBuffers=oi,ni(Ni,Mi,!0,Mi.length,Si,"",si.finish),Mi.pendingcb++,Mi.lastBufferedRequest=null,si.next?(Mi.corkedRequestsFree=si.next,si.next=null):Mi.corkedRequestsFree=new oe(Mi),Mi.bufferedRequestCount=0}else{for(;fi;){var Et=fi.chunk,ii=fi.encoding,ri=fi.callback,ui=Mi.objectMode?1:Et.length;if(ni(Ni,Mi,!1,ui,Et,ii,ri),fi=fi.next,Mi.bufferedRequestCount--,Mi.writing)break}fi===null&&(Mi.lastBufferedRequest=null)}Mi.bufferedRequest=fi,Mi.bufferProcessing=!1}kt.prototype._write=function(Ni,Mi,fi){fi(new Fe("_write()"))},kt.prototype._writev=null,kt.prototype.end=function(Ni,Mi,fi){var zi=this._writableState;return typeof Ni=="function"?(fi=Ni,Ni=null,Mi=null):typeof Mi=="function"&&(fi=Mi,Mi=null),Ni!=null&&this.write(Ni,Mi),zi.corked&&(zi.corked=1,this.uncork()),zi.ending||Ci(this,zi,fi),this},Object.defineProperty(kt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function yi(Ni){return Ni.ending&&Ni.length===0&&Ni.bufferedRequest===null&&!Ni.finished&&!Ni.writing}function Ai(Ni,Mi){Ni._final(function(fi){Mi.pendingcb--,fi&&Oe(Ni,fi),Mi.prefinished=!0,Ni.emit("prefinish"),wi(Ni,Mi)})}function hi(Ni,Mi){!Mi.prefinished&&!Mi.finalCalled&&(typeof Ni._final=="function"&&!Mi.destroyed?(Mi.pendingcb++,Mi.finalCalled=!0,V.nextTick(Ai,Ni,Mi)):(Mi.prefinished=!0,Ni.emit("prefinish")))}function wi(Ni,Mi){var fi=yi(Mi);if(fi&&(hi(Ni,Mi),Mi.pendingcb===0&&(Mi.finished=!0,Ni.emit("finish"),Mi.autoDestroy))){var zi=Ni._readableState;(!zi||zi.autoDestroy&&zi.endEmitted)&&Ni.destroy()}return fi}function Ci(Ni,Mi,fi){Mi.ending=!0,wi(Ni,Mi),fi&&(Mi.finished?V.nextTick(fi):Ni.once("finish",fi)),Mi.ended=!0,Ni.writable=!1}function mi(Ni,Mi,fi){var zi=Ni.entry;for(Ni.entry=null;zi;){var Si=zi.callback;Mi.pendingcb--,Si(fi),zi=zi.next}Mi.corkedRequestsFree.next=Ni}Object.defineProperty(kt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Mi){this._writableState&&(this._writableState.destroyed=Mi)}}),kt.prototype.destroy=de.destroy,kt.prototype._undestroy=de.undestroy,kt.prototype._destroy=function(Ni,Mi){Mi(Ni)}}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/destroy":63,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,inherits:24,"util-deprecate":78}],61:[function(r,g,k){(function(V){(function(){var $;function oe(Dt,$e,Ue){return $e in Dt?Object.defineProperty(Dt,$e,{value:Ue,enumerable:!0,configurable:!0,writable:!0}):Dt[$e]=Ue,Dt}var re=r("./end-of-stream"),Ce=Symbol("lastResolve"),ie=Symbol("lastReject"),ae=Symbol("error"),le=Symbol("ended"),Ie=Symbol("lastPromise"),ue=Symbol("handlePromise"),de=Symbol("stream");function Ne(Dt,$e){return{value:Dt,done:$e}}function he(Dt){var $e=Dt[Ce];if($e!==null){var Ue=Dt[de].read();Ue!==null&&(Dt[Ie]=null,Dt[Ce]=null,Dt[ie]=null,$e(Ne(Ue,!1)))}}function pe(Dt){V.nextTick(he,Dt)}function ze(Dt,$e){return function(Ue,Ve){Dt.then(function(){if($e[le]){Ue(Ne(void 0,!0));return}$e[ue](Ue,Ve)},Ve)}}var Fe=Object.getPrototypeOf(function(){}),xe=Object.setPrototypeOf(($={get stream(){return this[de]},next:function(){var $e=this,Ue=this[ae];if(Ue!==null)return Promise.reject(Ue);if(this[le])return Promise.resolve(Ne(void 0,!0));if(this[de].destroyed)return new Promise(function(qe,Lt){V.nextTick(function(){$e[ae]?Lt($e[ae]):qe(Ne(void 0,!0))})});var Ve=this[Ie],Oe;if(Ve)Oe=new Promise(ze(Ve,this));else{var At=this[de].read();if(At!==null)return Promise.resolve(Ne(At,!1));Oe=new Promise(this[ue])}return this[Ie]=Oe,Oe}},oe($,Symbol.asyncIterator,function(){return this}),oe($,"return",function(){var $e=this;return new Promise(function(Ue,Ve){$e[de].destroy(null,function(Oe){if(Oe){Ve(Oe);return}Ue(Ne(void 0,!0))})})}),$),Fe),_e=function($e){var Ue,Ve=Object.create(xe,(Ue={},oe(Ue,de,{value:$e,writable:!0}),oe(Ue,Ce,{value:null,writable:!0}),oe(Ue,ie,{value:null,writable:!0}),oe(Ue,ae,{value:null,writable:!0}),oe(Ue,le,{value:$e._readableState.endEmitted,writable:!0}),oe(Ue,ue,{value:function(At,qe){var Lt=Ve[de].read();Lt?(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,At(Ne(Lt,!1))):(Ve[Ce]=At,Ve[ie]=qe)},writable:!0}),Ue));return Ve[Ie]=null,re($e,function(Oe){if(Oe&&Oe.code!=="ERR_STREAM_PREMATURE_CLOSE"){var At=Ve[ie];At!==null&&(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,At(Oe)),Ve[ae]=Oe;return}var qe=Ve[Ce];qe!==null&&(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,qe(Ne(void 0,!0))),Ve[le]=!0}),$e.on("readable",pe.bind(null,Ve)),Ve};g.exports=_e}).call(this)}).call(this,r("_process"))},{"./end-of-stream":64,_process:50}],62:[function(r,g,k){function V(he,pe){var ze=Object.keys(he);if(Object.getOwnPropertySymbols){var Fe=Object.getOwnPropertySymbols(he);pe&&(Fe=Fe.filter(function(xe){return Object.getOwnPropertyDescriptor(he,xe).enumerable})),ze.push.apply(ze,Fe)}return ze}function $(he){for(var pe=1;pe<arguments.length;pe++){var ze=arguments[pe]!=null?arguments[pe]:{};pe%2?V(Object(ze),!0).forEach(function(Fe){oe(he,Fe,ze[Fe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(he,Object.getOwnPropertyDescriptors(ze)):V(Object(ze)).forEach(function(Fe){Object.defineProperty(he,Fe,Object.getOwnPropertyDescriptor(ze,Fe))})}return he}function oe(he,pe,ze){return pe in he?Object.defineProperty(he,pe,{value:ze,enumerable:!0,configurable:!0,writable:!0}):he[pe]=ze,he}function re(he,pe){if(!(he instanceof pe))throw new TypeError("Cannot call a class as a function")}function Ce(he,pe){for(var ze=0;ze<pe.length;ze++){var Fe=pe[ze];Fe.enumerable=Fe.enumerable||!1,Fe.configurable=!0,"value"in Fe&&(Fe.writable=!0),Object.defineProperty(he,Fe.key,Fe)}}function ie(he,pe,ze){return pe&&Ce(he.prototype,pe),ze&&Ce(he,ze),he}var ae=r("buffer"),le=ae.Buffer,Ie=r("util"),ue=Ie.inspect,de=ue&&ue.custom||"inspect";function Ne(he,pe,ze){le.prototype.copy.call(he,pe,ze)}g.exports=function(){function he(){re(this,he),this.head=null,this.tail=null,this.length=0}return ie(he,[{key:"push",value:function(ze){var Fe={data:ze,next:null};this.length>0?this.tail.next=Fe:this.head=Fe,this.tail=Fe,++this.length}},{key:"unshift",value:function(ze){var Fe={data:ze,next:this.head};this.length===0&&(this.tail=Fe),this.head=Fe,++this.length}},{key:"shift",value:function(){if(this.length!==0){var ze=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ze}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(ze){if(this.length===0)return"";for(var Fe=this.head,xe=""+Fe.data;Fe=Fe.next;)xe+=ze+Fe.data;return xe}},{key:"concat",value:function(ze){if(this.length===0)return le.alloc(0);for(var Fe=le.allocUnsafe(ze>>>0),xe=this.head,_e=0;xe;)Ne(xe.data,Fe,_e),_e+=xe.data.length,xe=xe.next;return Fe}},{key:"consume",value:function(ze,Fe){var xe;return ze<this.head.data.length?(xe=this.head.data.slice(0,ze),this.head.data=this.head.data.slice(ze)):ze===this.head.data.length?xe=this.shift():xe=Fe?this._getString(ze):this._getBuffer(ze),xe}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(ze){var Fe=this.head,xe=1,_e=Fe.data;for(ze-=_e.length;Fe=Fe.next;){var Dt=Fe.data,$e=ze>Dt.length?Dt.length:ze;if($e===Dt.length?_e+=Dt:_e+=Dt.slice(0,ze),ze-=$e,ze===0){$e===Dt.length?(++xe,Fe.next?this.head=Fe.next:this.head=this.tail=null):(this.head=Fe,Fe.data=Dt.slice($e));break}++xe}return this.length-=xe,_e}},{key:"_getBuffer",value:function(ze){var Fe=le.allocUnsafe(ze),xe=this.head,_e=1;for(xe.data.copy(Fe),ze-=xe.data.length;xe=xe.next;){var Dt=xe.data,$e=ze>Dt.length?Dt.length:ze;if(Dt.copy(Fe,Fe.length-ze,0,$e),ze-=$e,ze===0){$e===Dt.length?(++_e,xe.next?this.head=xe.next:this.head=this.tail=null):(this.head=xe,xe.data=Dt.slice($e));break}++_e}return this.length-=_e,Fe}},{key:de,value:function(ze,Fe){return ue(this,$({},Fe,{depth:0,customInspect:!1}))}}]),he}()},{buffer:17,util:16}],63:[function(r,g,k){(function(V){(function(){function $(le,Ie){var ue=this,de=this._readableState&&this._readableState.destroyed,Ne=this._writableState&&this._writableState.destroyed;return de||Ne?(Ie?Ie(le):le&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,V.nextTick(ie,this,le)):V.nextTick(ie,this,le)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(le||null,function(he){!Ie&&he?ue._writableState?ue._writableState.errorEmitted?V.nextTick(re,ue):(ue._writableState.errorEmitted=!0,V.nextTick(oe,ue,he)):V.nextTick(oe,ue,he):Ie?(V.nextTick(re,ue),Ie(he)):V.nextTick(re,ue)}),this)}function oe(le,Ie){ie(le,Ie),re(le)}function re(le){le._writableState&&!le._writableState.emitClose||le._readableState&&!le._readableState.emitClose||le.emit("close")}function Ce(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function ie(le,Ie){le.emit("error",Ie)}function ae(le,Ie){var ue=le._readableState,de=le._writableState;ue&&ue.autoDestroy||de&&de.autoDestroy?le.destroy(Ie):le.emit("error",Ie)}g.exports={destroy:$,undestroy:Ce,errorOrDestroy:ae}}).call(this)}).call(this,r("_process"))},{_process:50}],64:[function(r,g,k){var V=r("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function $(ie){var ae=!1;return function(){if(!ae){ae=!0;for(var le=arguments.length,Ie=new Array(le),ue=0;ue<le;ue++)Ie[ue]=arguments[ue];ie.apply(this,Ie)}}}function oe(){}function re(ie){return ie.setHeader&&typeof ie.abort=="function"}function Ce(ie,ae,le){if(typeof ae=="function")return Ce(ie,null,ae);ae||(ae={}),le=$(le||oe);var Ie=ae.readable||ae.readable!==!1&&ie.readable,ue=ae.writable||ae.writable!==!1&&ie.writable,de=function(){ie.writable||he()},Ne=ie._writableState&&ie._writableState.finished,he=function(){ue=!1,Ne=!0,Ie||le.call(ie)},pe=ie._readableState&&ie._readableState.endEmitted,ze=function(){Ie=!1,pe=!0,ue||le.call(ie)},Fe=function($e){le.call(ie,$e)},xe=function(){var $e;if(Ie&&!pe)return(!ie._readableState||!ie._readableState.ended)&&($e=new V),le.call(ie,$e);if(ue&&!Ne)return(!ie._writableState||!ie._writableState.ended)&&($e=new V),le.call(ie,$e)},_e=function(){ie.req.on("finish",he)};return re(ie)?(ie.on("complete",he),ie.on("abort",xe),ie.req?_e():ie.on("request",_e)):ue&&!ie._writableState&&(ie.on("end",de),ie.on("close",de)),ie.on("end",ze),ie.on("finish",he),ae.error!==!1&&ie.on("error",Fe),ie.on("close",xe),function(){ie.removeListener("complete",he),ie.removeListener("abort",xe),ie.removeListener("request",_e),ie.req&&ie.req.removeListener("finish",he),ie.removeListener("end",de),ie.removeListener("close",de),ie.removeListener("finish",he),ie.removeListener("end",ze),ie.removeListener("error",Fe),ie.removeListener("close",xe)}}g.exports=Ce},{"../../../errors":55}],65:[function(r,g,k){g.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],66:[function(r,g,k){var V;function $(he){var pe=!1;return function(){pe||(pe=!0,he.apply(void 0,arguments))}}var oe=r("../../../errors").codes,re=oe.ERR_MISSING_ARGS,Ce=oe.ERR_STREAM_DESTROYED;function ie(he){if(he)throw he}function ae(he){return he.setHeader&&typeof he.abort=="function"}function le(he,pe,ze,Fe){Fe=$(Fe);var xe=!1;he.on("close",function(){xe=!0}),V===void 0&&(V=r("./end-of-stream")),V(he,{readable:pe,writable:ze},function(Dt){if(Dt)return Fe(Dt);xe=!0,Fe()});var _e=!1;return function(Dt){if(!xe&&!_e){if(_e=!0,ae(he))return he.abort();if(typeof he.destroy=="function")return he.destroy();Fe(Dt||new Ce("pipe"))}}}function Ie(he){he()}function ue(he,pe){return he.pipe(pe)}function de(he){return!he.length||typeof he[he.length-1]!="function"?ie:he.pop()}function Ne(){for(var he=arguments.length,pe=new Array(he),ze=0;ze<he;ze++)pe[ze]=arguments[ze];var Fe=de(pe);if(Array.isArray(pe[0])&&(pe=pe[0]),pe.length<2)throw new re("streams");var xe,_e=pe.map(function(Dt,$e){var Ue=$e<pe.length-1,Ve=$e>0;return le(Dt,Ue,Ve,function(Oe){xe||(xe=Oe),Oe&&_e.forEach(Ie),!Ue&&(_e.forEach(Ie),Fe(xe))})});return pe.reduce(ue)}g.exports=Ne},{"../../../errors":55,"./end-of-stream":64}],67:[function(r,g,k){var V=r("../../../errors").codes.ERR_INVALID_OPT_VALUE;function $(re,Ce,ie){return re.highWaterMark!=null?re.highWaterMark:Ce?re[ie]:null}function oe(re,Ce,ie,ae){var le=$(Ce,ae,ie);if(le!=null){if(!(isFinite(le)&&Math.floor(le)===le)||le<0){var Ie=ae?ie:"highWaterMark";throw new V(Ie,le)}return Math.floor(le)}return re.objectMode?16:16*1024}g.exports={getHighWaterMark:oe}},{"../../../errors":55}],68:[function(r,g,k){g.exports=r("events").EventEmitter},{events:22}],69:[function(r,g,k){k=g.exports=r("./lib/_stream_readable.js"),k.Stream=k,k.Readable=k,k.Writable=r("./lib/_stream_writable.js"),k.Duplex=r("./lib/_stream_duplex.js"),k.Transform=r("./lib/_stream_transform.js"),k.PassThrough=r("./lib/_stream_passthrough.js"),k.finished=r("./lib/internal/streams/end-of-stream.js"),k.pipeline=r("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":56,"./lib/_stream_passthrough.js":57,"./lib/_stream_readable.js":58,"./lib/_stream_transform.js":59,"./lib/_stream_writable.js":60,"./lib/internal/streams/end-of-stream.js":64,"./lib/internal/streams/pipeline.js":66}],70:[function(r,g,k){function V(oe,re,Ce){var ie=this;this._callback=oe,this._args=Ce,this._interval=setInterval(oe,re,this._args),this.reschedule=function(ae){ae||(ae=ie._interval),ie._interval&&clearInterval(ie._interval),ie._interval=setInterval(ie._callback,ae,ie._args)},this.clear=function(){ie._interval&&(clearInterval(ie._interval),ie._interval=void 0)},this.destroy=function(){ie._interval&&clearInterval(ie._interval),ie._callback=void 0,ie._interval=void 0,ie._args=void 0}}function $(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var oe;if(arguments.length>0){oe=new Array(arguments.length-2);for(var re=0;re<oe.length;re++)oe[re]=arguments[re+2]}return new V(arguments[0],arguments[1],oe)}g.exports=$},{}],71:[function(r,g,k){g.exports=r("./index.js")()},{"./index.js":72}],72:[function(r,g,k){(function(V){(function(){g.exports=oe;function $(Ce){return Ce instanceof V?V.from(Ce):new Ce.constructor(Ce.buffer.slice(),Ce.byteOffset,Ce.length)}function oe(Ce){if(Ce=Ce||{},Ce.circles)return re(Ce);return Ce.proto?le:ae;function ie(Ie,ue){for(var de=Object.keys(Ie),Ne=new Array(de.length),he=0;he<de.length;he++){var pe=de[he],ze=Ie[pe];typeof ze!="object"||ze===null?Ne[pe]=ze:ze instanceof Date?Ne[pe]=new Date(ze):ArrayBuffer.isView(ze)?Ne[pe]=$(ze):Ne[pe]=ue(ze)}return Ne}function ae(Ie){if(typeof Ie!="object"||Ie===null)return Ie;if(Ie instanceof Date)return new Date(Ie);if(Array.isArray(Ie))return ie(Ie,ae);if(Ie instanceof Map)return new Map(ie(Array.from(Ie),ae));if(Ie instanceof Set)return new Set(ie(Array.from(Ie),ae));var ue={};for(var de in Ie)if(Object.hasOwnProperty.call(Ie,de)!==!1){var Ne=Ie[de];typeof Ne!="object"||Ne===null?ue[de]=Ne:Ne instanceof Date?ue[de]=new Date(Ne):Ne instanceof Map?ue[de]=new Map(ie(Array.from(Ne),ae)):Ne instanceof Set?ue[de]=new Set(ie(Array.from(Ne),ae)):ArrayBuffer.isView(Ne)?ue[de]=$(Ne):ue[de]=ae(Ne)}return ue}function le(Ie){if(typeof Ie!="object"||Ie===null)return Ie;if(Ie instanceof Date)return new Date(Ie);if(Array.isArray(Ie))return ie(Ie,le);if(Ie instanceof Map)return new Map(ie(Array.from(Ie),le));if(Ie instanceof Set)return new Set(ie(Array.from(Ie),le));var ue={};for(var de in Ie){var Ne=Ie[de];typeof Ne!="object"||Ne===null?ue[de]=Ne:Ne instanceof Date?ue[de]=new Date(Ne):Ne instanceof Map?ue[de]=new Map(ie(Array.from(Ne),le)):Ne instanceof Set?ue[de]=new Set(ie(Array.from(Ne),le)):ArrayBuffer.isView(Ne)?ue[de]=$(Ne):ue[de]=le(Ne)}return ue}}function re(Ce){var ie=[],ae=[];return Ce.proto?ue:Ie;function le(de,Ne){for(var he=Object.keys(de),pe=new Array(he.length),ze=0;ze<he.length;ze++){var Fe=he[ze],xe=de[Fe];if(typeof xe!="object"||xe===null)pe[Fe]=xe;else if(xe instanceof Date)pe[Fe]=new Date(xe);else if(ArrayBuffer.isView(xe))pe[Fe]=$(xe);else{var _e=ie.indexOf(xe);_e!==-1?pe[Fe]=ae[_e]:pe[Fe]=Ne(xe)}}return pe}function Ie(de){if(typeof de!="object"||de===null)return de;if(de instanceof Date)return new Date(de);if(Array.isArray(de))return le(de,Ie);if(de instanceof Map)return new Map(le(Array.from(de),Ie));if(de instanceof Set)return new Set(le(Array.from(de),Ie));var Ne={};ie.push(de),ae.push(Ne);for(var he in de)if(Object.hasOwnProperty.call(de,he)!==!1){var pe=de[he];if(typeof pe!="object"||pe===null)Ne[he]=pe;else if(pe instanceof Date)Ne[he]=new Date(pe);else if(pe instanceof Map)Ne[he]=new Map(le(Array.from(pe),Ie));else if(pe instanceof Set)Ne[he]=new Set(le(Array.from(pe),Ie));else if(ArrayBuffer.isView(pe))Ne[he]=$(pe);else{var ze=ie.indexOf(pe);ze!==-1?Ne[he]=ae[ze]:Ne[he]=Ie(pe)}}return ie.pop(),ae.pop(),Ne}function ue(de){if(typeof de!="object"||de===null)return de;if(de instanceof Date)return new Date(de);if(Array.isArray(de))return le(de,ue);if(de instanceof Map)return new Map(le(Array.from(de),ue));if(de instanceof Set)return new Set(le(Array.from(de),ue));var Ne={};ie.push(de),ae.push(Ne);for(var he in de){var pe=de[he];if(typeof pe!="object"||pe===null)Ne[he]=pe;else if(pe instanceof Date)Ne[he]=new Date(pe);else if(pe instanceof Map)Ne[he]=new Map(le(Array.from(pe),ue));else if(pe instanceof Set)Ne[he]=new Set(le(Array.from(pe),ue));else if(ArrayBuffer.isView(pe))Ne[he]=$(pe);else{var ze=ie.indexOf(pe);ze!==-1?Ne[he]=ae[ze]:Ne[he]=ue(pe)}}return ie.pop(),ae.pop(),Ne}}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],73:[function(r,g,k){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var V=r("buffer"),$=V.Buffer;function oe(Ce,ie){for(var ae in Ce)ie[ae]=Ce[ae]}$.from&&$.alloc&&$.allocUnsafe&&$.allocUnsafeSlow?g.exports=V:(oe(V,k),k.Buffer=re);function re(Ce,ie,ae){return $(Ce,ie,ae)}re.prototype=Object.create($.prototype),oe($,re),re.from=function(Ce,ie,ae){if(typeof Ce=="number")throw new TypeError("Argument must not be a number");return $(Ce,ie,ae)},re.alloc=function(Ce,ie,ae){if(typeof Ce!="number")throw new TypeError("Argument must be a number");var le=$(Ce);return ie!==void 0?typeof ae=="string"?le.fill(ie,ae):le.fill(ie):le.fill(0),le},re.allocUnsafe=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return $(Ce)},re.allocUnsafeSlow=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return V.SlowBuffer(Ce)}},{buffer:17}],74:[function(r,g,k){g.exports=V;function V(oe){var re=oe._readableState;return re?re.objectMode||typeof oe._duplexState=="number"?oe.read():oe.read($(re)):null}function $(oe){return oe.buffer.length?oe.buffer.head?oe.buffer.head.data.length:oe.buffer[0].length:oe.length}},{}],75:[function(r,g,k){var V=r("safe-buffer").Buffer,$=V.isEncoding||function(_e){switch(_e=""+_e,_e&&_e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function oe(_e){if(!_e)return"utf8";for(var Dt;;)switch(_e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return _e;default:if(Dt)return;_e=(""+_e).toLowerCase(),Dt=!0}}function re(_e){var Dt=oe(_e);if(typeof Dt!="string"&&(V.isEncoding===$||!$(_e)))throw new Error("Unknown encoding: "+_e);return Dt||_e}k.StringDecoder=Ce;function Ce(_e){this.encoding=re(_e);var Dt;switch(this.encoding){case"utf16le":this.text=Ne,this.end=he,Dt=4;break;case"utf8":this.fillLast=Ie,Dt=4;break;case"base64":this.text=pe,this.end=ze,Dt=3;break;default:this.write=Fe,this.end=xe;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=V.allocUnsafe(Dt)}Ce.prototype.write=function(_e){if(_e.length===0)return"";var Dt,$e;if(this.lastNeed){if(Dt=this.fillLast(_e),Dt===void 0)return"";$e=this.lastNeed,this.lastNeed=0}else $e=0;return $e<_e.length?Dt?Dt+this.text(_e,$e):this.text(_e,$e):Dt||""},Ce.prototype.end=de,Ce.prototype.text=ue,Ce.prototype.fillLast=function(_e){if(this.lastNeed<=_e.length)return _e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,_e.length),this.lastNeed-=_e.length};function ie(_e){return _e<=127?0:_e>>5===6?2:_e>>4===14?3:_e>>3===30?4:_e>>6===2?-1:-2}function ae(_e,Dt,$e){var Ue=Dt.length-1;if(Ue<$e)return 0;var Ve=ie(Dt[Ue]);return Ve>=0?(Ve>0&&(_e.lastNeed=Ve-1),Ve):--Ue<$e||Ve===-2?0:(Ve=ie(Dt[Ue]),Ve>=0?(Ve>0&&(_e.lastNeed=Ve-2),Ve):--Ue<$e||Ve===-2?0:(Ve=ie(Dt[Ue]),Ve>=0?(Ve>0&&(Ve===2?Ve=0:_e.lastNeed=Ve-3),Ve):0))}function le(_e,Dt,$e){if((Dt[0]&192)!==128)return _e.lastNeed=0,"�";if(_e.lastNeed>1&&Dt.length>1){if((Dt[1]&192)!==128)return _e.lastNeed=1,"�";if(_e.lastNeed>2&&Dt.length>2&&(Dt[2]&192)!==128)return _e.lastNeed=2,"�"}}function Ie(_e){var Dt=this.lastTotal-this.lastNeed,$e=le(this,_e);if($e!==void 0)return $e;if(this.lastNeed<=_e.length)return _e.copy(this.lastChar,Dt,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_e.copy(this.lastChar,Dt,0,_e.length),this.lastNeed-=_e.length}function ue(_e,Dt){var $e=ae(this,_e,Dt);if(!this.lastNeed)return _e.toString("utf8",Dt);this.lastTotal=$e;var Ue=_e.length-($e-this.lastNeed);return _e.copy(this.lastChar,0,Ue),_e.toString("utf8",Dt,Ue)}function de(_e){var Dt=_e&&_e.length?this.write(_e):"";return this.lastNeed?Dt+"�":Dt}function Ne(_e,Dt){if((_e.length-Dt)%2===0){var $e=_e.toString("utf16le",Dt);if($e){var Ue=$e.charCodeAt($e.length-1);if(Ue>=55296&&Ue<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_e[_e.length-2],this.lastChar[1]=_e[_e.length-1],$e.slice(0,-1)}return $e}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_e[_e.length-1],_e.toString("utf16le",Dt,_e.length-1)}function he(_e){var Dt=_e&&_e.length?this.write(_e):"";if(this.lastNeed){var $e=this.lastTotal-this.lastNeed;return Dt+this.lastChar.toString("utf16le",0,$e)}return Dt}function pe(_e,Dt){var $e=(_e.length-Dt)%3;return $e===0?_e.toString("base64",Dt):(this.lastNeed=3-$e,this.lastTotal=3,$e===1?this.lastChar[0]=_e[_e.length-1]:(this.lastChar[0]=_e[_e.length-2],this.lastChar[1]=_e[_e.length-1]),_e.toString("base64",Dt,_e.length-$e))}function ze(_e){var Dt=_e&&_e.length?this.write(_e):"";return this.lastNeed?Dt+this.lastChar.toString("base64",0,3-this.lastNeed):Dt}function Fe(_e){return _e.toString(this.encoding)}function xe(_e){return _e&&_e.length?this.write(_e):""}},{"safe-buffer":73}],76:[function(r,g,k){var V=r("punycode"),$=r("./util");k.parse=Dt,k.resolve=Ue,k.resolveObject=Ve,k.format=$e,k.Url=oe;function oe(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var re=/^([a-z0-9.+-]+:)/i,Ce=/:[0-9]*$/,ie=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ae=["<",">",'"',"`"," ","\r",`
1303
- `," "],le=["{","}","|","\\","^","`"].concat(ae),Ie=["'"].concat(le),ue=["%","/","?",";","#"].concat(Ie),de=["/","?","#"],Ne=255,he=/^[+a-z0-9A-Z_-]{0,63}$/,pe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ze={javascript:!0,"javascript:":!0},Fe={javascript:!0,"javascript:":!0},xe={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_e=r("querystring");function Dt(Oe,At,qe){if(Oe&&$.isObject(Oe)&&Oe instanceof oe)return Oe;var Lt=new oe;return Lt.parse(Oe,At,qe),Lt}oe.prototype.parse=function(Oe,At,qe){if(!$.isString(Oe))throw new TypeError("Parameter 'url' must be a string, not "+typeof Oe);var Lt=Oe.indexOf("?"),kt=Lt!==-1&&Lt<Oe.indexOf("#")?"?":"#",jt=Oe.split(kt),ti=/\\/g;jt[0]=jt[0].replace(ti,"/"),Oe=jt.join(kt);var ei=Oe;if(ei=ei.trim(),!qe&&Oe.split("#").length===1){var Pt=ie.exec(ei);if(Pt)return this.path=ei,this.href=ei,this.pathname=Pt[1],Pt[2]?(this.search=Pt[2],At?this.query=_e.parse(this.search.substr(1)):this.query=this.search.substr(1)):At&&(this.search="",this.query={}),this}var ni=re.exec(ei);if(ni){ni=ni[0];var gi=ni.toLowerCase();this.protocol=gi,ei=ei.substr(ni.length)}if(qe||ni||ei.match(/^\/\/[^@\/]+@[^@\/]+/)){var di=ei.substr(0,2)==="//";di&&!(ni&&Fe[ni])&&(ei=ei.substr(2),this.slashes=!0)}if(!Fe[ni]&&(di||ni&&!xe[ni])){for(var li=-1,ai=0;ai<de.length;ai++){var ci=ei.indexOf(de[ai]);ci!==-1&&(li===-1||ci<li)&&(li=ci)}var pi,yi;li===-1?yi=ei.lastIndexOf("@"):yi=ei.lastIndexOf("@",li),yi!==-1&&(pi=ei.slice(0,yi),ei=ei.slice(yi+1),this.auth=decodeURIComponent(pi)),li=-1;for(var ai=0;ai<ue.length;ai++){var ci=ei.indexOf(ue[ai]);ci!==-1&&(li===-1||ci<li)&&(li=ci)}li===-1&&(li=ei.length),this.host=ei.slice(0,li),ei=ei.slice(li),this.parseHost(),this.hostname=this.hostname||"";var Ai=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Ai)for(var hi=this.hostname.split(/\./),ai=0,wi=hi.length;ai<wi;ai++){var Ci=hi[ai];if(Ci&&!Ci.match(he)){for(var mi="",Ni=0,Mi=Ci.length;Ni<Mi;Ni++)Ci.charCodeAt(Ni)>127?mi+="x":mi+=Ci[Ni];if(!mi.match(he)){var fi=hi.slice(0,ai),zi=hi.slice(ai+1),Si=Ci.match(pe);Si&&(fi.push(Si[1]),zi.unshift(Si[2])),zi.length&&(ei="/"+zi.join(".")+ei),this.hostname=fi.join(".");break}}}this.hostname.length>Ne?this.hostname="":this.hostname=this.hostname.toLowerCase(),Ai||(this.hostname=V.toASCII(this.hostname));var si=this.port?":"+this.port:"",Ii=this.hostname||"";this.host=Ii+si,this.href+=this.host,Ai&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ei[0]!=="/"&&(ei="/"+ei))}if(!ze[gi])for(var ai=0,wi=Ie.length;ai<wi;ai++){var oi=Ie[ai];if(ei.indexOf(oi)!==-1){var Et=encodeURIComponent(oi);Et===oi&&(Et=escape(oi)),ei=ei.split(oi).join(Et)}}var ii=ei.indexOf("#");ii!==-1&&(this.hash=ei.substr(ii),ei=ei.slice(0,ii));var ri=ei.indexOf("?");if(ri!==-1?(this.search=ei.substr(ri),this.query=ei.substr(ri+1),At&&(this.query=_e.parse(this.query)),ei=ei.slice(0,ri)):At&&(this.search="",this.query={}),ei&&(this.pathname=ei),xe[gi]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var si=this.pathname||"",ui=this.search||"";this.path=si+ui}return this.href=this.format(),this};function $e(Oe){return $.isString(Oe)&&(Oe=Dt(Oe)),Oe instanceof oe?Oe.format():oe.prototype.format.call(Oe)}oe.prototype.format=function(){var Oe=this.auth||"";Oe&&(Oe=encodeURIComponent(Oe),Oe=Oe.replace(/%3A/i,":"),Oe+="@");var At=this.protocol||"",qe=this.pathname||"",Lt=this.hash||"",kt=!1,jt="";this.host?kt=Oe+this.host:this.hostname&&(kt=Oe+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(kt+=":"+this.port)),this.query&&$.isObject(this.query)&&Object.keys(this.query).length&&(jt=_e.stringify(this.query));var ti=this.search||jt&&"?"+jt||"";return At&&At.substr(-1)!==":"&&(At+=":"),this.slashes||(!At||xe[At])&&kt!==!1?(kt="//"+(kt||""),qe&&qe.charAt(0)!=="/"&&(qe="/"+qe)):kt||(kt=""),Lt&&Lt.charAt(0)!=="#"&&(Lt="#"+Lt),ti&&ti.charAt(0)!=="?"&&(ti="?"+ti),qe=qe.replace(/[?#]/g,function(ei){return encodeURIComponent(ei)}),ti=ti.replace("#","%23"),At+kt+qe+ti+Lt};function Ue(Oe,At){return Dt(Oe,!1,!0).resolve(At)}oe.prototype.resolve=function(Oe){return this.resolveObject(Dt(Oe,!1,!0)).format()};function Ve(Oe,At){return Oe?Dt(Oe,!1,!0).resolveObject(At):At}oe.prototype.resolveObject=function(Oe){if($.isString(Oe)){var At=new oe;At.parse(Oe,!1,!0),Oe=At}for(var qe=new oe,Lt=Object.keys(this),kt=0;kt<Lt.length;kt++){var jt=Lt[kt];qe[jt]=this[jt]}if(qe.hash=Oe.hash,Oe.href==="")return qe.href=qe.format(),qe;if(Oe.slashes&&!Oe.protocol){for(var ti=Object.keys(Oe),ei=0;ei<ti.length;ei++){var Pt=ti[ei];Pt!=="protocol"&&(qe[Pt]=Oe[Pt])}return xe[qe.protocol]&&qe.hostname&&!qe.pathname&&(qe.path=qe.pathname="/"),qe.href=qe.format(),qe}if(Oe.protocol&&Oe.protocol!==qe.protocol){if(!xe[Oe.protocol]){for(var ni=Object.keys(Oe),gi=0;gi<ni.length;gi++){var di=ni[gi];qe[di]=Oe[di]}return qe.href=qe.format(),qe}if(qe.protocol=Oe.protocol,!Oe.host&&!Fe[Oe.protocol]){for(var wi=(Oe.pathname||"").split("/");wi.length&&!(Oe.host=wi.shift()););Oe.host||(Oe.host=""),Oe.hostname||(Oe.hostname=""),wi[0]!==""&&wi.unshift(""),wi.length<2&&wi.unshift(""),qe.pathname=wi.join("/")}else qe.pathname=Oe.pathname;if(qe.search=Oe.search,qe.query=Oe.query,qe.host=Oe.host||"",qe.auth=Oe.auth,qe.hostname=Oe.hostname||Oe.host,qe.port=Oe.port,qe.pathname||qe.search){var li=qe.pathname||"",ai=qe.search||"";qe.path=li+ai}return qe.slashes=qe.slashes||Oe.slashes,qe.href=qe.format(),qe}var ci=qe.pathname&&qe.pathname.charAt(0)==="/",pi=Oe.host||Oe.pathname&&Oe.pathname.charAt(0)==="/",yi=pi||ci||qe.host&&Oe.pathname,Ai=yi,hi=qe.pathname&&qe.pathname.split("/")||[],wi=Oe.pathname&&Oe.pathname.split("/")||[],Ci=qe.protocol&&!xe[qe.protocol];if(Ci&&(qe.hostname="",qe.port=null,qe.host&&(hi[0]===""?hi[0]=qe.host:hi.unshift(qe.host)),qe.host="",Oe.protocol&&(Oe.hostname=null,Oe.port=null,Oe.host&&(wi[0]===""?wi[0]=Oe.host:wi.unshift(Oe.host)),Oe.host=null),yi=yi&&(wi[0]===""||hi[0]==="")),pi)qe.host=Oe.host||Oe.host===""?Oe.host:qe.host,qe.hostname=Oe.hostname||Oe.hostname===""?Oe.hostname:qe.hostname,qe.search=Oe.search,qe.query=Oe.query,hi=wi;else if(wi.length)hi||(hi=[]),hi.pop(),hi=hi.concat(wi),qe.search=Oe.search,qe.query=Oe.query;else if(!$.isNullOrUndefined(Oe.search)){if(Ci){qe.hostname=qe.host=hi.shift();var mi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;mi&&(qe.auth=mi.shift(),qe.host=qe.hostname=mi.shift())}return qe.search=Oe.search,qe.query=Oe.query,(!$.isNull(qe.pathname)||!$.isNull(qe.search))&&(qe.path=(qe.pathname?qe.pathname:"")+(qe.search?qe.search:"")),qe.href=qe.format(),qe}if(!hi.length)return qe.pathname=null,qe.search?qe.path="/"+qe.search:qe.path=null,qe.href=qe.format(),qe;for(var Ni=hi.slice(-1)[0],Mi=(qe.host||Oe.host||hi.length>1)&&(Ni==="."||Ni==="..")||Ni==="",fi=0,zi=hi.length;zi>=0;zi--)Ni=hi[zi],Ni==="."?hi.splice(zi,1):Ni===".."?(hi.splice(zi,1),fi++):fi&&(hi.splice(zi,1),fi--);if(!yi&&!Ai)for(;fi--;fi)hi.unshift("..");yi&&hi[0]!==""&&(!hi[0]||hi[0].charAt(0)!=="/")&&hi.unshift(""),Mi&&hi.join("/").substr(-1)!=="/"&&hi.push("");var Si=hi[0]===""||hi[0]&&hi[0].charAt(0)==="/";if(Ci){qe.hostname=qe.host=Si?"":hi.length?hi.shift():"";var mi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;mi&&(qe.auth=mi.shift(),qe.host=qe.hostname=mi.shift())}return yi=yi||qe.host&&hi.length,yi&&!Si&&hi.unshift(""),hi.length?qe.pathname=hi.join("/"):(qe.pathname=null,qe.path=null),(!$.isNull(qe.pathname)||!$.isNull(qe.search))&&(qe.path=(qe.pathname?qe.pathname:"")+(qe.search?qe.search:"")),qe.auth=Oe.auth||qe.auth,qe.slashes=qe.slashes||Oe.slashes,qe.href=qe.format(),qe},oe.prototype.parseHost=function(){var Oe=this.host,At=Ce.exec(Oe);At&&(At=At[0],At!==":"&&(this.port=At.substr(1)),Oe=Oe.substr(0,Oe.length-At.length)),Oe&&(this.hostname=Oe)}},{"./util":77,punycode:51,querystring:54}],77:[function(r,g,k){g.exports={isString:function(V){return typeof V=="string"},isObject:function(V){return typeof V=="object"&&V!==null},isNull:function(V){return V===null},isNullOrUndefined:function(V){return V==null}}},{}],78:[function(r,g,k){(function(V){(function(){g.exports=$;function $(re,Ce){if(oe("noDeprecation"))return re;var ie=!1;function ae(){if(!ie){if(oe("throwDeprecation"))throw new Error(Ce);oe("traceDeprecation")?console.trace(Ce):console.warn(Ce),ie=!0}return re.apply(this,arguments)}return ae}function oe(re){try{if(!V.localStorage)return!1}catch{return!1}var Ce=V.localStorage[re];return Ce==null?!1:String(Ce).toLowerCase()==="true"}}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],79:[function(r,g,k){g.exports=V;function V($,oe){if($&&oe)return V($)(oe);if(typeof $!="function")throw new TypeError("need wrapper function");return Object.keys($).forEach(function(Ce){re[Ce]=$[Ce]}),re;function re(){for(var Ce=new Array(arguments.length),ie=0;ie<Ce.length;ie++)Ce[ie]=arguments[ie];var ae=$.apply(this,Ce),le=Ce[Ce.length-1];return typeof ae=="function"&&ae!==le&&Object.keys(le).forEach(function(Ie){ae[Ie]=le[Ie]}),ae}}},{}],80:[function(r,g,k){g.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},{}],81:[function(r,g,k){g.exports=$;var V=Object.prototype.hasOwnProperty;function $(){for(var oe={},re=0;re<arguments.length;re++){var Ce=arguments[re];for(var ie in Ce)V.call(Ce,ie)&&(oe[ie]=Ce[ie])}return oe}},{}],82:[function(r,g,k){g.exports=function(V){V.prototype[Symbol.iterator]=function*(){for(let $=this.head;$;$=$.next)yield $.value}}},{}],83:[function(r,g,k){g.exports=V,V.Node=Ce,V.create=V;function V(ie){var ae=this;if(ae instanceof V||(ae=new V),ae.tail=null,ae.head=null,ae.length=0,ie&&typeof ie.forEach=="function")ie.forEach(function(ue){ae.push(ue)});else if(arguments.length>0)for(var le=0,Ie=arguments.length;le<Ie;le++)ae.push(arguments[le]);return ae}V.prototype.removeNode=function(ie){if(ie.list!==this)throw new Error("removing node which does not belong to this list");var ae=ie.next,le=ie.prev;return ae&&(ae.prev=le),le&&(le.next=ae),ie===this.head&&(this.head=ae),ie===this.tail&&(this.tail=le),ie.list.length--,ie.next=null,ie.prev=null,ie.list=null,ae},V.prototype.unshiftNode=function(ie){if(ie!==this.head){ie.list&&ie.list.removeNode(ie);var ae=this.head;ie.list=this,ie.next=ae,ae&&(ae.prev=ie),this.head=ie,this.tail||(this.tail=ie),this.length++}},V.prototype.pushNode=function(ie){if(ie!==this.tail){ie.list&&ie.list.removeNode(ie);var ae=this.tail;ie.list=this,ie.prev=ae,ae&&(ae.next=ie),this.tail=ie,this.head||(this.head=ie),this.length++}},V.prototype.push=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)oe(this,arguments[ie]);return this.length},V.prototype.unshift=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)re(this,arguments[ie]);return this.length},V.prototype.pop=function(){if(this.tail){var ie=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,ie}},V.prototype.shift=function(){if(this.head){var ie=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,ie}},V.prototype.forEach=function(ie,ae){ae=ae||this;for(var le=this.head,Ie=0;le!==null;Ie++)ie.call(ae,le.value,Ie,this),le=le.next},V.prototype.forEachReverse=function(ie,ae){ae=ae||this;for(var le=this.tail,Ie=this.length-1;le!==null;Ie--)ie.call(ae,le.value,Ie,this),le=le.prev},V.prototype.get=function(ie){for(var ae=0,le=this.head;le!==null&&ae<ie;ae++)le=le.next;if(ae===ie&&le!==null)return le.value},V.prototype.getReverse=function(ie){for(var ae=0,le=this.tail;le!==null&&ae<ie;ae++)le=le.prev;if(ae===ie&&le!==null)return le.value},V.prototype.map=function(ie,ae){ae=ae||this;for(var le=new V,Ie=this.head;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.next;return le},V.prototype.mapReverse=function(ie,ae){ae=ae||this;for(var le=new V,Ie=this.tail;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.prev;return le},V.prototype.reduce=function(ie,ae){var le,Ie=this.head;if(arguments.length>1)le=ae;else if(this.head)Ie=this.head.next,le=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var ue=0;Ie!==null;ue++)le=ie(le,Ie.value,ue),Ie=Ie.next;return le},V.prototype.reduceReverse=function(ie,ae){var le,Ie=this.tail;if(arguments.length>1)le=ae;else if(this.tail)Ie=this.tail.prev,le=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var ue=this.length-1;Ie!==null;ue--)le=ie(le,Ie.value,ue),Ie=Ie.prev;return le},V.prototype.toArray=function(){for(var ie=new Array(this.length),ae=0,le=this.head;le!==null;ae++)ie[ae]=le.value,le=le.next;return ie},V.prototype.toArrayReverse=function(){for(var ie=new Array(this.length),ae=0,le=this.tail;le!==null;ae++)ie[ae]=le.value,le=le.prev;return ie},V.prototype.slice=function(ie,ae){ae=ae||this.length,ae<0&&(ae+=this.length),ie=ie||0,ie<0&&(ie+=this.length);var le=new V;if(ae<ie||ae<0)return le;ie<0&&(ie=0),ae>this.length&&(ae=this.length);for(var Ie=0,ue=this.head;ue!==null&&Ie<ie;Ie++)ue=ue.next;for(;ue!==null&&Ie<ae;Ie++,ue=ue.next)le.push(ue.value);return le},V.prototype.sliceReverse=function(ie,ae){ae=ae||this.length,ae<0&&(ae+=this.length),ie=ie||0,ie<0&&(ie+=this.length);var le=new V;if(ae<ie||ae<0)return le;ie<0&&(ie=0),ae>this.length&&(ae=this.length);for(var Ie=this.length,ue=this.tail;ue!==null&&Ie>ae;Ie--)ue=ue.prev;for(;ue!==null&&Ie>ie;Ie--,ue=ue.prev)le.push(ue.value);return le},V.prototype.splice=function(ie,ae,...le){ie>this.length&&(ie=this.length-1),ie<0&&(ie=this.length+ie);for(var Ie=0,ue=this.head;ue!==null&&Ie<ie;Ie++)ue=ue.next;for(var de=[],Ie=0;ue&&Ie<ae;Ie++)de.push(ue.value),ue=this.removeNode(ue);ue===null&&(ue=this.tail),ue!==this.head&&ue!==this.tail&&(ue=ue.prev);for(var Ie=0;Ie<le.length;Ie++)ue=$(this,ue,le[Ie]);return de},V.prototype.reverse=function(){for(var ie=this.head,ae=this.tail,le=ie;le!==null;le=le.prev){var Ie=le.prev;le.prev=le.next,le.next=Ie}return this.head=ae,this.tail=ie,this};function $(ie,ae,le){var Ie=ae===ie.head?new Ce(le,null,ae,ie):new Ce(le,ae,ae.next,ie);return Ie.next===null&&(ie.tail=Ie),Ie.prev===null&&(ie.head=Ie),ie.length++,Ie}function oe(ie,ae){ie.tail=new Ce(ae,ie.tail,null,ie),ie.head||(ie.head=ie.tail),ie.length++}function re(ie,ae){ie.head=new Ce(ae,null,ie.head,ie),ie.tail||(ie.tail=ie.head),ie.length++}function Ce(ie,ae,le,Ie){if(!(this instanceof Ce))return new Ce(ie,ae,le,Ie);this.list=Ie,this.value=ie,ae?(ae.next=this,this.prev=ae):this.prev=null,le?(le.prev=this,this.next=le):this.next=null}try{r("./iterator.js")(V)}catch{}},{"./iterator.js":82}]},{},[12])(12)})})(mqtt);var mqttExports=mqtt.exports;let client;const sub=(i,n,r,g,k)=>{client=mqttExports.connect(i,{username:n,password:r}),client.on("connect",()=>{console.log("MQTT服务器连接成功"),console.log(client.options.clientId),client.subscribe(g,{qos:1})}),client.on("message",k)},close=()=>{client&&client.end&&client.end(!0,{},()=>{console.log("MQTT服务连接关闭")})},_hoisted_1=["transform"],_hoisted_2=["transform","onClick"],_hoisted_3=["transform"],_hoisted_4=["xlink:href","id","transform"],_hoisted_5=["id"],_sfc_main=vue.defineComponent({__name:"index",props:{data:{},canvasDrag:{type:Boolean,default:!0}},setup(i,{expose:n}){const r=i,g=vue.getCurrentInstance();Object.keys(vueComp).forEach(ue=>{var de;Object.keys((de=g==null?void 0:g.appContext)==null?void 0:de.components).includes(ue)||g==null||g.appContext.app.component(ue,vueComp[ue])});const k=vue.reactive(r.data??{layout_center:{x:0,y:0},config:{svg:{background_color:"#fff",scale:1,position_center:{x:-333,y:-113},svg_position_center:{x:50,y:50}},net:{mqtt:{url:"",user:"",pwd:"",topics:""}}},done_json:[]}),V=useGlobalStore(pinia),$=ue=>{if(V.mouse_info.state!=EMouseInfoState.Down&&V.intention!==EGlobalStoreIntention.Connection)return;if(!r.canvasDrag){console.log(r.canvasDrag);return}const{clientX:de,clientY:Ne}=ue;V.mouse_info.new_position_x=V.mouse_info.now_position_x+de-V.mouse_info.position_x,V.mouse_info.new_position_y=V.mouse_info.now_position_y+Ne-V.mouse_info.position_y,V.intention==EGlobalStoreIntention.MoveCanvas&&(k.layout_center.x=V.mouse_info.new_position_x,k.layout_center.y=V.mouse_info.new_position_y)},oe=()=>{V.mouse_info.state==EMouseInfoState.Down&&(V.intention!=EGlobalStoreIntention.Select&&(V.intention=EGlobalStoreIntention.None),V.setMouseInfo({state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}))},re=ue=>{console.log("onCanvasMouseDown",ue);const{clientX:de,clientY:Ne}=ue;V.intention=EGlobalStoreIntention.MoveCanvas,V.setMouseInfo({state:EMouseInfoState.Down,position_x:de,position_y:Ne,now_position_x:k.layout_center.x,now_position_y:k.layout_center.y,new_position_x:k.layout_center.x,new_position_y:k.layout_center.y})},Ce=(ue,de,Ne)=>({x:ue.x-ue.width/2*de+ue.width/2,y:ue.y-ue.height/2*Ne+ue.height/2,width:ue.width*de,height:ue.height*Ne}),ie=(ue,de,Ne)=>setArrItemByID(ue,de,Ne,k.done_json),ae=ue=>{var de;if(((de=ue.events)==null?void 0:de.length)>0){for(let Ne of ue.events)if(Ne.type===EEventType.Click||Ne.type===EEventType.Change){if(Ne.condition&&Ne.condition.type!=="None"&&Ne.condition.type==="Relation"&&Ne.condition.Relation&&Ne.condition.Relation.relation){const he=Ne.condition.Relation.key,pe=Ne.condition.Relation.relation,ze=valFormat(Ne.condition.Relation.val),Fe=valFormat(Ne.condition.Relation.val2);if(ue.props.hasOwnProperty(he)){const xe=ue.props[he].val;if(!le(xe,pe,ze,Fe))continue}}if(Ne.action===EEventAction.ChangeAttr){if(Ne.attrs&&Ne.attrs.length>0){let he;if(Ne.target){for(let pe of V.done_json)if(pe.id===Ne.target){he=pe;break}}else he=ue;if(!he)continue;for(let pe of Ne.attrs)he.state&&he.state.hasOwnProperty(pe.key)?he.state[pe.key].default=valFormat(pe.val):he.props.hasOwnProperty(pe.key)&&(he.props[pe.key].val=valFormat(pe.val))}}else Ne.action===EEventAction.JavaScript&&new Function(Ne.scripts)()}}},le=(ue,de,Ne,he)=>{switch(de){case">":return ue>Ne;case">=":return ue>=Ne;case"<":return ue<Ne;case"<=":return ue<=Ne;case"==":return ue==Ne;case"!=":return ue!=Ne;case">=,=<":return ue>=Ne&&ue<=he;case"<,>":return ue<Ne||ue>he}};vue.onMounted(()=>{Ie()}),vue.onBeforeUnmount(close);const Ie=()=>{const ue=k.config.net.mqtt;ue&&ue.url&&ue.user&&ue.pwd&&ue.topics&&sub(ue.url,ue.user,ue.pwd,ue.topics,(de,Ne)=>{console.log(de),console.log(Ne.toString())})};return n({setNodeAttrByID:ie}),(ue,de)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",onMousedown:re,onMousemove:$,onMouseup:oe},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:k.config.svg.background_color}),width:"100%",height:"100%"},[vue.createElementVNode("g",{transform:`translate(${k.config.svg.position_center.x+k.layout_center.x},${k.config.svg.position_center.y+k.layout_center.y})rotate(0)scale(${k.config.svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.done_json,Ne=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Ne.id,transform:`translate(${Ne.x},${Ne.y})rotate(0)scale(1)`,onClick:he=>ae(Ne)},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Ne)}`)},[vue.createElementVNode("g",{transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2})rotate(${Ne.rotate}) scale(1) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`},[Ne.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$d,{key:0,"item-info":Ne},null,8,["item-info"])):Ne.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Ne.name}`},vue.unref(prosToVBind)(Ne),{width:"100",height:"100",id:Ne.id,transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),null,16,_hoisted_4)):Ne.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ne.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Ne),{width:"100",height:"100",id:Ne.id,onOnChange:he=>ae(Ne),transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),null,16,["id","onOnChange","transform"])):Ne.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},Ce(Ne.actual_bound,Ne.scale_x,Ne.scale_y),{id:`foreign-object${Ne.id}`}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ne.tag),vue.mergeProps(vue.unref(prosToVBind)(Ne),{id:Ne.id,onOnChange:he=>ae(Ne),transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ne.tag_slot),1)]),_:2},1040,["id","onOnChange","transform"]))],16,_hoisted_5)):vue.createCommentVNode("",!0)],8,_hoisted_3)],2)],8,_hoisted_2)),[[vue.vShow,Ne.display]])),128))],8,_hoisted_1)],4))],32))}}),index_vue_vue_type_style_index_0_scoped_aefb5edf_lang="",index=_export_sfc(_sfc_main,[["__scopeId","data-v-aefb5edf"]]);exports.SvgEditor=index$1,exports.SvgViewer=index,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
1302
+ }`,"autocompletion.css",!1),g.AcePopup=Ie,g.$singleLineEditor=le,g.getAriaId=ae}),ace.define("ace/autocomplete/util",["require","exports","module"],function(r,g,k){g.parForEach=function($,oe,re){var Ce=0,ie=$.length;ie===0&&re();for(var ae=0;ae<ie;ae++)oe($[ae],function(le,Ie){Ce++,Ce===ie&&re(le,Ie)})};var V=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;g.retrievePrecedingIdentifier=function($,oe,re){re=re||V;for(var Ce=[],ie=oe-1;ie>=0&&re.test($[ie]);ie--)Ce.push($[ie]);return Ce.reverse().join("")},g.retrieveFollowingIdentifier=function($,oe,re){re=re||V;for(var Ce=[],ie=oe;ie<$.length&&re.test($[ie]);ie++)Ce.push($[ie]);return Ce},g.getCompletionPrefix=function($){var oe=$.getCursorPosition(),re=$.session.getLine(oe.row),Ce;return $.completers.forEach(function(ie){ie.identifierRegexps&&ie.identifierRegexps.forEach(function(ae){!Ce&&ae&&(Ce=this.retrievePrecedingIdentifier(re,oe.column,ae))}.bind(this))}.bind(this)),Ce||this.retrievePrecedingIdentifier(re,oe.column)}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],function(r,g,k){var V=r("./keyboard/hash_handler").HashHandler,$=r("./autocomplete/popup").AcePopup,oe=r("./autocomplete/popup").getAriaId,re=r("./autocomplete/util"),Ce=r("./lib/lang"),ie=r("./lib/dom"),ae=r("./snippets").snippetManager,le=r("./config"),Ie=function(){this.autoInsert=!1,this.autoSelect=!0,this.exactMatch=!1,this.gatherCompletionsId=0,this.keyboardHandler=new V,this.keyboardHandler.bindKeys(this.commands),this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.changeTimer=Ce.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=Ce.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){return this.popup=new $(document.body||document.documentElement),this.popup.on("click",function(de){this.insertMatch(),de.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.tooltipTimer.bind(null,null)),this.popup.on("select",this.tooltipTimer.bind(null,null)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},this.getPopup=function(){return this.popup||this.$init()},this.openPopup=function(de,Ne,he){this.popup||this.$init(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions({activeDescendant:oe(this.popup.getRow())}),de.keyBinding.addKeyboardHandler(this.keyboardHandler);var pe=de.renderer;if(this.popup.setRow(this.autoSelect?0:-1),he)he&&!Ne&&this.detach();else{this.popup.setTheme(de.getTheme()),this.popup.setFontSize(de.getFontSize());var ze=pe.layerConfig.lineHeight,Fe=pe.$cursorLayer.getPixelPosition(this.base,!0);Fe.left-=this.popup.getTextLeftOffset();var xe=de.container.getBoundingClientRect();Fe.top+=xe.top-pe.layerConfig.offset,Fe.left+=xe.left-de.renderer.scrollLeft,Fe.left+=pe.gutterWidth,this.popup.show(Fe,ze)}this.changeTimer.cancel()},this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener),this.changeTimer.cancel(),this.hideDocTooltip(),this.gatherCompletionsId+=1,this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completions=this.base=null},this.changeListener=function(de){var Ne=this.editor.selection.lead;(Ne.row!=this.base.row||Ne.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},this.blurListener=function(de){var Ne=document.activeElement,he=this.editor.textInput.getElement(),pe=de.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(de.relatedTarget),ze=this.popup&&this.popup.container;Ne!=he&&Ne.parentNode!=ze&&!pe&&Ne!=this.tooltipNode&&de.relatedTarget!=he&&this.detach()},this.mousedownListener=function(de){this.detach()},this.mousewheelListener=function(de){this.detach()},this.goTo=function(de){this.popup.goTo(de)},this.insertMatch=function(de,Ne){if(de||(de=this.popup.getData(this.popup.getRow())),!de)return!1;var he=this.completions;if(this.editor.startOperation({command:{name:"insertMatch"}}),de.completer&&de.completer.insertMatch)de.completer.insertMatch(this.editor,de);else{if(!he)return!1;if(he.filterText)for(var pe=this.editor.selection.getAllRanges(),ze=0,Fe;Fe=pe[ze];ze++)Fe.start.column-=he.filterText.length,this.editor.session.remove(Fe);de.snippet?ae.insertSnippet(this.editor,de.snippet):this.editor.execCommand("insertstring",de.value||de)}this.completions==he&&this.detach(),this.editor.endOperation()},this.commands={Up:function(de){de.completer.goTo("up")},Down:function(de){de.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(de){de.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(de){de.completer.goTo("end")},Esc:function(de){de.completer.detach()},Return:function(de){return de.completer.insertMatch()},"Shift-Return":function(de){de.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(de){var Ne=de.completer.insertMatch();if(!Ne&&!de.tabstopManager)de.completer.goTo("down");else return Ne},PageUp:function(de){de.completer.popup.gotoPageUp()},PageDown:function(de){de.completer.popup.gotoPageDown()}},this.gatherCompletions=function(de,Ne){var he=de.getSession(),pe=de.getCursorPosition(),ze=re.getCompletionPrefix(de);this.base=he.doc.createAnchor(pe.row,pe.column-ze.length),this.base.$insertRight=!0;var Fe=[],xe=de.completers.length;return de.completers.forEach(function(_e,Dt){_e.getCompletions(de,he,pe,ze,function($e,Ue){!$e&&Ue&&(Fe=Fe.concat(Ue)),Ne(null,{prefix:re.getCompletionPrefix(de),matches:Fe,finished:--xe===0})})}),!0},this.showPopup=function(de,Ne){this.editor&&this.detach(),this.activated=!0,this.editor=de,de.completer!=this&&(de.completer&&de.completer.detach(),de.completer=this),de.on("changeSelection",this.changeListener),de.on("blur",this.blurListener),de.on("mousedown",this.mousedownListener),de.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,Ne)},this.updateCompletions=function(de,Ne){if(de&&this.base&&this.completions){var he=this.editor.getCursorPosition(),pe=this.editor.session.getTextRange({start:this.base,end:he});if(pe==this.completions.filterText)return;if(this.completions.setFilter(pe),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==pe&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,pe,de);return}if(Ne&&Ne.matches){var he=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(he.row,he.column),this.base.$insertRight=!0,this.completions=new ue(Ne.matches),this.openPopup(this.editor,"",de)}var ze=this.gatherCompletionsId,Fe=function(Ue){if(Ue.finished)return this.detach()}.bind(this),xe=function(Ue){var Ve=Ue.prefix,Oe=Ue.matches;this.completions=new ue(Oe),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(Ve);var At=this.completions.filtered;if(!At.length||At.length==1&&At[0].value==Ve&&!At[0].snippet)return Fe(Ue);if(this.autoInsert&&At.length==1&&Ue.finished)return this.insertMatch(At[0]);this.openPopup(this.editor,Ve,de)}.bind(this),_e=!0,Dt=null;if(this.gatherCompletions(this.editor,function(Ue,Ve){var Oe=Ve.prefix,At=Ve&&Ve.matches;if(!At||!At.length)return Fe(Ve);if(!(Oe.indexOf(Ve.prefix)!==0||ze!=this.gatherCompletionsId)){if(_e){Dt=Ve;return}xe(Ve)}}.bind(this)),_e=!1,Dt){var $e=Dt;Dt=null,xe($e)}},this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},this.updateDocTooltip=function(){var de=this.popup,Ne=de.data,he=Ne&&(Ne[de.getHoveredRow()]||Ne[de.getRow()]),pe=null;if(!he||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();if(this.editor.completers.some(function(ze){return ze.getDocTooltip&&(pe=ze.getDocTooltip(he)),pe}),!pe&&typeof he!="string"&&(pe=he),typeof pe=="string"&&(pe={docText:pe}),!pe||!(pe.docHTML||pe.docText))return this.hideDocTooltip();this.showDocTooltip(pe)},this.showDocTooltip=function(de){this.tooltipNode||(this.tooltipNode=ie.createElement("div"),this.tooltipNode.className="ace_tooltip ace_doc-tooltip",this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this));var Ne=this.tooltipNode;de.docHTML?Ne.innerHTML=de.docHTML:de.docText&&(Ne.textContent=de.docText),Ne.parentNode||document.body.appendChild(Ne);var he=this.popup,pe=he.container.getBoundingClientRect();Ne.style.top=he.container.style.top,Ne.style.bottom=he.container.style.bottom,Ne.style.display="block",window.innerWidth-pe.right<320?pe.left<320?he.isTopdown?(Ne.style.top=pe.bottom+"px",Ne.style.left=pe.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.top=he.container.offsetTop-Ne.offsetHeight+"px",Ne.style.left=pe.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.right=window.innerWidth-pe.left+"px",Ne.style.left=""):(Ne.style.left=pe.right+1+"px",Ne.style.right="")},this.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var de=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==de&&this.editor.focus(),this.tooltipNode=null,de.parentNode&&de.parentNode.removeChild(de)}},this.onTooltipClick=function(de){for(var Ne=de.target;Ne&&Ne!=this.tooltipNode;){if(Ne.nodeName=="A"&&Ne.href){Ne.rel="noreferrer",Ne.target="_blank";break}Ne=Ne.parentNode}},this.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var de=this.popup.container;de&&de.parentNode&&de.parentNode.removeChild(de)}this.editor&&this.editor.completer==this&&this.editor.completer==null,this.popup=null}}).call(Ie.prototype),Ie.for=function(de){return de.completer||(le.get("sharedPopups")?(Ie.$shared||(Ie.$sharedInstance=new Ie),de.completer=Ie.$sharedInstance):(de.completer=new Ie,de.once("destroy",function(Ne,he){he.completer.destroy()}))),de.completer},Ie.startCommand={name:"startAutocomplete",exec:function(de,Ne){var he=Ie.for(de);he.autoInsert=!1,he.autoSelect=!0,he.showPopup(de,Ne),he.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var ue=function(de,Ne){this.all=de,this.filtered=de,this.filterText=Ne||"",this.exactMatch=!1};(function(){this.setFilter=function(de){if(de.length>this.filterText&&de.lastIndexOf(this.filterText,0)===0)var Ne=this.filtered;else var Ne=this.all;this.filterText=de,Ne=this.filterCompletions(Ne,this.filterText),Ne=Ne.sort(function(pe,ze){return ze.exactMatch-pe.exactMatch||ze.$score-pe.$score||(pe.caption||pe.value).localeCompare(ze.caption||ze.value)});var he=null;Ne=Ne.filter(function(pe){var ze=pe.snippet||pe.caption||pe.value;return ze===he?!1:(he=ze,!0)}),this.filtered=Ne},this.filterCompletions=function(de,Ne){var he=[],pe=Ne.toUpperCase(),ze=Ne.toLowerCase();e:for(var Fe=0,xe;xe=de[Fe];Fe++){var _e=xe.caption||xe.value||xe.snippet;if(_e){var Dt=-1,$e=0,Ue=0,Ve,Oe;if(this.exactMatch){if(Ne!==_e.substr(0,Ne.length))continue e}else{var At=_e.toLowerCase().indexOf(ze);if(At>-1)Ue=At;else for(var qe=0;qe<Ne.length;qe++){var Lt=_e.indexOf(ze[qe],Dt+1),kt=_e.indexOf(pe[qe],Dt+1);if(Ve=Lt>=0&&(kt<0||Lt<kt)?Lt:kt,Ve<0)continue e;Oe=Ve-Dt-1,Oe>0&&(Dt===-1&&(Ue+=10),Ue+=Oe,$e=$e|1<<qe),Dt=Ve}}xe.matchMask=$e,xe.exactMatch=Ue?0:1,xe.$score=(xe.score||0)-Ue,he.push(xe)}}return he}}).call(ue.prototype),g.Autocomplete=Ie,g.FilteredList=ue}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(r,g,k){var V=r("../range").Range,$=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function oe(Ce,ie){var ae=Ce.getTextRange(V.fromPoints({row:0,column:0},ie));return ae.split($).length-1}function re(Ce,ie){var ae=oe(Ce,ie),le=Ce.getValue().split($),Ie=Object.create(null),ue=le[ae];return le.forEach(function(de,Ne){if(!(!de||de===ue)){var he=Math.abs(ae-Ne),pe=le.length-he;Ie[de]?Ie[de]=Math.max(pe,Ie[de]):Ie[de]=pe}}),Ie}g.getCompletions=function(Ce,ie,ae,le,Ie){var ue=re(ie,ae),de=Object.keys(ue);Ie(null,de.map(function(Ne){return{caption:Ne,value:Ne,score:ue[Ne],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(r,g,k){var V=r("../snippets").snippetManager,$=r("../autocomplete").Autocomplete,oe=r("../config"),re=r("../lib/lang"),Ce=r("../autocomplete/util"),ie=r("../autocomplete/text_completer"),ae={getCompletions:function(xe,_e,Dt,$e,Ue){if(_e.$mode.completer)return _e.$mode.completer.getCompletions(xe,_e,Dt,$e,Ue);var Ve=xe.session.getState(Dt.row),Oe=_e.$mode.getCompletions(Ve,_e,Dt,$e);Ue(null,Oe)}},le=function(xe){var _e={};return xe.replace(/\${(\d+)(:(.*?))?}/g,function(Dt,$e,Ue,Ve){return _e[$e]=Ve||""}).replace(/\$(\d+?)/g,function(Dt,$e){return _e[$e]})},Ie={getCompletions:function(xe,_e,Dt,$e,Ue){var Ve=[],Oe=_e.getTokenAt(Dt.row,Dt.column);Oe&&Oe.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?Ve.push("html-tag"):Ve=V.getActiveScopes(xe);var At=V.snippetMap,qe=[];Ve.forEach(function(Lt){for(var kt=At[Lt]||[],jt=kt.length;jt--;){var ti=kt[jt],ei=ti.name||ti.tabTrigger;ei&&qe.push({caption:ei,snippet:ti.content,meta:ti.tabTrigger&&!ti.name?ti.tabTrigger+"⇥ ":"snippet",type:"snippet"})}},this),Ue(null,qe)},getDocTooltip:function(xe){xe.type=="snippet"&&!xe.docHTML&&(xe.docHTML=["<b>",re.escapeHTML(xe.caption),"</b>","<hr></hr>",re.escapeHTML(le(xe.snippet))].join(""))}},ue=[Ie,ie,ae];g.setCompleters=function(xe){ue.length=0,xe&&ue.push.apply(ue,xe)},g.addCompleter=function(xe){ue.push(xe)},g.textCompleter=ie,g.keyWordCompleter=ae,g.snippetCompleter=Ie;var de={name:"expandSnippet",exec:function(xe){return V.expandWithTab(xe)},bindKey:"Tab"},Ne=function(xe,_e){he(_e.session.$mode)},he=function(xe){typeof xe=="string"&&(xe=oe.$modes[xe]),xe&&(V.files||(V.files={}),pe(xe.$id,xe.snippetFileId),xe.modes&&xe.modes.forEach(he))},pe=function(xe,_e){!_e||!xe||V.files[xe]||(V.files[xe]={},oe.loadModule(_e,function(Dt){Dt&&(V.files[xe]=Dt,!Dt.snippets&&Dt.snippetText&&(Dt.snippets=V.parseSnippetFile(Dt.snippetText)),V.register(Dt.snippets||[],Dt.scope),Dt.includeScopes&&(V.snippetMap[Dt.scope].includeScopes=Dt.includeScopes,Dt.includeScopes.forEach(function($e){he("ace/mode/"+$e)})))}))},ze=function(xe){var _e=xe.editor,Dt=_e.completer&&_e.completer.activated;if(xe.command.name==="backspace")Dt&&!Ce.getCompletionPrefix(_e)&&_e.completer.detach();else if(xe.command.name==="insertstring"){var $e=Ce.getCompletionPrefix(_e);if($e&&!Dt){var Ue=$.for(_e);Ue.autoInsert=!1,Ue.showPopup(_e)}}},Fe=r("../editor").Editor;r("../config").defineOptions(Fe.prototype,"editor",{enableBasicAutocompletion:{set:function(xe){xe?(this.completers||(this.completers=Array.isArray(xe)?xe:ue),this.commands.addCommand($.startCommand)):this.commands.removeCommand($.startCommand)},value:!1},enableLiveAutocompletion:{set:function(xe){xe?(this.completers||(this.completers=Array.isArray(xe)?xe:ue),this.commands.on("afterExec",ze)):this.commands.removeListener("afterExec",ze)},value:!1},enableSnippets:{set:function(xe){xe?(this.commands.addCommand(de),this.on("changeMode",Ne),Ne(null,this)):(this.commands.removeCommand(de),this.off("changeMode",Ne))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(r){i&&(i.exports=r)})}()})(extLanguage_tools),ace$1.config.setModuleUrl("ace/theme/github",themeUrl),ace$1.config.setModuleUrl("ace/theme/kr_theme",themeUrl2),ace$1.config.setModuleUrl("ace/mode/base",workerBaseUrl),ace$1.config.setModuleUrl("ace/mode/json",modeJsonUrl),ace$1.config.setModuleUrl("ace/mode/json_worker",workerJsonUrl),ace$1.config.setModuleUrl("ace/snippets/json",snippetsJsonUrl),ace$1.config.setModuleUrl("ace/mode/javascript",modeJavascriptUrl),ace$1.config.setModuleUrl("ace/mode/javascript_worker",workerJavascriptUrl),ace$1.config.setModuleUrl("ace/snippets/javascript",snippetsJavascriptUrl),ace$1.require("ace/ext/language_tools");const _sfc_main$b=vue.defineComponent({__name:"code-edit-modal",props:{modelValue:{default:()=>({})},lang:{default:"json"},title:{default:"编辑"}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.ref(!1),k=vue.computed({get(){return r.lang==="json"?JSON.stringify(r.modelValue,null,2):r.modelValue},set(V){r.lang==="json"?n("update:modelValue",JSON.parse(V)):n("update:modelValue",V)}});return(V,$)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElButton),{onClick:$[0]||($[0]=oe=>g.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("···")]),_:1}),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:g.value,"onUpdate:modelValue":$[2]||($[2]=oe=>g.value=oe),title:r.title,width:"60%"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(VAceEditor),{value:k.value,"onUpdate:value":$[1]||($[1]=oe=>k.value=oe),lang:r.lang,theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value","lang"])]),_:1},8,["modelValue","title"])]))}}),_hoisted_1$7={class:"one-row-txt",style:{width:"78px"}},_hoisted_2$5={key:1},_hoisted_3$4={class:"one-row-txt",style:{width:"145px"}},_hoisted_4$2={key:1},_sfc_main$a=vue.defineComponent({__name:"dynamic-el-form-item",props:{objInfo:{default:()=>({})},hide:{default:()=>[]},code:{type:Boolean,default:!1}},setup(i){const n=i;return(r,g)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.objInfo,(k,V)=>(vue.openBlock(),vue.createElementBlock("div",{key:V},[n.code?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,class:"props-row",size:"small"},{label:vue.withCtx(()=>[vue.unref(getStringWidth)(String(V))>78?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:String(V),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$7,vue.toDisplayString(V),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$5,vue.toDisplayString(V),1))]),default:vue.withCtx(()=>[vue.unref(getStringWidth)(String(k.val))>145?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:k.val,placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$4,vue.toDisplayString(k.val),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$2,vue.toDisplayString(k.val),1))]),_:2},1024)):vue.createCommentVNode("",!0),n.hide.indexOf(String(V))<0?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:k.title,size:"small"},{default:vue.withCtx(()=>[k.type===vue.unref(EConfigItemPropsType).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElSelect),{key:0,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,placeholder:"Select",size:"small",disabled:!!(k!=null&&k.disabled)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.options,$=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:$.value,label:$.label,value:$.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).InputNumber?(vue.openBlock(),vue.createBlock(vue.unref(ElInputNumber),{key:1,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Input?(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:2,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Color?(vue.openBlock(),vue.createBlock(vue.unref(ElColorPicker),{key:3,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Switch?(vue.openBlock(),vue.createBlock(vue.unref(ElSwitch),{key:4,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).JsonEdit?(vue.openBlock(),vue.createBlock(_sfc_main$b,{key:5,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):vue.createCommentVNode("",!0)]),_:2},1032,["label"])):vue.createCommentVNode("",!0)]))),128))}}),dynamicElFormItem_vue_vue_type_style_index_0_scoped_a1ba665e_lang="",dynamicElFormItem_vue_vue_type_style_index_1_lang="",DynamicElFormItem=_export_sfc(_sfc_main$a,[["__scopeId","data-v-a1ba665e"]]),_hoisted_1$6={style:{height:"100%"}},_hoisted_2$4={class:"flex flex-wrap"},_hoisted_3$3=["onMouseenter","onClick"],_sfc_main$9=vue.defineComponent({__name:"common-animate",props:{val:{}},emits:["updateCommonAniVal"],setup(i,{emit:n}){const r=i,g=vue.ref(r.val),k=vue.ref(!1),V=vue.ref("进入"),$=vue.ref(null),oe=re=>{n("updateCommonAniVal",re),k.value=!1};return vue.watch(()=>r.val,re=>{g.value=re}),(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[g.value?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:0,closable:"",onClose:Ce[0]||(Ce[0]=ie=>oe("")),onClick:Ce[1]||(Ce[1]=ie=>k.value=!0),style:{cursor:"pointer"}},{default:vue.withCtx(()=>{var ie;return[vue.createTextVNode(vue.toDisplayString((ie=vue.unref(common_animate_list).map(ae=>ae.children).reduce((ae,le)=>ae.concat(le)).find(ae=>ae.value==g.value))==null?void 0:ie.label)+" ",1),vue.createVNode(vue.unref(ElIcon),{size:10},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"setting"})]),_:1})]}),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:1,type:"success",style:{cursor:"pointer"},onClick:Ce[2]||(Ce[2]=ie=>k.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("新增")]),_:1})),vue.createVNode(vue.unref(ElDrawer),{modelValue:k.value,"onUpdate:modelValue":Ce[5]||(Ce[5]=ie=>k.value=ie),title:"选择动画",direction:"ltr"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabs),{modelValue:V.value,"onUpdate:modelValue":Ce[4]||(Ce[4]=ie=>V.value=ie)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(common_animate_list),ie=>(vue.openBlock(),vue.createBlock(vue.unref(ElTabPane),{label:ie.label,name:ie.label,key:ie.label},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{height:"500px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$4,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(ie.children,(ae,le)=>(vue.openBlock(),vue.createElementBlock("div",{class:"animate",key:le,onMouseenter:Ie=>$.value=le,onMouseleave:Ce[3]||(Ce[3]=Ie=>$.value=null),onClick:Ie=>oe(ae.value)},[vue.createElementVNode("div",{class:vue.normalizeClass(`${$.value==le?`animate__animated animate__${ae.value} animate__slow animate__infinite`:""}`)},vue.toDisplayString(ae.label),3)],40,_hoisted_3$3))),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]))}}),commonAnimate_vue_vue_type_style_index_0_scoped_f7641a8c_lang="",CommonAnimate=_export_sfc(_sfc_main$9,[["__scopeId","data-v-f7641a8c"]]),_sfc_main$8=vue.defineComponent({__name:"index",setup(i){var V;const n=useGlobalStore(pinia),r=vue.ref(((V=n.handle_svg_info)==null?void 0:V.info.id)||""),g=$=>{n.intention=EGlobalStoreIntention.Select,n.setHandleSvgInfo($)},k={children:"children",label:"title"};return($,oe)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTree),{data:vue.unref(n).done_json,props:k,onNodeClick:g,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!0,"node-key":"id","current-node-key":r.value},null,8,["data","current-node-key"]))}}),_withScopeId$1=i=>(vue.pushScopeId("data-v-8ce989ed"),i=i(),vue.popScopeId(),i),_hoisted_1$5={class:"wall-l"},_hoisted_2$3={class:"head-l"},_hoisted_3$2=_withScopeId$1(()=>vue.createElementVNode("span",null,"key",-1)),_hoisted_4$1=_withScopeId$1(()=>vue.createElementVNode("span",null,"value",-1)),_hoisted_5$1={class:"row-l"},_sfc_main$7=vue.defineComponent({__name:"list",props:{modelValue:{default:()=>[{key:"",val:""}]}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.computed({get(){return r.modelValue},set($){n("update:modelValue",$)}}),k=()=>{g.value.push({key:"",val:""})},V=$=>{g.value.splice($,1)};return($,oe)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.createElementVNode("div",_hoisted_2$3,[_hoisted_3$2,_hoisted_4$1,vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:k},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"add"})]),_:1})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(g.value,(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:re.key,"onUpdate:modelValue":ie=>re.key=ie,size:"small",placeholder:"key"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:re.val,"onUpdate:modelValue":ie=>re.val=ie,size:"small",placeholder:"value"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:ie=>V(Ce)},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:2},1032,["onClick"])]))),256))]))}}),list_vue_vue_type_style_index_0_scoped_8ce989ed_lang="",List=_export_sfc(_sfc_main$7,[["__scopeId","data-v-8ce989ed"]]),_hoisted_1$4={class:"c-wall-d"},_sfc_main$6=vue.defineComponent({__name:"condition",props:{modelValue:{default:()=>({type:EConditionType.None})}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.computed({get(){return r.modelValue},set($){n("update:modelValue",$)}}),k=[{label:"大于",val:"greater"},{label:"大于等于",val:">="},{label:"小于",val:"<"},{label:"小于等于",val:"<="},{label:"等于",val:"=="},{label:"不等于",val:"!="},{label:"介于",val:">=,=<"},{label:"不介于",val:"<,>"}],V=$=>{$!=="None"&&(g.value.Relation={key:"",relation:"",val:"",val2:""}),n("update:modelValue",g)};return($,oe)=>{var re,Ce;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElFormItem),{label:"条件",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:g.value.type,"onUpdate:modelValue":oe[0]||(oe[0]=ie=>g.value.type=ie),onChange:V},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"None",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"Relation",label:"关系运算"})]),_:1},8,["modelValue"])]),_:1}),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"属性",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.key,"onUpdate:modelValue":oe[1]||(oe[1]=ie=>g.value.Relation.key=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"关系",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:g.value.Relation.relation,"onUpdate:modelValue":oe[2]||(oe[2]=ie=>g.value.Relation.relation=ie)},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(k,(ie,ae)=>vue.createVNode(vue.unref(ElOption),{value:ie.val,label:ie.label,key:"rop"+ae},null,8,["value","label"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"值",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.val,"onUpdate:modelValue":oe[3]||(oe[3]=ie=>g.value.Relation.val=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"&&(((re=g.value.Relation)==null?void 0:re.relation)===">=,=<"||((Ce=g.value.Relation)==null?void 0:Ce.relation)==="<,>")?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:"值2",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.val2,"onUpdate:modelValue":oe[4]||(oe[4]=ie=>g.value.Relation.val2=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)])}}}),condition_vue_vue_type_style_index_0_scoped_a72b6fe7_lang="",Condition=_export_sfc(_sfc_main$6,[["__scopeId","data-v-a72b6fe7"]]),_withScopeId=i=>(vue.pushScopeId("data-v-bdbaeafd"),i=i(),vue.popScopeId(),i),_hoisted_1$3=_withScopeId(()=>vue.createElementVNode("span",{style:{"font-weight":"bold"}},"MQTT",-1)),_hoisted_2$2={class:"events-title"},_hoisted_3$1={key:1},_sfc_main$5=vue.defineComponent({__name:"index",setup(i){const n=useConfigStore(pinia),r=useGlobalStore(pinia),g=vue.ref("page"),k=vue.ref("style"),V=(ae,le)=>{ae!=null&&ae.common_animations&&(ae.common_animations.val=le)};n.$subscribe((ae,le)=>{ae.storeId==="config-store"&&localStorage.setItem("svg-editor-config",JSON.stringify(le))});const $=vue.ref(numberArray(20)),oe=vue.ref(["MQTT"]),re=vue.ref();re.value=()=>{var le,Ie;let ae={type:EEventType.Null,action:EEventAction.Null,target:"",scripts:"",condition:{type:EConditionType.None}};(Ie=(le=r.handle_svg_info)==null?void 0:le.info)==null||Ie.events.push(ae)};const Ce=(ae,le)=>{ae==="ChangeAttr"?le.attrs=[{key:"",val:""}]:delete le.attrs},ie=ae=>{var le,Ie;(Ie=(le=r.handle_svg_info)==null?void 0:le.info)==null||Ie.events.splice(ae,1)};return(ae,le)=>vue.unref(r).intention!=vue.unref(EGlobalStoreIntention).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElTabs),{key:0,class:"mx-2 rightTabs",modelValue:g.value,"onUpdate:modelValue":le[11]||(le[11]=Ie=>g.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabPane),{label:"图纸",name:"page"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"背景色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElColorPicker),{modelValue:vue.unref(n).svg.background_color,"onUpdate:modelValue":le[0]||(le[0]=Ie=>vue.unref(n).svg.background_color=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"x原点",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.position_center.x,"onUpdate:modelValue":le[1]||(le[1]=Ie=>vue.unref(n).svg.position_center.x=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"y原点",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.position_center.y,"onUpdate:modelValue":le[2]||(le[2]=Ie=>vue.unref(n).svg.position_center.y=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"网格",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(n).svg.grid,"onUpdate:modelValue":le[3]||(le[3]=Ie=>vue.unref(n).svg.grid=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"标尺",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(n).svg.ruler,"onUpdate:modelValue":le[4]||(le[4]=Ie=>vue.unref(n).svg.ruler=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.scale,"onUpdate:modelValue":le[5]||(le[5]=Ie=>vue.unref(n).svg.scale=Ie),step:.1,"step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"通信",name:"net"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapse),{modelValue:oe.value,"onUpdate:modelValue":le[10]||(le[10]=Ie=>oe.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapseItem),{name:"MQTT"},{title:vue.withCtx(()=>[_hoisted_1$3]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"URL",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.url,"onUpdate:modelValue":le[6]||(le[6]=Ie=>vue.unref(n).net.mqtt.url=Ie),placeholder:"如 ws://127.0.0.1:4500"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"用户名",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.user,"onUpdate:modelValue":le[7]||(le[7]=Ie=>vue.unref(n).net.mqtt.user=Ie),placeholder:"username"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"密码",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.pwd,"onUpdate:modelValue":le[8]||(le[8]=Ie=>vue.unref(n).net.mqtt.pwd=Ie),placeholder:"password"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"Topics",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.topics,"onUpdate:modelValue":le[9]||(le[9]=Ie=>vue.unref(n).net.mqtt.topics=Ie),placeholder:"topics"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"连线",name:"line"},{default:vue.withCtx(()=>[vue.unref(n).connection_line.props?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).connection_line.props,hide:["point_position"]},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(n).connection_line.animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).connection_line.animations},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0)]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$8)]),_:1})]),_:1},8,["modelValue"])):vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&vue.unref(r).handle_svg_info?(vue.openBlock(),vue.createBlock(vue.unref(ElTabs),{key:1,class:"mx-2 rightTabs",modelValue:k.value,"onUpdate:modelValue":le[24]||(le[24]=Ie=>k.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabPane),{label:"外观",name:"style"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"标题",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.title,"onUpdate:modelValue":le[12]||(le[12]=Ie=>vue.unref(r).handle_svg_info.info.title=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"x坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(r).handle_svg_info.info.x,"onUpdate:modelValue":le[13]||(le[13]=Ie=>vue.unref(r).handle_svg_info.info.x=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"y坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(r).handle_svg_info.info.y,"onUpdate:modelValue":le[14]||(le[14]=Ie=>vue.unref(r).handle_svg_info.info.y=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"显示",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(r).handle_svg_info.info.display,"onUpdate:modelValue":le[15]||(le[15]=Ie=>vue.unref(r).handle_svg_info.info.display=Ie)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"事件",name:"event"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{type:"primary",style:{width:"100%"},onClick:re.value},{default:vue.withCtx(()=>[vue.createTextVNode("添加事件")]),_:1},8,["onClick"]),vue.createVNode(vue.unref(ElCollapse),{modelValue:$.value,"onUpdate:modelValue":le[16]||(le[16]=Ie=>$.value=Ie)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).handle_svg_info.info.events,(Ie,ue)=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:ue,key:"event"+ue},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$2,[vue.createElementVNode("span",null,"事件"+vue.toDisplayString(ue+1),1),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:vue.withModifiers(de=>ie(ue),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:2},1032,["onClick"])])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"类型",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:Ie.type,"onUpdate:modelValue":de=>Ie.type=de},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"Click",label:"点击"}),vue.createVNode(vue.unref(ElOption),{value:"Change",label:"值改变"})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(ElFormItem),{label:"行为",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:Ie.action,"onUpdate:modelValue":de=>Ie.action=de,onChange:de=>Ce(de,Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"ChangeAttr",label:"改变属性"}),vue.createVNode(vue.unref(ElOption),{value:"JavaScript",label:"执行JavaScript"})]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),Ie.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"目标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:Ie.target,"onUpdate:modelValue":de=>Ie.target=de,placeholder:"默认自身"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),Ie.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(List,{key:1,modelValue:Ie.attrs,"onUpdate:modelValue":de=>Ie.attrs=de},null,8,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),Ie.action==="JavaScript"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"JavaScript",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$b,{modelValue:Ie.scripts,"onUpdate:modelValue":de=>Ie.scripts=de,lang:"javascript"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),vue.createVNode(Condition,{modelValue:Ie.condition,"onUpdate:modelValue":de=>Ie.condition=de},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"动效",name:"animation"},{default:vue.withCtx(()=>{var Ie;return[(Ie=vue.unref(r).handle_svg_info)!=null&&Ie.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).handle_svg_info.info.animations},null,8,["obj-info"])]),_:1})):vue.unref(r).handle_svg_info.info.common_animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"动画效果",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(CommonAnimate,{onUpdateCommonAniVal:le[17]||(le[17]=ue=>{var de;return V((de=vue.unref(r).handle_svg_info)==null?void 0:de.info,ue)}),val:vue.unref(r).handle_svg_info.info.common_animations.val},null,8,["val"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"延迟",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.delay,"onUpdate:modelValue":le[18]||(le[18]=ue=>vue.unref(r).handle_svg_info.info.common_animations.delay=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"delay-0s",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"delay-1s",label:"1秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-2s",label:"2秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-3s",label:"3秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-4s",label:"4秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-5s",label:"5秒"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"动画速度",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.speed,"onUpdate:modelValue":le[19]||(le[19]=ue=>vue.unref(r).handle_svg_info.info.common_animations.speed=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"slow",label:"慢"}),vue.createVNode(vue.unref(ElOption),{value:"slower",label:"最慢"}),vue.createVNode(vue.unref(ElOption),{value:"fast",label:"快"}),vue.createVNode(vue.unref(ElOption),{value:"faster",label:"最快"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"循环次数",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.repeat,"onUpdate:modelValue":le[20]||(le[20]=ue=>vue.unref(r).handle_svg_info.info.common_animations.repeat=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"repeat-1",label:"一次"}),vue.createVNode(vue.unref(ElOption),{value:"repeat-2",label:"两次"}),vue.createVNode(vue.unref(ElOption),{value:"repeat-3",label:"三次"}),vue.createVNode(vue.unref(ElOption),{value:"infinite",label:"无限次"})]),_:1},8,["modelValue"])]),_:1})]),_:1})):vue.createCommentVNode("",!0)]}),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"数据",name:"data"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>{var Ie;return[vue.createVNode(vue.unref(ElFormItem),{label:"ID",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.id,"onUpdate:modelValue":le[21]||(le[21]=ue=>vue.unref(r).handle_svg_info.info.id=ue)},null,8,["modelValue"])]),_:1}),vue.unref(r).handle_svg_info.info.state?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(vue.unref(r).handle_svg_info.info.state,(ue,de)=>{var Ne;return vue.openBlock(),vue.createElementBlock("div",{key:"state"+de},[vue.createVNode(vue.unref(ElFormItem),{class:"props-row",label:String(de),size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ue==null?void 0:ue.default),1)]),_:2},1032,["label"]),de==="OnOff"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:(Ne=vue.unref(r).handle_svg_info.info.state)==null?void 0:Ne.OnOff.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(r).handle_svg_info.info.state.OnOff.default,"onUpdate:modelValue":le[22]||(le[22]=he=>vue.unref(r).handle_svg_info.info.state.OnOff.default=he)},null,8,["modelValue"])]),_:1},8,["label"])):vue.createCommentVNode("",!0)])}),128)):vue.createCommentVNode("",!0),(Ie=vue.unref(r).handle_svg_info.info)!=null&&Ie.hasOwnProperty("tag_slot")?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$1,[vue.createVNode(vue.unref(ElFormItem),{class:"props-row",label:"tag_slot",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(r).handle_svg_info.info.tag_slot),1)]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"文字插槽",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.tag_slot,"onUpdate:modelValue":le[23]||(le[23]=ue=>vue.unref(r).handle_svg_info.info.tag_slot=ue)},null,8,["modelValue"])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).handle_svg_info.info.props,code:""},null,8,["obj-info"])]}),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$8)]),_:1})]),_:1},8,["modelValue"])):vue.createCommentVNode("",!0)}}),index_vue_vue_type_style_index_0_scoped_bdbaeafd_lang="",index_vue_vue_type_style_index_1_lang="",RightPanel=_export_sfc(_sfc_main$5,[["__scopeId","data-v-bdbaeafd"]]),_sfc_main$4=vue.defineComponent({__name:"index",setup(i){const n=vue.ref(""),r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=useConfigStore(pinia);return vue.onMounted(()=>{const V={layout_center:g.center_offset,config:k.$state,done_json:r.done_json};n.value=JSON.stringify(V,null,2)}),(V,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:n.value,"onUpdate:value":$[0]||($[0]=oe=>n.value=oe),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$3=vue.defineComponent({__name:"index",setup(i,{expose:n}){const r=vue.ref("");return n({setVal:V=>{r.value=V},onImportJson:()=>{useImportDataModel(r.value)&&ElMessage.success("导入成功")}}),(V,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:r.value,"onUpdate:value":$[0]||($[0]=oe=>r.value=oe),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$2=vue.defineComponent({name:"V3RulerComponent",props:{position:{type:String,default:"relative",validator:i=>["absolute","fixed","relative","static","inherit"].indexOf(i)!==-1},isHotKey:{type:Boolean,default:!0},isScaleRevise:{type:Boolean,default:!1},value:{type:Array,default:()=>[{type:"h",site:50},{type:"v",site:180}]},contentLayout:{type:Object,default:()=>({top:0,left:0})},parent:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},stepLength:{type:Number,default:50,validator:i=>i%10===0}},emits:["input","update:visible"],setup(i,n){const r=useSvgEditLayoutStore(pinia),g=function(){return function(Ai,hi,wi){Ai&&hi&&wi&&Ai.addEventListener(hi,wi,!1)}}(),k=function(){return function(Ai,hi,wi){Ai&&hi&&Ai.removeEventListener(hi,wi,!1)}}(),V=17;let $=18,oe=vue.ref(0),re=vue.ref(0),Ce=vue.ref([{id:0}]),ie=vue.ref([{id:0}]),ae=0,le=0,Ie=vue.ref(!1),ue="",de=vue.ref(-999),Ne=vue.ref(-999),he=0,pe=0,ze="";const Fe=vue.ref(null),xe=vue.ref(null),_e=vue.ref(null),Dt=vue.ref(null),$e=vue.computed(()=>({width:oe.value+"px",height:re.value+"px",position:i.position})),Ue=vue.computed(()=>({left:i.contentLayout.left+"px",top:i.contentLayout.top+"px",padding:$+"px 0px 0px "+$+"px"})),Ve=vue.computed(()=>{let Ai=0,hi=0;return i.value.map(wi=>{const Ci=wi.type==="h";return{id:`${wi.type}_${Ci?Ai++:hi++}`,type:wi.type,title:wi.site.toFixed(2)+"px",[Ci?"top":"left"]:wi.site/(i.stepLength/50)+V}})});r.$subscribe(Ai=>{Ai.storeId==="svg-edit-layout-store"&&window.setTimeout(Oe,420)}),vue.onMounted(()=>{g(document,"mousemove",gi),g(document,"mouseup",di),Oe(),g(window,"resize",At)}),vue.onBeforeUnmount(()=>{k(document,"mousemove",gi),k(document,"mouseup",di),k(window,"resize",At)});const Oe=()=>{kt(),ti()},At=()=>{Ce.value=[{id:0}],ie.value=[{id:0}],Oe()},qe=({type:Ai,top:hi,left:wi})=>Ai==="h"?{top:hi+"px"}:{left:wi+"px"},Lt=({type:Ai,id:hi})=>Ai==="h"?pi(hi):yi(hi),kt=()=>{if(i.isScaleRevise){const Ai=Fe.value.offsetLeft,hi=Fe.value.offsetTop;Pt(Ce.value,Ai),Pt(ie.value,hi)}if(i.parent){const Ai=window.getComputedStyle(xe.value.parentNode,null);oe.value=parseInt(Ai.getPropertyValue("width"),10),re.value=parseInt(Ai.getPropertyValue("height"),10)}else oe.value=document.documentElement.clientWidth-le,re.value=document.documentElement.clientHeight-ae;he=_e.value.clientWidth,pe=Dt.value.clientHeight,jt()},jt=()=>{ae=Dt.value.getBoundingClientRect().y,le=_e.value.getBoundingClientRect().x},ti=()=>{ei(Ce.value,oe.value),ei(ie.value,re.value)},ei=(Ai,hi)=>{for(let wi=0;wi<hi*i.stepLength/50;wi+=i.stepLength)wi%i.stepLength===0&&wi!=0&&Ai.push({id:wi})},Pt=(Ai,hi)=>{for(let wi=0;wi<hi;wi+=1)wi%i.stepLength===0&&wi+i.stepLength<=hi&&Ai.push({id:wi})},ni=Ai=>{Ie.value=!0,ue=Ai},gi=Ai=>{switch(jt(),ue){case"x":Ie.value&&(Ne.value=Ai.pageY-ae);break;case"y":Ie.value&&(de.value=Ai.pageX-le);break;case"h":Ie.value&&(Ne.value=Ai.pageY-ae);break;case"v":Ie.value&&(de.value=Ai.pageX-le);break}},di=Ai=>{if(jt(),Ie.value){Ie.value=!1;const hi=JSON.parse(JSON.stringify(i.value));switch(ue){case"x":hi.push({type:"h",site:(Ai.pageY-ae-V)*(i.stepLength/50)}),n.emit("input",hi);break;case"y":hi.push({type:"v",site:(Ai.pageX-le-V)*(i.stepLength/50)}),n.emit("input",hi);break;case"h":li(hi,Ai.pageY,ae,pe,"h"),n.emit("input",hi);break;case"v":li(hi,Ai.pageX,le,he,"v"),n.emit("input",hi);break}Ne.value=de.value=-10}},li=(Ai,hi,wi,Ci,mi)=>{if(hi-wi<Ci){let Ni;Ve.value.forEach((Mi,fi)=>{Mi.id===ze&&(Ni=fi)}),Ai.splice(Ni,1,{type:mi,site:-600})}else{let Ni;Ve.value.forEach((Mi,fi)=>{Mi.id===ze&&(Ni=fi)}),Ai.splice(Ni,1,{type:mi,site:(hi-wi-V)*(i.stepLength/50)})}},ai=()=>{ni("x")},ci=()=>{ni("y")},pi=Ai=>{Ie.value=!0,ue="h",ze=Ai},yi=Ai=>{Ie.value=!0,ue="v",ze=Ai};return{wrapperStyle:$e,horizontalDragRuler:ai,xScale:Ce,verticalDragRuler:ci,yScale:ie,verticalDottedTop:Ne,horizontalDottedLeft:de,lineList:Ve,getLineStyle:qe,handleDragLine:Lt,contentStyle:Ue,isDrag:Ie,content:Fe,el:xe,verticalRuler:_e,horizontalRuler:Dt}}}),index_vue_vue_type_style_index_0_lang="",_hoisted_1$2=["title","onMousedown"],_hoisted_2$1={class:"vue-ruler-content-mask"};function _sfc_render(i,n,r,g,k,V){return vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(i.wrapperStyle),class:"vue-ruler-wrapper",onselectStart:"return false;",ref:"el"},[vue.withDirectives(vue.createElementVNode("section",null,[vue.createElementVNode("div",{ref:"horizontalRuler",class:"vue-ruler-h",onMousedown:n[0]||(n[0]=vue.withModifiers((...$)=>i.horizontalDragRuler&&i.horizontalDragRuler(...$),["stop"]))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.xScale,($,oe)=>(vue.openBlock(),vue.createElementBlock("span",{key:oe,style:vue.normalizeStyle({left:oe*50+2+"px"}),class:"n"},vue.toDisplayString($.id),5))),128))],544),vue.createElementVNode("div",{ref:"verticalRuler",class:"vue-ruler-v",onMousedown:n[1]||(n[1]=vue.withModifiers((...$)=>i.verticalDragRuler&&i.verticalDragRuler(...$),["stop"]))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.yScale,($,oe)=>(vue.openBlock(),vue.createElementBlock("span",{key:oe,style:vue.normalizeStyle({top:oe*50+2+"px"}),class:"n"},vue.toDisplayString($.id),5))),128))],544),vue.createElementVNode("div",{style:vue.normalizeStyle({top:i.verticalDottedTop+"px"}),class:"vue-ruler-ref-dot-h"},null,4),vue.createElementVNode("div",{style:vue.normalizeStyle({left:i.horizontalDottedLeft+"px"}),class:"vue-ruler-ref-dot-v"},null,4),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.lineList,$=>(vue.openBlock(),vue.createElementBlock("div",{title:$.title,style:vue.normalizeStyle(i.getLineStyle($)),key:$.id,class:vue.normalizeClass(`vue-ruler-ref-line-${$.type}`),onMousedown:oe=>i.handleDragLine($)},null,46,_hoisted_1$2))),128))],512),[[vue.vShow,i.$props.visible]]),vue.createElementVNode("div",{ref:"content",class:"vue-ruler-content",style:vue.normalizeStyle(i.contentStyle)},[vue.renderSlot(i.$slots,"default")],4),vue.withDirectives(vue.createElementVNode("div",_hoisted_2$1,null,512),[[vue.vShow,i.isDrag]])],4)}const Vue3RulerTool=_export_sfc(_sfc_main$2,[["render",_sfc_render]]);function fileWrite(i,n=new Date(Date.now()).toLocaleString()){const r=JSON.stringify(i),g=new Blob([r]);let k=document.createElement("a");k.download=n+".json",k.style.display="none",k.href=URL.createObjectURL(g),document.body.appendChild(k),k.click(),document.body.removeChild(k)}function fileRead(i){return new Promise((n,r)=>{let g=new FileReader;g.readAsText(i,"UTF-8"),g.onload=function(k){k&&k.target?n(k.target.result):r("文件读取错误")}})}const _hoisted_1$1={class:"canvas-main-pc"},_sfc_main$1=vue.defineComponent({__name:"index",props:{customToolbar:{},data:{},saveFile:{type:Boolean,default:!1}},emits:["onReturn","onPreview","onSave"],setup(i,{expose:n,emit:r}){const g=i,k=vue.ref([]),V=he=>{k.value=he},$=useGlobalStore(pinia),oe=useSvgEditLayoutStore(pinia),re=useConfigStore(pinia),Ce=vue.ref(),ie=vue.reactive({[EVisibleConfKey.ExportJson]:!1,[EVisibleConfKey.ImportJson]:!1,[EVisibleConfKey.ImportFile]:!1}),ae=(he,pe)=>{ie[he]=pe},le=vue.ref();le.value=()=>{Ce.value.onImportJson(),ae(EVisibleConfKey.ImportJson,!1)};const Ie=he=>["text/plain","application/json"].indexOf(he.type)<0?(ElMessage.error("仅支持的格式:txt、json"),!1):(fileRead(he).then(pe=>{Ce.value.setVal(pe),ElMessage.success("文件读取成功!")}),!1),ue=he=>{$.setDoneJson(he)};vue.onMounted(()=>{g.data?useImportDataModel(g.data):$.setDoneJson([]),$.intention=EGlobalStoreIntention.None}),n({setGraphNodeJson:ue});const{appContext:de}=vue.getCurrentInstance();function Ne(he){g.saveFile?ElMessageBox.prompt("请输入文件名","保存",{cancelButtonText:"取消",confirmButtonText:"保存"},de).then(pe=>{fileWrite(he,pe.value.trim()),r("onSave",he)}).catch(pe=>{console.log(pe)}):r("onSave",he)}return(he,pe)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElContainer),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElHeader),{class:"top-el-header"},{default:vue.withCtx(()=>[vue.createVNode(TopPanel,{onChangeVisible:ae,onOnReturn:pe[0]||(pe[0]=ze=>r("onReturn")),onOnPreview:pe[1]||(pe[1]=ze=>r("onPreview",ze)),onOnSave:Ne})]),_:1}),vue.createVNode(vue.unref(ElContainer),{class:"middle"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(oe).left_nav?"show-nav":"hide-nav"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(LeftPanel,{class:"content-left","custom-toolbar":g.customToolbar},null,8,["custom-toolbar"])]),_:1})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElMain),{class:"middle main"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createVNode(Vue3RulerTool,{class:"canvas-main-pc",value:k.value,"step-length":50,parent:!0,"is-scale-revise":!1,visible:vue.unref(re).svg.ruler,"onUpdate:visible":pe[2]||(pe[2]=ze=>vue.unref(re).svg.ruler=ze),onInput:V},{default:vue.withCtx(()=>[vue.createVNode(CenterPanel)]),_:1},8,["value","visible"])])]),_:1}),vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(oe).right_nav?"show-nav":"hide-nav"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(RightPanel)]),_:1})]),_:1},8,["class"])]),_:1})]),_:1}),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:ie.ImportJson,"onUpdate:modelValue":pe[4]||(pe[4]=ze=>ie.ImportJson=ze),title:"导入数据",width:"60%","destroy-on-close":""},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(ElUpload),{beforeUpload:Ie,style:{display:"inline-flex","margin-right":"12px"},multiple:!1,"show-file-list":!1,limit:1},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{onClick:pe[3]||(pe[3]=ze=>ae(vue.unref(EVisibleConfKey).ImportFile,!0))},{default:vue.withCtx(()=>[vue.createTextVNode("读取文件")]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{type:"primary",onClick:le.value},{default:vue.withCtx(()=>[vue.createTextVNode("导入数据")]),_:1},8,["onClick"])]),default:vue.withCtx(()=>[vue.createVNode(_sfc_main$3,{ref_key:"importJsonRef",ref:Ce},null,512)]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:ie.ExportJson,"onUpdate:modelValue":pe[5]||(pe[5]=ze=>ie.ExportJson=ze),title:"导出",width:"60%","destroy-on-close":""},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$4)]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_acde8f01_lang="",index$1=_export_sfc(_sfc_main$1,[["__scopeId","data-v-acde8f01"]]);function commonjsRequire(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mqtt={exports:{}};(function(i,n){(function(r){i.exports=r()})(function(){return function(){function r(g,k,V){function $(Ce,ie){if(!k[Ce]){if(!g[Ce]){var ae=typeof commonjsRequire=="function"&&commonjsRequire;if(!ie&&ae)return ae(Ce,!0);if(oe)return oe(Ce,!0);var le=new Error("Cannot find module '"+Ce+"'");throw le.code="MODULE_NOT_FOUND",le}var Ie=k[Ce]={exports:{}};g[Ce][0].call(Ie.exports,function(ue){var de=g[Ce][1][ue];return $(de||ue)},Ie,Ie.exports,r,g,k,V)}return k[Ce].exports}for(var oe=typeof commonjsRequire=="function"&&commonjsRequire,re=0;re<V.length;re++)$(V[re]);return $}return r}()({1:[function(r,g,k){(function(V,$){(function(){const oe=r("events").EventEmitter,re=r("./store"),Ce=r("./topic-alias-recv"),ie=r("./topic-alias-send"),ae=r("mqtt-packet"),le=r("./default-message-id-provider"),Ie=r("readable-stream").Writable,ue=r("inherits"),de=r("reinterval"),Ne=r("rfdc/default"),he=r("./validations"),pe=r("xtend"),ze=r("debug")("mqttjs:client"),Fe=V?V.nextTick:function(ei){setTimeout(ei,0)},xe=$.setImmediate||function(ei){Fe(ei)},_e={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0},Dt=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],$e={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function Ue(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function Ve(ei,Pt){if(ei.options.protocolVersion===5&&Pt.cmd==="publish"){let ni;Pt.properties&&(ni=Pt.properties.topicAlias);const gi=Pt.topic.toString();if(ei.topicAliasSend)if(ni){if(gi.length!==0&&(ze("applyTopicAlias :: register topic: %s - alias: %d",gi,ni),!ei.topicAliasSend.put(gi,ni)))return ze("applyTopicAlias :: error out of range. topic: %s - alias: %d",gi,ni),new Error("Sending Topic Alias out of range")}else gi.length!==0&&(ei.options.autoAssignTopicAlias?(ni=ei.topicAliasSend.getAliasByTopic(gi),ni?(Pt.topic="",Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",gi,ni)):(ni=ei.topicAliasSend.getLruAlias(),ei.topicAliasSend.put(gi,ni),Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto assign topic: %s - alias: %d",gi,ni))):ei.options.autoUseTopicAlias&&(ni=ei.topicAliasSend.getAliasByTopic(gi),ni&&(Pt.topic="",Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto use topic: %s - alias: %d",gi,ni))));else if(ni)return ze("applyTopicAlias :: error out of range. topic: %s - alias: %d",gi,ni),new Error("Sending Topic Alias out of range")}}function Oe(ei,Pt){let ni;Pt.properties&&(ni=Pt.properties.topicAlias);let gi=Pt.topic.toString();if(gi.length===0){if(typeof ni>"u")return new Error("Unregistered Topic Alias");if(gi=ei.topicAliasSend.getTopicByAlias(ni),typeof gi>"u")return new Error("Unregistered Topic Alias");Pt.topic=gi}ni&&delete Pt.properties.topicAlias}function At(ei,Pt,ni){ze("sendPacket :: packet: %O",Pt),ze("sendPacket :: emitting `packetsend`"),ei.emit("packetsend",Pt),ze("sendPacket :: writing to stream");const gi=ae.writeToStream(Pt,ei.stream,ei.options);ze("sendPacket :: writeToStream result %s",gi),!gi&&ni&&ni!==jt?(ze("sendPacket :: handle events on `drain` once through callback."),ei.stream.once("drain",ni)):ni&&(ze("sendPacket :: invoking cb"),ni())}function qe(ei){ei&&(ze("flush: queue exists? %b",!!ei),Object.keys(ei).forEach(function(Pt){typeof ei[Pt].cb=="function"&&(ei[Pt].cb(new Error("Connection closed")),delete ei[Pt])}))}function Lt(ei){ei&&(ze("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(ei).forEach(function(Pt){ei[Pt].volatile&&typeof ei[Pt].cb=="function"&&(ei[Pt].cb(new Error("Connection closed")),delete ei[Pt])}))}function kt(ei,Pt,ni,gi){ze("storeAndSend :: store packet with cmd %s to outgoingStore",Pt.cmd);let di=Pt,li;if(di.cmd==="publish"&&(di=Ne(Pt),li=Oe(ei,di),li))return ni&&ni(li);ei.outgoingStore.put(di,function(ci){if(ci)return ni&&ni(ci);gi(),At(ei,Pt,ni)})}function jt(ei){ze("nop ::",ei)}function ti(ei,Pt){let ni;const gi=this;if(!(this instanceof ti))return new ti(ei,Pt);this.options=Pt||{};for(ni in _e)typeof this.options[ni]>"u"?this.options[ni]=_e[ni]:this.options[ni]=Pt[ni];ze("MqttClient :: options.protocol",Pt.protocol),ze("MqttClient :: options.protocolVersion",Pt.protocolVersion),ze("MqttClient :: options.username",Pt.username),ze("MqttClient :: options.keepalive",Pt.keepalive),ze("MqttClient :: options.reconnectPeriod",Pt.reconnectPeriod),ze("MqttClient :: options.rejectUnauthorized",Pt.rejectUnauthorized),ze("MqttClient :: options.topicAliasMaximum",Pt.topicAliasMaximum),this.options.clientId=typeof Pt.clientId=="string"?Pt.clientId:Ue(),ze("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=Pt.protocolVersion===5&&Pt.customHandleAcks?Pt.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=ei,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new le:this.options.messageIdProvider,this.outgoingStore=Pt.outgoingStore||new re,this.incomingStore=Pt.incomingStore||new re,this.queueQoSZero=Pt.queueQoSZero===void 0?!0:Pt.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,Pt.topicAliasMaximum>0&&(Pt.topicAliasMaximum>65535?ze("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new Ce(Pt.topicAliasMaximum)),this.on("connect",function(){const di=this.queue;function li(){const ai=di.shift();ze("deliver :: entry %o",ai);let ci=null;if(!ai){gi._resubscribe();return}ci=ai.packet,ze("deliver :: call _sendPacket for %o",ci);let pi=!0;ci.messageId&&ci.messageId!==0&&(gi.messageIdProvider.register(ci.messageId)||(pi=!1)),pi?gi._sendPacket(ci,function(yi){ai.cb&&ai.cb(yi),li()}):(ze("messageId: %d has already used. The message is skipped and removed.",ci.messageId),li())}ze("connect :: sending queued packets"),li()}),this.on("close",function(){ze("close :: connected set to `false`"),this.connected=!1,ze("close :: clearing connackTimer"),clearTimeout(this.connackTimer),ze("close :: clearing ping timer"),gi.pingTimer!==null&&(gi.pingTimer.clear(),gi.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),ze("close :: calling _setupReconnect"),this._setupReconnect()}),oe.call(this),ze("MqttClient :: setting up stream"),this._setupStream()}ue(ti,oe),ti.prototype._setupStream=function(){const ei=this,Pt=new Ie,ni=ae.parser(this.options);let gi=null;const di=[];ze("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),ze("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),ni.on("packet",function(yi){ze("parser :: on packet push to packets array."),di.push(yi)});function li(){if(di.length)Fe(ai);else{const yi=gi;gi=null,yi()}}function ai(){ze("work :: getting next packet in queue");const yi=di.shift();if(yi)ze("work :: packet pulled from queue"),ei._handlePacket(yi,li);else{ze("work :: no packets in queue");const Ai=gi;gi=null,ze("work :: done flag is %s",!!Ai),Ai&&Ai()}}Pt._write=function(yi,Ai,hi){gi=hi,ze("writable stream :: parsing buffer"),ni.parse(yi),ai()};function ci(yi){ze("streamErrorHandler :: error",yi.message),Dt.includes(yi.code)?(ze("streamErrorHandler :: emitting error"),ei.emit("error",yi)):jt(yi)}ze("_setupStream :: pipe stream to writable stream"),this.stream.pipe(Pt),this.stream.on("error",ci),this.stream.on("close",function(){ze("(%s)stream :: on close",ei.options.clientId),Lt(ei.outgoing),ze("stream: emit close to MqttClient"),ei.emit("close")}),ze("_setupStream: sending packet `connect`");const pi=Object.create(this.options);if(pi.cmd="connect",this.topicAliasRecv&&(pi.properties||(pi.properties={}),this.topicAliasRecv&&(pi.properties.topicAliasMaximum=this.topicAliasRecv.max)),At(this,pi),ni.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return ei.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){const yi=pe({cmd:"auth",reasonCode:0},this.options.authPacket);At(this,yi)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){ze("!!connectTimeout hit!! Calling _cleanUp with force `true`"),ei._cleanUp(!0)},this.options.connectTimeout)},ti.prototype._handlePacket=function(ei,Pt){const ni=this.options;if(ni.protocolVersion===5&&ni.properties&&ni.properties.maximumPacketSize&&ni.properties.maximumPacketSize<ei.length)return this.emit("error",new Error("exceeding packets size "+ei.cmd)),this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),this;switch(ze("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",ei),ei.cmd){case"publish":this._handlePublish(ei,Pt);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(ei),Pt();break;case"pubrel":this._handlePubrel(ei,Pt);break;case"connack":this._handleConnack(ei),Pt();break;case"auth":this._handleAuth(ei),Pt();break;case"pingresp":this._handlePingresp(ei),Pt();break;case"disconnect":this._handleDisconnect(ei),Pt();break}},ti.prototype._checkDisconnecting=function(ei){return this.disconnecting&&(ei&&ei!==jt?ei(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},ti.prototype.publish=function(ei,Pt,ni,gi){ze("publish :: message `%s` to topic `%s`",Pt,ei);const di=this.options;if(typeof ni=="function"&&(gi=ni,ni=null),ni=pe({qos:0,retain:!1,dup:!1},ni),this._checkDisconnecting(gi))return this;const ai=this,ci=function(){let pi=0;if((ni.qos===1||ni.qos===2)&&(pi=ai._nextId(),pi===null))return ze("No messageId left"),!1;const yi={cmd:"publish",topic:ei,payload:Pt,qos:ni.qos,retain:ni.retain,messageId:pi,dup:ni.dup};switch(di.protocolVersion===5&&(yi.properties=ni.properties),ze("publish :: qos",ni.qos),ni.qos){case 1:case 2:ai.outgoing[yi.messageId]={volatile:!1,cb:gi||jt},ze("MqttClient:publish: packet cmd: %s",yi.cmd),ai._sendPacket(yi,void 0,ni.cbStorePut);break;default:ze("MqttClient:publish: packet cmd: %s",yi.cmd),ai._sendPacket(yi,gi,ni.cbStorePut);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ci())&&this._storeProcessingQueue.push({invoke:ci,cbStorePut:ni.cbStorePut,callback:gi}),this},ti.prototype.subscribe=function(){const ei=this,Pt=new Array(arguments.length);for(let hi=0;hi<arguments.length;hi++)Pt[hi]=arguments[hi];const ni=[];let gi=Pt.shift();const di=gi.resubscribe;let li=Pt.pop()||jt,ai=Pt.pop();const ci=this.options.protocolVersion;delete gi.resubscribe,typeof gi=="string"&&(gi=[gi]),typeof li!="function"&&(ai=li,li=jt);const pi=he.validateTopics(gi);if(pi!==null)return xe(li,new Error("Invalid topic "+pi)),this;if(this._checkDisconnecting(li))return ze("subscribe: discconecting true"),this;const yi={qos:0};if(ci===5&&(yi.nl=!1,yi.rap=!1,yi.rh=0),ai=pe(yi,ai),Array.isArray(gi)?gi.forEach(function(hi){if(ze("subscribe: array topic %s",hi),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,hi)||ei._resubscribeTopics[hi].qos<ai.qos||di){const wi={topic:hi,qos:ai.qos};ci===5&&(wi.nl=ai.nl,wi.rap=ai.rap,wi.rh=ai.rh,wi.properties=ai.properties),ze("subscribe: pushing topic `%s` and qos `%s` to subs list",wi.topic,wi.qos),ni.push(wi)}}):Object.keys(gi).forEach(function(hi){if(ze("subscribe: object topic %s",hi),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,hi)||ei._resubscribeTopics[hi].qos<gi[hi].qos||di){const wi={topic:hi,qos:gi[hi].qos};ci===5&&(wi.nl=gi[hi].nl,wi.rap=gi[hi].rap,wi.rh=gi[hi].rh,wi.properties=ai.properties),ze("subscribe: pushing `%s` to subs list",wi),ni.push(wi)}}),!ni.length)return li(null,[]),this;const Ai=function(){const hi=ei._nextId();if(hi===null)return ze("No messageId left"),!1;const wi={cmd:"subscribe",subscriptions:ni,qos:1,retain:!1,dup:!1,messageId:hi};if(ai.properties&&(wi.properties=ai.properties),ei.options.resubscribe){ze("subscribe :: resubscribe true");const Ci=[];ni.forEach(function(mi){if(ei.options.reconnectPeriod>0){const Ni={qos:mi.qos};ci===5&&(Ni.nl=mi.nl||!1,Ni.rap=mi.rap||!1,Ni.rh=mi.rh||0,Ni.properties=mi.properties),ei._resubscribeTopics[mi.topic]=Ni,Ci.push(mi.topic)}}),ei.messageIdToTopic[wi.messageId]=Ci}return ei.outgoing[wi.messageId]={volatile:!0,cb:function(Ci,mi){if(!Ci){const Ni=mi.granted;for(let Mi=0;Mi<Ni.length;Mi+=1)ni[Mi].qos=Ni[Mi]}li(Ci,ni)}},ze("subscribe :: call _sendPacket"),ei._sendPacket(wi),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!Ai())&&this._storeProcessingQueue.push({invoke:Ai,callback:li}),this},ti.prototype.unsubscribe=function(){const ei=this,Pt=new Array(arguments.length);for(let ci=0;ci<arguments.length;ci++)Pt[ci]=arguments[ci];let ni=Pt.shift(),gi=Pt.pop()||jt,di=Pt.pop();typeof ni=="string"&&(ni=[ni]),typeof gi!="function"&&(di=gi,gi=jt);const li=he.validateTopics(ni);if(li!==null)return xe(gi,new Error("Invalid topic "+li)),this;if(ei._checkDisconnecting(gi))return this;const ai=function(){const ci=ei._nextId();if(ci===null)return ze("No messageId left"),!1;const pi={cmd:"unsubscribe",qos:1,messageId:ci};return typeof ni=="string"?pi.unsubscriptions=[ni]:Array.isArray(ni)&&(pi.unsubscriptions=ni),ei.options.resubscribe&&pi.unsubscriptions.forEach(function(yi){delete ei._resubscribeTopics[yi]}),typeof di=="object"&&di.properties&&(pi.properties=di.properties),ei.outgoing[pi.messageId]={volatile:!0,cb:gi},ze("unsubscribe: call _sendPacket"),ei._sendPacket(pi),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ai())&&this._storeProcessingQueue.push({invoke:ai,callback:gi}),this},ti.prototype.end=function(ei,Pt,ni){const gi=this;ze("end :: (%s)",this.options.clientId),(ei==null||typeof ei!="boolean")&&(ni=Pt||jt,Pt=ei,ei=!1,typeof Pt!="object"&&(ni=Pt,Pt=null,typeof ni!="function"&&(ni=jt))),typeof Pt!="object"&&(ni=Pt,Pt=null),ze("end :: cb? %s",!!ni),ni=ni||jt;function di(){ze("end :: closeStores: closing incoming and outgoing stores"),gi.disconnected=!0,gi.incomingStore.close(function(ai){gi.outgoingStore.close(function(ci){if(ze("end :: closeStores: emitting end"),gi.emit("end"),ni){const pi=ai||ci;ze("end :: closeStores: invoking callback with args"),ni(pi)}})}),gi._deferredReconnect&&gi._deferredReconnect()}function li(){ze("end :: (%s) :: finish :: calling _cleanUp with force %s",gi.options.clientId,ei),gi._cleanUp(ei,()=>{ze("end :: finish :: calling process.nextTick on closeStores"),Fe(di.bind(gi))},Pt)}return this.disconnecting?(ni(),this):(this._clearReconnect(),this.disconnecting=!0,!ei&&Object.keys(this.outgoing).length>0?(ze("end :: (%s) :: calling finish in 10ms once outgoing is empty",gi.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,li,10))):(ze("end :: (%s) :: immediately calling finish",gi.options.clientId),li()),this)},ti.prototype.removeOutgoingMessage=function(ei){const Pt=this.outgoing[ei]?this.outgoing[ei].cb:null;return delete this.outgoing[ei],this.outgoingStore.del({messageId:ei},function(){Pt(new Error("Message removed"))}),this},ti.prototype.reconnect=function(ei){ze("client reconnect");const Pt=this,ni=function(){ei?(Pt.options.incomingStore=ei.incomingStore,Pt.options.outgoingStore=ei.outgoingStore):(Pt.options.incomingStore=null,Pt.options.outgoingStore=null),Pt.incomingStore=Pt.options.incomingStore||new re,Pt.outgoingStore=Pt.options.outgoingStore||new re,Pt.disconnecting=!1,Pt.disconnected=!1,Pt._deferredReconnect=null,Pt._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=ni:ni(),this},ti.prototype._reconnect=function(){ze("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),ze("client already connected. disconnecting first.")):(ze("_reconnect: calling _setupStream"),this._setupStream())},ti.prototype._setupReconnect=function(){const ei=this;!ei.disconnecting&&!ei.reconnectTimer&&ei.options.reconnectPeriod>0?(this.reconnecting||(ze("_setupReconnect :: emit `offline` state"),this.emit("offline"),ze("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),ze("_setupReconnect :: setting reconnectTimer for %d ms",ei.options.reconnectPeriod),ei.reconnectTimer=setInterval(function(){ze("reconnectTimer :: reconnect triggered!"),ei._reconnect()},ei.options.reconnectPeriod)):ze("_setupReconnect :: doing nothing...")},ti.prototype._clearReconnect=function(){ze("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},ti.prototype._cleanUp=function(ei,Pt){const ni=arguments[2];if(Pt&&(ze("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",Pt)),ze("_cleanUp :: forced? %s",ei),ei)this.options.reconnectPeriod===0&&this.options.clean&&qe(this.outgoing),ze("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const gi=pe({cmd:"disconnect"},ni);ze("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(gi,xe.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(ze("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(ze("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),Pt&&!this.connected&&(ze("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",Pt),Pt())},ti.prototype._sendPacket=function(ei,Pt,ni){ze("_sendPacket :: (%s) :: start",this.options.clientId),ni=ni||jt,Pt=Pt||jt;const gi=Ve(this,ei);if(gi){Pt(gi);return}if(!this.connected){if(ei.cmd==="auth"){this._shiftPingInterval(),At(this,ei,Pt);return}ze("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(ei,Pt,ni);return}switch(this._shiftPingInterval(),ei.cmd){case"publish":break;case"pubrel":kt(this,ei,Pt,ni);return;default:At(this,ei,Pt);return}switch(ei.qos){case 2:case 1:kt(this,ei,Pt,ni);break;case 0:default:At(this,ei,Pt);break}ze("_sendPacket :: (%s) :: end",this.options.clientId)},ti.prototype._storePacket=function(ei,Pt,ni){ze("_storePacket :: packet: %o",ei),ze("_storePacket :: cb? %s",!!Pt),ni=ni||jt;let gi=ei;if(gi.cmd==="publish"){gi=Ne(ei);const di=Oe(this,gi);if(di)return Pt&&Pt(di)}(gi.qos||0)===0&&this.queueQoSZero||gi.cmd!=="publish"?this.queue.push({packet:gi,cb:Pt}):gi.qos>0?(Pt=this.outgoing[gi.messageId]?this.outgoing[gi.messageId].cb:null,this.outgoingStore.put(gi,function(di){if(di)return Pt&&Pt(di);ni()})):Pt&&Pt(new Error("No connection to broker"))},ti.prototype._setupPingTimer=function(){ze("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);const ei=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=de(function(){ei._checkPing()},this.options.keepalive*1e3))},ti.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)},ti.prototype._checkPing=function(){ze("_checkPing :: checking ping..."),this.pingResp?(ze("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(ze("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},ti.prototype._handlePingresp=function(){this.pingResp=!0},ti.prototype._handleConnack=function(ei){ze("_handleConnack");const Pt=this.options,gi=Pt.protocolVersion===5?ei.reasonCode:ei.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,ei.properties){if(ei.properties.topicAliasMaximum){if(ei.properties.topicAliasMaximum>65535){this.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}ei.properties.topicAliasMaximum>0&&(this.topicAliasSend=new ie(ei.properties.topicAliasMaximum))}ei.properties.serverKeepAlive&&Pt.keepalive&&(Pt.keepalive=ei.properties.serverKeepAlive,this._shiftPingInterval()),ei.properties.maximumPacketSize&&(Pt.properties||(Pt.properties={}),Pt.properties.maximumPacketSize=ei.properties.maximumPacketSize)}if(gi===0)this.reconnecting=!1,this._onConnect(ei);else if(gi>0){const di=new Error("Connection refused: "+$e[gi]);di.code=gi,this.emit("error",di)}},ti.prototype._handleAuth=function(ei){const ni=this.options.protocolVersion,gi=ni===5?ei.reasonCode:ei.returnCode;if(ni!==5){const li=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+ni);li.code=gi,this.emit("error",li);return}const di=this;this.handleAuth(ei,function(li,ai){if(li){di.emit("error",li);return}if(gi===24)di.reconnecting=!1,di._sendPacket(ai);else{const ci=new Error("Connection refused: "+$e[gi]);li.code=gi,di.emit("error",ci)}})},ti.prototype.handleAuth=function(ei,Pt){Pt()},ti.prototype._handlePublish=function(ei,Pt){ze("_handlePublish: packet %o",ei),Pt=typeof Pt<"u"?Pt:jt;let ni=ei.topic.toString();const gi=ei.payload,di=ei.qos,li=ei.messageId,ai=this,ci=this.options,pi=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){let yi;if(ei.properties&&(yi=ei.properties.topicAlias),typeof yi<"u")if(ni.length===0)if(yi>0&&yi<=65535){const Ai=this.topicAliasRecv.getTopicByAlias(yi);if(Ai)ni=Ai,ze("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",ni,yi);else{ze("_handlePublish :: unregistered topic alias. alias: %d",yi),this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{ze("_handlePublish :: topic alias out of range. alias: %d",yi),this.emit("error",new Error("Received Topic Alias is out of range"));return}else if(this.topicAliasRecv.put(ni,yi))ze("_handlePublish :: registered topic: %s - alias: %d",ni,yi);else{ze("_handlePublish :: topic alias out of range. alias: %d",yi),this.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(ze("_handlePublish: qos %d",di),di){case 2:{ci.customHandleAcks(ni,gi,ei,function(yi,Ai){if(yi instanceof Error||(Ai=yi,yi=null),yi)return ai.emit("error",yi);if(pi.indexOf(Ai)===-1)return ai.emit("error",new Error("Wrong reason code for pubrec"));Ai?ai._sendPacket({cmd:"pubrec",messageId:li,reasonCode:Ai},Pt):ai.incomingStore.put(ei,function(){ai._sendPacket({cmd:"pubrec",messageId:li},Pt)})});break}case 1:{ci.customHandleAcks(ni,gi,ei,function(yi,Ai){if(yi instanceof Error||(Ai=yi,yi=null),yi)return ai.emit("error",yi);if(pi.indexOf(Ai)===-1)return ai.emit("error",new Error("Wrong reason code for puback"));Ai||ai.emit("message",ni,gi,ei),ai.handleMessage(ei,function(hi){if(hi)return Pt&&Pt(hi);ai._sendPacket({cmd:"puback",messageId:li,reasonCode:Ai},Pt)})});break}case 0:this.emit("message",ni,gi,ei),this.handleMessage(ei,Pt);break;default:ze("_handlePublish: unknown QoS. Doing nothing.");break}},ti.prototype.handleMessage=function(ei,Pt){Pt()},ti.prototype._handleAck=function(ei){const Pt=ei.messageId,ni=ei.cmd;let gi=null;const di=this.outgoing[Pt]?this.outgoing[Pt].cb:null,li=this;let ai;if(!di){ze("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(ze("_handleAck :: packet type",ni),ni){case"pubcomp":case"puback":{const ci=ei.reasonCode;ci&&ci>0&&ci!==16&&(ai=new Error("Publish error: "+$e[ci]),ai.code=ci,di(ai,ei)),delete this.outgoing[Pt],this.outgoingStore.del(ei,di),this.messageIdProvider.deallocate(Pt),this._invokeStoreProcessingQueue();break}case"pubrec":{gi={cmd:"pubrel",qos:2,messageId:Pt};const ci=ei.reasonCode;ci&&ci>0&&ci!==16?(ai=new Error("Publish error: "+$e[ci]),ai.code=ci,di(ai,ei)):this._sendPacket(gi);break}case"suback":{delete this.outgoing[Pt],this.messageIdProvider.deallocate(Pt);for(let ci=0;ci<ei.granted.length;ci++)if(ei.granted[ci]&128){const pi=this.messageIdToTopic[Pt];pi&&pi.forEach(function(yi){delete li._resubscribeTopics[yi]})}this._invokeStoreProcessingQueue(),di(null,ei);break}case"unsuback":{delete this.outgoing[Pt],this.messageIdProvider.deallocate(Pt),this._invokeStoreProcessingQueue(),di(null);break}default:li.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&Object.keys(this.outgoing).length===0&&this.emit("outgoingEmpty")},ti.prototype._handlePubrel=function(ei,Pt){ze("handling pubrel packet"),Pt=typeof Pt<"u"?Pt:jt;const ni=ei.messageId,gi=this,di={cmd:"pubcomp",messageId:ni};gi.incomingStore.get(ei,function(li,ai){li?gi._sendPacket(di,Pt):(gi.emit("message",ai.topic,ai.payload,ai),gi.handleMessage(ai,function(ci){if(ci)return Pt(ci);gi.incomingStore.del(ai,jt),gi._sendPacket(di,Pt)}))})},ti.prototype._handleDisconnect=function(ei){this.emit("disconnect",ei)},ti.prototype._nextId=function(){return this.messageIdProvider.allocate()},ti.prototype.getLastMessageId=function(){return this.messageIdProvider.getLastAllocated()},ti.prototype._resubscribe=function(){ze("_resubscribe");const ei=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion===5&&!this.connackPacket.sessionPresent)&&ei.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){ze("_resubscribe: protocolVersion 5");for(let Pt=0;Pt<ei.length;Pt++){const ni={};ni[ei[Pt]]=this._resubscribeTopics[ei[Pt]],ni.resubscribe=!0,this.subscribe(ni,{properties:ni[ei[Pt]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1},ti.prototype._onConnect=function(ei){if(this.disconnected){this.emit("connect",ei);return}const Pt=this;this.connackPacket=ei,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;function ni(){let gi=Pt.outgoingStore.createStream();function di(){Pt._storeProcessing=!1,Pt._packetIdsDuringStoreProcessing={}}Pt.once("close",li),gi.on("error",function(ci){di(),Pt._flushStoreProcessingQueue(),Pt.removeListener("close",li),Pt.emit("error",ci)});function li(){gi.destroy(),gi=null,Pt._flushStoreProcessingQueue(),di()}function ai(){if(!gi)return;Pt._storeProcessing=!0;const ci=gi.read(1);let pi;if(!ci){gi.once("readable",ai);return}if(Pt._packetIdsDuringStoreProcessing[ci.messageId]){ai();return}!Pt.disconnecting&&!Pt.reconnectTimer?(pi=Pt.outgoing[ci.messageId]?Pt.outgoing[ci.messageId].cb:null,Pt.outgoing[ci.messageId]={volatile:!1,cb:function(yi,Ai){pi&&pi(yi,Ai),ai()}},Pt._packetIdsDuringStoreProcessing[ci.messageId]=!0,Pt.messageIdProvider.register(ci.messageId)?Pt._sendPacket(ci):ze("messageId: %d has already used.",ci.messageId)):gi.destroy&&gi.destroy()}gi.on("end",function(){let ci=!0;for(const pi in Pt._packetIdsDuringStoreProcessing)if(!Pt._packetIdsDuringStoreProcessing[pi]){ci=!1;break}ci?(di(),Pt.removeListener("close",li),Pt._invokeAllStoreProcessingQueue(),Pt.emit("connect",ei)):ni()}),ai()}ni()},ti.prototype._invokeStoreProcessingQueue=function(){if(this._storeProcessingQueue.length>0){const ei=this._storeProcessingQueue[0];if(ei&&ei.invoke())return this._storeProcessingQueue.shift(),!0}return!1},ti.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},ti.prototype._flushStoreProcessingQueue=function(){for(const ei of this._storeProcessingQueue)ei.cbStorePut&&ei.cbStorePut(new Error("Connection closed")),ei.callback&&ei.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},g.exports=ti}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"./default-message-id-provider":7,"./store":8,"./topic-alias-recv":9,"./topic-alias-send":10,"./validations":11,_process:50,debug:18,events:22,inherits:24,"mqtt-packet":40,"readable-stream":69,reinterval:70,"rfdc/default":71,xtend:81}],2:[function(r,g,k){const{Buffer:V}=r("buffer"),$=r("readable-stream").Transform,oe=r("duplexify");let re,Ce,ie,ae=!1;function le(){const he=new $;return he._write=function(pe,ze,Fe){re.sendSocketMessage({data:pe.buffer,success:function(){Fe()},fail:function(){Fe(new Error)}})},he._flush=function(ze){re.closeSocket({success:function(){ze()}})},he}function Ie(he){he.hostname||(he.hostname="localhost"),he.path||(he.path="/"),he.wsOptions||(he.wsOptions={})}function ue(he,pe){const ze=he.protocol==="alis"?"wss":"ws";let Fe=ze+"://"+he.hostname+he.path;return he.port&&he.port!==80&&he.port!==443&&(Fe=ze+"://"+he.hostname+":"+he.port+he.path),typeof he.transformWsUrl=="function"&&(Fe=he.transformWsUrl(Fe,he,pe)),Fe}function de(){ae||(ae=!0,re.onSocketOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),re.onSocketMessage(function(he){if(typeof he.data=="string"){const pe=V.from(he.data,"base64");Ce.push(pe)}else{const pe=new FileReader;pe.addEventListener("load",function(){let ze=pe.result;ze instanceof ArrayBuffer?ze=V.from(ze):ze=V.from(ze,"utf8"),Ce.push(ze)}),pe.readAsArrayBuffer(he.data)}}),re.onSocketClose(function(){ie.end(),ie.destroy()}),re.onSocketError(function(he){ie.destroy(he)}))}function Ne(he,pe){if(pe.hostname=pe.hostname||pe.host,!pe.hostname)throw new Error("Could not determine host. Specify host manually.");const ze=pe.protocolId==="MQIsdp"&&pe.protocolVersion===3?"mqttv3.1":"mqtt";Ie(pe);const Fe=ue(pe,he);return re=pe.my,re.connectSocket({url:Fe,protocols:ze}),Ce=le(),ie=oe.obj(),de(),ie}g.exports=Ne},{buffer:17,duplexify:20,"readable-stream":69}],3:[function(r,g,k){const V=r("net"),$=r("debug")("mqttjs:tcp");function oe(re,Ce){Ce.port=Ce.port||1883,Ce.hostname=Ce.hostname||Ce.host||"localhost";const ie=Ce.port,ae=Ce.hostname;return $("port %d and host %s",ie,ae),V.createConnection(ie,ae)}g.exports=oe},{debug:18,net:16}],4:[function(r,g,k){const V=r("tls"),$=r("net"),oe=r("debug")("mqttjs:tls");function re(Ce,ie){ie.port=ie.port||8883,ie.host=ie.hostname||ie.host||"localhost",$.isIP(ie.host)===0&&(ie.servername=ie.host),ie.rejectUnauthorized=ie.rejectUnauthorized!==!1,delete ie.path,oe("port %d host %s rejectUnauthorized %b",ie.port,ie.host,ie.rejectUnauthorized);const ae=V.connect(ie);ae.on("secureConnect",function(){ie.rejectUnauthorized&&!ae.authorized?ae.emit("error",new Error("TLS not authorized")):ae.removeListener("error",le)});function le(Ie){ie.rejectUnauthorized&&Ce.emit("error",Ie),ae.end()}return ae.on("error",le),ae}g.exports=re},{debug:18,net:16,tls:16}],5:[function(r,g,k){(function(V){(function(){const{Buffer:$}=r("buffer"),oe=r("ws"),re=r("debug")("mqttjs:ws"),Ce=r("duplexify"),ie=r("readable-stream").Transform,ae=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],le=typeof V<"u"&&V.title==="browser"||typeof __webpack_require__=="function";function Ie(Fe,xe){let _e=Fe.protocol+"://"+Fe.hostname+":"+Fe.port+Fe.path;return typeof Fe.transformWsUrl=="function"&&(_e=Fe.transformWsUrl(_e,Fe,xe)),_e}function ue(Fe){const xe=Fe;return Fe.hostname||(xe.hostname="localhost"),Fe.port||(Fe.protocol==="wss"?xe.port=443:xe.port=80),Fe.path||(xe.path="/"),Fe.wsOptions||(xe.wsOptions={}),!le&&Fe.protocol==="wss"&&ae.forEach(function(_e){Object.prototype.hasOwnProperty.call(Fe,_e)&&!Object.prototype.hasOwnProperty.call(Fe.wsOptions,_e)&&(xe.wsOptions[_e]=Fe[_e])}),xe}function de(Fe){const xe=ue(Fe);if(xe.hostname||(xe.hostname=xe.host),!xe.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");const _e=new URL(document.URL);xe.hostname=_e.hostname,xe.port||(xe.port=_e.port)}return xe.objectMode===void 0&&(xe.objectMode=!(xe.binary===!0||xe.binary===void 0)),xe}function Ne(Fe,xe,_e){re("createWebSocket"),re("protocol: "+_e.protocolId+" "+_e.protocolVersion);const Dt=_e.protocolId==="MQIsdp"&&_e.protocolVersion===3?"mqttv3.1":"mqtt";return re("creating new Websocket for url: "+xe+" and protocol: "+Dt),new oe(xe,[Dt],_e.wsOptions)}function he(Fe,xe){const _e=xe.protocolId==="MQIsdp"&&xe.protocolVersion===3?"mqttv3.1":"mqtt",Dt=Ie(xe,Fe),$e=new WebSocket(Dt,[_e]);return $e.binaryType="arraybuffer",$e}function pe(Fe,xe){re("streamBuilder");const _e=ue(xe),Dt=Ie(_e,Fe),$e=Ne(Fe,Dt,_e),Ue=oe.createWebSocketStream($e,_e.wsOptions);return Ue.url=Dt,$e.on("close",()=>{Ue.destroy()}),Ue}function ze(Fe,xe){re("browserStreamBuilder");let _e;const $e=de(xe).browserBufferSize||1024*512,Ue=xe.browserBufferTimeout||1e3,Ve=!xe.objectMode,Oe=he(Fe,xe),At=Lt(xe,ni,gi);xe.objectMode||(At._writev=Pt),At.on("close",()=>{Oe.close()});const qe=typeof Oe.addEventListener<"u";Oe.readyState===Oe.OPEN?_e=At:(_e=_e=Ce(void 0,void 0,xe),xe.objectMode||(_e._writev=Pt),qe?Oe.addEventListener("open",kt):Oe.onopen=kt),_e.socket=Oe,qe?(Oe.addEventListener("close",jt),Oe.addEventListener("error",ti),Oe.addEventListener("message",ei)):(Oe.onclose=jt,Oe.onerror=ti,Oe.onmessage=ei);function Lt(di,li,ai){const ci=new ie({objectModeMode:di.objectMode});return ci._write=li,ci._flush=ai,ci}function kt(){_e.setReadable(At),_e.setWritable(At),_e.emit("connect")}function jt(){_e.end(),_e.destroy()}function ti(di){_e.destroy(di)}function ei(di){let li=di.data;li instanceof ArrayBuffer?li=$.from(li):li=$.from(li,"utf8"),At.push(li)}function Pt(di,li){const ai=new Array(di.length);for(let ci=0;ci<di.length;ci++)typeof di[ci].chunk=="string"?ai[ci]=$.from(di[ci],"utf8"):ai[ci]=di[ci].chunk;this._write($.concat(ai),"binary",li)}function ni(di,li,ai){Oe.bufferedAmount>$e&&setTimeout(ni,Ue,di,li,ai),Ve&&typeof di=="string"&&(di=$.from(di,"utf8"));try{Oe.send(di)}catch(ci){return ai(ci)}ai()}function gi(di){Oe.close(),di()}return _e}le?g.exports=ze:g.exports=pe}).call(this)}).call(this,r("_process"))},{_process:50,buffer:17,debug:18,duplexify:20,"readable-stream":69,ws:80}],6:[function(r,g,k){const{Buffer:V}=r("buffer"),$=r("readable-stream").Transform,oe=r("duplexify");let re,Ce,ie;function ae(){const Ne=new $;return Ne._write=function(he,pe,ze){re.send({data:he.buffer,success:function(){ze()},fail:function(Fe){ze(new Error(Fe))}})},Ne._flush=function(pe){re.close({success:function(){pe()}})},Ne}function le(Ne){Ne.hostname||(Ne.hostname="localhost"),Ne.path||(Ne.path="/"),Ne.wsOptions||(Ne.wsOptions={})}function Ie(Ne,he){const pe=Ne.protocol==="wxs"?"wss":"ws";let ze=pe+"://"+Ne.hostname+Ne.path;return Ne.port&&Ne.port!==80&&Ne.port!==443&&(ze=pe+"://"+Ne.hostname+":"+Ne.port+Ne.path),typeof Ne.transformWsUrl=="function"&&(ze=Ne.transformWsUrl(ze,Ne,he)),ze}function ue(){re.onOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),re.onMessage(function(Ne){let he=Ne.data;he instanceof ArrayBuffer?he=V.from(he):he=V.from(he,"utf8"),Ce.push(he)}),re.onClose(function(){ie.end(),ie.destroy()}),re.onError(function(Ne){ie.destroy(new Error(Ne.errMsg))})}function de(Ne,he){if(he.hostname=he.hostname||he.host,!he.hostname)throw new Error("Could not determine host. Specify host manually.");const pe=he.protocolId==="MQIsdp"&&he.protocolVersion===3?"mqttv3.1":"mqtt";le(he);const ze=Ie(he,Ne);re=wx.connectSocket({url:ze,protocols:[pe]}),Ce=ae(),ie=oe.obj(),ie._destroy=function(xe,_e){re.close({success:function(){_e&&_e(xe)}})};const Fe=ie.destroy;return ie.destroy=function(){ie.destroy=Fe;const xe=this;setTimeout(function(){re.close({fail:function(){xe._destroy(new Error)}})},0)}.bind(ie),ue(),ie}g.exports=de},{buffer:17,duplexify:20,"readable-stream":69}],7:[function(r,g,k){function V(){if(!(this instanceof V))return new V;this.nextId=Math.max(1,Math.floor(Math.random()*65535))}V.prototype.allocate=function(){const $=this.nextId++;return this.nextId===65536&&(this.nextId=1),$},V.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1},V.prototype.register=function($){return!0},V.prototype.deallocate=function($){},V.prototype.clear=function(){},g.exports=V},{}],8:[function(r,g,k){const V=r("xtend"),$=r("readable-stream").Readable,oe={objectMode:!0},re={clean:!0};function Ce(ie){if(!(this instanceof Ce))return new Ce(ie);this.options=ie||{},this.options=V(re,ie),this._inflights=new Map}Ce.prototype.put=function(ie,ae){return this._inflights.set(ie.messageId,ie),ae&&ae(),this},Ce.prototype.createStream=function(){const ie=new $(oe),ae=[];let le=!1,Ie=0;return this._inflights.forEach(function(ue,de){ae.push(ue)}),ie._read=function(){!le&&Ie<ae.length?this.push(ae[Ie++]):this.push(null)},ie.destroy=function(){if(le)return;const ue=this;le=!0,setTimeout(function(){ue.emit("close")},0)},ie},Ce.prototype.del=function(ie,ae){return ie=this._inflights.get(ie.messageId),ie?(this._inflights.delete(ie.messageId),ae(null,ie)):ae&&ae(new Error("missing packet")),this},Ce.prototype.get=function(ie,ae){return ie=this._inflights.get(ie.messageId),ie?ae(null,ie):ae&&ae(new Error("missing packet")),this},Ce.prototype.close=function(ie){this.options.clean&&(this._inflights=null),ie&&ie()},g.exports=Ce},{"readable-stream":69,xtend:81}],9:[function(r,g,k){function V($){if(!(this instanceof V))return new V($);this.aliasToTopic={},this.max=$}V.prototype.put=function($,oe){return oe===0||oe>this.max?!1:(this.aliasToTopic[oe]=$,this.length=Object.keys(this.aliasToTopic).length,!0)},V.prototype.getTopicByAlias=function($){return this.aliasToTopic[$]},V.prototype.clear=function(){this.aliasToTopic={}},g.exports=V},{}],10:[function(r,g,k){const V=r("lru-cache"),$=r("number-allocator").NumberAllocator;function oe(re){if(!(this instanceof oe))return new oe(re);re>0&&(this.aliasToTopic=new V({max:re}),this.topicToAlias={},this.numberAllocator=new $(1,re),this.max=re,this.length=0)}oe.prototype.put=function(re,Ce){if(Ce===0||Ce>this.max)return!1;const ie=this.aliasToTopic.get(Ce);return ie&&delete this.topicToAlias[ie],this.aliasToTopic.set(Ce,re),this.topicToAlias[re]=Ce,this.numberAllocator.use(Ce),this.length=this.aliasToTopic.length,!0},oe.prototype.getTopicByAlias=function(re){return this.aliasToTopic.get(re)},oe.prototype.getAliasByTopic=function(re){const Ce=this.topicToAlias[re];return typeof Ce<"u"&&this.aliasToTopic.get(Ce),Ce},oe.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},oe.prototype.getLruAlias=function(){const re=this.numberAllocator.firstVacant();return re||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},g.exports=oe},{"lru-cache":37,"number-allocator":46}],11:[function(r,g,k){function V(oe){const re=oe.split("/");for(let Ce=0;Ce<re.length;Ce++)if(re[Ce]!=="+"){if(re[Ce]==="#")return Ce===re.length-1;if(re[Ce].indexOf("+")!==-1||re[Ce].indexOf("#")!==-1)return!1}return!0}function $(oe){if(oe.length===0)return"empty_topic_list";for(let re=0;re<oe.length;re++)if(!V(oe[re]))return oe[re];return null}g.exports={validateTopics:$}},{}],12:[function(r,g,k){(function(V){(function(){const $=r("../client"),oe=r("../store"),re=r("url"),Ce=r("xtend"),ie=r("debug")("mqttjs"),ae={};typeof V<"u"&&V.title!=="browser"||typeof __webpack_require__!="function"?(ae.mqtt=r("./tcp"),ae.tcp=r("./tcp"),ae.ssl=r("./tls"),ae.tls=r("./tls"),ae.mqtts=r("./tls")):(ae.wx=r("./wx"),ae.wxs=r("./wx"),ae.ali=r("./ali"),ae.alis=r("./ali")),ae.ws=r("./ws"),ae.wss=r("./ws");function le(ue){let de;ue.auth&&(de=ue.auth.match(/^(.+):(.+)$/),de?(ue.username=de[1],ue.password=de[2]):ue.username=ue.auth)}function Ie(ue,de){if(ie("connecting to an MQTT broker..."),typeof ue=="object"&&!de&&(de=ue,ue=null),de=de||{},ue){const pe=re.parse(ue,!0);if(pe.port!=null&&(pe.port=Number(pe.port)),de=Ce(pe,de),de.protocol===null)throw new Error("Missing protocol");de.protocol=de.protocol.replace(/:$/,"")}if(le(de),de.query&&typeof de.query.clientId=="string"&&(de.clientId=de.query.clientId),de.cert&&de.key)if(de.protocol){if(["mqtts","wss","wxs","alis"].indexOf(de.protocol)===-1)switch(de.protocol){case"mqtt":de.protocol="mqtts";break;case"ws":de.protocol="wss";break;case"wx":de.protocol="wxs";break;case"ali":de.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+de.protocol+'"!')}}else throw new Error("Missing secure protocol key");if(!ae[de.protocol]){const pe=["mqtts","wss"].indexOf(de.protocol)!==-1;de.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(ze,Fe){return pe&&Fe%2===0?!1:typeof ae[ze]=="function"})[0]}if(de.clean===!1&&!de.clientId)throw new Error("Missing clientId for unclean clients");de.protocol&&(de.defaultProtocol=de.protocol);function Ne(pe){return de.servers&&((!pe._reconnectCount||pe._reconnectCount===de.servers.length)&&(pe._reconnectCount=0),de.host=de.servers[pe._reconnectCount].host,de.port=de.servers[pe._reconnectCount].port,de.protocol=de.servers[pe._reconnectCount].protocol?de.servers[pe._reconnectCount].protocol:de.defaultProtocol,de.hostname=de.host,pe._reconnectCount++),ie("calling streambuilder for",de.protocol),ae[de.protocol](pe,de)}const he=new $(Ne,de);return he.on("error",function(){}),he}g.exports=Ie,g.exports.connect=Ie,g.exports.MqttClient=$,g.exports.Store=oe}).call(this)}).call(this,r("_process"))},{"../client":1,"../store":8,"./ali":2,"./tcp":3,"./tls":4,"./ws":5,"./wx":6,_process:50,debug:18,url:76,xtend:81}],13:[function(r,g,k){k.byteLength=le,k.toByteArray=ue,k.fromByteArray=he;for(var V=[],$=[],oe=typeof Uint8Array<"u"?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ce=0,ie=re.length;Ce<ie;++Ce)V[Ce]=re[Ce],$[re.charCodeAt(Ce)]=Ce;$["-".charCodeAt(0)]=62,$["_".charCodeAt(0)]=63;function ae(pe){var ze=pe.length;if(ze%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var Fe=pe.indexOf("=");Fe===-1&&(Fe=ze);var xe=Fe===ze?0:4-Fe%4;return[Fe,xe]}function le(pe){var ze=ae(pe),Fe=ze[0],xe=ze[1];return(Fe+xe)*3/4-xe}function Ie(pe,ze,Fe){return(ze+Fe)*3/4-Fe}function ue(pe){var ze,Fe=ae(pe),xe=Fe[0],_e=Fe[1],Dt=new oe(Ie(pe,xe,_e)),$e=0,Ue=_e>0?xe-4:xe,Ve;for(Ve=0;Ve<Ue;Ve+=4)ze=$[pe.charCodeAt(Ve)]<<18|$[pe.charCodeAt(Ve+1)]<<12|$[pe.charCodeAt(Ve+2)]<<6|$[pe.charCodeAt(Ve+3)],Dt[$e++]=ze>>16&255,Dt[$e++]=ze>>8&255,Dt[$e++]=ze&255;return _e===2&&(ze=$[pe.charCodeAt(Ve)]<<2|$[pe.charCodeAt(Ve+1)]>>4,Dt[$e++]=ze&255),_e===1&&(ze=$[pe.charCodeAt(Ve)]<<10|$[pe.charCodeAt(Ve+1)]<<4|$[pe.charCodeAt(Ve+2)]>>2,Dt[$e++]=ze>>8&255,Dt[$e++]=ze&255),Dt}function de(pe){return V[pe>>18&63]+V[pe>>12&63]+V[pe>>6&63]+V[pe&63]}function Ne(pe,ze,Fe){for(var xe,_e=[],Dt=ze;Dt<Fe;Dt+=3)xe=(pe[Dt]<<16&16711680)+(pe[Dt+1]<<8&65280)+(pe[Dt+2]&255),_e.push(de(xe));return _e.join("")}function he(pe){for(var ze,Fe=pe.length,xe=Fe%3,_e=[],Dt=16383,$e=0,Ue=Fe-xe;$e<Ue;$e+=Dt)_e.push(Ne(pe,$e,$e+Dt>Ue?Ue:$e+Dt));return xe===1?(ze=pe[Fe-1],_e.push(V[ze>>2]+V[ze<<4&63]+"==")):xe===2&&(ze=(pe[Fe-2]<<8)+pe[Fe-1],_e.push(V[ze>>10]+V[ze>>4&63]+V[ze<<2&63]+"=")),_e.join("")}},{}],14:[function(r,g,k){const{Buffer:V}=r("buffer"),$=Symbol.for("BufferList");function oe(re){if(!(this instanceof oe))return new oe(re);oe._init.call(this,re)}oe._init=function(Ce){Object.defineProperty(this,$,{value:!0}),this._bufs=[],this.length=0,Ce&&this.append(Ce)},oe.prototype._new=function(Ce){return new oe(Ce)},oe.prototype._offset=function(Ce){if(Ce===0)return[0,0];let ie=0;for(let ae=0;ae<this._bufs.length;ae++){const le=ie+this._bufs[ae].length;if(Ce<le||ae===this._bufs.length-1)return[ae,Ce-ie];ie=le}},oe.prototype._reverseOffset=function(re){const Ce=re[0];let ie=re[1];for(let ae=0;ae<Ce;ae++)ie+=this._bufs[ae].length;return ie},oe.prototype.get=function(Ce){if(Ce>this.length||Ce<0)return;const ie=this._offset(Ce);return this._bufs[ie[0]][ie[1]]},oe.prototype.slice=function(Ce,ie){return typeof Ce=="number"&&Ce<0&&(Ce+=this.length),typeof ie=="number"&&ie<0&&(ie+=this.length),this.copy(null,0,Ce,ie)},oe.prototype.copy=function(Ce,ie,ae,le){if((typeof ae!="number"||ae<0)&&(ae=0),(typeof le!="number"||le>this.length)&&(le=this.length),ae>=this.length||le<=0)return Ce||V.alloc(0);const Ie=!!Ce,ue=this._offset(ae),de=le-ae;let Ne=de,he=Ie&&ie||0,pe=ue[1];if(ae===0&&le===this.length){if(!Ie)return this._bufs.length===1?this._bufs[0]:V.concat(this._bufs,this.length);for(let ze=0;ze<this._bufs.length;ze++)this._bufs[ze].copy(Ce,he),he+=this._bufs[ze].length;return Ce}if(Ne<=this._bufs[ue[0]].length-pe)return Ie?this._bufs[ue[0]].copy(Ce,ie,pe,pe+Ne):this._bufs[ue[0]].slice(pe,pe+Ne);Ie||(Ce=V.allocUnsafe(de));for(let ze=ue[0];ze<this._bufs.length;ze++){const Fe=this._bufs[ze].length-pe;if(Ne>Fe)this._bufs[ze].copy(Ce,he,pe),he+=Fe;else{this._bufs[ze].copy(Ce,he,pe,pe+Ne),he+=Fe;break}Ne-=Fe,pe&&(pe=0)}return Ce.length>he?Ce.slice(0,he):Ce},oe.prototype.shallowSlice=function(Ce,ie){if(Ce=Ce||0,ie=typeof ie!="number"?this.length:ie,Ce<0&&(Ce+=this.length),ie<0&&(ie+=this.length),Ce===ie)return this._new();const ae=this._offset(Ce),le=this._offset(ie),Ie=this._bufs.slice(ae[0],le[0]+1);return le[1]===0?Ie.pop():Ie[Ie.length-1]=Ie[Ie.length-1].slice(0,le[1]),ae[1]!==0&&(Ie[0]=Ie[0].slice(ae[1])),this._new(Ie)},oe.prototype.toString=function(Ce,ie,ae){return this.slice(ie,ae).toString(Ce)},oe.prototype.consume=function(Ce){if(Ce=Math.trunc(Ce),Number.isNaN(Ce)||Ce<=0)return this;for(;this._bufs.length;)if(Ce>=this._bufs[0].length)Ce-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(Ce),this.length-=Ce;break}return this},oe.prototype.duplicate=function(){const Ce=this._new();for(let ie=0;ie<this._bufs.length;ie++)Ce.append(this._bufs[ie]);return Ce},oe.prototype.append=function(Ce){if(Ce==null)return this;if(Ce.buffer)this._appendBuffer(V.from(Ce.buffer,Ce.byteOffset,Ce.byteLength));else if(Array.isArray(Ce))for(let ie=0;ie<Ce.length;ie++)this.append(Ce[ie]);else if(this._isBufferList(Ce))for(let ie=0;ie<Ce._bufs.length;ie++)this.append(Ce._bufs[ie]);else typeof Ce=="number"&&(Ce=Ce.toString()),this._appendBuffer(V.from(Ce));return this},oe.prototype._appendBuffer=function(Ce){this._bufs.push(Ce),this.length+=Ce.length},oe.prototype.indexOf=function(re,Ce,ie){if(ie===void 0&&typeof Ce=="string"&&(ie=Ce,Ce=void 0),typeof re=="function"||Array.isArray(re))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof re=="number"?re=V.from([re]):typeof re=="string"?re=V.from(re,ie):this._isBufferList(re)?re=re.slice():Array.isArray(re.buffer)?re=V.from(re.buffer,re.byteOffset,re.byteLength):V.isBuffer(re)||(re=V.from(re)),Ce=Number(Ce||0),isNaN(Ce)&&(Ce=0),Ce<0&&(Ce=this.length+Ce),Ce<0&&(Ce=0),re.length===0)return Ce>this.length?this.length:Ce;const ae=this._offset(Ce);let le=ae[0],Ie=ae[1];for(;le<this._bufs.length;le++){const ue=this._bufs[le];for(;Ie<ue.length;)if(ue.length-Ie>=re.length){const Ne=ue.indexOf(re,Ie);if(Ne!==-1)return this._reverseOffset([le,Ne]);Ie=ue.length-re.length+1}else{const Ne=this._reverseOffset([le,Ie]);if(this._match(Ne,re))return Ne;Ie++}Ie=0}return-1},oe.prototype._match=function(re,Ce){if(this.length-re<Ce.length)return!1;for(let ie=0;ie<Ce.length;ie++)if(this.get(re+ie)!==Ce[ie])return!1;return!0},function(){const re={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const Ce in re)(function(ie){re[ie]===null?oe.prototype[ie]=function(ae,le){return this.slice(ae,ae+le)[ie](0,le)}:oe.prototype[ie]=function(ae=0){return this.slice(ae,ae+re[ie])[ie](0)}})(Ce)}(),oe.prototype._isBufferList=function(Ce){return Ce instanceof oe||oe.isBufferList(Ce)},oe.isBufferList=function(Ce){return Ce!=null&&Ce[$]},g.exports=oe},{buffer:17}],15:[function(r,g,k){const V=r("readable-stream").Duplex,$=r("inherits"),oe=r("./BufferList");function re(Ce){if(!(this instanceof re))return new re(Ce);if(typeof Ce=="function"){this._callback=Ce;const ie=function(le){this._callback&&(this._callback(le),this._callback=null)}.bind(this);this.on("pipe",function(le){le.on("error",ie)}),this.on("unpipe",function(le){le.removeListener("error",ie)}),Ce=null}oe._init.call(this,Ce),V.call(this)}$(re,V),Object.assign(re.prototype,oe.prototype),re.prototype._new=function(ie){return new re(ie)},re.prototype._write=function(ie,ae,le){this._appendBuffer(ie),typeof le=="function"&&le()},re.prototype._read=function(ie){if(!this.length)return this.push(null);ie=Math.min(ie,this.length),this.push(this.slice(0,ie)),this.consume(ie)},re.prototype.end=function(ie){V.prototype.end.call(this,ie),this._callback&&(this._callback(null,this.slice()),this._callback=null)},re.prototype._destroy=function(ie,ae){this._bufs.length=0,this.length=0,ae(ie)},re.prototype._isBufferList=function(ie){return ie instanceof re||ie instanceof oe||re.isBufferList(ie)},re.isBufferList=oe.isBufferList,g.exports=re,g.exports.BufferListStream=re,g.exports.BufferList=oe},{"./BufferList":14,inherits:24,"readable-stream":69}],16:[function(r,g,k){},{}],17:[function(r,g,k){(function(V){(function(){var $=r("base64-js"),oe=r("ieee754");k.Buffer=ae,k.SlowBuffer=xe,k.INSPECT_MAX_BYTES=50;var re=2147483647;k.kMaxLength=re,ae.TYPED_ARRAY_SUPPORT=Ce(),!ae.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ce(){try{var oi=new Uint8Array(1);return oi.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},oi.foo()===42}catch{return!1}}Object.defineProperty(ae.prototype,"parent",{enumerable:!0,get:function(){if(ae.isBuffer(this))return this.buffer}}),Object.defineProperty(ae.prototype,"offset",{enumerable:!0,get:function(){if(ae.isBuffer(this))return this.byteOffset}});function ie(oi){if(oi>re)throw new RangeError('The value "'+oi+'" is invalid for option "size"');var Et=new Uint8Array(oi);return Et.__proto__=ae.prototype,Et}function ae(oi,Et,ii){if(typeof oi=="number"){if(typeof Et=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return de(oi)}return le(oi,Et,ii)}typeof Symbol<"u"&&Symbol.species!=null&&ae[Symbol.species]===ae&&Object.defineProperty(ae,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),ae.poolSize=8192;function le(oi,Et,ii){if(typeof oi=="string")return Ne(oi,Et);if(ArrayBuffer.isView(oi))return he(oi);if(oi==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oi);if(si(oi,ArrayBuffer)||oi&&si(oi.buffer,ArrayBuffer))return pe(oi,Et,ii);if(typeof oi=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var ri=oi.valueOf&&oi.valueOf();if(ri!=null&&ri!==oi)return ae.from(ri,Et,ii);var ui=ze(oi);if(ui)return ui;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof oi[Symbol.toPrimitive]=="function")return ae.from(oi[Symbol.toPrimitive]("string"),Et,ii);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oi)}ae.from=function(oi,Et,ii){return le(oi,Et,ii)},ae.prototype.__proto__=Uint8Array.prototype,ae.__proto__=Uint8Array;function Ie(oi){if(typeof oi!="number")throw new TypeError('"size" argument must be of type number');if(oi<0)throw new RangeError('The value "'+oi+'" is invalid for option "size"')}function ue(oi,Et,ii){return Ie(oi),oi<=0?ie(oi):Et!==void 0?typeof ii=="string"?ie(oi).fill(Et,ii):ie(oi).fill(Et):ie(oi)}ae.alloc=function(oi,Et,ii){return ue(oi,Et,ii)};function de(oi){return Ie(oi),ie(oi<0?0:Fe(oi)|0)}ae.allocUnsafe=function(oi){return de(oi)},ae.allocUnsafeSlow=function(oi){return de(oi)};function Ne(oi,Et){if((typeof Et!="string"||Et==="")&&(Et="utf8"),!ae.isEncoding(Et))throw new TypeError("Unknown encoding: "+Et);var ii=_e(oi,Et)|0,ri=ie(ii),ui=ri.write(oi,Et);return ui!==ii&&(ri=ri.slice(0,ui)),ri}function he(oi){for(var Et=oi.length<0?0:Fe(oi.length)|0,ii=ie(Et),ri=0;ri<Et;ri+=1)ii[ri]=oi[ri]&255;return ii}function pe(oi,Et,ii){if(Et<0||oi.byteLength<Et)throw new RangeError('"offset" is outside of buffer bounds');if(oi.byteLength<Et+(ii||0))throw new RangeError('"length" is outside of buffer bounds');var ri;return Et===void 0&&ii===void 0?ri=new Uint8Array(oi):ii===void 0?ri=new Uint8Array(oi,Et):ri=new Uint8Array(oi,Et,ii),ri.__proto__=ae.prototype,ri}function ze(oi){if(ae.isBuffer(oi)){var Et=Fe(oi.length)|0,ii=ie(Et);return ii.length===0||oi.copy(ii,0,0,Et),ii}if(oi.length!==void 0)return typeof oi.length!="number"||Ii(oi.length)?ie(0):he(oi);if(oi.type==="Buffer"&&Array.isArray(oi.data))return he(oi.data)}function Fe(oi){if(oi>=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return oi|0}function xe(oi){return+oi!=oi&&(oi=0),ae.alloc(+oi)}ae.isBuffer=function(Et){return Et!=null&&Et._isBuffer===!0&&Et!==ae.prototype},ae.compare=function(Et,ii){if(si(Et,Uint8Array)&&(Et=ae.from(Et,Et.offset,Et.byteLength)),si(ii,Uint8Array)&&(ii=ae.from(ii,ii.offset,ii.byteLength)),!ae.isBuffer(Et)||!ae.isBuffer(ii))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Et===ii)return 0;for(var ri=Et.length,ui=ii.length,vi=0,bi=Math.min(ri,ui);vi<bi;++vi)if(Et[vi]!==ii[vi]){ri=Et[vi],ui=ii[vi];break}return ri<ui?-1:ui<ri?1:0},ae.isEncoding=function(Et){switch(String(Et).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ae.concat=function(Et,ii){if(!Array.isArray(Et))throw new TypeError('"list" argument must be an Array of Buffers');if(Et.length===0)return ae.alloc(0);var ri;if(ii===void 0)for(ii=0,ri=0;ri<Et.length;++ri)ii+=Et[ri].length;var ui=ae.allocUnsafe(ii),vi=0;for(ri=0;ri<Et.length;++ri){var bi=Et[ri];if(si(bi,Uint8Array)&&(bi=ae.from(bi)),!ae.isBuffer(bi))throw new TypeError('"list" argument must be an Array of Buffers');bi.copy(ui,vi),vi+=bi.length}return ui};function _e(oi,Et){if(ae.isBuffer(oi))return oi.length;if(ArrayBuffer.isView(oi)||si(oi,ArrayBuffer))return oi.byteLength;if(typeof oi!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof oi);var ii=oi.length,ri=arguments.length>2&&arguments[2]===!0;if(!ri&&ii===0)return 0;for(var ui=!1;;)switch(Et){case"ascii":case"latin1":case"binary":return ii;case"utf8":case"utf-8":return Ni(oi).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ii*2;case"hex":return ii>>>1;case"base64":return zi(oi).length;default:if(ui)return ri?-1:Ni(oi).length;Et=(""+Et).toLowerCase(),ui=!0}}ae.byteLength=_e;function Dt(oi,Et,ii){var ri=!1;if((Et===void 0||Et<0)&&(Et=0),Et>this.length||((ii===void 0||ii>this.length)&&(ii=this.length),ii<=0)||(ii>>>=0,Et>>>=0,ii<=Et))return"";for(oi||(oi="utf8");;)switch(oi){case"hex":return li(this,Et,ii);case"utf8":case"utf-8":return ei(this,Et,ii);case"ascii":return gi(this,Et,ii);case"latin1":case"binary":return di(this,Et,ii);case"base64":return ti(this,Et,ii);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ai(this,Et,ii);default:if(ri)throw new TypeError("Unknown encoding: "+oi);oi=(oi+"").toLowerCase(),ri=!0}}ae.prototype._isBuffer=!0;function $e(oi,Et,ii){var ri=oi[Et];oi[Et]=oi[ii],oi[ii]=ri}ae.prototype.swap16=function(){var Et=this.length;if(Et%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ii=0;ii<Et;ii+=2)$e(this,ii,ii+1);return this},ae.prototype.swap32=function(){var Et=this.length;if(Et%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var ii=0;ii<Et;ii+=4)$e(this,ii,ii+3),$e(this,ii+1,ii+2);return this},ae.prototype.swap64=function(){var Et=this.length;if(Et%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var ii=0;ii<Et;ii+=8)$e(this,ii,ii+7),$e(this,ii+1,ii+6),$e(this,ii+2,ii+5),$e(this,ii+3,ii+4);return this},ae.prototype.toString=function(){var Et=this.length;return Et===0?"":arguments.length===0?ei(this,0,Et):Dt.apply(this,arguments)},ae.prototype.toLocaleString=ae.prototype.toString,ae.prototype.equals=function(Et){if(!ae.isBuffer(Et))throw new TypeError("Argument must be a Buffer");return this===Et?!0:ae.compare(this,Et)===0},ae.prototype.inspect=function(){var Et="",ii=k.INSPECT_MAX_BYTES;return Et=this.toString("hex",0,ii).replace(/(.{2})/g,"$1 ").trim(),this.length>ii&&(Et+=" ... "),"<Buffer "+Et+">"},ae.prototype.compare=function(Et,ii,ri,ui,vi){if(si(Et,Uint8Array)&&(Et=ae.from(Et,Et.offset,Et.byteLength)),!ae.isBuffer(Et))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Et);if(ii===void 0&&(ii=0),ri===void 0&&(ri=Et?Et.length:0),ui===void 0&&(ui=0),vi===void 0&&(vi=this.length),ii<0||ri>Et.length||ui<0||vi>this.length)throw new RangeError("out of range index");if(ui>=vi&&ii>=ri)return 0;if(ui>=vi)return-1;if(ii>=ri)return 1;if(ii>>>=0,ri>>>=0,ui>>>=0,vi>>>=0,this===Et)return 0;for(var bi=vi-ui,Zi=ri-ii,Gi=Math.min(bi,Zi),Yi=this.slice(ui,vi),Oi=Et.slice(ii,ri),xi=0;xi<Gi;++xi)if(Yi[xi]!==Oi[xi]){bi=Yi[xi],Zi=Oi[xi];break}return bi<Zi?-1:Zi<bi?1:0};function Ue(oi,Et,ii,ri,ui){if(oi.length===0)return-1;if(typeof ii=="string"?(ri=ii,ii=0):ii>2147483647?ii=2147483647:ii<-2147483648&&(ii=-2147483648),ii=+ii,Ii(ii)&&(ii=ui?0:oi.length-1),ii<0&&(ii=oi.length+ii),ii>=oi.length){if(ui)return-1;ii=oi.length-1}else if(ii<0)if(ui)ii=0;else return-1;if(typeof Et=="string"&&(Et=ae.from(Et,ri)),ae.isBuffer(Et))return Et.length===0?-1:Ve(oi,Et,ii,ri,ui);if(typeof Et=="number")return Et=Et&255,typeof Uint8Array.prototype.indexOf=="function"?ui?Uint8Array.prototype.indexOf.call(oi,Et,ii):Uint8Array.prototype.lastIndexOf.call(oi,Et,ii):Ve(oi,[Et],ii,ri,ui);throw new TypeError("val must be string, number or Buffer")}function Ve(oi,Et,ii,ri,ui){var vi=1,bi=oi.length,Zi=Et.length;if(ri!==void 0&&(ri=String(ri).toLowerCase(),ri==="ucs2"||ri==="ucs-2"||ri==="utf16le"||ri==="utf-16le")){if(oi.length<2||Et.length<2)return-1;vi=2,bi/=2,Zi/=2,ii/=2}function Gi(Wi,ki){return vi===1?Wi[ki]:Wi.readUInt16BE(ki*vi)}var Yi;if(ui){var Oi=-1;for(Yi=ii;Yi<bi;Yi++)if(Gi(oi,Yi)===Gi(Et,Oi===-1?0:Yi-Oi)){if(Oi===-1&&(Oi=Yi),Yi-Oi+1===Zi)return Oi*vi}else Oi!==-1&&(Yi-=Yi-Oi),Oi=-1}else for(ii+Zi>bi&&(ii=bi-Zi),Yi=ii;Yi>=0;Yi--){for(var xi=!0,Li=0;Li<Zi;Li++)if(Gi(oi,Yi+Li)!==Gi(Et,Li)){xi=!1;break}if(xi)return Yi}return-1}ae.prototype.includes=function(Et,ii,ri){return this.indexOf(Et,ii,ri)!==-1},ae.prototype.indexOf=function(Et,ii,ri){return Ue(this,Et,ii,ri,!0)},ae.prototype.lastIndexOf=function(Et,ii,ri){return Ue(this,Et,ii,ri,!1)};function Oe(oi,Et,ii,ri){ii=Number(ii)||0;var ui=oi.length-ii;ri?(ri=Number(ri),ri>ui&&(ri=ui)):ri=ui;var vi=Et.length;ri>vi/2&&(ri=vi/2);for(var bi=0;bi<ri;++bi){var Zi=parseInt(Et.substr(bi*2,2),16);if(Ii(Zi))return bi;oi[ii+bi]=Zi}return bi}function At(oi,Et,ii,ri){return Si(Ni(Et,oi.length-ii),oi,ii,ri)}function qe(oi,Et,ii,ri){return Si(Mi(Et),oi,ii,ri)}function Lt(oi,Et,ii,ri){return qe(oi,Et,ii,ri)}function kt(oi,Et,ii,ri){return Si(zi(Et),oi,ii,ri)}function jt(oi,Et,ii,ri){return Si(fi(Et,oi.length-ii),oi,ii,ri)}ae.prototype.write=function(Et,ii,ri,ui){if(ii===void 0)ui="utf8",ri=this.length,ii=0;else if(ri===void 0&&typeof ii=="string")ui=ii,ri=this.length,ii=0;else if(isFinite(ii))ii=ii>>>0,isFinite(ri)?(ri=ri>>>0,ui===void 0&&(ui="utf8")):(ui=ri,ri=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var vi=this.length-ii;if((ri===void 0||ri>vi)&&(ri=vi),Et.length>0&&(ri<0||ii<0)||ii>this.length)throw new RangeError("Attempt to write outside buffer bounds");ui||(ui="utf8");for(var bi=!1;;)switch(ui){case"hex":return Oe(this,Et,ii,ri);case"utf8":case"utf-8":return At(this,Et,ii,ri);case"ascii":return qe(this,Et,ii,ri);case"latin1":case"binary":return Lt(this,Et,ii,ri);case"base64":return kt(this,Et,ii,ri);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jt(this,Et,ii,ri);default:if(bi)throw new TypeError("Unknown encoding: "+ui);ui=(""+ui).toLowerCase(),bi=!0}},ae.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ti(oi,Et,ii){return Et===0&&ii===oi.length?$.fromByteArray(oi):$.fromByteArray(oi.slice(Et,ii))}function ei(oi,Et,ii){ii=Math.min(oi.length,ii);for(var ri=[],ui=Et;ui<ii;){var vi=oi[ui],bi=null,Zi=vi>239?4:vi>223?3:vi>191?2:1;if(ui+Zi<=ii){var Gi,Yi,Oi,xi;switch(Zi){case 1:vi<128&&(bi=vi);break;case 2:Gi=oi[ui+1],(Gi&192)===128&&(xi=(vi&31)<<6|Gi&63,xi>127&&(bi=xi));break;case 3:Gi=oi[ui+1],Yi=oi[ui+2],(Gi&192)===128&&(Yi&192)===128&&(xi=(vi&15)<<12|(Gi&63)<<6|Yi&63,xi>2047&&(xi<55296||xi>57343)&&(bi=xi));break;case 4:Gi=oi[ui+1],Yi=oi[ui+2],Oi=oi[ui+3],(Gi&192)===128&&(Yi&192)===128&&(Oi&192)===128&&(xi=(vi&15)<<18|(Gi&63)<<12|(Yi&63)<<6|Oi&63,xi>65535&&xi<1114112&&(bi=xi))}}bi===null?(bi=65533,Zi=1):bi>65535&&(bi-=65536,ri.push(bi>>>10&1023|55296),bi=56320|bi&1023),ri.push(bi),ui+=Zi}return ni(ri)}var Pt=4096;function ni(oi){var Et=oi.length;if(Et<=Pt)return String.fromCharCode.apply(String,oi);for(var ii="",ri=0;ri<Et;)ii+=String.fromCharCode.apply(String,oi.slice(ri,ri+=Pt));return ii}function gi(oi,Et,ii){var ri="";ii=Math.min(oi.length,ii);for(var ui=Et;ui<ii;++ui)ri+=String.fromCharCode(oi[ui]&127);return ri}function di(oi,Et,ii){var ri="";ii=Math.min(oi.length,ii);for(var ui=Et;ui<ii;++ui)ri+=String.fromCharCode(oi[ui]);return ri}function li(oi,Et,ii){var ri=oi.length;(!Et||Et<0)&&(Et=0),(!ii||ii<0||ii>ri)&&(ii=ri);for(var ui="",vi=Et;vi<ii;++vi)ui+=mi(oi[vi]);return ui}function ai(oi,Et,ii){for(var ri=oi.slice(Et,ii),ui="",vi=0;vi<ri.length;vi+=2)ui+=String.fromCharCode(ri[vi]+ri[vi+1]*256);return ui}ae.prototype.slice=function(Et,ii){var ri=this.length;Et=~~Et,ii=ii===void 0?ri:~~ii,Et<0?(Et+=ri,Et<0&&(Et=0)):Et>ri&&(Et=ri),ii<0?(ii+=ri,ii<0&&(ii=0)):ii>ri&&(ii=ri),ii<Et&&(ii=Et);var ui=this.subarray(Et,ii);return ui.__proto__=ae.prototype,ui};function ci(oi,Et,ii){if(oi%1!==0||oi<0)throw new RangeError("offset is not uint");if(oi+Et>ii)throw new RangeError("Trying to access beyond buffer length")}ae.prototype.readUIntLE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et],vi=1,bi=0;++bi<ii&&(vi*=256);)ui+=this[Et+bi]*vi;return ui},ae.prototype.readUIntBE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et+--ii],vi=1;ii>0&&(vi*=256);)ui+=this[Et+--ii]*vi;return ui},ae.prototype.readUInt8=function(Et,ii){return Et=Et>>>0,ii||ci(Et,1,this.length),this[Et]},ae.prototype.readUInt16LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,2,this.length),this[Et]|this[Et+1]<<8},ae.prototype.readUInt16BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,2,this.length),this[Et]<<8|this[Et+1]},ae.prototype.readUInt32LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),(this[Et]|this[Et+1]<<8|this[Et+2]<<16)+this[Et+3]*16777216},ae.prototype.readUInt32BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]*16777216+(this[Et+1]<<16|this[Et+2]<<8|this[Et+3])},ae.prototype.readIntLE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et],vi=1,bi=0;++bi<ii&&(vi*=256);)ui+=this[Et+bi]*vi;return vi*=128,ui>=vi&&(ui-=Math.pow(2,8*ii)),ui},ae.prototype.readIntBE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=ii,vi=1,bi=this[Et+--ui];ui>0&&(vi*=256);)bi+=this[Et+--ui]*vi;return vi*=128,bi>=vi&&(bi-=Math.pow(2,8*ii)),bi},ae.prototype.readInt8=function(Et,ii){return Et=Et>>>0,ii||ci(Et,1,this.length),this[Et]&128?(255-this[Et]+1)*-1:this[Et]},ae.prototype.readInt16LE=function(Et,ii){Et=Et>>>0,ii||ci(Et,2,this.length);var ri=this[Et]|this[Et+1]<<8;return ri&32768?ri|4294901760:ri},ae.prototype.readInt16BE=function(Et,ii){Et=Et>>>0,ii||ci(Et,2,this.length);var ri=this[Et+1]|this[Et]<<8;return ri&32768?ri|4294901760:ri},ae.prototype.readInt32LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]|this[Et+1]<<8|this[Et+2]<<16|this[Et+3]<<24},ae.prototype.readInt32BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]<<24|this[Et+1]<<16|this[Et+2]<<8|this[Et+3]},ae.prototype.readFloatLE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),oe.read(this,Et,!0,23,4)},ae.prototype.readFloatBE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),oe.read(this,Et,!1,23,4)},ae.prototype.readDoubleLE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,8,this.length),oe.read(this,Et,!0,52,8)},ae.prototype.readDoubleBE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,8,this.length),oe.read(this,Et,!1,52,8)};function pi(oi,Et,ii,ri,ui,vi){if(!ae.isBuffer(oi))throw new TypeError('"buffer" argument must be a Buffer instance');if(Et>ui||Et<vi)throw new RangeError('"value" argument is out of bounds');if(ii+ri>oi.length)throw new RangeError("Index out of range")}ae.prototype.writeUIntLE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,ri=ri>>>0,!ui){var vi=Math.pow(2,8*ri)-1;pi(this,Et,ii,ri,vi,0)}var bi=1,Zi=0;for(this[ii]=Et&255;++Zi<ri&&(bi*=256);)this[ii+Zi]=Et/bi&255;return ii+ri},ae.prototype.writeUIntBE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,ri=ri>>>0,!ui){var vi=Math.pow(2,8*ri)-1;pi(this,Et,ii,ri,vi,0)}var bi=ri-1,Zi=1;for(this[ii+bi]=Et&255;--bi>=0&&(Zi*=256);)this[ii+bi]=Et/Zi&255;return ii+ri},ae.prototype.writeUInt8=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,1,255,0),this[ii]=Et&255,ii+1},ae.prototype.writeUInt16LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,65535,0),this[ii]=Et&255,this[ii+1]=Et>>>8,ii+2},ae.prototype.writeUInt16BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,65535,0),this[ii]=Et>>>8,this[ii+1]=Et&255,ii+2},ae.prototype.writeUInt32LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,4294967295,0),this[ii+3]=Et>>>24,this[ii+2]=Et>>>16,this[ii+1]=Et>>>8,this[ii]=Et&255,ii+4},ae.prototype.writeUInt32BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,4294967295,0),this[ii]=Et>>>24,this[ii+1]=Et>>>16,this[ii+2]=Et>>>8,this[ii+3]=Et&255,ii+4},ae.prototype.writeIntLE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,!ui){var vi=Math.pow(2,8*ri-1);pi(this,Et,ii,ri,vi-1,-vi)}var bi=0,Zi=1,Gi=0;for(this[ii]=Et&255;++bi<ri&&(Zi*=256);)Et<0&&Gi===0&&this[ii+bi-1]!==0&&(Gi=1),this[ii+bi]=(Et/Zi>>0)-Gi&255;return ii+ri},ae.prototype.writeIntBE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,!ui){var vi=Math.pow(2,8*ri-1);pi(this,Et,ii,ri,vi-1,-vi)}var bi=ri-1,Zi=1,Gi=0;for(this[ii+bi]=Et&255;--bi>=0&&(Zi*=256);)Et<0&&Gi===0&&this[ii+bi+1]!==0&&(Gi=1),this[ii+bi]=(Et/Zi>>0)-Gi&255;return ii+ri},ae.prototype.writeInt8=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,1,127,-128),Et<0&&(Et=255+Et+1),this[ii]=Et&255,ii+1},ae.prototype.writeInt16LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,32767,-32768),this[ii]=Et&255,this[ii+1]=Et>>>8,ii+2},ae.prototype.writeInt16BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,32767,-32768),this[ii]=Et>>>8,this[ii+1]=Et&255,ii+2},ae.prototype.writeInt32LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,2147483647,-2147483648),this[ii]=Et&255,this[ii+1]=Et>>>8,this[ii+2]=Et>>>16,this[ii+3]=Et>>>24,ii+4},ae.prototype.writeInt32BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,2147483647,-2147483648),Et<0&&(Et=4294967295+Et+1),this[ii]=Et>>>24,this[ii+1]=Et>>>16,this[ii+2]=Et>>>8,this[ii+3]=Et&255,ii+4};function yi(oi,Et,ii,ri,ui,vi){if(ii+ri>oi.length)throw new RangeError("Index out of range");if(ii<0)throw new RangeError("Index out of range")}function Ai(oi,Et,ii,ri,ui){return Et=+Et,ii=ii>>>0,ui||yi(oi,Et,ii,4),oe.write(oi,Et,ii,ri,23,4),ii+4}ae.prototype.writeFloatLE=function(Et,ii,ri){return Ai(this,Et,ii,!0,ri)},ae.prototype.writeFloatBE=function(Et,ii,ri){return Ai(this,Et,ii,!1,ri)};function hi(oi,Et,ii,ri,ui){return Et=+Et,ii=ii>>>0,ui||yi(oi,Et,ii,8),oe.write(oi,Et,ii,ri,52,8),ii+8}ae.prototype.writeDoubleLE=function(Et,ii,ri){return hi(this,Et,ii,!0,ri)},ae.prototype.writeDoubleBE=function(Et,ii,ri){return hi(this,Et,ii,!1,ri)},ae.prototype.copy=function(Et,ii,ri,ui){if(!ae.isBuffer(Et))throw new TypeError("argument should be a Buffer");if(ri||(ri=0),!ui&&ui!==0&&(ui=this.length),ii>=Et.length&&(ii=Et.length),ii||(ii=0),ui>0&&ui<ri&&(ui=ri),ui===ri||Et.length===0||this.length===0)return 0;if(ii<0)throw new RangeError("targetStart out of bounds");if(ri<0||ri>=this.length)throw new RangeError("Index out of range");if(ui<0)throw new RangeError("sourceEnd out of bounds");ui>this.length&&(ui=this.length),Et.length-ii<ui-ri&&(ui=Et.length-ii+ri);var vi=ui-ri;if(this===Et&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(ii,ri,ui);else if(this===Et&&ri<ii&&ii<ui)for(var bi=vi-1;bi>=0;--bi)Et[bi+ii]=this[bi+ri];else Uint8Array.prototype.set.call(Et,this.subarray(ri,ui),ii);return vi},ae.prototype.fill=function(Et,ii,ri,ui){if(typeof Et=="string"){if(typeof ii=="string"?(ui=ii,ii=0,ri=this.length):typeof ri=="string"&&(ui=ri,ri=this.length),ui!==void 0&&typeof ui!="string")throw new TypeError("encoding must be a string");if(typeof ui=="string"&&!ae.isEncoding(ui))throw new TypeError("Unknown encoding: "+ui);if(Et.length===1){var vi=Et.charCodeAt(0);(ui==="utf8"&&vi<128||ui==="latin1")&&(Et=vi)}}else typeof Et=="number"&&(Et=Et&255);if(ii<0||this.length<ii||this.length<ri)throw new RangeError("Out of range index");if(ri<=ii)return this;ii=ii>>>0,ri=ri===void 0?this.length:ri>>>0,Et||(Et=0);var bi;if(typeof Et=="number")for(bi=ii;bi<ri;++bi)this[bi]=Et;else{var Zi=ae.isBuffer(Et)?Et:ae.from(Et,ui),Gi=Zi.length;if(Gi===0)throw new TypeError('The value "'+Et+'" is invalid for argument "value"');for(bi=0;bi<ri-ii;++bi)this[bi+ii]=Zi[bi%Gi]}return this};var wi=/[^+/0-9A-Za-z-_]/g;function Ci(oi){if(oi=oi.split("=")[0],oi=oi.trim().replace(wi,""),oi.length<2)return"";for(;oi.length%4!==0;)oi=oi+"=";return oi}function mi(oi){return oi<16?"0"+oi.toString(16):oi.toString(16)}function Ni(oi,Et){Et=Et||1/0;for(var ii,ri=oi.length,ui=null,vi=[],bi=0;bi<ri;++bi){if(ii=oi.charCodeAt(bi),ii>55295&&ii<57344){if(!ui){if(ii>56319){(Et-=3)>-1&&vi.push(239,191,189);continue}else if(bi+1===ri){(Et-=3)>-1&&vi.push(239,191,189);continue}ui=ii;continue}if(ii<56320){(Et-=3)>-1&&vi.push(239,191,189),ui=ii;continue}ii=(ui-55296<<10|ii-56320)+65536}else ui&&(Et-=3)>-1&&vi.push(239,191,189);if(ui=null,ii<128){if((Et-=1)<0)break;vi.push(ii)}else if(ii<2048){if((Et-=2)<0)break;vi.push(ii>>6|192,ii&63|128)}else if(ii<65536){if((Et-=3)<0)break;vi.push(ii>>12|224,ii>>6&63|128,ii&63|128)}else if(ii<1114112){if((Et-=4)<0)break;vi.push(ii>>18|240,ii>>12&63|128,ii>>6&63|128,ii&63|128)}else throw new Error("Invalid code point")}return vi}function Mi(oi){for(var Et=[],ii=0;ii<oi.length;++ii)Et.push(oi.charCodeAt(ii)&255);return Et}function fi(oi,Et){for(var ii,ri,ui,vi=[],bi=0;bi<oi.length&&!((Et-=2)<0);++bi)ii=oi.charCodeAt(bi),ri=ii>>8,ui=ii%256,vi.push(ui),vi.push(ri);return vi}function zi(oi){return $.toByteArray(Ci(oi))}function Si(oi,Et,ii,ri){for(var ui=0;ui<ri&&!(ui+ii>=Et.length||ui>=oi.length);++ui)Et[ui+ii]=oi[ui];return ui}function si(oi,Et){return oi instanceof Et||oi!=null&&oi.constructor!=null&&oi.constructor.name!=null&&oi.constructor.name===Et.name}function Ii(oi){return oi!==oi}}).call(this)}).call(this,r("buffer").Buffer)},{"base64-js":13,buffer:17,ieee754:23}],18:[function(r,g,k){(function(V){(function(){k.formatArgs=oe,k.save=re,k.load=Ce,k.useColors=$,k.storage=ie(),k.destroy=(()=>{let le=!1;return()=>{le||(le=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),k.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function $(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function oe(le){if(le[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+le[0]+(this.useColors?"%c ":" ")+"+"+g.exports.humanize(this.diff),!this.useColors)return;const Ie="color: "+this.color;le.splice(1,0,Ie,"color: inherit");let ue=0,de=0;le[0].replace(/%[a-zA-Z%]/g,Ne=>{Ne!=="%%"&&(ue++,Ne==="%c"&&(de=ue))}),le.splice(de,0,Ie)}k.log=console.debug||console.log||(()=>{});function re(le){try{le?k.storage.setItem("debug",le):k.storage.removeItem("debug")}catch{}}function Ce(){let le;try{le=k.storage.getItem("debug")}catch{}return!le&&typeof V<"u"&&"env"in V&&(le=V.env.DEBUG),le}function ie(){try{return localStorage}catch{}}g.exports=r("./common")(k);const{formatters:ae}=g.exports;ae.j=function(le){try{return JSON.stringify(le)}catch(Ie){return"[UnexpectedJSONParseError]: "+Ie.message}}}).call(this)}).call(this,r("_process"))},{"./common":19,_process:50}],19:[function(r,g,k){function V($){re.debug=re,re.default=re,re.coerce=ue,re.disable=ae,re.enable=ie,re.enabled=le,re.humanize=r("ms"),re.destroy=de,Object.keys($).forEach(Ne=>{re[Ne]=$[Ne]}),re.names=[],re.skips=[],re.formatters={};function oe(Ne){let he=0;for(let pe=0;pe<Ne.length;pe++)he=(he<<5)-he+Ne.charCodeAt(pe),he|=0;return re.colors[Math.abs(he)%re.colors.length]}re.selectColor=oe;function re(Ne){let he,pe=null,ze,Fe;function xe(..._e){if(!xe.enabled)return;const Dt=xe,$e=Number(new Date),Ue=$e-(he||$e);Dt.diff=Ue,Dt.prev=he,Dt.curr=$e,he=$e,_e[0]=re.coerce(_e[0]),typeof _e[0]!="string"&&_e.unshift("%O");let Ve=0;_e[0]=_e[0].replace(/%([a-zA-Z%])/g,(At,qe)=>{if(At==="%%")return"%";Ve++;const Lt=re.formatters[qe];if(typeof Lt=="function"){const kt=_e[Ve];At=Lt.call(Dt,kt),_e.splice(Ve,1),Ve--}return At}),re.formatArgs.call(Dt,_e),(Dt.log||re.log).apply(Dt,_e)}return xe.namespace=Ne,xe.useColors=re.useColors(),xe.color=re.selectColor(Ne),xe.extend=Ce,xe.destroy=re.destroy,Object.defineProperty(xe,"enabled",{enumerable:!0,configurable:!1,get:()=>pe!==null?pe:(ze!==re.namespaces&&(ze=re.namespaces,Fe=re.enabled(Ne)),Fe),set:_e=>{pe=_e}}),typeof re.init=="function"&&re.init(xe),xe}function Ce(Ne,he){const pe=re(this.namespace+(typeof he>"u"?":":he)+Ne);return pe.log=this.log,pe}function ie(Ne){re.save(Ne),re.namespaces=Ne,re.names=[],re.skips=[];let he;const pe=(typeof Ne=="string"?Ne:"").split(/[\s,]+/),ze=pe.length;for(he=0;he<ze;he++)pe[he]&&(Ne=pe[he].replace(/\*/g,".*?"),Ne[0]==="-"?re.skips.push(new RegExp("^"+Ne.substr(1)+"$")):re.names.push(new RegExp("^"+Ne+"$")))}function ae(){const Ne=[...re.names.map(Ie),...re.skips.map(Ie).map(he=>"-"+he)].join(",");return re.enable(""),Ne}function le(Ne){if(Ne[Ne.length-1]==="*")return!0;let he,pe;for(he=0,pe=re.skips.length;he<pe;he++)if(re.skips[he].test(Ne))return!1;for(he=0,pe=re.names.length;he<pe;he++)if(re.names[he].test(Ne))return!0;return!1}function Ie(Ne){return Ne.toString().substring(2,Ne.toString().length-2).replace(/\.\*\?$/,"*")}function ue(Ne){return Ne instanceof Error?Ne.stack||Ne.message:Ne}function de(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return re.enable(re.load()),re}g.exports=V},{ms:45}],20:[function(r,g,k){(function(V,$){(function(){var oe=r("readable-stream"),re=r("end-of-stream"),Ce=r("inherits"),ie=r("stream-shift"),ae=$.from&&$.from!==Uint8Array.from?$.from([0]):new $([0]),le=function(ze,Fe){ze._corked?ze.once("uncork",Fe):Fe()},Ie=function(ze,Fe){ze._autoDestroy&&ze.destroy(Fe)},ue=function(ze,Fe){return function(xe){xe?Ie(ze,xe.message==="premature close"?null:xe):Fe&&!ze._ended&&ze.end()}},de=function(ze,Fe){if(!ze||ze._writableState&&ze._writableState.finished)return Fe();if(ze._writableState)return ze.end(Fe);ze.end(),Fe()},Ne=function(){},he=function(ze){return new oe.Readable({objectMode:!0,highWaterMark:16}).wrap(ze)},pe=function(ze,Fe,xe){if(!(this instanceof pe))return new pe(ze,Fe,xe);oe.Duplex.call(this,xe),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!xe||xe.autoDestroy!==!1,this._forwardDestroy=!xe||xe.destroy!==!1,this._forwardEnd=!xe||xe.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,ze&&this.setWritable(ze),Fe&&this.setReadable(Fe)};Ce(pe,oe.Duplex),pe.obj=function(ze,Fe,xe){return xe||(xe={}),xe.objectMode=!0,xe.highWaterMark=16,new pe(ze,Fe,xe)},pe.prototype.cork=function(){++this._corked===1&&this.emit("cork")},pe.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},pe.prototype.setWritable=function(ze){if(this._unwrite&&this._unwrite(),this.destroyed){ze&&ze.destroy&&ze.destroy();return}if(ze===null||ze===!1){this.end();return}var Fe=this,xe=re(ze,{writable:!0,readable:!1},ue(this,this._forwardEnd)),_e=function(){var $e=Fe._ondrain;Fe._ondrain=null,$e&&$e()},Dt=function(){Fe._writable.removeListener("drain",_e),xe()};this._unwrite&&V.nextTick(_e),this._writable=ze,this._writable.on("drain",_e),this._unwrite=Dt,this.uncork()},pe.prototype.setReadable=function(ze){if(this._unread&&this._unread(),this.destroyed){ze&&ze.destroy&&ze.destroy();return}if(ze===null||ze===!1){this.push(null),this.resume();return}var Fe=this,xe=re(ze,{writable:!1,readable:!0},ue(this)),_e=function(){Fe._forward()},Dt=function(){Fe.push(null)},$e=function(){Fe._readable2.removeListener("readable",_e),Fe._readable2.removeListener("end",Dt),xe()};this._drained=!0,this._readable=ze,this._readable2=ze._readableState?ze:he(ze),this._readable2.on("readable",_e),this._readable2.on("end",Dt),this._unread=$e,this._forward()},pe.prototype._read=function(){this._drained=!0,this._forward()},pe.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var ze;this._drained&&(ze=ie(this._readable2))!==null;)this.destroyed||(this._drained=this.push(ze));this._forwarding=!1}},pe.prototype.destroy=function(ze,Fe){if(Fe||(Fe=Ne),this.destroyed)return Fe(null);this.destroyed=!0;var xe=this;V.nextTick(function(){xe._destroy(ze),Fe(null)})},pe.prototype._destroy=function(ze){if(ze){var Fe=this._ondrain;this._ondrain=null,Fe?Fe(ze):this.emit("error",ze)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},pe.prototype._write=function(ze,Fe,xe){if(!this.destroyed){if(this._corked)return le(this,this._write.bind(this,ze,Fe,xe));if(ze===ae)return this._finish(xe);if(!this._writable)return xe();this._writable.write(ze)===!1?this._ondrain=xe:this.destroyed||xe()}},pe.prototype._finish=function(ze){var Fe=this;this.emit("preend"),le(this,function(){de(Fe._forwardEnd&&Fe._writable,function(){Fe._writableState.prefinished===!1&&(Fe._writableState.prefinished=!0),Fe.emit("prefinish"),le(Fe,ze)})})},pe.prototype.end=function(ze,Fe,xe){return typeof ze=="function"?this.end(null,null,ze):typeof Fe=="function"?this.end(ze,null,Fe):(this._ended=!0,ze&&this.write(ze),!this._writableState.ending&&!this._writableState.destroyed&&this.write(ae),oe.Writable.prototype.end.call(this,xe))},g.exports=pe}).call(this)}).call(this,r("_process"),r("buffer").Buffer)},{_process:50,buffer:17,"end-of-stream":21,inherits:24,"readable-stream":69,"stream-shift":74}],21:[function(r,g,k){(function(V){(function(){var $=r("once"),oe=function(){},re=function(ae){return ae.setHeader&&typeof ae.abort=="function"},Ce=function(ae){return ae.stdio&&Array.isArray(ae.stdio)&&ae.stdio.length===3},ie=function(ae,le,Ie){if(typeof le=="function")return ie(ae,null,le);le||(le={}),Ie=$(Ie||oe);var ue=ae._writableState,de=ae._readableState,Ne=le.readable||le.readable!==!1&&ae.readable,he=le.writable||le.writable!==!1&&ae.writable,pe=!1,ze=function(){ae.writable||Fe()},Fe=function(){he=!1,Ne||Ie.call(ae)},xe=function(){Ne=!1,he||Ie.call(ae)},_e=function(Oe){Ie.call(ae,Oe?new Error("exited with error code: "+Oe):null)},Dt=function(Oe){Ie.call(ae,Oe)},$e=function(){V.nextTick(Ue)},Ue=function(){if(!pe){if(Ne&&!(de&&de.ended&&!de.destroyed))return Ie.call(ae,new Error("premature close"));if(he&&!(ue&&ue.ended&&!ue.destroyed))return Ie.call(ae,new Error("premature close"))}},Ve=function(){ae.req.on("finish",Fe)};return re(ae)?(ae.on("complete",Fe),ae.on("abort",$e),ae.req?Ve():ae.on("request",Ve)):he&&!ue&&(ae.on("end",ze),ae.on("close",ze)),Ce(ae)&&ae.on("exit",_e),ae.on("end",xe),ae.on("finish",Fe),le.error!==!1&&ae.on("error",Dt),ae.on("close",$e),function(){pe=!0,ae.removeListener("complete",Fe),ae.removeListener("abort",$e),ae.removeListener("request",Ve),ae.req&&ae.req.removeListener("finish",Fe),ae.removeListener("end",ze),ae.removeListener("close",ze),ae.removeListener("finish",Fe),ae.removeListener("exit",_e),ae.removeListener("end",xe),ae.removeListener("error",Dt),ae.removeListener("close",$e)}};g.exports=ie}).call(this)}).call(this,r("_process"))},{_process:50,once:48}],22:[function(r,g,k){var V=Object.create||Ve,$=Object.keys||Oe,oe=Function.prototype.bind||At;function re(){(!this._events||!Object.prototype.hasOwnProperty.call(this,"_events"))&&(this._events=V(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}g.exports=re,re.EventEmitter=re,re.prototype._events=void 0,re.prototype._maxListeners=void 0;var Ce=10,ie;try{var ae={};Object.defineProperty&&Object.defineProperty(ae,"x",{value:0}),ie=ae.x===0}catch{ie=!1}ie?Object.defineProperty(re,"defaultMaxListeners",{enumerable:!0,get:function(){return Ce},set:function(qe){if(typeof qe!="number"||qe<0||qe!==qe)throw new TypeError('"defaultMaxListeners" must be a positive number');Ce=qe}}):re.defaultMaxListeners=Ce,re.prototype.setMaxListeners=function(Lt){if(typeof Lt!="number"||Lt<0||isNaN(Lt))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=Lt,this};function le(qe){return qe._maxListeners===void 0?re.defaultMaxListeners:qe._maxListeners}re.prototype.getMaxListeners=function(){return le(this)};function Ie(qe,Lt,kt){if(Lt)qe.call(kt);else for(var jt=qe.length,ti=$e(qe,jt),ei=0;ei<jt;++ei)ti[ei].call(kt)}function ue(qe,Lt,kt,jt){if(Lt)qe.call(kt,jt);else for(var ti=qe.length,ei=$e(qe,ti),Pt=0;Pt<ti;++Pt)ei[Pt].call(kt,jt)}function de(qe,Lt,kt,jt,ti){if(Lt)qe.call(kt,jt,ti);else for(var ei=qe.length,Pt=$e(qe,ei),ni=0;ni<ei;++ni)Pt[ni].call(kt,jt,ti)}function Ne(qe,Lt,kt,jt,ti,ei){if(Lt)qe.call(kt,jt,ti,ei);else for(var Pt=qe.length,ni=$e(qe,Pt),gi=0;gi<Pt;++gi)ni[gi].call(kt,jt,ti,ei)}function he(qe,Lt,kt,jt){if(Lt)qe.apply(kt,jt);else for(var ti=qe.length,ei=$e(qe,ti),Pt=0;Pt<ti;++Pt)ei[Pt].apply(kt,jt)}re.prototype.emit=function(Lt){var kt,jt,ti,ei,Pt,ni,gi=Lt==="error";if(ni=this._events,ni)gi=gi&&ni.error==null;else if(!gi)return!1;if(gi){if(arguments.length>1&&(kt=arguments[1]),kt instanceof Error)throw kt;var di=new Error('Unhandled "error" event. ('+kt+")");throw di.context=kt,di}if(jt=ni[Lt],!jt)return!1;var li=typeof jt=="function";switch(ti=arguments.length,ti){case 1:Ie(jt,li,this);break;case 2:ue(jt,li,this,arguments[1]);break;case 3:de(jt,li,this,arguments[1],arguments[2]);break;case 4:Ne(jt,li,this,arguments[1],arguments[2],arguments[3]);break;default:for(ei=new Array(ti-1),Pt=1;Pt<ti;Pt++)ei[Pt-1]=arguments[Pt];he(jt,li,this,ei)}return!0};function pe(qe,Lt,kt,jt){var ti,ei,Pt;if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');if(ei=qe._events,ei?(ei.newListener&&(qe.emit("newListener",Lt,kt.listener?kt.listener:kt),ei=qe._events),Pt=ei[Lt]):(ei=qe._events=V(null),qe._eventsCount=0),!Pt)Pt=ei[Lt]=kt,++qe._eventsCount;else if(typeof Pt=="function"?Pt=ei[Lt]=jt?[kt,Pt]:[Pt,kt]:jt?Pt.unshift(kt):Pt.push(kt),!Pt.warned&&(ti=le(qe),ti&&ti>0&&Pt.length>ti)){Pt.warned=!0;var ni=new Error("Possible EventEmitter memory leak detected. "+Pt.length+' "'+String(Lt)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');ni.name="MaxListenersExceededWarning",ni.emitter=qe,ni.type=Lt,ni.count=Pt.length,typeof console=="object"&&console.warn&&console.warn("%s: %s",ni.name,ni.message)}return qe}re.prototype.addListener=function(Lt,kt){return pe(this,Lt,kt,!1)},re.prototype.on=re.prototype.addListener,re.prototype.prependListener=function(Lt,kt){return pe(this,Lt,kt,!0)};function ze(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var qe=new Array(arguments.length),Lt=0;Lt<qe.length;++Lt)qe[Lt]=arguments[Lt];this.listener.apply(this.target,qe)}}function Fe(qe,Lt,kt){var jt={fired:!1,wrapFn:void 0,target:qe,type:Lt,listener:kt},ti=oe.call(ze,jt);return ti.listener=kt,jt.wrapFn=ti,ti}re.prototype.once=function(Lt,kt){if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');return this.on(Lt,Fe(this,Lt,kt)),this},re.prototype.prependOnceListener=function(Lt,kt){if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(Lt,Fe(this,Lt,kt)),this},re.prototype.removeListener=function(Lt,kt){var jt,ti,ei,Pt,ni;if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');if(ti=this._events,!ti)return this;if(jt=ti[Lt],!jt)return this;if(jt===kt||jt.listener===kt)--this._eventsCount===0?this._events=V(null):(delete ti[Lt],ti.removeListener&&this.emit("removeListener",Lt,jt.listener||kt));else if(typeof jt!="function"){for(ei=-1,Pt=jt.length-1;Pt>=0;Pt--)if(jt[Pt]===kt||jt[Pt].listener===kt){ni=jt[Pt].listener,ei=Pt;break}if(ei<0)return this;ei===0?jt.shift():Dt(jt,ei),jt.length===1&&(ti[Lt]=jt[0]),ti.removeListener&&this.emit("removeListener",Lt,ni||kt)}return this},re.prototype.removeAllListeners=function(Lt){var kt,jt,ti;if(jt=this._events,!jt)return this;if(!jt.removeListener)return arguments.length===0?(this._events=V(null),this._eventsCount=0):jt[Lt]&&(--this._eventsCount===0?this._events=V(null):delete jt[Lt]),this;if(arguments.length===0){var ei=$(jt),Pt;for(ti=0;ti<ei.length;++ti)Pt=ei[ti],Pt!=="removeListener"&&this.removeAllListeners(Pt);return this.removeAllListeners("removeListener"),this._events=V(null),this._eventsCount=0,this}if(kt=jt[Lt],typeof kt=="function")this.removeListener(Lt,kt);else if(kt)for(ti=kt.length-1;ti>=0;ti--)this.removeListener(Lt,kt[ti]);return this};function xe(qe,Lt,kt){var jt=qe._events;if(!jt)return[];var ti=jt[Lt];return ti?typeof ti=="function"?kt?[ti.listener||ti]:[ti]:kt?Ue(ti):$e(ti,ti.length):[]}re.prototype.listeners=function(Lt){return xe(this,Lt,!0)},re.prototype.rawListeners=function(Lt){return xe(this,Lt,!1)},re.listenerCount=function(qe,Lt){return typeof qe.listenerCount=="function"?qe.listenerCount(Lt):_e.call(qe,Lt)},re.prototype.listenerCount=_e;function _e(qe){var Lt=this._events;if(Lt){var kt=Lt[qe];if(typeof kt=="function")return 1;if(kt)return kt.length}return 0}re.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function Dt(qe,Lt){for(var kt=Lt,jt=kt+1,ti=qe.length;jt<ti;kt+=1,jt+=1)qe[kt]=qe[jt];qe.pop()}function $e(qe,Lt){for(var kt=new Array(Lt),jt=0;jt<Lt;++jt)kt[jt]=qe[jt];return kt}function Ue(qe){for(var Lt=new Array(qe.length),kt=0;kt<Lt.length;++kt)Lt[kt]=qe[kt].listener||qe[kt];return Lt}function Ve(qe){var Lt=function(){};return Lt.prototype=qe,new Lt}function Oe(qe){for(var Lt in qe)Object.prototype.hasOwnProperty.call(qe,Lt);return Lt}function At(qe){var Lt=this;return function(){return Lt.apply(qe,arguments)}}},{}],23:[function(r,g,k){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */k.read=function(V,$,oe,re,Ce){var ie,ae,le=Ce*8-re-1,Ie=(1<<le)-1,ue=Ie>>1,de=-7,Ne=oe?Ce-1:0,he=oe?-1:1,pe=V[$+Ne];for(Ne+=he,ie=pe&(1<<-de)-1,pe>>=-de,de+=le;de>0;ie=ie*256+V[$+Ne],Ne+=he,de-=8);for(ae=ie&(1<<-de)-1,ie>>=-de,de+=re;de>0;ae=ae*256+V[$+Ne],Ne+=he,de-=8);if(ie===0)ie=1-ue;else{if(ie===Ie)return ae?NaN:(pe?-1:1)*(1/0);ae=ae+Math.pow(2,re),ie=ie-ue}return(pe?-1:1)*ae*Math.pow(2,ie-re)},k.write=function(V,$,oe,re,Ce,ie){var ae,le,Ie,ue=ie*8-Ce-1,de=(1<<ue)-1,Ne=de>>1,he=Ce===23?Math.pow(2,-24)-Math.pow(2,-77):0,pe=re?0:ie-1,ze=re?1:-1,Fe=$<0||$===0&&1/$<0?1:0;for($=Math.abs($),isNaN($)||$===1/0?(le=isNaN($)?1:0,ae=de):(ae=Math.floor(Math.log($)/Math.LN2),$*(Ie=Math.pow(2,-ae))<1&&(ae--,Ie*=2),ae+Ne>=1?$+=he/Ie:$+=he*Math.pow(2,1-Ne),$*Ie>=2&&(ae++,Ie/=2),ae+Ne>=de?(le=0,ae=de):ae+Ne>=1?(le=($*Ie-1)*Math.pow(2,Ce),ae=ae+Ne):(le=$*Math.pow(2,Ne-1)*Math.pow(2,Ce),ae=0));Ce>=8;V[oe+pe]=le&255,pe+=ze,le/=256,Ce-=8);for(ae=ae<<Ce|le,ue+=Ce;ue>0;V[oe+pe]=ae&255,pe+=ze,ae/=256,ue-=8);V[oe+pe-ze]|=Fe*128}},{}],24:[function(r,g,k){typeof Object.create=="function"?g.exports=function($,oe){oe&&($.super_=oe,$.prototype=Object.create(oe.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}))}:g.exports=function($,oe){if(oe){$.super_=oe;var re=function(){};re.prototype=oe.prototype,$.prototype=new re,$.prototype.constructor=$}}},{}],25:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});var V=function(){function $(oe,re){this.color=!0,this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0,this.leftChild=void 0,this.rightChild=void 0,this.key=oe,this.value=re}return $.prototype.rotateLeft=function(){var oe=this.parent,re=this.brother,Ce=this.leftChild,ie=this.rightChild;if(!ie)throw new Error("unknown error");var ae=ie.leftChild,le=ie.rightChild;return oe&&(oe.leftChild===this?oe.leftChild=ie:oe.rightChild===this&&(oe.rightChild=ie)),ie.parent=oe,ie.brother=re,ie.leftChild=this,ie.rightChild=le,re&&(re.brother=ie),this.parent=ie,this.brother=le,this.leftChild=Ce,this.rightChild=ae,le&&(le.parent=ie,le.brother=this),Ce&&(Ce.parent=this,Ce.brother=ae),ae&&(ae.parent=this,ae.brother=Ce),ie},$.prototype.rotateRight=function(){var oe=this.parent,re=this.brother,Ce=this.leftChild;if(!Ce)throw new Error("unknown error");var ie=this.rightChild,ae=Ce.leftChild,le=Ce.rightChild;return oe&&(oe.leftChild===this?oe.leftChild=Ce:oe.rightChild===this&&(oe.rightChild=Ce)),Ce.parent=oe,Ce.brother=re,Ce.leftChild=ae,Ce.rightChild=this,re&&(re.brother=Ce),ae&&(ae.parent=Ce,ae.brother=this),this.parent=Ce,this.brother=ae,this.leftChild=le,this.rightChild=ie,le&&(le.parent=this,le.brother=ie),ie&&(ie.parent=this,ie.brother=le),Ce},$.prototype.remove=function(){if(this.leftChild||this.rightChild)throw new Error("can only remove leaf node");this.parent&&(this===this.parent.leftChild?this.parent.leftChild=void 0:this===this.parent.rightChild&&(this.parent.rightChild=void 0)),this.brother&&(this.brother.brother=void 0),this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0},$.TreeNodeColorType={red:!0,black:!1},$}();Object.freeze(V),k.default=V},{}],26:[function(r,g,k){var V=this&&this.__generator||function(oe,re){var Ce={label:0,sent:function(){if(le[0]&1)throw le[1];return le[1]},trys:[],ops:[]},ie,ae,le,Ie;return Ie={next:ue(0),throw:ue(1),return:ue(2)},typeof Symbol=="function"&&(Ie[Symbol.iterator]=function(){return this}),Ie;function ue(Ne){return function(he){return de([Ne,he])}}function de(Ne){if(ie)throw new TypeError("Generator is already executing.");for(;Ce;)try{if(ie=1,ae&&(le=Ne[0]&2?ae.return:Ne[0]?ae.throw||((le=ae.return)&&le.call(ae),0):ae.next)&&!(le=le.call(ae,Ne[1])).done)return le;switch(ae=0,le&&(Ne=[Ne[0]&2,le.value]),Ne[0]){case 0:case 1:le=Ne;break;case 4:return Ce.label++,{value:Ne[1],done:!1};case 5:Ce.label++,ae=Ne[1],Ne=[0];continue;case 7:Ne=Ce.ops.pop(),Ce.trys.pop();continue;default:if(le=Ce.trys,!(le=le.length>0&&le[le.length-1])&&(Ne[0]===6||Ne[0]===2)){Ce=0;continue}if(Ne[0]===3&&(!le||Ne[1]>le[0]&&Ne[1]<le[3])){Ce.label=Ne[1];break}if(Ne[0]===6&&Ce.label<le[1]){Ce.label=le[1],le=Ne;break}if(le&&Ce.label<le[2]){Ce.label=le[2],Ce.ops.push(Ne);break}le[2]&&Ce.ops.pop(),Ce.trys.pop();continue}Ne=re.call(oe,Ce)}catch(he){Ne=[6,he],ae=0}finally{ie=le=0}if(Ne[0]&5)throw Ne[1];return{value:Ne[0]?Ne[1]:void 0,done:!0}}};Object.defineProperty(k,"__esModule",{value:!0}),$.sigma=3,$.bucketSize=5e3;function $(oe){var re=this;oe===void 0&&(oe=[]);var Ce=[],ie=0,ae=0,le=0,Ie=0,ue=0,de=0;this.size=function(){return de},this.empty=function(){return de===0},this.clear=function(){ie=le=ae=Ie=ue=de=0,he.call(this,$.bucketSize),de=0},this.front=function(){return Ce[ie][ae]},this.back=function(){return Ce[le][Ie]},this.forEach=function(pe){if(!this.empty()){var ze=0;if(ie===le){for(var Fe=ae;Fe<=Ie;++Fe)pe(Ce[ie][Fe],ze++);return}for(var Fe=ae;Fe<$.bucketSize;++Fe)pe(Ce[ie][Fe],ze++);for(var Fe=ie+1;Fe<le;++Fe)for(var xe=0;xe<$.bucketSize;++xe)pe(Ce[Fe][xe],ze++);for(var Fe=0;Fe<=Ie;++Fe)pe(Ce[le][Fe],ze++)}};var Ne=function(pe){var ze=ie*$.bucketSize+ae,Fe=ze+pe,xe=le*$.bucketSize+Ie;if(Fe<ze||Fe>xe)throw new Error("pos should more than 0 and less than queue's size");var _e=Math.floor(Fe/$.bucketSize),Dt=Fe%$.bucketSize;return{curNodeBucketIndex:_e,curNodePointerIndex:Dt}};this.getElementByPos=function(pe){var ze=Ne(pe),Fe=ze.curNodeBucketIndex,xe=ze.curNodePointerIndex;return Ce[Fe][xe]},this.eraseElementByPos=function(pe){var ze=this;if(pe<0||pe>de)throw new Error("pos should more than 0 and less than queue's size");if(pe===0)this.popFront();else if(pe===this.size())this.popBack();else{for(var Fe=[],xe=pe+1;xe<de;++xe)Fe.push(this.getElementByPos(xe));this.cut(pe),this.popBack(),Fe.forEach(function(_e){return ze.pushBack(_e)})}},this.eraseElementByValue=function(pe){if(!this.empty()){var ze=[];this.forEach(function(_e){_e!==pe&&ze.push(_e)});for(var Fe=ze.length,xe=0;xe<Fe;++xe)this.setElementByPos(xe,ze[xe]);this.cut(Fe-1)}};var he=function(pe){for(var ze=[],Fe=pe*$.sigma,xe=Math.max(Math.ceil(Fe/$.bucketSize),2),_e=0;_e<xe;++_e)ze.push(new Array($.bucketSize));var Dt=Math.ceil(pe/$.bucketSize),$e=Math.floor(xe/2)-Math.floor(Dt/2),Ue=$e,Ve=0;if(this.size())for(var _e=0;_e<Dt;++_e){for(var Oe=0;Oe<$.bucketSize;++Oe)if(ze[$e+_e][Oe]=this.front(),this.popFront(),this.empty()){Ue=$e+_e,Ve=Oe;break}if(this.empty())break}Ce=ze,ie=$e,ae=0,le=Ue,Ie=Ve,ue=xe,de=pe};this.pushBack=function(pe){this.empty()||(le===ue-1&&Ie===$.bucketSize-1&&he.call(this,this.size()),Ie<$.bucketSize-1?++Ie:le<ue-1&&(++le,Ie=0)),++de,Ce[le][Ie]=pe},this.popBack=function(){this.empty()||(this.size()!==1&&(Ie>0?--Ie:ie<le&&(--le,Ie=$.bucketSize-1)),de>0&&--de)},this.setElementByPos=function(pe,ze){var Fe=Ne(pe),xe=Fe.curNodeBucketIndex,_e=Fe.curNodePointerIndex;Ce[xe][_e]=ze},this.insert=function(pe,ze,Fe){var xe=this;if(Fe===void 0&&(Fe=1),pe===0)for(;Fe--;)this.pushFront(ze);else if(pe===this.size())for(;Fe--;)this.pushBack(ze);else{for(var _e=[],Dt=pe;Dt<de;++Dt)_e.push(this.getElementByPos(Dt));this.cut(pe-1);for(var Dt=0;Dt<Fe;++Dt)this.pushBack(ze);_e.forEach(function($e){return xe.pushBack($e)})}},this.find=function(pe){if(ie===le){for(var ze=ae;ze<=Ie;++ze)if(Ce[ie][ze]===pe)return!0;return!1}for(var ze=ae;ze<$.bucketSize;++ze)if(Ce[ie][ze]===pe)return!0;for(var ze=ie+1;ze<le;++ze)for(var Fe=0;Fe<$.bucketSize;++Fe)if(Ce[ze][Fe]===pe)return!0;for(var ze=0;ze<=Ie;++ze)if(Ce[le][ze]===pe)return!0;return!1},this.reverse=function(){for(var pe=0,ze=de-1;pe<ze;){var Fe=this.getElementByPos(pe);this.setElementByPos(pe,this.getElementByPos(ze)),this.setElementByPos(ze,Fe),++pe,--ze}},this.unique=function(){if(!this.empty()){var pe=[],ze=this.front();this.forEach(function(xe,_e){(_e===0||xe!==ze)&&(pe.push(xe),ze=xe)});for(var Fe=0;Fe<de;++Fe)this.setElementByPos(Fe,pe[Fe]);this.cut(pe.length-1)}},this.sort=function(pe){var ze=[];this.forEach(function(xe){ze.push(xe)}),ze.sort(pe);for(var Fe=0;Fe<de;++Fe)this.setElementByPos(Fe,ze[Fe])},this.pushFront=function(pe){this.empty()||(ie===0&&ae===0&&he.call(this,this.size()),ae>0?--ae:ie>0&&(--ie,ae=$.bucketSize-1)),++de,Ce[ie][ae]=pe},this.popFront=function(){this.empty()||(this.size()!==1&&(ae<$.bucketSize-1?++ae:ie<le&&(++ie,ae=0)),de>0&&--de)},this.shrinkToFit=function(){var pe=this,ze=[];this.forEach(function(Dt){ze.push(Dt)});var Fe=ze.length;Ce=[];for(var xe=Math.ceil(Fe/$.bucketSize),_e=0;_e<xe;++_e)Ce.push(new Array($.bucketSize));this.clear(),ze.forEach(function(Dt){return pe.pushBack(Dt)})},this.cut=function(pe){if(pe<0){this.clear();return}var ze=Ne(pe),Fe=ze.curNodeBucketIndex,xe=ze.curNodePointerIndex;le=Fe,Ie=xe,de=pe+1},this[Symbol.iterator]=function(){return function(){var ze,ze,ze,pe,ze;return V(this,function(Fe){switch(Fe.label){case 0:if(de===0)return[2];if(ie!==le)return[3,5];ze=ae,Fe.label=1;case 1:return ze<=Ie?[4,Ce[ie][ze]]:[3,4];case 2:Fe.sent(),Fe.label=3;case 3:return++ze,[3,1];case 4:return[2];case 5:ze=ae,Fe.label=6;case 6:return ze<$.bucketSize?[4,Ce[ie][ze]]:[3,9];case 7:Fe.sent(),Fe.label=8;case 8:return++ze,[3,6];case 9:ze=ie+1,Fe.label=10;case 10:if(!(ze<le))return[3,15];pe=0,Fe.label=11;case 11:return pe<$.bucketSize?[4,Ce[ze][pe]]:[3,14];case 12:Fe.sent(),Fe.label=13;case 13:return++pe,[3,11];case 14:return++ze,[3,10];case 15:ze=0,Fe.label=16;case 16:return ze<=Ie?[4,Ce[le][ze]]:[3,19];case 17:Fe.sent(),Fe.label=18;case 18:return++ze,[3,16];case 19:return[2]}})}()},function(){var pe=$.bucketSize;oe.size?pe=oe.size():oe.length&&(pe=oe.length);var ze=pe*$.sigma;ue=Math.ceil(ze/$.bucketSize),ue=Math.max(ue,3);for(var Fe=0;Fe<ue;++Fe)Ce.push(new Array($.bucketSize));var xe=Math.ceil(pe/$.bucketSize);ie=Math.floor(ue/2)-Math.floor(xe/2),le=ie,oe.forEach(function(_e){return re.pushBack(_e)})}(),Object.freeze(this)}Object.freeze($),k.default=$},{}],27:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../LinkList/LinkList"),re=r("../Map/Map");Ce.initSize=16,Ce.maxSize=1<<30,Ce.sigma=.75,Ce.treeifyThreshold=8,Ce.untreeifyThreshold=6,Ce.minTreeifySize=64;function Ce(ie,ae,le){var Ie=this;if(ie===void 0&&(ie=[]),ae===void 0&&(ae=Ce.initSize),le=le||function(pe){var ze,Fe,xe=0,_e="";if(typeof pe=="number")xe=Math.floor(pe),xe=(xe<<5)-xe,xe=xe&xe;else{typeof pe!="string"?_e=JSON.stringify(pe):_e=pe;try{for(var Dt=$(_e),$e=Dt.next();!$e.done;$e=Dt.next()){var Ue=$e.value,Ve=Ue.charCodeAt(0);xe=(xe<<5)-xe+Ve,xe=xe&xe}}catch(Oe){ze={error:Oe}}finally{try{$e&&!$e.done&&(Fe=Dt.return)&&Fe.call(Dt)}finally{if(ze)throw ze.error}}}return xe^=xe>>>16,xe},ae&ae-1)throw new Error("initBucketNum must be 2 to the power of n");var ue=0,de=[],Ne=Math.max(Ce.initSize,Math.min(Ce.maxSize,ae));this.size=function(){return ue},this.empty=function(){return ue===0},this.clear=function(){ue=0,Ne=ae,de=[]},this.forEach=function(pe){var ze=0;de.forEach(function(Fe){Fe.forEach(function(xe){pe(xe,ze++)})})};var he=function(pe){if(!(pe>=Ce.maxSize)){Ne=pe*2;var ze=[];de.forEach(function(Fe,xe){if(!Fe.empty()){if(Fe instanceof oe.default&&Fe.size()===1){var _e=Fe.front(),Dt=_e.key,$e=_e.value;ze[le(Dt)&Ne-1]=new oe.default([{key:Dt,value:$e}])}else if(Fe instanceof re.default){var Ue=new oe.default,Ve=new oe.default;Fe.forEach(function(qe){var Lt=le(qe.key);Lt&pe?Ve.pushBack(qe):Ue.pushBack(qe)}),Ue.size()>Ce.untreeifyThreshold?ze[xe]=new re.default(Ue):Ue.size()&&(ze[xe]=Ue),Ve.size()>Ce.untreeifyThreshold?ze[xe+pe]=new re.default(Ve):Ve.size()&&(ze[xe+pe]=Ve)}else{var Oe=new oe.default,At=new oe.default;Fe.forEach(function(qe){var Lt=le(qe.key);Lt&pe?At.pushBack(qe):Oe.pushBack(qe)}),Oe.size()&&(ze[xe]=Oe),At.size()&&(ze[xe+pe]=At)}de[xe].clear()}}),de=ze}};this.setElement=function(pe,ze){var Fe,xe;if(pe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(ze==null){this.eraseElementByKey(pe);return}var _e=le(pe)&Ne-1;if(!de[_e])++ue,de[_e]=new oe.default([{key:pe,value:ze}]);else{var Dt=de[_e].size();if(de[_e]instanceof oe.default){try{for(var $e=$(de[_e]),Ue=$e.next();!Ue.done;Ue=$e.next()){var Ve=Ue.value;if(Ve.key===pe){Ve.value=ze;return}}}catch(At){Fe={error:At}}finally{try{Ue&&!Ue.done&&(xe=$e.return)&&xe.call($e)}finally{if(Fe)throw Fe.error}}de[_e].pushBack({key:pe,value:ze}),de[_e].size()>=Ce.treeifyThreshold&&(de[_e]=new re.default(de[_e]))}else de[_e].setElement(pe,ze);var Oe=de[_e].size();ue+=Oe-Dt}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.getElementByKey=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(de[xe]){if(de[xe]instanceof re.default)return de[xe].getElementByKey(pe);try{for(var _e=$(de[xe]),Dt=_e.next();!Dt.done;Dt=_e.next()){var $e=Dt.value;if($e.key===pe)return $e.value}}catch(Ue){ze={error:Ue}}finally{try{Dt&&!Dt.done&&(Fe=_e.return)&&Fe.call(_e)}finally{if(ze)throw ze.error}}}},this.eraseElementByKey=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(de[xe]){var _e=de[xe].size();if(de[xe]instanceof re.default)de[xe].eraseElementByKey(pe),de[xe].size()<=Ce.untreeifyThreshold&&(de[xe]=new oe.default(de[xe]));else{var Dt=-1;try{for(var $e=$(de[xe]),Ue=$e.next();!Ue.done;Ue=$e.next()){var Ve=Ue.value;if(++Dt,Ve.key===pe){de[xe].eraseElementByPos(Dt);break}}}catch(At){ze={error:At}}finally{try{Ue&&!Ue.done&&(Fe=$e.return)&&Fe.call($e)}finally{if(ze)throw ze.error}}}var Oe=de[xe].size();ue+=Oe-_e}},this.find=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(!de[xe])return!1;if(de[xe]instanceof re.default)return de[xe].find(pe);try{for(var _e=$(de[xe]),Dt=_e.next();!Dt.done;Dt=_e.next()){var $e=Dt.value;if($e.key===pe)return!0}}catch(Ue){ze={error:Ue}}finally{try{Dt&&!Dt.done&&(Fe=_e.return)&&Fe.call(_e)}finally{if(ze)throw ze.error}}return!1},this[Symbol.iterator]=function(){return function(){var pe,ze,Fe,xe,_e,Dt,$e;return V(this,function(Ue){switch(Ue.label){case 0:pe=0,Ue.label=1;case 1:if(!(pe<Ne))return[3,10];for(;pe<Ne&&!de[pe];)++pe;if(pe>=Ne)return[3,10];Ue.label=2;case 2:Ue.trys.push([2,7,8,9]),ze=(Dt=void 0,$(de[pe])),Fe=ze.next(),Ue.label=3;case 3:return Fe.done?[3,6]:(xe=Fe.value,[4,xe]);case 4:Ue.sent(),Ue.label=5;case 5:return Fe=ze.next(),[3,3];case 6:return[3,9];case 7:return _e=Ue.sent(),Dt={error:_e},[3,9];case 8:try{Fe&&!Fe.done&&($e=ze.return)&&$e.call(ze)}finally{if(Dt)throw Dt.error}return[7];case 9:return++pe,[3,1];case 10:return[2]}})}()},ie.forEach(function(pe){var ze=pe.key,Fe=pe.value;return Ie.setElement(ze,Fe)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{"../LinkList/LinkList":29,"../Map/Map":30}],28:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Set/Set"),re=r("../LinkList/LinkList");Ce.initSize=16,Ce.maxSize=1<<30,Ce.sigma=.75,Ce.treeifyThreshold=8,Ce.untreeifyThreshold=6,Ce.minTreeifySize=64;function Ce(ie,ae,le){var Ie=this;if(ie===void 0&&(ie=[]),ae===void 0&&(ae=Ce.initSize),le=le||function(pe){var ze=0,Fe="";if(typeof pe=="number")ze=Math.floor(pe),ze=(ze<<5)-ze,ze=ze&ze;else{typeof pe!="string"?Fe=JSON.stringify(pe):Fe=pe;for(var xe=0;xe<Fe.length;xe++){var _e=Fe.charCodeAt(xe);ze=(ze<<5)-ze+_e,ze=ze&ze}}return ze^=ze>>>16,ze},ae&ae-1)throw new Error("initBucketNum must be 2 to the power of n");var ue=0,de=[],Ne=Math.max(Ce.initSize,Math.min(Ce.maxSize,ae));this.size=function(){return ue},this.empty=function(){return ue===0},this.clear=function(){ue=0,Ne=ae,de=[]},this.forEach=function(pe){var ze=0;de.forEach(function(Fe){Fe.forEach(function(xe){pe(xe,ze++)})})};var he=function(pe){if(!(pe>=Ce.maxSize)){Ne=pe*2;var ze=[];de.forEach(function(Fe,xe){if(!Fe.empty()){if(Fe instanceof re.default&&Fe.size()===1){var _e=Fe.front();if(_e===void 0)throw new Error("unknown error");ze[le(_e)&Ne-1]=new re.default([_e])}else if(Fe instanceof oe.default){var Dt=new re.default,$e=new re.default;Fe.forEach(function(Oe){var At=le(Oe);At&pe?$e.pushBack(Oe):Dt.pushBack(Oe)}),Dt.size()>Ce.untreeifyThreshold?ze[xe]=new oe.default(Dt):Dt.size()&&(ze[xe]=Dt),$e.size()>Ce.untreeifyThreshold?ze[xe+pe]=new oe.default($e):$e.size()&&(ze[xe+pe]=$e)}else{var Ue=new re.default,Ve=new re.default;Fe.forEach(function(Oe){var At=le(Oe);At&pe?Ve.pushBack(Oe):Ue.pushBack(Oe)}),Ue.size()&&(ze[xe]=Ue),Ve.size()&&(ze[xe+pe]=Ve)}de[xe].clear()}}),de=ze}};this.insert=function(pe){if(pe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");var ze=le(pe)&Ne-1;if(!de[ze])de[ze]=new re.default([pe]),++ue;else{var Fe=de[ze].size();if(de[ze]instanceof re.default){if(de[ze].find(pe))return;de[ze].pushBack(pe),de[ze].size()>=Ce.treeifyThreshold&&(de[ze]=new oe.default(de[ze]))}else de[ze].insert(pe);var xe=de[ze].size();ue+=xe-Fe}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.eraseElementByValue=function(pe){var ze=le(pe)&Ne-1;if(de[ze]){var Fe=de[ze].size();de[ze].eraseElementByValue(pe),de[ze]instanceof oe.default&&de[ze].size()<=Ce.untreeifyThreshold&&(de[ze]=new re.default(de[ze]));var xe=de[ze].size();ue+=xe-Fe}},this.find=function(pe){var ze=le(pe)&Ne-1;return de[ze]?de[ze].find(pe):!1},this[Symbol.iterator]=function(){return function(){var pe,ze,Fe,xe,_e,Dt,$e;return V(this,function(Ue){switch(Ue.label){case 0:pe=0,Ue.label=1;case 1:if(!(pe<Ne))return[3,10];for(;pe<Ne&&!de[pe];)++pe;if(pe>=Ne)return[3,10];Ue.label=2;case 2:Ue.trys.push([2,7,8,9]),ze=(Dt=void 0,$(de[pe])),Fe=ze.next(),Ue.label=3;case 3:return Fe.done?[3,6]:(xe=Fe.value,[4,xe]);case 4:Ue.sent(),Ue.label=5;case 5:return Fe=ze.next(),[3,3];case 6:return[3,9];case 7:return _e=Ue.sent(),Dt={error:_e},[3,9];case 8:try{Fe&&!Fe.done&&($e=ze.return)&&$e.call(ze)}finally{if(Dt)throw Dt.error}return[7];case 9:return++pe,[3,1];case 10:return[2]}})}()},ie.forEach(function(pe){return Ie.insert(pe)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{"../LinkList/LinkList":29,"../Set/Set":33}],29:[function(r,g,k){var V=this&&this.__generator||function(re,Ce){var ie={label:0,sent:function(){if(Ie[0]&1)throw Ie[1];return Ie[1]},trys:[],ops:[]},ae,le,Ie,ue;return ue={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ue[Symbol.iterator]=function(){return this}),ue;function de(he){return function(pe){return Ne([he,pe])}}function Ne(he){if(ae)throw new TypeError("Generator is already executing.");for(;ie;)try{if(ae=1,le&&(Ie=he[0]&2?le.return:he[0]?le.throw||((Ie=le.return)&&Ie.call(le),0):le.next)&&!(Ie=Ie.call(le,he[1])).done)return Ie;switch(le=0,Ie&&(he=[he[0]&2,Ie.value]),he[0]){case 0:case 1:Ie=he;break;case 4:return ie.label++,{value:he[1],done:!1};case 5:ie.label++,le=he[1],he=[0];continue;case 7:he=ie.ops.pop(),ie.trys.pop();continue;default:if(Ie=ie.trys,!(Ie=Ie.length>0&&Ie[Ie.length-1])&&(he[0]===6||he[0]===2)){ie=0;continue}if(he[0]===3&&(!Ie||he[1]>Ie[0]&&he[1]<Ie[3])){ie.label=he[1];break}if(he[0]===6&&ie.label<Ie[1]){ie.label=Ie[1],Ie=he;break}if(Ie&&ie.label<Ie[2]){ie.label=Ie[2],ie.ops.push(he);break}Ie[2]&&ie.ops.pop(),ie.trys.pop();continue}he=Ce.call(re,ie)}catch(pe){he=[6,pe],le=0}finally{ae=Ie=0}if(he[0]&5)throw he[1];return{value:he[0]?he[1]:void 0,done:!0}}};Object.defineProperty(k,"__esModule",{value:!0});var $=function(){function re(Ce){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=Ce}return re}();function oe(re){var Ce=this;re===void 0&&(re=[]);var ie=0,ae=void 0,le=void 0;this.size=function(){return ie},this.empty=function(){return ie===0},this.clear=function(){ae=le=void 0,ie=0},this.front=function(){return ae==null?void 0:ae.value},this.back=function(){return le==null?void 0:le.value},this.forEach=function(Ie){for(var ue=ae,de=0;ue;){if(ue.value===void 0)throw new Error("unknown error");Ie(ue.value,de++),ue=ue.next}},this.getElementByPos=function(Ie){if(Ie<0||Ie>=ie)throw new Error("pos must more then 0 and less then the list length");for(var ue=ae;Ie--&&ue;)ue=ue.next;if(!ue||ue.value===void 0)throw new Error("unknown error");return ue.value},this.eraseElementByPos=function(Ie){if(Ie<0||Ie>=ie)throw new Error("erase pos must more then 0 and less then the list length");if(Ie===0)this.popFront();else if(Ie===ie-1)this.popBack();else{for(var ue=ae;Ie--;){if(!(ue!=null&&ue.next))throw new Error("unknown error");ue=ue.next}if(!ue||!ue.pre||!ue.next)throw new Error("unknown error");var de=ue.pre,Ne=ue.next;Ne.pre=de,de.next=Ne,ie>0&&--ie}},this.eraseElementByValue=function(Ie){for(;ae&&ae.value===Ie;)this.popFront();for(;le&&le.value===Ie;)this.popBack();if(ae)for(var ue=ae;ue;){if(ue.value===Ie){var de=ue.pre,Ne=ue.next;Ne&&(Ne.pre=de),de&&(de.next=Ne),ie>0&&--ie}ue=ue.next}},this.pushBack=function(Ie){if(Ie==null)throw new Error("you can't push null or undefined here");++ie;var ue=new $(Ie);le?(le.next=ue,ue.pre=le,le=ue):ae=le=ue},this.popBack=function(){le&&(ie>0&&--ie,le&&(ae===le?ae=le=void 0:(le=le.pre,le&&(le.next=void 0))))},this.setElementByPos=function(Ie,ue){if(ue==null)throw new Error("you can't set null or undefined here");if(Ie<0||Ie>=ie)throw new Error("pos must more then 0 and less then the list length");for(var de=ae;Ie--;){if(!de)throw new Error("unknown error");de=de.next}de&&(de.value=ue)},this.insert=function(Ie,ue,de){if(de===void 0&&(de=1),ue==null)throw new Error("you can't insert null or undefined here");if(Ie<0||Ie>ie)throw new Error("insert pos must more then 0 and less then or equal to the list length");if(de<0)throw new Error("insert size must more than 0");if(Ie===0)for(;de--;)this.pushFront(ue);else if(Ie===ie)for(;de--;)this.pushBack(ue);else{for(var Ne=ae,he=1;he<Ie;++he){if(!(Ne!=null&&Ne.next))throw new Error("unknown error");Ne=Ne==null?void 0:Ne.next}if(!Ne)throw new Error("unknown error");var pe=Ne.next;for(ie+=de;de--;)Ne.next=new $(ue),Ne.next.pre=Ne,Ne=Ne.next;Ne.next=pe,pe&&(pe.pre=Ne)}},this.find=function(Ie){for(var ue=ae;ue;){if(ue.value===Ie)return!0;ue=ue.next}return!1},this.reverse=function(){for(var Ie=ae,ue=le,de=0;Ie&&ue&&de*2<ie;){var Ne=Ie.value;Ie.value=ue.value,ue.value=Ne,Ie=Ie.next,ue=ue.pre,++de}},this.unique=function(){for(var Ie=ae;Ie;){for(var ue=Ie;ue&&ue.next&&ue.value===ue.next.value;)ue=ue.next,ie>0&&--ie;Ie.next=ue.next,Ie.next&&(Ie.next.pre=Ie),Ie=Ie.next}},this.sort=function(Ie){var ue=[];this.forEach(function(Ne){ue.push(Ne)}),ue.sort(Ie);var de=ae;ue.forEach(function(Ne){de&&(de.value=Ne,de=de.next)})},this.pushFront=function(Ie){if(Ie==null)throw new Error("you can't push null or undefined here");++ie;var ue=new $(Ie);ae?(ue.next=ae,ae.pre=ue,ae=ue):ae=le=ue},this.popFront=function(){ae&&(ie>0&&--ie,ae&&(ae===le?ae=le=void 0:(ae=ae.next,ae&&(ae.pre=void 0))))},this.merge=function(Ie){var ue=this,de=ae;Ie.forEach(function(Ne){for(;de&&de.value!==void 0&&de.value<=Ne;)de=de.next;if(de===void 0)ue.pushBack(Ne),de=le;else if(de===ae)ue.pushFront(Ne),de=ae;else{++ie;var he=de.pre;he&&(he.next=new $(Ne),he.next.pre=he,he.next.next=de,de&&(de.pre=he.next))}})},this[Symbol.iterator]=function(){return function(){var Ie;return V(this,function(ue){switch(ue.label){case 0:Ie=ae,ue.label=1;case 1:if(Ie===void 0)return[3,3];if(!Ie.value)throw new Error("unknown error");return[4,Ie.value];case 2:return ue.sent(),Ie=Ie.next,[3,1];case 3:return[2]}})}()},re.forEach(function(Ie){return Ce.pushBack(Ie)}),Object.freeze(this)}Object.freeze(oe),k.default=oe},{}],30:[function(r,g,k){var V=this&&this.__generator||function(Ce,ie){var ae={label:0,sent:function(){if(ue[0]&1)throw ue[1];return ue[1]},trys:[],ops:[]},le,Ie,ue,de;return de={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function Ne(pe){return function(ze){return he([pe,ze])}}function he(pe){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=pe[0]&2?Ie.return:pe[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,pe[1])).done)return ue;switch(Ie=0,ue&&(pe=[pe[0]&2,ue.value]),pe[0]){case 0:case 1:ue=pe;break;case 4:return ae.label++,{value:pe[1],done:!1};case 5:ae.label++,Ie=pe[1],pe=[0];continue;case 7:pe=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(pe[0]===6||pe[0]===2)){ae=0;continue}if(pe[0]===3&&(!ue||pe[1]>ue[0]&&pe[1]<ue[3])){ae.label=pe[1];break}if(pe[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=pe;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(pe);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}pe=ie.call(Ce,ae)}catch(ze){pe=[6,ze],Ie=0}finally{le=ue=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},$=this&&this.__values||function(Ce){var ie=typeof Symbol=="function"&&Symbol.iterator,ae=ie&&Ce[ie],le=0;if(ae)return ae.call(Ce);if(Ce&&typeof Ce.length=="number")return{next:function(){return Ce&&le>=Ce.length&&(Ce=void 0),{value:Ce&&Ce[le++],done:!Ce}}};throw new TypeError(ie?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Base/TreeNode");function re(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(Oe,At){return Oe<At?-1:Oe>At?1:0};var le=0,Ie=new oe.default;Ie.color=oe.default.TreeNodeColorType.black,this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.key=Ie.value=void 0,Ie.leftChild=Ie.rightChild=Ie.brother=void 0};var ue=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.leftChild?ue(Oe.leftChild):Oe},de=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.rightChild?de(Oe.rightChild):Oe};this.front=function(){if(!this.empty()){var Oe=ue(Ie);if(Oe.key===void 0||Oe.value===void 0)throw new Error("unknown error");return{key:Oe.key,value:Oe.value}}},this.back=function(){if(!this.empty()){var Oe=de(Ie);if(Oe.key===void 0||Oe.value===void 0)throw new Error("unknown error");return{key:Oe.key,value:Oe.value}}},this.forEach=function(Oe){var At,qe,Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;Oe(ti,Lt++)}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}},this.getElementByPos=function(Oe){var At,qe;if(Oe<0||Oe>=this.size())throw new Error("pos must more than 0 and less than set's size");var Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;if(Lt===Oe)return ti;++Lt}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}throw new Error("unknown Error")};var Ne=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe===0?{key:Oe.key,value:Oe.value}:qe<0?Ne(Oe.rightChild,At):Ne(Oe.leftChild,At)||{key:Oe.key,value:Oe.value}}};this.lowerBound=function(Oe){return Ne(Ie,Oe)};var he=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe<=0?he(Oe.rightChild,At):he(Oe.leftChild,At)||{key:Oe.key,value:Oe.value}}};this.upperBound=function(Oe){return he(Ie,Oe)};var pe=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe===0?{key:Oe.key,value:Oe.value}:qe>0?pe(Oe.leftChild,At):pe(Oe.rightChild,At)||{key:Oe.key,value:Oe.value}}};this.reverseLowerBound=function(Oe){return pe(Ie,Oe)};var ze=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe>=0?ze(Oe.leftChild,At):ze(Oe.rightChild,At)||{key:Oe.key,value:Oe.value}}};this.reverseUpperBound=function(Oe){return ze(Ie,Oe)};var Fe=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(Oe.color===oe.default.TreeNodeColorType.red){Oe.color=oe.default.TreeNodeColorType.black;return}var qe=Oe.brother;if(!qe)throw new Error("unknown error");if(Oe===At.leftChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Fe(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateRight();Ie===qe&&(Ie=Lt),Fe(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Fe(At))}else if(Oe===At.rightChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Fe(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateLeft();Ie===qe&&(Ie=Lt),Fe(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Fe(At))}},xe=function(Oe){for(var At=Oe;At.leftChild||At.rightChild;){if(At.rightChild){At=ue(At.rightChild);var qe=Oe.key;Oe.key=At.key,At.key=qe;var Lt=Oe.value;Oe.value=At.value,At.value=Lt,Oe=At}if(At.leftChild){At=de(At.leftChild);var qe=Oe.key;Oe.key=At.key,At.key=qe;var Lt=Oe.value;Oe.value=At.value,At.value=Lt,Oe=At}}Fe(At),At&&At.remove(),--le,Ie.color=oe.default.TreeNodeColorType.black},_e=function(Oe,At){if(!Oe||Oe.key===void 0)return!1;var qe=_e(Oe.leftChild,At);return qe||At(Oe)?!0:_e(Oe.rightChild,At)};this.eraseElementByPos=function(Oe){if(Oe<0||Oe>=le)throw new Error("pos must more than 0 and less than set's size");var At=0;_e(Ie,function(qe){return Oe===At?(xe(qe),!0):(++At,!1)})},this.eraseElementByKey=function(Oe){if(!this.empty()){var At=Ue(Ie,Oe);At===void 0||At.key===void 0||ie(At.key,Oe)!==0||xe(At)}};var Dt=function(Oe,At){if(!Oe||Oe.key===void 0)throw new Error("unknown error");var qe=ie(At,Oe.key);return qe<0?Oe.leftChild?Dt(Oe.leftChild,At):(Oe.leftChild=new oe.default,Oe.leftChild.parent=Oe,Oe.leftChild.brother=Oe.rightChild,Oe.rightChild&&(Oe.rightChild.brother=Oe.leftChild),Oe.leftChild):qe>0?Oe.rightChild?Dt(Oe.rightChild,At):(Oe.rightChild=new oe.default,Oe.rightChild.parent=Oe,Oe.rightChild.brother=Oe.leftChild,Oe.leftChild&&(Oe.leftChild.brother=Oe.rightChild),Oe.rightChild):Oe},$e=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(At.color!==oe.default.TreeNodeColorType.black&&At.color===oe.default.TreeNodeColorType.red){var qe=At.brother,Lt=At.parent;if(!Lt)throw new Error("unknown error");if(qe&&qe.color===oe.default.TreeNodeColorType.red)qe.color=At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red,$e(Lt);else if(!qe||qe.color===oe.default.TreeNodeColorType.black){if(At===Lt.leftChild){if(Oe===At.leftChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateRight();Lt===Ie&&(Ie=kt)}else if(Oe===At.rightChild){var kt=At.rotateLeft();Lt===Ie&&(Ie=kt),$e(At)}}else if(At===Lt.rightChild){if(Oe===At.leftChild){var kt=At.rotateRight();Lt===Ie&&(Ie=kt),$e(At)}else if(Oe===At.rightChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateLeft();Lt===Ie&&(Ie=kt)}}}}};this.setElement=function(Oe,At){if(Oe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(At==null){this.eraseElementByKey(Oe);return}if(this.empty()){++le,Ie.key=Oe,Ie.value=At,Ie.color=oe.default.TreeNodeColorType.black;return}var qe=Dt(Ie,Oe);if(qe.key!==void 0&&ie(qe.key,Oe)===0){qe.value=At;return}++le,qe.key=Oe,qe.value=At,$e(qe),Ie.color=oe.default.TreeNodeColorType.black};var Ue=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(At,Oe.key);return qe<0?Ue(Oe.leftChild,At):qe>0?Ue(Oe.rightChild,At):Oe}};this.find=function(Oe){return!!Ue(Ie,Oe)},this.getElementByKey=function(Oe){var At=Ue(Ie,Oe);if((At==null?void 0:At.key)===void 0||(At==null?void 0:At.value)===void 0)throw new Error("unknown error");return At.value},this.union=function(Oe){var At=this;Oe.forEach(function(qe){var Lt=qe.key,kt=qe.value;return At.setElement(Lt,kt)})},this.getHeight=function(){if(this.empty())return 0;var Oe=function(At){return At?Math.max(Oe(At.leftChild),Oe(At.rightChild))+1:1};return Oe(Ie)};var Ve=function(Oe){return V(this,function(At){switch(At.label){case 0:return!Oe||Oe.key===void 0||Oe.value===void 0?[2]:[5,$(Ve(Oe.leftChild))];case 1:return At.sent(),[4,{key:Oe.key,value:Oe.value}];case 2:return At.sent(),[5,$(Ve(Oe.rightChild))];case 3:return At.sent(),[2]}})};this[Symbol.iterator]=function(){return Ve(Ie)},Ce.forEach(function(Oe){var At=Oe.key,qe=Oe.value;return ae.setElement(At,qe)}),Object.freeze(this)}Object.freeze(re),k.default=re},{"../Base/TreeNode":25}],31:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});function V($,oe){$===void 0&&($=[]),oe=oe||function(le,Ie){return le>Ie?-1:le<Ie?1:0};var re=[];$.forEach(function(le){return re.push(le)});var Ce=re.length,ie=function(le,Ie){if(le<0||le>=Ce)throw new Error("unknown error");if(Ie<0||Ie>=Ce)throw new Error("unknown error");var ue=re[le];re[le]=re[Ie],re[Ie]=ue},ae=function(le){if(le<0||le>=Ce)throw new Error("unknown error");var Ie=le*2+1,ue=le*2+2;Ie<Ce&&oe(re[le],re[Ie])>0&&ie(le,Ie),ue<Ce&&oe(re[le],re[ue])>0&&ie(le,ue)};(function(){for(var le=Math.floor((Ce-1)/2);le>=0;--le)for(var Ie=le,ue=Ie*2+1;ue<Ce;){var de=ue,Ne=de+1,he=de;if(Ne<Ce&&oe(re[de],re[Ne])>0&&(he=Ne),oe(re[Ie],re[he])<=0)break;ie(Ie,he),Ie=he,ue=Ie*2+1}})(),this.size=function(){return Ce},this.empty=function(){return Ce===0},this.clear=function(){Ce=0,re.length=0},this.push=function(le){if(re.push(le),++Ce,Ce!==1)for(var Ie=Ce-1;Ie>0;){var ue=Math.floor((Ie-1)/2);if(oe(re[ue],le)<=0)break;ae(ue),Ie=ue}},this.pop=function(){if(!this.empty()){if(this.size()===1){--Ce;return}var le=re[Ce-1];--Ce;for(var Ie=0;Ie<this.size();){var ue=Ie*2+1,de=Ie*2+2;if(ue>=this.size())break;var Ne=ue;if(de<this.size()&&oe(re[ue],re[de])>0&&(Ne=de),oe(re[Ne],le)>=0)break;re[Ie]=re[Ne],Ie=Ne}re[Ie]=le}},this.top=function(){return re[0]},Object.freeze(this)}Object.freeze(V),k.default=V},{}],32:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});var V=r("../LinkList/LinkList");function $(oe){oe===void 0&&(oe=[]);var re=new V.default(oe);this.size=function(){return re.size()},this.empty=function(){return re.empty()},this.clear=function(){re.clear()},this.push=function(Ce){re.pushBack(Ce)},this.pop=function(){re.popFront()},this.front=function(){return re.front()},Object.freeze(this)}Object.freeze($),k.default=$},{"../LinkList/LinkList":29}],33:[function(r,g,k){var V=this&&this.__generator||function(Ce,ie){var ae={label:0,sent:function(){if(ue[0]&1)throw ue[1];return ue[1]},trys:[],ops:[]},le,Ie,ue,de;return de={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function Ne(pe){return function(ze){return he([pe,ze])}}function he(pe){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=pe[0]&2?Ie.return:pe[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,pe[1])).done)return ue;switch(Ie=0,ue&&(pe=[pe[0]&2,ue.value]),pe[0]){case 0:case 1:ue=pe;break;case 4:return ae.label++,{value:pe[1],done:!1};case 5:ae.label++,Ie=pe[1],pe=[0];continue;case 7:pe=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(pe[0]===6||pe[0]===2)){ae=0;continue}if(pe[0]===3&&(!ue||pe[1]>ue[0]&&pe[1]<ue[3])){ae.label=pe[1];break}if(pe[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=pe;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(pe);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}pe=ie.call(Ce,ae)}catch(ze){pe=[6,ze],Ie=0}finally{le=ue=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},$=this&&this.__values||function(Ce){var ie=typeof Symbol=="function"&&Symbol.iterator,ae=ie&&Ce[ie],le=0;if(ae)return ae.call(Ce);if(Ce&&typeof Ce.length=="number")return{next:function(){return Ce&&le>=Ce.length&&(Ce=void 0),{value:Ce&&Ce[le++],done:!Ce}}};throw new TypeError(ie?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Base/TreeNode");function re(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(Oe,At){return Oe<At?-1:Oe>At?1:0};var le=0,Ie=new oe.default;Ie.color=oe.default.TreeNodeColorType.black,this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.key=void 0,Ie.leftChild=Ie.rightChild=Ie.brother=Ie.parent=void 0,Ie.color=oe.default.TreeNodeColorType.black};var ue=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.leftChild?ue(Oe.leftChild):Oe},de=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.rightChild?de(Oe.rightChild):Oe};this.front=function(){if(!this.empty()){var Oe=ue(Ie);return Oe.key}},this.back=function(){if(!this.empty()){var Oe=de(Ie);return Oe.key}},this.forEach=function(Oe){var At,qe,Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;Oe(ti,Lt++)}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}},this.getElementByPos=function(Oe){var At,qe;if(Oe<0||Oe>=this.size())throw new Error("pos must more than 0 and less than set's size");var Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;if(Lt===Oe)return ti;++Lt}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}throw new Error("unknown error")};var Ne=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(Oe.color===oe.default.TreeNodeColorType.red){Oe.color=oe.default.TreeNodeColorType.black;return}var qe=Oe.brother;if(!qe)throw new Error("unknown error");if(Oe===At.leftChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Ne(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateRight();Ie===qe&&(Ie=Lt),Ne(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Ne(At))}else if(Oe===At.rightChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Ne(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateLeft();Ie===qe&&(Ie=Lt),Ne(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Ne(At))}},he=function(Oe){for(var At=Oe;At.leftChild||At.rightChild;){if(At.rightChild){At=ue(At.rightChild);var qe=Oe.key;Oe.key=At.key,At.key=qe,Oe=At}if(At.leftChild){At=de(At.leftChild);var qe=Oe.key;Oe.key=At.key,At.key=qe,Oe=At}}Ne(At),At&&At.remove(),--le,Ie.color=oe.default.TreeNodeColorType.black},pe=function(Oe,At){if(!Oe||Oe.key===void 0)return!1;var qe=pe(Oe.leftChild,At);return qe||At(Oe)?!0:pe(Oe.rightChild,At)};this.eraseElementByPos=function(Oe){if(Oe<0||Oe>=le)throw new Error("pos must more than 0 and less than set's size");var At=0;pe(Ie,function(qe){return Oe===At?(he(qe),!0):(++At,!1)})},this.eraseElementByValue=function(Oe){if(!this.empty()){var At=xe(Ie,Oe);At===void 0||At.key===void 0||ie(At.key,Oe)!==0||he(At)}};var ze=function(Oe,At){if(!Oe||Oe.key===void 0)throw new Error("unknown error");var qe=ie(At,Oe.key);return qe<0?Oe.leftChild?ze(Oe.leftChild,At):(Oe.leftChild=new oe.default,Oe.leftChild.parent=Oe,Oe.leftChild.brother=Oe.rightChild,Oe.rightChild&&(Oe.rightChild.brother=Oe.leftChild),Oe.leftChild):qe>0?Oe.rightChild?ze(Oe.rightChild,At):(Oe.rightChild=new oe.default,Oe.rightChild.parent=Oe,Oe.rightChild.brother=Oe.leftChild,Oe.leftChild&&(Oe.leftChild.brother=Oe.rightChild),Oe.rightChild):Oe},Fe=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(At.color!==oe.default.TreeNodeColorType.black&&At.color===oe.default.TreeNodeColorType.red){var qe=At.brother,Lt=At.parent;if(!Lt)throw new Error("unknown error");if(qe&&qe.color===oe.default.TreeNodeColorType.red)qe.color=At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red,Fe(Lt);else if(!qe||qe.color===oe.default.TreeNodeColorType.black){if(At===Lt.leftChild){if(Oe===At.leftChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateRight();Lt===Ie&&(Ie=kt)}else if(Oe===At.rightChild){var kt=At.rotateLeft();Lt===Ie&&(Ie=kt),Fe(At)}}else if(At===Lt.rightChild){if(Oe===At.leftChild){var kt=At.rotateRight();Lt===Ie&&(Ie=kt),Fe(At)}else if(Oe===At.rightChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateLeft();Lt===Ie&&(Ie=kt)}}}}};this.insert=function(Oe){if(Oe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(this.empty()){++le,Ie.key=Oe,Ie.color=oe.default.TreeNodeColorType.black;return}var At=ze(Ie,Oe);At.key!==void 0&&ie(At.key,Oe)===0||(++le,At.key=Oe,Fe(At),Ie.color=oe.default.TreeNodeColorType.black)};var xe=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(At,Oe.key);return qe<0?xe(Oe.leftChild,At):qe>0?xe(Oe.rightChild,At):Oe}};this.find=function(Oe){var At=xe(Ie,Oe);return At!==void 0&&At.key!==void 0&&ie(At.key,Oe)===0};var _e=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe===0)return Oe.key;if(qe<0)return _e(Oe.rightChild,At);var Lt=_e(Oe.leftChild,At);return Lt!==void 0?Lt:Oe.key}};this.lowerBound=function(Oe){return _e(Ie,Oe)};var Dt=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe<=0)return Dt(Oe.rightChild,At);var Lt=Dt(Oe.leftChild,At);return Lt!==void 0?Lt:Oe.key}};this.upperBound=function(Oe){return Dt(Ie,Oe)};var $e=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe===0)return Oe.key;if(qe>0)return $e(Oe.leftChild,At);var Lt=$e(Oe.rightChild,At);return Lt!==void 0?Lt:Oe.key}};this.reverseLowerBound=function(Oe){return $e(Ie,Oe)};var Ue=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe>=0)return Ue(Oe.leftChild,At);var Lt=Ue(Oe.rightChild,At);return Lt!==void 0?Lt:Oe.key}};this.reverseUpperBound=function(Oe){return Ue(Ie,Oe)},this.union=function(Oe){var At=this;Oe.forEach(function(qe){return At.insert(qe)})},this.getHeight=function(){if(this.empty())return 0;var Oe=function(At){return At?Math.max(Oe(At.leftChild),Oe(At.rightChild))+1:1};return Oe(Ie)};var Ve=function(Oe){return V(this,function(At){switch(At.label){case 0:return!Oe||Oe.key===void 0?[2]:[5,$(Ve(Oe.leftChild))];case 1:return At.sent(),[4,Oe.key];case 2:return At.sent(),[5,$(Ve(Oe.rightChild))];case 3:return At.sent(),[2]}})};this[Symbol.iterator]=function(){return Ve(Ie)},Ce.forEach(function(Oe){return ae.insert(Oe)}),Object.freeze(this)}Object.freeze(re),k.default=re},{"../Base/TreeNode":25}],34:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});function V($){var oe=this;$===void 0&&($=[]);var re=0,Ce=[];this.size=function(){return re},this.empty=function(){return re===0},this.clear=function(){re=0,Ce.length=0},this.push=function(ie){Ce.push(ie),++re},this.pop=function(){Ce.pop(),re>0&&--re},this.top=function(){return Ce[re-1]},$.forEach(function(ie){return oe.push(ie)}),Object.freeze(this)}Object.freeze(V),k.default=V},{}],35:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__read||function(ie,ae){var le=typeof Symbol=="function"&&ie[Symbol.iterator];if(!le)return ie;var Ie=le.call(ie),ue,de=[],Ne;try{for(;(ae===void 0||ae-- >0)&&!(ue=Ie.next()).done;)de.push(ue.value)}catch(he){Ne={error:he}}finally{try{ue&&!ue.done&&(le=Ie.return)&&le.call(Ie)}finally{if(Ne)throw Ne.error}}return de},oe=this&&this.__spreadArray||function(ie,ae,le){if(le||arguments.length===2)for(var Ie=0,ue=ae.length,de;Ie<ue;Ie++)(de||!(Ie in ae))&&(de||(de=Array.prototype.slice.call(ae,0,Ie)),de[Ie]=ae[Ie]);return ie.concat(de||Array.prototype.slice.call(ae))},re=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});function Ce(ie){var ae=this;ie===void 0&&(ie=[]);var le=0,Ie=[];this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.length=0},this.front=function(){if(!this.empty())return Ie[0]},this.back=function(){if(!this.empty())return Ie[le-1]},this.forEach=function(ue){Ie.forEach(ue)},this.getElementByPos=function(ue){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");return Ie[ue]},this.eraseElementByPos=function(ue){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");for(var de=ue;de<le-1;++de)Ie[de]=Ie[de+1];this.popBack()},this.eraseElementByValue=function(ue){var de=[];this.forEach(function(he){he!==ue&&de.push(he)}),de.forEach(function(he,pe){Ie[pe]=he});for(var Ne=de.length;le>Ne;)this.popBack()},this.pushBack=function(ue){Ie.push(ue),++le},this.popBack=function(){Ie.pop(),le>0&&--le},this.setElementByPos=function(ue,de){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");Ie[ue]=de},this.insert=function(ue,de,Ne){if(Ne===void 0&&(Ne=1),ue<0||ue>le)throw new Error("pos must more than 0 and less than or equal to vector's size");Ie.splice.apply(Ie,oe([ue,0],$(new Array(Ne).fill(de)),!1)),le+=Ne},this.find=function(ue){return Ie.includes(ue)},this.reverse=function(){Ie.reverse()},this.unique=function(){var ue,de=[];this.forEach(function(he,pe){(pe===0||he!==ue)&&(de.push(he),ue=he)}),de.forEach(function(he,pe){Ie[pe]=he});for(var Ne=de.length;le>Ne;)this.popBack()},this.sort=function(ue){Ie.sort(ue)},this[Symbol.iterator]=function(){return function(){return V(this,function(ue){switch(ue.label){case 0:return[5,re(Ie)];case 1:return[2,ue.sent()]}})}()},ie.forEach(function(ue){return ae.pushBack(ue)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{}],36:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0}),k.HashMap=k.HashSet=k.Map=k.Set=k.PriorityQueue=k.Deque=k.LinkList=k.Queue=k.Stack=k.Vector=void 0;var V=r("./Vector/Vector");k.Vector=V.default;var $=r("./Stack/Stack");k.Stack=$.default;var oe=r("./Queue/Queue");k.Queue=oe.default;var re=r("./LinkList/LinkList");k.LinkList=re.default;var Ce=r("./Deque/Deque");k.Deque=Ce.default;var ie=r("./PriorityQueue/PriorityQueue");k.PriorityQueue=ie.default;var ae=r("./Set/Set");k.Set=ae.default;var le=r("./Map/Map");k.Map=le.default;var Ie=r("./HashSet/HashSet");k.HashSet=Ie.default;var ue=r("./HashMap/HashMap");k.HashMap=ue.default},{"./Deque/Deque":26,"./HashMap/HashMap":27,"./HashSet/HashSet":28,"./LinkList/LinkList":29,"./Map/Map":30,"./PriorityQueue/PriorityQueue":31,"./Queue/Queue":32,"./Set/Set":33,"./Stack/Stack":34,"./Vector/Vector":35}],37:[function(r,g,k){const V=r("yallist"),$=Symbol("max"),oe=Symbol("length"),re=Symbol("lengthCalculator"),Ce=Symbol("allowStale"),ie=Symbol("maxAge"),ae=Symbol("dispose"),le=Symbol("noDisposeOnSet"),Ie=Symbol("lruList"),ue=Symbol("cache"),de=Symbol("updateAgeOnGet"),Ne=()=>1;class he{constructor(Ue){if(typeof Ue=="number"&&(Ue={max:Ue}),Ue||(Ue={}),Ue.max&&(typeof Ue.max!="number"||Ue.max<0))throw new TypeError("max must be a non-negative number");this[$]=Ue.max||1/0;const Ve=Ue.length||Ne;if(this[re]=typeof Ve!="function"?Ne:Ve,this[Ce]=Ue.stale||!1,Ue.maxAge&&typeof Ue.maxAge!="number")throw new TypeError("maxAge must be a number");this[ie]=Ue.maxAge||0,this[ae]=Ue.dispose,this[le]=Ue.noDisposeOnSet||!1,this[de]=Ue.updateAgeOnGet||!1,this.reset()}set max(Ue){if(typeof Ue!="number"||Ue<0)throw new TypeError("max must be a non-negative number");this[$]=Ue||1/0,Fe(this)}get max(){return this[$]}set allowStale(Ue){this[Ce]=!!Ue}get allowStale(){return this[Ce]}set maxAge(Ue){if(typeof Ue!="number")throw new TypeError("maxAge must be a non-negative number");this[ie]=Ue,Fe(this)}get maxAge(){return this[ie]}set lengthCalculator(Ue){typeof Ue!="function"&&(Ue=Ne),Ue!==this[re]&&(this[re]=Ue,this[oe]=0,this[Ie].forEach(Ve=>{Ve.length=this[re](Ve.value,Ve.key),this[oe]+=Ve.length})),Fe(this)}get lengthCalculator(){return this[re]}get length(){return this[oe]}get itemCount(){return this[Ie].length}rforEach(Ue,Ve){Ve=Ve||this;for(let Oe=this[Ie].tail;Oe!==null;){const At=Oe.prev;Dt(this,Ue,Oe,Ve),Oe=At}}forEach(Ue,Ve){Ve=Ve||this;for(let Oe=this[Ie].head;Oe!==null;){const At=Oe.next;Dt(this,Ue,Oe,Ve),Oe=At}}keys(){return this[Ie].toArray().map(Ue=>Ue.key)}values(){return this[Ie].toArray().map(Ue=>Ue.value)}reset(){this[ae]&&this[Ie]&&this[Ie].length&&this[Ie].forEach(Ue=>this[ae](Ue.key,Ue.value)),this[ue]=new Map,this[Ie]=new V,this[oe]=0}dump(){return this[Ie].map(Ue=>ze(this,Ue)?!1:{k:Ue.key,v:Ue.value,e:Ue.now+(Ue.maxAge||0)}).toArray().filter(Ue=>Ue)}dumpLru(){return this[Ie]}set(Ue,Ve,Oe){if(Oe=Oe||this[ie],Oe&&typeof Oe!="number")throw new TypeError("maxAge must be a number");const At=Oe?Date.now():0,qe=this[re](Ve,Ue);if(this[ue].has(Ue)){if(qe>this[$])return xe(this,this[ue].get(Ue)),!1;const jt=this[ue].get(Ue).value;return this[ae]&&(this[le]||this[ae](Ue,jt.value)),jt.now=At,jt.maxAge=Oe,jt.value=Ve,this[oe]+=qe-jt.length,jt.length=qe,this.get(Ue),Fe(this),!0}const Lt=new _e(Ue,Ve,qe,At,Oe);return Lt.length>this[$]?(this[ae]&&this[ae](Ue,Ve),!1):(this[oe]+=Lt.length,this[Ie].unshift(Lt),this[ue].set(Ue,this[Ie].head),Fe(this),!0)}has(Ue){if(!this[ue].has(Ue))return!1;const Ve=this[ue].get(Ue).value;return!ze(this,Ve)}get(Ue){return pe(this,Ue,!0)}peek(Ue){return pe(this,Ue,!1)}pop(){const Ue=this[Ie].tail;return Ue?(xe(this,Ue),Ue.value):null}del(Ue){xe(this,this[ue].get(Ue))}load(Ue){this.reset();const Ve=Date.now();for(let Oe=Ue.length-1;Oe>=0;Oe--){const At=Ue[Oe],qe=At.e||0;if(qe===0)this.set(At.k,At.v);else{const Lt=qe-Ve;Lt>0&&this.set(At.k,At.v,Lt)}}}prune(){this[ue].forEach((Ue,Ve)=>pe(this,Ve,!1))}}const pe=($e,Ue,Ve)=>{const Oe=$e[ue].get(Ue);if(Oe){const At=Oe.value;if(ze($e,At)){if(xe($e,Oe),!$e[Ce])return}else Ve&&($e[de]&&(Oe.value.now=Date.now()),$e[Ie].unshiftNode(Oe));return At.value}},ze=($e,Ue)=>{if(!Ue||!Ue.maxAge&&!$e[ie])return!1;const Ve=Date.now()-Ue.now;return Ue.maxAge?Ve>Ue.maxAge:$e[ie]&&Ve>$e[ie]},Fe=$e=>{if($e[oe]>$e[$])for(let Ue=$e[Ie].tail;$e[oe]>$e[$]&&Ue!==null;){const Ve=Ue.prev;xe($e,Ue),Ue=Ve}},xe=($e,Ue)=>{if(Ue){const Ve=Ue.value;$e[ae]&&$e[ae](Ve.key,Ve.value),$e[oe]-=Ve.length,$e[ue].delete(Ve.key),$e[Ie].removeNode(Ue)}};class _e{constructor(Ue,Ve,Oe,At,qe){this.key=Ue,this.value=Ve,this.length=Oe,this.now=At,this.maxAge=qe||0}}const Dt=($e,Ue,Ve,Oe)=>{let At=Ve.value;ze($e,At)&&(xe($e,Ve),$e[Ce]||(At=void 0)),At&&Ue.call(Oe,At.value,At.key,$e)};g.exports=he},{yallist:83}],38:[function(r,g,k){(function(V){(function(){const $=g.exports;$.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},$.codes={};for(const re in $.types){const Ce=$.types[re];$.codes[Ce]=re}$.CMD_SHIFT=4,$.CMD_MASK=240,$.DUP_MASK=8,$.QOS_MASK=3,$.QOS_SHIFT=1,$.RETAIN_MASK=1,$.VARBYTEINT_MASK=127,$.VARBYTEINT_FIN_MASK=128,$.VARBYTEINT_MAX=268435455,$.SESSIONPRESENT_MASK=1,$.SESSIONPRESENT_HEADER=V.from([$.SESSIONPRESENT_MASK]),$.CONNACK_HEADER=V.from([$.codes.connack<<$.CMD_SHIFT]),$.USERNAME_MASK=128,$.PASSWORD_MASK=64,$.WILL_RETAIN_MASK=32,$.WILL_QOS_MASK=24,$.WILL_QOS_SHIFT=3,$.WILL_FLAG_MASK=4,$.CLEAN_SESSION_MASK=2,$.CONNECT_HEADER=V.from([$.codes.connect<<$.CMD_SHIFT]),$.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},$.propertiesCodes={};for(const re in $.properties){const Ce=$.properties[re];$.propertiesCodes[Ce]=re}$.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function oe(re){return[0,1,2].map(Ce=>[0,1].map(ie=>[0,1].map(ae=>{const le=V.alloc(1);return le.writeUInt8($.codes[re]<<$.CMD_SHIFT|(ie?$.DUP_MASK:0)|Ce<<$.QOS_SHIFT|ae,0,!0),le})))}$.PUBLISH_HEADER=oe("publish"),$.SUBSCRIBE_HEADER=oe("subscribe"),$.SUBSCRIBE_OPTIONS_QOS_MASK=3,$.SUBSCRIBE_OPTIONS_NL_MASK=1,$.SUBSCRIBE_OPTIONS_NL_SHIFT=2,$.SUBSCRIBE_OPTIONS_RAP_MASK=1,$.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,$.SUBSCRIBE_OPTIONS_RH_MASK=3,$.SUBSCRIBE_OPTIONS_RH_SHIFT=4,$.SUBSCRIBE_OPTIONS_RH=[0,16,32],$.SUBSCRIBE_OPTIONS_NL=4,$.SUBSCRIBE_OPTIONS_RAP=8,$.SUBSCRIBE_OPTIONS_QOS=[0,1,2],$.UNSUBSCRIBE_HEADER=oe("unsubscribe"),$.ACKS={unsuback:oe("unsuback"),puback:oe("puback"),pubcomp:oe("pubcomp"),pubrel:oe("pubrel"),pubrec:oe("pubrec")},$.SUBACK_HEADER=V.from([$.codes.suback<<$.CMD_SHIFT]),$.VERSION3=V.from([3]),$.VERSION4=V.from([4]),$.VERSION5=V.from([5]),$.VERSION131=V.from([131]),$.VERSION132=V.from([132]),$.QOS=[0,1,2].map(re=>V.from([re])),$.EMPTY={pingreq:V.from([$.codes.pingreq<<4,0]),pingresp:V.from([$.codes.pingresp<<4,0]),disconnect:V.from([$.codes.disconnect<<4,0])}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],39:[function(r,g,k){(function(V){(function(){const $=r("./writeToStream"),oe=r("events");function re(ie,ae){const le=new Ce;return $(ie,le,ae),le.concat()}class Ce extends oe{constructor(){super(),this._array=new Array(20),this._i=0}write(ae){return this._array[this._i++]=ae,!0}concat(){let ae=0;const le=new Array(this._array.length),Ie=this._array;let ue=0,de;for(de=0;de<Ie.length&&Ie[de]!==void 0;de++)typeof Ie[de]!="string"?le[de]=Ie[de].length:le[de]=V.byteLength(Ie[de]),ae+=le[de];const Ne=V.allocUnsafe(ae);for(de=0;de<Ie.length&&Ie[de]!==void 0;de++)typeof Ie[de]!="string"?(Ie[de].copy(Ne,ue),ue+=le[de]):(Ne.write(Ie[de],ue),ue+=le[de]);return Ne}}g.exports=re}).call(this)}).call(this,r("buffer").Buffer)},{"./writeToStream":44,buffer:17,events:22}],40:[function(r,g,k){k.parser=r("./parser").parser,k.generate=r("./generate"),k.writeToStream=r("./writeToStream")},{"./generate":39,"./parser":43,"./writeToStream":44}],41:[function(r,g,k){(function(V){(function(){const oe={},re=V.isBuffer(V.from([1,2]).subarray(0,1));function Ce(Ie){const ue=V.allocUnsafe(2);return ue.writeUInt8(Ie>>8,0),ue.writeUInt8(Ie&255,0+1),ue}function ie(){for(let Ie=0;Ie<65536;Ie++)oe[Ie]=Ce(Ie)}function ae(Ie){let de=0,Ne=0;const he=V.allocUnsafe(4);do de=Ie%128|0,Ie=Ie/128|0,Ie>0&&(de=de|128),he.writeUInt8(de,Ne++);while(Ie>0&&Ne<4);return Ie>0&&(Ne=0),re?he.subarray(0,Ne):he.slice(0,Ne)}function le(Ie){const ue=V.allocUnsafe(4);return ue.writeUInt32BE(Ie,0),ue}g.exports={cache:oe,generateCache:ie,generateNumber:Ce,genBufVariableByteInt:ae,generate4ByteBuffer:le}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],42:[function(r,g,k){class V{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}g.exports=V},{}],43:[function(r,g,k){const V=r("bl"),$=r("events"),oe=r("./packet"),re=r("./constants"),Ce=r("debug")("mqtt-packet:parser");class ie extends ${constructor(){super(),this.parser=this.constructor.parser}static parser(le){return this instanceof ie?(this.settings=le||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new ie().parser(le)}_resetState(){Ce("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new oe,this.error=null,this._list=V(),this._stateCounter=0}parse(le){for(this.error&&this._resetState(),this._list.append(le),Ce("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,Ce("parse: state complete. _stateCounter is now: %d",this._stateCounter),Ce("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return Ce("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const le=this._list.readUInt8(0);return this.packet.cmd=re.types[le>>re.CMD_SHIFT],this.packet.retain=(le&re.RETAIN_MASK)!==0,this.packet.qos=le>>re.QOS_SHIFT&re.QOS_MASK,this.packet.dup=(le&re.DUP_MASK)!==0,Ce("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){const le=this._parseVarByteNum(!0);return le&&(this.packet.length=le.value,this._list.consume(le.bytes)),Ce("_parseLength %d",le.value),!!le}_parsePayload(){Ce("_parsePayload: payload %O",this._list);let le=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}le=!0}return Ce("_parsePayload complete result: %s",le),le}_parseConnect(){Ce("_parseConnect");let le,Ie,ue,de;const Ne={},he=this.packet,pe=this._parseString();if(pe===null)return this._emitError(new Error("Cannot parse protocolId"));if(pe!=="MQTT"&&pe!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(he.protocolId=pe,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(he.protocolVersion=this._list.readUInt8(this._pos),he.protocolVersion>=128&&(he.bridgeMode=!0,he.protocolVersion=he.protocolVersion-128),he.protocolVersion!==3&&he.protocolVersion!==4&&he.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(Ne.username=this._list.readUInt8(this._pos)&re.USERNAME_MASK,Ne.password=this._list.readUInt8(this._pos)&re.PASSWORD_MASK,Ne.will=this._list.readUInt8(this._pos)&re.WILL_FLAG_MASK,Ne.will&&(he.will={},he.will.retain=(this._list.readUInt8(this._pos)&re.WILL_RETAIN_MASK)!==0,he.will.qos=(this._list.readUInt8(this._pos)&re.WILL_QOS_MASK)>>re.WILL_QOS_SHIFT),he.clean=(this._list.readUInt8(this._pos)&re.CLEAN_SESSION_MASK)!==0,this._pos++,he.keepalive=this._parseNum(),he.keepalive===-1)return this._emitError(new Error("Packet too short"));if(he.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(he.properties=Fe)}const ze=this._parseString();if(ze===null)return this._emitError(new Error("Packet too short"));if(he.clientId=ze,Ce("_parseConnect: packet.clientId: %s",he.clientId),Ne.will){if(he.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(he.will.properties=Fe)}if(le=this._parseString(),le===null)return this._emitError(new Error("Cannot parse will topic"));if(he.will.topic=le,Ce("_parseConnect: packet.will.topic: %s",he.will.topic),Ie=this._parseBuffer(),Ie===null)return this._emitError(new Error("Cannot parse will payload"));he.will.payload=Ie,Ce("_parseConnect: packet.will.paylaod: %s",he.will.payload)}if(Ne.username){if(de=this._parseString(),de===null)return this._emitError(new Error("Cannot parse username"));he.username=de,Ce("_parseConnect: packet.username: %s",he.username)}if(Ne.password){if(ue=this._parseBuffer(),ue===null)return this._emitError(new Error("Cannot parse password"));he.password=ue}return this.settings=he,Ce("_parseConnect: complete"),he}_parseConnack(){Ce("_parseConnack");const le=this.packet;if(this._list.length<1)return null;if(le.sessionPresent=!!(this._list.readUInt8(this._pos++)&re.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?le.reasonCode=this._list.readUInt8(this._pos++):le.reasonCode=0;else{if(this._list.length<2)return null;le.returnCode=this._list.readUInt8(this._pos++)}if(le.returnCode===-1||le.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}Ce("_parseConnack: complete")}_parsePublish(){Ce("_parsePublish");const le=this.packet;if(le.topic=this._parseString(),le.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(le.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}le.payload=this._list.slice(this._pos,le.length),Ce("_parsePublish: payload from buffer list: %o",le.payload)}}_parseSubscribe(){Ce("_parseSubscribe");const le=this.packet;let Ie,ue,de,Ne,he,pe,ze;if(le.qos!==1)return this._emitError(new Error("Wrong subscribe header"));if(le.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(le.properties=Fe)}for(;this._pos<le.length;){if(Ie=this._parseString(),Ie===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=le.length)return this._emitError(new Error("Malformed Subscribe Payload"));ue=this._parseByte(),de=ue&re.SUBSCRIBE_OPTIONS_QOS_MASK,pe=(ue>>re.SUBSCRIBE_OPTIONS_NL_SHIFT&re.SUBSCRIBE_OPTIONS_NL_MASK)!==0,he=(ue>>re.SUBSCRIBE_OPTIONS_RAP_SHIFT&re.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,Ne=ue>>re.SUBSCRIBE_OPTIONS_RH_SHIFT&re.SUBSCRIBE_OPTIONS_RH_MASK,ze={topic:Ie,qos:de},this.settings.protocolVersion===5?(ze.nl=pe,ze.rap=he,ze.rh=Ne):this.settings.bridgeMode&&(ze.rh=0,ze.rap=!0,ze.nl=!0),Ce("_parseSubscribe: push subscription `%s` to subscription",ze),le.subscriptions.push(ze)}}}_parseSuback(){Ce("_parseSuback");const le=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseUnsubscribe(){Ce("_parseUnsubscribe");const le=this.packet;if(le.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}for(;this._pos<le.length;){const Ie=this._parseString();if(Ie===null)return this._emitError(new Error("Cannot parse topic"));Ce("_parseUnsubscribe: push topic `%s` to unsubscriptions",Ie),le.unsubscriptions.push(Ie)}}}_parseUnsuback(){Ce("_parseUnsuback");const le=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(this.settings.protocolVersion===5){const Ie=this._parseProperties();for(Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie),le.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseConfirmation(){Ce("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const le=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5&&(le.length>2?(le.reasonCode=this._parseByte(),Ce("_parseConfirmation: packet.reasonCode `%d`",le.reasonCode)):le.reasonCode=0,le.length>3)){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}return!0}_parseDisconnect(){const le=this.packet;if(Ce("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?le.reasonCode=this._parseByte():le.reasonCode=0;const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}return Ce("_parseDisconnect result: true"),!0}_parseAuth(){Ce("_parseAuth");const le=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));le.reasonCode=this._parseByte();const Ie=this._parseProperties();return Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie),Ce("_parseAuth: result: true"),!0}_parseMessageId(){const le=this.packet;return le.messageId=this._parseNum(),le.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(Ce("_parseMessageId: packet.messageId %d",le.messageId),!0)}_parseString(le){const Ie=this._parseNum(),ue=Ie+this._pos;if(Ie===-1||ue>this._list.length||ue>this.packet.length)return null;const de=this._list.toString("utf8",this._pos,ue);return this._pos+=Ie,Ce("_parseString: result: %s",de),de}_parseStringPair(){return Ce("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const le=this._parseNum(),Ie=le+this._pos;if(le===-1||Ie>this._list.length||Ie>this.packet.length)return null;const ue=this._list.slice(this._pos,Ie);return this._pos+=le,Ce("_parseBuffer: result: %o",ue),ue}_parseNum(){if(this._list.length-this._pos<2)return-1;const le=this._list.readUInt16BE(this._pos);return this._pos+=2,Ce("_parseNum: result: %s",le),le}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const le=this._list.readUInt32BE(this._pos);return this._pos+=4,Ce("_parse4ByteNum: result: %s",le),le}_parseVarByteNum(le){Ce("_parseVarByteNum");const Ie=4;let ue=0,de=1,Ne=0,he=!1,pe;const ze=this._pos?this._pos:0;for(;ue<Ie&&ze+ue<this._list.length;){if(pe=this._list.readUInt8(ze+ue++),Ne+=de*(pe&re.VARBYTEINT_MASK),de*=128,!(pe&re.VARBYTEINT_FIN_MASK)){he=!0;break}if(this._list.length<=ue)break}return!he&&ue===Ie&&this._list.length>=ue&&this._emitError(new Error("Invalid variable byte integer")),ze&&(this._pos+=ue),he=he?le?{bytes:ue,value:Ne}:Ne:!1,Ce("_parseVarByteNum: result: %o",he),he}_parseByte(){let le;return this._pos<this._list.length&&(le=this._list.readUInt8(this._pos),this._pos++),Ce("_parseByte: result: %o",le),le}_parseByType(le){switch(Ce("_parseByType: type: %s",le),le){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){Ce("_parseProperties");const le=this._parseVarByteNum(),ue=this._pos+le,de={};for(;this._pos<ue;){const Ne=this._parseByte();if(!Ne)return this._emitError(new Error("Cannot parse property code type")),!1;const he=re.propertiesCodes[Ne];if(!he)return this._emitError(new Error("Unknown property")),!1;if(he==="userProperties"){de[he]||(de[he]=Object.create(null));const pe=this._parseByType(re.propertiesTypes[he]);if(de[he][pe.name])if(Array.isArray(de[he][pe.name]))de[he][pe.name].push(pe.value);else{const ze=de[he][pe.name];de[he][pe.name]=[ze],de[he][pe.name].push(pe.value)}else de[he][pe.name]=pe.value;continue}de[he]?Array.isArray(de[he])?de[he].push(this._parseByType(re.propertiesTypes[he])):(de[he]=[de[he]],de[he].push(this._parseByType(re.propertiesTypes[he]))):de[he]=this._parseByType(re.propertiesTypes[he])}return de}_newPacket(){return Ce("_newPacket"),this.packet&&(this._list.consume(this.packet.length),Ce("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),Ce("_newPacket: new packet"),this.packet=new oe,this._pos=0,!0}_emitError(le){Ce("_emitError"),this.error=le,this.emit("error",le)}}g.exports=ie},{"./constants":38,"./packet":42,bl:15,debug:18,events:22}],44:[function(r,g,k){(function(V){(function(){const $=r("./constants"),oe=V.allocUnsafe(0),re=V.from([0]),Ce=r("./numbers"),ie=r("process-nextick-args").nextTick,ae=r("debug")("mqtt-packet:writeToStream"),le=Ce.cache,Ie=Ce.generateNumber,ue=Ce.generateCache,de=Ce.genBufVariableByteInt,Ne=Ce.generate4ByteBuffer;let he=ni,pe=!0;function ze(wi,Ci,mi){switch(ae("generate called"),Ci.cork&&(Ci.cork(),ie(Fe,Ci)),pe&&(pe=!1,ue()),ae("generate: packet.cmd: %s",wi.cmd),wi.cmd){case"connect":return xe(wi,Ci);case"connack":return _e(wi,Ci,mi);case"publish":return Dt(wi,Ci,mi);case"puback":case"pubrec":case"pubrel":case"pubcomp":return $e(wi,Ci,mi);case"subscribe":return Ue(wi,Ci,mi);case"suback":return Ve(wi,Ci,mi);case"unsubscribe":return Oe(wi,Ci,mi);case"unsuback":return At(wi,Ci,mi);case"pingreq":case"pingresp":return qe(wi,Ci);case"disconnect":return Lt(wi,Ci,mi);case"auth":return kt(wi,Ci,mi);default:return Ci.emit("error",new Error("Unknown command")),!1}}Object.defineProperty(ze,"cacheNumbers",{get(){return he===ni},set(wi){wi?((!le||Object.keys(le).length===0)&&(pe=!0),he=ni):(pe=!1,he=gi)}});function Fe(wi){wi.uncork()}function xe(wi,Ci,mi){const Ni=wi||{},Mi=Ni.protocolId||"MQTT";let fi=Ni.protocolVersion||4;const zi=Ni.will;let Si=Ni.clean;const si=Ni.keepalive||0,Ii=Ni.clientId||"",oi=Ni.username,Et=Ni.password,ii=Ni.properties;Si===void 0&&(Si=!0);let ri=0;if(!Mi||typeof Mi!="string"&&!V.isBuffer(Mi))return Ci.emit("error",new Error("Invalid protocolId")),!1;if(ri+=Mi.length+2,fi!==3&&fi!==4&&fi!==5)return Ci.emit("error",new Error("Invalid protocol version")),!1;if(ri+=1,(typeof Ii=="string"||V.isBuffer(Ii))&&(Ii||fi>=4)&&(Ii||Si))ri+=V.byteLength(Ii)+2;else{if(fi<4)return Ci.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(Si*1===0)return Ci.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof si!="number"||si<0||si>65535||si%1!==0)return Ci.emit("error",new Error("Invalid keepalive")),!1;if(ri+=2,ri+=1,fi===5){var ui=ai(Ci,ii);if(!ui)return!1;ri+=ui.length}if(zi){if(typeof zi!="object")return Ci.emit("error",new Error("Invalid will")),!1;if(!zi.topic||typeof zi.topic!="string")return Ci.emit("error",new Error("Invalid will topic")),!1;if(ri+=V.byteLength(zi.topic)+2,ri+=2,zi.payload)if(zi.payload.length>=0)typeof zi.payload=="string"?ri+=V.byteLength(zi.payload):ri+=zi.payload.length;else return Ci.emit("error",new Error("Invalid will payload")),!1;var vi={};if(fi===5){if(vi=ai(Ci,zi.properties),!vi)return!1;ri+=vi.length}}let bi=!1;if(oi!=null)if(hi(oi))bi=!0,ri+=V.byteLength(oi)+2;else return Ci.emit("error",new Error("Invalid username")),!1;if(Et!=null){if(!bi)return Ci.emit("error",new Error("Username is required to use password")),!1;if(hi(Et))ri+=Ai(Et)+2;else return Ci.emit("error",new Error("Invalid password")),!1}Ci.write($.CONNECT_HEADER),ti(Ci,ri),li(Ci,Mi),Ni.bridgeMode&&(fi+=128),Ci.write(fi===131?$.VERSION131:fi===132?$.VERSION132:fi===4?$.VERSION4:fi===5?$.VERSION5:$.VERSION3);let Zi=0;return Zi|=oi!=null?$.USERNAME_MASK:0,Zi|=Et!=null?$.PASSWORD_MASK:0,Zi|=zi&&zi.retain?$.WILL_RETAIN_MASK:0,Zi|=zi&&zi.qos?zi.qos<<$.WILL_QOS_SHIFT:0,Zi|=zi?$.WILL_FLAG_MASK:0,Zi|=Si?$.CLEAN_SESSION_MASK:0,Ci.write(V.from([Zi])),he(Ci,si),fi===5&&ui.write(),li(Ci,Ii),zi&&(fi===5&&vi.write(),ei(Ci,zi.topic),li(Ci,zi.payload)),oi!=null&&li(Ci,oi),Et!=null&&li(Ci,Et),!0}function _e(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Ni===5?Mi.reasonCode:Mi.returnCode,zi=Mi.properties;let Si=2;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid return code")),!1;let si=null;if(Ni===5){if(si=ai(Ci,zi),!si)return!1;Si+=si.length}return Ci.write($.CONNACK_HEADER),ti(Ci,Si),Ci.write(Mi.sessionPresent?$.SESSIONPRESENT_HEADER:re),Ci.write(V.from([fi])),si!=null&&si.write(),!0}function Dt(wi,Ci,mi){ae("publish: packet: %o",wi);const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.qos||0,zi=Mi.retain?$.RETAIN_MASK:0,Si=Mi.topic,si=Mi.payload||oe,Ii=Mi.messageId,oi=Mi.properties;let Et=0;if(typeof Si=="string")Et+=V.byteLength(Si)+2;else if(V.isBuffer(Si))Et+=Si.length+2;else return Ci.emit("error",new Error("Invalid topic")),!1;if(V.isBuffer(si)?Et+=si.length:Et+=V.byteLength(si),fi&&typeof Ii!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;fi&&(Et+=2);let ii=null;if(Ni===5){if(ii=ai(Ci,oi),!ii)return!1;Et+=ii.length}return Ci.write($.PUBLISH_HEADER[fi][Mi.dup?1:0][zi?1:0]),ti(Ci,Et),he(Ci,Ai(Si)),Ci.write(Si),fi>0&&he(Ci,Ii),ii!=null&&ii.write(),ae("publish: payload: %o",si),Ci.write(si)}function $e(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.cmd||"puback",zi=Mi.messageId,Si=Mi.dup&&fi==="pubrel"?$.DUP_MASK:0;let si=0;const Ii=Mi.reasonCode,oi=Mi.properties;let Et=Ni===5?3:2;if(fi==="pubrel"&&(si=1),typeof zi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;let ii=null;if(Ni===5&&typeof oi=="object"){if(ii=ci(Ci,oi,mi,Et),!ii)return!1;Et+=ii.length}return Ci.write($.ACKS[fi][si][Si][0]),ti(Ci,Et),he(Ci,zi),Ni===5&&Ci.write(V.from([Ii])),ii!==null&&ii.write(),!0}function Ue(wi,Ci,mi){ae("subscribe: packet: ");const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.dup?$.DUP_MASK:0,zi=Mi.messageId,Si=Mi.subscriptions,si=Mi.properties;let Ii=0;if(typeof zi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;Ii+=2;let oi=null;if(Ni===5){if(oi=ai(Ci,si),!oi)return!1;Ii+=oi.length}if(typeof Si=="object"&&Si.length)for(let ii=0;ii<Si.length;ii+=1){const ri=Si[ii].topic,ui=Si[ii].qos;if(typeof ri!="string")return Ci.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if(typeof ui!="number")return Ci.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(Ni===5){if(typeof(Si[ii].nl||!1)!="boolean")return Ci.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(Si[ii].rap||!1)!="boolean")return Ci.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;const Zi=Si[ii].rh||0;if(typeof Zi!="number"||Zi>2)return Ci.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}Ii+=V.byteLength(ri)+2+1}else return Ci.emit("error",new Error("Invalid subscriptions")),!1;ae("subscribe: writing to stream: %o",$.SUBSCRIBE_HEADER),Ci.write($.SUBSCRIBE_HEADER[1][fi?1:0][0]),ti(Ci,Ii),he(Ci,zi),oi!==null&&oi.write();let Et=!0;for(const ii of Si){const ri=ii.topic,ui=ii.qos,vi=+ii.nl,bi=+ii.rap,Zi=ii.rh;let Gi;ei(Ci,ri),Gi=$.SUBSCRIBE_OPTIONS_QOS[ui],Ni===5&&(Gi|=vi?$.SUBSCRIBE_OPTIONS_NL:0,Gi|=bi?$.SUBSCRIBE_OPTIONS_RAP:0,Gi|=Zi?$.SUBSCRIBE_OPTIONS_RH[Zi]:0),Et=Ci.write(V.from([Gi]))}return Et}function Ve(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.granted,Si=Mi.properties;let si=0;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(si+=2,typeof zi=="object"&&zi.length)for(let oi=0;oi<zi.length;oi+=1){if(typeof zi[oi]!="number")return Ci.emit("error",new Error("Invalid qos vector")),!1;si+=1}else return Ci.emit("error",new Error("Invalid qos vector")),!1;let Ii=null;if(Ni===5){if(Ii=ci(Ci,Si,mi,si),!Ii)return!1;si+=Ii.length}return Ci.write($.SUBACK_HEADER),ti(Ci,si),he(Ci,fi),Ii!==null&&Ii.write(),Ci.write(V.from(zi))}function Oe(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.dup?$.DUP_MASK:0,Si=Mi.unsubscriptions,si=Mi.properties;let Ii=0;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(Ii+=2,typeof Si=="object"&&Si.length)for(let ii=0;ii<Si.length;ii+=1){if(typeof Si[ii]!="string")return Ci.emit("error",new Error("Invalid unsubscriptions")),!1;Ii+=V.byteLength(Si[ii])+2}else return Ci.emit("error",new Error("Invalid unsubscriptions")),!1;let oi=null;if(Ni===5){if(oi=ai(Ci,si),!oi)return!1;Ii+=oi.length}Ci.write($.UNSUBSCRIBE_HEADER[1][zi?1:0][0]),ti(Ci,Ii),he(Ci,fi),oi!==null&&oi.write();let Et=!0;for(let ii=0;ii<Si.length;ii++)Et=ei(Ci,Si[ii]);return Et}function At(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.dup?$.DUP_MASK:0,Si=Mi.granted,si=Mi.properties,Ii=Mi.cmd,oi=0;let Et=2;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(Ni===5)if(typeof Si=="object"&&Si.length)for(let ri=0;ri<Si.length;ri+=1){if(typeof Si[ri]!="number")return Ci.emit("error",new Error("Invalid qos vector")),!1;Et+=1}else return Ci.emit("error",new Error("Invalid qos vector")),!1;let ii=null;if(Ni===5){if(ii=ci(Ci,si,mi,Et),!ii)return!1;Et+=ii.length}return Ci.write($.ACKS[Ii][oi][zi][0]),ti(Ci,Et),he(Ci,fi),ii!==null&&ii.write(),Ni===5&&Ci.write(V.from(Si)),!0}function qe(wi,Ci,mi){return Ci.write($.EMPTY[wi.cmd])}function Lt(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.reasonCode,zi=Mi.properties;let Si=Ni===5?1:0,si=null;if(Ni===5){if(si=ci(Ci,zi,mi,Si),!si)return!1;Si+=si.length}return Ci.write(V.from([$.codes.disconnect<<4])),ti(Ci,Si),Ni===5&&Ci.write(V.from([fi])),si!==null&&si.write(),!0}function kt(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.reasonCode,zi=Mi.properties;let Si=Ni===5?1:0;Ni!==5&&Ci.emit("error",new Error("Invalid mqtt version for auth packet"));const si=ci(Ci,zi,mi,Si);return si?(Si+=si.length,Ci.write(V.from([$.codes.auth<<4])),ti(Ci,Si),Ci.write(V.from([fi])),si!==null&&si.write(),!0):!1}const jt={};function ti(wi,Ci){if(Ci>$.VARBYTEINT_MAX)return wi.emit("error",new Error(`Invalid variable byte integer: ${Ci}`)),!1;let mi=jt[Ci];return mi||(mi=de(Ci),Ci<16384&&(jt[Ci]=mi)),ae("writeVarByteInt: writing to stream: %o",mi),wi.write(mi)}function ei(wi,Ci){const mi=V.byteLength(Ci);return he(wi,mi),ae("writeString: %s",Ci),wi.write(Ci,"utf8")}function Pt(wi,Ci,mi){ei(wi,Ci),ei(wi,mi)}function ni(wi,Ci){return ae("writeNumberCached: number: %d",Ci),ae("writeNumberCached: %o",le[Ci]),wi.write(le[Ci])}function gi(wi,Ci){const mi=Ie(Ci);return ae("writeNumberGenerated: %o",mi),wi.write(mi)}function di(wi,Ci){const mi=Ne(Ci);return ae("write4ByteNumber: %o",mi),wi.write(mi)}function li(wi,Ci){typeof Ci=="string"?ei(wi,Ci):Ci?(he(wi,Ci.length),wi.write(Ci)):he(wi,0)}function ai(wi,Ci){if(typeof Ci!="object"||Ci.length!=null)return{length:1,write(){yi(wi,{},0)}};let mi=0;function Ni(fi,zi){const Si=$.propertiesTypes[fi];let si=0;switch(Si){case"byte":{if(typeof zi!="boolean")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+1;break}case"int8":{if(typeof zi!="number"||zi<0||zi>255)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+1;break}case"binary":{if(zi&&zi===null)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+V.byteLength(zi)+2;break}case"int16":{if(typeof zi!="number"||zi<0||zi>65535)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+2;break}case"int32":{if(typeof zi!="number"||zi<0||zi>4294967295)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+4;break}case"var":{if(typeof zi!="number"||zi<0||zi>268435455)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+V.byteLength(de(zi));break}case"string":{if(typeof zi!="string")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+2+V.byteLength(zi.toString());break}case"pair":{if(typeof zi!="object")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=Object.getOwnPropertyNames(zi).reduce((Ii,oi)=>{const Et=zi[oi];return Array.isArray(Et)?Ii+=Et.reduce((ii,ri)=>(ii+=1+2+V.byteLength(oi.toString())+2+V.byteLength(ri.toString()),ii),0):Ii+=1+2+V.byteLength(oi.toString())+2+V.byteLength(zi[oi].toString()),Ii},0);break}default:return wi.emit("error",new Error(`Invalid property ${fi}: ${zi}`)),!1}return si}if(Ci)for(const fi in Ci){let zi=0,Si=0;const si=Ci[fi];if(Array.isArray(si))for(let Ii=0;Ii<si.length;Ii++){if(Si=Ni(fi,si[Ii]),!Si)return!1;zi+=Si}else{if(Si=Ni(fi,si),!Si)return!1;zi=Si}if(!zi)return!1;mi+=zi}return{length:V.byteLength(de(mi))+mi,write(){yi(wi,Ci,mi)}}}function ci(wi,Ci,mi,Ni){const Mi=["reasonString","userProperties"],fi=mi&&mi.properties&&mi.properties.maximumPacketSize?mi.properties.maximumPacketSize:0;let zi=ai(wi,Ci);if(fi)for(;Ni+zi.length>fi;){const Si=Mi.shift();if(Si&&Ci[Si])delete Ci[Si],zi=ai(wi,Ci);else return!1}return zi}function pi(wi,Ci,mi){switch($.propertiesTypes[Ci]){case"byte":{wi.write(V.from([$.properties[Ci]])),wi.write(V.from([+mi]));break}case"int8":{wi.write(V.from([$.properties[Ci]])),wi.write(V.from([mi]));break}case"binary":{wi.write(V.from([$.properties[Ci]])),li(wi,mi);break}case"int16":{wi.write(V.from([$.properties[Ci]])),he(wi,mi);break}case"int32":{wi.write(V.from([$.properties[Ci]])),di(wi,mi);break}case"var":{wi.write(V.from([$.properties[Ci]])),ti(wi,mi);break}case"string":{wi.write(V.from([$.properties[Ci]])),ei(wi,mi);break}case"pair":{Object.getOwnPropertyNames(mi).forEach(Mi=>{const fi=mi[Mi];Array.isArray(fi)?fi.forEach(zi=>{wi.write(V.from([$.properties[Ci]])),Pt(wi,Mi.toString(),zi.toString())}):(wi.write(V.from([$.properties[Ci]])),Pt(wi,Mi.toString(),fi.toString()))});break}default:return wi.emit("error",new Error(`Invalid property ${Ci} value: ${mi}`)),!1}}function yi(wi,Ci,mi){ti(wi,mi);for(const Ni in Ci)if(Object.prototype.hasOwnProperty.call(Ci,Ni)&&Ci[Ni]!==null){const Mi=Ci[Ni];if(Array.isArray(Mi))for(let fi=0;fi<Mi.length;fi++)pi(wi,Ni,Mi[fi]);else pi(wi,Ni,Mi)}}function Ai(wi){return wi?wi instanceof V?wi.length:V.byteLength(wi):0}function hi(wi){return typeof wi=="string"||wi instanceof V}g.exports=ze}).call(this)}).call(this,r("buffer").Buffer)},{"./constants":38,"./numbers":41,buffer:17,debug:18,"process-nextick-args":49}],45:[function(r,g,k){var V=1e3,$=V*60,oe=$*60,re=oe*24,Ce=re*7,ie=re*365.25;g.exports=function(de,Ne){Ne=Ne||{};var he=typeof de;if(he==="string"&&de.length>0)return ae(de);if(he==="number"&&isFinite(de))return Ne.long?Ie(de):le(de);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(de))};function ae(de){if(de=String(de),!(de.length>100)){var Ne=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(de);if(Ne){var he=parseFloat(Ne[1]),pe=(Ne[2]||"ms").toLowerCase();switch(pe){case"years":case"year":case"yrs":case"yr":case"y":return he*ie;case"weeks":case"week":case"w":return he*Ce;case"days":case"day":case"d":return he*re;case"hours":case"hour":case"hrs":case"hr":case"h":return he*oe;case"minutes":case"minute":case"mins":case"min":case"m":return he*$;case"seconds":case"second":case"secs":case"sec":case"s":return he*V;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return he;default:return}}}}function le(de){var Ne=Math.abs(de);return Ne>=re?Math.round(de/re)+"d":Ne>=oe?Math.round(de/oe)+"h":Ne>=$?Math.round(de/$)+"m":Ne>=V?Math.round(de/V)+"s":de+"ms"}function Ie(de){var Ne=Math.abs(de);return Ne>=re?ue(de,Ne,re,"day"):Ne>=oe?ue(de,Ne,oe,"hour"):Ne>=$?ue(de,Ne,$,"minute"):Ne>=V?ue(de,Ne,V,"second"):de+" ms"}function ue(de,Ne,he,pe){var ze=Ne>=he*1.5;return Math.round(de/he)+" "+pe+(ze?"s":"")}},{}],46:[function(r,g,k){const V=r("./lib/number-allocator.js");g.exports.NumberAllocator=V},{"./lib/number-allocator.js":47}],47:[function(r,g,k){const V=r("js-sdsl").Set,$=r("debug")("number-allocator:trace"),oe=r("debug")("number-allocator:error");function re(ie,ae){this.low=ie,this.high=ae}re.prototype.equals=function(ie){return this.low===ie.low&&this.high===ie.high},re.prototype.compare=function(ie){return this.low<ie.low&&this.high<ie.low?-1:ie.low<this.low&&ie.high<this.low?1:0};function Ce(ie,ae){if(!(this instanceof Ce))return new Ce(ie,ae);this.min=ie,this.max=ae,this.ss=new V([],(le,Ie)=>le.compare(Ie)),$("Create"),this.clear()}Ce.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},Ce.prototype.alloc=function(){if(this.ss.size()===0)return $("alloc():empty"),null;const ie=this.ss.front(),ae=ie.low;return ae+1<=ie.high?++ie.low:this.ss.eraseElementByPos(0),$("alloc():"+ae),ae},Ce.prototype.use=function(ie){const ae=new re(ie,ie),le=this.ss.lowerBound(ae);if(le){if(le.equals(ae))return this.ss.eraseElementByValue(le),$("use():"+ie),!0;if(le.low>ie)return!1;if(le.low===ie)return++le.low,$("use():"+ie),!0;if(le.high===ie)return--le.high,$("use():"+ie),!0;const Ie=le.low;return le.low=ie+1,this.ss.insert(new re(Ie,ie-1)),$("use():"+ie),!0}return $("use():failed"),!1},Ce.prototype.free=function(ie){if(ie<this.min||ie>this.max){oe("free():"+ie+" is out of range");return}const ae=new re(ie,ie),le=this.ss.lowerBound(ae);if(le){if(le.low<=ie&&ie<=le.high){oe("free():"+ie+" has already been vacant");return}if(le===this.ss.front())ie+1===le.low?--le.low:this.ss.insert(ae);else{const Ie=this.ss.reverseLowerBound(ae);Ie.high+1===ie?ie+1===le.low?(this.ss.eraseElementByValue(Ie),le.low=Ie.low):Ie.high=ie:ie+1===le.low?le.low=ie:this.ss.insert(ae)}}else{if(le===this.ss.front()){this.ss.insert(ae);return}const Ie=this.ss.reverseLowerBound(ae);Ie.high+1===ie?Ie.high=ie:this.ss.insert(ae)}$("free():"+ie)},Ce.prototype.clear=function(){$("clear()"),this.ss.clear(),this.ss.insert(new re(this.min,this.max))},Ce.prototype.intervalCount=function(){return this.ss.size()},Ce.prototype.dump=function(){console.log("length:"+this.ss.size());for(const ie of this.ss)console.log(ie)},g.exports=Ce},{debug:18,"js-sdsl":36}],48:[function(r,g,k){var V=r("wrappy");g.exports=V($),g.exports.strict=V(oe),$.proto=$(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return $(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return oe(this)},configurable:!0})});function $(re){var Ce=function(){return Ce.called?Ce.value:(Ce.called=!0,Ce.value=re.apply(this,arguments))};return Ce.called=!1,Ce}function oe(re){var Ce=function(){if(Ce.called)throw new Error(Ce.onceError);return Ce.called=!0,Ce.value=re.apply(this,arguments)},ie=re.name||"Function wrapped with `once`";return Ce.onceError=ie+" shouldn't be called more than once",Ce.called=!1,Ce}},{wrappy:79}],49:[function(r,g,k){(function(V){(function(){typeof V>"u"||!V.version||V.version.indexOf("v0.")===0||V.version.indexOf("v1.")===0&&V.version.indexOf("v1.8.")!==0?g.exports={nextTick:$}:g.exports=V;function $(oe,re,Ce,ie){if(typeof oe!="function")throw new TypeError('"callback" argument must be a function');var ae=arguments.length,le,Ie;switch(ae){case 0:case 1:return V.nextTick(oe);case 2:return V.nextTick(function(){oe.call(null,re)});case 3:return V.nextTick(function(){oe.call(null,re,Ce)});case 4:return V.nextTick(function(){oe.call(null,re,Ce,ie)});default:for(le=new Array(ae-1),Ie=0;Ie<le.length;)le[Ie++]=arguments[Ie];return V.nextTick(function(){oe.apply(null,le)})}}}).call(this)}).call(this,r("_process"))},{_process:50}],50:[function(r,g,k){var V=g.exports={},$,oe;function re(){throw new Error("setTimeout has not been defined")}function Ce(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?$=setTimeout:$=re}catch{$=re}try{typeof clearTimeout=="function"?oe=clearTimeout:oe=Ce}catch{oe=Ce}})();function ie(Fe){if($===setTimeout)return setTimeout(Fe,0);if(($===re||!$)&&setTimeout)return $=setTimeout,setTimeout(Fe,0);try{return $(Fe,0)}catch{try{return $.call(null,Fe,0)}catch{return $.call(this,Fe,0)}}}function ae(Fe){if(oe===clearTimeout)return clearTimeout(Fe);if((oe===Ce||!oe)&&clearTimeout)return oe=clearTimeout,clearTimeout(Fe);try{return oe(Fe)}catch{try{return oe.call(null,Fe)}catch{return oe.call(this,Fe)}}}var le=[],Ie=!1,ue,de=-1;function Ne(){!Ie||!ue||(Ie=!1,ue.length?le=ue.concat(le):de=-1,le.length&&he())}function he(){if(!Ie){var Fe=ie(Ne);Ie=!0;for(var xe=le.length;xe;){for(ue=le,le=[];++de<xe;)ue&&ue[de].run();de=-1,xe=le.length}ue=null,Ie=!1,ae(Fe)}}V.nextTick=function(Fe){var xe=new Array(arguments.length-1);if(arguments.length>1)for(var _e=1;_e<arguments.length;_e++)xe[_e-1]=arguments[_e];le.push(new pe(Fe,xe)),le.length===1&&!Ie&&ie(he)};function pe(Fe,xe){this.fun=Fe,this.array=xe}pe.prototype.run=function(){this.fun.apply(null,this.array)},V.title="browser",V.browser=!0,V.env={},V.argv=[],V.version="",V.versions={};function ze(){}V.on=ze,V.addListener=ze,V.once=ze,V.off=ze,V.removeListener=ze,V.removeAllListeners=ze,V.emit=ze,V.prependListener=ze,V.prependOnceListener=ze,V.listeners=function(Fe){return[]},V.binding=function(Fe){throw new Error("process.binding is not supported")},V.cwd=function(){return"/"},V.chdir=function(Fe){throw new Error("process.chdir is not supported")},V.umask=function(){return 0}},{}],51:[function(r,g,k){(function(V){(function(){(function($){var oe=typeof k=="object"&&k&&!k.nodeType&&k,re=typeof g=="object"&&g&&!g.nodeType&&g,Ce=typeof V=="object"&&V;(Ce.global===Ce||Ce.window===Ce||Ce.self===Ce)&&($=Ce);var ie,ae=2147483647,le=36,Ie=1,ue=26,de=38,Ne=700,he=72,pe=128,ze="-",Fe=/^xn--/,xe=/[^\x20-\x7E]/,_e=/[\x2E\u3002\uFF0E\uFF61]/g,Dt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$e=le-Ie,Ue=Math.floor,Ve=String.fromCharCode,Oe;function At(ai){throw new RangeError(Dt[ai])}function qe(ai,ci){for(var pi=ai.length,yi=[];pi--;)yi[pi]=ci(ai[pi]);return yi}function Lt(ai,ci){var pi=ai.split("@"),yi="";pi.length>1&&(yi=pi[0]+"@",ai=pi[1]),ai=ai.replace(_e,".");var Ai=ai.split("."),hi=qe(Ai,ci).join(".");return yi+hi}function kt(ai){for(var ci=[],pi=0,yi=ai.length,Ai,hi;pi<yi;)Ai=ai.charCodeAt(pi++),Ai>=55296&&Ai<=56319&&pi<yi?(hi=ai.charCodeAt(pi++),(hi&64512)==56320?ci.push(((Ai&1023)<<10)+(hi&1023)+65536):(ci.push(Ai),pi--)):ci.push(Ai);return ci}function jt(ai){return qe(ai,function(ci){var pi="";return ci>65535&&(ci-=65536,pi+=Ve(ci>>>10&1023|55296),ci=56320|ci&1023),pi+=Ve(ci),pi}).join("")}function ti(ai){return ai-48<10?ai-22:ai-65<26?ai-65:ai-97<26?ai-97:le}function ei(ai,ci){return ai+22+75*(ai<26)-((ci!=0)<<5)}function Pt(ai,ci,pi){var yi=0;for(ai=pi?Ue(ai/Ne):ai>>1,ai+=Ue(ai/ci);ai>$e*ue>>1;yi+=le)ai=Ue(ai/$e);return Ue(yi+($e+1)*ai/(ai+de))}function ni(ai){var ci=[],pi=ai.length,yi,Ai=0,hi=pe,wi=he,Ci,mi,Ni,Mi,fi,zi,Si,si,Ii;for(Ci=ai.lastIndexOf(ze),Ci<0&&(Ci=0),mi=0;mi<Ci;++mi)ai.charCodeAt(mi)>=128&&At("not-basic"),ci.push(ai.charCodeAt(mi));for(Ni=Ci>0?Ci+1:0;Ni<pi;){for(Mi=Ai,fi=1,zi=le;Ni>=pi&&At("invalid-input"),Si=ti(ai.charCodeAt(Ni++)),(Si>=le||Si>Ue((ae-Ai)/fi))&&At("overflow"),Ai+=Si*fi,si=zi<=wi?Ie:zi>=wi+ue?ue:zi-wi,!(Si<si);zi+=le)Ii=le-si,fi>Ue(ae/Ii)&&At("overflow"),fi*=Ii;yi=ci.length+1,wi=Pt(Ai-Mi,yi,Mi==0),Ue(Ai/yi)>ae-hi&&At("overflow"),hi+=Ue(Ai/yi),Ai%=yi,ci.splice(Ai++,0,hi)}return jt(ci)}function gi(ai){var ci,pi,yi,Ai,hi,wi,Ci,mi,Ni,Mi,fi,zi=[],Si,si,Ii,oi;for(ai=kt(ai),Si=ai.length,ci=pe,pi=0,hi=he,wi=0;wi<Si;++wi)fi=ai[wi],fi<128&&zi.push(Ve(fi));for(yi=Ai=zi.length,Ai&&zi.push(ze);yi<Si;){for(Ci=ae,wi=0;wi<Si;++wi)fi=ai[wi],fi>=ci&&fi<Ci&&(Ci=fi);for(si=yi+1,Ci-ci>Ue((ae-pi)/si)&&At("overflow"),pi+=(Ci-ci)*si,ci=Ci,wi=0;wi<Si;++wi)if(fi=ai[wi],fi<ci&&++pi>ae&&At("overflow"),fi==ci){for(mi=pi,Ni=le;Mi=Ni<=hi?Ie:Ni>=hi+ue?ue:Ni-hi,!(mi<Mi);Ni+=le)oi=mi-Mi,Ii=le-Mi,zi.push(Ve(ei(Mi+oi%Ii,0))),mi=Ue(oi/Ii);zi.push(Ve(ei(mi,0))),hi=Pt(pi,si,yi==Ai),pi=0,++yi}++pi,++ci}return zi.join("")}function di(ai){return Lt(ai,function(ci){return Fe.test(ci)?ni(ci.slice(4).toLowerCase()):ci})}function li(ai){return Lt(ai,function(ci){return xe.test(ci)?"xn--"+gi(ci):ci})}if(ie={version:"1.4.1",ucs2:{decode:kt,encode:jt},decode:ni,encode:gi,toASCII:li,toUnicode:di},oe&&re)if(g.exports==oe)re.exports=ie;else for(Oe in ie)ie.hasOwnProperty(Oe)&&(oe[Oe]=ie[Oe]);else $.punycode=ie})(this)}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],52:[function(r,g,k){function V(oe,re){return Object.prototype.hasOwnProperty.call(oe,re)}g.exports=function(oe,re,Ce,ie){re=re||"&",Ce=Ce||"=";var ae={};if(typeof oe!="string"||oe.length===0)return ae;var le=/\+/g;oe=oe.split(re);var Ie=1e3;ie&&typeof ie.maxKeys=="number"&&(Ie=ie.maxKeys);var ue=oe.length;Ie>0&&ue>Ie&&(ue=Ie);for(var de=0;de<ue;++de){var Ne=oe[de].replace(le,"%20"),he=Ne.indexOf(Ce),pe,ze,Fe,xe;he>=0?(pe=Ne.substr(0,he),ze=Ne.substr(he+1)):(pe=Ne,ze=""),Fe=decodeURIComponent(pe),xe=decodeURIComponent(ze),V(ae,Fe)?$(ae[Fe])?ae[Fe].push(xe):ae[Fe]=[ae[Fe],xe]:ae[Fe]=xe}return ae};var $=Array.isArray||function(oe){return Object.prototype.toString.call(oe)==="[object Array]"}},{}],53:[function(r,g,k){var V=function(Ce){switch(typeof Ce){case"string":return Ce;case"boolean":return Ce?"true":"false";case"number":return isFinite(Ce)?Ce:"";default:return""}};g.exports=function(Ce,ie,ae,le){return ie=ie||"&",ae=ae||"=",Ce===null&&(Ce=void 0),typeof Ce=="object"?oe(re(Ce),function(Ie){var ue=encodeURIComponent(V(Ie))+ae;return $(Ce[Ie])?oe(Ce[Ie],function(de){return ue+encodeURIComponent(V(de))}).join(ie):ue+encodeURIComponent(V(Ce[Ie]))}).join(ie):le?encodeURIComponent(V(le))+ae+encodeURIComponent(V(Ce)):""};var $=Array.isArray||function(Ce){return Object.prototype.toString.call(Ce)==="[object Array]"};function oe(Ce,ie){if(Ce.map)return Ce.map(ie);for(var ae=[],le=0;le<Ce.length;le++)ae.push(ie(Ce[le],le));return ae}var re=Object.keys||function(Ce){var ie=[];for(var ae in Ce)Object.prototype.hasOwnProperty.call(Ce,ae)&&ie.push(ae);return ie}},{}],54:[function(r,g,k){k.decode=k.parse=r("./decode"),k.encode=k.stringify=r("./encode")},{"./decode":52,"./encode":53}],55:[function(r,g,k){function V(le,Ie){le.prototype=Object.create(Ie.prototype),le.prototype.constructor=le,le.__proto__=Ie}var $={};function oe(le,Ie,ue){ue||(ue=Error);function de(he,pe,ze){return typeof Ie=="string"?Ie:Ie(he,pe,ze)}var Ne=function(he){V(pe,he);function pe(ze,Fe,xe){return he.call(this,de(ze,Fe,xe))||this}return pe}(ue);Ne.prototype.name=ue.name,Ne.prototype.code=le,$[le]=Ne}function re(le,Ie){if(Array.isArray(le)){var ue=le.length;return le=le.map(function(de){return String(de)}),ue>2?"one of ".concat(Ie," ").concat(le.slice(0,ue-1).join(", "),", or ")+le[ue-1]:ue===2?"one of ".concat(Ie," ").concat(le[0]," or ").concat(le[1]):"of ".concat(Ie," ").concat(le[0])}else return"of ".concat(Ie," ").concat(String(le))}function Ce(le,Ie,ue){return le.substr(!ue||ue<0?0:+ue,Ie.length)===Ie}function ie(le,Ie,ue){return(ue===void 0||ue>le.length)&&(ue=le.length),le.substring(ue-Ie.length,ue)===Ie}function ae(le,Ie,ue){return typeof ue!="number"&&(ue=0),ue+Ie.length>le.length?!1:le.indexOf(Ie,ue)!==-1}oe("ERR_INVALID_OPT_VALUE",function(le,Ie){return'The value "'+Ie+'" is invalid for option "'+le+'"'},TypeError),oe("ERR_INVALID_ARG_TYPE",function(le,Ie,ue){var de;typeof Ie=="string"&&Ce(Ie,"not ")?(de="must not be",Ie=Ie.replace(/^not /,"")):de="must be";var Ne;if(ie(le," argument"))Ne="The ".concat(le," ").concat(de," ").concat(re(Ie,"type"));else{var he=ae(le,".")?"property":"argument";Ne='The "'.concat(le,'" ').concat(he," ").concat(de," ").concat(re(Ie,"type"))}return Ne+=". Received type ".concat(typeof ue),Ne},TypeError),oe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),oe("ERR_METHOD_NOT_IMPLEMENTED",function(le){return"The "+le+" method is not implemented"}),oe("ERR_STREAM_PREMATURE_CLOSE","Premature close"),oe("ERR_STREAM_DESTROYED",function(le){return"Cannot call "+le+" after a stream was destroyed"}),oe("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),oe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),oe("ERR_STREAM_WRITE_AFTER_END","write after end"),oe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),oe("ERR_UNKNOWN_ENCODING",function(le){return"Unknown encoding: "+le},TypeError),oe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),g.exports.codes=$},{}],56:[function(r,g,k){(function(V){(function(){var $=Object.keys||function(de){var Ne=[];for(var he in de)Ne.push(he);return Ne};g.exports=le;var oe=r("./_stream_readable"),re=r("./_stream_writable");r("inherits")(le,oe);for(var Ce=$(re.prototype),ie=0;ie<Ce.length;ie++){var ae=Ce[ie];le.prototype[ae]||(le.prototype[ae]=re.prototype[ae])}function le(de){if(!(this instanceof le))return new le(de);oe.call(this,de),re.call(this,de),this.allowHalfOpen=!0,de&&(de.readable===!1&&(this.readable=!1),de.writable===!1&&(this.writable=!1),de.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Ie)))}Object.defineProperty(le.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(le.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(le.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Ie(){this._writableState.ended||V.nextTick(ue,this)}function ue(de){de.end()}Object.defineProperty(le.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(Ne){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=Ne,this._writableState.destroyed=Ne)}})}).call(this)}).call(this,r("_process"))},{"./_stream_readable":58,"./_stream_writable":60,_process:50,inherits:24}],57:[function(r,g,k){g.exports=$;var V=r("./_stream_transform");r("inherits")($,V);function $(oe){if(!(this instanceof $))return new $(oe);V.call(this,oe)}$.prototype._transform=function(oe,re,Ce){Ce(null,oe)}},{"./_stream_transform":59,inherits:24}],58:[function(r,g,k){(function(V,$){(function(){g.exports=jt;var oe;jt.ReadableState=kt,r("events").EventEmitter;var re=function(Ii,oi){return Ii.listeners(oi).length},Ce=r("./internal/streams/stream"),ie=r("buffer").Buffer,ae=$.Uint8Array||function(){};function le(si){return ie.from(si)}function Ie(si){return ie.isBuffer(si)||si instanceof ae}var ue=r("util"),de;ue&&ue.debuglog?de=ue.debuglog("stream"):de=function(){};var Ne=r("./internal/streams/buffer_list"),he=r("./internal/streams/destroy"),pe=r("./internal/streams/state"),ze=pe.getHighWaterMark,Fe=r("../errors").codes,xe=Fe.ERR_INVALID_ARG_TYPE,_e=Fe.ERR_STREAM_PUSH_AFTER_EOF,Dt=Fe.ERR_METHOD_NOT_IMPLEMENTED,$e=Fe.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ue,Ve,Oe;r("inherits")(jt,Ce);var At=he.errorOrDestroy,qe=["error","close","destroy","pause","resume"];function Lt(si,Ii,oi){if(typeof si.prependListener=="function")return si.prependListener(Ii,oi);!si._events||!si._events[Ii]?si.on(Ii,oi):Array.isArray(si._events[Ii])?si._events[Ii].unshift(oi):si._events[Ii]=[oi,si._events[Ii]]}function kt(si,Ii,oi){oe=oe||r("./_stream_duplex"),si=si||{},typeof oi!="boolean"&&(oi=Ii instanceof oe),this.objectMode=!!si.objectMode,oi&&(this.objectMode=this.objectMode||!!si.readableObjectMode),this.highWaterMark=ze(this,si,"readableHighWaterMark",oi),this.buffer=new Ne,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=si.emitClose!==!1,this.autoDestroy=!!si.autoDestroy,this.destroyed=!1,this.defaultEncoding=si.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,si.encoding&&(Ue||(Ue=r("string_decoder/").StringDecoder),this.decoder=new Ue(si.encoding),this.encoding=si.encoding)}function jt(si){if(oe=oe||r("./_stream_duplex"),!(this instanceof jt))return new jt(si);var Ii=this instanceof oe;this._readableState=new kt(si,this,Ii),this.readable=!0,si&&(typeof si.read=="function"&&(this._read=si.read),typeof si.destroy=="function"&&(this._destroy=si.destroy)),Ce.call(this)}Object.defineProperty(jt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Ii){this._readableState&&(this._readableState.destroyed=Ii)}}),jt.prototype.destroy=he.destroy,jt.prototype._undestroy=he.undestroy,jt.prototype._destroy=function(si,Ii){Ii(si)},jt.prototype.push=function(si,Ii){var oi=this._readableState,Et;return oi.objectMode?Et=!0:typeof si=="string"&&(Ii=Ii||oi.defaultEncoding,Ii!==oi.encoding&&(si=ie.from(si,Ii),Ii=""),Et=!0),ti(this,si,Ii,!1,Et)},jt.prototype.unshift=function(si){return ti(this,si,null,!0,!1)};function ti(si,Ii,oi,Et,ii){de("readableAddChunk",Ii);var ri=si._readableState;if(Ii===null)ri.reading=!1,li(si,ri);else{var ui;if(ii||(ui=Pt(ri,Ii)),ui)At(si,ui);else if(ri.objectMode||Ii&&Ii.length>0)if(typeof Ii!="string"&&!ri.objectMode&&Object.getPrototypeOf(Ii)!==ie.prototype&&(Ii=le(Ii)),Et)ri.endEmitted?At(si,new $e):ei(si,ri,Ii,!0);else if(ri.ended)At(si,new _e);else{if(ri.destroyed)return!1;ri.reading=!1,ri.decoder&&!oi?(Ii=ri.decoder.write(Ii),ri.objectMode||Ii.length!==0?ei(si,ri,Ii,!1):pi(si,ri)):ei(si,ri,Ii,!1)}else Et||(ri.reading=!1,pi(si,ri))}return!ri.ended&&(ri.length<ri.highWaterMark||ri.length===0)}function ei(si,Ii,oi,Et){Ii.flowing&&Ii.length===0&&!Ii.sync?(Ii.awaitDrain=0,si.emit("data",oi)):(Ii.length+=Ii.objectMode?1:oi.length,Et?Ii.buffer.unshift(oi):Ii.buffer.push(oi),Ii.needReadable&&ai(si)),pi(si,Ii)}function Pt(si,Ii){var oi;return!Ie(Ii)&&typeof Ii!="string"&&Ii!==void 0&&!si.objectMode&&(oi=new xe("chunk",["string","Buffer","Uint8Array"],Ii)),oi}jt.prototype.isPaused=function(){return this._readableState.flowing===!1},jt.prototype.setEncoding=function(si){Ue||(Ue=r("string_decoder/").StringDecoder);var Ii=new Ue(si);this._readableState.decoder=Ii,this._readableState.encoding=this._readableState.decoder.encoding;for(var oi=this._readableState.buffer.head,Et="";oi!==null;)Et+=Ii.write(oi.data),oi=oi.next;return this._readableState.buffer.clear(),Et!==""&&this._readableState.buffer.push(Et),this._readableState.length=Et.length,this};var ni=1073741824;function gi(si){return si>=ni?si=ni:(si--,si|=si>>>1,si|=si>>>2,si|=si>>>4,si|=si>>>8,si|=si>>>16,si++),si}function di(si,Ii){return si<=0||Ii.length===0&&Ii.ended?0:Ii.objectMode?1:si!==si?Ii.flowing&&Ii.length?Ii.buffer.head.data.length:Ii.length:(si>Ii.highWaterMark&&(Ii.highWaterMark=gi(si)),si<=Ii.length?si:Ii.ended?Ii.length:(Ii.needReadable=!0,0))}jt.prototype.read=function(si){de("read",si),si=parseInt(si,10);var Ii=this._readableState,oi=si;if(si!==0&&(Ii.emittedReadable=!1),si===0&&Ii.needReadable&&((Ii.highWaterMark!==0?Ii.length>=Ii.highWaterMark:Ii.length>0)||Ii.ended))return de("read: emitReadable",Ii.length,Ii.ended),Ii.length===0&&Ii.ended?fi(this):ai(this),null;if(si=di(si,Ii),si===0&&Ii.ended)return Ii.length===0&&fi(this),null;var Et=Ii.needReadable;de("need readable",Et),(Ii.length===0||Ii.length-si<Ii.highWaterMark)&&(Et=!0,de("length less than watermark",Et)),Ii.ended||Ii.reading?(Et=!1,de("reading or ended",Et)):Et&&(de("do read"),Ii.reading=!0,Ii.sync=!0,Ii.length===0&&(Ii.needReadable=!0),this._read(Ii.highWaterMark),Ii.sync=!1,Ii.reading||(si=di(oi,Ii)));var ii;return si>0?ii=Mi(si,Ii):ii=null,ii===null?(Ii.needReadable=Ii.length<=Ii.highWaterMark,si=0):(Ii.length-=si,Ii.awaitDrain=0),Ii.length===0&&(Ii.ended||(Ii.needReadable=!0),oi!==si&&Ii.ended&&fi(this)),ii!==null&&this.emit("data",ii),ii};function li(si,Ii){if(de("onEofChunk"),!Ii.ended){if(Ii.decoder){var oi=Ii.decoder.end();oi&&oi.length&&(Ii.buffer.push(oi),Ii.length+=Ii.objectMode?1:oi.length)}Ii.ended=!0,Ii.sync?ai(si):(Ii.needReadable=!1,Ii.emittedReadable||(Ii.emittedReadable=!0,ci(si)))}}function ai(si){var Ii=si._readableState;de("emitReadable",Ii.needReadable,Ii.emittedReadable),Ii.needReadable=!1,Ii.emittedReadable||(de("emitReadable",Ii.flowing),Ii.emittedReadable=!0,V.nextTick(ci,si))}function ci(si){var Ii=si._readableState;de("emitReadable_",Ii.destroyed,Ii.length,Ii.ended),!Ii.destroyed&&(Ii.length||Ii.ended)&&(si.emit("readable"),Ii.emittedReadable=!1),Ii.needReadable=!Ii.flowing&&!Ii.ended&&Ii.length<=Ii.highWaterMark,Ni(si)}function pi(si,Ii){Ii.readingMore||(Ii.readingMore=!0,V.nextTick(yi,si,Ii))}function yi(si,Ii){for(;!Ii.reading&&!Ii.ended&&(Ii.length<Ii.highWaterMark||Ii.flowing&&Ii.length===0);){var oi=Ii.length;if(de("maybeReadMore read 0"),si.read(0),oi===Ii.length)break}Ii.readingMore=!1}jt.prototype._read=function(si){At(this,new Dt("_read()"))},jt.prototype.pipe=function(si,Ii){var oi=this,Et=this._readableState;switch(Et.pipesCount){case 0:Et.pipes=si;break;case 1:Et.pipes=[Et.pipes,si];break;default:Et.pipes.push(si);break}Et.pipesCount+=1,de("pipe count=%d opts=%j",Et.pipesCount,Ii);var ii=(!Ii||Ii.end!==!1)&&si!==V.stdout&&si!==V.stderr,ri=ii?vi:Wi;Et.endEmitted?V.nextTick(ri):oi.once("end",ri),si.on("unpipe",ui);function ui(ki,Ri){de("onunpipe"),ki===oi&&Ri&&Ri.hasUnpiped===!1&&(Ri.hasUnpiped=!0,Gi())}function vi(){de("onend"),si.end()}var bi=Ai(oi);si.on("drain",bi);var Zi=!1;function Gi(){de("cleanup"),si.removeListener("close",xi),si.removeListener("finish",Li),si.removeListener("drain",bi),si.removeListener("error",Oi),si.removeListener("unpipe",ui),oi.removeListener("end",vi),oi.removeListener("end",Wi),oi.removeListener("data",Yi),Zi=!0,Et.awaitDrain&&(!si._writableState||si._writableState.needDrain)&&bi()}oi.on("data",Yi);function Yi(ki){de("ondata");var Ri=si.write(ki);de("dest.write",Ri),Ri===!1&&((Et.pipesCount===1&&Et.pipes===si||Et.pipesCount>1&&Si(Et.pipes,si)!==-1)&&!Zi&&(de("false write response, pause",Et.awaitDrain),Et.awaitDrain++),oi.pause())}function Oi(ki){de("onerror",ki),Wi(),si.removeListener("error",Oi),re(si,"error")===0&&At(si,ki)}Lt(si,"error",Oi);function xi(){si.removeListener("finish",Li),Wi()}si.once("close",xi);function Li(){de("onfinish"),si.removeListener("close",xi),Wi()}si.once("finish",Li);function Wi(){de("unpipe"),oi.unpipe(si)}return si.emit("pipe",oi),Et.flowing||(de("pipe resume"),oi.resume()),si};function Ai(si){return function(){var oi=si._readableState;de("pipeOnDrain",oi.awaitDrain),oi.awaitDrain&&oi.awaitDrain--,oi.awaitDrain===0&&re(si,"data")&&(oi.flowing=!0,Ni(si))}}jt.prototype.unpipe=function(si){var Ii=this._readableState,oi={hasUnpiped:!1};if(Ii.pipesCount===0)return this;if(Ii.pipesCount===1)return si&&si!==Ii.pipes?this:(si||(si=Ii.pipes),Ii.pipes=null,Ii.pipesCount=0,Ii.flowing=!1,si&&si.emit("unpipe",this,oi),this);if(!si){var Et=Ii.pipes,ii=Ii.pipesCount;Ii.pipes=null,Ii.pipesCount=0,Ii.flowing=!1;for(var ri=0;ri<ii;ri++)Et[ri].emit("unpipe",this,{hasUnpiped:!1});return this}var ui=Si(Ii.pipes,si);return ui===-1?this:(Ii.pipes.splice(ui,1),Ii.pipesCount-=1,Ii.pipesCount===1&&(Ii.pipes=Ii.pipes[0]),si.emit("unpipe",this,oi),this)},jt.prototype.on=function(si,Ii){var oi=Ce.prototype.on.call(this,si,Ii),Et=this._readableState;return si==="data"?(Et.readableListening=this.listenerCount("readable")>0,Et.flowing!==!1&&this.resume()):si==="readable"&&!Et.endEmitted&&!Et.readableListening&&(Et.readableListening=Et.needReadable=!0,Et.flowing=!1,Et.emittedReadable=!1,de("on readable",Et.length,Et.reading),Et.length?ai(this):Et.reading||V.nextTick(wi,this)),oi},jt.prototype.addListener=jt.prototype.on,jt.prototype.removeListener=function(si,Ii){var oi=Ce.prototype.removeListener.call(this,si,Ii);return si==="readable"&&V.nextTick(hi,this),oi},jt.prototype.removeAllListeners=function(si){var Ii=Ce.prototype.removeAllListeners.apply(this,arguments);return(si==="readable"||si===void 0)&&V.nextTick(hi,this),Ii};function hi(si){var Ii=si._readableState;Ii.readableListening=si.listenerCount("readable")>0,Ii.resumeScheduled&&!Ii.paused?Ii.flowing=!0:si.listenerCount("data")>0&&si.resume()}function wi(si){de("readable nexttick read 0"),si.read(0)}jt.prototype.resume=function(){var si=this._readableState;return si.flowing||(de("resume"),si.flowing=!si.readableListening,Ci(this,si)),si.paused=!1,this};function Ci(si,Ii){Ii.resumeScheduled||(Ii.resumeScheduled=!0,V.nextTick(mi,si,Ii))}function mi(si,Ii){de("resume",Ii.reading),Ii.reading||si.read(0),Ii.resumeScheduled=!1,si.emit("resume"),Ni(si),Ii.flowing&&!Ii.reading&&si.read(0)}jt.prototype.pause=function(){return de("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(de("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ni(si){var Ii=si._readableState;for(de("flow",Ii.flowing);Ii.flowing&&si.read()!==null;);}jt.prototype.wrap=function(si){var Ii=this,oi=this._readableState,Et=!1;si.on("end",function(){if(de("wrapped end"),oi.decoder&&!oi.ended){var ui=oi.decoder.end();ui&&ui.length&&Ii.push(ui)}Ii.push(null)}),si.on("data",function(ui){if(de("wrapped data"),oi.decoder&&(ui=oi.decoder.write(ui)),!(oi.objectMode&&ui==null)&&!(!oi.objectMode&&(!ui||!ui.length))){var vi=Ii.push(ui);vi||(Et=!0,si.pause())}});for(var ii in si)this[ii]===void 0&&typeof si[ii]=="function"&&(this[ii]=function(vi){return function(){return si[vi].apply(si,arguments)}}(ii));for(var ri=0;ri<qe.length;ri++)si.on(qe[ri],this.emit.bind(this,qe[ri]));return this._read=function(ui){de("wrapped _read",ui),Et&&(Et=!1,si.resume())},this},typeof Symbol=="function"&&(jt.prototype[Symbol.asyncIterator]=function(){return Ve===void 0&&(Ve=r("./internal/streams/async_iterator")),Ve(this)}),Object.defineProperty(jt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(jt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(jt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Ii){this._readableState&&(this._readableState.flowing=Ii)}}),jt._fromList=Mi,Object.defineProperty(jt.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Mi(si,Ii){if(Ii.length===0)return null;var oi;return Ii.objectMode?oi=Ii.buffer.shift():!si||si>=Ii.length?(Ii.decoder?oi=Ii.buffer.join(""):Ii.buffer.length===1?oi=Ii.buffer.first():oi=Ii.buffer.concat(Ii.length),Ii.buffer.clear()):oi=Ii.buffer.consume(si,Ii.decoder),oi}function fi(si){var Ii=si._readableState;de("endReadable",Ii.endEmitted),Ii.endEmitted||(Ii.ended=!0,V.nextTick(zi,Ii,si))}function zi(si,Ii){if(de("endReadableNT",si.endEmitted,si.length),!si.endEmitted&&si.length===0&&(si.endEmitted=!0,Ii.readable=!1,Ii.emit("end"),si.autoDestroy)){var oi=Ii._writableState;(!oi||oi.autoDestroy&&oi.finished)&&Ii.destroy()}}typeof Symbol=="function"&&(jt.from=function(si,Ii){return Oe===void 0&&(Oe=r("./internal/streams/from")),Oe(jt,si,Ii)});function Si(si,Ii){for(var oi=0,Et=si.length;oi<Et;oi++)if(si[oi]===Ii)return oi;return-1}}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/async_iterator":61,"./internal/streams/buffer_list":62,"./internal/streams/destroy":63,"./internal/streams/from":65,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,events:22,inherits:24,"string_decoder/":75,util:16}],59:[function(r,g,k){g.exports=le;var V=r("../errors").codes,$=V.ERR_METHOD_NOT_IMPLEMENTED,oe=V.ERR_MULTIPLE_CALLBACK,re=V.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ce=V.ERR_TRANSFORM_WITH_LENGTH_0,ie=r("./_stream_duplex");r("inherits")(le,ie);function ae(de,Ne){var he=this._transformState;he.transforming=!1;var pe=he.writecb;if(pe===null)return this.emit("error",new oe);he.writechunk=null,he.writecb=null,Ne!=null&&this.push(Ne),pe(de);var ze=this._readableState;ze.reading=!1,(ze.needReadable||ze.length<ze.highWaterMark)&&this._read(ze.highWaterMark)}function le(de){if(!(this instanceof le))return new le(de);ie.call(this,de),this._transformState={afterTransform:ae.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,de&&(typeof de.transform=="function"&&(this._transform=de.transform),typeof de.flush=="function"&&(this._flush=de.flush)),this.on("prefinish",Ie)}function Ie(){var de=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(Ne,he){ue(de,Ne,he)}):ue(this,null,null)}le.prototype.push=function(de,Ne){return this._transformState.needTransform=!1,ie.prototype.push.call(this,de,Ne)},le.prototype._transform=function(de,Ne,he){he(new $("_transform()"))},le.prototype._write=function(de,Ne,he){var pe=this._transformState;if(pe.writecb=he,pe.writechunk=de,pe.writeencoding=Ne,!pe.transforming){var ze=this._readableState;(pe.needTransform||ze.needReadable||ze.length<ze.highWaterMark)&&this._read(ze.highWaterMark)}},le.prototype._read=function(de){var Ne=this._transformState;Ne.writechunk!==null&&!Ne.transforming?(Ne.transforming=!0,this._transform(Ne.writechunk,Ne.writeencoding,Ne.afterTransform)):Ne.needTransform=!0},le.prototype._destroy=function(de,Ne){ie.prototype._destroy.call(this,de,function(he){Ne(he)})};function ue(de,Ne,he){if(Ne)return de.emit("error",Ne);if(he!=null&&de.push(he),de._writableState.length)throw new Ce;if(de._transformState.transforming)throw new re;return de.push(null)}},{"../errors":55,"./_stream_duplex":56,inherits:24}],60:[function(r,g,k){(function(V,$){(function(){g.exports=kt;function oe(Ni){var Mi=this;this.next=null,this.entry=null,this.finish=function(){mi(Mi,Ni)}}var re;kt.WritableState=qe;var Ce={deprecate:r("util-deprecate")},ie=r("./internal/streams/stream"),ae=r("buffer").Buffer,le=$.Uint8Array||function(){};function Ie(Ni){return ae.from(Ni)}function ue(Ni){return ae.isBuffer(Ni)||Ni instanceof le}var de=r("./internal/streams/destroy"),Ne=r("./internal/streams/state"),he=Ne.getHighWaterMark,pe=r("../errors").codes,ze=pe.ERR_INVALID_ARG_TYPE,Fe=pe.ERR_METHOD_NOT_IMPLEMENTED,xe=pe.ERR_MULTIPLE_CALLBACK,_e=pe.ERR_STREAM_CANNOT_PIPE,Dt=pe.ERR_STREAM_DESTROYED,$e=pe.ERR_STREAM_NULL_VALUES,Ue=pe.ERR_STREAM_WRITE_AFTER_END,Ve=pe.ERR_UNKNOWN_ENCODING,Oe=de.errorOrDestroy;r("inherits")(kt,ie);function At(){}function qe(Ni,Mi,fi){re=re||r("./_stream_duplex"),Ni=Ni||{},typeof fi!="boolean"&&(fi=Mi instanceof re),this.objectMode=!!Ni.objectMode,fi&&(this.objectMode=this.objectMode||!!Ni.writableObjectMode),this.highWaterMark=he(this,Ni,"writableHighWaterMark",fi),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var zi=Ni.decodeStrings===!1;this.decodeStrings=!zi,this.defaultEncoding=Ni.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Si){li(Mi,Si)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Ni.emitClose!==!1,this.autoDestroy=!!Ni.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new oe(this)}qe.prototype.getBuffer=function(){for(var Mi=this.bufferedRequest,fi=[];Mi;)fi.push(Mi),Mi=Mi.next;return fi},function(){try{Object.defineProperty(qe.prototype,"buffer",{get:Ce.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Lt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Lt=Function.prototype[Symbol.hasInstance],Object.defineProperty(kt,Symbol.hasInstance,{value:function(Mi){return Lt.call(this,Mi)?!0:this!==kt?!1:Mi&&Mi._writableState instanceof qe}})):Lt=function(Mi){return Mi instanceof this};function kt(Ni){re=re||r("./_stream_duplex");var Mi=this instanceof re;if(!Mi&&!Lt.call(kt,this))return new kt(Ni);this._writableState=new qe(Ni,this,Mi),this.writable=!0,Ni&&(typeof Ni.write=="function"&&(this._write=Ni.write),typeof Ni.writev=="function"&&(this._writev=Ni.writev),typeof Ni.destroy=="function"&&(this._destroy=Ni.destroy),typeof Ni.final=="function"&&(this._final=Ni.final)),ie.call(this)}kt.prototype.pipe=function(){Oe(this,new _e)};function jt(Ni,Mi){var fi=new Ue;Oe(Ni,fi),V.nextTick(Mi,fi)}function ti(Ni,Mi,fi,zi){var Si;return fi===null?Si=new $e:typeof fi!="string"&&!Mi.objectMode&&(Si=new ze("chunk",["string","Buffer"],fi)),Si?(Oe(Ni,Si),V.nextTick(zi,Si),!1):!0}kt.prototype.write=function(Ni,Mi,fi){var zi=this._writableState,Si=!1,si=!zi.objectMode&&ue(Ni);return si&&!ae.isBuffer(Ni)&&(Ni=Ie(Ni)),typeof Mi=="function"&&(fi=Mi,Mi=null),si?Mi="buffer":Mi||(Mi=zi.defaultEncoding),typeof fi!="function"&&(fi=At),zi.ending?jt(this,fi):(si||ti(this,zi,Ni,fi))&&(zi.pendingcb++,Si=Pt(this,zi,si,Ni,Mi,fi)),Si},kt.prototype.cork=function(){this._writableState.corked++},kt.prototype.uncork=function(){var Ni=this._writableState;Ni.corked&&(Ni.corked--,!Ni.writing&&!Ni.corked&&!Ni.bufferProcessing&&Ni.bufferedRequest&&pi(this,Ni))},kt.prototype.setDefaultEncoding=function(Mi){if(typeof Mi=="string"&&(Mi=Mi.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Mi+"").toLowerCase())>-1))throw new Ve(Mi);return this._writableState.defaultEncoding=Mi,this},Object.defineProperty(kt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ei(Ni,Mi,fi){return!Ni.objectMode&&Ni.decodeStrings!==!1&&typeof Mi=="string"&&(Mi=ae.from(Mi,fi)),Mi}Object.defineProperty(kt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Pt(Ni,Mi,fi,zi,Si,si){if(!fi){var Ii=ei(Mi,zi,Si);zi!==Ii&&(fi=!0,Si="buffer",zi=Ii)}var oi=Mi.objectMode?1:zi.length;Mi.length+=oi;var Et=Mi.length<Mi.highWaterMark;if(Et||(Mi.needDrain=!0),Mi.writing||Mi.corked){var ii=Mi.lastBufferedRequest;Mi.lastBufferedRequest={chunk:zi,encoding:Si,isBuf:fi,callback:si,next:null},ii?ii.next=Mi.lastBufferedRequest:Mi.bufferedRequest=Mi.lastBufferedRequest,Mi.bufferedRequestCount+=1}else ni(Ni,Mi,!1,oi,zi,Si,si);return Et}function ni(Ni,Mi,fi,zi,Si,si,Ii){Mi.writelen=zi,Mi.writecb=Ii,Mi.writing=!0,Mi.sync=!0,Mi.destroyed?Mi.onwrite(new Dt("write")):fi?Ni._writev(Si,Mi.onwrite):Ni._write(Si,si,Mi.onwrite),Mi.sync=!1}function gi(Ni,Mi,fi,zi,Si){--Mi.pendingcb,fi?(V.nextTick(Si,zi),V.nextTick(wi,Ni,Mi),Ni._writableState.errorEmitted=!0,Oe(Ni,zi)):(Si(zi),Ni._writableState.errorEmitted=!0,Oe(Ni,zi),wi(Ni,Mi))}function di(Ni){Ni.writing=!1,Ni.writecb=null,Ni.length-=Ni.writelen,Ni.writelen=0}function li(Ni,Mi){var fi=Ni._writableState,zi=fi.sync,Si=fi.writecb;if(typeof Si!="function")throw new xe;if(di(fi),Mi)gi(Ni,fi,zi,Mi,Si);else{var si=yi(fi)||Ni.destroyed;!si&&!fi.corked&&!fi.bufferProcessing&&fi.bufferedRequest&&pi(Ni,fi),zi?V.nextTick(ai,Ni,fi,si,Si):ai(Ni,fi,si,Si)}}function ai(Ni,Mi,fi,zi){fi||ci(Ni,Mi),Mi.pendingcb--,zi(),wi(Ni,Mi)}function ci(Ni,Mi){Mi.length===0&&Mi.needDrain&&(Mi.needDrain=!1,Ni.emit("drain"))}function pi(Ni,Mi){Mi.bufferProcessing=!0;var fi=Mi.bufferedRequest;if(Ni._writev&&fi&&fi.next){var zi=Mi.bufferedRequestCount,Si=new Array(zi),si=Mi.corkedRequestsFree;si.entry=fi;for(var Ii=0,oi=!0;fi;)Si[Ii]=fi,fi.isBuf||(oi=!1),fi=fi.next,Ii+=1;Si.allBuffers=oi,ni(Ni,Mi,!0,Mi.length,Si,"",si.finish),Mi.pendingcb++,Mi.lastBufferedRequest=null,si.next?(Mi.corkedRequestsFree=si.next,si.next=null):Mi.corkedRequestsFree=new oe(Mi),Mi.bufferedRequestCount=0}else{for(;fi;){var Et=fi.chunk,ii=fi.encoding,ri=fi.callback,ui=Mi.objectMode?1:Et.length;if(ni(Ni,Mi,!1,ui,Et,ii,ri),fi=fi.next,Mi.bufferedRequestCount--,Mi.writing)break}fi===null&&(Mi.lastBufferedRequest=null)}Mi.bufferedRequest=fi,Mi.bufferProcessing=!1}kt.prototype._write=function(Ni,Mi,fi){fi(new Fe("_write()"))},kt.prototype._writev=null,kt.prototype.end=function(Ni,Mi,fi){var zi=this._writableState;return typeof Ni=="function"?(fi=Ni,Ni=null,Mi=null):typeof Mi=="function"&&(fi=Mi,Mi=null),Ni!=null&&this.write(Ni,Mi),zi.corked&&(zi.corked=1,this.uncork()),zi.ending||Ci(this,zi,fi),this},Object.defineProperty(kt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function yi(Ni){return Ni.ending&&Ni.length===0&&Ni.bufferedRequest===null&&!Ni.finished&&!Ni.writing}function Ai(Ni,Mi){Ni._final(function(fi){Mi.pendingcb--,fi&&Oe(Ni,fi),Mi.prefinished=!0,Ni.emit("prefinish"),wi(Ni,Mi)})}function hi(Ni,Mi){!Mi.prefinished&&!Mi.finalCalled&&(typeof Ni._final=="function"&&!Mi.destroyed?(Mi.pendingcb++,Mi.finalCalled=!0,V.nextTick(Ai,Ni,Mi)):(Mi.prefinished=!0,Ni.emit("prefinish")))}function wi(Ni,Mi){var fi=yi(Mi);if(fi&&(hi(Ni,Mi),Mi.pendingcb===0&&(Mi.finished=!0,Ni.emit("finish"),Mi.autoDestroy))){var zi=Ni._readableState;(!zi||zi.autoDestroy&&zi.endEmitted)&&Ni.destroy()}return fi}function Ci(Ni,Mi,fi){Mi.ending=!0,wi(Ni,Mi),fi&&(Mi.finished?V.nextTick(fi):Ni.once("finish",fi)),Mi.ended=!0,Ni.writable=!1}function mi(Ni,Mi,fi){var zi=Ni.entry;for(Ni.entry=null;zi;){var Si=zi.callback;Mi.pendingcb--,Si(fi),zi=zi.next}Mi.corkedRequestsFree.next=Ni}Object.defineProperty(kt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Mi){this._writableState&&(this._writableState.destroyed=Mi)}}),kt.prototype.destroy=de.destroy,kt.prototype._undestroy=de.undestroy,kt.prototype._destroy=function(Ni,Mi){Mi(Ni)}}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/destroy":63,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,inherits:24,"util-deprecate":78}],61:[function(r,g,k){(function(V){(function(){var $;function oe(Dt,$e,Ue){return $e in Dt?Object.defineProperty(Dt,$e,{value:Ue,enumerable:!0,configurable:!0,writable:!0}):Dt[$e]=Ue,Dt}var re=r("./end-of-stream"),Ce=Symbol("lastResolve"),ie=Symbol("lastReject"),ae=Symbol("error"),le=Symbol("ended"),Ie=Symbol("lastPromise"),ue=Symbol("handlePromise"),de=Symbol("stream");function Ne(Dt,$e){return{value:Dt,done:$e}}function he(Dt){var $e=Dt[Ce];if($e!==null){var Ue=Dt[de].read();Ue!==null&&(Dt[Ie]=null,Dt[Ce]=null,Dt[ie]=null,$e(Ne(Ue,!1)))}}function pe(Dt){V.nextTick(he,Dt)}function ze(Dt,$e){return function(Ue,Ve){Dt.then(function(){if($e[le]){Ue(Ne(void 0,!0));return}$e[ue](Ue,Ve)},Ve)}}var Fe=Object.getPrototypeOf(function(){}),xe=Object.setPrototypeOf(($={get stream(){return this[de]},next:function(){var $e=this,Ue=this[ae];if(Ue!==null)return Promise.reject(Ue);if(this[le])return Promise.resolve(Ne(void 0,!0));if(this[de].destroyed)return new Promise(function(qe,Lt){V.nextTick(function(){$e[ae]?Lt($e[ae]):qe(Ne(void 0,!0))})});var Ve=this[Ie],Oe;if(Ve)Oe=new Promise(ze(Ve,this));else{var At=this[de].read();if(At!==null)return Promise.resolve(Ne(At,!1));Oe=new Promise(this[ue])}return this[Ie]=Oe,Oe}},oe($,Symbol.asyncIterator,function(){return this}),oe($,"return",function(){var $e=this;return new Promise(function(Ue,Ve){$e[de].destroy(null,function(Oe){if(Oe){Ve(Oe);return}Ue(Ne(void 0,!0))})})}),$),Fe),_e=function($e){var Ue,Ve=Object.create(xe,(Ue={},oe(Ue,de,{value:$e,writable:!0}),oe(Ue,Ce,{value:null,writable:!0}),oe(Ue,ie,{value:null,writable:!0}),oe(Ue,ae,{value:null,writable:!0}),oe(Ue,le,{value:$e._readableState.endEmitted,writable:!0}),oe(Ue,ue,{value:function(At,qe){var Lt=Ve[de].read();Lt?(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,At(Ne(Lt,!1))):(Ve[Ce]=At,Ve[ie]=qe)},writable:!0}),Ue));return Ve[Ie]=null,re($e,function(Oe){if(Oe&&Oe.code!=="ERR_STREAM_PREMATURE_CLOSE"){var At=Ve[ie];At!==null&&(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,At(Oe)),Ve[ae]=Oe;return}var qe=Ve[Ce];qe!==null&&(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,qe(Ne(void 0,!0))),Ve[le]=!0}),$e.on("readable",pe.bind(null,Ve)),Ve};g.exports=_e}).call(this)}).call(this,r("_process"))},{"./end-of-stream":64,_process:50}],62:[function(r,g,k){function V(he,pe){var ze=Object.keys(he);if(Object.getOwnPropertySymbols){var Fe=Object.getOwnPropertySymbols(he);pe&&(Fe=Fe.filter(function(xe){return Object.getOwnPropertyDescriptor(he,xe).enumerable})),ze.push.apply(ze,Fe)}return ze}function $(he){for(var pe=1;pe<arguments.length;pe++){var ze=arguments[pe]!=null?arguments[pe]:{};pe%2?V(Object(ze),!0).forEach(function(Fe){oe(he,Fe,ze[Fe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(he,Object.getOwnPropertyDescriptors(ze)):V(Object(ze)).forEach(function(Fe){Object.defineProperty(he,Fe,Object.getOwnPropertyDescriptor(ze,Fe))})}return he}function oe(he,pe,ze){return pe in he?Object.defineProperty(he,pe,{value:ze,enumerable:!0,configurable:!0,writable:!0}):he[pe]=ze,he}function re(he,pe){if(!(he instanceof pe))throw new TypeError("Cannot call a class as a function")}function Ce(he,pe){for(var ze=0;ze<pe.length;ze++){var Fe=pe[ze];Fe.enumerable=Fe.enumerable||!1,Fe.configurable=!0,"value"in Fe&&(Fe.writable=!0),Object.defineProperty(he,Fe.key,Fe)}}function ie(he,pe,ze){return pe&&Ce(he.prototype,pe),ze&&Ce(he,ze),he}var ae=r("buffer"),le=ae.Buffer,Ie=r("util"),ue=Ie.inspect,de=ue&&ue.custom||"inspect";function Ne(he,pe,ze){le.prototype.copy.call(he,pe,ze)}g.exports=function(){function he(){re(this,he),this.head=null,this.tail=null,this.length=0}return ie(he,[{key:"push",value:function(ze){var Fe={data:ze,next:null};this.length>0?this.tail.next=Fe:this.head=Fe,this.tail=Fe,++this.length}},{key:"unshift",value:function(ze){var Fe={data:ze,next:this.head};this.length===0&&(this.tail=Fe),this.head=Fe,++this.length}},{key:"shift",value:function(){if(this.length!==0){var ze=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ze}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(ze){if(this.length===0)return"";for(var Fe=this.head,xe=""+Fe.data;Fe=Fe.next;)xe+=ze+Fe.data;return xe}},{key:"concat",value:function(ze){if(this.length===0)return le.alloc(0);for(var Fe=le.allocUnsafe(ze>>>0),xe=this.head,_e=0;xe;)Ne(xe.data,Fe,_e),_e+=xe.data.length,xe=xe.next;return Fe}},{key:"consume",value:function(ze,Fe){var xe;return ze<this.head.data.length?(xe=this.head.data.slice(0,ze),this.head.data=this.head.data.slice(ze)):ze===this.head.data.length?xe=this.shift():xe=Fe?this._getString(ze):this._getBuffer(ze),xe}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(ze){var Fe=this.head,xe=1,_e=Fe.data;for(ze-=_e.length;Fe=Fe.next;){var Dt=Fe.data,$e=ze>Dt.length?Dt.length:ze;if($e===Dt.length?_e+=Dt:_e+=Dt.slice(0,ze),ze-=$e,ze===0){$e===Dt.length?(++xe,Fe.next?this.head=Fe.next:this.head=this.tail=null):(this.head=Fe,Fe.data=Dt.slice($e));break}++xe}return this.length-=xe,_e}},{key:"_getBuffer",value:function(ze){var Fe=le.allocUnsafe(ze),xe=this.head,_e=1;for(xe.data.copy(Fe),ze-=xe.data.length;xe=xe.next;){var Dt=xe.data,$e=ze>Dt.length?Dt.length:ze;if(Dt.copy(Fe,Fe.length-ze,0,$e),ze-=$e,ze===0){$e===Dt.length?(++_e,xe.next?this.head=xe.next:this.head=this.tail=null):(this.head=xe,xe.data=Dt.slice($e));break}++_e}return this.length-=_e,Fe}},{key:de,value:function(ze,Fe){return ue(this,$({},Fe,{depth:0,customInspect:!1}))}}]),he}()},{buffer:17,util:16}],63:[function(r,g,k){(function(V){(function(){function $(le,Ie){var ue=this,de=this._readableState&&this._readableState.destroyed,Ne=this._writableState&&this._writableState.destroyed;return de||Ne?(Ie?Ie(le):le&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,V.nextTick(ie,this,le)):V.nextTick(ie,this,le)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(le||null,function(he){!Ie&&he?ue._writableState?ue._writableState.errorEmitted?V.nextTick(re,ue):(ue._writableState.errorEmitted=!0,V.nextTick(oe,ue,he)):V.nextTick(oe,ue,he):Ie?(V.nextTick(re,ue),Ie(he)):V.nextTick(re,ue)}),this)}function oe(le,Ie){ie(le,Ie),re(le)}function re(le){le._writableState&&!le._writableState.emitClose||le._readableState&&!le._readableState.emitClose||le.emit("close")}function Ce(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function ie(le,Ie){le.emit("error",Ie)}function ae(le,Ie){var ue=le._readableState,de=le._writableState;ue&&ue.autoDestroy||de&&de.autoDestroy?le.destroy(Ie):le.emit("error",Ie)}g.exports={destroy:$,undestroy:Ce,errorOrDestroy:ae}}).call(this)}).call(this,r("_process"))},{_process:50}],64:[function(r,g,k){var V=r("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function $(ie){var ae=!1;return function(){if(!ae){ae=!0;for(var le=arguments.length,Ie=new Array(le),ue=0;ue<le;ue++)Ie[ue]=arguments[ue];ie.apply(this,Ie)}}}function oe(){}function re(ie){return ie.setHeader&&typeof ie.abort=="function"}function Ce(ie,ae,le){if(typeof ae=="function")return Ce(ie,null,ae);ae||(ae={}),le=$(le||oe);var Ie=ae.readable||ae.readable!==!1&&ie.readable,ue=ae.writable||ae.writable!==!1&&ie.writable,de=function(){ie.writable||he()},Ne=ie._writableState&&ie._writableState.finished,he=function(){ue=!1,Ne=!0,Ie||le.call(ie)},pe=ie._readableState&&ie._readableState.endEmitted,ze=function(){Ie=!1,pe=!0,ue||le.call(ie)},Fe=function($e){le.call(ie,$e)},xe=function(){var $e;if(Ie&&!pe)return(!ie._readableState||!ie._readableState.ended)&&($e=new V),le.call(ie,$e);if(ue&&!Ne)return(!ie._writableState||!ie._writableState.ended)&&($e=new V),le.call(ie,$e)},_e=function(){ie.req.on("finish",he)};return re(ie)?(ie.on("complete",he),ie.on("abort",xe),ie.req?_e():ie.on("request",_e)):ue&&!ie._writableState&&(ie.on("end",de),ie.on("close",de)),ie.on("end",ze),ie.on("finish",he),ae.error!==!1&&ie.on("error",Fe),ie.on("close",xe),function(){ie.removeListener("complete",he),ie.removeListener("abort",xe),ie.removeListener("request",_e),ie.req&&ie.req.removeListener("finish",he),ie.removeListener("end",de),ie.removeListener("close",de),ie.removeListener("finish",he),ie.removeListener("end",ze),ie.removeListener("error",Fe),ie.removeListener("close",xe)}}g.exports=Ce},{"../../../errors":55}],65:[function(r,g,k){g.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],66:[function(r,g,k){var V;function $(he){var pe=!1;return function(){pe||(pe=!0,he.apply(void 0,arguments))}}var oe=r("../../../errors").codes,re=oe.ERR_MISSING_ARGS,Ce=oe.ERR_STREAM_DESTROYED;function ie(he){if(he)throw he}function ae(he){return he.setHeader&&typeof he.abort=="function"}function le(he,pe,ze,Fe){Fe=$(Fe);var xe=!1;he.on("close",function(){xe=!0}),V===void 0&&(V=r("./end-of-stream")),V(he,{readable:pe,writable:ze},function(Dt){if(Dt)return Fe(Dt);xe=!0,Fe()});var _e=!1;return function(Dt){if(!xe&&!_e){if(_e=!0,ae(he))return he.abort();if(typeof he.destroy=="function")return he.destroy();Fe(Dt||new Ce("pipe"))}}}function Ie(he){he()}function ue(he,pe){return he.pipe(pe)}function de(he){return!he.length||typeof he[he.length-1]!="function"?ie:he.pop()}function Ne(){for(var he=arguments.length,pe=new Array(he),ze=0;ze<he;ze++)pe[ze]=arguments[ze];var Fe=de(pe);if(Array.isArray(pe[0])&&(pe=pe[0]),pe.length<2)throw new re("streams");var xe,_e=pe.map(function(Dt,$e){var Ue=$e<pe.length-1,Ve=$e>0;return le(Dt,Ue,Ve,function(Oe){xe||(xe=Oe),Oe&&_e.forEach(Ie),!Ue&&(_e.forEach(Ie),Fe(xe))})});return pe.reduce(ue)}g.exports=Ne},{"../../../errors":55,"./end-of-stream":64}],67:[function(r,g,k){var V=r("../../../errors").codes.ERR_INVALID_OPT_VALUE;function $(re,Ce,ie){return re.highWaterMark!=null?re.highWaterMark:Ce?re[ie]:null}function oe(re,Ce,ie,ae){var le=$(Ce,ae,ie);if(le!=null){if(!(isFinite(le)&&Math.floor(le)===le)||le<0){var Ie=ae?ie:"highWaterMark";throw new V(Ie,le)}return Math.floor(le)}return re.objectMode?16:16*1024}g.exports={getHighWaterMark:oe}},{"../../../errors":55}],68:[function(r,g,k){g.exports=r("events").EventEmitter},{events:22}],69:[function(r,g,k){k=g.exports=r("./lib/_stream_readable.js"),k.Stream=k,k.Readable=k,k.Writable=r("./lib/_stream_writable.js"),k.Duplex=r("./lib/_stream_duplex.js"),k.Transform=r("./lib/_stream_transform.js"),k.PassThrough=r("./lib/_stream_passthrough.js"),k.finished=r("./lib/internal/streams/end-of-stream.js"),k.pipeline=r("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":56,"./lib/_stream_passthrough.js":57,"./lib/_stream_readable.js":58,"./lib/_stream_transform.js":59,"./lib/_stream_writable.js":60,"./lib/internal/streams/end-of-stream.js":64,"./lib/internal/streams/pipeline.js":66}],70:[function(r,g,k){function V(oe,re,Ce){var ie=this;this._callback=oe,this._args=Ce,this._interval=setInterval(oe,re,this._args),this.reschedule=function(ae){ae||(ae=ie._interval),ie._interval&&clearInterval(ie._interval),ie._interval=setInterval(ie._callback,ae,ie._args)},this.clear=function(){ie._interval&&(clearInterval(ie._interval),ie._interval=void 0)},this.destroy=function(){ie._interval&&clearInterval(ie._interval),ie._callback=void 0,ie._interval=void 0,ie._args=void 0}}function $(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var oe;if(arguments.length>0){oe=new Array(arguments.length-2);for(var re=0;re<oe.length;re++)oe[re]=arguments[re+2]}return new V(arguments[0],arguments[1],oe)}g.exports=$},{}],71:[function(r,g,k){g.exports=r("./index.js")()},{"./index.js":72}],72:[function(r,g,k){(function(V){(function(){g.exports=oe;function $(Ce){return Ce instanceof V?V.from(Ce):new Ce.constructor(Ce.buffer.slice(),Ce.byteOffset,Ce.length)}function oe(Ce){if(Ce=Ce||{},Ce.circles)return re(Ce);return Ce.proto?le:ae;function ie(Ie,ue){for(var de=Object.keys(Ie),Ne=new Array(de.length),he=0;he<de.length;he++){var pe=de[he],ze=Ie[pe];typeof ze!="object"||ze===null?Ne[pe]=ze:ze instanceof Date?Ne[pe]=new Date(ze):ArrayBuffer.isView(ze)?Ne[pe]=$(ze):Ne[pe]=ue(ze)}return Ne}function ae(Ie){if(typeof Ie!="object"||Ie===null)return Ie;if(Ie instanceof Date)return new Date(Ie);if(Array.isArray(Ie))return ie(Ie,ae);if(Ie instanceof Map)return new Map(ie(Array.from(Ie),ae));if(Ie instanceof Set)return new Set(ie(Array.from(Ie),ae));var ue={};for(var de in Ie)if(Object.hasOwnProperty.call(Ie,de)!==!1){var Ne=Ie[de];typeof Ne!="object"||Ne===null?ue[de]=Ne:Ne instanceof Date?ue[de]=new Date(Ne):Ne instanceof Map?ue[de]=new Map(ie(Array.from(Ne),ae)):Ne instanceof Set?ue[de]=new Set(ie(Array.from(Ne),ae)):ArrayBuffer.isView(Ne)?ue[de]=$(Ne):ue[de]=ae(Ne)}return ue}function le(Ie){if(typeof Ie!="object"||Ie===null)return Ie;if(Ie instanceof Date)return new Date(Ie);if(Array.isArray(Ie))return ie(Ie,le);if(Ie instanceof Map)return new Map(ie(Array.from(Ie),le));if(Ie instanceof Set)return new Set(ie(Array.from(Ie),le));var ue={};for(var de in Ie){var Ne=Ie[de];typeof Ne!="object"||Ne===null?ue[de]=Ne:Ne instanceof Date?ue[de]=new Date(Ne):Ne instanceof Map?ue[de]=new Map(ie(Array.from(Ne),le)):Ne instanceof Set?ue[de]=new Set(ie(Array.from(Ne),le)):ArrayBuffer.isView(Ne)?ue[de]=$(Ne):ue[de]=le(Ne)}return ue}}function re(Ce){var ie=[],ae=[];return Ce.proto?ue:Ie;function le(de,Ne){for(var he=Object.keys(de),pe=new Array(he.length),ze=0;ze<he.length;ze++){var Fe=he[ze],xe=de[Fe];if(typeof xe!="object"||xe===null)pe[Fe]=xe;else if(xe instanceof Date)pe[Fe]=new Date(xe);else if(ArrayBuffer.isView(xe))pe[Fe]=$(xe);else{var _e=ie.indexOf(xe);_e!==-1?pe[Fe]=ae[_e]:pe[Fe]=Ne(xe)}}return pe}function Ie(de){if(typeof de!="object"||de===null)return de;if(de instanceof Date)return new Date(de);if(Array.isArray(de))return le(de,Ie);if(de instanceof Map)return new Map(le(Array.from(de),Ie));if(de instanceof Set)return new Set(le(Array.from(de),Ie));var Ne={};ie.push(de),ae.push(Ne);for(var he in de)if(Object.hasOwnProperty.call(de,he)!==!1){var pe=de[he];if(typeof pe!="object"||pe===null)Ne[he]=pe;else if(pe instanceof Date)Ne[he]=new Date(pe);else if(pe instanceof Map)Ne[he]=new Map(le(Array.from(pe),Ie));else if(pe instanceof Set)Ne[he]=new Set(le(Array.from(pe),Ie));else if(ArrayBuffer.isView(pe))Ne[he]=$(pe);else{var ze=ie.indexOf(pe);ze!==-1?Ne[he]=ae[ze]:Ne[he]=Ie(pe)}}return ie.pop(),ae.pop(),Ne}function ue(de){if(typeof de!="object"||de===null)return de;if(de instanceof Date)return new Date(de);if(Array.isArray(de))return le(de,ue);if(de instanceof Map)return new Map(le(Array.from(de),ue));if(de instanceof Set)return new Set(le(Array.from(de),ue));var Ne={};ie.push(de),ae.push(Ne);for(var he in de){var pe=de[he];if(typeof pe!="object"||pe===null)Ne[he]=pe;else if(pe instanceof Date)Ne[he]=new Date(pe);else if(pe instanceof Map)Ne[he]=new Map(le(Array.from(pe),ue));else if(pe instanceof Set)Ne[he]=new Set(le(Array.from(pe),ue));else if(ArrayBuffer.isView(pe))Ne[he]=$(pe);else{var ze=ie.indexOf(pe);ze!==-1?Ne[he]=ae[ze]:Ne[he]=ue(pe)}}return ie.pop(),ae.pop(),Ne}}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],73:[function(r,g,k){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var V=r("buffer"),$=V.Buffer;function oe(Ce,ie){for(var ae in Ce)ie[ae]=Ce[ae]}$.from&&$.alloc&&$.allocUnsafe&&$.allocUnsafeSlow?g.exports=V:(oe(V,k),k.Buffer=re);function re(Ce,ie,ae){return $(Ce,ie,ae)}re.prototype=Object.create($.prototype),oe($,re),re.from=function(Ce,ie,ae){if(typeof Ce=="number")throw new TypeError("Argument must not be a number");return $(Ce,ie,ae)},re.alloc=function(Ce,ie,ae){if(typeof Ce!="number")throw new TypeError("Argument must be a number");var le=$(Ce);return ie!==void 0?typeof ae=="string"?le.fill(ie,ae):le.fill(ie):le.fill(0),le},re.allocUnsafe=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return $(Ce)},re.allocUnsafeSlow=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return V.SlowBuffer(Ce)}},{buffer:17}],74:[function(r,g,k){g.exports=V;function V(oe){var re=oe._readableState;return re?re.objectMode||typeof oe._duplexState=="number"?oe.read():oe.read($(re)):null}function $(oe){return oe.buffer.length?oe.buffer.head?oe.buffer.head.data.length:oe.buffer[0].length:oe.length}},{}],75:[function(r,g,k){var V=r("safe-buffer").Buffer,$=V.isEncoding||function(_e){switch(_e=""+_e,_e&&_e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function oe(_e){if(!_e)return"utf8";for(var Dt;;)switch(_e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return _e;default:if(Dt)return;_e=(""+_e).toLowerCase(),Dt=!0}}function re(_e){var Dt=oe(_e);if(typeof Dt!="string"&&(V.isEncoding===$||!$(_e)))throw new Error("Unknown encoding: "+_e);return Dt||_e}k.StringDecoder=Ce;function Ce(_e){this.encoding=re(_e);var Dt;switch(this.encoding){case"utf16le":this.text=Ne,this.end=he,Dt=4;break;case"utf8":this.fillLast=Ie,Dt=4;break;case"base64":this.text=pe,this.end=ze,Dt=3;break;default:this.write=Fe,this.end=xe;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=V.allocUnsafe(Dt)}Ce.prototype.write=function(_e){if(_e.length===0)return"";var Dt,$e;if(this.lastNeed){if(Dt=this.fillLast(_e),Dt===void 0)return"";$e=this.lastNeed,this.lastNeed=0}else $e=0;return $e<_e.length?Dt?Dt+this.text(_e,$e):this.text(_e,$e):Dt||""},Ce.prototype.end=de,Ce.prototype.text=ue,Ce.prototype.fillLast=function(_e){if(this.lastNeed<=_e.length)return _e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,_e.length),this.lastNeed-=_e.length};function ie(_e){return _e<=127?0:_e>>5===6?2:_e>>4===14?3:_e>>3===30?4:_e>>6===2?-1:-2}function ae(_e,Dt,$e){var Ue=Dt.length-1;if(Ue<$e)return 0;var Ve=ie(Dt[Ue]);return Ve>=0?(Ve>0&&(_e.lastNeed=Ve-1),Ve):--Ue<$e||Ve===-2?0:(Ve=ie(Dt[Ue]),Ve>=0?(Ve>0&&(_e.lastNeed=Ve-2),Ve):--Ue<$e||Ve===-2?0:(Ve=ie(Dt[Ue]),Ve>=0?(Ve>0&&(Ve===2?Ve=0:_e.lastNeed=Ve-3),Ve):0))}function le(_e,Dt,$e){if((Dt[0]&192)!==128)return _e.lastNeed=0,"�";if(_e.lastNeed>1&&Dt.length>1){if((Dt[1]&192)!==128)return _e.lastNeed=1,"�";if(_e.lastNeed>2&&Dt.length>2&&(Dt[2]&192)!==128)return _e.lastNeed=2,"�"}}function Ie(_e){var Dt=this.lastTotal-this.lastNeed,$e=le(this,_e);if($e!==void 0)return $e;if(this.lastNeed<=_e.length)return _e.copy(this.lastChar,Dt,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_e.copy(this.lastChar,Dt,0,_e.length),this.lastNeed-=_e.length}function ue(_e,Dt){var $e=ae(this,_e,Dt);if(!this.lastNeed)return _e.toString("utf8",Dt);this.lastTotal=$e;var Ue=_e.length-($e-this.lastNeed);return _e.copy(this.lastChar,0,Ue),_e.toString("utf8",Dt,Ue)}function de(_e){var Dt=_e&&_e.length?this.write(_e):"";return this.lastNeed?Dt+"�":Dt}function Ne(_e,Dt){if((_e.length-Dt)%2===0){var $e=_e.toString("utf16le",Dt);if($e){var Ue=$e.charCodeAt($e.length-1);if(Ue>=55296&&Ue<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_e[_e.length-2],this.lastChar[1]=_e[_e.length-1],$e.slice(0,-1)}return $e}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_e[_e.length-1],_e.toString("utf16le",Dt,_e.length-1)}function he(_e){var Dt=_e&&_e.length?this.write(_e):"";if(this.lastNeed){var $e=this.lastTotal-this.lastNeed;return Dt+this.lastChar.toString("utf16le",0,$e)}return Dt}function pe(_e,Dt){var $e=(_e.length-Dt)%3;return $e===0?_e.toString("base64",Dt):(this.lastNeed=3-$e,this.lastTotal=3,$e===1?this.lastChar[0]=_e[_e.length-1]:(this.lastChar[0]=_e[_e.length-2],this.lastChar[1]=_e[_e.length-1]),_e.toString("base64",Dt,_e.length-$e))}function ze(_e){var Dt=_e&&_e.length?this.write(_e):"";return this.lastNeed?Dt+this.lastChar.toString("base64",0,3-this.lastNeed):Dt}function Fe(_e){return _e.toString(this.encoding)}function xe(_e){return _e&&_e.length?this.write(_e):""}},{"safe-buffer":73}],76:[function(r,g,k){var V=r("punycode"),$=r("./util");k.parse=Dt,k.resolve=Ue,k.resolveObject=Ve,k.format=$e,k.Url=oe;function oe(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var re=/^([a-z0-9.+-]+:)/i,Ce=/:[0-9]*$/,ie=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ae=["<",">",'"',"`"," ","\r",`
1303
+ `," "],le=["{","}","|","\\","^","`"].concat(ae),Ie=["'"].concat(le),ue=["%","/","?",";","#"].concat(Ie),de=["/","?","#"],Ne=255,he=/^[+a-z0-9A-Z_-]{0,63}$/,pe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ze={javascript:!0,"javascript:":!0},Fe={javascript:!0,"javascript:":!0},xe={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_e=r("querystring");function Dt(Oe,At,qe){if(Oe&&$.isObject(Oe)&&Oe instanceof oe)return Oe;var Lt=new oe;return Lt.parse(Oe,At,qe),Lt}oe.prototype.parse=function(Oe,At,qe){if(!$.isString(Oe))throw new TypeError("Parameter 'url' must be a string, not "+typeof Oe);var Lt=Oe.indexOf("?"),kt=Lt!==-1&&Lt<Oe.indexOf("#")?"?":"#",jt=Oe.split(kt),ti=/\\/g;jt[0]=jt[0].replace(ti,"/"),Oe=jt.join(kt);var ei=Oe;if(ei=ei.trim(),!qe&&Oe.split("#").length===1){var Pt=ie.exec(ei);if(Pt)return this.path=ei,this.href=ei,this.pathname=Pt[1],Pt[2]?(this.search=Pt[2],At?this.query=_e.parse(this.search.substr(1)):this.query=this.search.substr(1)):At&&(this.search="",this.query={}),this}var ni=re.exec(ei);if(ni){ni=ni[0];var gi=ni.toLowerCase();this.protocol=gi,ei=ei.substr(ni.length)}if(qe||ni||ei.match(/^\/\/[^@\/]+@[^@\/]+/)){var di=ei.substr(0,2)==="//";di&&!(ni&&Fe[ni])&&(ei=ei.substr(2),this.slashes=!0)}if(!Fe[ni]&&(di||ni&&!xe[ni])){for(var li=-1,ai=0;ai<de.length;ai++){var ci=ei.indexOf(de[ai]);ci!==-1&&(li===-1||ci<li)&&(li=ci)}var pi,yi;li===-1?yi=ei.lastIndexOf("@"):yi=ei.lastIndexOf("@",li),yi!==-1&&(pi=ei.slice(0,yi),ei=ei.slice(yi+1),this.auth=decodeURIComponent(pi)),li=-1;for(var ai=0;ai<ue.length;ai++){var ci=ei.indexOf(ue[ai]);ci!==-1&&(li===-1||ci<li)&&(li=ci)}li===-1&&(li=ei.length),this.host=ei.slice(0,li),ei=ei.slice(li),this.parseHost(),this.hostname=this.hostname||"";var Ai=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Ai)for(var hi=this.hostname.split(/\./),ai=0,wi=hi.length;ai<wi;ai++){var Ci=hi[ai];if(Ci&&!Ci.match(he)){for(var mi="",Ni=0,Mi=Ci.length;Ni<Mi;Ni++)Ci.charCodeAt(Ni)>127?mi+="x":mi+=Ci[Ni];if(!mi.match(he)){var fi=hi.slice(0,ai),zi=hi.slice(ai+1),Si=Ci.match(pe);Si&&(fi.push(Si[1]),zi.unshift(Si[2])),zi.length&&(ei="/"+zi.join(".")+ei),this.hostname=fi.join(".");break}}}this.hostname.length>Ne?this.hostname="":this.hostname=this.hostname.toLowerCase(),Ai||(this.hostname=V.toASCII(this.hostname));var si=this.port?":"+this.port:"",Ii=this.hostname||"";this.host=Ii+si,this.href+=this.host,Ai&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ei[0]!=="/"&&(ei="/"+ei))}if(!ze[gi])for(var ai=0,wi=Ie.length;ai<wi;ai++){var oi=Ie[ai];if(ei.indexOf(oi)!==-1){var Et=encodeURIComponent(oi);Et===oi&&(Et=escape(oi)),ei=ei.split(oi).join(Et)}}var ii=ei.indexOf("#");ii!==-1&&(this.hash=ei.substr(ii),ei=ei.slice(0,ii));var ri=ei.indexOf("?");if(ri!==-1?(this.search=ei.substr(ri),this.query=ei.substr(ri+1),At&&(this.query=_e.parse(this.query)),ei=ei.slice(0,ri)):At&&(this.search="",this.query={}),ei&&(this.pathname=ei),xe[gi]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var si=this.pathname||"",ui=this.search||"";this.path=si+ui}return this.href=this.format(),this};function $e(Oe){return $.isString(Oe)&&(Oe=Dt(Oe)),Oe instanceof oe?Oe.format():oe.prototype.format.call(Oe)}oe.prototype.format=function(){var Oe=this.auth||"";Oe&&(Oe=encodeURIComponent(Oe),Oe=Oe.replace(/%3A/i,":"),Oe+="@");var At=this.protocol||"",qe=this.pathname||"",Lt=this.hash||"",kt=!1,jt="";this.host?kt=Oe+this.host:this.hostname&&(kt=Oe+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(kt+=":"+this.port)),this.query&&$.isObject(this.query)&&Object.keys(this.query).length&&(jt=_e.stringify(this.query));var ti=this.search||jt&&"?"+jt||"";return At&&At.substr(-1)!==":"&&(At+=":"),this.slashes||(!At||xe[At])&&kt!==!1?(kt="//"+(kt||""),qe&&qe.charAt(0)!=="/"&&(qe="/"+qe)):kt||(kt=""),Lt&&Lt.charAt(0)!=="#"&&(Lt="#"+Lt),ti&&ti.charAt(0)!=="?"&&(ti="?"+ti),qe=qe.replace(/[?#]/g,function(ei){return encodeURIComponent(ei)}),ti=ti.replace("#","%23"),At+kt+qe+ti+Lt};function Ue(Oe,At){return Dt(Oe,!1,!0).resolve(At)}oe.prototype.resolve=function(Oe){return this.resolveObject(Dt(Oe,!1,!0)).format()};function Ve(Oe,At){return Oe?Dt(Oe,!1,!0).resolveObject(At):At}oe.prototype.resolveObject=function(Oe){if($.isString(Oe)){var At=new oe;At.parse(Oe,!1,!0),Oe=At}for(var qe=new oe,Lt=Object.keys(this),kt=0;kt<Lt.length;kt++){var jt=Lt[kt];qe[jt]=this[jt]}if(qe.hash=Oe.hash,Oe.href==="")return qe.href=qe.format(),qe;if(Oe.slashes&&!Oe.protocol){for(var ti=Object.keys(Oe),ei=0;ei<ti.length;ei++){var Pt=ti[ei];Pt!=="protocol"&&(qe[Pt]=Oe[Pt])}return xe[qe.protocol]&&qe.hostname&&!qe.pathname&&(qe.path=qe.pathname="/"),qe.href=qe.format(),qe}if(Oe.protocol&&Oe.protocol!==qe.protocol){if(!xe[Oe.protocol]){for(var ni=Object.keys(Oe),gi=0;gi<ni.length;gi++){var di=ni[gi];qe[di]=Oe[di]}return qe.href=qe.format(),qe}if(qe.protocol=Oe.protocol,!Oe.host&&!Fe[Oe.protocol]){for(var wi=(Oe.pathname||"").split("/");wi.length&&!(Oe.host=wi.shift()););Oe.host||(Oe.host=""),Oe.hostname||(Oe.hostname=""),wi[0]!==""&&wi.unshift(""),wi.length<2&&wi.unshift(""),qe.pathname=wi.join("/")}else qe.pathname=Oe.pathname;if(qe.search=Oe.search,qe.query=Oe.query,qe.host=Oe.host||"",qe.auth=Oe.auth,qe.hostname=Oe.hostname||Oe.host,qe.port=Oe.port,qe.pathname||qe.search){var li=qe.pathname||"",ai=qe.search||"";qe.path=li+ai}return qe.slashes=qe.slashes||Oe.slashes,qe.href=qe.format(),qe}var ci=qe.pathname&&qe.pathname.charAt(0)==="/",pi=Oe.host||Oe.pathname&&Oe.pathname.charAt(0)==="/",yi=pi||ci||qe.host&&Oe.pathname,Ai=yi,hi=qe.pathname&&qe.pathname.split("/")||[],wi=Oe.pathname&&Oe.pathname.split("/")||[],Ci=qe.protocol&&!xe[qe.protocol];if(Ci&&(qe.hostname="",qe.port=null,qe.host&&(hi[0]===""?hi[0]=qe.host:hi.unshift(qe.host)),qe.host="",Oe.protocol&&(Oe.hostname=null,Oe.port=null,Oe.host&&(wi[0]===""?wi[0]=Oe.host:wi.unshift(Oe.host)),Oe.host=null),yi=yi&&(wi[0]===""||hi[0]==="")),pi)qe.host=Oe.host||Oe.host===""?Oe.host:qe.host,qe.hostname=Oe.hostname||Oe.hostname===""?Oe.hostname:qe.hostname,qe.search=Oe.search,qe.query=Oe.query,hi=wi;else if(wi.length)hi||(hi=[]),hi.pop(),hi=hi.concat(wi),qe.search=Oe.search,qe.query=Oe.query;else if(!$.isNullOrUndefined(Oe.search)){if(Ci){qe.hostname=qe.host=hi.shift();var mi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;mi&&(qe.auth=mi.shift(),qe.host=qe.hostname=mi.shift())}return qe.search=Oe.search,qe.query=Oe.query,(!$.isNull(qe.pathname)||!$.isNull(qe.search))&&(qe.path=(qe.pathname?qe.pathname:"")+(qe.search?qe.search:"")),qe.href=qe.format(),qe}if(!hi.length)return qe.pathname=null,qe.search?qe.path="/"+qe.search:qe.path=null,qe.href=qe.format(),qe;for(var Ni=hi.slice(-1)[0],Mi=(qe.host||Oe.host||hi.length>1)&&(Ni==="."||Ni==="..")||Ni==="",fi=0,zi=hi.length;zi>=0;zi--)Ni=hi[zi],Ni==="."?hi.splice(zi,1):Ni===".."?(hi.splice(zi,1),fi++):fi&&(hi.splice(zi,1),fi--);if(!yi&&!Ai)for(;fi--;fi)hi.unshift("..");yi&&hi[0]!==""&&(!hi[0]||hi[0].charAt(0)!=="/")&&hi.unshift(""),Mi&&hi.join("/").substr(-1)!=="/"&&hi.push("");var Si=hi[0]===""||hi[0]&&hi[0].charAt(0)==="/";if(Ci){qe.hostname=qe.host=Si?"":hi.length?hi.shift():"";var mi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;mi&&(qe.auth=mi.shift(),qe.host=qe.hostname=mi.shift())}return yi=yi||qe.host&&hi.length,yi&&!Si&&hi.unshift(""),hi.length?qe.pathname=hi.join("/"):(qe.pathname=null,qe.path=null),(!$.isNull(qe.pathname)||!$.isNull(qe.search))&&(qe.path=(qe.pathname?qe.pathname:"")+(qe.search?qe.search:"")),qe.auth=Oe.auth||qe.auth,qe.slashes=qe.slashes||Oe.slashes,qe.href=qe.format(),qe},oe.prototype.parseHost=function(){var Oe=this.host,At=Ce.exec(Oe);At&&(At=At[0],At!==":"&&(this.port=At.substr(1)),Oe=Oe.substr(0,Oe.length-At.length)),Oe&&(this.hostname=Oe)}},{"./util":77,punycode:51,querystring:54}],77:[function(r,g,k){g.exports={isString:function(V){return typeof V=="string"},isObject:function(V){return typeof V=="object"&&V!==null},isNull:function(V){return V===null},isNullOrUndefined:function(V){return V==null}}},{}],78:[function(r,g,k){(function(V){(function(){g.exports=$;function $(re,Ce){if(oe("noDeprecation"))return re;var ie=!1;function ae(){if(!ie){if(oe("throwDeprecation"))throw new Error(Ce);oe("traceDeprecation")?console.trace(Ce):console.warn(Ce),ie=!0}return re.apply(this,arguments)}return ae}function oe(re){try{if(!V.localStorage)return!1}catch{return!1}var Ce=V.localStorage[re];return Ce==null?!1:String(Ce).toLowerCase()==="true"}}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],79:[function(r,g,k){g.exports=V;function V($,oe){if($&&oe)return V($)(oe);if(typeof $!="function")throw new TypeError("need wrapper function");return Object.keys($).forEach(function(Ce){re[Ce]=$[Ce]}),re;function re(){for(var Ce=new Array(arguments.length),ie=0;ie<Ce.length;ie++)Ce[ie]=arguments[ie];var ae=$.apply(this,Ce),le=Ce[Ce.length-1];return typeof ae=="function"&&ae!==le&&Object.keys(le).forEach(function(Ie){ae[Ie]=le[Ie]}),ae}}},{}],80:[function(r,g,k){g.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},{}],81:[function(r,g,k){g.exports=$;var V=Object.prototype.hasOwnProperty;function $(){for(var oe={},re=0;re<arguments.length;re++){var Ce=arguments[re];for(var ie in Ce)V.call(Ce,ie)&&(oe[ie]=Ce[ie])}return oe}},{}],82:[function(r,g,k){g.exports=function(V){V.prototype[Symbol.iterator]=function*(){for(let $=this.head;$;$=$.next)yield $.value}}},{}],83:[function(r,g,k){g.exports=V,V.Node=Ce,V.create=V;function V(ie){var ae=this;if(ae instanceof V||(ae=new V),ae.tail=null,ae.head=null,ae.length=0,ie&&typeof ie.forEach=="function")ie.forEach(function(ue){ae.push(ue)});else if(arguments.length>0)for(var le=0,Ie=arguments.length;le<Ie;le++)ae.push(arguments[le]);return ae}V.prototype.removeNode=function(ie){if(ie.list!==this)throw new Error("removing node which does not belong to this list");var ae=ie.next,le=ie.prev;return ae&&(ae.prev=le),le&&(le.next=ae),ie===this.head&&(this.head=ae),ie===this.tail&&(this.tail=le),ie.list.length--,ie.next=null,ie.prev=null,ie.list=null,ae},V.prototype.unshiftNode=function(ie){if(ie!==this.head){ie.list&&ie.list.removeNode(ie);var ae=this.head;ie.list=this,ie.next=ae,ae&&(ae.prev=ie),this.head=ie,this.tail||(this.tail=ie),this.length++}},V.prototype.pushNode=function(ie){if(ie!==this.tail){ie.list&&ie.list.removeNode(ie);var ae=this.tail;ie.list=this,ie.prev=ae,ae&&(ae.next=ie),this.tail=ie,this.head||(this.head=ie),this.length++}},V.prototype.push=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)oe(this,arguments[ie]);return this.length},V.prototype.unshift=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)re(this,arguments[ie]);return this.length},V.prototype.pop=function(){if(this.tail){var ie=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,ie}},V.prototype.shift=function(){if(this.head){var ie=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,ie}},V.prototype.forEach=function(ie,ae){ae=ae||this;for(var le=this.head,Ie=0;le!==null;Ie++)ie.call(ae,le.value,Ie,this),le=le.next},V.prototype.forEachReverse=function(ie,ae){ae=ae||this;for(var le=this.tail,Ie=this.length-1;le!==null;Ie--)ie.call(ae,le.value,Ie,this),le=le.prev},V.prototype.get=function(ie){for(var ae=0,le=this.head;le!==null&&ae<ie;ae++)le=le.next;if(ae===ie&&le!==null)return le.value},V.prototype.getReverse=function(ie){for(var ae=0,le=this.tail;le!==null&&ae<ie;ae++)le=le.prev;if(ae===ie&&le!==null)return le.value},V.prototype.map=function(ie,ae){ae=ae||this;for(var le=new V,Ie=this.head;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.next;return le},V.prototype.mapReverse=function(ie,ae){ae=ae||this;for(var le=new V,Ie=this.tail;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.prev;return le},V.prototype.reduce=function(ie,ae){var le,Ie=this.head;if(arguments.length>1)le=ae;else if(this.head)Ie=this.head.next,le=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var ue=0;Ie!==null;ue++)le=ie(le,Ie.value,ue),Ie=Ie.next;return le},V.prototype.reduceReverse=function(ie,ae){var le,Ie=this.tail;if(arguments.length>1)le=ae;else if(this.tail)Ie=this.tail.prev,le=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var ue=this.length-1;Ie!==null;ue--)le=ie(le,Ie.value,ue),Ie=Ie.prev;return le},V.prototype.toArray=function(){for(var ie=new Array(this.length),ae=0,le=this.head;le!==null;ae++)ie[ae]=le.value,le=le.next;return ie},V.prototype.toArrayReverse=function(){for(var ie=new Array(this.length),ae=0,le=this.tail;le!==null;ae++)ie[ae]=le.value,le=le.prev;return ie},V.prototype.slice=function(ie,ae){ae=ae||this.length,ae<0&&(ae+=this.length),ie=ie||0,ie<0&&(ie+=this.length);var le=new V;if(ae<ie||ae<0)return le;ie<0&&(ie=0),ae>this.length&&(ae=this.length);for(var Ie=0,ue=this.head;ue!==null&&Ie<ie;Ie++)ue=ue.next;for(;ue!==null&&Ie<ae;Ie++,ue=ue.next)le.push(ue.value);return le},V.prototype.sliceReverse=function(ie,ae){ae=ae||this.length,ae<0&&(ae+=this.length),ie=ie||0,ie<0&&(ie+=this.length);var le=new V;if(ae<ie||ae<0)return le;ie<0&&(ie=0),ae>this.length&&(ae=this.length);for(var Ie=this.length,ue=this.tail;ue!==null&&Ie>ae;Ie--)ue=ue.prev;for(;ue!==null&&Ie>ie;Ie--,ue=ue.prev)le.push(ue.value);return le},V.prototype.splice=function(ie,ae,...le){ie>this.length&&(ie=this.length-1),ie<0&&(ie=this.length+ie);for(var Ie=0,ue=this.head;ue!==null&&Ie<ie;Ie++)ue=ue.next;for(var de=[],Ie=0;ue&&Ie<ae;Ie++)de.push(ue.value),ue=this.removeNode(ue);ue===null&&(ue=this.tail),ue!==this.head&&ue!==this.tail&&(ue=ue.prev);for(var Ie=0;Ie<le.length;Ie++)ue=$(this,ue,le[Ie]);return de},V.prototype.reverse=function(){for(var ie=this.head,ae=this.tail,le=ie;le!==null;le=le.prev){var Ie=le.prev;le.prev=le.next,le.next=Ie}return this.head=ae,this.tail=ie,this};function $(ie,ae,le){var Ie=ae===ie.head?new Ce(le,null,ae,ie):new Ce(le,ae,ae.next,ie);return Ie.next===null&&(ie.tail=Ie),Ie.prev===null&&(ie.head=Ie),ie.length++,Ie}function oe(ie,ae){ie.tail=new Ce(ae,ie.tail,null,ie),ie.head||(ie.head=ie.tail),ie.length++}function re(ie,ae){ie.head=new Ce(ae,null,ie.head,ie),ie.tail||(ie.tail=ie.head),ie.length++}function Ce(ie,ae,le,Ie){if(!(this instanceof Ce))return new Ce(ie,ae,le,Ie);this.list=Ie,this.value=ie,ae?(ae.next=this,this.prev=ae):this.prev=null,le?(le.prev=this,this.next=le):this.next=null}try{r("./iterator.js")(V)}catch{}},{"./iterator.js":82}]},{},[12])(12)})})(mqtt);var mqttExports=mqtt.exports;let client;const sub=(i,n,r,g,k)=>{client=mqttExports.connect(i,{username:n,password:r}),client.on("connect",()=>{console.log("MQTT服务器连接成功"),console.log(client.options.clientId),client.subscribe(g,{qos:1})}),client.on("message",k)},close=()=>{client&&client.end&&client.end(!0,{},()=>{console.log("MQTT服务连接关闭")})},_hoisted_1=["transform"],_hoisted_2=["transform","onClick"],_hoisted_3=["transform"],_hoisted_4=["xlink:href","id","transform"],_hoisted_5=["id"],_sfc_main=vue.defineComponent({__name:"index",props:{data:{},canvasDrag:{type:Boolean,default:!0}},setup(i,{expose:n}){const r=i,g=vue.getCurrentInstance();Object.keys(vueComp).forEach(ue=>{var de;Object.keys((de=g==null?void 0:g.appContext)==null?void 0:de.components).includes(ue)||g==null||g.appContext.app.component(ue,vueComp[ue])});const k=vue.reactive(r.data??{layout_center:{x:0,y:0},config:{svg:{background_color:"#fff",scale:1,position_center:{x:-333,y:-113},svg_position_center:{x:50,y:50}},net:{mqtt:{url:"",user:"",pwd:"",topics:""}}},done_json:[]}),V=useGlobalStore(pinia),$=ue=>{if(V.mouse_info.state!=EMouseInfoState.Down&&V.intention!==EGlobalStoreIntention.Connection)return;if(!r.canvasDrag){console.log(r.canvasDrag);return}const{clientX:de,clientY:Ne}=ue;V.mouse_info.new_position_x=V.mouse_info.now_position_x+de-V.mouse_info.position_x,V.mouse_info.new_position_y=V.mouse_info.now_position_y+Ne-V.mouse_info.position_y,V.intention==EGlobalStoreIntention.MoveCanvas&&(k.layout_center.x=V.mouse_info.new_position_x,k.layout_center.y=V.mouse_info.new_position_y)},oe=()=>{V.mouse_info.state==EMouseInfoState.Down&&(V.intention!=EGlobalStoreIntention.Select&&(V.intention=EGlobalStoreIntention.None),V.setMouseInfo({state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}))},re=ue=>{console.log("onCanvasMouseDown",ue);const{clientX:de,clientY:Ne}=ue;V.intention=EGlobalStoreIntention.MoveCanvas,V.setMouseInfo({state:EMouseInfoState.Down,position_x:de,position_y:Ne,now_position_x:k.layout_center.x,now_position_y:k.layout_center.y,new_position_x:k.layout_center.x,new_position_y:k.layout_center.y})},Ce=(ue,de,Ne)=>({x:ue.x-ue.width/2*de+ue.width/2,y:ue.y-ue.height/2*Ne+ue.height/2,width:ue.width*de,height:ue.height*Ne}),ie=(ue,de,Ne)=>setArrItemByID(ue,de,Ne,k.done_json),ae=ue=>{var de;if(((de=ue.events)==null?void 0:de.length)>0){for(let Ne of ue.events)if(Ne.type===EEventType.Click||Ne.type===EEventType.Change){if(Ne.condition&&Ne.condition.type!=="None"&&Ne.condition.type==="Relation"&&Ne.condition.Relation&&Ne.condition.Relation.relation){const he=Ne.condition.Relation.key,pe=Ne.condition.Relation.relation,ze=valFormat(Ne.condition.Relation.val),Fe=valFormat(Ne.condition.Relation.val2);if(ue.props.hasOwnProperty(he)){const xe=ue.props[he].val;if(!le(xe,pe,ze,Fe))continue}}if(Ne.action===EEventAction.ChangeAttr){if(Ne.attrs&&Ne.attrs.length>0){let he;if(Ne.target){for(let pe of V.done_json)if(pe.id===Ne.target){he=pe;break}}else he=ue;if(!he)continue;for(let pe of Ne.attrs)he.state&&he.state.hasOwnProperty(pe.key)?he.state[pe.key].default=valFormat(pe.val):he.props.hasOwnProperty(pe.key)&&(he.props[pe.key].val=valFormat(pe.val))}}else Ne.action===EEventAction.JavaScript&&new Function(Ne.scripts)()}}},le=(ue,de,Ne,he)=>{switch(de){case">":return ue>Ne;case">=":return ue>=Ne;case"<":return ue<Ne;case"<=":return ue<=Ne;case"==":return ue==Ne;case"!=":return ue!=Ne;case">=,=<":return ue>=Ne&&ue<=he;case"<,>":return ue<Ne||ue>he}};vue.onMounted(()=>{Ie()}),vue.onBeforeUnmount(close);const Ie=()=>{const ue=k.config.net.mqtt;ue&&ue.url&&ue.user&&ue.pwd&&ue.topics&&sub(ue.url,ue.user,ue.pwd,ue.topics,(de,Ne)=>{console.log(de),console.log(Ne.toString())})};return n({setNodeAttrByID:ie}),(ue,de)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",onMousedown:re,onMousemove:$,onMouseup:oe},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:k.config.svg.background_color}),width:"100%",height:"100%"},[vue.createElementVNode("g",{transform:`translate(${k.config.svg.position_center.x+k.layout_center.x},${k.config.svg.position_center.y+k.layout_center.y})rotate(0)scale(${k.config.svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.done_json,Ne=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Ne.id,transform:`translate(${Ne.x},${Ne.y})rotate(0)scale(1)`,onClick:he=>ae(Ne)},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Ne)}`)},[vue.createElementVNode("g",{transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2})rotate(${Ne.rotate}) scale(1) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`},[Ne.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$d,{key:0,"item-info":Ne},null,8,["item-info"])):Ne.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Ne.name}`},vue.unref(prosToVBind)(Ne),{width:"100",height:"100",id:Ne.id,transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),null,16,_hoisted_4)):Ne.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ne.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Ne),{width:"100",height:"100",id:Ne.id,onOnChange:he=>ae(Ne),transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),null,16,["id","onOnChange","transform"])):Ne.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},Ce(Ne.actual_bound,Ne.scale_x,Ne.scale_y),{id:`foreign-object${Ne.id}`}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ne.tag),vue.mergeProps(vue.unref(prosToVBind)(Ne),{id:Ne.id,onOnChange:he=>ae(Ne),transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ne.tag_slot),1)]),_:2},1040,["id","onOnChange","transform"]))],16,_hoisted_5)):vue.createCommentVNode("",!0)],8,_hoisted_3)],2)],8,_hoisted_2)),[[vue.vShow,Ne.display]])),128))],8,_hoisted_1)],4))],32))}}),index_vue_vue_type_style_index_0_scoped_a4451d40_lang="",index=_export_sfc(_sfc_main,[["__scopeId","data-v-a4451d40"]]);exports.SvgEditor=index$1,exports.SvgViewer=index,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});