@zhangqingcq/vgce 0.0.32 → 0.0.33

Sign up to get free protection for your applications and to get access to all the features.
package/dist/vgce.umd.cjs CHANGED
@@ -110,20 +110,20 @@
110
110
  </g>\r
111
111
  </g>\r
112
112
  </symbol><symbol viewBox="0 0 1024 1024" id="svg-clock-a">\r
113
- <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"></path>\r
113
+ <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="#B3A7FF"></path>\r
114
114
  <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"></path>\r
115
- <path 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">\r
116
- <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="-45 512 512" to="315 512 512" dur="43200s" repeatCount="indefinite" />\r
117
- </path>\r
118
- <path 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">\r
115
+ <path 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="#50E68E">\r
119
116
  <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="45 512 512" to="405 512 512" dur="3600s" repeatCount="indefinite" />\r
120
117
  </path>\r
121
- <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"></path>\r
122
- <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"></path>\r
123
- <path 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">\r
118
+ <path 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="#9A36E7">\r
119
+ <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="-45 512 512" to="315 512 512" dur="43200s" repeatCount="indefinite" />\r
120
+ </path>\r
121
+ <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="#F45AFC"></path>\r
122
+ <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="#4942CF"></path>\r
123
+ <path 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="#E83E24">\r
124
124
  <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="135 512 512" to="495 512 512" dur="60s" repeatCount="indefinite" />\r
125
125
  </path>\r
126
- <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="#FFFFFF"></path>\r
126
+ <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="#EBF257"></path>\r
127
127
  </symbol><symbol class="icon" viewBox="0 0 1024 1024" id="svg-common-table"><path d="M885.3 957.3H140.7c-42.2 0-76.5-34.3-76.5-76.5V136.3c0-42.2 34.3-76.5 76.5-76.5h744.6c42.2 0 76.5 34.3 76.5 76.5v744.6c-0.1 42.1-34.3 76.4-76.5 76.4z m-744.6-851c-16.5 0-29.9 13.4-29.9 29.9v744.6c0 16.5 13.4 29.9 29.9 29.9h744.6c16.5 0 29.9-13.4 29.9-29.9V136.3c0-16.5-13.4-29.9-29.9-29.9H140.7z" fill="#2F2302" p-id="1992" data-spm-anchor-id="a313x.manage_type_myprojects.0.i22.1adc3a81gVIGv0" class="" /><path d="M938.5 315.8h-851V91.1c0-4.4 3.6-8 8-8h835c4.4 0 8 3.6 8 8v224.7z" fill="#F1D563" p-id="1993" data-spm-anchor-id="a313x.manage_type_myprojects.0.i20.1adc3a81gVIGv0" class="" /><path d="M961.7 339H64.3V136.3c0-42.2 34.3-76.5 76.5-76.5h744.6c42.2 0 76.5 34.3 76.5 76.5V339z m-850.9-46.5h804.4V136.3c0-16.5-13.4-29.9-29.9-29.9H140.7c-16.5 0-29.9 13.4-29.9 29.9v156.2zM938.5 644.8h-851c-12.9 0-23.3-10.4-23.3-23.3 0-12.8 10.4-23.3 23.3-23.3h851c12.9 0 23.3 10.4 23.3 23.3-0.1 12.9-10.5 23.3-23.3 23.3z" fill="#2F2302" p-id="1994" data-spm-anchor-id="a313x.manage_type_myprojects.0.i23.1adc3a81gVIGv0" class="" /><path d="M363.4 957.3c-12.9 0-23.3-10.4-23.3-23.3V315.8c0-12.8 10.4-23.3 23.3-23.3s23.3 10.4 23.3 23.3V934c0 12.9-10.4 23.3-23.3 23.3zM662.6 957.3c-12.9 0-23.3-10.4-23.3-23.3V315.8c0-12.8 10.4-23.3 23.3-23.3s23.3 10.4 23.3 23.3V934c0 12.9-10.5 23.3-23.3 23.3z" fill="#2F2302" p-id="1995" data-spm-anchor-id="a313x.manage_type_myprojects.0.i21.1adc3a81gVIGv0" class="" /></symbol><symbol class="icon" viewBox="0 0 1094 1024" id="svg-el-button"><path d="M984.860838 227.319149H153.357353c-15.616064 0-28.275239 12.657976-28.27524 28.272839v441.069494c0 15.614864 12.659176 28.274039 28.27524 28.27404h831.503485c15.614864 0 28.272839-12.657976 28.272839-28.27404V255.591988c0-15.613664-12.656776-28.272839-28.272839-28.272839z m-12.372367 432.768847c0 13.025187-10.559113 23.5855-23.5843 23.585501H189.31402c-13.026387 0-23.5855-10.559113-23.5855-23.585501V292.166674c0-13.025187 10.559113-23.5855 23.5855-23.5855H948.904171c13.025187 0 23.5843 10.559113 23.5843 23.5855v367.921322z" fill="#409eff" p-id="1625" data-spm-anchor-id="a313x.manage_type_myprojects.0.i3.1adc3a81px4RsK" class="" /><path d="M395.144131 473.024043c19.678184-10.226704 29.925288-27.174807 30.718512-50.803508-3.156094-40.171193-30.718512-61.438224-82.704055-63.801094h-105.154322v244.57086h111.062097c58.28093 0 87.430996-23.224289 87.430996-69.708869-0.794424-28.356842-14.584033-48.441838-41.353228-60.257389z m-118.149508-79.16035h61.438224c29.130865 0.794424 44.491321 11.040328 46.077768 30.719712-0.794424 22.061455-16.541291 33.488194-47.259803 34.263417h-60.256189V393.863693z m68.526835 174.861991h-68.526835v-74.43461h64.983129c33.856605 0.794424 51.579931 12.997586 53.167579 36.627488-0.0012 25.216349-16.541291 37.807122-49.623873 37.807122zM461.309295 393.863693h82.705255v209.126608h40.169993V393.863693h81.52322v-35.444252H461.309295zM863.017621 509.65033c0 13.403198 0.776423 27.96923 2.36407 43.716098v1.182035c-7.08861-16.541291-14.971644-31.106123-23.629901-43.716098-21.267031-33.081382-55.142837-83.88609-101.608217-152.412924h-41.352028v244.57086H737.781903v-147.688384c0-18.109738-1.180835-34.263417-3.546105-48.440638h1.180835c6.295387 13.401998 13.772809 27.580419 22.449066 42.534062 22.042254 33.082582 56.712484 84.292902 103.972287 153.59496h40.171192V358.419441H863.017621v151.230889z" fill="#C54E6A" p-id="1626" data-spm-anchor-id="a313x.manage_type_myprojects.0.i6.1adc3a81px4RsK" class="selected" /></symbol><symbol viewBox="0 0 1024 1024" id="svg-el-tag">
128
128
  <path d="M767.1 292.6c-0.2-19-15.6-34.4-34.6-34.6l-202.2-2.5c-9.5-0.1-18.6 3.6-25.2 10.3l-35.4 35.4c48.4 138.5 72.4 282.3 42.1 433.8-1.7 10.4-3.9 21.1-6.4 31.9 6-1.5 11.7-4.4 16.3-9.1l237.6-237.6c6.7-6.7 10.4-15.8 10.3-25.2l-2.5-202.4zM664.3 429c-17.1 17.1-44.9 17.1-62 0s-17.1-44.9 0-62 44.9-17.1 62 0 17.2 44.8 0 62z" fill="#FFDE55" />
129
129
  <path d="M779.6 292.5c-0.2-12.5-5.1-24.2-13.9-33.1-8.8-8.8-20.6-13.8-33.1-13.9L530.4 243c-12.7-0.1-25.2 4.9-34.2 13.9L258.6 494.6c-9 9-13.9 20.9-13.9 33.6 0 12.7 4.9 24.7 13.9 33.6l204.7 204.7c9 9 20.9 13.9 33.6 13.9 12.7 0 24.7-4.9 33.6-13.9l237.6-237.6c9-9 14.1-21.5 13.9-34.2l-2.4-202.2z m-29.1 218.7L512.9 748.8c-4.3 4.3-9.9 6.6-16 6.6-6 0-11.7-2.3-16-6.6L276.3 544.2c-4.3-4.3-6.6-9.9-6.6-16s2.3-11.7 6.6-16l237.6-237.6c4.2-4.2 10-6.6 16-6.6h0.3l202.2 2.5c12.4 0.2 22.2 9.9 22.3 22.3l2.5 202.2c0 6-2.4 11.9-6.7 16.2z" fill="" />
@@ -251,7 +251,7 @@ usage: app.provide(ID_INJECTION_KEY, {
251
251
  * Copyright(c) 2015 Andreas Lubbe
252
252
  * Copyright(c) 2015 Tiancheng "Timothy" Gu
253
253
  * MIT Licensed
254
- */var matchHtmlRegExp=/["'&<>]/,escapeHtml_1=escapeHtml;function escapeHtml(i){var n=""+i,r=matchHtmlRegExp.exec(n);if(!r)return n;var g,V="",k=0,$=0;for(k=r.index;k<n.length;k++){switch(n.charCodeAt(k)){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}$!==k&&(V+=n.substring($,k)),$=k+1,V+=g}return $!==k?V+n.substring($,k):V}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,V){if(!n&&!g&&(!V||Array.isArray(V)&&!V.length))return i;typeof r=="string"?r=r==="descending"?-1:1:r=r&&r<0?-1:1;const k=g?null:function(re,oe){return V?(Array.isArray(V)||(V=[V]),V.map(Ce=>typeof Ce=="string"?get$1(re,Ce):Ce(re,oe,i))):(n!=="$key"&&isObject$4(re)&&"$value"in re&&(re=re.$value),[isObject$4(re)?get$1(re,n):re])},$=function(re,oe){if(g)return g(re.value,oe.value);for(let Ce=0,ie=re.key.length;Ce<ie;Ce++){if(re.key[Ce]<oe.key[Ce])return-1;if(re.key[Ce]>oe.key[Ce])return 1}return 0};return i.map((re,oe)=>({value:re,index:oe,key:k?k(re,oe):null})).sort((re,oe)=>{let Ce=$(re,oe);return Ce||(Ce=re.index-oe.index),Ce*+r}).map(re=>re.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 V=i.columns[g];if(V.columnKey===n){r=V;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 V of r)g=g[V];return`${g}`}else if(typeof n=="function")return n.call(null,i)},getKeysMap=function(i,n){const r={};return(i||[]).forEach((g,V)=>{r[getRowIdentity(g,n)]={row:g,index:V}}),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 V=n[g];typeof V<"u"&&(r[g]=V)}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 V=i.indexOf(n),k=V!==-1,$=re=>{re==="add"?i.push(n):i.splice(V,1),g=!0,isArray$3(n.children)&&n.children.forEach(oe=>{toggleRowStatus(i,oe,r??!k)})};return isBoolean(r)?r&&!k?$("add"):!r&&k&&$("remove"):$(k?"remove":"add"),g}function walkTreeNode(i,n,r="children",g="hasChildren"){const V=$=>!(Array.isArray($)&&$.length);function k($,re,oe){n($,re,oe),re.forEach(Ce=>{if(Ce[g]){n(Ce,null,oe+1);return}const ie=Ce[r];V(ie)||k(Ce,ie,oe+1)})}i.forEach($=>{if($[g]){n($,null,0);return}const re=$[r];V(re)||k($,re,0)})}let removePopper;function createTablePopper(i,n,r,g,V){V=merge$2({enterable:!0,showArrow:!0},V);const k=i==null?void 0:i.dataset.prefix,$=i==null?void 0:i.querySelector(`.${k}-scrollbar__wrap`);function re(){const Ne=V.effect==="light",he=document.createElement("div");return he.className=[`${k}-popper`,Ne?"is-light":"is-dark",V.popperClass||""].join(" "),r=escapeHtml$1(r),he.innerHTML=r,he.style.zIndex=String(g()),i==null||i.appendChild(he),he}function oe(){const Ne=document.createElement("div");return Ne.className=`${k}-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;V.enterable&&({onOpen:ae,onClose:le}=useDelayedToggle({showAfter:V.showAfter,hideAfter:V.hideAfter,open:Ce,close:removePopper}));const Ie=re();Ie.onmouseenter=ae,Ie.onmouseleave=le;const ue=[];if(V.offset&&ue.push({name:"offset",options:{offset:[0,V.offset]}}),V.showArrow){const Ne=Ie.appendChild(oe());ue.push({name:"arrow",options:{element:Ne,padding:10}})}const de=V.popperOptions||{};return ie=yn(n,Ie,{placement:V.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 V=0,k=i;const $=r.states.columns.value;if(g){const oe=getCurrentColumns(g[i]);V=$.slice(0,$.indexOf(oe[0])).reduce(getColSpan,0),k=V+oe.reduce(getColSpan,0)-1}else V=i;let re;switch(n){case"left":k<r.states.fixedLeafColumnsLength.value&&(re="left");break;case"right":V>=$.length-r.states.rightFixedLeafColumnsLength.value&&(re="right");break;default:k<r.states.fixedLeafColumnsLength.value?re="left":V>=$.length-r.states.rightFixedLeafColumnsLength.value&&(re="right")}return re?{direction:re,start:V,after:k}:{}},getFixedColumnsClass=(i,n,r,g,V,k=0)=>{const $=[],{direction:re,start:oe,after:Ce}=isFixedColumn(n,r,g,V);if(re){const ie=re==="left";$.push(`${i}-fixed-column--${re}`),ie&&Ce+k===g.states.fixedLeafColumnsLength.value-1?$.push("is-last-column"):!ie&&oe-k===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:V,start:k=0,after:$=0}=isFixedColumn(i,n,r,g);if(!V)return;const re={},oe=V==="left",Ce=r.states.columns.value;return oe?re.left=Ce.slice(0,k).reduce(getOffset,0):re.right=Ce.slice($+1).reverse().reduce(getOffset,0),re},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 oe=i.data.value||[],Ce=i.rowKey.value;if(r.value)g.value=oe.slice();else if(Ce){const ie=getKeysMap(g.value,Ce);g.value=oe.reduce((ae,le)=>{const Ie=getRowIdentity(le,Ce);return ie[Ie]&&ae.push(le),ae},[])}else g.value=[]},toggleRowExpansion:(oe,Ce)=>{toggleRowStatus(g.value,oe,Ce)&&n.emit("expand-change",oe,g.value.slice())},setExpandRowKeys:oe=>{n.store.assertRowKey();const Ce=i.data.value||[],ie=i.rowKey.value,ae=getKeysMap(Ce,ie);g.value=oe.reduce((le,Ie)=>{const ue=ae[Ie];return ue&&le.push(ue.row),le},[])},isRowExpanded:oe=>{const Ce=i.rowKey.value;return Ce?!!getKeysMap(g.value,Ce)[getRowIdentity(oe,Ce)]:g.value.includes(oe)},states:{expandRows:g,defaultExpandAll:r}}}function useCurrent(i){const n=vue.getCurrentInstance(),r=vue.ref(null),g=vue.ref(null),V=Ce=>{n.store.assertRowKey(),r.value=Ce,$(Ce)},k=()=>{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:V,restoreCurrentRowKey:k,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),k())},states:{_currentRowKey:r,currentRow:g}}}function useTree(i){const n=vue.ref([]),r=vue.ref({}),g=vue.ref(16),V=vue.ref(!1),k=vue.ref({}),$=vue.ref("hasChildren"),re=vue.ref("children"),oe=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,ze=Object.keys(k.value),pe={};return ze.length&&ze.forEach(Ve=>{if(k.value[Ve].length){const Oe={children:[]};k.value[Ve].forEach(_e=>{const At=getRowIdentity(_e,he);Oe.children.push(At),_e[$.value]&&!pe[At]&&(pe[At]={children:[]})}),pe[Ve]=Oe}}),pe}),ae=he=>{const ze=i.rowKey.value,pe={};return walkTreeNode(he,(Ve,Oe,_e)=>{const At=getRowIdentity(Ve,ze);Array.isArray(Oe)?pe[At]={children:Oe.map($e=>getRowIdentity($e,ze)),level:_e}:V.value&&(pe[At]={children:[],lazy:!0,level:_e})},re.value,$.value),pe},le=(he=!1,ze=(pe=>(pe=oe.store)==null?void 0:pe.states.defaultExpandAll.value)())=>{var pe;const Ve=Ce.value,Oe=ie.value,_e=Object.keys(Ve),At={};if(_e.length){const $e=vue.unref(r),Fe=[],Ue=(Dt,qe)=>{if(he)return n.value?ze||n.value.includes(qe):!!(ze||Dt!=null&&Dt.expanded);{const kt=ze||n.value&&n.value.includes(qe);return!!(Dt!=null&&Dt.expanded||kt)}};_e.forEach(Dt=>{const qe=$e[Dt],kt={...Ve[Dt]};if(kt.expanded=Ue(qe,Dt),kt.lazy){const{loaded:jt=!1,loading:Pt=!1}=qe||{};kt.loaded=!!jt,kt.loading=!!Pt,Fe.push(Dt)}At[Dt]=kt});const xe=Object.keys(Oe);V.value&&xe.length&&Fe.length&&xe.forEach(Dt=>{const qe=$e[Dt],kt=Oe[Dt].children;if(Fe.includes(Dt)){if(At[Dt].children.length!==0)throw new Error("[ElTable]children must be an empty array.");At[Dt].children=kt}else{const{loaded:jt=!1,loading:Pt=!1}=qe||{};At[Dt]={lazy:!0,loaded:!!jt,loading:!!Pt,expanded:Ue(qe,Dt),children:kt,level:""}}})}r.value=At,(pe=oe.store)==null||pe.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,ze)=>{oe.store.assertRowKey();const pe=i.rowKey.value,Ve=getRowIdentity(he,pe),Oe=Ve&&r.value[Ve];if(Ve&&Oe&&"expanded"in Oe){const _e=Oe.expanded;ze=typeof ze>"u"?!Oe.expanded:ze,r.value[Ve].expanded=ze,_e!==ze&&oe.emit("expand-change",he,ze),oe.store.updateTableScrollY()}},de=he=>{oe.store.assertRowKey();const ze=i.rowKey.value,pe=getRowIdentity(he,ze),Ve=r.value[pe];V.value&&Ve&&"loaded"in Ve&&!Ve.loaded?Ne(he,pe,Ve):ue(he,void 0)},Ne=(he,ze,pe)=>{const{load:Ve}=oe.props;Ve&&!r.value[ze].loaded&&(r.value[ze].loading=!0,Ve(he,pe,Oe=>{if(!Array.isArray(Oe))throw new TypeError("[ElTable] data must be an array");r.value[ze].loading=!1,r.value[ze].loaded=!0,r.value[ze].expanded=!0,Oe.length&&(k.value[ze]=Oe),oe.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:V,lazyTreeNodeMap:k,lazyColumnIdentifier:$,childrenColumnName:re}}}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),V=vue.ref([]),k=vue.ref([]),$=vue.ref(!1),re=vue.ref([]),oe=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),ze=vue.ref(0),pe=vue.ref(!1),Ve=vue.ref([]),Oe=vue.ref(!1),_e=vue.ref(!1),At=vue.ref(null),$e=vue.ref({}),Fe=vue.ref(null),Ue=vue.ref(null),xe=vue.ref(null),Dt=vue.ref(null),qe=vue.ref(null);vue.watch(V,()=>n.state&&ti(!1),{deep:!0});const kt=()=>{if(!g.value)throw new Error("[ElTable] prop row-key is required")},jt=Oi=>{var Zi;(Zi=Oi.children)==null||Zi.forEach(Wi=>{Wi.fixed=Oi.fixed,jt(Wi)})},Pt=()=>{re.value.forEach(ki=>{jt(ki)}),ie.value=re.value.filter(ki=>ki.fixed===!0||ki.fixed==="left"),ae.value=re.value.filter(ki=>ki.fixed==="right"),ie.value.length>0&&re.value[0]&&re.value[0].type==="selection"&&!re.value[0].fixed&&(re.value[0].fixed=!0,ie.value.unshift(re.value[0]));const Oi=re.value.filter(ki=>!ki.fixed);oe.value=[].concat(ie.value).concat(Oi).concat(ae.value);const Zi=doFlattenColumns(Oi),Wi=doFlattenColumns(ie.value),Vi=doFlattenColumns(ae.value);Ne.value=Zi.length,he.value=Wi.length,ze.value=Vi.length,Ce.value=[].concat(Wi).concat(Zi).concat(Vi),$.value=ie.value.length>0||ae.value.length>0},ti=(Oi,Zi=!1)=>{Oi&&Pt(),Zi?n.state.doLayout():n.state.debouncedUpdateLayout()},ei=Oi=>Ve.value.includes(Oi),Et=()=>{pe.value=!1,Ve.value.length&&(Ve.value=[],n.emit("selection-change",[]))},ni=()=>{let Oi;if(g.value){Oi=[];const Zi=getKeysMap(Ve.value,g.value),Wi=getKeysMap(V.value,g.value);for(const Vi in Zi)hasOwn$1(Zi,Vi)&&!Wi[Vi]&&Oi.push(Zi[Vi].row)}else Oi=Ve.value.filter(Zi=>!V.value.includes(Zi));if(Oi.length){const Zi=Ve.value.filter(Wi=>!Oi.includes(Wi));Ve.value=Zi,n.emit("selection-change",Zi.slice())}},ri=()=>(Ve.value||[]).slice(),ci=(Oi,Zi=void 0,Wi=!0)=>{if(toggleRowStatus(Ve.value,Oi,Zi)){const ki=(Ve.value||[]).slice();Wi&&n.emit("select",ki,Oi),n.emit("selection-change",ki)}},Ci=()=>{var Oi,Zi;const Wi=_e.value?!pe.value:!(pe.value||Ve.value.length);pe.value=Wi;let Vi=!1,ki=0;const Hi=(Zi=(Oi=n==null?void 0:n.store)==null?void 0:Oi.states)==null?void 0:Zi.rowKey.value;V.value.forEach((ji,Fi)=>{const Ki=Fi+ki;At.value?At.value.call(null,ji,Ki)&&toggleRowStatus(Ve.value,ji,Wi)&&(Vi=!0):toggleRowStatus(Ve.value,ji,Wi)&&(Vi=!0),ki+=yi(getRowIdentity(ji,Hi))}),Vi&&n.emit("selection-change",Ve.value?Ve.value.slice():[]),n.emit("select-all",Ve.value)},li=()=>{const Oi=getKeysMap(Ve.value,g.value);V.value.forEach(Zi=>{const Wi=getRowIdentity(Zi,g.value),Vi=Oi[Wi];Vi&&(Ve.value[Vi.index]=Zi)})},ui=()=>{var Oi,Zi,Wi;if(((Oi=V.value)==null?void 0:Oi.length)===0){pe.value=!1;return}let Vi;g.value&&(Vi=getKeysMap(Ve.value,g.value));const ki=function(Ki){return Vi?!!Vi[getRowIdentity(Ki,g.value)]:Ve.value.includes(Ki)};let Hi=!0,ji=0,Fi=0;for(let Ki=0,Ti=(V.value||[]).length;Ki<Ti;Ki++){const Di=(Wi=(Zi=n==null?void 0:n.store)==null?void 0:Zi.states)==null?void 0:Wi.rowKey.value,Yi=Ki+Fi,Ri=V.value[Ki],Ei=At.value&&At.value.call(null,Ri,Yi);if(ki(Ri))ji++;else if(!At.value||Ei){Hi=!1;break}Fi+=yi(getRowIdentity(Ri,Di))}ji===0&&(Hi=!1),pe.value=Hi},yi=Oi=>{var Zi;if(!n||!n.store)return 0;const{treeData:Wi}=n.store.states;let Vi=0;const ki=(Zi=Wi.value[Oi])==null?void 0:Zi.children;return ki&&(Vi+=ki.length,ki.forEach(Hi=>{Vi+=yi(Hi)})),Vi},Mi=(Oi,Zi)=>{Array.isArray(Oi)||(Oi=[Oi]);const Wi={};return Oi.forEach(Vi=>{$e.value[Vi.id]=Zi,Wi[Vi.columnKey||Vi.id]=Zi}),Wi},zi=(Oi,Zi,Wi)=>{Ue.value&&Ue.value!==Oi&&(Ue.value.order=null),Ue.value=Oi,xe.value=Zi,Dt.value=Wi},Ai=()=>{let Oi=vue.unref(k);Object.keys($e.value).forEach(Zi=>{const Wi=$e.value[Zi];if(!Wi||Wi.length===0)return;const Vi=getColumnById({columns:Ce.value},Zi);Vi&&Vi.filterMethod&&(Oi=Oi.filter(ki=>Wi.some(Hi=>Vi.filterMethod.call(null,Hi,ki,Vi))))}),Fe.value=Oi},Ii=()=>{V.value=sortData(Fe.value,{sortingColumn:Ue.value,sortProp:xe.value,sortOrder:Dt.value})},ai=(Oi=void 0)=>{Oi&&Oi.filter||Ai(),Ii()},pi=Oi=>{const{tableHeaderRef:Zi}=n.refs;if(!Zi)return;const Wi=Object.assign({},Zi.filterPanels),Vi=Object.keys(Wi);if(Vi.length)if(typeof Oi=="string"&&(Oi=[Oi]),Array.isArray(Oi)){const ki=Oi.map(Hi=>getColumnByKey({columns:Ce.value},Hi));Vi.forEach(Hi=>{const ji=ki.find(Fi=>Fi.id===Hi);ji&&(ji.filteredValue=[])}),n.store.commit("filterChange",{column:ki,values:[],silent:!0,multi:!0})}else Vi.forEach(ki=>{const Hi=Ce.value.find(ji=>ji.id===ki);Hi&&(Hi.filteredValue=[])}),$e.value={},n.store.commit("filterChange",{column:{},values:[],silent:!0})},Ni=()=>{Ue.value&&(zi(null,null,null),n.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:di,toggleRowExpansion:fi,updateExpandRows:vi,states:bi,isRowExpanded:si}=useExpand({data:V,rowKey:g}),{updateTreeExpandKeys:wi,toggleTreeExpansion:oi,updateTreeData:Lt,loadOrToggle:ii,states:gi}=useTree({data:V,rowKey:g}),{updateCurrentRowData:hi,updateCurrentRow:mi,setCurrentRowKey:Si,states:xi}=useCurrent({data:V,rowKey:g});return{assertRowKey:kt,updateColumns:Pt,scheduleLayout:ti,isSelected:ei,clearSelection:Et,cleanSelection:ni,getSelectionRows:ri,toggleRowSelection:ci,_toggleAllSelection:Ci,toggleAllSelection:null,updateSelectionByRowKey:li,updateAllSelected:ui,updateFilters:Mi,updateCurrentRow:mi,updateSort:zi,execFilter:Ai,execSort:Ii,execQuery:ai,clearFilter:pi,clearSort:Ni,toggleRowExpansion:fi,setExpandRowKeysAdapter:Oi=>{di(Oi),wi(Oi)},setCurrentRowKey:Si,toggleRowExpansionAdapter:(Oi,Zi)=>{Ce.value.some(({type:Vi})=>Vi==="expand")?fi(Oi,Zi):oi(Oi,Zi)},isRowExpanded:si,updateExpandRows:vi,updateCurrentRowData:hi,loadOrToggle:ii,updateTreeData:Lt,states:{tableSize:r,rowKey:g,data:V,_data:k,isComplex:$,_columns:re,originColumns:oe,columns:Ce,fixedColumns:ie,rightFixedColumns:ae,leafColumns:le,fixedLeafColumns:Ie,rightFixedLeafColumns:ue,updateOrderFns:de,leafColumnsLength:Ne,fixedLeafColumnsLength:he,rightFixedLeafColumnsLength:ze,isAllSelected:pe,selection:Ve,reserveSelection:Oe,selectOnIndeterminate:_e,selectable:At,filters:$e,filteredData:Fe,sortingColumn:Ue,sortProp:xe,sortOrder:Dt,hoverRow:qe,...bi,...gi,...xi}}}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($,re){const oe=vue.unref($._data)!==re;$.data.value=re,$._data.value=re,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()):oe?i.store.clearSelection():i.store.cleanSelection(),i.store.updateAllSelected(),i.$ready&&i.store.scheduleLayout()},insertColumn($,re,oe,Ce){const ie=vue.unref($._columns);let ae=[];oe?(oe&&!oe.children&&(oe.children=[]),oe.children.push(re),ae=replaceColumn(ie,oe)):(ie.push(re),ae=ie),sortColumn(ae),$._columns.value=ae,$.updateOrderFns.push(Ce),re.type==="selection"&&($.selectable.value=re.selectable,$.reserveSelection.value=re.reserveSelection),i.$ready&&(i.store.updateColumns(),i.store.scheduleLayout())},updateColumnOrder($,re){var oe;((oe=re.getColumnIndex)==null?void 0:oe.call(re))!==re.no&&(sortColumn($._columns.value),i.$ready&&i.store.updateColumns())},removeColumn($,re,oe,Ce){const ie=vue.unref($._columns)||[];if(oe)oe.children.splice(oe.children.findIndex(le=>le.id===re.id),1),vue.nextTick(()=>{var le;((le=oe.children)==null?void 0:le.length)===0&&delete oe.children}),$._columns.value=replaceColumn(ie,oe);else{const le=ie.indexOf(re);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($,re){const{prop:oe,order:Ce,init:ie}=re;if(oe){const ae=vue.unref($.columns).find(le=>le.property===oe);ae&&(ae.order=Ce,i.store.updateSort(ae,oe,Ce),i.store.commit("changeSortCondition",{init:ie}))}},changeSortCondition($,re){const{sortingColumn:oe,sortProp:Ce,sortOrder:ie}=$,ae=vue.unref(oe),le=vue.unref(Ce),Ie=vue.unref(ie);Ie===null&&($.sortingColumn.value=null,$.sortProp.value=null);const ue={filter:!0};i.store.execQuery(ue),(!re||!(re.silent||re.init))&&i.emit("sort-change",{column:ae,prop:le,order:Ie}),i.store.updateTableScrollY()},filterChange($,re){const{column:oe,values:Ce,silent:ie}=re,ae=i.store.updateFilters(oe,Ce);i.store.execQuery(),ie||i.emit("filter-change",ae),i.store.updateTableScrollY()},toggleAllSelection(){i.store.toggleAllSelection()},rowSelectedChanged($,re){i.store.toggleRowSelection(re),i.store.updateAllSelected()},setHoverRow($,re){$.hoverRow.value=re},setCurrentRow($,re){i.store.updateCurrentRow(re)}},commit:function($,...re){const oe=i.store.mutations;if(oe[$])oe[$].apply(i,[i.store.states].concat(re));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,V=InitialStateMap[n];typeof InitialStateMap[n]=="object"&&(V=V.key,g=g||InitialStateMap[n].default),r.states[V].value=g}function getArrKeysValue(i,n){if(n.includes(".")){const r=n.split(".");let g=i;return r.forEach(V=>{g=g[V]}),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 V=this.scrollY.value;return g=r.wrapRef.scrollHeight>r.wrapRef.clientHeight,this.scrollY.value=g,V!==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 V=this.getFlattenColumns(),k=V.filter(oe=>typeof oe.width!="number");if(V.forEach(oe=>{typeof oe.width=="number"&&oe.realWidth&&(oe.realWidth=null)}),k.length>0&&n){if(V.forEach(oe=>{g+=Number(oe.width||oe.minWidth||80)}),g<=r){this.scrollX.value=!1;const oe=r-g;if(k.length===1)k[0].realWidth=Number(k[0].minWidth||80)+oe;else{const Ce=k.reduce((le,Ie)=>le+Number(Ie.minWidth||80),0),ie=oe/Ce;let ae=0;k.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}),k[0].realWidth=Number(k[0].minWidth||80)+oe-ae}}else this.scrollX.value=!0,k.forEach(oe=>{oe.realWidth=Number(oe.minWidth)});this.bodyWidth.value=Math.max(g,r),this.table.state.resizeState.value.width=this.bodyWidth.value}else V.forEach(oe=>{!oe.width&&!oe.minWidth?oe.realWidth=80:oe.realWidth=Number(oe.width||oe.minWidth),g+=oe.realWidth}),this.scrollX.value=g>r,this.bodyWidth.value=g;const $=this.store.states.fixedColumns.value;if($.length>0){let oe=0;$.forEach(Ce=>{oe+=Number(Ce.realWidth||Ce.width)}),this.fixedWidth.value=oe}const re=this.store.states.rightFixedColumns.value;if(re.length>0){let oe=0;re.forEach(Ce=>{oe+=Number(Ce.realWidth||Ce.width)}),this.rightFixedWidth.value=oe}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 V,k;switch(n){case"columns":(V=g.state)==null||V.onColumnsChange(this);break;case"scrollable":(k=g.state)==null||k.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${n}.`)}})}}const{CheckboxGroup:ElCheckboxGroup}=ElCheckbox,_sfc_main$E=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"),V=n==null?void 0:n.parent;V.filterPanels.value[i.column.id]||(V.filterPanels.value[i.column.id]=n);const k=vue.ref(!1),$=vue.ref(null),re=vue.computed(()=>i.column&&i.column.filters),oe=vue.computed({get:()=>{var Ve;return(((Ve=i.column)==null?void 0:Ve.filteredValue)||[])[0]},set:Ve=>{Ce.value&&(typeof Ve<"u"&&Ve!==null?Ce.value.splice(0,1,Ve):Ce.value.splice(0,1))}}),Ce=vue.computed({get(){return i.column?i.column.filteredValue||[]:[]},set(Ve){i.column&&i.upDataColumn("filteredValue",Ve)}}),ie=vue.computed(()=>i.column?i.column.filterMultiple:!0),ae=Ve=>Ve.value===oe.value,le=()=>{k.value=!1},Ie=Ve=>{Ve.stopPropagation(),k.value=!k.value},ue=()=>{k.value=!1},de=()=>{ze(Ce.value),le()},Ne=()=>{Ce.value=[],ze(Ce.value),le()},he=Ve=>{oe.value=Ve,ze(typeof Ve<"u"&&Ve!==null?Ce.value:[]),le()},ze=Ve=>{i.store.commit("filterChange",{column:i.column,values:Ve}),i.store.updateAllSelected()};vue.watch(k,Ve=>{i.column&&i.upDataColumn("filterOpened",Ve)},{immediate:!0});const pe=vue.computed(()=>{var Ve,Oe;return(Oe=(Ve=$.value)==null?void 0:Ve.popperRef)==null?void 0:Oe.contentRef});return{tooltipVisible:k,multiple:ie,filteredValue:Ce,filterValue:oe,filters:re,handleConfirm:de,handleReset:Ne,handleSelect:he,isActive:ae,t:r,ns:g,showFilterPanel:Ie,hideFilterPanel:ue,popperPaneRef:pe,tooltip:$}}}),_hoisted_1$r={key:0},_hoisted_2$m=["disabled"],_hoisted_3$g=["label","onClick"];function _sfc_render$4(i,n,r,g,V,k){const $=vue.resolveComponent("el-checkbox"),re=vue.resolveComponent("el-checkbox-group"),oe=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$r,[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("content"))},[vue.createVNode(oe,{"wrap-class":i.ns.e("wrap")},{default:vue.withCtx(()=>[vue.createVNode(re,{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$E,[["render",_sfc_render$4],["__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),V(r.value)}),vue.onUpdated(()=>{g(r.value),V(r.value)}),vue.onUnmounted(()=>{r.value.removeObserver(n)});const r=vue.computed(()=>{const k=i.layout;if(!k)throw new Error("Can not find table layout.");return k}),g=k=>{var $;const re=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col"))||[];if(!re.length)return;const oe=k.getFlattenColumns(),Ce={};oe.forEach(ie=>{Ce[ie.id]=ie});for(let ie=0,ae=re.length;ie<ae;ie++){const le=re[ie],Ie=le.getAttribute("name"),ue=Ce[Ie];ue&&le.setAttribute("width",ue.realWidth||ue.width)}},V=k=>{var $,re;const oe=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let ie=0,ae=oe.length;ie<ae;ie++)oe[ie].setAttribute("width",k.scrollY.value?k.gutterWidth:"0");const Ce=((re=i.vnode.el)==null?void 0:re.querySelectorAll("th.gutter"))||[];for(let ie=0,ae=Ce.length;ie<ae;ie++){const le=Ce[ie];le.style.width=k.scrollY.value?`${k.gutterWidth}px`:"0",le.style.display=k.scrollY.value?"":"none"}};return{tableLayout:r.value,onColumnsChange:g,onScrollableChange:V}}const TABLE_INJECTION_KEY=Symbol("ElTable");function useEvent(i,n){const r=vue.getCurrentInstance(),g=vue.inject(TABLE_INJECTION_KEY),V=de=>{de.stopPropagation()},k=(de,Ne)=>{!Ne.filters&&Ne.sortable?ue(de,Ne,!1):Ne.filterable&&!Ne.sortable&&V(de),g==null||g.emit("header-click",Ne,de)},$=(de,Ne)=>{g==null||g.emit("header-contextmenu",Ne,de)},re=vue.ref(null),oe=vue.ref(!1),Ce=vue.ref({}),ie=(de,Ne)=>{if(isClient&&!(Ne.children&&Ne.children.length>0)&&re.value&&i.border){oe.value=!0;const he=g;n("set-drag-visible",!0);const pe=(he==null?void 0:he.vnode.el).getBoundingClientRect().left,Ve=r.vnode.el.querySelector(`th.${Ne.id}`),Oe=Ve.getBoundingClientRect(),_e=Oe.left-pe+30;addClass(Ve,"noclick"),Ce.value={startMouseLeft:de.clientX,startLeft:Oe.right-pe,startColumnLeft:Oe.left-pe,tableLeft:pe};const At=he==null?void 0:he.refs.resizeProxy;At.style.left=`${Ce.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const $e=Ue=>{const xe=Ue.clientX-Ce.value.startMouseLeft,Dt=Ce.value.startLeft+xe;At.style.left=`${Math.max(_e,Dt)}px`},Fe=()=>{if(oe.value){const{startColumnLeft:Ue,startLeft:xe}=Ce.value,qe=Number.parseInt(At.style.left,10)-Ue;Ne.width=Ne.realWidth=qe,he==null||he.emit("header-dragend",Ne.width,xe-Ue,Ne,de),requestAnimationFrame(()=>{i.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",oe.value=!1,re.value=null,Ce.value={},n("set-drag-visible",!1)}document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",Fe),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{removeClass(Ve,"noclick")},0)};document.addEventListener("mousemove",$e),document.addEventListener("mouseup",Fe)}},ae=(de,Ne)=>{if(Ne.children&&Ne.children.length>0)return;const he=de.target;if(!isElement(he))return;const ze=he==null?void 0:he.closest("th");if(!(!Ne||!Ne.resizable)&&!oe.value&&i.border){const pe=ze.getBoundingClientRect(),Ve=document.body.style;pe.width>12&&pe.right-de.pageX<8?(Ve.cursor="col-resize",hasClass(ze,"is-sortable")&&(ze.style.cursor="col-resize"),re.value=Ne):oe.value||(Ve.cursor="",hasClass(ze,"is-sortable")&&(ze.style.cursor="pointer"),re.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 ze;de.stopPropagation();const pe=Ne.order===he?null:he||Ie(Ne),Ve=(ze=de.target)==null?void 0:ze.closest("th");if(Ve&&hasClass(Ve,"noclick")){removeClass(Ve,"noclick");return}if(!Ne.sortable)return;const Oe=i.store.states;let _e=Oe.sortProp.value,At;const $e=Oe.sortingColumn.value;($e!==Ne||$e===Ne&&$e.order===null)&&($e&&($e.order=null),Oe.sortingColumn.value=Ne,_e=Ne.property),pe?At=Ne.order=pe:At=Ne.order=null,Oe.sortProp.value=_e,Oe.sortOrder.value=At,g==null||g.store.commit("changeSortCondition")};return{handleHeaderClick:k,handleHeaderContextMenu:$,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:ue,handleFilterClick:V}}function useStyle$2(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getHeaderRowStyle:re=>{const oe=n==null?void 0:n.props.headerRowStyle;return typeof oe=="function"?oe.call(null,{rowIndex:re}):oe},getHeaderRowClass:re=>{const oe=[],Ce=n==null?void 0:n.props.headerRowClassName;return typeof Ce=="string"?oe.push(Ce):typeof Ce=="function"&&oe.push(Ce.call(null,{rowIndex:re})),oe.join(" ")},getHeaderCellStyle:(re,oe,Ce,ie)=>{var ae;let le=(ae=n==null?void 0:n.props.headerCellStyle)!=null?ae:{};typeof le=="function"&&(le=le.call(null,{rowIndex:re,columnIndex:oe,row:Ce,column:ie}));const Ie=getFixedColumnOffset(oe,ie.fixed,i.store,Ce);return ensurePosition(Ie,"left"),ensurePosition(Ie,"right"),Object.assign({},le,Ie)},getHeaderCellClass:(re,oe,Ce,ie)=>{const ae=getFixedColumnsClass(r.b(),oe,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:re,columnIndex:oe,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=(k,$)=>{if($&&(k.level=$.level+1,n<k.level&&(n=k.level)),k.children){let re=0;k.children.forEach(oe=>{r(oe,k),re+=oe.colSpan}),k.colSpan=re}else k.colSpan=1};i.forEach(k=>{k.level=1,r(k,void 0)});const g=[];for(let k=0;k<n;k++)g.push([]);return getAllColumns(i).forEach(k=>{k.children?(k.rowSpan=1,k.children.forEach($=>$.isSubColumn=!0)):k.rowSpan=n-k.level+1,g[k.level-1].push(k)}),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 k=r.value.length>1;return k&&n&&(n.state.isGroup.value=!0),k}),toggleAllSelection:k=>{k.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),V=useNamespace("table"),k=vue.ref({}),{onColumnsChange:$,onScrollableChange:re}=useLayoutObserver(g);vue.onMounted(async()=>{await vue.nextTick(),await vue.nextTick();const{prop:_e,order:At}=i.defaultSort;g==null||g.store.commit("sort",{prop:_e,order:At,init:!0})});const{handleHeaderClick:oe,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue}=useEvent(i,n),{getHeaderRowStyle:de,getHeaderRowClass:Ne,getHeaderCellStyle:he,getHeaderCellClass:ze}=useStyle$2(i),{isGroup:pe,toggleAllSelection:Ve,columnRows:Oe}=useUtils$1(i);return r.state={onColumnsChange:$,onScrollableChange:re},r.filterPanels=k,{ns:V,filterPanels:k,onColumnsChange:$,onScrollableChange:re,columnRows:Oe,getHeaderRowClass:Ne,getHeaderRowStyle:de,getHeaderCellClass:ze,getHeaderCellStyle:he,handleHeaderClick:oe,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue,isGroup:pe,toggleAllSelection:Ve}},render(){const{ns:i,isGroup:n,columnRows:r,getHeaderCellStyle:g,getHeaderCellClass:V,getHeaderRowClass:k,getHeaderRowStyle:$,handleHeaderClick:re,handleHeaderContextMenu:oe,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:k(he),key:he,style:$(he)},Ne.map((ze,pe)=>(ze.rowSpan>de&&(de=ze.rowSpan),vue.h("th",{class:V(he,pe,Ne,ze),colspan:ze.colSpan,key:`${ze.id}-thead`,rowspan:ze.rowSpan,style:g(he,pe,Ne,ze),onClick:Ve=>re(Ve,ze),onContextmenu:Ve=>oe(Ve,ze),onMousedown:Ve=>Ce(Ve,ze),onMousemove:Ve=>ie(Ve,ze),onMouseout:le},[vue.h("div",{class:["cell",ze.filteredValue&&ze.filteredValue.length>0?"highlight":""]},[ze.renderHeader?ze.renderHeader({column:ze,$index:pe,store:Ie,_self:ue}):ze.label,ze.sortable&&vue.h("span",{onClick:Ve=>ae(Ve,ze),class:"caret-wrapper"},[vue.h("i",{onClick:Ve=>ae(Ve,ze,"ascending"),class:"sort-caret ascending"}),vue.h("i",{onClick:Ve=>ae(Ve,ze,"descending"),class:"sort-caret descending"})]),ze.filterable&&vue.h(FilterPanel,{store:Ie,placement:ze.filterPlacement||"bottom-start",column:ze,upDataColumn:(Ve,Oe)=>{ze[Ve]=Oe}})])]))))))}});function useEvents(i){const n=vue.inject(TABLE_INJECTION_KEY),r=vue.ref(""),g=vue.ref(vue.h("div")),{nextZIndex:V}=useZIndex(),k=(ue,de,Ne)=>{var he;const ze=n,pe=getCell(ue);let Ve;const Oe=(he=ze==null?void 0:ze.vnode.el)==null?void 0:he.dataset.prefix;pe&&(Ve=getColumnByCell({columns:i.store.states.columns.value},pe,Oe),Ve&&(ze==null||ze.emit(`cell-${Ne}`,de,Ve,pe,ue))),ze==null||ze.emit(`row-${Ne}`,de,Ve,ue)},$=(ue,de)=>{k(ue,de,"dblclick")},re=(ue,de)=>{i.store.commit("setCurrentRow",de),k(ue,de,"click")},oe=(ue,de)=>{k(ue,de,"contextmenu")},Ce=debounce(ue=>{i.store.commit("setHoverRow",ue)},30),ie=debounce(()=>{i.store.commit("setHoverRow",null)},30),ae=ue=>{const de=window.getComputedStyle(ue,null),Ne=Number.parseInt(de.paddingLeft,10)||0,he=Number.parseInt(de.paddingRight,10)||0,ze=Number.parseInt(de.paddingTop,10)||0,pe=Number.parseInt(de.paddingBottom,10)||0;return{left:Ne,right:he,top:ze,bottom:pe}};return{handleDoubleClick:$,handleClick:re,handleContextMenu:oe,handleMouseEnter:Ce,handleMouseLeave:ie,handleCellMouseEnter:(ue,de,Ne)=>{var he;const ze=n,pe=getCell(ue),Ve=(he=ze==null?void 0:ze.vnode.el)==null?void 0:he.dataset.prefix;if(pe){const jt=getColumnByCell({columns:i.store.states.columns.value},pe,Ve),Pt=ze.hoverState={cell:pe,column:jt,row:de};ze==null||ze.emit("cell-mouse-enter",Pt.row,Pt.column,Pt.cell,ue)}if(!Ne)return;const Oe=ue.target.querySelector(".cell");if(!(hasClass(Oe,`${Ve}-tooltip`)&&Oe.childNodes.length))return;const _e=document.createRange();_e.setStart(Oe,0),_e.setEnd(Oe,Oe.childNodes.length);const At=Math.round(_e.getBoundingClientRect().width),$e=Math.round(_e.getBoundingClientRect().height),{top:Fe,left:Ue,right:xe,bottom:Dt}=ae(Oe),qe=Ue+xe,kt=Fe+Dt;(At+qe>Oe.offsetWidth||$e+kt>Oe.offsetHeight||Oe.scrollWidth>Oe.offsetWidth)&&createTablePopper(n==null?void 0:n.refs.tableWrapper,pe,pe.innerText||pe.textContent,V,Ne)},handleCellMouseLeave:ue=>{if(!getCell(ue))return;const Ne=n==null?void 0:n.hoverState;n==null||n.emit("cell-mouse-leave",Ne==null?void 0:Ne.row,Ne==null?void 0:Ne.column,Ne==null?void 0:Ne.cell,ue)},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:V,handleContextMenu:k,handleMouseEnter:$,handleMouseLeave:re,handleCellMouseEnter:oe,handleCellMouseLeave:Ce,tooltipContent:ie,tooltipTrigger:ae}=useEvents(i),{getRowStyle:le,getRowClass:Ie,getCellStyle:ue,getCellClass:de,getSpan:Ne,getColspanRealWidth:he}=useStyles(i),ze=vue.computed(()=>i.store.states.columns.value.findIndex(({type:At})=>At==="default")),pe=(At,$e)=>{const Fe=n.props.rowKey;return Fe?getRowIdentity(At,Fe):$e},Ve=(At,$e,Fe,Ue=!1)=>{const{tooltipEffect:xe,tooltipOptions:Dt,store:qe}=i,{indent:kt,columns:jt}=qe.states,Pt=Ie(At,$e);let ti=!0;Fe&&(Pt.push(r.em("row",`level-${Fe.level}`)),ti=Fe.display);const ei=ti?null:{display:"none"};return vue.h("tr",{style:[ei,le(At,$e)],class:Pt,key:pe(At,$e),onDblclick:Et=>g(Et,At),onClick:Et=>V(Et,At),onContextmenu:Et=>k(Et,At),onMouseenter:()=>$($e),onMouseleave:re},jt.value.map((Et,ni)=>{const{rowspan:ri,colspan:ci}=Ne(At,Et,$e,ni);if(!ri||!ci)return null;const Ci={...Et};Ci.realWidth=he(jt.value,ci,ni);const li={store:i.store,_self:i.context||n,column:Ci,row:At,$index:$e,cellIndex:ni,expanded:Ue};ni===ze.value&&Fe&&(li.treeNode={indent:Fe.level*kt.value,level:Fe.level},typeof Fe.expanded=="boolean"&&(li.treeNode.expanded=Fe.expanded,"loading"in Fe&&(li.treeNode.loading=Fe.loading),"noLazyChildren"in Fe&&(li.treeNode.noLazyChildren=Fe.noLazyChildren)));const ui=`${$e},${ni}`,yi=Ci.columnKey||Ci.rawColumnKey||"",Mi=Oe(ni,Et,li),zi=Et.showOverflowTooltip&&merge$2({effect:xe},Dt,Et.showOverflowTooltip);return vue.h("td",{style:ue($e,ni,At,Et),class:de($e,ni,At,Et,ci-1),key:`${yi}${ui}`,rowspan:ri,colspan:ci,onMouseenter:Ai=>oe(Ai,At,zi),onMouseleave:Ce},[Mi])}))},Oe=(At,$e,Fe)=>$e.renderCell(Fe);return{wrappedRowRender:(At,$e)=>{const Fe=i.store,{isRowExpanded:Ue,assertRowKey:xe}=Fe,{treeData:Dt,lazyTreeNodeMap:qe,childrenColumnName:kt,rowKey:jt}=Fe.states,Pt=Fe.states.columns.value;if(Pt.some(({type:ei})=>ei==="expand")){const ei=Ue(At),Et=Ve(At,$e,void 0,ei),ni=n.renderExpanded;return ei?ni?[[Et,vue.h("tr",{key:`expanded-row__${Et.key}`},[vue.h("td",{colspan:Pt.length,class:`${r.e("cell")} ${r.e("expanded-cell")}`},[ni({row:At,$index:$e,store:Fe,expanded:ei})])])]]:(console.error("[Element Error]renderExpanded is required."),Et):[[Et]]}else if(Object.keys(Dt.value).length){xe();const ei=getRowIdentity(At,jt.value);let Et=Dt.value[ei],ni=null;Et&&(ni={expanded:Et.expanded,level:Et.level,display:!0},typeof Et.lazy=="boolean"&&(typeof Et.loaded=="boolean"&&Et.loaded&&(ni.noLazyChildren=!(Et.children&&Et.children.length)),ni.loading=Et.loading));const ri=[Ve(At,$e,ni)];if(Et){let ci=0;const Ci=(ui,yi)=>{ui&&ui.length&&yi&&ui.forEach(Mi=>{const zi={display:yi.display&&yi.expanded,level:yi.level+1,expanded:!1,noLazyChildren:!1,loading:!1},Ai=getRowIdentity(Mi,jt.value);if(Ai==null)throw new Error("For nested data item, row-key is required.");if(Et={...Dt.value[Ai]},Et&&(zi.expanded=Et.expanded,Et.level=Et.level||zi.level,Et.display=!!(Et.expanded&&zi.display),typeof Et.lazy=="boolean"&&(typeof Et.loaded=="boolean"&&Et.loaded&&(zi.noLazyChildren=!(Et.children&&Et.children.length)),zi.loading=Et.loading)),ci++,ri.push(Ve(Mi,$e+ci,zi)),Et){const Ii=qe.value[Ai]||Mi[kt.value];Ci(Ii,Et)}})};Et.display=!0;const li=qe.value[ei]||At[kt.value];Ci(li,Et)}return ri}else return Ve(At,$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:V,tooltipContent:k,tooltipTrigger:$}=useRender$1(i),{onColumnsChange:re,onScrollableChange:oe}=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:re,onScrollableChange:oe,wrappedRowRender:V,tooltipContent:k,tooltipTrigger:$}},render(){const{wrappedRowRender:i,store:n}=this,r=n.states.data.value||[];return vue.h("tbody",{},[r.reduce((g,V)=>g.concat(i(V,g.length)),[])])}});function hColgroup(i){const n=i.tableLayout==="auto";let r=i.columns||[];n&&r.every(V=>V.width===void 0)&&(r=[]);const g=V=>{const k={key:`${i.tableLayout}_${V.id}`,style:{},name:void 0};return n?k.style={width:`${V.width}px`}:k.name=V.id,k};return vue.h("colgroup",{},r.map(V=>vue.h("col",g(V))))}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),V=vue.computed(()=>n.states.columns.value.length),k=vue.computed(()=>n.states.fixedColumns.value.length),$=vue.computed(()=>n.states.rightFixedColumns.value.length);return{leftFixedLeafCount:r,rightFixedLeafCount:g,columnsCount:V,leftFixedCount:k,rightFixedCount:$,columns:n.states.columns}}function useStyle$1(i){const{columns:n}=useMapState(),r=useNamespace("table");return{getCellClasses:(k,$)=>{const re=k[$],oe=[r.e("cell"),re.id,re.align,re.labelClassName,...getFixedColumnsClass(r.b(),$,re.fixed,i.store)];return re.className&&oe.push(re.className),re.children||oe.push(r.is("leaf")),oe},getCellStyles:(k,$)=>{const re=getFixedColumnOffset($,k.fixed,i.store);return ensurePosition(re,"left"),ensurePosition(re,"right"),re},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:V,ns:k}=this,$=this.store.states.data.value;let re=[];return g?re=g({columns:i,data:$}):i.forEach((oe,Ce)=>{if(Ce===0){re[Ce]=V;return}const ie=$.map(ue=>Number(ue[oe.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?re[Ce]="":re[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:k.e("footer"),cellspacing:"0",cellpadding:"0",border:"0"},[hColgroup({columns:i}),vue.h("tbody",[vue.h("tr",{},[...i.map((oe,Ce)=>vue.h("td",{key:Ce,colspan:oe.colSpan,rowspan:oe.rowSpan,class:r(i,Ce),style:n(oe,Ce)},[vue.h("div",{class:["cell",oe.labelClassName]},[re[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 V=vue.ref(!1),k=vue.ref(null),$=vue.ref(!1),re=Et=>{$.value=Et},oe=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],([Et,ni])=>{!vue.unref(ni)||!vue.unref(Et)||r.setCurrentRowKey(`${Et}`)},{immediate:!0}),vue.watch(()=>i.data,Et=>{g.store.commit("setData",Et)},{immediate:!0,deep:!0}),vue.watchEffect(()=>{i.expandRowKeys&&r.setExpandRowKeysAdapter(i.expandRowKeys)});const he=()=>{g.store.commit("setHoverRow",null),g.hoverState&&(g.hoverState=null)},ze=(Et,ni)=>{const{pixelX:ri,pixelY:ci}=ni;Math.abs(ri)>=Math.abs(ci)&&(g.refs.bodyWrapper.scrollLeft+=ni.pixelX/5)},pe=vue.computed(()=>i.height||i.maxHeight||r.states.fixedColumns.value.length>0||r.states.rightFixedColumns.value.length>0),Ve=vue.computed(()=>({width:n.bodyWidth.value?`${n.bodyWidth.value}px`:""})),Oe=()=>{pe.value&&n.updateElsHeight(),n.updateColumnsWidth(),requestAnimationFrame(Fe)};vue.onMounted(async()=>{await vue.nextTick(),r.updateColumns(),Ue(),requestAnimationFrame(Oe);const Et=g.vnode.el,ni=g.refs.headerWrapper;i.flexible&&Et&&Et.parentElement&&(Et.parentElement.style.minWidth="0"),oe.value={width:ae.value=Et.offsetWidth,height:Et.offsetHeight,headerHeight:i.showHeader&&ni?ni.offsetHeight:null},r.states.columns.value.forEach(ri=>{ri.filteredValue&&ri.filteredValue.length&&g.store.commit("filterChange",{column:ri,values:ri.filteredValue,silent:!0})}),g.$ready=!0});const _e=(Et,ni)=>{if(!Et)return;const ri=Array.from(Et.classList).filter(ci=>!ci.startsWith("is-scrolling-"));ri.push(n.scrollX.value?ni:"is-scrolling-none"),Et.className=ri.join(" ")},At=Et=>{const{tableWrapper:ni}=g.refs;_e(ni,Et)},$e=Et=>{const{tableWrapper:ni}=g.refs;return!!(ni&&ni.classList.contains(Et))},Fe=function(){if(!g.refs.scrollBarRef)return;if(!n.scrollX.value){const yi="is-scrolling-none";$e(yi)||At(yi);return}const Et=g.refs.scrollBarRef.wrapRef;if(!Et)return;const{scrollLeft:ni,offsetWidth:ri,scrollWidth:ci}=Et,{headerWrapper:Ci,footerWrapper:li}=g.refs;Ci&&(Ci.scrollLeft=ni),li&&(li.scrollLeft=ni);const ui=ci-ri-1;ni>=ui?At("is-scrolling-right"):At(ni===0?"is-scrolling-left":"is-scrolling-middle")},Ue=()=>{g.refs.scrollBarRef&&(g.refs.scrollBarRef.wrapRef&&useEventListener(g.refs.scrollBarRef.wrapRef,"scroll",Fe,{passive:!0}),i.fit?useResizeObserver(g.vnode.el,xe):useEventListener(window,"resize",xe),useResizeObserver(g.refs.bodyWrapper,()=>{var Et,ni;xe(),(ni=(Et=g.refs)==null?void 0:Et.scrollBarRef)==null||ni.update()}))},xe=()=>{var Et,ni,ri,ci;const Ci=g.vnode.el;if(!g.$ready||!Ci)return;let li=!1;const{width:ui,height:yi,headerHeight:Mi}=oe.value,zi=ae.value=Ci.offsetWidth;ui!==zi&&(li=!0);const Ai=Ci.offsetHeight;(i.height||pe.value)&&yi!==Ai&&(li=!0);const Ii=i.tableLayout==="fixed"?g.refs.headerWrapper:(Et=g.refs.tableHeaderRef)==null?void 0:Et.$el;i.showHeader&&(Ii==null?void 0:Ii.offsetHeight)!==Mi&&(li=!0),le.value=((ni=g.refs.tableWrapper)==null?void 0:ni.scrollHeight)||0,ue.value=(Ii==null?void 0:Ii.scrollHeight)||0,de.value=((ri=g.refs.footerWrapper)==null?void 0:ri.offsetHeight)||0,Ne.value=((ci=g.refs.appendWrapper)==null?void 0:ci.offsetHeight)||0,Ie.value=le.value-ue.value-de.value-Ne.value,li&&(oe.value={width:zi,height:Ai,headerHeight:i.showHeader&&(Ii==null?void 0:Ii.offsetHeight)||0},Oe())},Dt=useFormSize(),qe=vue.computed(()=>{const{bodyWidth:Et,scrollY:ni,gutterWidth:ri}=n;return Et.value?`${Et.value-(ni.value?ri:0)}px`:""}),kt=vue.computed(()=>i.maxHeight?"fixed":i.tableLayout),jt=vue.computed(()=>{if(i.data&&i.data.length)return null;let Et="100%";i.height&&Ie.value&&(Et=`${Ie.value}px`);const ni=ae.value;return{width:ni?`${ni}px`:"",height:Et}}),Pt=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:V,renderExpanded:k,setDragVisible:re,isGroup:Ce,handleMouseLeave:he,handleHeaderFooterMousewheel:ze,tableSize:Dt,emptyBlockStyle:jt,handleFixedMousewheel:(Et,ni)=>{const ri=g.refs.bodyWrapper;if(Math.abs(ni.spinY)>0){const ci=ri.scrollTop;ni.pixelY<0&&ci!==0&&Et.preventDefault(),ni.pixelY>0&&ri.scrollHeight-ri.clientHeight>ci&&Et.preventDefault(),ri.scrollTop+=Math.ceil(ni.pixelY/5)}else ri.scrollLeft+=Math.ceil(ni.pixelX/5)},resizeProxyVisible:$,bodyWidth:qe,resizeState:oe,doLayout:Oe,tableBodyStyles:Ve,tableLayout:kt,scrollbarViewStyle:ie,tableInnerStyle:Pt,scrollbarStyle:ti}}function useKeyRender(i){const n=vue.ref(),r=()=>{const V=i.vnode.el.querySelector(".hidden-columns"),k={childList:!0,subtree:!0},$=i.store.states.updateOrderFns;n.value=new MutationObserver(()=>{$.forEach(re=>re())}),n.value.observe(V,k)};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=(k,$)=>{const re=i.value;re&&re.scrollTo(k,$)},r=(k,$)=>{const re=i.value;re&&isNumber$1($)&&["Top","Left"].includes(k)&&re[`setScroll${k}`]($)};return{scrollBarRef:i,scrollTo:n,setScrollTop:k=>r("Top",k),setScrollLeft:k=>r("Left",k)}};let tableIdSeed=1;const _sfc_main$D=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 V=createStore(g,i);g.store=V;const k=new TableLayout({store:g.store,table:g,fit:i.fit,showHeader:i.showHeader});g.layout=k;const $=vue.computed(()=>(V.states.data.value||[]).length===0),{setCurrentRow:re,getSelectionRows:oe,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,sort:de}=useUtils(V),{isHidden:Ne,renderExpanded:he,setDragVisible:ze,isGroup:pe,handleMouseLeave:Ve,handleHeaderFooterMousewheel:Oe,tableSize:_e,emptyBlockStyle:At,handleFixedMousewheel:$e,resizeProxyVisible:Fe,bodyWidth:Ue,resizeState:xe,doLayout:Dt,tableBodyStyles:qe,tableLayout:kt,scrollbarViewStyle:jt,tableInnerStyle:Pt,scrollbarStyle:ti}=useStyle(i,k,V,g),{scrollBarRef:ei,scrollTo:Et,setScrollLeft:ni,setScrollTop:ri}=useScrollbar(),ci=debounce(Dt,50),Ci=`${r.namespace.value}-table_${tableIdSeed++}`;g.tableId=Ci,g.state={isGroup:pe,resizeState:xe,doLayout:Dt,debouncedUpdateLayout:ci};const li=vue.computed(()=>i.sumText||n("el.table.sumText")),ui=vue.computed(()=>i.emptyText||n("el.table.emptyText"));return useKeyRender(g),{ns:r,layout:k,store:V,handleHeaderFooterMousewheel:Oe,handleMouseLeave:Ve,tableId:Ci,tableSize:_e,isHidden:Ne,isEmpty:$,renderExpanded:he,resizeProxyVisible:Fe,resizeState:xe,isGroup:pe,bodyWidth:Ue,tableBodyStyles:qe,emptyBlockStyle:At,debouncedUpdateLayout:ci,handleFixedMousewheel:$e,setCurrentRow:re,getSelectionRows:oe,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,doLayout:Dt,sort:de,t:n,setDragVisible:ze,context:g,computedSumText:li,computedEmptyText:ui,tableLayout:kt,scrollbarViewStyle:jt,tableInnerStyle:Pt,scrollbarStyle:ti,scrollBarRef:ei,scrollTo:Et,setScrollLeft:ni,setScrollTop:ri}}}),_hoisted_1$q=["data-prefix"],_hoisted_2$l={ref:"hiddenColumns",class:"hidden-columns"};function _sfc_render$3(i,n,r,g,V,k){const $=vue.resolveComponent("hColgroup"),re=vue.resolveComponent("table-header"),oe=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(re,{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(re,{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(oe,{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$q)}var Table=_export_sfc$1(_sfc_main$D,[["render",_sfc_render$3],["__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:V=>V.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,V=[g.e("expand-icon")];r&&V.push(g.em("expand-icon","expanded"));const k=function($){$.stopPropagation(),n.toggleRowExpansion(i)};return vue.h("div",{class:V,onClick:k},{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 V=n.property,k=V&&getProp(i,V).value;return n&&n.formatter?n.formatter(i,n,k,r):((g=k==null?void 0:k.toString)==null?void 0:g.call(k))||""}function treeCellPrefix({row:i,treeNode:n,store:r},g=!1){const{ns:V}=r;if(!n)return g?[vue.h("span",{class:V.e("placeholder")})]:null;const k=[],$=function(re){re.stopPropagation(),!n.loading&&r.loadOrToggle(i)};if(n.indent&&k.push(vue.h("span",{class:V.e("indent"),style:{"padding-left":`${n.indent}px`}})),typeof n.expanded=="boolean"&&!n.noLazyChildren){const re=[V.e("expand-icon"),n.expanded?V.em("expand-icon","expanded"):""];let oe=arrow_right_default;n.loading&&(oe=loading_default),k.push(vue.h("div",{class:re,onClick:$},{default:()=>[vue.h(ElIcon,{class:{[V.is("loading")]:n.loading}},{default:()=>[vue.h(oe)]})]}))}else k.push(vue.h("span",{class:V.e("placeholder")}));return k}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 k=["fixed"],$={realWidth:"width",realMinWidth:"minWidth"},re=getAllAliases(k,$);Object.keys(re).forEach(oe=>{const Ce=$[oe];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{let ae=ie;Ce==="width"&&oe==="realWidth"&&(ae=parseWidth(ie)),Ce==="minWidth"&&oe==="realMinWidth"&&(ae=parseMinWidth(ie)),r.columnConfig.value[Ce]=ae,r.columnConfig.value[oe]=ae;const le=Ce==="fixed";i.value.store.scheduleLayout(le)})})},registerNormalWatchers:()=>{const k=["label","filters","filterMultiple","sortable","index","formatter","className","labelClassName","showOverflowTooltip"],$={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},re=getAllAliases(k,$);Object.keys(re).forEach(oe=>{const Ce=$[oe];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{r.columnConfig.value[oe]=ie})})}}}function useRender(i,n,r){const g=vue.getCurrentInstance(),V=vue.ref(""),k=vue.ref(!1),$=vue.ref(),re=vue.ref(),oe=useNamespace("table");vue.watchEffect(()=>{$.value=i.align?`is-${i.align}`:null,$.value}),vue.watchEffect(()=>{re.value=i.headerAlign?`is-${i.headerAlign}`:$.value,re.value});const Ce=vue.computed(()=>{let Ve=g.vnode.vParent||g.parent;for(;Ve&&!Ve.tableId&&!Ve.columnId;)Ve=Ve.vnode.vParent||Ve.parent;return Ve}),ie=vue.computed(()=>{const{store:Ve}=g.parent;if(!Ve)return!1;const{treeData:Oe}=Ve.states,_e=Oe.value;return _e&&Object.keys(_e).length>0}),ae=vue.ref(parseWidth(i.width)),le=vue.ref(parseMinWidth(i.minWidth)),Ie=Ve=>(ae.value&&(Ve.width=ae.value),le.value&&(Ve.minWidth=le.value),!ae.value&&le.value&&(Ve.width=void 0),Ve.minWidth||(Ve.minWidth=80),Ve.realWidth=Number(Ve.width===void 0?Ve.minWidth:Ve.width),Ve),ue=Ve=>{const Oe=Ve.type,_e=cellForced[Oe]||{};Object.keys(_e).forEach($e=>{const Fe=_e[$e];$e!=="className"&&Fe!==void 0&&(Ve[$e]=Fe)});const At=getDefaultClassName(Oe);if(At){const $e=`${vue.unref(oe.namespace)}-${At}`;Ve.className=Ve.className?`${Ve.className} ${$e}`:$e}return Ve},de=Ve=>{Array.isArray(Ve)?Ve.forEach(_e=>Oe(_e)):Oe(Ve);function Oe(_e){var At;((At=_e==null?void 0:_e.type)==null?void 0:At.name)==="ElTableColumn"&&(_e.vParent=g)}};return{columnId:V,realAlign:$,isSubColumn:k,realHeaderAlign:re,columnOrTableParent:Ce,setColumnWidth:Ie,setColumnForcedProps:ue,setColumnRenders:Ve=>{i.renderHeader?debugWarn("TableColumn","Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."):Ve.type!=="selection"&&(Ve.renderHeader=_e=>{g.columnConfig.value.label;const At=n.header;return At?At(_e):Ve.label});let Oe=Ve.renderCell;return Ve.type==="expand"?(Ve.renderCell=_e=>vue.h("div",{class:"cell"},[Oe(_e)]),r.value.renderExpanded=_e=>n.default?n.default(_e):n.default):(Oe=Oe||defaultRenderCell,Ve.renderCell=_e=>{let At=null;if(n.default){const qe=n.default(_e);At=qe.some(kt=>kt.type!==vue.Comment)?qe:Oe(_e)}else At=Oe(_e);const{columns:$e}=r.value.store.states,Fe=$e.value.findIndex(qe=>qe.type==="default"),Ue=ie.value&&_e.cellIndex===Fe,xe=treeCellPrefix(_e,Ue),Dt={class:"cell",style:{}};return Ve.showOverflowTooltip&&(Dt.class=`${Dt.class} ${vue.unref(oe.namespace)}-tooltip`,Dt.style={width:`${(_e.column.realWidth||Number(_e.column.width))-1}px`}),de(At),vue.h("div",Dt,[xe,At])}),Ve},getPropsData:(...Ve)=>Ve.reduce((Oe,_e)=>(Array.isArray(_e)&&_e.forEach(At=>{Oe[At]=i[At]}),Oe),{}),getColumnElIndex:(Ve,Oe)=>Array.prototype.indexOf.call(Ve,Oe),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({}),V=vue.computed(()=>{let pe=r.parent;for(;pe&&!pe.tableId;)pe=pe.parent;return pe}),{registerNormalWatchers:k,registerComplexWatchers:$}=useWatcher(V,i),{columnId:re,isSubColumn:oe,realHeaderAlign:Ce,columnOrTableParent:ie,setColumnWidth:ae,setColumnForcedProps:le,setColumnRenders:Ie,getPropsData:ue,getColumnElIndex:de,realAlign:Ne,updateColumnOrder:he}=useRender(i,n,V),ze=ie.value;re.value=`${ze.tableId||ze.columnId}_column_${columnIdSeed++}`,vue.onBeforeMount(()=>{oe.value=V.value!==ze;const pe=i.type||"default",Ve=i.sortable===""?!0:i.sortable,Oe=isUndefined(i.showOverflowTooltip)?ze.props.showOverflowTooltip:i.showOverflowTooltip,_e={...cellStarts[pe],id:re.value,type:pe,property:i.prop||i.property,align:Ne,headerAlign:Ce,showOverflowTooltip:Oe,filterable:i.filters||i.filterMethod,filteredValue:[],filterPlacement:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:Ve,index:i.index,rawColumnKey:r.vnode.key};let xe=ue(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement"]);xe=mergeOptions(_e,xe),xe=compose(Ie,ae,le)(xe),g.value=xe,k(),$()}),vue.onMounted(()=>{var pe;const Ve=ie.value,Oe=oe.value?Ve.vnode.el.children:(pe=Ve.refs.hiddenColumns)==null?void 0:pe.children,_e=()=>de(Oe||[],r.vnode.el);g.value.getColumnIndex=_e,_e()>-1&&V.value.store.commit("insertColumn",g.value,oe.value?Ve.columnConfig.value:null,he)}),vue.onBeforeUnmount(()=>{V.value.store.commit("removeColumn",g.value,oe.value?ze.columnConfig.value:null,he)}),r.columnId=re.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}),V=[];if(Array.isArray(g))for(const $ of g)((r=$.type)==null?void 0:r.name)==="ElTableColumn"||$.shapeFlag&2?V.push($):$.type===vue.Fragment&&Array.isArray($.children)&&$.children.forEach(re=>{(re==null?void 0:re.patchFlag)!==1024&&!isString$1(re==null?void 0:re.children)&&V.push(re)});return vue.h("div",V)}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$C=vue.defineComponent({...__default__$6,props:tabBarProps,setup(i,{expose:n}){const r=i,g=vue.getCurrentInstance(),V=vue.inject(tabsRootContextKey);V||throwError$1(COMPONENT_NAME$3,"<el-tabs><el-tab-bar /></el-tabs>");const k=useNamespace("tabs"),$=vue.ref(),re=vue.ref(),oe=()=>{let ie=0,ae=0;const le=["top","bottom"].includes(V.props.tabPosition)?"width":"height",Ie=le==="width"?"x":"y",ue=Ie==="x"?"left":"top";return r.tabs.every(de=>{var Ne,he;const ze=(he=(Ne=g.parent)==null?void 0:Ne.refs)==null?void 0:he[`tab-${de.uid}`];if(!ze)return!1;if(!de.active)return!0;ie=ze[`offset${capitalize(ue)}`],ae=ze[`client${capitalize(le)}`];const pe=window.getComputedStyle(ze);return le==="width"&&(r.tabs.length>1&&(ae-=Number.parseFloat(pe.paddingLeft)+Number.parseFloat(pe.paddingRight)),ie+=Number.parseFloat(pe.paddingLeft)),!1}),{[le]:`${ae}px`,transform:`translate${capitalize(Ie)}(${ie}px)`}},Ce=()=>re.value=oe();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(k).e("active-bar"),vue.unref(k).is(vue.unref(V).props.tabPosition)]),style:vue.normalizeStyle(re.value)},null,6))}});var TabBar=_export_sfc$1(_sfc_main$C,[["__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(),V=vue.inject(tabsRootContextKey);V||throwError$1(COMPONENT_NAME$2,"<el-tabs><tab-nav /></el-tabs>");const k=useNamespace("tabs"),$=useDocumentVisibility(),re=useWindowFocus(),oe=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(V.props.tabPosition)?"width":"height"),he=vue.computed(()=>({transform:`translate${Ne.value==="width"?"X":"Y"}(-${Ie.value}px)`})),ze=()=>{if(!oe.value)return;const Fe=oe.value[`offset${capitalize(Ne.value)}`],Ue=Ie.value;if(!Ue)return;const xe=Ue>Fe?Ue-Fe:0;Ie.value=xe},pe=()=>{if(!oe.value||!Ce.value)return;const Fe=Ce.value[`offset${capitalize(Ne.value)}`],Ue=oe.value[`offset${capitalize(Ne.value)}`],xe=Ie.value;if(Fe-xe<=Ue)return;const Dt=Fe-xe>Ue*2?xe+Ue:Fe-Ue;Ie.value=Dt},Ve=async()=>{const Fe=Ce.value;if(!le.value||!ie.value||!oe.value||!Fe)return;await vue.nextTick();const Ue=ie.value.querySelector(".is-active");if(!Ue)return;const xe=oe.value,Dt=["top","bottom"].includes(V.props.tabPosition),qe=Ue.getBoundingClientRect(),kt=xe.getBoundingClientRect(),jt=Dt?Fe.offsetWidth-kt.width:Fe.offsetHeight-kt.height,Pt=Ie.value;let ti=Pt;Dt?(qe.left<kt.left&&(ti=Pt-(kt.left-qe.left)),qe.right>kt.right&&(ti=Pt+qe.right-kt.right)):(qe.top<kt.top&&(ti=Pt-(kt.top-qe.top)),qe.bottom>kt.bottom&&(ti=Pt+(qe.bottom-kt.bottom))),ti=Math.max(ti,0),Ie.value=Math.min(ti,jt)},Oe=()=>{var Fe;if(!Ce.value||!oe.value)return;i.stretch&&((Fe=ae.value)==null||Fe.update());const Ue=Ce.value[`offset${capitalize(Ne.value)}`],xe=oe.value[`offset${capitalize(Ne.value)}`],Dt=Ie.value;xe<Ue?(le.value=le.value||{},le.value.prev=Dt,le.value.next=Dt+xe<Ue,Ue-Dt<xe&&(Ie.value=Ue-xe)):(le.value=!1,Dt>0&&(Ie.value=0))},_e=Fe=>{const Ue=Fe.code,{up:xe,down:Dt,left:qe,right:kt}=EVENT_CODE;if(![xe,Dt,qe,kt].includes(Ue))return;const jt=Array.from(Fe.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),Pt=jt.indexOf(Fe.target);let ti;Ue===qe||Ue===xe?Pt===0?ti=jt.length-1:ti=Pt-1:Pt<jt.length-1?ti=Pt+1:ti=0,jt[ti].focus({preventScroll:!0}),jt[ti].click(),At()},At=()=>{de.value&&(ue.value=!0)},$e=()=>ue.value=!1;return vue.watch($,Fe=>{Fe==="hidden"?de.value=!1:Fe==="visible"&&setTimeout(()=>de.value=!0,50)}),vue.watch(re,Fe=>{Fe?setTimeout(()=>de.value=!0,50):de.value=!1}),useResizeObserver(ie,Oe),vue.onMounted(()=>setTimeout(()=>Ve(),0)),vue.onUpdated(()=>Oe()),n({scrollToActiveTab:Ve,removeFocus:$e}),vue.watch(()=>i.panes,()=>g.update(),{flush:"post",deep:!0}),()=>{const Fe=le.value?[vue.createVNode("span",{class:[k.e("nav-prev"),k.is("disabled",!le.value.prev)],onClick:ze},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_left_default,null,null)]})]),vue.createVNode("span",{class:[k.e("nav-next"),k.is("disabled",!le.value.next)],onClick:pe},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_right_default,null,null)]})])]:null,Ue=i.panes.map((xe,Dt)=>{var qe,kt,jt,Pt;const ti=xe.uid,ei=xe.props.disabled,Et=(kt=(qe=xe.props.name)!=null?qe:xe.index)!=null?kt:`${Dt}`,ni=!ei&&(xe.isClosable||i.editable);xe.index=`${Dt}`;const ri=ni?vue.createVNode(ElIcon,{class:"is-icon-close",onClick:li=>r("tabRemove",xe,li)},{default:()=>[vue.createVNode(close_default,null,null)]}):null,ci=((Pt=(jt=xe.slots).label)==null?void 0:Pt.call(jt))||xe.props.label,Ci=!ei&&xe.active?0:-1;return vue.createVNode("div",{ref:`tab-${ti}`,class:[k.e("item"),k.is(V.props.tabPosition),k.is("active",xe.active),k.is("disabled",ei),k.is("closable",ni),k.is("focus",ue.value)],id:`tab-${Et}`,key:`tab-${ti}`,"aria-controls":`pane-${Et}`,role:"tab","aria-selected":xe.active,tabindex:Ci,onFocus:()=>At(),onBlur:()=>$e(),onClick:li=>{$e(),r("tabClick",xe,Et,li)},onKeydown:li=>{ni&&(li.code===EVENT_CODE.delete||li.code===EVENT_CODE.backspace)&&r("tabRemove",xe,li)}},[ci,ri])});return vue.createVNode("div",{ref:ie,class:[k.e("nav-wrap"),k.is("scrollable",!!le.value),k.is(V.props.tabPosition)]},[Fe,vue.createVNode("div",{class:k.e("nav-scroll"),ref:oe},[vue.createVNode("div",{class:[k.e("nav"),k.is(V.props.tabPosition),k.is("stretch",i.stretch&&["top","bottom"].includes(V.props.tabPosition))],ref:Ce,style:he.value,role:"tablist",onKeydown:_e},[i.type?null:vue.createVNode(TabBar,{ref:ae,tabs:[...i.panes]},null),Ue])])])}}}),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 V,k;const $=useNamespace("tabs"),{children:re,addChild:oe,removeChild:Ce}=useOrderedChildren(vue.getCurrentInstance(),"ElTabPane"),ie=vue.ref(),ae=vue.ref((k=(V=i.modelValue)!=null?V:i.activeName)!=null?k:"0"),le=he=>{ae.value=he,n(UPDATE_MODEL_EVENT,he),n("tabChange",he)},Ie=async he=>{var ze,pe,Ve;if(!(ae.value===he||isUndefined(he)))try{await((ze=i.beforeLeave)==null?void 0:ze.call(i,he,ae.value))!==!1&&(le(he),(Ve=(pe=ie.value)==null?void 0:pe.removeFocus)==null||Ve.call(pe))}catch{}},ue=(he,ze,pe)=>{he.props.disabled||(Ie(ze),n("tabClick",he,pe))},de=(he,ze)=>{he.props.disabled||isUndefined(he.props.name)||(ze.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:oe,unregisterPane:Ce}),g({currentName:ae}),()=>{const he=i.editable||i.addable?vue.createVNode("span",{class:$.e("new-tab"),tabindex:"0",onClick:Ne,onKeydown:Ve=>{Ve.code===EVENT_CODE.enter&&Ne()}},[vue.createVNode(ElIcon,{class:$.is("icon-plus")},{default:()=>[vue.createVNode(plus_default,null,null)]})]):null,ze=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:re.value,stretch:i.stretch,onTabClick:ue,onTabRemove:de},null)]),pe=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"?[ze,pe]:[pe,ze]])}}});const tabPaneProps=buildProps({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),_hoisted_1$p=["id","aria-hidden","aria-labelledby"],COMPONENT_NAME$1="ElTabPane",__default__$5=vue.defineComponent({name:COMPONENT_NAME$1}),_sfc_main$B=vue.defineComponent({...__default__$5,props:tabPaneProps,setup(i){const n=i,r=vue.getCurrentInstance(),g=vue.useSlots(),V=vue.inject(tabsRootContextKey);V||throwError$1(COMPONENT_NAME$1,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const k=useNamespace("tab-pane"),$=vue.ref(),re=vue.computed(()=>n.closable||V.props.closable),oe=computedEager(()=>{var Ie;return V.currentName.value===((Ie=n.name)!=null?Ie:$.value)}),Ce=vue.ref(oe.value),ie=vue.computed(()=>{var Ie;return(Ie=n.name)!=null?Ie:$.value}),ae=computedEager(()=>!n.lazy||Ce.value||oe.value);vue.watch(oe,Ie=>{Ie&&(Ce.value=!0)});const le=vue.reactive({uid:r.uid,slots:g,props:n,paneName:ie,active:oe,index:$,isClosable:re});return vue.onMounted(()=>{V.registerPane(le)}),vue.onUnmounted(()=>{V.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(k).b()),role:"tabpanel","aria-hidden":!vue.unref(oe),"aria-labelledby":`tab-${vue.unref(ie)}`},[vue.renderSlot(Ie.$slots,"default")],10,_hoisted_1$p)),[[vue.vShow,vue.unref(oe)]]):vue.createCommentVNode("v-if",!0)}});var TabPane=_export_sfc$1(_sfc_main$B,[["__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 V=i.value.currentNode;g!==V&&n("current-change",V?V.data:null,V)},getChildState=i=>{let n=!0,r=!0,g=!0;for(let V=0,k=i.length;V<k;V++){const $=i[V];($.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 V=i.parent;!V||V.level===0||i.store.checkStrictly||reInitChecked(V)},getPropertyFromData=function(i,n){const r=i.store.props,g=i.data||{},V=r[n];if(typeof V=="function")return V(g,i);if(typeof V=="string")return g[V];if(typeof V>"u"){const k=g[n];return k===void 0?"":k}};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 k=getPropertyFromData(this,"isLeaf");typeof k=="boolean"&&(this.isLeafByUser=k)}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,V=n.key;V&&g&&g.includes(this.key)&&this.expand(null,n.autoExpandParent),V&&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,V=r.length;g<V;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 V=this.getChildren(!0);V.includes(n.data)||(typeof r>"u"||r<0?V.push(n.data):V.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 V=this.childNodes.indexOf(n);V>-1&&(this.store&&this.store.deregisterNode(n),n.parent=null,this.childNodes.splice(V,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 V=this.parent;for(;V.level>0;)V.expanded=!0,V=V.parent}this.expanded=!0,n&&n(),this.childNodes.forEach(V=>{V.canFocus=!0})};this.shouldLoadData()?this.loadData(V=>{Array.isArray(V)&&(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,V){if(this.indeterminate=n==="half",this.checked=n===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:$,allWithoutDisable:re}=getChildState(this.childNodes);!this.isLeaf&&!$&&re&&(this.checked=!1,n=!1);const oe=()=>{if(r){const Ce=this.childNodes;for(let le=0,Ie=Ce.length;le<Ie;le++){const ue=Ce[le];V=V||n!==!1;const de=ue.disabled?ue.checked:V;ue.setChecked(de,r,!0,V)}const{half:ie,all:ae}=getChildState(Ce);ae||(this.checked=ae,this.indeterminate=ie)}};if(this.shouldLoadData()){this.loadData(()=>{oe(),reInitChecked(this)},{checked:n!==!1});return}else oe()}const k=this.parent;!k||k.level===0||g||reInitChecked(k)}getChildren(n=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const g=this.store.props;let V="children";return g&&(V=g.children||"children"),r[V]===void 0&&(r[V]=null),n&&!r[V]&&(r[V]=[]),r[V]}updateChildren(){const n=this.getChildren()||[],r=this.childNodes.map(k=>k.data),g={},V=[];n.forEach((k,$)=>{const re=k[NODE_KEY];!!re&&r.findIndex(Ce=>Ce[NODE_KEY]===re)>=0?g[re]={index:$,data:k}:V.push({index:$,data:k})}),this.store.lazy||r.forEach(k=>{g[k[NODE_KEY]]||this.removeChildByData(k)}),V.forEach(({index:k,data:$})=>{this.insertChild({data:$},k)}),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=V=>{this.childNodes=[],this.doCreateChildren(V,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),n&&n.call(this,V)};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,V=function(k){const $=k.root?k.root.childNodes:k.childNodes;if($.forEach(re=>{re.visible=r.call(re,n,re.data,re),V(re)}),!k.visible&&$.length){let re=!0;re=!$.some(oe=>oe.visible),k.root?k.root.visible=re===!1:k.visible=re===!1}n&&k.visible&&!k.isLeaf&&!g&&k.expand()};V(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 V=r[g];V&&V.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=[],V=function(k){(k.root?k.root.childNodes:k.childNodes).forEach(re=>{(re.checked||r&&re.indeterminate)&&(!n||n&&re.isLeaf)&&g.push(re.data),V(re)})};return V(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(k=>{k.indeterminate&&n.push(k.data),r(k)})};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 V=g.childNodes;for(let k=V.length-1;k>=0;k--){const $=V[k];this.remove($.data)}for(let k=0,$=r.length;k<$;k++){const re=r[k];this.append(re,g.data)}}_setCheckedKeys(n,r=!1,g){const V=this._getAllNodes().sort((re,oe)=>oe.level-re.level),k=Object.create(null),$=Object.keys(g);V.forEach(re=>re.setChecked(!1,!1));for(let re=0,oe=V.length;re<oe;re++){const Ce=V[re],ie=Ce.data[n].toString();if(!$.includes(ie)){Ce.checked&&!k[ie]&&Ce.setChecked(!1,!1);continue}let le=Ce.parent;for(;le&&le.level>0;)k[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,V={};n.forEach(k=>{V[(k||{})[g]]=!0}),this._setCheckedKeys(g,r,V)}setCheckedKeys(n,r=!1){this.defaultCheckedKeys=n;const g=this.key,V={};n.forEach(k=>{V[k]=!0}),this._setCheckedKeys(g,r,V)}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 V=this.getNode(n);V&&V.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],V=this.nodesMap[g];this.setCurrentNode(V),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$A=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 V=i.node,{data:k,store:$}=V;return i.renderContent?i.renderContent(vue.h,{_self:r,node:V,data:k,store:$}):g.ctx.slots.default?g.ctx.slots.default({node:V,data:k}):vue.h("span",{class:n.be("node","label")},[V.label])}}});var NodeContent=_export_sfc$1(_sfc_main$A,[["__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 V of r.children)V.treeNodeExpand(g)}}}const dragEventsKey=Symbol("dragEvents");function useDragNodeHandler({props:i,ctx:n,el$:r,dropIndicator$:g,store:V}){const k=useNamespace("tree"),$=vue.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),re=({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)},oe=({event:ie,treeNode:ae})=>{const le=ae,Ie=$.value.dropNode;Ie&&Ie.node.id!==le.node.id&&removeClass(Ie.$el,k.is("drop-inner"));const ue=$.value.draggingNode;if(!ue||!le)return;let de=!0,Ne=!0,he=!0,ze=!0;typeof i.allowDrop=="function"&&(de=i.allowDrop(ue.node,le.node,"prev"),ze=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 pe=le.$el.querySelector(`.${k.be("node","content")}`).getBoundingClientRect(),Ve=r.value.getBoundingClientRect();let Oe;const _e=de?Ne?.25:he?.45:1:-1,At=he?Ne?.75:de?.55:0:1;let $e=-9999;const Fe=ie.clientY-pe.top;Fe<pe.height*_e?Oe="before":Fe>pe.height*At?Oe="after":Ne?Oe="inner":Oe="none";const Ue=le.$el.querySelector(`.${k.be("node","expand-icon")}`).getBoundingClientRect(),xe=g.value;Oe==="before"?$e=Ue.top-Ve.top:Oe==="after"&&($e=Ue.bottom-Ve.top),xe.style.top=`${$e}px`,xe.style.left=`${Ue.right-Ve.left}px`,Oe==="inner"?addClass(le.$el,k.is("drop-inner")):removeClass(le.$el,k.is("drop-inner")),$.value.showDropIndicator=Oe==="before"||Oe==="after",$.value.allowDrop=$.value.showDropIndicator||ze,$.value.dropType=Oe,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"&&V.value.registerNode(ue),removeClass(Ie.$el,k.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:re,treeNodeDragOver:oe,treeNodeDragEnd:Ce}),{dragState:$}}const _sfc_main$z=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),V=vue.inject("RootTree"),k=vue.ref(!1),$=vue.ref(!1),re=vue.ref(null),oe=vue.ref(null),Ce=vue.ref(null),ie=vue.inject(dragEventsKey),ae=vue.getCurrentInstance();vue.provide("NodeInstance",ae),V||debugWarn("Tree","Can not find node's tree."),i.node.expanded&&(k.value=!0,$.value=!0);const le=V.props.children||"children";vue.watch(()=>{const Fe=i.node.data[le];return Fe&&[...Fe]},()=>{i.node.updateChildren()}),vue.watch(()=>i.node.indeterminate,Fe=>{de(i.node.checked,Fe)}),vue.watch(()=>i.node.checked,Fe=>{de(Fe,i.node.indeterminate)}),vue.watch(()=>i.node.expanded,Fe=>{vue.nextTick(()=>k.value=Fe),Fe&&($.value=!0)});const Ie=Fe=>getNodeKey(V.props.nodeKey,Fe.data),ue=Fe=>{const Ue=i.props.class;if(!Ue)return{};let xe;if(isFunction$2(Ue)){const{data:Dt}=Fe;xe=Ue(Dt,Fe)}else xe=Ue;return isString$1(xe)?{[xe]:!0}:xe},de=(Fe,Ue)=>{(re.value!==Fe||oe.value!==Ue)&&V.ctx.emit("check-change",i.node.data,Fe,Ue),re.value=Fe,oe.value=Ue},Ne=Fe=>{handleCurrentChange(V.store,V.ctx.emit,()=>V.store.value.setCurrentNode(i.node)),V.currentNode.value=i.node,V.props.expandOnClickNode&&ze(),V.props.checkOnClickNode&&!i.node.disabled&&pe(null,{target:{checked:!i.node.checked}}),V.ctx.emit("node-click",i.node.data,i.node,ae,Fe)},he=Fe=>{V.instance.vnode.props.onNodeContextmenu&&(Fe.stopPropagation(),Fe.preventDefault()),V.ctx.emit("node-contextmenu",Fe,i.node.data,i.node,ae)},ze=()=>{i.node.isLeaf||(k.value?(V.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)))},pe=(Fe,Ue)=>{i.node.setChecked(Ue.target.checked,!V.props.checkStrictly),vue.nextTick(()=>{const xe=V.store.value;V.ctx.emit("check",i.node.data,{checkedNodes:xe.getCheckedNodes(),checkedKeys:xe.getCheckedKeys(),halfCheckedNodes:xe.getHalfCheckedNodes(),halfCheckedKeys:xe.getHalfCheckedKeys()})})};return{ns:r,node$:Ce,tree:V,expanded:k,childNodeRendered:$,oldChecked:re,oldIndeterminate:oe,getNodeKey:Ie,getNodeClass:ue,handleSelectChange:de,handleClick:Ne,handleContextMenu:he,handleExpandIconClick:ze,handleCheckChange:pe,handleChildNodeExpand:(Fe,Ue,xe)=>{g(Ue),V.ctx.emit("node-expand",Fe,Ue,xe)},handleDragStart:Fe=>{V.props.draggable&&ie.treeNodeDragStart({event:Fe,treeNode:i})},handleDragOver:Fe=>{Fe.preventDefault(),V.props.draggable&&ie.treeNodeDragOver({event:Fe,treeNode:{$el:Ce.value,node:i.node}})},handleDrop:Fe=>{Fe.preventDefault()},handleDragEnd:Fe=>{V.props.draggable&&ie.treeNodeDragEnd(Fe)},CaretRight:caret_right_default}}}),_hoisted_1$o=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],_hoisted_2$k=["aria-expanded"];function _sfc_render$2(i,n,r,g,V,k){const $=vue.resolveComponent("el-icon"),re=vue.resolveComponent("el-checkbox"),oe=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(re,{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(oe)]),_: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$o)),[[vue.vShow,i.node.visible]])}var ElTreeNode=_export_sfc$1(_sfc_main$z,[["render",_sfc_render$2],["__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([]),V=vue.shallowRef([]);vue.onMounted(()=>{$()}),vue.onUpdated(()=>{g.value=Array.from(i.value.querySelectorAll("[role=treeitem]")),V.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"))}),vue.watch(V,re=>{re.forEach(oe=>{oe.setAttribute("tabindex","-1")})}),useEventListener(i,"keydown",re=>{const oe=re.target;if(!oe.className.includes(r.b("node")))return;const Ce=re.code;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const ie=g.value.indexOf(oe);let ae;if([EVENT_CODE.up,EVENT_CODE.down].includes(Ce)){if(re.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)&&(re.preventDefault(),oe.click());const le=oe.querySelector('[type="checkbox"]');[EVENT_CODE.enter,EVENT_CODE.space].includes(Ce)&&le&&(re.preventDefault(),le.click())});const $=()=>{var re;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),V.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"));const oe=i.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(oe.length){oe[0].setAttribute("tabindex","0");return}(re=g.value[0])==null||re.setAttribute("tabindex","0")}}const _sfc_main$y=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"),V=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}));V.value.initialize();const k=vue.ref(V.value.root),$=vue.ref(null),re=vue.ref(null),oe=vue.ref(null),{broadcastExpanded:Ce}=useNodeExpandEventBroadcast(i),{dragState:ie}=useDragNodeHandler({props:i,ctx:n,el$:re,dropIndicator$:oe,store:V});useKeydown({el$:re},V);const ae=vue.computed(()=>{const{childNodes:ti}=k.value;return!ti||ti.length===0||ti.every(({visible:ei})=>!ei)});vue.watch(()=>i.currentNodeKey,ti=>{V.value.setCurrentNodeKey(ti)}),vue.watch(()=>i.defaultCheckedKeys,ti=>{V.value.setDefaultCheckedKey(ti)}),vue.watch(()=>i.defaultExpandedKeys,ti=>{V.value.setDefaultExpandedKeys(ti)}),vue.watch(()=>i.data,ti=>{V.value.setData(ti)},{deep:!0}),vue.watch(()=>i.checkStrictly,ti=>{V.value.checkStrictly=ti});const le=ti=>{if(!i.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");V.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=V.value.getNode(ti);if(!ei)return[];const Et=[ei.data];let ni=ei.parent;for(;ni&&ni!==k.value;)Et.push(ni.data),ni=ni.parent;return Et.reverse()},de=(ti,ei)=>V.value.getCheckedNodes(ti,ei),Ne=ti=>V.value.getCheckedKeys(ti),he=()=>{const ti=V.value.getCurrentNode();return ti?ti.data:null},ze=()=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const ti=he();return ti?ti[i.nodeKey]:null},pe=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");V.value.setCheckedNodes(ti,ei)},Ve=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");V.value.setCheckedKeys(ti,ei)},Oe=(ti,ei,Et)=>{V.value.setChecked(ti,ei,Et)},_e=()=>V.value.getHalfCheckedNodes(),At=()=>V.value.getHalfCheckedKeys(),$e=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");handleCurrentChange(V,n.emit,()=>V.value.setUserCurrentNode(ti,ei))},Fe=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");handleCurrentChange(V,n.emit,()=>V.value.setCurrentNodeKey(ti,ei))},Ue=ti=>V.value.getNode(ti),xe=ti=>{V.value.remove(ti)},Dt=(ti,ei)=>{V.value.append(ti,ei)},qe=(ti,ei)=>{V.value.insertBefore(ti,ei)},kt=(ti,ei)=>{V.value.insertAfter(ti,ei)},jt=(ti,ei,Et)=>{Ce(ei),n.emit("node-expand",ti,ei,Et)},Pt=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");V.value.updateChildren(ti,ei)};return vue.provide("RootTree",{ctx:n,props:i,store:V,root:k,currentNode:$,instance:vue.getCurrentInstance()}),vue.provide(formItemContextKey,void 0),{ns:g,store:V,root:k,currentNode:$,dragState:ie,el$:re,dropIndicator$:oe,isEmpty:ae,filter:le,getNodeKey:Ie,getNodePath:ue,getCheckedNodes:de,getCheckedKeys:Ne,getCurrentNode:he,getCurrentKey:ze,setCheckedNodes:pe,setCheckedKeys:Ve,setChecked:Oe,getHalfCheckedNodes:_e,getHalfCheckedKeys:At,setCurrentNode:$e,setCurrentKey:Fe,t:r,getNode:Ue,remove:xe,append:Dt,insertBefore:qe,insertAfter:kt,handleNodeExpand:jt,updateKeyChildren:Pt}}});function _sfc_render$1(i,n,r,g,V,k){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,re=>(vue.openBlock(),vue.createBlock($,{key:i.getNodeKey(re),node:re,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 re;return[vue.createElementVNode("span",{class:vue.normalizeClass(i.ns.e("empty-text"))},vue.toDisplayString((re=i.emptyText)!=null?re: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$y,[["render",_sfc_render$1],["__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,V){super(n),this.name="UploadAjaxError",this.status=r,this.method=g,this.url=V}}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",k=>{const $=k;$.percent=k.total>0?k.loaded/k.total*100:0,i.onProgress($)});const g=new FormData;if(i.data)for(const[k,$]of Object.entries(i.data))Array.isArray($)?g.append(k,...$):g.append(k,$);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 V=i.headers||{};if(V instanceof Headers)V.forEach((k,$)=>n.setRequestHeader($,k));else for(const[k,$]of Object.entries(V))isNil($)||n.setRequestHeader(k,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$n=["onKeydown"],_hoisted_2$j=["src"],_hoisted_3$f=["onClick"],_hoisted_4$c=["title"],_hoisted_5$a=["onClick"],_hoisted_6$8=["onClick"],__default__$4=vue.defineComponent({name:"ElUploadList"}),_sfc_main$x=vue.defineComponent({...__default__$4,props:uploadListProps,emits:uploadListEmits,setup(i,{emit:n}){const{t:r}=useLocale(),g=useNamespace("upload"),V=useNamespace("icon"),k=useNamespace("list"),$=useFormDisabled(),re=vue.ref(!1),oe=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(k).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:re.value}]),tabindex:"0",onKeydown:vue.withKeys(le=>!vue.unref($)&&oe(ae),["delete"]),onFocus:ie[0]||(ie[0]=le=>re.value=!0),onBlur:ie[1]||(ie[1]=le=>re.value=!1),onClick:ie[2]||(ie[2]=le=>re.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(V).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$c)],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(V).m("upload-success"),vue.unref(V).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(V).m("upload-success"),vue.unref(V).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(V).m("close")),onClick:le=>oe(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(V).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(V).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=>oe(ae)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(V).m("delete"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(delete_default))]),_:1},8,["class"])],10,_hoisted_6$8))],2)):vue.createCommentVNode("v-if",!0)])],42,_hoisted_1$n))),128)),vue.renderSlot(Ce.$slots,"append")]),_:3},8,["class","name"]))}});var UploadList=_export_sfc$1(_sfc_main$x,[["__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$m=["onDrop","onDragover"],COMPONENT_NAME="ElUploadDrag",__default__$3=vue.defineComponent({name:COMPONENT_NAME}),_sfc_main$w=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"),V=vue.ref(!1),k=useFormDisabled(),$=oe=>{if(k.value)return;V.value=!1,oe.stopPropagation();const Ce=Array.from(oe.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)},re=()=>{k.value||(V.value=!0)};return(oe,Ce)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(g).b("dragger"),vue.unref(g).is("dragover",V.value)]),onDrop:vue.withModifiers($,["prevent"]),onDragover:vue.withModifiers(re,["prevent"]),onDragleave:Ce[0]||(Ce[0]=vue.withModifiers(ie=>V.value=!1,["prevent"]))},[vue.renderSlot(oe.$slots,"default")],42,_hoisted_1$m))}});var UploadDragger=_export_sfc$1(_sfc_main$w,[["__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$l=["onKeydown"],_hoisted_2$i=["name","multiple","accept"],__default__$2=vue.defineComponent({name:"ElUploadContent",inheritAttrs:!1}),_sfc_main$v=vue.defineComponent({...__default__$2,props:uploadContentProps,setup(i,{expose:n}){const r=i,g=useNamespace("upload"),V=useFormDisabled(),k=vue.shallowRef({}),$=vue.shallowRef(),re=ue=>{if(ue.length===0)return;const{autoUpload:de,limit:Ne,fileList:he,multiple:ze,onStart:pe,onExceed:Ve}=r;if(Ne&&he.length+ue.length>Ne){Ve(ue,he);return}ze||(ue=ue.slice(0,1));for(const Oe of ue){const _e=Oe;_e.uid=genFileId(),pe(_e),de&&oe(_e)}},oe=async ue=>{if($.value.value="",!r.beforeUpload)return Ce(ue);let de,Ne={};try{const ze=r.data,pe=r.beforeUpload(ue);Ne=isObject$4(r.data)?cloneDeep(r.data):r.data,de=await pe,isObject$4(r.data)&&isEqual(ze,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:ze,withCredentials:pe,name:Ve,action:Oe,onProgress:_e,onSuccess:At,onError:$e,httpRequest:Fe}=r,{uid:Ue}=ue,xe={headers:Ne||{},withCredentials:pe,file:ue,data:de??he,method:ze,filename:Ve,action:Oe,onProgress:qe=>{_e(qe,ue)},onSuccess:qe=>{At(qe,ue),delete k.value[Ue]},onError:qe=>{$e(qe,ue),delete k.value[Ue]}},Dt=Fe(xe);k.value[Ue]=Dt,Dt instanceof Promise&&Dt.then(xe.onSuccess,xe.onError)},ie=ue=>{const de=ue.target.files;de&&re(Array.from(de))},ae=()=>{V.value||($.value.value="",$.value.click())},le=()=>{ae()};return n({abort:ue=>{entriesOf(k.value).filter(ue?([Ne])=>String(ue.uid)===Ne:()=>!0).forEach(([Ne,he])=>{he instanceof XMLHttpRequest&&he.abort(),delete k.value[Ne]})},upload:oe}),(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(V),onFile:re},{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$l))}});var UploadContent=_export_sfc$1(_sfc_main$v,[["__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 V(le){var Ie;(Ie=n.value)==null||Ie.abort(le)}function k(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))},re=(le,Ie)=>{const ue=g(Ie);ue&&(i.onProgress(le,ue,r.value),ue.status="uploading",ue.percentage=Math.round(le.percent))},oe=(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=>{V(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:V,clearFiles:k,handleError:$,handleProgress:re,handleStart:Ce,handleSuccess:oe,handleRemove:ie,submit:ae}},__default__$1=vue.defineComponent({name:"ElUpload"}),_sfc_main$u=vue.defineComponent({...__default__$1,props:uploadProps,setup(i,{expose:n}){const r=i,g=vue.useSlots(),V=useFormDisabled(),k=vue.shallowRef(),{abort:$,submit:re,clearFiles:oe,uploadFiles:Ce,handleStart:ie,handleError:ae,handleRemove:le,handleSuccess:Ie,handleProgress:ue}=useHandlers(r,k),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:re,clearFiles:oe,handleStart:ie,handleRemove:le}),(he,ze)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.unref(de)&&he.showFileList?(vue.openBlock(),vue.createBlock(UploadList,{key:0,disabled:vue.unref(V),"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:k},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:pe})=>[vue.renderSlot(he.$slots,"file",{file:pe})])}: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:k},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(V),"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:pe})=>[vue.renderSlot(he.$slots,"file",{file:pe})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0)]))}});var Upload=_export_sfc$1(_sfc_main$u,[["__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(V=>V.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$k=["id"],_hoisted_2$h=["innerHTML"],__default__=vue.defineComponent({name:"ElMessage"}),_sfc_main$t=vue.defineComponent({...__default__,props:messageProps,emits:messageEmits,setup(i,{expose:n}){const r=i,{Close:g}=TypeComponents,{ns:V,zIndex:k}=useGlobalComponentSettings("message"),{currentZIndex:$,nextZIndex:re}=k,oe=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 At=r.type;return{[V.bm("icon",At)]:At&&TypeComponentsMap[At]}}),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),ze=vue.computed(()=>({top:`${Ne.value}px`,zIndex:$.value}));function pe(){r.duration!==0&&({stop:ae}=useTimeoutFn(()=>{Oe()},r.duration))}function Ve(){ae==null||ae()}function Oe(){Ce.value=!1}function _e({code:At}){At===EVENT_CODE.esc&&Oe()}return vue.onMounted(()=>{pe(),re(),Ce.value=!0}),vue.watch(()=>r.repeatNum,()=>{Ve(),pe()}),useEventListener(document,"keydown",_e),useResizeObserver(oe,()=>{ie.value=oe.value.getBoundingClientRect().height}),n({visible:Ce,bottom:he,close:Oe}),(At,$e)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(V).b("fade"),onBeforeLeave:At.onClose,onAfterLeave:$e[0]||($e[0]=Fe=>At.$emit("destroy")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:At.id,ref_key:"messageRef",ref:oe,class:vue.normalizeClass([vue.unref(V).b(),{[vue.unref(V).m(At.type)]:At.type&&!At.icon},vue.unref(V).is("center",At.center),vue.unref(V).is("closable",At.showClose),At.customClass]),style:vue.normalizeStyle(vue.unref(ze)),role:"alert",onMouseenter:Ve,onMouseleave:pe},[At.repeatNum>1?(vue.openBlock(),vue.createBlock(vue.unref(ElBadge),{key:0,value:At.repeatNum,type:vue.unref(le),class:vue.normalizeClass(vue.unref(V).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(V).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(At.$slots,"default",{},()=>[At.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(V).e("content")),innerHTML:At.message},null,10,_hoisted_2$h)],2112)):(vue.openBlock(),vue.createElementBlock("p",{key:0,class:vue.normalizeClass(vue.unref(V).e("content"))},vue.toDisplayString(At.message),3))]),At.showClose?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(V).e("closeBtn")),onClick:vue.withModifiers(Oe,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(g))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],46,_hoisted_1$k),[[vue.vShow,Ce.value]])]),_:3},8,["name","onBeforeLeave"]))}});var MessageConstructor=_export_sfc$1(_sfc_main$t,[["__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++}`,V=n.onClose,k=document.createElement("div"),$={...n,id:g,onClose:()=>{V==null||V(),closeMessage(ie)},onDestroy:()=>{vue.render(null,k)}},re=vue.createVNode(MessageConstructor,$,isFunction$2($.message)||vue.isVNode($.message)?{default:isFunction$2($.message)?$.message:()=>$.message}:null);re.appContext=r||message._context,vue.render(re,k),i.appendChild(k.firstElementChild);const oe=re.component,ie={id:g,vnode:re,vm:oe,handler:{close:()=>{oe.exposed.visible.value=!1}},props:re.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 V=instances$2.find(({vnode:k})=>{var $;return(($=k.props)==null?void 0:$.message)===r.message});if(V)return V.props.repeatNum+=1,V.props.type=r.type,V.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$s=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:V,size:k}=useGlobalComponentSettings("message-box",vue.computed(()=>i.buttonSize)),{t:$}=r,{nextZIndex:re}=g,oe=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:re()}),ie=vue.computed(()=>{const jt=Ce.type;return{[V.bm("icon",jt)]:jt&&TypeComponentsMap[jt]}}),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(),ze=vue.ref(),pe=vue.ref(),Ve=vue.computed(()=>Ce.confirmButtonClass);vue.watch(()=>Ce.inputValue,async jt=>{await vue.nextTick(),i.boxType==="prompt"&&jt!==null&&xe()},{immediate:!0}),vue.watch(()=>oe.value,jt=>{var Pt,ti;jt&&(i.boxType!=="prompt"&&(Ce.autofocus?he.value=(ti=(Pt=pe.value)==null?void 0:Pt.$el)!=null?ti:de.value:he.value=de.value),Ce.zIndex=re()),i.boxType==="prompt"&&(jt?vue.nextTick().then(()=>{var ei;ze.value&&ze.value.$el&&(Ce.autofocus?he.value=(ei=Dt())!=null?ei:de.value:he.value=de.value)}):(Ce.editorErrorMessage="",Ce.validateError=!1))});const Oe=vue.computed(()=>i.draggable);useDraggable(de,Ne,Oe),vue.onMounted(async()=>{await vue.nextTick(),i.closeOnHashChange&&window.addEventListener("hashchange",_e)}),vue.onBeforeUnmount(()=>{i.closeOnHashChange&&window.removeEventListener("hashchange",_e)});function _e(){oe.value&&(oe.value=!1,vue.nextTick(()=>{Ce.action&&n("action",Ce.action)}))}const At=()=>{i.closeOnClickModal&&Ue(Ce.distinguishCancelAndClose?"close":"cancel")},$e=useSameTarget(At),Fe=jt=>{if(Ce.inputType!=="textarea")return jt.preventDefault(),Ue("confirm")},Ue=jt=>{var Pt;i.boxType==="prompt"&&jt==="confirm"&&!xe()||(Ce.action=jt,Ce.beforeClose?(Pt=Ce.beforeClose)==null||Pt.call(Ce,jt,Ce,_e):_e())},xe=()=>{if(i.boxType==="prompt"){const jt=Ce.inputPattern;if(jt&&!jt.test(Ce.inputValue||""))return Ce.editorErrorMessage=Ce.inputErrorMessage||$("el.messagebox.error"),Ce.validateError=!0,!1;const Pt=Ce.inputValidator;if(typeof Pt=="function"){const ti=Pt(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},Dt=()=>{const jt=ze.value.$refs;return jt.input||jt.textarea},qe=()=>{Ue("close")},kt=()=>{i.closeOnPressEscape&&qe()};return i.lockScroll&&useLockscreen(oe),{...vue.toRefs(Ce),ns:V,overlayEvent:$e,visible:oe,hasMessage:ue,typeClass:ie,contentId:ae,inputId:le,btnSize:k,iconComponent:Ie,confirmButtonClasses:Ve,rootRef:de,focusStartRef:he,headerRef:Ne,inputRef:ze,confirmRef:pe,doClose:_e,handleClose:qe,onCloseRequested:kt,handleWrapperClick:At,handleInputEnter:Fe,handleAction:Ue,t:$}}}),_hoisted_1$j=["aria-label","aria-describedby"],_hoisted_2$g=["aria-label"],_hoisted_3$e=["id"];function _sfc_render(i,n,r,g,V,k){const $=vue.resolveComponent("el-icon"),re=vue.resolveComponent("close"),oe=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(re)]),_: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(oe,{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$j)]),_:3},8,["z-index","overlay-class","mask"]),[[vue.vShow,i.visible]])]),_:3})}var MessageBoxConstructor=_export_sfc$1(_sfc_main$s,[["render",_sfc_render],["__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(V)},i.onAction=k=>{const $=messageInstance.get(V);let re;i.showInput?re={value:V.inputValue,action:k}:re=k,i.callback?i.callback(re,g.proxy):k==="cancel"||k==="close"?i.distinguishCancelAndClose&&k!=="cancel"?$.reject("close"):$.reject("cancel"):$.resolve(re)};const g=initInstance(i,r,n),V=g.proxy;for(const k in i)hasOwn$1(i,k)&&!hasOwn$1(V.$props,k)&&(V[k]=i[k]);return V.visible=!0,V};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,V)=>{const k=showMessage(i,n??MessageBox._context);messageInstance.set(k,{options:i,callback:r,resolve:g,reject:V})})}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,V)=>{let k="";return isObject$4(r)?(g=r,k=""):isUndefined(r)?k="":k=r,MessageBox(Object.assign({title:k,message:n,type:"",...MESSAGE_BOX_DEFAULT_OPTS[i]},g,{boxType:i}),V)}}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$2="",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.Textarea="Textarea",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||{}),EGlobalStoreIntention=(i=>(i.None="None",i.Create="Create",i.Move="Move",i.GroupMove="GroupMove",i.MoveCanvas="MoveCanvas",i.Select="Select",i.Zoom="Zoom",i.Rotate="Rotate",i.Connection="Connection",i.SetConnectionLineNode="SetConnectionLineNode",i.ContextMenu="ContextMenu",i.SelectArea="SelectArea",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 svg_alert_light={name:"alert-light",title:"警示灯",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},defaultState:"yellow",state:{green:{label:"正常",fill:"#00ff00",fillOpacity:"1"},yellow:{label:"请注意",fill:"#ffff00",fillOpacity:"1"},red:{label:"报警",fill:"#ff0000",fillOpacity:"1"},white:{label:"关闭",fill:"#ffffff",fillOpacity:"0"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateful_group={groupType:"stateful",title:"状态SVG",list:[svg_alert_light]},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_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_hotpot={name:"hotpot",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_hamburger={name:"hamburger",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:[]},stateless_group={groupType:"stateless",title:"静态SVG",list:[svg_hamburger,svg_hotpot,svg_bot_2,svg_bot_9]},thermometer={name:"thermometer",title:"温度计",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},animation_group={groupType:"have_animation",title:"动画SVG",list:[thermometer]},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.Textarea,val:"文字内容"},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},fill:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1},writingMode:{title:"文字朝向",type:EConfigItemPropsType.Select,val:"horizontal-tb",options:[{value:"horizontal-tb",label:"水平"},{value:"vertical-rl",label:"垂直"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},switch_r={name:"switch-r",title:"开关",tag:"switch-r",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},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_r,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:!1,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:!1,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"}]},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:500},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:200},maxHeight:{title:"最大高度",type:EConfigItemPropsType.InputNumber,val:200},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:!1,have_anchor:!1,actual_rect:!0},display:!0,props:{width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:150},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},color:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1}},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:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{percentage:{title:"进度",type:EConfigItemPropsType.InputNumber,val:50}},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$r=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")}),(V,k)=>(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{type:"dashboard",percentage:Number(r.percentage),color:g},null,8,["percentage"]))}}),_hoisted_1$i=["id"],_hoisted_2$f=["id"],_hoisted_3$d=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1537","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_4$b=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1531","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_5$9=vue.createElementVNode("path",{d:"M238.933333 409.6c-37.546667 0-68.266667 27.306667-68.266666 61.44v85.333333c0 34.133333 30.72 61.44 68.266666 61.44s68.266667-27.306667 68.266667-61.44v-85.333333c0-34.133333-30.72-61.44-68.266667-61.44z m34.133334 146.773333c0 13.653333-17.066667 23.893333-34.133334 23.893334s-34.133333-10.24-34.133333-27.306667v-85.333333c0-13.653333 17.066667-23.893333 34.133333-23.893334s34.133333 10.24 34.133334 27.306667v85.333333zM460.8 409.6c-10.24 0-17.066667 6.826667-17.066667 17.066667v109.226666l-71.68-119.466666c-3.413333-6.826667-10.24-10.24-20.48-6.826667-6.826667 3.413333-13.653333 10.24-13.653333 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667v-109.226666l71.68 119.466666c3.413333 6.826667 10.24 6.826667 13.653334 6.826667h3.413333c6.826667-3.413333 13.653333-10.24 13.653333-17.066667v-170.666666c3.413333-10.24-3.413333-17.066667-13.653333-17.066667zM750.933333 341.333333c-95.573333 0-170.666667 75.093333-170.666666 170.666667s75.093333 170.666667 170.666666 170.666667 170.666667-75.093333 170.666667-170.666667-75.093333-170.666667-170.666667-170.666667z",fill:"#5ad562","p-id":"1530","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i1.1adc3a81uCnBP5"},null,-1),_hoisted_6$7=[_hoisted_3$d,_hoisted_4$b,_hoisted_5$9],_hoisted_7$7=["id"],_hoisted_8$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1536","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_9$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1535","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_10$6=vue.createElementVNode("path",{d:"M273.066667 341.333333c-95.573333 0-170.666667 75.093333-170.666667 170.666667s75.093333 170.666667 170.666667 170.666667 170.666667-75.093333 170.666666-170.666667-75.093333-170.666667-170.666666-170.666667z",fill:"#bfbfbf","p-id":"1534","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81KYNNkt"},null,-1),_hoisted_11$5=vue.createElementVNode("path",{d:"M580.266667 409.6c-37.546667 0-68.266667 27.306667-68.266667 61.44v85.333333c0 34.133333 30.72 61.44 68.266667 61.44s68.266667-27.306667 68.266666-61.44v-85.333333c0-34.133333-30.72-61.44-68.266666-61.44z m34.133333 146.773333c0 13.653333-17.066667 27.306667-34.133333 27.306667s-34.133333-10.24-34.133334-27.306667v-85.333333c0-13.653333 17.066667-27.306667 34.133334-27.306667s34.133333 10.24 34.133333 27.306667v85.333333zM904.533333 409.6h-68.266666c-10.24 0-17.066667 6.826667-17.066667 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066667-17.066667s-6.826667-17.066667-17.066667-17.066666H853.333333v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667zM768 409.6h-68.266667c-10.24 0-17.066667 6.826667-17.066666 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066666 17.066667s17.066667-6.826667 17.066667-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066666-17.066667s-6.826667-17.066667-17.066666-17.066666H716.8v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667z",fill:"#707070","p-id":"1533","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i2.1adc3a81KYNNkt"},null,-1),_hoisted_12$4=[_hoisted_8$7,_hoisted_9$7,_hoisted_10$6,_hoisted_11$5],_hoisted_13$4=["xlink:href"],_sfc_main$q=vue.defineComponent({__name:"switch-r",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,V)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id},[vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${r.id}switch-demo-open`},_hoisted_6$7,8,_hoisted_2$f),vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${r.id}switch-demo-close`},_hoisted_12$4,8,_hoisted_7$7),vue.createElementVNode("use",{"xlink:href":`#${r.id}switch-demo-${r.isOpen?"open":"close"}`,width:"100",height:"100"},null,8,_hoisted_13$4)],8,_hoisted_1$i))}}),_sfc_main$p=vue.defineComponent({__name:"svg-text",props:{text:{},bold:{type:Boolean}},emits:["resize"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.text,()=>{vue.nextTick(function(){n("resize")})}),(g,V)=>(vue.openBlock(),vue.createElementBlock("text",{x:"50",y:"55",style:vue.normalizeStyle({"font-weight":r.bold?"bold":"normal"})},vue.toDisplayString(r.text),5))}}),_sfc_main$o=vue.defineComponent({__name:"common-table",props:{colConfig:{default:()=>[]},data:{default:()=>[]},height:{default:200},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,...V}=n;r.value=V}),(g,V)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTable),vue.normalizeProps(vue.guardReactiveProps(vue.unref(r))),{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.colConfig,k=>(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),vue.mergeProps({key:k.prop},k),null,16))),128))]),_:1},16))}}),_hoisted_1$h={class:"flex mt-5px"},_sfc_main$n=vue.defineComponent({__name:"now-time",props:{width:{},fontFamily:{},color:{},fontSize:{},bold:{type:Boolean}},setup(i){const n=i,r=vue.computed(()=>({fontFamily:n.fontFamily,color:n.color,fontSize:n.fontSize+"px",fontWeight:n.bold?"bold":"normal"})),g=vue.ref(new Date),V=vue.ref(),k=vue.computed(()=>{const oe=g.value.getFullYear(),Ce=g.value.getMonth()+1,ie=g.value.getDate();return oe.toString()+"年"+Ce.toString()+"月"+ie.toString()+"日"}),$=vue.computed(()=>{const oe=g.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][oe]}),re=vue.computed(()=>{const oe=g.value.getHours(),Ce=g.value.getMinutes(),ie=g.value.getSeconds();return(oe<10?"0"+oe.toString():oe.toString())+":"+(Ce<10?"0"+Ce.toString():Ce.toString())+":"+(ie<10?"0"+ie.toString():ie.toString())});return vue.onMounted(()=>{V.value=setInterval(()=>{g.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(V.value)}),(oe,Ce)=>(vue.openBlock(),vue.createElementBlock("div",{class:"now-time",style:vue.normalizeStyle({width:n.width+"px"})},[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(r))},vue.toDisplayString(vue.unref(k)),5),vue.createElementVNode("div",_hoisted_1$h,[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(r))},vue.toDisplayString(vue.unref($)),5),vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(r))},vue.toDisplayString(vue.unref(re)),5)])],4))}}),nowTime_vue_vue_type_style_index_0_scoped_82ca3b84_lang="",_export_sfc=(i,n)=>{const r=i.__vccOpts||i;for(const[g,V]of n)r[g]=V;return r},NowTime=_export_sfc(_sfc_main$n,[["__scopeId","data-v-82ca3b84"]]);/*! *****************************************************************************
254
+ */var matchHtmlRegExp=/["'&<>]/,escapeHtml_1=escapeHtml;function escapeHtml(i){var n=""+i,r=matchHtmlRegExp.exec(n);if(!r)return n;var g,V="",k=0,$=0;for(k=r.index;k<n.length;k++){switch(n.charCodeAt(k)){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}$!==k&&(V+=n.substring($,k)),$=k+1,V+=g}return $!==k?V+n.substring($,k):V}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,V){if(!n&&!g&&(!V||Array.isArray(V)&&!V.length))return i;typeof r=="string"?r=r==="descending"?-1:1:r=r&&r<0?-1:1;const k=g?null:function(re,oe){return V?(Array.isArray(V)||(V=[V]),V.map(Ce=>typeof Ce=="string"?get$1(re,Ce):Ce(re,oe,i))):(n!=="$key"&&isObject$4(re)&&"$value"in re&&(re=re.$value),[isObject$4(re)?get$1(re,n):re])},$=function(re,oe){if(g)return g(re.value,oe.value);for(let Ce=0,ie=re.key.length;Ce<ie;Ce++){if(re.key[Ce]<oe.key[Ce])return-1;if(re.key[Ce]>oe.key[Ce])return 1}return 0};return i.map((re,oe)=>({value:re,index:oe,key:k?k(re,oe):null})).sort((re,oe)=>{let Ce=$(re,oe);return Ce||(Ce=re.index-oe.index),Ce*+r}).map(re=>re.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 V=i.columns[g];if(V.columnKey===n){r=V;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 V of r)g=g[V];return`${g}`}else if(typeof n=="function")return n.call(null,i)},getKeysMap=function(i,n){const r={};return(i||[]).forEach((g,V)=>{r[getRowIdentity(g,n)]={row:g,index:V}}),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 V=n[g];typeof V<"u"&&(r[g]=V)}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 V=i.indexOf(n),k=V!==-1,$=re=>{re==="add"?i.push(n):i.splice(V,1),g=!0,isArray$3(n.children)&&n.children.forEach(oe=>{toggleRowStatus(i,oe,r??!k)})};return isBoolean(r)?r&&!k?$("add"):!r&&k&&$("remove"):$(k?"remove":"add"),g}function walkTreeNode(i,n,r="children",g="hasChildren"){const V=$=>!(Array.isArray($)&&$.length);function k($,re,oe){n($,re,oe),re.forEach(Ce=>{if(Ce[g]){n(Ce,null,oe+1);return}const ie=Ce[r];V(ie)||k(Ce,ie,oe+1)})}i.forEach($=>{if($[g]){n($,null,0);return}const re=$[r];V(re)||k($,re,0)})}let removePopper;function createTablePopper(i,n,r,g,V){V=merge$2({enterable:!0,showArrow:!0},V);const k=i==null?void 0:i.dataset.prefix,$=i==null?void 0:i.querySelector(`.${k}-scrollbar__wrap`);function re(){const Ne=V.effect==="light",he=document.createElement("div");return he.className=[`${k}-popper`,Ne?"is-light":"is-dark",V.popperClass||""].join(" "),r=escapeHtml$1(r),he.innerHTML=r,he.style.zIndex=String(g()),i==null||i.appendChild(he),he}function oe(){const Ne=document.createElement("div");return Ne.className=`${k}-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;V.enterable&&({onOpen:ae,onClose:le}=useDelayedToggle({showAfter:V.showAfter,hideAfter:V.hideAfter,open:Ce,close:removePopper}));const Ie=re();Ie.onmouseenter=ae,Ie.onmouseleave=le;const ue=[];if(V.offset&&ue.push({name:"offset",options:{offset:[0,V.offset]}}),V.showArrow){const Ne=Ie.appendChild(oe());ue.push({name:"arrow",options:{element:Ne,padding:10}})}const de=V.popperOptions||{};return ie=yn(n,Ie,{placement:V.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 V=0,k=i;const $=r.states.columns.value;if(g){const oe=getCurrentColumns(g[i]);V=$.slice(0,$.indexOf(oe[0])).reduce(getColSpan,0),k=V+oe.reduce(getColSpan,0)-1}else V=i;let re;switch(n){case"left":k<r.states.fixedLeafColumnsLength.value&&(re="left");break;case"right":V>=$.length-r.states.rightFixedLeafColumnsLength.value&&(re="right");break;default:k<r.states.fixedLeafColumnsLength.value?re="left":V>=$.length-r.states.rightFixedLeafColumnsLength.value&&(re="right")}return re?{direction:re,start:V,after:k}:{}},getFixedColumnsClass=(i,n,r,g,V,k=0)=>{const $=[],{direction:re,start:oe,after:Ce}=isFixedColumn(n,r,g,V);if(re){const ie=re==="left";$.push(`${i}-fixed-column--${re}`),ie&&Ce+k===g.states.fixedLeafColumnsLength.value-1?$.push("is-last-column"):!ie&&oe-k===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:V,start:k=0,after:$=0}=isFixedColumn(i,n,r,g);if(!V)return;const re={},oe=V==="left",Ce=r.states.columns.value;return oe?re.left=Ce.slice(0,k).reduce(getOffset,0):re.right=Ce.slice($+1).reverse().reduce(getOffset,0),re},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 oe=i.data.value||[],Ce=i.rowKey.value;if(r.value)g.value=oe.slice();else if(Ce){const ie=getKeysMap(g.value,Ce);g.value=oe.reduce((ae,le)=>{const Ie=getRowIdentity(le,Ce);return ie[Ie]&&ae.push(le),ae},[])}else g.value=[]},toggleRowExpansion:(oe,Ce)=>{toggleRowStatus(g.value,oe,Ce)&&n.emit("expand-change",oe,g.value.slice())},setExpandRowKeys:oe=>{n.store.assertRowKey();const Ce=i.data.value||[],ie=i.rowKey.value,ae=getKeysMap(Ce,ie);g.value=oe.reduce((le,Ie)=>{const ue=ae[Ie];return ue&&le.push(ue.row),le},[])},isRowExpanded:oe=>{const Ce=i.rowKey.value;return Ce?!!getKeysMap(g.value,Ce)[getRowIdentity(oe,Ce)]:g.value.includes(oe)},states:{expandRows:g,defaultExpandAll:r}}}function useCurrent(i){const n=vue.getCurrentInstance(),r=vue.ref(null),g=vue.ref(null),V=Ce=>{n.store.assertRowKey(),r.value=Ce,$(Ce)},k=()=>{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:V,restoreCurrentRowKey:k,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),k())},states:{_currentRowKey:r,currentRow:g}}}function useTree(i){const n=vue.ref([]),r=vue.ref({}),g=vue.ref(16),V=vue.ref(!1),k=vue.ref({}),$=vue.ref("hasChildren"),re=vue.ref("children"),oe=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,ze=Object.keys(k.value),pe={};return ze.length&&ze.forEach(Ve=>{if(k.value[Ve].length){const Oe={children:[]};k.value[Ve].forEach(_e=>{const At=getRowIdentity(_e,he);Oe.children.push(At),_e[$.value]&&!pe[At]&&(pe[At]={children:[]})}),pe[Ve]=Oe}}),pe}),ae=he=>{const ze=i.rowKey.value,pe={};return walkTreeNode(he,(Ve,Oe,_e)=>{const At=getRowIdentity(Ve,ze);Array.isArray(Oe)?pe[At]={children:Oe.map($e=>getRowIdentity($e,ze)),level:_e}:V.value&&(pe[At]={children:[],lazy:!0,level:_e})},re.value,$.value),pe},le=(he=!1,ze=(pe=>(pe=oe.store)==null?void 0:pe.states.defaultExpandAll.value)())=>{var pe;const Ve=Ce.value,Oe=ie.value,_e=Object.keys(Ve),At={};if(_e.length){const $e=vue.unref(r),Fe=[],Ue=(Dt,qe)=>{if(he)return n.value?ze||n.value.includes(qe):!!(ze||Dt!=null&&Dt.expanded);{const kt=ze||n.value&&n.value.includes(qe);return!!(Dt!=null&&Dt.expanded||kt)}};_e.forEach(Dt=>{const qe=$e[Dt],kt={...Ve[Dt]};if(kt.expanded=Ue(qe,Dt),kt.lazy){const{loaded:jt=!1,loading:Pt=!1}=qe||{};kt.loaded=!!jt,kt.loading=!!Pt,Fe.push(Dt)}At[Dt]=kt});const xe=Object.keys(Oe);V.value&&xe.length&&Fe.length&&xe.forEach(Dt=>{const qe=$e[Dt],kt=Oe[Dt].children;if(Fe.includes(Dt)){if(At[Dt].children.length!==0)throw new Error("[ElTable]children must be an empty array.");At[Dt].children=kt}else{const{loaded:jt=!1,loading:Pt=!1}=qe||{};At[Dt]={lazy:!0,loaded:!!jt,loading:!!Pt,expanded:Ue(qe,Dt),children:kt,level:""}}})}r.value=At,(pe=oe.store)==null||pe.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,ze)=>{oe.store.assertRowKey();const pe=i.rowKey.value,Ve=getRowIdentity(he,pe),Oe=Ve&&r.value[Ve];if(Ve&&Oe&&"expanded"in Oe){const _e=Oe.expanded;ze=typeof ze>"u"?!Oe.expanded:ze,r.value[Ve].expanded=ze,_e!==ze&&oe.emit("expand-change",he,ze),oe.store.updateTableScrollY()}},de=he=>{oe.store.assertRowKey();const ze=i.rowKey.value,pe=getRowIdentity(he,ze),Ve=r.value[pe];V.value&&Ve&&"loaded"in Ve&&!Ve.loaded?Ne(he,pe,Ve):ue(he,void 0)},Ne=(he,ze,pe)=>{const{load:Ve}=oe.props;Ve&&!r.value[ze].loaded&&(r.value[ze].loading=!0,Ve(he,pe,Oe=>{if(!Array.isArray(Oe))throw new TypeError("[ElTable] data must be an array");r.value[ze].loading=!1,r.value[ze].loaded=!0,r.value[ze].expanded=!0,Oe.length&&(k.value[ze]=Oe),oe.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:V,lazyTreeNodeMap:k,lazyColumnIdentifier:$,childrenColumnName:re}}}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),V=vue.ref([]),k=vue.ref([]),$=vue.ref(!1),re=vue.ref([]),oe=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),ze=vue.ref(0),pe=vue.ref(!1),Ve=vue.ref([]),Oe=vue.ref(!1),_e=vue.ref(!1),At=vue.ref(null),$e=vue.ref({}),Fe=vue.ref(null),Ue=vue.ref(null),xe=vue.ref(null),Dt=vue.ref(null),qe=vue.ref(null);vue.watch(V,()=>n.state&&ti(!1),{deep:!0});const kt=()=>{if(!g.value)throw new Error("[ElTable] prop row-key is required")},jt=Oi=>{var Zi;(Zi=Oi.children)==null||Zi.forEach(Wi=>{Wi.fixed=Oi.fixed,jt(Wi)})},Pt=()=>{re.value.forEach(ki=>{jt(ki)}),ie.value=re.value.filter(ki=>ki.fixed===!0||ki.fixed==="left"),ae.value=re.value.filter(ki=>ki.fixed==="right"),ie.value.length>0&&re.value[0]&&re.value[0].type==="selection"&&!re.value[0].fixed&&(re.value[0].fixed=!0,ie.value.unshift(re.value[0]));const Oi=re.value.filter(ki=>!ki.fixed);oe.value=[].concat(ie.value).concat(Oi).concat(ae.value);const Zi=doFlattenColumns(Oi),Wi=doFlattenColumns(ie.value),Vi=doFlattenColumns(ae.value);Ne.value=Zi.length,he.value=Wi.length,ze.value=Vi.length,Ce.value=[].concat(Wi).concat(Zi).concat(Vi),$.value=ie.value.length>0||ae.value.length>0},ti=(Oi,Zi=!1)=>{Oi&&Pt(),Zi?n.state.doLayout():n.state.debouncedUpdateLayout()},ei=Oi=>Ve.value.includes(Oi),Et=()=>{pe.value=!1,Ve.value.length&&(Ve.value=[],n.emit("selection-change",[]))},ni=()=>{let Oi;if(g.value){Oi=[];const Zi=getKeysMap(Ve.value,g.value),Wi=getKeysMap(V.value,g.value);for(const Vi in Zi)hasOwn$1(Zi,Vi)&&!Wi[Vi]&&Oi.push(Zi[Vi].row)}else Oi=Ve.value.filter(Zi=>!V.value.includes(Zi));if(Oi.length){const Zi=Ve.value.filter(Wi=>!Oi.includes(Wi));Ve.value=Zi,n.emit("selection-change",Zi.slice())}},ri=()=>(Ve.value||[]).slice(),ci=(Oi,Zi=void 0,Wi=!0)=>{if(toggleRowStatus(Ve.value,Oi,Zi)){const ki=(Ve.value||[]).slice();Wi&&n.emit("select",ki,Oi),n.emit("selection-change",ki)}},Ci=()=>{var Oi,Zi;const Wi=_e.value?!pe.value:!(pe.value||Ve.value.length);pe.value=Wi;let Vi=!1,ki=0;const Hi=(Zi=(Oi=n==null?void 0:n.store)==null?void 0:Oi.states)==null?void 0:Zi.rowKey.value;V.value.forEach((ji,Fi)=>{const Ki=Fi+ki;At.value?At.value.call(null,ji,Ki)&&toggleRowStatus(Ve.value,ji,Wi)&&(Vi=!0):toggleRowStatus(Ve.value,ji,Wi)&&(Vi=!0),ki+=yi(getRowIdentity(ji,Hi))}),Vi&&n.emit("selection-change",Ve.value?Ve.value.slice():[]),n.emit("select-all",Ve.value)},li=()=>{const Oi=getKeysMap(Ve.value,g.value);V.value.forEach(Zi=>{const Wi=getRowIdentity(Zi,g.value),Vi=Oi[Wi];Vi&&(Ve.value[Vi.index]=Zi)})},ui=()=>{var Oi,Zi,Wi;if(((Oi=V.value)==null?void 0:Oi.length)===0){pe.value=!1;return}let Vi;g.value&&(Vi=getKeysMap(Ve.value,g.value));const ki=function(Ki){return Vi?!!Vi[getRowIdentity(Ki,g.value)]:Ve.value.includes(Ki)};let Hi=!0,ji=0,Fi=0;for(let Ki=0,Ti=(V.value||[]).length;Ki<Ti;Ki++){const Di=(Wi=(Zi=n==null?void 0:n.store)==null?void 0:Zi.states)==null?void 0:Wi.rowKey.value,Yi=Ki+Fi,Ri=V.value[Ki],Ei=At.value&&At.value.call(null,Ri,Yi);if(ki(Ri))ji++;else if(!At.value||Ei){Hi=!1;break}Fi+=yi(getRowIdentity(Ri,Di))}ji===0&&(Hi=!1),pe.value=Hi},yi=Oi=>{var Zi;if(!n||!n.store)return 0;const{treeData:Wi}=n.store.states;let Vi=0;const ki=(Zi=Wi.value[Oi])==null?void 0:Zi.children;return ki&&(Vi+=ki.length,ki.forEach(Hi=>{Vi+=yi(Hi)})),Vi},Mi=(Oi,Zi)=>{Array.isArray(Oi)||(Oi=[Oi]);const Wi={};return Oi.forEach(Vi=>{$e.value[Vi.id]=Zi,Wi[Vi.columnKey||Vi.id]=Zi}),Wi},zi=(Oi,Zi,Wi)=>{Ue.value&&Ue.value!==Oi&&(Ue.value.order=null),Ue.value=Oi,xe.value=Zi,Dt.value=Wi},Ai=()=>{let Oi=vue.unref(k);Object.keys($e.value).forEach(Zi=>{const Wi=$e.value[Zi];if(!Wi||Wi.length===0)return;const Vi=getColumnById({columns:Ce.value},Zi);Vi&&Vi.filterMethod&&(Oi=Oi.filter(ki=>Wi.some(Hi=>Vi.filterMethod.call(null,Hi,ki,Vi))))}),Fe.value=Oi},Ii=()=>{V.value=sortData(Fe.value,{sortingColumn:Ue.value,sortProp:xe.value,sortOrder:Dt.value})},ai=(Oi=void 0)=>{Oi&&Oi.filter||Ai(),Ii()},pi=Oi=>{const{tableHeaderRef:Zi}=n.refs;if(!Zi)return;const Wi=Object.assign({},Zi.filterPanels),Vi=Object.keys(Wi);if(Vi.length)if(typeof Oi=="string"&&(Oi=[Oi]),Array.isArray(Oi)){const ki=Oi.map(Hi=>getColumnByKey({columns:Ce.value},Hi));Vi.forEach(Hi=>{const ji=ki.find(Fi=>Fi.id===Hi);ji&&(ji.filteredValue=[])}),n.store.commit("filterChange",{column:ki,values:[],silent:!0,multi:!0})}else Vi.forEach(ki=>{const Hi=Ce.value.find(ji=>ji.id===ki);Hi&&(Hi.filteredValue=[])}),$e.value={},n.store.commit("filterChange",{column:{},values:[],silent:!0})},Ni=()=>{Ue.value&&(zi(null,null,null),n.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:di,toggleRowExpansion:fi,updateExpandRows:vi,states:bi,isRowExpanded:si}=useExpand({data:V,rowKey:g}),{updateTreeExpandKeys:wi,toggleTreeExpansion:oi,updateTreeData:Lt,loadOrToggle:ii,states:gi}=useTree({data:V,rowKey:g}),{updateCurrentRowData:hi,updateCurrentRow:mi,setCurrentRowKey:Si,states:xi}=useCurrent({data:V,rowKey:g});return{assertRowKey:kt,updateColumns:Pt,scheduleLayout:ti,isSelected:ei,clearSelection:Et,cleanSelection:ni,getSelectionRows:ri,toggleRowSelection:ci,_toggleAllSelection:Ci,toggleAllSelection:null,updateSelectionByRowKey:li,updateAllSelected:ui,updateFilters:Mi,updateCurrentRow:mi,updateSort:zi,execFilter:Ai,execSort:Ii,execQuery:ai,clearFilter:pi,clearSort:Ni,toggleRowExpansion:fi,setExpandRowKeysAdapter:Oi=>{di(Oi),wi(Oi)},setCurrentRowKey:Si,toggleRowExpansionAdapter:(Oi,Zi)=>{Ce.value.some(({type:Vi})=>Vi==="expand")?fi(Oi,Zi):oi(Oi,Zi)},isRowExpanded:si,updateExpandRows:vi,updateCurrentRowData:hi,loadOrToggle:ii,updateTreeData:Lt,states:{tableSize:r,rowKey:g,data:V,_data:k,isComplex:$,_columns:re,originColumns:oe,columns:Ce,fixedColumns:ie,rightFixedColumns:ae,leafColumns:le,fixedLeafColumns:Ie,rightFixedLeafColumns:ue,updateOrderFns:de,leafColumnsLength:Ne,fixedLeafColumnsLength:he,rightFixedLeafColumnsLength:ze,isAllSelected:pe,selection:Ve,reserveSelection:Oe,selectOnIndeterminate:_e,selectable:At,filters:$e,filteredData:Fe,sortingColumn:Ue,sortProp:xe,sortOrder:Dt,hoverRow:qe,...bi,...gi,...xi}}}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($,re){const oe=vue.unref($._data)!==re;$.data.value=re,$._data.value=re,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()):oe?i.store.clearSelection():i.store.cleanSelection(),i.store.updateAllSelected(),i.$ready&&i.store.scheduleLayout()},insertColumn($,re,oe,Ce){const ie=vue.unref($._columns);let ae=[];oe?(oe&&!oe.children&&(oe.children=[]),oe.children.push(re),ae=replaceColumn(ie,oe)):(ie.push(re),ae=ie),sortColumn(ae),$._columns.value=ae,$.updateOrderFns.push(Ce),re.type==="selection"&&($.selectable.value=re.selectable,$.reserveSelection.value=re.reserveSelection),i.$ready&&(i.store.updateColumns(),i.store.scheduleLayout())},updateColumnOrder($,re){var oe;((oe=re.getColumnIndex)==null?void 0:oe.call(re))!==re.no&&(sortColumn($._columns.value),i.$ready&&i.store.updateColumns())},removeColumn($,re,oe,Ce){const ie=vue.unref($._columns)||[];if(oe)oe.children.splice(oe.children.findIndex(le=>le.id===re.id),1),vue.nextTick(()=>{var le;((le=oe.children)==null?void 0:le.length)===0&&delete oe.children}),$._columns.value=replaceColumn(ie,oe);else{const le=ie.indexOf(re);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($,re){const{prop:oe,order:Ce,init:ie}=re;if(oe){const ae=vue.unref($.columns).find(le=>le.property===oe);ae&&(ae.order=Ce,i.store.updateSort(ae,oe,Ce),i.store.commit("changeSortCondition",{init:ie}))}},changeSortCondition($,re){const{sortingColumn:oe,sortProp:Ce,sortOrder:ie}=$,ae=vue.unref(oe),le=vue.unref(Ce),Ie=vue.unref(ie);Ie===null&&($.sortingColumn.value=null,$.sortProp.value=null);const ue={filter:!0};i.store.execQuery(ue),(!re||!(re.silent||re.init))&&i.emit("sort-change",{column:ae,prop:le,order:Ie}),i.store.updateTableScrollY()},filterChange($,re){const{column:oe,values:Ce,silent:ie}=re,ae=i.store.updateFilters(oe,Ce);i.store.execQuery(),ie||i.emit("filter-change",ae),i.store.updateTableScrollY()},toggleAllSelection(){i.store.toggleAllSelection()},rowSelectedChanged($,re){i.store.toggleRowSelection(re),i.store.updateAllSelected()},setHoverRow($,re){$.hoverRow.value=re},setCurrentRow($,re){i.store.updateCurrentRow(re)}},commit:function($,...re){const oe=i.store.mutations;if(oe[$])oe[$].apply(i,[i.store.states].concat(re));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,V=InitialStateMap[n];typeof InitialStateMap[n]=="object"&&(V=V.key,g=g||InitialStateMap[n].default),r.states[V].value=g}function getArrKeysValue(i,n){if(n.includes(".")){const r=n.split(".");let g=i;return r.forEach(V=>{g=g[V]}),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 V=this.scrollY.value;return g=r.wrapRef.scrollHeight>r.wrapRef.clientHeight,this.scrollY.value=g,V!==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 V=this.getFlattenColumns(),k=V.filter(oe=>typeof oe.width!="number");if(V.forEach(oe=>{typeof oe.width=="number"&&oe.realWidth&&(oe.realWidth=null)}),k.length>0&&n){if(V.forEach(oe=>{g+=Number(oe.width||oe.minWidth||80)}),g<=r){this.scrollX.value=!1;const oe=r-g;if(k.length===1)k[0].realWidth=Number(k[0].minWidth||80)+oe;else{const Ce=k.reduce((le,Ie)=>le+Number(Ie.minWidth||80),0),ie=oe/Ce;let ae=0;k.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}),k[0].realWidth=Number(k[0].minWidth||80)+oe-ae}}else this.scrollX.value=!0,k.forEach(oe=>{oe.realWidth=Number(oe.minWidth)});this.bodyWidth.value=Math.max(g,r),this.table.state.resizeState.value.width=this.bodyWidth.value}else V.forEach(oe=>{!oe.width&&!oe.minWidth?oe.realWidth=80:oe.realWidth=Number(oe.width||oe.minWidth),g+=oe.realWidth}),this.scrollX.value=g>r,this.bodyWidth.value=g;const $=this.store.states.fixedColumns.value;if($.length>0){let oe=0;$.forEach(Ce=>{oe+=Number(Ce.realWidth||Ce.width)}),this.fixedWidth.value=oe}const re=this.store.states.rightFixedColumns.value;if(re.length>0){let oe=0;re.forEach(Ce=>{oe+=Number(Ce.realWidth||Ce.width)}),this.rightFixedWidth.value=oe}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 V,k;switch(n){case"columns":(V=g.state)==null||V.onColumnsChange(this);break;case"scrollable":(k=g.state)==null||k.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${n}.`)}})}}const{CheckboxGroup:ElCheckboxGroup}=ElCheckbox,_sfc_main$E=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"),V=n==null?void 0:n.parent;V.filterPanels.value[i.column.id]||(V.filterPanels.value[i.column.id]=n);const k=vue.ref(!1),$=vue.ref(null),re=vue.computed(()=>i.column&&i.column.filters),oe=vue.computed({get:()=>{var Ve;return(((Ve=i.column)==null?void 0:Ve.filteredValue)||[])[0]},set:Ve=>{Ce.value&&(typeof Ve<"u"&&Ve!==null?Ce.value.splice(0,1,Ve):Ce.value.splice(0,1))}}),Ce=vue.computed({get(){return i.column?i.column.filteredValue||[]:[]},set(Ve){i.column&&i.upDataColumn("filteredValue",Ve)}}),ie=vue.computed(()=>i.column?i.column.filterMultiple:!0),ae=Ve=>Ve.value===oe.value,le=()=>{k.value=!1},Ie=Ve=>{Ve.stopPropagation(),k.value=!k.value},ue=()=>{k.value=!1},de=()=>{ze(Ce.value),le()},Ne=()=>{Ce.value=[],ze(Ce.value),le()},he=Ve=>{oe.value=Ve,ze(typeof Ve<"u"&&Ve!==null?Ce.value:[]),le()},ze=Ve=>{i.store.commit("filterChange",{column:i.column,values:Ve}),i.store.updateAllSelected()};vue.watch(k,Ve=>{i.column&&i.upDataColumn("filterOpened",Ve)},{immediate:!0});const pe=vue.computed(()=>{var Ve,Oe;return(Oe=(Ve=$.value)==null?void 0:Ve.popperRef)==null?void 0:Oe.contentRef});return{tooltipVisible:k,multiple:ie,filteredValue:Ce,filterValue:oe,filters:re,handleConfirm:de,handleReset:Ne,handleSelect:he,isActive:ae,t:r,ns:g,showFilterPanel:Ie,hideFilterPanel:ue,popperPaneRef:pe,tooltip:$}}}),_hoisted_1$r={key:0},_hoisted_2$m=["disabled"],_hoisted_3$g=["label","onClick"];function _sfc_render$4(i,n,r,g,V,k){const $=vue.resolveComponent("el-checkbox"),re=vue.resolveComponent("el-checkbox-group"),oe=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$r,[vue.createElementVNode("div",{class:vue.normalizeClass(i.ns.e("content"))},[vue.createVNode(oe,{"wrap-class":i.ns.e("wrap")},{default:vue.withCtx(()=>[vue.createVNode(re,{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$E,[["render",_sfc_render$4],["__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),V(r.value)}),vue.onUpdated(()=>{g(r.value),V(r.value)}),vue.onUnmounted(()=>{r.value.removeObserver(n)});const r=vue.computed(()=>{const k=i.layout;if(!k)throw new Error("Can not find table layout.");return k}),g=k=>{var $;const re=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col"))||[];if(!re.length)return;const oe=k.getFlattenColumns(),Ce={};oe.forEach(ie=>{Ce[ie.id]=ie});for(let ie=0,ae=re.length;ie<ae;ie++){const le=re[ie],Ie=le.getAttribute("name"),ue=Ce[Ie];ue&&le.setAttribute("width",ue.realWidth||ue.width)}},V=k=>{var $,re;const oe=(($=i.vnode.el)==null?void 0:$.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let ie=0,ae=oe.length;ie<ae;ie++)oe[ie].setAttribute("width",k.scrollY.value?k.gutterWidth:"0");const Ce=((re=i.vnode.el)==null?void 0:re.querySelectorAll("th.gutter"))||[];for(let ie=0,ae=Ce.length;ie<ae;ie++){const le=Ce[ie];le.style.width=k.scrollY.value?`${k.gutterWidth}px`:"0",le.style.display=k.scrollY.value?"":"none"}};return{tableLayout:r.value,onColumnsChange:g,onScrollableChange:V}}const TABLE_INJECTION_KEY=Symbol("ElTable");function useEvent(i,n){const r=vue.getCurrentInstance(),g=vue.inject(TABLE_INJECTION_KEY),V=de=>{de.stopPropagation()},k=(de,Ne)=>{!Ne.filters&&Ne.sortable?ue(de,Ne,!1):Ne.filterable&&!Ne.sortable&&V(de),g==null||g.emit("header-click",Ne,de)},$=(de,Ne)=>{g==null||g.emit("header-contextmenu",Ne,de)},re=vue.ref(null),oe=vue.ref(!1),Ce=vue.ref({}),ie=(de,Ne)=>{if(isClient&&!(Ne.children&&Ne.children.length>0)&&re.value&&i.border){oe.value=!0;const he=g;n("set-drag-visible",!0);const pe=(he==null?void 0:he.vnode.el).getBoundingClientRect().left,Ve=r.vnode.el.querySelector(`th.${Ne.id}`),Oe=Ve.getBoundingClientRect(),_e=Oe.left-pe+30;addClass(Ve,"noclick"),Ce.value={startMouseLeft:de.clientX,startLeft:Oe.right-pe,startColumnLeft:Oe.left-pe,tableLeft:pe};const At=he==null?void 0:he.refs.resizeProxy;At.style.left=`${Ce.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const $e=Ue=>{const xe=Ue.clientX-Ce.value.startMouseLeft,Dt=Ce.value.startLeft+xe;At.style.left=`${Math.max(_e,Dt)}px`},Fe=()=>{if(oe.value){const{startColumnLeft:Ue,startLeft:xe}=Ce.value,qe=Number.parseInt(At.style.left,10)-Ue;Ne.width=Ne.realWidth=qe,he==null||he.emit("header-dragend",Ne.width,xe-Ue,Ne,de),requestAnimationFrame(()=>{i.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",oe.value=!1,re.value=null,Ce.value={},n("set-drag-visible",!1)}document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",Fe),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{removeClass(Ve,"noclick")},0)};document.addEventListener("mousemove",$e),document.addEventListener("mouseup",Fe)}},ae=(de,Ne)=>{if(Ne.children&&Ne.children.length>0)return;const he=de.target;if(!isElement(he))return;const ze=he==null?void 0:he.closest("th");if(!(!Ne||!Ne.resizable)&&!oe.value&&i.border){const pe=ze.getBoundingClientRect(),Ve=document.body.style;pe.width>12&&pe.right-de.pageX<8?(Ve.cursor="col-resize",hasClass(ze,"is-sortable")&&(ze.style.cursor="col-resize"),re.value=Ne):oe.value||(Ve.cursor="",hasClass(ze,"is-sortable")&&(ze.style.cursor="pointer"),re.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 ze;de.stopPropagation();const pe=Ne.order===he?null:he||Ie(Ne),Ve=(ze=de.target)==null?void 0:ze.closest("th");if(Ve&&hasClass(Ve,"noclick")){removeClass(Ve,"noclick");return}if(!Ne.sortable)return;const Oe=i.store.states;let _e=Oe.sortProp.value,At;const $e=Oe.sortingColumn.value;($e!==Ne||$e===Ne&&$e.order===null)&&($e&&($e.order=null),Oe.sortingColumn.value=Ne,_e=Ne.property),pe?At=Ne.order=pe:At=Ne.order=null,Oe.sortProp.value=_e,Oe.sortOrder.value=At,g==null||g.store.commit("changeSortCondition")};return{handleHeaderClick:k,handleHeaderContextMenu:$,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:ue,handleFilterClick:V}}function useStyle$2(i){const n=vue.inject(TABLE_INJECTION_KEY),r=useNamespace("table");return{getHeaderRowStyle:re=>{const oe=n==null?void 0:n.props.headerRowStyle;return typeof oe=="function"?oe.call(null,{rowIndex:re}):oe},getHeaderRowClass:re=>{const oe=[],Ce=n==null?void 0:n.props.headerRowClassName;return typeof Ce=="string"?oe.push(Ce):typeof Ce=="function"&&oe.push(Ce.call(null,{rowIndex:re})),oe.join(" ")},getHeaderCellStyle:(re,oe,Ce,ie)=>{var ae;let le=(ae=n==null?void 0:n.props.headerCellStyle)!=null?ae:{};typeof le=="function"&&(le=le.call(null,{rowIndex:re,columnIndex:oe,row:Ce,column:ie}));const Ie=getFixedColumnOffset(oe,ie.fixed,i.store,Ce);return ensurePosition(Ie,"left"),ensurePosition(Ie,"right"),Object.assign({},le,Ie)},getHeaderCellClass:(re,oe,Ce,ie)=>{const ae=getFixedColumnsClass(r.b(),oe,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:re,columnIndex:oe,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=(k,$)=>{if($&&(k.level=$.level+1,n<k.level&&(n=k.level)),k.children){let re=0;k.children.forEach(oe=>{r(oe,k),re+=oe.colSpan}),k.colSpan=re}else k.colSpan=1};i.forEach(k=>{k.level=1,r(k,void 0)});const g=[];for(let k=0;k<n;k++)g.push([]);return getAllColumns(i).forEach(k=>{k.children?(k.rowSpan=1,k.children.forEach($=>$.isSubColumn=!0)):k.rowSpan=n-k.level+1,g[k.level-1].push(k)}),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 k=r.value.length>1;return k&&n&&(n.state.isGroup.value=!0),k}),toggleAllSelection:k=>{k.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),V=useNamespace("table"),k=vue.ref({}),{onColumnsChange:$,onScrollableChange:re}=useLayoutObserver(g);vue.onMounted(async()=>{await vue.nextTick(),await vue.nextTick();const{prop:_e,order:At}=i.defaultSort;g==null||g.store.commit("sort",{prop:_e,order:At,init:!0})});const{handleHeaderClick:oe,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue}=useEvent(i,n),{getHeaderRowStyle:de,getHeaderRowClass:Ne,getHeaderCellStyle:he,getHeaderCellClass:ze}=useStyle$2(i),{isGroup:pe,toggleAllSelection:Ve,columnRows:Oe}=useUtils$1(i);return r.state={onColumnsChange:$,onScrollableChange:re},r.filterPanels=k,{ns:V,filterPanels:k,onColumnsChange:$,onScrollableChange:re,columnRows:Oe,getHeaderRowClass:Ne,getHeaderRowStyle:de,getHeaderCellClass:ze,getHeaderCellStyle:he,handleHeaderClick:oe,handleHeaderContextMenu:Ce,handleMouseDown:ie,handleMouseMove:ae,handleMouseOut:le,handleSortClick:Ie,handleFilterClick:ue,isGroup:pe,toggleAllSelection:Ve}},render(){const{ns:i,isGroup:n,columnRows:r,getHeaderCellStyle:g,getHeaderCellClass:V,getHeaderRowClass:k,getHeaderRowStyle:$,handleHeaderClick:re,handleHeaderContextMenu:oe,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:k(he),key:he,style:$(he)},Ne.map((ze,pe)=>(ze.rowSpan>de&&(de=ze.rowSpan),vue.h("th",{class:V(he,pe,Ne,ze),colspan:ze.colSpan,key:`${ze.id}-thead`,rowspan:ze.rowSpan,style:g(he,pe,Ne,ze),onClick:Ve=>re(Ve,ze),onContextmenu:Ve=>oe(Ve,ze),onMousedown:Ve=>Ce(Ve,ze),onMousemove:Ve=>ie(Ve,ze),onMouseout:le},[vue.h("div",{class:["cell",ze.filteredValue&&ze.filteredValue.length>0?"highlight":""]},[ze.renderHeader?ze.renderHeader({column:ze,$index:pe,store:Ie,_self:ue}):ze.label,ze.sortable&&vue.h("span",{onClick:Ve=>ae(Ve,ze),class:"caret-wrapper"},[vue.h("i",{onClick:Ve=>ae(Ve,ze,"ascending"),class:"sort-caret ascending"}),vue.h("i",{onClick:Ve=>ae(Ve,ze,"descending"),class:"sort-caret descending"})]),ze.filterable&&vue.h(FilterPanel,{store:Ie,placement:ze.filterPlacement||"bottom-start",column:ze,upDataColumn:(Ve,Oe)=>{ze[Ve]=Oe}})])]))))))}});function useEvents(i){const n=vue.inject(TABLE_INJECTION_KEY),r=vue.ref(""),g=vue.ref(vue.h("div")),{nextZIndex:V}=useZIndex(),k=(ue,de,Ne)=>{var he;const ze=n,pe=getCell(ue);let Ve;const Oe=(he=ze==null?void 0:ze.vnode.el)==null?void 0:he.dataset.prefix;pe&&(Ve=getColumnByCell({columns:i.store.states.columns.value},pe,Oe),Ve&&(ze==null||ze.emit(`cell-${Ne}`,de,Ve,pe,ue))),ze==null||ze.emit(`row-${Ne}`,de,Ve,ue)},$=(ue,de)=>{k(ue,de,"dblclick")},re=(ue,de)=>{i.store.commit("setCurrentRow",de),k(ue,de,"click")},oe=(ue,de)=>{k(ue,de,"contextmenu")},Ce=debounce(ue=>{i.store.commit("setHoverRow",ue)},30),ie=debounce(()=>{i.store.commit("setHoverRow",null)},30),ae=ue=>{const de=window.getComputedStyle(ue,null),Ne=Number.parseInt(de.paddingLeft,10)||0,he=Number.parseInt(de.paddingRight,10)||0,ze=Number.parseInt(de.paddingTop,10)||0,pe=Number.parseInt(de.paddingBottom,10)||0;return{left:Ne,right:he,top:ze,bottom:pe}};return{handleDoubleClick:$,handleClick:re,handleContextMenu:oe,handleMouseEnter:Ce,handleMouseLeave:ie,handleCellMouseEnter:(ue,de,Ne)=>{var he;const ze=n,pe=getCell(ue),Ve=(he=ze==null?void 0:ze.vnode.el)==null?void 0:he.dataset.prefix;if(pe){const jt=getColumnByCell({columns:i.store.states.columns.value},pe,Ve),Pt=ze.hoverState={cell:pe,column:jt,row:de};ze==null||ze.emit("cell-mouse-enter",Pt.row,Pt.column,Pt.cell,ue)}if(!Ne)return;const Oe=ue.target.querySelector(".cell");if(!(hasClass(Oe,`${Ve}-tooltip`)&&Oe.childNodes.length))return;const _e=document.createRange();_e.setStart(Oe,0),_e.setEnd(Oe,Oe.childNodes.length);const At=Math.round(_e.getBoundingClientRect().width),$e=Math.round(_e.getBoundingClientRect().height),{top:Fe,left:Ue,right:xe,bottom:Dt}=ae(Oe),qe=Ue+xe,kt=Fe+Dt;(At+qe>Oe.offsetWidth||$e+kt>Oe.offsetHeight||Oe.scrollWidth>Oe.offsetWidth)&&createTablePopper(n==null?void 0:n.refs.tableWrapper,pe,pe.innerText||pe.textContent,V,Ne)},handleCellMouseLeave:ue=>{if(!getCell(ue))return;const Ne=n==null?void 0:n.hoverState;n==null||n.emit("cell-mouse-leave",Ne==null?void 0:Ne.row,Ne==null?void 0:Ne.column,Ne==null?void 0:Ne.cell,ue)},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:V,handleContextMenu:k,handleMouseEnter:$,handleMouseLeave:re,handleCellMouseEnter:oe,handleCellMouseLeave:Ce,tooltipContent:ie,tooltipTrigger:ae}=useEvents(i),{getRowStyle:le,getRowClass:Ie,getCellStyle:ue,getCellClass:de,getSpan:Ne,getColspanRealWidth:he}=useStyles(i),ze=vue.computed(()=>i.store.states.columns.value.findIndex(({type:At})=>At==="default")),pe=(At,$e)=>{const Fe=n.props.rowKey;return Fe?getRowIdentity(At,Fe):$e},Ve=(At,$e,Fe,Ue=!1)=>{const{tooltipEffect:xe,tooltipOptions:Dt,store:qe}=i,{indent:kt,columns:jt}=qe.states,Pt=Ie(At,$e);let ti=!0;Fe&&(Pt.push(r.em("row",`level-${Fe.level}`)),ti=Fe.display);const ei=ti?null:{display:"none"};return vue.h("tr",{style:[ei,le(At,$e)],class:Pt,key:pe(At,$e),onDblclick:Et=>g(Et,At),onClick:Et=>V(Et,At),onContextmenu:Et=>k(Et,At),onMouseenter:()=>$($e),onMouseleave:re},jt.value.map((Et,ni)=>{const{rowspan:ri,colspan:ci}=Ne(At,Et,$e,ni);if(!ri||!ci)return null;const Ci={...Et};Ci.realWidth=he(jt.value,ci,ni);const li={store:i.store,_self:i.context||n,column:Ci,row:At,$index:$e,cellIndex:ni,expanded:Ue};ni===ze.value&&Fe&&(li.treeNode={indent:Fe.level*kt.value,level:Fe.level},typeof Fe.expanded=="boolean"&&(li.treeNode.expanded=Fe.expanded,"loading"in Fe&&(li.treeNode.loading=Fe.loading),"noLazyChildren"in Fe&&(li.treeNode.noLazyChildren=Fe.noLazyChildren)));const ui=`${$e},${ni}`,yi=Ci.columnKey||Ci.rawColumnKey||"",Mi=Oe(ni,Et,li),zi=Et.showOverflowTooltip&&merge$2({effect:xe},Dt,Et.showOverflowTooltip);return vue.h("td",{style:ue($e,ni,At,Et),class:de($e,ni,At,Et,ci-1),key:`${yi}${ui}`,rowspan:ri,colspan:ci,onMouseenter:Ai=>oe(Ai,At,zi),onMouseleave:Ce},[Mi])}))},Oe=(At,$e,Fe)=>$e.renderCell(Fe);return{wrappedRowRender:(At,$e)=>{const Fe=i.store,{isRowExpanded:Ue,assertRowKey:xe}=Fe,{treeData:Dt,lazyTreeNodeMap:qe,childrenColumnName:kt,rowKey:jt}=Fe.states,Pt=Fe.states.columns.value;if(Pt.some(({type:ei})=>ei==="expand")){const ei=Ue(At),Et=Ve(At,$e,void 0,ei),ni=n.renderExpanded;return ei?ni?[[Et,vue.h("tr",{key:`expanded-row__${Et.key}`},[vue.h("td",{colspan:Pt.length,class:`${r.e("cell")} ${r.e("expanded-cell")}`},[ni({row:At,$index:$e,store:Fe,expanded:ei})])])]]:(console.error("[Element Error]renderExpanded is required."),Et):[[Et]]}else if(Object.keys(Dt.value).length){xe();const ei=getRowIdentity(At,jt.value);let Et=Dt.value[ei],ni=null;Et&&(ni={expanded:Et.expanded,level:Et.level,display:!0},typeof Et.lazy=="boolean"&&(typeof Et.loaded=="boolean"&&Et.loaded&&(ni.noLazyChildren=!(Et.children&&Et.children.length)),ni.loading=Et.loading));const ri=[Ve(At,$e,ni)];if(Et){let ci=0;const Ci=(ui,yi)=>{ui&&ui.length&&yi&&ui.forEach(Mi=>{const zi={display:yi.display&&yi.expanded,level:yi.level+1,expanded:!1,noLazyChildren:!1,loading:!1},Ai=getRowIdentity(Mi,jt.value);if(Ai==null)throw new Error("For nested data item, row-key is required.");if(Et={...Dt.value[Ai]},Et&&(zi.expanded=Et.expanded,Et.level=Et.level||zi.level,Et.display=!!(Et.expanded&&zi.display),typeof Et.lazy=="boolean"&&(typeof Et.loaded=="boolean"&&Et.loaded&&(zi.noLazyChildren=!(Et.children&&Et.children.length)),zi.loading=Et.loading)),ci++,ri.push(Ve(Mi,$e+ci,zi)),Et){const Ii=qe.value[Ai]||Mi[kt.value];Ci(Ii,Et)}})};Et.display=!0;const li=qe.value[ei]||At[kt.value];Ci(li,Et)}return ri}else return Ve(At,$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:V,tooltipContent:k,tooltipTrigger:$}=useRender$1(i),{onColumnsChange:re,onScrollableChange:oe}=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:re,onScrollableChange:oe,wrappedRowRender:V,tooltipContent:k,tooltipTrigger:$}},render(){const{wrappedRowRender:i,store:n}=this,r=n.states.data.value||[];return vue.h("tbody",{},[r.reduce((g,V)=>g.concat(i(V,g.length)),[])])}});function hColgroup(i){const n=i.tableLayout==="auto";let r=i.columns||[];n&&r.every(V=>V.width===void 0)&&(r=[]);const g=V=>{const k={key:`${i.tableLayout}_${V.id}`,style:{},name:void 0};return n?k.style={width:`${V.width}px`}:k.name=V.id,k};return vue.h("colgroup",{},r.map(V=>vue.h("col",g(V))))}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),V=vue.computed(()=>n.states.columns.value.length),k=vue.computed(()=>n.states.fixedColumns.value.length),$=vue.computed(()=>n.states.rightFixedColumns.value.length);return{leftFixedLeafCount:r,rightFixedLeafCount:g,columnsCount:V,leftFixedCount:k,rightFixedCount:$,columns:n.states.columns}}function useStyle$1(i){const{columns:n}=useMapState(),r=useNamespace("table");return{getCellClasses:(k,$)=>{const re=k[$],oe=[r.e("cell"),re.id,re.align,re.labelClassName,...getFixedColumnsClass(r.b(),$,re.fixed,i.store)];return re.className&&oe.push(re.className),re.children||oe.push(r.is("leaf")),oe},getCellStyles:(k,$)=>{const re=getFixedColumnOffset($,k.fixed,i.store);return ensurePosition(re,"left"),ensurePosition(re,"right"),re},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:V,ns:k}=this,$=this.store.states.data.value;let re=[];return g?re=g({columns:i,data:$}):i.forEach((oe,Ce)=>{if(Ce===0){re[Ce]=V;return}const ie=$.map(ue=>Number(ue[oe.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?re[Ce]="":re[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:k.e("footer"),cellspacing:"0",cellpadding:"0",border:"0"},[hColgroup({columns:i}),vue.h("tbody",[vue.h("tr",{},[...i.map((oe,Ce)=>vue.h("td",{key:Ce,colspan:oe.colSpan,rowspan:oe.rowSpan,class:r(i,Ce),style:n(oe,Ce)},[vue.h("div",{class:["cell",oe.labelClassName]},[re[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 V=vue.ref(!1),k=vue.ref(null),$=vue.ref(!1),re=Et=>{$.value=Et},oe=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],([Et,ni])=>{!vue.unref(ni)||!vue.unref(Et)||r.setCurrentRowKey(`${Et}`)},{immediate:!0}),vue.watch(()=>i.data,Et=>{g.store.commit("setData",Et)},{immediate:!0,deep:!0}),vue.watchEffect(()=>{i.expandRowKeys&&r.setExpandRowKeysAdapter(i.expandRowKeys)});const he=()=>{g.store.commit("setHoverRow",null),g.hoverState&&(g.hoverState=null)},ze=(Et,ni)=>{const{pixelX:ri,pixelY:ci}=ni;Math.abs(ri)>=Math.abs(ci)&&(g.refs.bodyWrapper.scrollLeft+=ni.pixelX/5)},pe=vue.computed(()=>i.height||i.maxHeight||r.states.fixedColumns.value.length>0||r.states.rightFixedColumns.value.length>0),Ve=vue.computed(()=>({width:n.bodyWidth.value?`${n.bodyWidth.value}px`:""})),Oe=()=>{pe.value&&n.updateElsHeight(),n.updateColumnsWidth(),requestAnimationFrame(Fe)};vue.onMounted(async()=>{await vue.nextTick(),r.updateColumns(),Ue(),requestAnimationFrame(Oe);const Et=g.vnode.el,ni=g.refs.headerWrapper;i.flexible&&Et&&Et.parentElement&&(Et.parentElement.style.minWidth="0"),oe.value={width:ae.value=Et.offsetWidth,height:Et.offsetHeight,headerHeight:i.showHeader&&ni?ni.offsetHeight:null},r.states.columns.value.forEach(ri=>{ri.filteredValue&&ri.filteredValue.length&&g.store.commit("filterChange",{column:ri,values:ri.filteredValue,silent:!0})}),g.$ready=!0});const _e=(Et,ni)=>{if(!Et)return;const ri=Array.from(Et.classList).filter(ci=>!ci.startsWith("is-scrolling-"));ri.push(n.scrollX.value?ni:"is-scrolling-none"),Et.className=ri.join(" ")},At=Et=>{const{tableWrapper:ni}=g.refs;_e(ni,Et)},$e=Et=>{const{tableWrapper:ni}=g.refs;return!!(ni&&ni.classList.contains(Et))},Fe=function(){if(!g.refs.scrollBarRef)return;if(!n.scrollX.value){const yi="is-scrolling-none";$e(yi)||At(yi);return}const Et=g.refs.scrollBarRef.wrapRef;if(!Et)return;const{scrollLeft:ni,offsetWidth:ri,scrollWidth:ci}=Et,{headerWrapper:Ci,footerWrapper:li}=g.refs;Ci&&(Ci.scrollLeft=ni),li&&(li.scrollLeft=ni);const ui=ci-ri-1;ni>=ui?At("is-scrolling-right"):At(ni===0?"is-scrolling-left":"is-scrolling-middle")},Ue=()=>{g.refs.scrollBarRef&&(g.refs.scrollBarRef.wrapRef&&useEventListener(g.refs.scrollBarRef.wrapRef,"scroll",Fe,{passive:!0}),i.fit?useResizeObserver(g.vnode.el,xe):useEventListener(window,"resize",xe),useResizeObserver(g.refs.bodyWrapper,()=>{var Et,ni;xe(),(ni=(Et=g.refs)==null?void 0:Et.scrollBarRef)==null||ni.update()}))},xe=()=>{var Et,ni,ri,ci;const Ci=g.vnode.el;if(!g.$ready||!Ci)return;let li=!1;const{width:ui,height:yi,headerHeight:Mi}=oe.value,zi=ae.value=Ci.offsetWidth;ui!==zi&&(li=!0);const Ai=Ci.offsetHeight;(i.height||pe.value)&&yi!==Ai&&(li=!0);const Ii=i.tableLayout==="fixed"?g.refs.headerWrapper:(Et=g.refs.tableHeaderRef)==null?void 0:Et.$el;i.showHeader&&(Ii==null?void 0:Ii.offsetHeight)!==Mi&&(li=!0),le.value=((ni=g.refs.tableWrapper)==null?void 0:ni.scrollHeight)||0,ue.value=(Ii==null?void 0:Ii.scrollHeight)||0,de.value=((ri=g.refs.footerWrapper)==null?void 0:ri.offsetHeight)||0,Ne.value=((ci=g.refs.appendWrapper)==null?void 0:ci.offsetHeight)||0,Ie.value=le.value-ue.value-de.value-Ne.value,li&&(oe.value={width:zi,height:Ai,headerHeight:i.showHeader&&(Ii==null?void 0:Ii.offsetHeight)||0},Oe())},Dt=useFormSize(),qe=vue.computed(()=>{const{bodyWidth:Et,scrollY:ni,gutterWidth:ri}=n;return Et.value?`${Et.value-(ni.value?ri:0)}px`:""}),kt=vue.computed(()=>i.maxHeight?"fixed":i.tableLayout),jt=vue.computed(()=>{if(i.data&&i.data.length)return null;let Et="100%";i.height&&Ie.value&&(Et=`${Ie.value}px`);const ni=ae.value;return{width:ni?`${ni}px`:"",height:Et}}),Pt=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:V,renderExpanded:k,setDragVisible:re,isGroup:Ce,handleMouseLeave:he,handleHeaderFooterMousewheel:ze,tableSize:Dt,emptyBlockStyle:jt,handleFixedMousewheel:(Et,ni)=>{const ri=g.refs.bodyWrapper;if(Math.abs(ni.spinY)>0){const ci=ri.scrollTop;ni.pixelY<0&&ci!==0&&Et.preventDefault(),ni.pixelY>0&&ri.scrollHeight-ri.clientHeight>ci&&Et.preventDefault(),ri.scrollTop+=Math.ceil(ni.pixelY/5)}else ri.scrollLeft+=Math.ceil(ni.pixelX/5)},resizeProxyVisible:$,bodyWidth:qe,resizeState:oe,doLayout:Oe,tableBodyStyles:Ve,tableLayout:kt,scrollbarViewStyle:ie,tableInnerStyle:Pt,scrollbarStyle:ti}}function useKeyRender(i){const n=vue.ref(),r=()=>{const V=i.vnode.el.querySelector(".hidden-columns"),k={childList:!0,subtree:!0},$=i.store.states.updateOrderFns;n.value=new MutationObserver(()=>{$.forEach(re=>re())}),n.value.observe(V,k)};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=(k,$)=>{const re=i.value;re&&re.scrollTo(k,$)},r=(k,$)=>{const re=i.value;re&&isNumber$1($)&&["Top","Left"].includes(k)&&re[`setScroll${k}`]($)};return{scrollBarRef:i,scrollTo:n,setScrollTop:k=>r("Top",k),setScrollLeft:k=>r("Left",k)}};let tableIdSeed=1;const _sfc_main$D=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 V=createStore(g,i);g.store=V;const k=new TableLayout({store:g.store,table:g,fit:i.fit,showHeader:i.showHeader});g.layout=k;const $=vue.computed(()=>(V.states.data.value||[]).length===0),{setCurrentRow:re,getSelectionRows:oe,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,sort:de}=useUtils(V),{isHidden:Ne,renderExpanded:he,setDragVisible:ze,isGroup:pe,handleMouseLeave:Ve,handleHeaderFooterMousewheel:Oe,tableSize:_e,emptyBlockStyle:At,handleFixedMousewheel:$e,resizeProxyVisible:Fe,bodyWidth:Ue,resizeState:xe,doLayout:Dt,tableBodyStyles:qe,tableLayout:kt,scrollbarViewStyle:jt,tableInnerStyle:Pt,scrollbarStyle:ti}=useStyle(i,k,V,g),{scrollBarRef:ei,scrollTo:Et,setScrollLeft:ni,setScrollTop:ri}=useScrollbar(),ci=debounce(Dt,50),Ci=`${r.namespace.value}-table_${tableIdSeed++}`;g.tableId=Ci,g.state={isGroup:pe,resizeState:xe,doLayout:Dt,debouncedUpdateLayout:ci};const li=vue.computed(()=>i.sumText||n("el.table.sumText")),ui=vue.computed(()=>i.emptyText||n("el.table.emptyText"));return useKeyRender(g),{ns:r,layout:k,store:V,handleHeaderFooterMousewheel:Oe,handleMouseLeave:Ve,tableId:Ci,tableSize:_e,isHidden:Ne,isEmpty:$,renderExpanded:he,resizeProxyVisible:Fe,resizeState:xe,isGroup:pe,bodyWidth:Ue,tableBodyStyles:qe,emptyBlockStyle:At,debouncedUpdateLayout:ci,handleFixedMousewheel:$e,setCurrentRow:re,getSelectionRows:oe,toggleRowSelection:Ce,clearSelection:ie,clearFilter:ae,toggleAllSelection:le,toggleRowExpansion:Ie,clearSort:ue,doLayout:Dt,sort:de,t:n,setDragVisible:ze,context:g,computedSumText:li,computedEmptyText:ui,tableLayout:kt,scrollbarViewStyle:jt,tableInnerStyle:Pt,scrollbarStyle:ti,scrollBarRef:ei,scrollTo:Et,setScrollLeft:ni,setScrollTop:ri}}}),_hoisted_1$q=["data-prefix"],_hoisted_2$l={ref:"hiddenColumns",class:"hidden-columns"};function _sfc_render$3(i,n,r,g,V,k){const $=vue.resolveComponent("hColgroup"),re=vue.resolveComponent("table-header"),oe=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(re,{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(re,{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(oe,{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$q)}var Table=_export_sfc$1(_sfc_main$D,[["render",_sfc_render$3],["__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:V=>V.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,V=[g.e("expand-icon")];r&&V.push(g.em("expand-icon","expanded"));const k=function($){$.stopPropagation(),n.toggleRowExpansion(i)};return vue.h("div",{class:V,onClick:k},{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 V=n.property,k=V&&getProp(i,V).value;return n&&n.formatter?n.formatter(i,n,k,r):((g=k==null?void 0:k.toString)==null?void 0:g.call(k))||""}function treeCellPrefix({row:i,treeNode:n,store:r},g=!1){const{ns:V}=r;if(!n)return g?[vue.h("span",{class:V.e("placeholder")})]:null;const k=[],$=function(re){re.stopPropagation(),!n.loading&&r.loadOrToggle(i)};if(n.indent&&k.push(vue.h("span",{class:V.e("indent"),style:{"padding-left":`${n.indent}px`}})),typeof n.expanded=="boolean"&&!n.noLazyChildren){const re=[V.e("expand-icon"),n.expanded?V.em("expand-icon","expanded"):""];let oe=arrow_right_default;n.loading&&(oe=loading_default),k.push(vue.h("div",{class:re,onClick:$},{default:()=>[vue.h(ElIcon,{class:{[V.is("loading")]:n.loading}},{default:()=>[vue.h(oe)]})]}))}else k.push(vue.h("span",{class:V.e("placeholder")}));return k}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 k=["fixed"],$={realWidth:"width",realMinWidth:"minWidth"},re=getAllAliases(k,$);Object.keys(re).forEach(oe=>{const Ce=$[oe];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{let ae=ie;Ce==="width"&&oe==="realWidth"&&(ae=parseWidth(ie)),Ce==="minWidth"&&oe==="realMinWidth"&&(ae=parseMinWidth(ie)),r.columnConfig.value[Ce]=ae,r.columnConfig.value[oe]=ae;const le=Ce==="fixed";i.value.store.scheduleLayout(le)})})},registerNormalWatchers:()=>{const k=["label","filters","filterMultiple","sortable","index","formatter","className","labelClassName","showOverflowTooltip"],$={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},re=getAllAliases(k,$);Object.keys(re).forEach(oe=>{const Ce=$[oe];hasOwn$1(n,Ce)&&vue.watch(()=>n[Ce],ie=>{r.columnConfig.value[oe]=ie})})}}}function useRender(i,n,r){const g=vue.getCurrentInstance(),V=vue.ref(""),k=vue.ref(!1),$=vue.ref(),re=vue.ref(),oe=useNamespace("table");vue.watchEffect(()=>{$.value=i.align?`is-${i.align}`:null,$.value}),vue.watchEffect(()=>{re.value=i.headerAlign?`is-${i.headerAlign}`:$.value,re.value});const Ce=vue.computed(()=>{let Ve=g.vnode.vParent||g.parent;for(;Ve&&!Ve.tableId&&!Ve.columnId;)Ve=Ve.vnode.vParent||Ve.parent;return Ve}),ie=vue.computed(()=>{const{store:Ve}=g.parent;if(!Ve)return!1;const{treeData:Oe}=Ve.states,_e=Oe.value;return _e&&Object.keys(_e).length>0}),ae=vue.ref(parseWidth(i.width)),le=vue.ref(parseMinWidth(i.minWidth)),Ie=Ve=>(ae.value&&(Ve.width=ae.value),le.value&&(Ve.minWidth=le.value),!ae.value&&le.value&&(Ve.width=void 0),Ve.minWidth||(Ve.minWidth=80),Ve.realWidth=Number(Ve.width===void 0?Ve.minWidth:Ve.width),Ve),ue=Ve=>{const Oe=Ve.type,_e=cellForced[Oe]||{};Object.keys(_e).forEach($e=>{const Fe=_e[$e];$e!=="className"&&Fe!==void 0&&(Ve[$e]=Fe)});const At=getDefaultClassName(Oe);if(At){const $e=`${vue.unref(oe.namespace)}-${At}`;Ve.className=Ve.className?`${Ve.className} ${$e}`:$e}return Ve},de=Ve=>{Array.isArray(Ve)?Ve.forEach(_e=>Oe(_e)):Oe(Ve);function Oe(_e){var At;((At=_e==null?void 0:_e.type)==null?void 0:At.name)==="ElTableColumn"&&(_e.vParent=g)}};return{columnId:V,realAlign:$,isSubColumn:k,realHeaderAlign:re,columnOrTableParent:Ce,setColumnWidth:Ie,setColumnForcedProps:ue,setColumnRenders:Ve=>{i.renderHeader?debugWarn("TableColumn","Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."):Ve.type!=="selection"&&(Ve.renderHeader=_e=>{g.columnConfig.value.label;const At=n.header;return At?At(_e):Ve.label});let Oe=Ve.renderCell;return Ve.type==="expand"?(Ve.renderCell=_e=>vue.h("div",{class:"cell"},[Oe(_e)]),r.value.renderExpanded=_e=>n.default?n.default(_e):n.default):(Oe=Oe||defaultRenderCell,Ve.renderCell=_e=>{let At=null;if(n.default){const qe=n.default(_e);At=qe.some(kt=>kt.type!==vue.Comment)?qe:Oe(_e)}else At=Oe(_e);const{columns:$e}=r.value.store.states,Fe=$e.value.findIndex(qe=>qe.type==="default"),Ue=ie.value&&_e.cellIndex===Fe,xe=treeCellPrefix(_e,Ue),Dt={class:"cell",style:{}};return Ve.showOverflowTooltip&&(Dt.class=`${Dt.class} ${vue.unref(oe.namespace)}-tooltip`,Dt.style={width:`${(_e.column.realWidth||Number(_e.column.width))-1}px`}),de(At),vue.h("div",Dt,[xe,At])}),Ve},getPropsData:(...Ve)=>Ve.reduce((Oe,_e)=>(Array.isArray(_e)&&_e.forEach(At=>{Oe[At]=i[At]}),Oe),{}),getColumnElIndex:(Ve,Oe)=>Array.prototype.indexOf.call(Ve,Oe),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({}),V=vue.computed(()=>{let pe=r.parent;for(;pe&&!pe.tableId;)pe=pe.parent;return pe}),{registerNormalWatchers:k,registerComplexWatchers:$}=useWatcher(V,i),{columnId:re,isSubColumn:oe,realHeaderAlign:Ce,columnOrTableParent:ie,setColumnWidth:ae,setColumnForcedProps:le,setColumnRenders:Ie,getPropsData:ue,getColumnElIndex:de,realAlign:Ne,updateColumnOrder:he}=useRender(i,n,V),ze=ie.value;re.value=`${ze.tableId||ze.columnId}_column_${columnIdSeed++}`,vue.onBeforeMount(()=>{oe.value=V.value!==ze;const pe=i.type||"default",Ve=i.sortable===""?!0:i.sortable,Oe=isUndefined(i.showOverflowTooltip)?ze.props.showOverflowTooltip:i.showOverflowTooltip,_e={...cellStarts[pe],id:re.value,type:pe,property:i.prop||i.property,align:Ne,headerAlign:Ce,showOverflowTooltip:Oe,filterable:i.filters||i.filterMethod,filteredValue:[],filterPlacement:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:Ve,index:i.index,rawColumnKey:r.vnode.key};let xe=ue(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement"]);xe=mergeOptions(_e,xe),xe=compose(Ie,ae,le)(xe),g.value=xe,k(),$()}),vue.onMounted(()=>{var pe;const Ve=ie.value,Oe=oe.value?Ve.vnode.el.children:(pe=Ve.refs.hiddenColumns)==null?void 0:pe.children,_e=()=>de(Oe||[],r.vnode.el);g.value.getColumnIndex=_e,_e()>-1&&V.value.store.commit("insertColumn",g.value,oe.value?Ve.columnConfig.value:null,he)}),vue.onBeforeUnmount(()=>{V.value.store.commit("removeColumn",g.value,oe.value?ze.columnConfig.value:null,he)}),r.columnId=re.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}),V=[];if(Array.isArray(g))for(const $ of g)((r=$.type)==null?void 0:r.name)==="ElTableColumn"||$.shapeFlag&2?V.push($):$.type===vue.Fragment&&Array.isArray($.children)&&$.children.forEach(re=>{(re==null?void 0:re.patchFlag)!==1024&&!isString$1(re==null?void 0:re.children)&&V.push(re)});return vue.h("div",V)}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$C=vue.defineComponent({...__default__$6,props:tabBarProps,setup(i,{expose:n}){const r=i,g=vue.getCurrentInstance(),V=vue.inject(tabsRootContextKey);V||throwError$1(COMPONENT_NAME$3,"<el-tabs><el-tab-bar /></el-tabs>");const k=useNamespace("tabs"),$=vue.ref(),re=vue.ref(),oe=()=>{let ie=0,ae=0;const le=["top","bottom"].includes(V.props.tabPosition)?"width":"height",Ie=le==="width"?"x":"y",ue=Ie==="x"?"left":"top";return r.tabs.every(de=>{var Ne,he;const ze=(he=(Ne=g.parent)==null?void 0:Ne.refs)==null?void 0:he[`tab-${de.uid}`];if(!ze)return!1;if(!de.active)return!0;ie=ze[`offset${capitalize(ue)}`],ae=ze[`client${capitalize(le)}`];const pe=window.getComputedStyle(ze);return le==="width"&&(r.tabs.length>1&&(ae-=Number.parseFloat(pe.paddingLeft)+Number.parseFloat(pe.paddingRight)),ie+=Number.parseFloat(pe.paddingLeft)),!1}),{[le]:`${ae}px`,transform:`translate${capitalize(Ie)}(${ie}px)`}},Ce=()=>re.value=oe();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(k).e("active-bar"),vue.unref(k).is(vue.unref(V).props.tabPosition)]),style:vue.normalizeStyle(re.value)},null,6))}});var TabBar=_export_sfc$1(_sfc_main$C,[["__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(),V=vue.inject(tabsRootContextKey);V||throwError$1(COMPONENT_NAME$2,"<el-tabs><tab-nav /></el-tabs>");const k=useNamespace("tabs"),$=useDocumentVisibility(),re=useWindowFocus(),oe=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(V.props.tabPosition)?"width":"height"),he=vue.computed(()=>({transform:`translate${Ne.value==="width"?"X":"Y"}(-${Ie.value}px)`})),ze=()=>{if(!oe.value)return;const Fe=oe.value[`offset${capitalize(Ne.value)}`],Ue=Ie.value;if(!Ue)return;const xe=Ue>Fe?Ue-Fe:0;Ie.value=xe},pe=()=>{if(!oe.value||!Ce.value)return;const Fe=Ce.value[`offset${capitalize(Ne.value)}`],Ue=oe.value[`offset${capitalize(Ne.value)}`],xe=Ie.value;if(Fe-xe<=Ue)return;const Dt=Fe-xe>Ue*2?xe+Ue:Fe-Ue;Ie.value=Dt},Ve=async()=>{const Fe=Ce.value;if(!le.value||!ie.value||!oe.value||!Fe)return;await vue.nextTick();const Ue=ie.value.querySelector(".is-active");if(!Ue)return;const xe=oe.value,Dt=["top","bottom"].includes(V.props.tabPosition),qe=Ue.getBoundingClientRect(),kt=xe.getBoundingClientRect(),jt=Dt?Fe.offsetWidth-kt.width:Fe.offsetHeight-kt.height,Pt=Ie.value;let ti=Pt;Dt?(qe.left<kt.left&&(ti=Pt-(kt.left-qe.left)),qe.right>kt.right&&(ti=Pt+qe.right-kt.right)):(qe.top<kt.top&&(ti=Pt-(kt.top-qe.top)),qe.bottom>kt.bottom&&(ti=Pt+(qe.bottom-kt.bottom))),ti=Math.max(ti,0),Ie.value=Math.min(ti,jt)},Oe=()=>{var Fe;if(!Ce.value||!oe.value)return;i.stretch&&((Fe=ae.value)==null||Fe.update());const Ue=Ce.value[`offset${capitalize(Ne.value)}`],xe=oe.value[`offset${capitalize(Ne.value)}`],Dt=Ie.value;xe<Ue?(le.value=le.value||{},le.value.prev=Dt,le.value.next=Dt+xe<Ue,Ue-Dt<xe&&(Ie.value=Ue-xe)):(le.value=!1,Dt>0&&(Ie.value=0))},_e=Fe=>{const Ue=Fe.code,{up:xe,down:Dt,left:qe,right:kt}=EVENT_CODE;if(![xe,Dt,qe,kt].includes(Ue))return;const jt=Array.from(Fe.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),Pt=jt.indexOf(Fe.target);let ti;Ue===qe||Ue===xe?Pt===0?ti=jt.length-1:ti=Pt-1:Pt<jt.length-1?ti=Pt+1:ti=0,jt[ti].focus({preventScroll:!0}),jt[ti].click(),At()},At=()=>{de.value&&(ue.value=!0)},$e=()=>ue.value=!1;return vue.watch($,Fe=>{Fe==="hidden"?de.value=!1:Fe==="visible"&&setTimeout(()=>de.value=!0,50)}),vue.watch(re,Fe=>{Fe?setTimeout(()=>de.value=!0,50):de.value=!1}),useResizeObserver(ie,Oe),vue.onMounted(()=>setTimeout(()=>Ve(),0)),vue.onUpdated(()=>Oe()),n({scrollToActiveTab:Ve,removeFocus:$e}),vue.watch(()=>i.panes,()=>g.update(),{flush:"post",deep:!0}),()=>{const Fe=le.value?[vue.createVNode("span",{class:[k.e("nav-prev"),k.is("disabled",!le.value.prev)],onClick:ze},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_left_default,null,null)]})]),vue.createVNode("span",{class:[k.e("nav-next"),k.is("disabled",!le.value.next)],onClick:pe},[vue.createVNode(ElIcon,null,{default:()=>[vue.createVNode(arrow_right_default,null,null)]})])]:null,Ue=i.panes.map((xe,Dt)=>{var qe,kt,jt,Pt;const ti=xe.uid,ei=xe.props.disabled,Et=(kt=(qe=xe.props.name)!=null?qe:xe.index)!=null?kt:`${Dt}`,ni=!ei&&(xe.isClosable||i.editable);xe.index=`${Dt}`;const ri=ni?vue.createVNode(ElIcon,{class:"is-icon-close",onClick:li=>r("tabRemove",xe,li)},{default:()=>[vue.createVNode(close_default,null,null)]}):null,ci=((Pt=(jt=xe.slots).label)==null?void 0:Pt.call(jt))||xe.props.label,Ci=!ei&&xe.active?0:-1;return vue.createVNode("div",{ref:`tab-${ti}`,class:[k.e("item"),k.is(V.props.tabPosition),k.is("active",xe.active),k.is("disabled",ei),k.is("closable",ni),k.is("focus",ue.value)],id:`tab-${Et}`,key:`tab-${ti}`,"aria-controls":`pane-${Et}`,role:"tab","aria-selected":xe.active,tabindex:Ci,onFocus:()=>At(),onBlur:()=>$e(),onClick:li=>{$e(),r("tabClick",xe,Et,li)},onKeydown:li=>{ni&&(li.code===EVENT_CODE.delete||li.code===EVENT_CODE.backspace)&&r("tabRemove",xe,li)}},[ci,ri])});return vue.createVNode("div",{ref:ie,class:[k.e("nav-wrap"),k.is("scrollable",!!le.value),k.is(V.props.tabPosition)]},[Fe,vue.createVNode("div",{class:k.e("nav-scroll"),ref:oe},[vue.createVNode("div",{class:[k.e("nav"),k.is(V.props.tabPosition),k.is("stretch",i.stretch&&["top","bottom"].includes(V.props.tabPosition))],ref:Ce,style:he.value,role:"tablist",onKeydown:_e},[i.type?null:vue.createVNode(TabBar,{ref:ae,tabs:[...i.panes]},null),Ue])])])}}}),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 V,k;const $=useNamespace("tabs"),{children:re,addChild:oe,removeChild:Ce}=useOrderedChildren(vue.getCurrentInstance(),"ElTabPane"),ie=vue.ref(),ae=vue.ref((k=(V=i.modelValue)!=null?V:i.activeName)!=null?k:"0"),le=he=>{ae.value=he,n(UPDATE_MODEL_EVENT,he),n("tabChange",he)},Ie=async he=>{var ze,pe,Ve;if(!(ae.value===he||isUndefined(he)))try{await((ze=i.beforeLeave)==null?void 0:ze.call(i,he,ae.value))!==!1&&(le(he),(Ve=(pe=ie.value)==null?void 0:pe.removeFocus)==null||Ve.call(pe))}catch{}},ue=(he,ze,pe)=>{he.props.disabled||(Ie(ze),n("tabClick",he,pe))},de=(he,ze)=>{he.props.disabled||isUndefined(he.props.name)||(ze.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:oe,unregisterPane:Ce}),g({currentName:ae}),()=>{const he=i.editable||i.addable?vue.createVNode("span",{class:$.e("new-tab"),tabindex:"0",onClick:Ne,onKeydown:Ve=>{Ve.code===EVENT_CODE.enter&&Ne()}},[vue.createVNode(ElIcon,{class:$.is("icon-plus")},{default:()=>[vue.createVNode(plus_default,null,null)]})]):null,ze=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:re.value,stretch:i.stretch,onTabClick:ue,onTabRemove:de},null)]),pe=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"?[ze,pe]:[pe,ze]])}}});const tabPaneProps=buildProps({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),_hoisted_1$p=["id","aria-hidden","aria-labelledby"],COMPONENT_NAME$1="ElTabPane",__default__$5=vue.defineComponent({name:COMPONENT_NAME$1}),_sfc_main$B=vue.defineComponent({...__default__$5,props:tabPaneProps,setup(i){const n=i,r=vue.getCurrentInstance(),g=vue.useSlots(),V=vue.inject(tabsRootContextKey);V||throwError$1(COMPONENT_NAME$1,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const k=useNamespace("tab-pane"),$=vue.ref(),re=vue.computed(()=>n.closable||V.props.closable),oe=computedEager(()=>{var Ie;return V.currentName.value===((Ie=n.name)!=null?Ie:$.value)}),Ce=vue.ref(oe.value),ie=vue.computed(()=>{var Ie;return(Ie=n.name)!=null?Ie:$.value}),ae=computedEager(()=>!n.lazy||Ce.value||oe.value);vue.watch(oe,Ie=>{Ie&&(Ce.value=!0)});const le=vue.reactive({uid:r.uid,slots:g,props:n,paneName:ie,active:oe,index:$,isClosable:re});return vue.onMounted(()=>{V.registerPane(le)}),vue.onUnmounted(()=>{V.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(k).b()),role:"tabpanel","aria-hidden":!vue.unref(oe),"aria-labelledby":`tab-${vue.unref(ie)}`},[vue.renderSlot(Ie.$slots,"default")],10,_hoisted_1$p)),[[vue.vShow,vue.unref(oe)]]):vue.createCommentVNode("v-if",!0)}});var TabPane=_export_sfc$1(_sfc_main$B,[["__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 V=i.value.currentNode;g!==V&&n("current-change",V?V.data:null,V)},getChildState=i=>{let n=!0,r=!0,g=!0;for(let V=0,k=i.length;V<k;V++){const $=i[V];($.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 V=i.parent;!V||V.level===0||i.store.checkStrictly||reInitChecked(V)},getPropertyFromData=function(i,n){const r=i.store.props,g=i.data||{},V=r[n];if(typeof V=="function")return V(g,i);if(typeof V=="string")return g[V];if(typeof V>"u"){const k=g[n];return k===void 0?"":k}};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 k=getPropertyFromData(this,"isLeaf");typeof k=="boolean"&&(this.isLeafByUser=k)}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,V=n.key;V&&g&&g.includes(this.key)&&this.expand(null,n.autoExpandParent),V&&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,V=r.length;g<V;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 V=this.getChildren(!0);V.includes(n.data)||(typeof r>"u"||r<0?V.push(n.data):V.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 V=this.childNodes.indexOf(n);V>-1&&(this.store&&this.store.deregisterNode(n),n.parent=null,this.childNodes.splice(V,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 V=this.parent;for(;V.level>0;)V.expanded=!0,V=V.parent}this.expanded=!0,n&&n(),this.childNodes.forEach(V=>{V.canFocus=!0})};this.shouldLoadData()?this.loadData(V=>{Array.isArray(V)&&(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,V){if(this.indeterminate=n==="half",this.checked=n===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:$,allWithoutDisable:re}=getChildState(this.childNodes);!this.isLeaf&&!$&&re&&(this.checked=!1,n=!1);const oe=()=>{if(r){const Ce=this.childNodes;for(let le=0,Ie=Ce.length;le<Ie;le++){const ue=Ce[le];V=V||n!==!1;const de=ue.disabled?ue.checked:V;ue.setChecked(de,r,!0,V)}const{half:ie,all:ae}=getChildState(Ce);ae||(this.checked=ae,this.indeterminate=ie)}};if(this.shouldLoadData()){this.loadData(()=>{oe(),reInitChecked(this)},{checked:n!==!1});return}else oe()}const k=this.parent;!k||k.level===0||g||reInitChecked(k)}getChildren(n=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const g=this.store.props;let V="children";return g&&(V=g.children||"children"),r[V]===void 0&&(r[V]=null),n&&!r[V]&&(r[V]=[]),r[V]}updateChildren(){const n=this.getChildren()||[],r=this.childNodes.map(k=>k.data),g={},V=[];n.forEach((k,$)=>{const re=k[NODE_KEY];!!re&&r.findIndex(Ce=>Ce[NODE_KEY]===re)>=0?g[re]={index:$,data:k}:V.push({index:$,data:k})}),this.store.lazy||r.forEach(k=>{g[k[NODE_KEY]]||this.removeChildByData(k)}),V.forEach(({index:k,data:$})=>{this.insertChild({data:$},k)}),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=V=>{this.childNodes=[],this.doCreateChildren(V,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),n&&n.call(this,V)};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,V=function(k){const $=k.root?k.root.childNodes:k.childNodes;if($.forEach(re=>{re.visible=r.call(re,n,re.data,re),V(re)}),!k.visible&&$.length){let re=!0;re=!$.some(oe=>oe.visible),k.root?k.root.visible=re===!1:k.visible=re===!1}n&&k.visible&&!k.isLeaf&&!g&&k.expand()};V(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 V=r[g];V&&V.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=[],V=function(k){(k.root?k.root.childNodes:k.childNodes).forEach(re=>{(re.checked||r&&re.indeterminate)&&(!n||n&&re.isLeaf)&&g.push(re.data),V(re)})};return V(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(k=>{k.indeterminate&&n.push(k.data),r(k)})};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 V=g.childNodes;for(let k=V.length-1;k>=0;k--){const $=V[k];this.remove($.data)}for(let k=0,$=r.length;k<$;k++){const re=r[k];this.append(re,g.data)}}_setCheckedKeys(n,r=!1,g){const V=this._getAllNodes().sort((re,oe)=>oe.level-re.level),k=Object.create(null),$=Object.keys(g);V.forEach(re=>re.setChecked(!1,!1));for(let re=0,oe=V.length;re<oe;re++){const Ce=V[re],ie=Ce.data[n].toString();if(!$.includes(ie)){Ce.checked&&!k[ie]&&Ce.setChecked(!1,!1);continue}let le=Ce.parent;for(;le&&le.level>0;)k[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,V={};n.forEach(k=>{V[(k||{})[g]]=!0}),this._setCheckedKeys(g,r,V)}setCheckedKeys(n,r=!1){this.defaultCheckedKeys=n;const g=this.key,V={};n.forEach(k=>{V[k]=!0}),this._setCheckedKeys(g,r,V)}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 V=this.getNode(n);V&&V.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],V=this.nodesMap[g];this.setCurrentNode(V),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$A=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 V=i.node,{data:k,store:$}=V;return i.renderContent?i.renderContent(vue.h,{_self:r,node:V,data:k,store:$}):g.ctx.slots.default?g.ctx.slots.default({node:V,data:k}):vue.h("span",{class:n.be("node","label")},[V.label])}}});var NodeContent=_export_sfc$1(_sfc_main$A,[["__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 V of r.children)V.treeNodeExpand(g)}}}const dragEventsKey=Symbol("dragEvents");function useDragNodeHandler({props:i,ctx:n,el$:r,dropIndicator$:g,store:V}){const k=useNamespace("tree"),$=vue.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),re=({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)},oe=({event:ie,treeNode:ae})=>{const le=ae,Ie=$.value.dropNode;Ie&&Ie.node.id!==le.node.id&&removeClass(Ie.$el,k.is("drop-inner"));const ue=$.value.draggingNode;if(!ue||!le)return;let de=!0,Ne=!0,he=!0,ze=!0;typeof i.allowDrop=="function"&&(de=i.allowDrop(ue.node,le.node,"prev"),ze=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 pe=le.$el.querySelector(`.${k.be("node","content")}`).getBoundingClientRect(),Ve=r.value.getBoundingClientRect();let Oe;const _e=de?Ne?.25:he?.45:1:-1,At=he?Ne?.75:de?.55:0:1;let $e=-9999;const Fe=ie.clientY-pe.top;Fe<pe.height*_e?Oe="before":Fe>pe.height*At?Oe="after":Ne?Oe="inner":Oe="none";const Ue=le.$el.querySelector(`.${k.be("node","expand-icon")}`).getBoundingClientRect(),xe=g.value;Oe==="before"?$e=Ue.top-Ve.top:Oe==="after"&&($e=Ue.bottom-Ve.top),xe.style.top=`${$e}px`,xe.style.left=`${Ue.right-Ve.left}px`,Oe==="inner"?addClass(le.$el,k.is("drop-inner")):removeClass(le.$el,k.is("drop-inner")),$.value.showDropIndicator=Oe==="before"||Oe==="after",$.value.allowDrop=$.value.showDropIndicator||ze,$.value.dropType=Oe,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"&&V.value.registerNode(ue),removeClass(Ie.$el,k.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:re,treeNodeDragOver:oe,treeNodeDragEnd:Ce}),{dragState:$}}const _sfc_main$z=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),V=vue.inject("RootTree"),k=vue.ref(!1),$=vue.ref(!1),re=vue.ref(null),oe=vue.ref(null),Ce=vue.ref(null),ie=vue.inject(dragEventsKey),ae=vue.getCurrentInstance();vue.provide("NodeInstance",ae),V||debugWarn("Tree","Can not find node's tree."),i.node.expanded&&(k.value=!0,$.value=!0);const le=V.props.children||"children";vue.watch(()=>{const Fe=i.node.data[le];return Fe&&[...Fe]},()=>{i.node.updateChildren()}),vue.watch(()=>i.node.indeterminate,Fe=>{de(i.node.checked,Fe)}),vue.watch(()=>i.node.checked,Fe=>{de(Fe,i.node.indeterminate)}),vue.watch(()=>i.node.expanded,Fe=>{vue.nextTick(()=>k.value=Fe),Fe&&($.value=!0)});const Ie=Fe=>getNodeKey(V.props.nodeKey,Fe.data),ue=Fe=>{const Ue=i.props.class;if(!Ue)return{};let xe;if(isFunction$2(Ue)){const{data:Dt}=Fe;xe=Ue(Dt,Fe)}else xe=Ue;return isString$1(xe)?{[xe]:!0}:xe},de=(Fe,Ue)=>{(re.value!==Fe||oe.value!==Ue)&&V.ctx.emit("check-change",i.node.data,Fe,Ue),re.value=Fe,oe.value=Ue},Ne=Fe=>{handleCurrentChange(V.store,V.ctx.emit,()=>V.store.value.setCurrentNode(i.node)),V.currentNode.value=i.node,V.props.expandOnClickNode&&ze(),V.props.checkOnClickNode&&!i.node.disabled&&pe(null,{target:{checked:!i.node.checked}}),V.ctx.emit("node-click",i.node.data,i.node,ae,Fe)},he=Fe=>{V.instance.vnode.props.onNodeContextmenu&&(Fe.stopPropagation(),Fe.preventDefault()),V.ctx.emit("node-contextmenu",Fe,i.node.data,i.node,ae)},ze=()=>{i.node.isLeaf||(k.value?(V.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)))},pe=(Fe,Ue)=>{i.node.setChecked(Ue.target.checked,!V.props.checkStrictly),vue.nextTick(()=>{const xe=V.store.value;V.ctx.emit("check",i.node.data,{checkedNodes:xe.getCheckedNodes(),checkedKeys:xe.getCheckedKeys(),halfCheckedNodes:xe.getHalfCheckedNodes(),halfCheckedKeys:xe.getHalfCheckedKeys()})})};return{ns:r,node$:Ce,tree:V,expanded:k,childNodeRendered:$,oldChecked:re,oldIndeterminate:oe,getNodeKey:Ie,getNodeClass:ue,handleSelectChange:de,handleClick:Ne,handleContextMenu:he,handleExpandIconClick:ze,handleCheckChange:pe,handleChildNodeExpand:(Fe,Ue,xe)=>{g(Ue),V.ctx.emit("node-expand",Fe,Ue,xe)},handleDragStart:Fe=>{V.props.draggable&&ie.treeNodeDragStart({event:Fe,treeNode:i})},handleDragOver:Fe=>{Fe.preventDefault(),V.props.draggable&&ie.treeNodeDragOver({event:Fe,treeNode:{$el:Ce.value,node:i.node}})},handleDrop:Fe=>{Fe.preventDefault()},handleDragEnd:Fe=>{V.props.draggable&&ie.treeNodeDragEnd(Fe)},CaretRight:caret_right_default}}}),_hoisted_1$o=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],_hoisted_2$k=["aria-expanded"];function _sfc_render$2(i,n,r,g,V,k){const $=vue.resolveComponent("el-icon"),re=vue.resolveComponent("el-checkbox"),oe=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(re,{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(oe)]),_: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$o)),[[vue.vShow,i.node.visible]])}var ElTreeNode=_export_sfc$1(_sfc_main$z,[["render",_sfc_render$2],["__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([]),V=vue.shallowRef([]);vue.onMounted(()=>{$()}),vue.onUpdated(()=>{g.value=Array.from(i.value.querySelectorAll("[role=treeitem]")),V.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"))}),vue.watch(V,re=>{re.forEach(oe=>{oe.setAttribute("tabindex","-1")})}),useEventListener(i,"keydown",re=>{const oe=re.target;if(!oe.className.includes(r.b("node")))return;const Ce=re.code;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const ie=g.value.indexOf(oe);let ae;if([EVENT_CODE.up,EVENT_CODE.down].includes(Ce)){if(re.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)&&(re.preventDefault(),oe.click());const le=oe.querySelector('[type="checkbox"]');[EVENT_CODE.enter,EVENT_CODE.space].includes(Ce)&&le&&(re.preventDefault(),le.click())});const $=()=>{var re;g.value=Array.from(i.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),V.value=Array.from(i.value.querySelectorAll("input[type=checkbox]"));const oe=i.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(oe.length){oe[0].setAttribute("tabindex","0");return}(re=g.value[0])==null||re.setAttribute("tabindex","0")}}const _sfc_main$y=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"),V=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}));V.value.initialize();const k=vue.ref(V.value.root),$=vue.ref(null),re=vue.ref(null),oe=vue.ref(null),{broadcastExpanded:Ce}=useNodeExpandEventBroadcast(i),{dragState:ie}=useDragNodeHandler({props:i,ctx:n,el$:re,dropIndicator$:oe,store:V});useKeydown({el$:re},V);const ae=vue.computed(()=>{const{childNodes:ti}=k.value;return!ti||ti.length===0||ti.every(({visible:ei})=>!ei)});vue.watch(()=>i.currentNodeKey,ti=>{V.value.setCurrentNodeKey(ti)}),vue.watch(()=>i.defaultCheckedKeys,ti=>{V.value.setDefaultCheckedKey(ti)}),vue.watch(()=>i.defaultExpandedKeys,ti=>{V.value.setDefaultExpandedKeys(ti)}),vue.watch(()=>i.data,ti=>{V.value.setData(ti)},{deep:!0}),vue.watch(()=>i.checkStrictly,ti=>{V.value.checkStrictly=ti});const le=ti=>{if(!i.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");V.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=V.value.getNode(ti);if(!ei)return[];const Et=[ei.data];let ni=ei.parent;for(;ni&&ni!==k.value;)Et.push(ni.data),ni=ni.parent;return Et.reverse()},de=(ti,ei)=>V.value.getCheckedNodes(ti,ei),Ne=ti=>V.value.getCheckedKeys(ti),he=()=>{const ti=V.value.getCurrentNode();return ti?ti.data:null},ze=()=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const ti=he();return ti?ti[i.nodeKey]:null},pe=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");V.value.setCheckedNodes(ti,ei)},Ve=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");V.value.setCheckedKeys(ti,ei)},Oe=(ti,ei,Et)=>{V.value.setChecked(ti,ei,Et)},_e=()=>V.value.getHalfCheckedNodes(),At=()=>V.value.getHalfCheckedKeys(),$e=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");handleCurrentChange(V,n.emit,()=>V.value.setUserCurrentNode(ti,ei))},Fe=(ti,ei=!0)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");handleCurrentChange(V,n.emit,()=>V.value.setCurrentNodeKey(ti,ei))},Ue=ti=>V.value.getNode(ti),xe=ti=>{V.value.remove(ti)},Dt=(ti,ei)=>{V.value.append(ti,ei)},qe=(ti,ei)=>{V.value.insertBefore(ti,ei)},kt=(ti,ei)=>{V.value.insertAfter(ti,ei)},jt=(ti,ei,Et)=>{Ce(ei),n.emit("node-expand",ti,ei,Et)},Pt=(ti,ei)=>{if(!i.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");V.value.updateChildren(ti,ei)};return vue.provide("RootTree",{ctx:n,props:i,store:V,root:k,currentNode:$,instance:vue.getCurrentInstance()}),vue.provide(formItemContextKey,void 0),{ns:g,store:V,root:k,currentNode:$,dragState:ie,el$:re,dropIndicator$:oe,isEmpty:ae,filter:le,getNodeKey:Ie,getNodePath:ue,getCheckedNodes:de,getCheckedKeys:Ne,getCurrentNode:he,getCurrentKey:ze,setCheckedNodes:pe,setCheckedKeys:Ve,setChecked:Oe,getHalfCheckedNodes:_e,getHalfCheckedKeys:At,setCurrentNode:$e,setCurrentKey:Fe,t:r,getNode:Ue,remove:xe,append:Dt,insertBefore:qe,insertAfter:kt,handleNodeExpand:jt,updateKeyChildren:Pt}}});function _sfc_render$1(i,n,r,g,V,k){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,re=>(vue.openBlock(),vue.createBlock($,{key:i.getNodeKey(re),node:re,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 re;return[vue.createElementVNode("span",{class:vue.normalizeClass(i.ns.e("empty-text"))},vue.toDisplayString((re=i.emptyText)!=null?re: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$y,[["render",_sfc_render$1],["__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,V){super(n),this.name="UploadAjaxError",this.status=r,this.method=g,this.url=V}}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",k=>{const $=k;$.percent=k.total>0?k.loaded/k.total*100:0,i.onProgress($)});const g=new FormData;if(i.data)for(const[k,$]of Object.entries(i.data))Array.isArray($)?g.append(k,...$):g.append(k,$);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 V=i.headers||{};if(V instanceof Headers)V.forEach((k,$)=>n.setRequestHeader($,k));else for(const[k,$]of Object.entries(V))isNil($)||n.setRequestHeader(k,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$n=["onKeydown"],_hoisted_2$j=["src"],_hoisted_3$f=["onClick"],_hoisted_4$c=["title"],_hoisted_5$a=["onClick"],_hoisted_6$8=["onClick"],__default__$4=vue.defineComponent({name:"ElUploadList"}),_sfc_main$x=vue.defineComponent({...__default__$4,props:uploadListProps,emits:uploadListEmits,setup(i,{emit:n}){const{t:r}=useLocale(),g=useNamespace("upload"),V=useNamespace("icon"),k=useNamespace("list"),$=useFormDisabled(),re=vue.ref(!1),oe=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(k).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:re.value}]),tabindex:"0",onKeydown:vue.withKeys(le=>!vue.unref($)&&oe(ae),["delete"]),onFocus:ie[0]||(ie[0]=le=>re.value=!0),onBlur:ie[1]||(ie[1]=le=>re.value=!1),onClick:ie[2]||(ie[2]=le=>re.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(V).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$c)],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(V).m("upload-success"),vue.unref(V).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(V).m("upload-success"),vue.unref(V).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(V).m("close")),onClick:le=>oe(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(V).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(V).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=>oe(ae)},[vue.createVNode(vue.unref(ElIcon),{class:vue.normalizeClass(vue.unref(V).m("delete"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(delete_default))]),_:1},8,["class"])],10,_hoisted_6$8))],2)):vue.createCommentVNode("v-if",!0)])],42,_hoisted_1$n))),128)),vue.renderSlot(Ce.$slots,"append")]),_:3},8,["class","name"]))}});var UploadList=_export_sfc$1(_sfc_main$x,[["__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$m=["onDrop","onDragover"],COMPONENT_NAME="ElUploadDrag",__default__$3=vue.defineComponent({name:COMPONENT_NAME}),_sfc_main$w=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"),V=vue.ref(!1),k=useFormDisabled(),$=oe=>{if(k.value)return;V.value=!1,oe.stopPropagation();const Ce=Array.from(oe.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)},re=()=>{k.value||(V.value=!0)};return(oe,Ce)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([vue.unref(g).b("dragger"),vue.unref(g).is("dragover",V.value)]),onDrop:vue.withModifiers($,["prevent"]),onDragover:vue.withModifiers(re,["prevent"]),onDragleave:Ce[0]||(Ce[0]=vue.withModifiers(ie=>V.value=!1,["prevent"]))},[vue.renderSlot(oe.$slots,"default")],42,_hoisted_1$m))}});var UploadDragger=_export_sfc$1(_sfc_main$w,[["__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$l=["onKeydown"],_hoisted_2$i=["name","multiple","accept"],__default__$2=vue.defineComponent({name:"ElUploadContent",inheritAttrs:!1}),_sfc_main$v=vue.defineComponent({...__default__$2,props:uploadContentProps,setup(i,{expose:n}){const r=i,g=useNamespace("upload"),V=useFormDisabled(),k=vue.shallowRef({}),$=vue.shallowRef(),re=ue=>{if(ue.length===0)return;const{autoUpload:de,limit:Ne,fileList:he,multiple:ze,onStart:pe,onExceed:Ve}=r;if(Ne&&he.length+ue.length>Ne){Ve(ue,he);return}ze||(ue=ue.slice(0,1));for(const Oe of ue){const _e=Oe;_e.uid=genFileId(),pe(_e),de&&oe(_e)}},oe=async ue=>{if($.value.value="",!r.beforeUpload)return Ce(ue);let de,Ne={};try{const ze=r.data,pe=r.beforeUpload(ue);Ne=isObject$4(r.data)?cloneDeep(r.data):r.data,de=await pe,isObject$4(r.data)&&isEqual(ze,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:ze,withCredentials:pe,name:Ve,action:Oe,onProgress:_e,onSuccess:At,onError:$e,httpRequest:Fe}=r,{uid:Ue}=ue,xe={headers:Ne||{},withCredentials:pe,file:ue,data:de??he,method:ze,filename:Ve,action:Oe,onProgress:qe=>{_e(qe,ue)},onSuccess:qe=>{At(qe,ue),delete k.value[Ue]},onError:qe=>{$e(qe,ue),delete k.value[Ue]}},Dt=Fe(xe);k.value[Ue]=Dt,Dt instanceof Promise&&Dt.then(xe.onSuccess,xe.onError)},ie=ue=>{const de=ue.target.files;de&&re(Array.from(de))},ae=()=>{V.value||($.value.value="",$.value.click())},le=()=>{ae()};return n({abort:ue=>{entriesOf(k.value).filter(ue?([Ne])=>String(ue.uid)===Ne:()=>!0).forEach(([Ne,he])=>{he instanceof XMLHttpRequest&&he.abort(),delete k.value[Ne]})},upload:oe}),(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(V),onFile:re},{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$l))}});var UploadContent=_export_sfc$1(_sfc_main$v,[["__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 V(le){var Ie;(Ie=n.value)==null||Ie.abort(le)}function k(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))},re=(le,Ie)=>{const ue=g(Ie);ue&&(i.onProgress(le,ue,r.value),ue.status="uploading",ue.percentage=Math.round(le.percent))},oe=(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=>{V(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:V,clearFiles:k,handleError:$,handleProgress:re,handleStart:Ce,handleSuccess:oe,handleRemove:ie,submit:ae}},__default__$1=vue.defineComponent({name:"ElUpload"}),_sfc_main$u=vue.defineComponent({...__default__$1,props:uploadProps,setup(i,{expose:n}){const r=i,g=vue.useSlots(),V=useFormDisabled(),k=vue.shallowRef(),{abort:$,submit:re,clearFiles:oe,uploadFiles:Ce,handleStart:ie,handleError:ae,handleRemove:le,handleSuccess:Ie,handleProgress:ue}=useHandlers(r,k),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:re,clearFiles:oe,handleStart:ie,handleRemove:le}),(he,ze)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.unref(de)&&he.showFileList?(vue.openBlock(),vue.createBlock(UploadList,{key:0,disabled:vue.unref(V),"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:k},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:pe})=>[vue.renderSlot(he.$slots,"file",{file:pe})])}: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:k},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(V),"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:pe})=>[vue.renderSlot(he.$slots,"file",{file:pe})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):vue.createCommentVNode("v-if",!0)]))}});var Upload=_export_sfc$1(_sfc_main$u,[["__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(V=>V.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$k=["id"],_hoisted_2$h=["innerHTML"],__default__=vue.defineComponent({name:"ElMessage"}),_sfc_main$t=vue.defineComponent({...__default__,props:messageProps,emits:messageEmits,setup(i,{expose:n}){const r=i,{Close:g}=TypeComponents,{ns:V,zIndex:k}=useGlobalComponentSettings("message"),{currentZIndex:$,nextZIndex:re}=k,oe=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 At=r.type;return{[V.bm("icon",At)]:At&&TypeComponentsMap[At]}}),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),ze=vue.computed(()=>({top:`${Ne.value}px`,zIndex:$.value}));function pe(){r.duration!==0&&({stop:ae}=useTimeoutFn(()=>{Oe()},r.duration))}function Ve(){ae==null||ae()}function Oe(){Ce.value=!1}function _e({code:At}){At===EVENT_CODE.esc&&Oe()}return vue.onMounted(()=>{pe(),re(),Ce.value=!0}),vue.watch(()=>r.repeatNum,()=>{Ve(),pe()}),useEventListener(document,"keydown",_e),useResizeObserver(oe,()=>{ie.value=oe.value.getBoundingClientRect().height}),n({visible:Ce,bottom:he,close:Oe}),(At,$e)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(V).b("fade"),onBeforeLeave:At.onClose,onAfterLeave:$e[0]||($e[0]=Fe=>At.$emit("destroy")),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{id:At.id,ref_key:"messageRef",ref:oe,class:vue.normalizeClass([vue.unref(V).b(),{[vue.unref(V).m(At.type)]:At.type&&!At.icon},vue.unref(V).is("center",At.center),vue.unref(V).is("closable",At.showClose),At.customClass]),style:vue.normalizeStyle(vue.unref(ze)),role:"alert",onMouseenter:Ve,onMouseleave:pe},[At.repeatNum>1?(vue.openBlock(),vue.createBlock(vue.unref(ElBadge),{key:0,value:At.repeatNum,type:vue.unref(le),class:vue.normalizeClass(vue.unref(V).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(V).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(At.$slots,"default",{},()=>[At.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(V).e("content")),innerHTML:At.message},null,10,_hoisted_2$h)],2112)):(vue.openBlock(),vue.createElementBlock("p",{key:0,class:vue.normalizeClass(vue.unref(V).e("content"))},vue.toDisplayString(At.message),3))]),At.showClose?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass(vue.unref(V).e("closeBtn")),onClick:vue.withModifiers(Oe,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(g))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],46,_hoisted_1$k),[[vue.vShow,Ce.value]])]),_:3},8,["name","onBeforeLeave"]))}});var MessageConstructor=_export_sfc$1(_sfc_main$t,[["__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++}`,V=n.onClose,k=document.createElement("div"),$={...n,id:g,onClose:()=>{V==null||V(),closeMessage(ie)},onDestroy:()=>{vue.render(null,k)}},re=vue.createVNode(MessageConstructor,$,isFunction$2($.message)||vue.isVNode($.message)?{default:isFunction$2($.message)?$.message:()=>$.message}:null);re.appContext=r||message._context,vue.render(re,k),i.appendChild(k.firstElementChild);const oe=re.component,ie={id:g,vnode:re,vm:oe,handler:{close:()=>{oe.exposed.visible.value=!1}},props:re.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 V=instances$2.find(({vnode:k})=>{var $;return(($=k.props)==null?void 0:$.message)===r.message});if(V)return V.props.repeatNum+=1,V.props.type=r.type,V.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$s=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:V,size:k}=useGlobalComponentSettings("message-box",vue.computed(()=>i.buttonSize)),{t:$}=r,{nextZIndex:re}=g,oe=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:re()}),ie=vue.computed(()=>{const jt=Ce.type;return{[V.bm("icon",jt)]:jt&&TypeComponentsMap[jt]}}),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(),ze=vue.ref(),pe=vue.ref(),Ve=vue.computed(()=>Ce.confirmButtonClass);vue.watch(()=>Ce.inputValue,async jt=>{await vue.nextTick(),i.boxType==="prompt"&&jt!==null&&xe()},{immediate:!0}),vue.watch(()=>oe.value,jt=>{var Pt,ti;jt&&(i.boxType!=="prompt"&&(Ce.autofocus?he.value=(ti=(Pt=pe.value)==null?void 0:Pt.$el)!=null?ti:de.value:he.value=de.value),Ce.zIndex=re()),i.boxType==="prompt"&&(jt?vue.nextTick().then(()=>{var ei;ze.value&&ze.value.$el&&(Ce.autofocus?he.value=(ei=Dt())!=null?ei:de.value:he.value=de.value)}):(Ce.editorErrorMessage="",Ce.validateError=!1))});const Oe=vue.computed(()=>i.draggable);useDraggable(de,Ne,Oe),vue.onMounted(async()=>{await vue.nextTick(),i.closeOnHashChange&&window.addEventListener("hashchange",_e)}),vue.onBeforeUnmount(()=>{i.closeOnHashChange&&window.removeEventListener("hashchange",_e)});function _e(){oe.value&&(oe.value=!1,vue.nextTick(()=>{Ce.action&&n("action",Ce.action)}))}const At=()=>{i.closeOnClickModal&&Ue(Ce.distinguishCancelAndClose?"close":"cancel")},$e=useSameTarget(At),Fe=jt=>{if(Ce.inputType!=="textarea")return jt.preventDefault(),Ue("confirm")},Ue=jt=>{var Pt;i.boxType==="prompt"&&jt==="confirm"&&!xe()||(Ce.action=jt,Ce.beforeClose?(Pt=Ce.beforeClose)==null||Pt.call(Ce,jt,Ce,_e):_e())},xe=()=>{if(i.boxType==="prompt"){const jt=Ce.inputPattern;if(jt&&!jt.test(Ce.inputValue||""))return Ce.editorErrorMessage=Ce.inputErrorMessage||$("el.messagebox.error"),Ce.validateError=!0,!1;const Pt=Ce.inputValidator;if(typeof Pt=="function"){const ti=Pt(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},Dt=()=>{const jt=ze.value.$refs;return jt.input||jt.textarea},qe=()=>{Ue("close")},kt=()=>{i.closeOnPressEscape&&qe()};return i.lockScroll&&useLockscreen(oe),{...vue.toRefs(Ce),ns:V,overlayEvent:$e,visible:oe,hasMessage:ue,typeClass:ie,contentId:ae,inputId:le,btnSize:k,iconComponent:Ie,confirmButtonClasses:Ve,rootRef:de,focusStartRef:he,headerRef:Ne,inputRef:ze,confirmRef:pe,doClose:_e,handleClose:qe,onCloseRequested:kt,handleWrapperClick:At,handleInputEnter:Fe,handleAction:Ue,t:$}}}),_hoisted_1$j=["aria-label","aria-describedby"],_hoisted_2$g=["aria-label"],_hoisted_3$e=["id"];function _sfc_render(i,n,r,g,V,k){const $=vue.resolveComponent("el-icon"),re=vue.resolveComponent("close"),oe=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(re)]),_: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(oe,{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$j)]),_:3},8,["z-index","overlay-class","mask"]),[[vue.vShow,i.visible]])]),_:3})}var MessageBoxConstructor=_export_sfc$1(_sfc_main$s,[["render",_sfc_render],["__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(V)},i.onAction=k=>{const $=messageInstance.get(V);let re;i.showInput?re={value:V.inputValue,action:k}:re=k,i.callback?i.callback(re,g.proxy):k==="cancel"||k==="close"?i.distinguishCancelAndClose&&k!=="cancel"?$.reject("close"):$.reject("cancel"):$.resolve(re)};const g=initInstance(i,r,n),V=g.proxy;for(const k in i)hasOwn$1(i,k)&&!hasOwn$1(V.$props,k)&&(V[k]=i[k]);return V.visible=!0,V};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,V)=>{const k=showMessage(i,n??MessageBox._context);messageInstance.set(k,{options:i,callback:r,resolve:g,reject:V})})}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,V)=>{let k="";return isObject$4(r)?(g=r,k=""):isUndefined(r)?k="":k=r,MessageBox(Object.assign({title:k,message:n,type:"",...MESSAGE_BOX_DEFAULT_OPTS[i]},g,{boxType:i}),V)}}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$2="",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.Textarea="Textarea",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||{}),EGlobalStoreIntention=(i=>(i.None="None",i.Create="Create",i.Move="Move",i.GroupMove="GroupMove",i.MoveCanvas="MoveCanvas",i.Select="Select",i.Zoom="Zoom",i.Rotate="Rotate",i.Connection="Connection",i.SetConnectionLineNode="SetConnectionLineNode",i.ContextMenu="ContextMenu",i.SelectArea="SelectArea",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 svg_alert_light={name:"alert-light",title:"警示灯",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},defaultState:"yellow",state:{green:{label:"正常",fill:"#00ff00",fillOpacity:"1"},yellow:{label:"请注意",fill:"#ffff00",fillOpacity:"1"},red:{label:"报警",fill:"#ff0000",fillOpacity:"1"},white:{label:"关闭",fill:"#ffffff",fillOpacity:"0"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},stateful_group={groupType:"stateful",title:"状态SVG",list:[svg_alert_light]},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_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_hotpot={name:"hotpot",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_hamburger={name:"hamburger",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:[]},stateless_group={groupType:"stateless",title:"静态SVG",list:[svg_hamburger,svg_hotpot,svg_bot_2,svg_bot_9]},thermometer={name:"thermometer",title:"温度计",type:EDoneJsonType.File,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},display:!0,props:{},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},animation_group={groupType:"have_animation",title:"动画SVG",list:[thermometer]},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.Textarea,val:"文字内容"},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},fill:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1},writingMode:{title:"文字朝向",type:EConfigItemPropsType.Select,val:"horizontal-tb",options:[{value:"horizontal-tb",label:"水平"},{value:"vertical-rl",label:"垂直"}]}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},switch_r={name:"switch-r",title:"开关",tag:"switch-r",type:EDoneJsonType.CustomSvg,display:!0,config:{can_zoom:!0,have_anchor:!0,actual_rect:!0},props:{isOpen:{title:"开关",type:EConfigItemPropsType.Switch,val:!1}},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:{centerColor:{title:"针顶颜色",type:EConfigItemPropsType.Color,val:"#EBF257"},secondsColor:{title:"秒针颜色",type:EConfigItemPropsType.Color,val:"#E83E24"},circleColor:{title:"针圈颜色",type:EConfigItemPropsType.Color,val:"#F45AFC"},minutesColor:{title:"分针颜色",type:EConfigItemPropsType.Color,val:"#50E68E"},hoursColor:{title:"时针颜色",type:EConfigItemPropsType.Color,val:"#9A36E7"},scaleColor:{title:"刻度颜色",type:EConfigItemPropsType.Color,val:"#4942CF"},backgroundColor:{title:"表盘颜色",type:EConfigItemPropsType.Color,val:"#ffffff"},borderColor:{title:"裱框颜色",type:EConfigItemPropsType.Color,val:"#B3A7FF"}},common_animations:{val:"",delay:"delay-0s",speed:"slow",repeat:"infinite"},events:[]},custom_svg_group={groupType:"custom_svg_group",title:"SVG组件",list:[svg_text,switch_r,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:!1,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:!1,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"}]},width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:500},height:{title:"高度",type:EConfigItemPropsType.InputNumber,val:200},maxHeight:{title:"最大高度",type:EConfigItemPropsType.InputNumber,val:200},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:!1,have_anchor:!1,actual_rect:!0},display:!0,props:{width:{title:"宽度",type:EConfigItemPropsType.InputNumber,val:150},fontFamily:{title:"字体",type:EConfigItemPropsType.Select,val:"Microsoft YaHei",options:[{value:"Microsoft YaHei",label:"微软雅黑"},{value:"NSimSun",label:"新宋体"},{value:"KaiTi",label:"楷体"}]},fontSize:{title:"文字大小",type:EConfigItemPropsType.InputNumber,val:18},color:{title:"文字颜色",type:EConfigItemPropsType.Color,val:"#000000"},bold:{title:"文字加粗",type:EConfigItemPropsType.Switch,val:!1}},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:!1,have_anchor:!0,actual_rect:!0},display:!0,props:{percentage:{title:"进度",type:EConfigItemPropsType.InputNumber,val:50}},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$r=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")}),(V,k)=>(vue.openBlock(),vue.createBlock(vue.unref(ElProgress),{type:"dashboard",percentage:Number(r.percentage),color:g},null,8,["percentage"]))}}),_hoisted_1$i=["id"],_hoisted_2$f=["id"],_hoisted_3$d=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1537","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_4$b=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1531","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_5$9=vue.createElementVNode("path",{d:"M238.933333 409.6c-37.546667 0-68.266667 27.306667-68.266666 61.44v85.333333c0 34.133333 30.72 61.44 68.266666 61.44s68.266667-27.306667 68.266667-61.44v-85.333333c0-34.133333-30.72-61.44-68.266667-61.44z m34.133334 146.773333c0 13.653333-17.066667 23.893333-34.133334 23.893334s-34.133333-10.24-34.133333-27.306667v-85.333333c0-13.653333 17.066667-23.893333 34.133333-23.893334s34.133333 10.24 34.133334 27.306667v85.333333zM460.8 409.6c-10.24 0-17.066667 6.826667-17.066667 17.066667v109.226666l-71.68-119.466666c-3.413333-6.826667-10.24-10.24-20.48-6.826667-6.826667 3.413333-13.653333 10.24-13.653333 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667v-109.226666l71.68 119.466666c3.413333 6.826667 10.24 6.826667 13.653334 6.826667h3.413333c6.826667-3.413333 13.653333-10.24 13.653333-17.066667v-170.666666c3.413333-10.24-3.413333-17.066667-13.653333-17.066667zM750.933333 341.333333c-95.573333 0-170.666667 75.093333-170.666666 170.666667s75.093333 170.666667 170.666666 170.666667 170.666667-75.093333 170.666667-170.666667-75.093333-170.666667-170.666667-170.666667z",fill:"#5ad562","p-id":"1530","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i1.1adc3a81uCnBP5"},null,-1),_hoisted_6$7=[_hoisted_3$d,_hoisted_4$b,_hoisted_5$9],_hoisted_7$7=["id"],_hoisted_8$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z",fill:"white","fill-opacity":".01","p-id":"1536","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_9$7=vue.createElementVNode("path",{d:"M747.52 238.933333 H276.48 C122.88 238.933333 0 361.813333 0 512 s122.88 273.066667 276.48 273.066667 H750.933333 c150.186667 0 276.48-122.88 276.48-273.066667 s-126.293333-273.066667-279.893333-273.066667z m0 512 H276.48 C143.36 750.933333 34.133333 645.12 34.133333 512s109.226667-238.933333 242.346667-238.933333 H750.933333c133.12 0 242.346667 105.813333 242.346667 238.933333s-112.64 238.933333-245.76 238.933333z",fill:"#2c2c2c","p-id":"1535","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81uCnBP5"},null,-1),_hoisted_10$6=vue.createElementVNode("path",{d:"M273.066667 341.333333c-95.573333 0-170.666667 75.093333-170.666667 170.666667s75.093333 170.666667 170.666667 170.666667 170.666667-75.093333 170.666666-170.666667-75.093333-170.666667-170.666666-170.666667z",fill:"#bfbfbf","p-id":"1534","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i0.1adc3a81KYNNkt"},null,-1),_hoisted_11$5=vue.createElementVNode("path",{d:"M580.266667 409.6c-37.546667 0-68.266667 27.306667-68.266667 61.44v85.333333c0 34.133333 30.72 61.44 68.266667 61.44s68.266667-27.306667 68.266666-61.44v-85.333333c0-34.133333-30.72-61.44-68.266666-61.44z m34.133333 146.773333c0 13.653333-17.066667 27.306667-34.133333 27.306667s-34.133333-10.24-34.133334-27.306667v-85.333333c0-13.653333 17.066667-27.306667 34.133334-27.306667s34.133333 10.24 34.133333 27.306667v85.333333zM904.533333 409.6h-68.266666c-10.24 0-17.066667 6.826667-17.066667 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066667 17.066667s17.066667-6.826667 17.066666-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066667-17.066667s-6.826667-17.066667-17.066667-17.066666H853.333333v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667zM768 409.6h-68.266667c-10.24 0-17.066667 6.826667-17.066666 17.066667v170.666666c0 10.24 6.826667 17.066667 17.066666 17.066667s17.066667-6.826667 17.066667-17.066667V512h17.066667c10.24 0 17.066667-6.826667 17.066666-17.066667s-6.826667-17.066667-17.066666-17.066666H716.8v-34.133334h51.2c10.24 0 17.066667-6.826667 17.066667-17.066666s-6.826667-17.066667-17.066667-17.066667z",fill:"#707070","p-id":"1533","data-spm-anchor-id":"a313x.manage_type_myprojects.0.i2.1adc3a81KYNNkt"},null,-1),_hoisted_12$4=[_hoisted_8$7,_hoisted_9$7,_hoisted_10$6,_hoisted_11$5],_hoisted_13$4=["xlink:href"],_sfc_main$q=vue.defineComponent({__name:"switch-r",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,V)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id},[vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${r.id}switch-demo-open`},_hoisted_6$7,8,_hoisted_2$f),vue.createElementVNode("symbol",{viewBox:"0 0 1027 1024",id:`${r.id}switch-demo-close`},_hoisted_12$4,8,_hoisted_7$7),vue.createElementVNode("use",{"xlink:href":`#${r.id}switch-demo-${r.isOpen?"open":"close"}`,width:"100",height:"100"},null,8,_hoisted_13$4)],8,_hoisted_1$i))}}),_sfc_main$p=vue.defineComponent({__name:"svg-text",props:{text:{},bold:{type:Boolean}},emits:["resize"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.text,()=>{vue.nextTick(function(){n("resize")})}),(g,V)=>(vue.openBlock(),vue.createElementBlock("text",{x:"50",y:"55",style:vue.normalizeStyle({"font-weight":r.bold?"bold":"normal"})},vue.toDisplayString(r.text),5))}}),_sfc_main$o=vue.defineComponent({__name:"common-table",props:{colConfig:{default:()=>[]},data:{default:()=>[]},height:{default:200},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,...V}=n;r.value=V}),(g,V)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTable),vue.normalizeProps(vue.guardReactiveProps(vue.unref(r))),{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.colConfig,k=>(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),vue.mergeProps({key:k.prop},k),null,16))),128))]),_:1},16))}}),_hoisted_1$h={class:"flex mt-5px"},_sfc_main$n=vue.defineComponent({__name:"now-time",props:{width:{},fontFamily:{},color:{},fontSize:{},bold:{type:Boolean}},setup(i){const n=i,r=vue.computed(()=>({fontFamily:n.fontFamily,color:n.color,fontSize:n.fontSize+"px",fontWeight:n.bold?"bold":"normal"})),g=vue.ref(new Date),V=vue.ref(),k=vue.computed(()=>{const oe=g.value.getFullYear(),Ce=g.value.getMonth()+1,ie=g.value.getDate();return oe.toString()+"年"+Ce.toString()+"月"+ie.toString()+"日"}),$=vue.computed(()=>{const oe=g.value.getDay();return["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][oe]}),re=vue.computed(()=>{const oe=g.value.getHours(),Ce=g.value.getMinutes(),ie=g.value.getSeconds();return(oe<10?"0"+oe.toString():oe.toString())+":"+(Ce<10?"0"+Ce.toString():Ce.toString())+":"+(ie<10?"0"+ie.toString():ie.toString())});return vue.onMounted(()=>{V.value=setInterval(()=>{g.value=new Date},500)}),vue.onUnmounted(()=>{clearInterval(V.value)}),(oe,Ce)=>(vue.openBlock(),vue.createElementBlock("div",{class:"now-time",style:vue.normalizeStyle({width:n.width+"px"})},[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(r))},vue.toDisplayString(vue.unref(k)),5),vue.createElementVNode("div",_hoisted_1$h,[vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(r))},vue.toDisplayString(vue.unref($)),5),vue.createElementVNode("div",{style:vue.normalizeStyle(vue.unref(r))},vue.toDisplayString(vue.unref(re)),5)])],4))}}),nowTime_vue_vue_type_style_index_0_scoped_82ca3b84_lang="",_export_sfc=(i,n)=>{const r=i.__vccOpts||i;for(const[g,V]of n)r[g]=V;return r},NowTime=_export_sfc(_sfc_main$n,[["__scopeId","data-v-82ca3b84"]]);/*! *****************************************************************************
255
255
  Copyright (c) Microsoft Corporation.
256
256
 
257
257
  Permission to use, copy, modify, and/or distribute this software for any
@@ -312,7 +312,7 @@ echarts.use([`+Dt+"]);":"Unknown series "+xe))}return}if(ae==="tooltip"){if(pe){
312
312
  if (customElements.get(tag) == null) {
313
313
  customElements.define(tag, EChartsElement);
314
314
  }
315
- `)("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(),V=vue.shallowRef(),k=vue.shallowRef(),$=vue.inject("ecTheme",null),re=vue.inject("ecInitOptions",null),oe=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 k.value||i.option||null}),de=vue.computed(function(){return i.theme||j($,{})}),Ne=vue.computed(function(){return i.initOptions||j(re,{})}),he=vue.computed(function(){return i.updateOptions||j(oe,{})}),ze=vue.computed(function(){return function($e){var Fe={};for(var Ue in $e)x(Ue)||(Fe[Ue]=$e[Ue]);return Fe}(r)}),pe=vue.getCurrentInstance().proxy.$listeners;function Ve($e){if(g.value){var Fe=V.value=init(g.value,de.value,Ne.value);i.group&&(Fe.group=i.group);var Ue=pe;Ue||(Ue={},Object.keys(r).filter(function(Dt){return Dt.indexOf("on")===0&&Dt.length>2}).forEach(function(Dt){var qe=Dt.charAt(2).toLowerCase()+Dt.slice(3);qe.substring(qe.length-4)==="Once"&&(qe="~".concat(qe.substring(0,qe.length-4))),Ue[qe]=r[Dt]})),Object.keys(Ue).forEach(function(Dt){var qe=Ue[Dt];if(qe){var kt=Dt.toLowerCase();kt.charAt(0)==="~"&&(kt=kt.substring(1),qe.__once__=!0);var jt=Fe;if(kt.indexOf("zr:")===0&&(jt=Fe.getZr(),kt=kt.substring(3)),qe.__once__){delete qe.__once__;var Pt=qe;qe=function(){for(var ti=[],ei=0;ei<arguments.length;ei++)ti[ei]=arguments[ei];Pt.apply(void 0,ti),jt.off(kt,qe)}}jt.on(kt,qe)}}),ie.value?vue.nextTick(function(){Fe&&!Fe.isDisposed()&&Fe.resize(),xe()}):xe()}function xe(){var Dt=$e||ue.value;Dt&&Fe.setOption(Dt,he.value)}}function Oe(){V.value&&(V.value.dispose(),V.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(Fe,Ue){Fe&&(V.value?V.value.setOption(Fe,O({notMerge:Fe.value!==(Ue==null?void 0:Ue.value)},he.value)):Ve())},{deep:!0}))},{immediate:!0}),vue.watch([de,Ne],function(){Oe(),Ve()},{deep:!0}),vue.watchEffect(function(){i.group&&V.value&&(V.value.group=i.group)});var At=y(V);return function($e,Fe,Ue){var xe=vue.inject("ecLoadingOptions",{}),Dt=vue.computed(function(){return O(O({},j(xe,{})),Ue==null?void 0:Ue.value)});vue.watchEffect(function(){var qe=$e.value;qe&&(Fe.value?qe.showLoading(Dt.value):qe.hideLoading())})}(V,le,Ie),function($e,Fe,Ue){var xe=null;vue.watch([Ue,$e,Fe],function(Dt,qe,kt){var jt=Dt[0],Pt=Dt[1],ti=Dt[2];jt&&Pt&&ti&&(xe=throttle$1(function(){Pt.resize()},100),addListener(jt,xe)),kt(function(){xe&&jt&&removeListener(jt,xe)})})}(V,ie,g),vue.onMounted(function(){Ve()}),vue.onBeforeUnmount(function(){T&&g.value?g.value.__dispose=Oe:Oe()}),O({chart:V,root:g,setOption:function($e,Fe){i.manualUpdate&&(k.value=$e),V.value?V.value.setOption($e,Fe||{}):Ve($e)},nonEventAttrs:ze},At)},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$m=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,V)=>(vue.openBlock(),vue.createBlock(vue.unref(S),{class:"chart",option:vue.unref(r),autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_fec2cbf2_lang="",PieCharts=_export_sfc(_sfc_main$m,[["__scopeId","data-v-fec2cbf2"]]),_hoisted_1$g=["id"],_hoisted_2$e=["id"],_hoisted_3$c=["fill"],_hoisted_4$a=["fill"],_hoisted_5$8=["fill"],_hoisted_6$6=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$6=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$6=["fill-opacity"],_hoisted_9$6=["fill-opacity"],_hoisted_10$5=["fill-opacity"],_hoisted_11$4=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$3=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$3=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$3=["xlink:href"],_sfc_main$l=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,V)=>(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$a),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$6,_hoisted_7$6,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$6),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$6),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$5),_hoisted_11$4,_hoisted_12$3,_hoisted_13$3],8,_hoisted_2$e),vue.createElementVNode("use",{"xlink:href":`#${r.id}light-121`,width:"100",height:"100"},null,8,_hoisted_14$3)],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$9=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$5=["from","to"],_hoisted_7$5={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$5=["from","to"],_hoisted_9$5=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$4=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$3={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$2=["from","to"],_hoisted_13$2=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$2=["xlink:href"],_sfc_main$k=vue.defineComponent({__name:"clock-a",props:{id:{default:""}},setup(i){const n=i,r=vue.ref(new Date),g=r.value.getSeconds(),V=r.value.getMinutes(),k=Math.floor((r.value.getHours()+(V+g/60)/60)*30);return($,re)=>(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$9,vue.createElementVNode("path",_hoisted_5$7,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(k)} 512.3 506.3`,to:`${315+vue.unref(k)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_6$5)]),vue.createElementVNode("path",_hoisted_7$5,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(V)*6} 512.3 506.3`,to:`${405+vue.unref(V)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_8$5)]),_hoisted_9$5,_hoisted_10$4,vue.createElementVNode("path",_hoisted_11$3,[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$2)]),_hoisted_13$2],8,_hoisted_2$d),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"100",height:"100"},null,8,_hoisted_14$2)],8,_hoisted_1$f))}}),vueComp={"svg-text":_sfc_main$p,"el-button":ElButton,"progress-a":_sfc_main$r,"el-tag":ElTag,"common-table":_sfc_main$o,"pie-charts":PieCharts,"switch-r":_sfc_main$q,"now-time":NowTime,"light-a":_sfc_main$l,"clock-a":_sfc_main$k},config=[...svg_config,...vue_config],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}}),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))})},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},spliceDoneJson(i){const n=useGlobalStore(),g=n.done_json.splice(i,1)[0];unbindAnchors(g.id),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},canvasInfo:{with:0,height:0,top:0,left:0}})}),stopEvent=i=>{i.stopPropagation()},preventDefault=i=>{i.preventDefault()};function componentsRegister(){var n,r;const i=vue.getCurrentInstance();for(let g in vueComp)!((n=i==null?void 0:i.appContext)!=null&&n.components.hasOwnProperty(g))&&vueComp.hasOwnProperty(g)&&((r=i==null?void 0:i.appContext)==null||r.app.component(g,vueComp[g]))}const randomString=i=>{i=i||10;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=n.length;let g="";for(let V=0;V<i;V++){let k=r;V===0&&(k=r-10),g+=n.charAt(Math.floor(Math.random()*k))}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:parseFloat(((i.x-n.x)*Math.cos(angleToRadian(r))-(i.y-n.y)*Math.sin(angleToRadian(r))+n.x).toFixed(1)),y:parseFloat(((i.x-n.x)*Math.sin(angleToRadian(r))+(i.y-n.y)*Math.cos(angleToRadian(r))+n.y).toFixed(1))}),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)=>{var V,k;const r=document.querySelector(`#${i.id}`),g=document.querySelector(`#rect${i.id}`);if(r){let $=0,re=0,oe=0,Ce=0;if(i.type===EDoneJsonType.Vue){oe=((V=i.props.width)==null?void 0:V.val)||r.offsetWidth||100,Ce=((k=i.props.height)==null?void 0:k.val)||r.offsetHeight||100,$=50-oe/2,re=50-Ce/2;const ie=document.querySelector(`#foreign-object${i.id}`);ie&&(ie.getAttribute("x")==="0"&&ie.getAttribute("y")==="0"&&ie.getAttribute("width")==="0"&&ie.getAttribute("height")==="0"||n)&&(ie.setAttribute("x",$.toString()),ie.setAttribute("y",re.toString()),ie.setAttribute("width",oe.toString()),ie.setAttribute("height",Ce.toString()))}else{const ie=r.getBBox();$=parseFloat(ie.x.toFixed(0)),re=parseFloat(ie.y.toFixed(0)),oe=parseFloat(ie.width.toFixed(0)),Ce=parseFloat(ie.height.toFixed(0))}g&&(g.getAttribute("x")==="0"&&g.getAttribute("y")==="0"&&g.getAttribute("width")==="0"&&g.getAttribute("height")==="0"||n)&&(g.setAttribute("x",$.toString()),g.setAttribute("y",re.toString()),g.setAttribute("width",oe.toString()),g.setAttribute("height",Ce.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:$,y:re,width:oe,height:Ce}),i.center_position={x:i.x+i.actual_bound.x+oe/2,y:i.y+i.actual_bound.y+Ce/2},i.point_coordinate.tl={x:i.center_position.x-oe*i.scale_x/2,y:i.center_position.y-Ce*i.scale_y/2},i.point_coordinate.tc={x:i.center_position.x,y:i.center_position.y-Ce*i.scale_y/2},i.point_coordinate.tr={x:i.center_position.x+oe*i.scale_x/2,y:i.center_position.y-Ce*i.scale_y/2},i.point_coordinate.l={x:i.center_position.x-oe*i.scale_x/2,y:i.center_position.y},i.point_coordinate.r={x:i.center_position.x+oe*i.scale_x/2,y:i.center_position.y},i.point_coordinate.bl={x:i.center_position.x-oe*i.scale_x/2,y:i.center_position.y+Ce*i.scale_y/2},i.point_coordinate.bc={x:i.center_position.x,y:i.center_position.y+Ce*i.scale_y/2},i.point_coordinate.br={x:i.center_position.x+oe*i.scale_x/2,y:i.center_position.y+Ce*i.scale_y/2},i.rotate!==0&&setAfterRotationPointCoordinate(i),moveAnchors(i)}},resetHandlePointOld=i=>{for(const n of Object.keys(i.point_coordinate))i.point_coordinate_old&&(i.point_coordinate_old[n].x=0,i.point_coordinate_old[n].y=0)},moveHandlePoint=(i,n,r)=>{const g=useGlobalStore(pinia),V=n??g.mouse_info.new_position_x-g.mouse_info.position_x,k=r??g.mouse_info.new_position_y-g.mouse_info.position_y;for(const $ of Object.keys(i.point_coordinate))n!==void 0&&r!==void 0?(i.point_coordinate[$].x+=V,i.point_coordinate[$].y+=k):i.point_coordinate_old&&(i.point_coordinate[$].x=i.point_coordinate_old[$].x+V,i.point_coordinate[$].y=i.point_coordinate_old[$].y+k)},moveAnchors=i=>{var r,g,V,k;const n=useGlobalStore(pinia);for(let $ of n.done_json)if($.type===EDoneJsonType.ConnectionLine){if(((g=(r=$.bind_anchors)==null?void 0:r.start)==null?void 0:g.target_id)===i.id){const re=getAnchorPosByAnchorType($.bind_anchors.start.type,i);$.props.point_position.val[0]={x:re.x-$.x,y:re.y-$.y}}if(((k=(V=$.bind_anchors)==null?void 0:V.end)==null?void 0:k.target_id)===i.id){const re=getAnchorPosByAnchorType($.bind_anchors.end.type,i);$.props.point_position.val[$.props.point_position.val.length-1]={x:re.x-$.x,y:re.y-$.y}}}},unbindAnchors=i=>{var r,g,V,k;const n=useGlobalStore(pinia);for(let $ of n.done_json)$.type===EDoneJsonType.ConnectionLine&&(((g=(r=$.bind_anchors)==null?void 0:r.start)==null?void 0:g.target_id)===i&&($.bind_anchors.start=null),((k=(V=$.bind_anchors)==null?void 0:V.end)==null?void 0:k.target_id)===i&&($.bind_anchors.end=null))},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,i.center_position,i.rotate),tc:calculateRotatedPointCoordinate(i.point_coordinate.tc,i.center_position,i.rotate),tr:calculateRotatedPointCoordinate(i.point_coordinate.tr,i.center_position,i.rotate),l:calculateRotatedPointCoordinate(i.point_coordinate.l,i.center_position,i.rotate),r:calculateRotatedPointCoordinate(i.point_coordinate.r,i.center_position,i.rotate),bl:calculateRotatedPointCoordinate(i.point_coordinate.bl,i.center_position,i.rotate),bc:calculateRotatedPointCoordinate(i.point_coordinate.bc,i.center_position,i.rotate),br:calculateRotatedPointCoordinate(i.point_coordinate.br,i.center_position,i.rotate)}},prosToVBind=(i,n=[])=>{let r={};if(i.state){for(const g in i.state)if(i.state.hasOwnProperty(g)&&g===i.defaultState){for(let V in i.state[g])V!=="label"&&(r[kebabCase$1(V)]=i.state[g][V]);break}}for(const g in i.props)n.indexOf(g)<0&&(r[kebabCase$1(g)]=i.props[g].val);return r},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,createLine=(i,n,r)=>{i.preventDefault();const g=useGlobalStore(pinia),V=useConfigStore(pinia),k=useSvgEditLayoutStore(pinia),{clientX:$,clientY:re}=i;let oe=objectDeepClone(V.connection_line),Ce=0,ie=0;if(n&&r){oe.bind_anchors.start={type:n,target_id:r.id};let le=getAnchorPosByAnchorType(n,r);Ce=le.x,ie=le.y}else Ce=Math.round(($-k.canvasInfo.left)/V.svg.scale-k.center_offset.x),ie=Math.round((re-k.canvasInfo.top)/V.svg.scale-k.center_offset.y);const ae={id:randomString(),x:Ce,y:ie,client:{x:Ce,y:ie},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y: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}},...oe};ae.props.point_position.val.push({x:0,y:0}),g.setDoneJson(ae),g.setHandleSvgInfo(ae,g.done_json.length-1),g.intention=EGlobalStoreIntention.Connection,g.mouse_info={state:EMouseInfoState.Down,position_x:Ce,position_y:ie,now_position_x:Ce,now_position_y:ie,new_position_x:0,new_position_y:0}};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:[]});const 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_r:{title:"节点半径",type:EConfigItemPropsType.InputNumber,val:4},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,grid:!0,grid_color:"#ebebeb",ruler:!0};const useConfigStore=pinia$1.defineStore("config-store",{state:()=>({svg:s,connection_line:t,net:{mqtt:{url:"",user:"",pwd:"",topics:""}}}),getters:{},actions:{}});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=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 V=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]=V,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(V,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const k=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(k),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(k,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),V=useConfigStore(pinia);return V.$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$j=vue.defineComponent({__name:"svg-analysis",props:{name:{},props:{default:()=>({})}},setup(i){const n=i,r=vue.computed(()=>`#svg-${n.name}`);return(g,V)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$e,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":vue.unref(r)},n.props),null,16,_hoisted_2$c)]))}});var EVisibleConfKey=(i=>(i.ImportJson="ImportJson",i.ExportJson="ExportJson",i.ImportFile="ImportFile",i))(EVisibleConfKey||{});const _withScopeId$2=i=>(vue.pushScopeId("data-v-62907637"),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:"250px"}},_hoisted_3$a=_withScopeId$2(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"Svg Editor")],-1)),_hoisted_4$8={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$4={class:"flex items-center mr-20px"},_hoisted_7$4={class:"flex items-center",style:{width:"250px"}},_hoisted_8$4=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title",style:{"padding-top":"16px"}},"多选",-1)),_hoisted_9$4=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住鼠标左键可以框选(图形坐标在框选区域即判定被选中),也可以按住ctrl+鼠标左键点图形进行多选",-1)),_hoisted_10$3=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_11$2=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"拖动画布",-1)),_hoisted_12$1=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住右键可拖动画布,右侧面板‘图纸’栏可微调或重置位置",-1)),_hoisted_13$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_14$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"画布缩放",-1)),_hoisted_15$1=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区使用鼠标滚轮或者右侧面板‘图纸’栏可控制画布缩放",-1)),_hoisted_16$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_17=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"标尺辅助线",-1)),_hoisted_18=_withScopeId$2(()=>vue.createElementVNode("div",null,"在标尺区域按住鼠标左键并拖动即可创建标尺辅助线,将标尺辅助线拖动到标尺区域即可删除标尺辅助线",-1)),_hoisted_19=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_20=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"组件尺寸",-1)),_hoisted_21=_withScopeId$2(()=>vue.createElementVNode("div",null,[vue.createElementVNode("p",null," 大多数组件可以通过选中组件然后拖动交互点或在右侧‘外观’栏改变外形尺寸,或通过右侧‘数据’栏直接或间接改变外形尺寸;"),vue.createElementVNode("p",null,"少数特殊组件仅可通过右侧'数据'栏直接或间接改变外形尺寸")],-1)),_hoisted_22=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_23=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"连线样式",-1)),_hoisted_24=_withScopeId$2(()=>vue.createElementVNode("div",null,"在右侧‘连线’栏可以统一配置连线样式,配置后先增加的线会应用新样式,之前的线样式不变,如需改变,可选中线手动更改或删除重画 ",-1)),_hoisted_25=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_26=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"横线和竖线",-1)),_hoisted_27=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null," 点击编辑器顶部连线按钮会进入连线状态,该状态下在画板点击鼠标左键即可开始画线,移动并再次点击左键创建新的节点,右键结束画线并退出连线状态;"),vue.createElementVNode("p",null,"画线的时候按住ctrl即可画竖线,按住shift即可画横线")],-1)),_hoisted_28=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_29=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"绑定锚点",-1)),_hoisted_30=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null,"组件在未选中时,鼠标经过组件时会出现锚点,鼠标悬浮在锚点上时,会有交互样式,点击左键即可以锚点为起点创建连线;"),vue.createElementVNode("p",null,"同样,在连线时鼠标经过锚点时,会出现锚点交互样式,点击左键即可以锚点为连线终点结束连线;"),vue.createElementVNode("p",null,"这两种情况下的连线会绑定组件上的锚点,如需解绑,参考下面的‘锚点解绑’;"),vue.createElementVNode("p",null,"同样,也可先画线,再选中连线绑定想要绑定的组件锚点(连线只有首尾节点可以绑定锚点)")],-1)),_hoisted_31=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_32=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"线段选中",-1)),_hoisted_33=_withScopeId$2(()=>vue.createElementVNode("div",null," 若线段绑定了锚点,移动线段,绑定的锚点不会移动。若是想将线段整体移动,需要先解绑,参考下面的‘锚点解绑’ ",-1)),_hoisted_34=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_35=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"锚点解绑",-1)),_hoisted_36=_withScopeId$2(()=>vue.createElementVNode("div",{style:{"padding-bottom":"14px"}}," 选中线段,在右侧‘数据’栏里解除绑定;或者鼠标左键拖拽连线上需要解绑的节点",-1)),_sfc_main$i=vue.defineComponent({__name:"top-panel",emits:["changeVisible","onReturn","onPreview","onSave"],setup(i,{emit:n}){const r=useSvgEditLayoutStore(pinia),g=useGlobalStore(pinia),V=useEditPrivateStore(pinia),k=useConfigStore(pinia),$=()=>{g.done_json.length<=0||g.setDoneJson([]),g.intention=EGlobalStoreIntention.None},re=ie=>{const ae={layout_center:r.center_offset,config:k.$state,done_json:g.done_json};n(ie,ae)},oe=vue.ref(!1),Ce=vue.computed({get:()=>g.intention===EGlobalStoreIntention.Connection,set(ie){g.intention=ie?EGlobalStoreIntention.Connection:EGlobalStoreIntention.None,ie&&g.setHandleSvgInfo(null)}});return(ie,ae)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$b,[_hoisted_3$a,vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ae[0]||(ae[0]=le=>vue.unref(r).left_nav=!vue.unref(r).left_nav),title:vue.unref(r).left_nav?"隐藏左侧菜单":"显示左侧菜单"},{default:vue.withCtx(()=>[vue.unref(r).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$j,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$j,{key:1,name:"menu-fold"}))]),_:1},8,["title"])]),vue.createElementVNode("div",_hoisted_4$8,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(ElIcon),{title:"撤销 ctrl+z",size:24,class:vue.normalizeClass(`${vue.unref(V).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:ae[1]||(ae[1]=()=>vue.unref(V).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:vue.unref(V).getTopBtnUndoStatus?"undo":"undo-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(V).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:24,onClick:ae[2]||(ae[2]=()=>vue.unref(V).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:vue.unref(V).getTopBtnRedoStatus?"redo":"redo-gray"},null,8,["name"])]),_: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:24,onClick:$},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:vue.unref(g).done_json.length>0?"delete":"delete-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"导入数据模型",class:"bt-Icon",size:24,onClick:ae[3]||(ae[3]=le=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"import"})]),_:1}),vue.createVNode(vue.unref(ElIcon),{title:"导出数据模型",size:24,class:"bt-Icon ml-5px",onClick:ae[4]||(ae[4]=le=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"export"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"创建连线",class:vue.normalizeClass(["bt-Icon",{active:vue.unref(Ce)}]),size:24,onClick:ae[5]||(ae[5]=le=>Ce.value=!vue.unref(Ce))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:vue.unref(Ce)?"line-active":"line"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"说明",class:"bt-Icon",size:24,onClick:ae[6]||(ae[6]=le=>oe.value=!vue.unref(oe))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"question"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$4,[vue.createVNode(vue.unref(ElIcon),{title:"返回",class:"bt-Icon",size:24,onClick:ae[7]||(ae[7]=le=>re("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"return"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"保存",class:"bt-Icon",size:24,onClick:ae[8]||(ae[8]=le=>re("onSave"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"save"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:ae[9]||(ae[9]=le=>re("onPreview"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$4,[vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ae[10]||(ae[10]=le=>vue.unref(r).right_nav=!vue.unref(r).right_nav),title:vue.unref(r).right_nav?"隐藏右侧菜单":"显示右侧菜单"},{default:vue.withCtx(()=>[vue.unref(r).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$j,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$j,{key:1,name:"menu-unfold"}))]),_:1},8,["title"])])]),vue.createVNode(vue.unref(ElDialog),{modelValue:vue.unref(oe),"onUpdate:modelValue":ae[11]||(ae[11]=le=>vue.isRef(oe)?oe.value=le:null),title:"使用说明",width:"60%",class:"guide-dialog"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{"max-height":"60vh"},{default:vue.withCtx(()=>[_hoisted_8$4,_hoisted_9$4,_hoisted_10$3,_hoisted_11$2,_hoisted_12$1,_hoisted_13$1,_hoisted_14$1,_hoisted_15$1,_hoisted_16$1,_hoisted_17,_hoisted_18,_hoisted_19,_hoisted_20,_hoisted_21,_hoisted_22,_hoisted_23,_hoisted_24,_hoisted_25,_hoisted_26,_hoisted_27,_hoisted_28,_hoisted_29,_hoisted_30,_hoisted_31,_hoisted_32,_hoisted_33,_hoisted_34,_hoisted_35,_hoisted_36]),_:1})]),_:1},8,["modelValue"])],64))}}),topPanel_vue_vue_type_style_index_0_scoped_62907637_lang="",topPanel_vue_vue_type_style_index_1_lang="",TopPanel=_export_sfc(_sfc_main$i,[["__scopeId","data-v-62907637"]]),_hoisted_1$c={class:"component-group flex flex-wrap"},_hoisted_2$a=["onDragstart","title"],_sfc_main$h=vue.defineComponent({__name:"left-panel",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),V=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),k=re=>{r.setCreateInfo(re)},$=re=>{var oe;if(((oe=re.dataTransfer)==null?void 0:oe.dropEffect)!=="copy"){ElMessage.warning("请将组件拖到画布中!"),r.intention=EGlobalStoreIntention.None;return}};return(re,oe)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElCollapse),{modelValue:vue.unref(V),"onUpdate:modelValue":oe[0]||(oe[0]=Ce=>vue.isRef(V)?V.value=Ce:null),style:{"border-top":"none"}},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(g),Ce=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:Ce.groupType,key:Ce.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",null,vue.toDisplayString(Ce.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$c,[(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=>k(ie),onDragend:$,title:ie.title},[vue.createVNode(vue.unref(ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:ie.name,props:vue.unref(prosToVBind)(ie,["width","height","maxHeight"])},null,8,["name","props"])]),_:2},1024)],40,_hoisted_2$a))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),leftPanel_vue_vue_type_style_index_0_scoped_d7403cfd_lang="",LeftPanel=_export_sfc(_sfc_main$h,[["__scopeId","data-v-d7403cfd"]]),calculateLeftTop=(i,n,r)=>{const g=getCenterPoint(i,n),V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate(n,g,-r);return{width:k.x-V.x,height:k.y-V.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(i,n,r)=>{const g=getCenterPoint(i,n),V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate(n,g,-r);return{width:V.x-k.x,height:k.y-V.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(i,n,r)=>{const g=getCenterPoint(i,n),V=calculateRotatedPointCoordinate(n,g,-r),k=calculateRotatedPointCoordinate(i,g,-r);return{width:k.x-V.x,height:k.y-V.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(i,n,r)=>{const g=getCenterPoint(i,n),V=calculateRotatedPointCoordinate(n,g,-r),k=calculateRotatedPointCoordinate(i,g,-r);return{width:V.x-k.x,height:k.y-V.y,is_old_width:!1,is_old_height:!1}},calculateTop=(i,n,r,g)=>{const V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate({x:g.x,y:V.y},g,r),$=Math.sqrt((k.x-n.x)**2+(k.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateRight=(i,n,r,g)=>{const V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate({x:V.x,y:g.y},g,r),$=Math.sqrt((k.x-n.x)**2+(k.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(i,n,r,g)=>{const V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate({x:g.x,y:V.y},g,r),$=Math.sqrt((k.x-n.x)**2+(k.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateLeft=(i,n,r,g)=>{const V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate({x:V.x,y:g.y},g,r),$=Math.sqrt((k.x-n.x)**2+(k.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$9=["cx","cy"],_hoisted_4$7=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$3=["fill","x","y"],_hoisted_7$3=["fill","x","y"],_hoisted_8$3=["fill","x","y"],_hoisted_9$3=["fill","x","y"],_hoisted_10$2=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$g=vue.defineComponent({__name:"handle-panel",props:{itemInfo:{}},setup(i){const n=i;vue.useCssVars(le=>({"5c831aea":vue.unref($)}));const r=useGlobalStore(pinia),g=useConfigStore(pinia),V=useSvgEditLayoutStore(pinia),k=vue.ref(4),$=vue.ref("#ab712e"),re=[{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=vue.computed(()=>n.itemInfo.config.can_zoom),Ce=(le,Ie)=>{console.log("handMousedown",Ie);const{clientX:ue,clientY:de}=Ie;Ie.stopPropagation(),r.intention=EGlobalStoreIntention.Zoom;const Ne=Math.round((ue-V.canvasInfo.left)/g.svg.scale-V.center_offset.x),he=Math.round((de-V.canvasInfo.top)/g.svg.scale-V.center_offset.y);r.mouse_info={state:EMouseInfoState.Down,position_x:Ne,position_y:he,now_position_x:Ne,now_position_y:he,new_position_x:0,new_position_y:0},r.scale_info={type:le,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:Ne+Math.abs(Ne-n.itemInfo.center_position.x)*2*(Ne>n.itemInfo.center_position.x?-1:1),y:he+Math.abs(he-n.itemInfo.center_position.y)*2*(he>n.itemInfo.center_position.y?-1:1)}}},ie=le=>{const{clientX:Ie,clientY:ue}=le,de=Math.round((Ie-V.canvasInfo.left)/g.svg.scale-V.center_offset.x),Ne=Math.round((ue-V.canvasInfo.top)/g.svg.scale-V.center_offset.y);le.stopPropagation(),r.intention=EGlobalStoreIntention.Rotate,r.rotate_info={angle:n.itemInfo.rotate},r.mouse_info={state:EMouseInfoState.Down,position_x:de,position_y:Ne,now_position_x:de,now_position_y:Ne,new_position_x:0,new_position_y:0}},ae=le=>{const Ie=(le+n.itemInfo.rotate)%360,ue=re.find(de=>de.start<=Ie&&de.end>Ie);return ue?{cursor:ue.cursor+"-resize",type:ue.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(le,Ie)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$b,[vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:Ie[0]||(Ie[0]=ue=>Ce(vue.unref(EScaleInfoType).TopLeft,ue))},null,44,_hoisted_2$9),[[vue.vShow,vue.unref(oe)]]),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:ie},null,40,_hoisted_3$9),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-vue.unref(k)-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-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:vue.unref($),"stroke-width":2})},null,12,_hoisted_4$7),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-vue.unref(k),y:n.itemInfo.actual_bound.y-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:Ie[1]||(Ie[1]=ue=>Ce(vue.unref(EScaleInfoType).TopCenter,ue))},null,44,_hoisted_5$5),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-vue.unref(k)+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:Ie[2]||(Ie[2]=ue=>Ce(vue.unref(EScaleInfoType).TopRight,ue))},null,44,_hoisted_6$3),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)+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:Ie[3]||(Ie[3]=ue=>Ce(vue.unref(EScaleInfoType).Left,ue))},null,44,_hoisted_7$3),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)+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:Ie[4]||(Ie[4]=ue=>Ce(vue.unref(EScaleInfoType).Right,ue))},null,44,_hoisted_8$3),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)+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:Ie[5]||(Ie[5]=ue=>Ce(vue.unref(EScaleInfoType).BottomLeft,ue))},null,44,_hoisted_9$3),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-vue.unref(k)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:Ie[6]||(Ie[6]=ue=>Ce(vue.unref(EScaleInfoType).BottomCenter,ue))},null,44,_hoisted_10$2),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:Ie[7]||(Ie[7]=ue=>Ce(vue.unref(EScaleInfoType).BottomRight,ue))},null,44,_hoisted_11$1),[[vue.vShow,vue.unref(oe)]])]))}}),handlePanel_vue_vue_type_style_index_0_scoped_e6622df8_lang="",HandlePanel=_export_sfc(_sfc_main$g,[["__scopeId","data-v-e6622df8"]]),_hoisted_1$a=["fill"],_hoisted_2$8=["cx","cy","r"],_hoisted_3$8=["cx","cy","r"],_hoisted_4$6=["cx","cy","r"],_hoisted_5$4=["cx","cy","r"],_hoisted_6$2=["cx","cy","r"],_hoisted_7$2=["cx","cy","r"],_hoisted_8$2=["cx","cy","r"],_hoisted_9$2=["cx","cy","r"],_sfc_main$f=vue.defineComponent({__name:"connection-panel",props:{itemInfo:{}},setup(i){const n=i,r=vue.ref(4),g=vue.ref("#ab712e"),V=vue.ref(4),k=vue.ref(12),$=useGlobalStore(pinia),re=useSvgEditLayoutStore(pinia),oe=vue.computed(()=>n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-r.value+V.value),Ce=vue.computed(()=>n.itemInfo.actual_bound.y-r.value-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+V.value),ie=vue.computed(()=>n.itemInfo.actual_bound.x-r.value+n.itemInfo.actual_bound.width+getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+V.value),ae=vue.computed(()=>n.itemInfo.actual_bound.y-r.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+V.value),le=vue.computed(()=>n.itemInfo.actual_bound.x-r.value+n.itemInfo.actual_bound.width/2+V.value),Ie=vue.computed(()=>n.itemInfo.actual_bound.y-r.value+n.itemInfo.actual_bound.height+getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+V.value),ue=vue.computed(()=>n.itemInfo.actual_bound.x-r.value-getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+V.value),de=vue.computed(()=>n.itemInfo.actual_bound.y-r.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+V.value),Ne=(ze,pe)=>{var Ve;$.intention===EGlobalStoreIntention.SetConnectionLineNode&&(ze.stopPropagation(),(Ve=$.handle_svg_info)!=null&&Ve.info.bind_anchors&&$.connection_line_node_info&&($.connection_line_node_info.point_index===0?$.handle_svg_info.info.bind_anchors.start={type:pe,target_id:n.itemInfo.id}:$.connection_line_node_info.point_index===$.handle_svg_info.info.props.point_position.val.length-1&&($.handle_svg_info.info.bind_anchors.end={type:pe,target_id:n.itemInfo.id}),$.intention=EGlobalStoreIntention.None,$.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))},he=(ze,pe)=>{var Ve;$.intention===EGlobalStoreIntention.None?(createLine(ze,pe,n.itemInfo),$.handle_svg_info&&($.handle_svg_info.info.props.point_position.val.length!==1?$.handle_svg_info.info.props.point_position.val.push({x:$.mouse_info.new_position_x-$.mouse_info.position_x-re.center_offset.x,y:$.mouse_info.new_position_y-$.mouse_info.position_y-re.center_offset.y}):$.handle_svg_info.info.props.point_position.val.push({x:0,y:0}))):$.intention===EGlobalStoreIntention.Connection&&(ze.stopPropagation(),(Ve=$.handle_svg_info)!=null&&Ve.info.bind_anchors&&($.handle_svg_info.info.bind_anchors.end={type:pe,target_id:n.itemInfo.id},$.intention=EGlobalStoreIntention.None,$.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))};return(ze,pe)=>(vue.openBlock(),vue.createElementBlock("g",{style:{"vector-effect":"non-scaling-stroke"},class:"connect-points",fill:vue.unref(g),"stroke-width":"2",stroke:"rgba(0,0,0,0)"},[vue.createElementVNode("g",{onMousedown:pe[0]||(pe[0]=Ve=>he(Ve,vue.unref(ELineBindAnchors).TopCenter)),onMouseup:pe[1]||(pe[1]=Ve=>Ne(Ve,vue.unref(ELineBindAnchors).TopCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(oe),cy:vue.unref(Ce),r:vue.unref(k),"fill-opacity":".3"},null,8,_hoisted_2$8),vue.createElementVNode("circle",{id:"connection_tc",cx:vue.unref(oe),cy:vue.unref(Ce),r:vue.unref(V),"pointer-events":"all"},null,8,_hoisted_3$8)],32),vue.createElementVNode("g",{onMousedown:pe[2]||(pe[2]=Ve=>he(Ve,vue.unref(ELineBindAnchors).Right)),onMouseup:pe[3]||(pe[3]=Ve=>Ne(Ve,vue.unref(ELineBindAnchors).Right))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(ie),cy:vue.unref(ae),r:vue.unref(k),"fill-opacity":".3"},null,8,_hoisted_4$6),vue.createElementVNode("circle",{id:"connection_r",cx:vue.unref(ie),cy:vue.unref(ae),r:vue.unref(V),"pointer-events":"all"},null,8,_hoisted_5$4)],32),vue.createElementVNode("g",{onMousedown:pe[4]||(pe[4]=Ve=>he(Ve,vue.unref(ELineBindAnchors).BottomCenter)),onMouseup:pe[5]||(pe[5]=Ve=>Ne(Ve,vue.unref(ELineBindAnchors).BottomCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(le),cy:vue.unref(Ie),r:vue.unref(k),"fill-opacity":".3"},null,8,_hoisted_6$2),vue.createElementVNode("circle",{id:"connection_bc",cx:vue.unref(le),cy:vue.unref(Ie),r:vue.unref(V),"pointer-events":"all"},null,8,_hoisted_7$2)],32),vue.createElementVNode("g",{onMousedown:pe[6]||(pe[6]=Ve=>he(Ve,vue.unref(ELineBindAnchors).Left)),onMouseup:pe[7]||(pe[7]=Ve=>Ne(Ve,vue.unref(ELineBindAnchors).Left))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(ue),cy:vue.unref(de),r:vue.unref(k),"fill-opacity":".3"},null,8,_hoisted_8$2),vue.createElementVNode("circle",{id:"connection_l",cx:vue.unref(ue),cy:vue.unref(de),r:vue.unref(V),style:{cursor:"crosshair"},"pointer-events":"all"},null,8,_hoisted_9$2)],32)],8,_hoisted_1$a))}}),connectionPanel_vue_vue_type_style_index_0_scoped_fb729c7a_lang="",ConnectionPanel=_export_sfc(_sfc_main$f,[["__scopeId","data-v-fb729c7a"]]),_hoisted_1$9=["d","stroke-width"],_hoisted_2$7=["d","stroke-width"],_hoisted_3$7=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$5=["from","to","dur","repeatCount"],_hoisted_5$3=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_6$1=["from","to","dur","repeatCount"],_hoisted_7$1=["r","fill"],_hoisted_8$1=["path","dur","repeatCount"],_hoisted_9$1=["cx","cy","r"],_hoisted_10$1=["cx","cy","r","stroke","onMousedown"],_sfc_main$e=vue.defineComponent({__name:"connection-line",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(i){const n=i,r=useGlobalStore(pinia),g=useConfigStore(pinia),V=useSvgEditLayoutStore(pinia),k=($,re,oe,Ce)=>{if(r.intention===EGlobalStoreIntention.Connection)return;r.setHandleSvgInfo(n.itemInfo);const{clientX:ie,clientY:ae}=re;re.stopPropagation(),r.connection_line_node_info={init_pos:{x:oe,y:Ce},point_index:$},r.intention=EGlobalStoreIntention.SetConnectionLineNode,r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((ie-V.canvasInfo.left)/g.svg.scale),position_y:Math.round((ae-V.canvasInfo.top)/g.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}};return($,re)=>{var oe,Ce,ie,ae,le,Ie;return vue.openBlock(),vue.createElementBlock("g",{style:vue.normalizeStyle({cursor:vue.unref(r).intention===vue.unref(EGlobalStoreIntention).Connection?"crosshair":"move"})},[vue.withDirectives(vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#DE4517","stroke-width":n.itemInfo.props["stroke-width"].val+1,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_1$9),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((oe=vue.unref(r).handle_svg_info)==null?void 0:oe.info.id)]]),vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#fff","stroke-opacity":".01","stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_2$7),vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:((Ce=n.itemInfo.animations)==null?void 0:Ce.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dashoffset":"0","stroke-dasharray":((ie=n.itemInfo.animations)==null?void 0:ie.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0,"stroke-linejoin":"round"},[((ae=n.itemInfo.animations)==null?void 0:ae.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_4$5)):vue.createCommentVNode("",!0)],8,_hoisted_3$7),((le=n.itemInfo.animations)==null?void 0:le.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","stroke-linejoin":"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_6$1)],8,_hoisted_5$3)):((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:Math.ceil(n.itemInfo.props["stroke-width"].val*.6)+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_8$1)],8,_hoisted_7$1)):vue.createCommentVNode("",!0),vue.createElementVNode("g",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(ue,de)=>{var Ne;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("circle",{key:de,cx:ue.x,cy:ue.y,r:n.itemInfo.props.point_r.val+1,fill:"none","fill-opacity":"0","stroke-width":"1",stroke:"#DE4517"},null,8,_hoisted_9$1)),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((Ne=vue.unref(r).handle_svg_info)==null?void 0:Ne.info.id)]])}),128)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(ue,de)=>(vue.openBlock(),vue.createElementBlock("circle",{key:de,cx:ue.x,cy:ue.y,r:n.itemInfo.props.point_r.val,"stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:Ne=>k(de,Ne,ue.x,ue.y)},null,40,_hoisted_10$1))),128))])],4)}}}),_hoisted_1$8={id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20"},_hoisted_2$6=["stroke"],_hoisted_3$6=["stroke"],_hoisted_4$4=["stroke"],_hoisted_5$2=["stroke"],_hoisted_6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_7=["transform"],_hoisted_8=["transform"],_hoisted_9=["transform","onMousedown","onMouseup","onMouseenter","onMouseleave","onContextmenu"],_hoisted_10=["xlink:href","id","transform"],_hoisted_11=["id"],_hoisted_12=["id","x1","y1","x2","y2"],_hoisted_13=["id"],_hoisted_14=["x","y","height","width"],_hoisted_15=["onClick"],_hoisted_16={class:"shortcut"},_sfc_main$d=vue.defineComponent({__name:"center-panel",setup(i,{expose:n}){vue.useCssVars(ti=>({"2e4aaeb1":vue.unref(ie)}));const r=useGlobalStore(pinia),g=useConfigStore(pinia),V=useSvgEditLayoutStore(pinia),k=useEditPrivateStore(pinia),$=useContextMenuStore(pinia);componentsRegister();const re=vue.ref(),oe=vue.ref(),Ce={MoveCanvas:"grab",Rotate:"url('/src/assets/icons/rotate.svg'), auto",Connection:"crosshair",SetConnectionLineNode:"crosshair"},ie=vue.computed(()=>Object.keys(Ce).indexOf(r.intention)>-1?Ce[r.intention]:"default"),ae=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}}),le=vue.ref({a:{x:0,y:0},b:{x:0,y:0}}),Ie=vue.computed(()=>r.intention===EGlobalStoreIntention.SelectArea&&le.value.b.x&&le.value.b.y?{with:Math.abs(le.value.b.x-le.value.a.x),height:Math.abs(le.value.b.y-le.value.a.y),x:le.value.a.x<le.value.b.x?le.value.a.x:le.value.b.x,y:le.value.a.y<le.value.b.y?le.value.a.y:le.value.b.y}:{with:0,height:0,x:0,y:0}),ue=vue.computed(()=>{let ti=0;for(let ei of r.done_json)ei.selected&&ti++;return ti>0});let de=!1,Ne=!1;const he=ti=>{var ei;if(r.intention!=EGlobalStoreIntention.None){if(r.intention==EGlobalStoreIntention.Create){if(!r.create_svg_info){console.error("要创建的数据获取失败");return}const Et=Math.floor(ti.offsetX/g.svg.scale-V.center_offset.x),ni=Math.floor(ti.offsetY/g.svg.scale-V.center_offset.y),ri={id:randomString(),x:Et,y:ni,client:{x:Et,y:ni},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y: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}},selected:!1,...objectDeepClone(r.create_svg_info)};r.setDoneJson(ri),r.setHandleSvgInfo(ri,r.done_json.length),r.intention=EGlobalStoreIntention.None}(ei=oe.value)==null||ei.focus()}},ze=ti=>{ti.preventDefault()},pe=ti=>{ti.preventDefault()},Ve=(ti,ei,Et)=>{var ni,ri,ci;if((ni=oe.value)==null||ni.focus(),r.intention===EGlobalStoreIntention.Connection){Et.stopPropagation();return}if(Et.preventDefault(),Et.stopPropagation(),Et.ctrlKey&&Et.button===0)((ri=r.handle_svg_info)!=null&&ri.index||((ci=r.handle_svg_info)==null?void 0:ci.index)===0)&&(r.done_json[r.handle_svg_info.index].selected=!0,r.setHandleSvgInfo(null),r.intention=EGlobalStoreIntention.None),ti.selected=!ti.selected;else if(ue.value){r.intention=EGlobalStoreIntention.GroupMove,r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Et.clientX-V.canvasInfo.left)/g.svg.scale),position_y:Math.round((Et.clientY-V.canvasInfo.top)/g.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0};for(let Ci of r.done_json)Ci.selected&&(Ci.old_position={x:Ci.x,y:Ci.y},Ci.point_coordinate_old=objectDeepClone(Ci.point_coordinate))}else r.intention=EGlobalStoreIntention.Select,r.setHandleSvgInfo(ti,ei),r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Et.clientX-V.canvasInfo.left)/g.svg.scale),position_y:Math.round((Et.clientY-V.canvasInfo.top)/g.svg.scale),now_position_x:ti.x,now_position_y:ti.y,new_position_x:0,new_position_y:0},ti.point_coordinate_old=objectDeepClone(ti.point_coordinate)},Oe=(ti,ei,Et)=>{if(!(r.intention===EGlobalStoreIntention.Connection||r.mouse_info.state!=EMouseInfoState.Down)&&ue.value&&!de&&["SelectArea","Move","Select"].indexOf(r.intention)<0){for(let ni of r.done_json)ni.selected=!1,ni.old_position={x:0,y:0},resetHandlePointOld(ni);r.intention=EGlobalStoreIntention.Select,r.setHandleSvgInfo(ti,ei),r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Et.clientX-V.canvasInfo.left)/g.svg.scale),position_y:Math.round((Et.clientY-V.canvasInfo.top)/g.svg.scale),now_position_x:ti.x,now_position_y:ti.y,new_position_x:0,new_position_y:0}}},_e=(ti,ei,Et)=>{Et.preventDefault(),Et.stopPropagation(),ae.connection_panel=!0,ae.connection_line=!0,!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&ti.type===EDoneJsonType.ConnectionLine)&&(ae.select_item.info=ti,ae.select_item.index=ei)},At=(ti,ei,Et)=>{Et.preventDefault(),Et.stopPropagation(),!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&ti.type===EDoneJsonType.ConnectionLine)&&(ae.connection_panel=!1,ae.connection_line=!1,ae.select_item.info=null,ae.select_item.index=-1)},$e=ti=>{var ci,Ci,li,ui,yi,Mi,zi,Ai,Ii,ai,pi,Ni,di,fi,vi,bi;if(r.mouse_info.state!=EMouseInfoState.Down&&r.intention!==EGlobalStoreIntention.Connection)return;const{clientX:ei,clientY:Et}=ti;r.mouse_info.new_position_x=Math.round((ei-V.canvasInfo.left)/g.svg.scale),r.mouse_info.new_position_y=Math.round((Et-V.canvasInfo.top)/g.svg.scale);const ni=Math.round(r.mouse_info.new_position_x-r.mouse_info.position_x+r.mouse_info.now_position_x),ri=Math.round(r.mouse_info.new_position_y-r.mouse_info.position_y+r.mouse_info.now_position_y);if((ci=r.handle_svg_info)!=null&&ci.info&&(r.intention===EGlobalStoreIntention.Select||r.intention===EGlobalStoreIntention.Move)){if(r.handle_svg_info.info.x=ni,r.handle_svg_info.info.y=ri,r.handle_svg_info.info.client={x:ni,y:ri},r.intention=EGlobalStoreIntention.Move,moveHandlePoint(r.handle_svg_info.info),moveAnchors(r.handle_svg_info.info),r.handle_svg_info.info.type===EDoneJsonType.ConnectionLine){if((Ci=r.handle_svg_info.info.bind_anchors)!=null&&Ci.start){let si=null;for(let wi of r.done_json)wi.id===((ui=(li=r.handle_svg_info.info.bind_anchors)==null?void 0:li.start)==null?void 0:ui.target_id)&&(si=wi);si&&moveAnchors(si)}if((yi=r.handle_svg_info.info.bind_anchors)!=null&&yi.end){let si=null;for(let wi of r.done_json)wi.id===((zi=(Mi=r.handle_svg_info.info.bind_anchors)==null?void 0:Mi.end)==null?void 0:zi.target_id)&&(si=wi);si&&moveAnchors(si)}}}else if(r.intention===EGlobalStoreIntention.MoveCanvas)V.center_offset.x=ni,V.center_offset.y=ri;else if(r.intention===EGlobalStoreIntention.SelectArea)le.value.b.x=r.mouse_info.new_position_x-V.center_offset.x,le.value.b.y=r.mouse_info.new_position_y-V.center_offset.y;else if(r.intention===EGlobalStoreIntention.GroupMove){de=!0;for(let si of r.done_json)if(si.selected&&si.old_position){const wi=Math.round(r.mouse_info.new_position_x-r.mouse_info.position_x+si.old_position.x),oi=Math.round(r.mouse_info.new_position_y-r.mouse_info.position_y+si.old_position.y);if(si.x=wi,si.y=oi,si.client={x:wi,y:oi},moveHandlePoint(si),moveAnchors(si),si.type===EDoneJsonType.ConnectionLine&&((Ai=si.bind_anchors)!=null&&Ai.end)){let Lt=null;for(let ii of r.done_json)ii.id===((ai=(Ii=si.bind_anchors)==null?void 0:Ii.end)==null?void 0:ai.target_id)&&(Lt=ii);Lt&&moveAnchors(Lt)}}}else if(r.intention===EGlobalStoreIntention.Zoom){if(!r.handle_svg_info)return;const si={x:r.mouse_info.new_position_x-V.center_offset.x,y:r.mouse_info.new_position_y-V.center_offset.y};let wi={width:0,height:0,is_old_width:!1,is_old_height:!1};if(r.scale_info.type===EScaleInfoType.TopLeft?wi=calculateLeftTop(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopRight?wi=calculateRightTop(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomRight?wi=calculateRightBottom(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomLeft?wi=calculateLeftBottom(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopCenter?wi=calculateTop(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Right?wi=calculateRight(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.BottomCenter?wi=calculateBottom(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Left&&(wi=calculateLeft(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client)),r.handle_svg_info&&wi.width>0&&wi.height>0){const oi=wi.is_old_width?1:parseFloat((wi.width/r.handle_svg_info.info.actual_bound.width).toFixed(3)),Lt=wi.is_old_height?1:parseFloat((wi.height/r.handle_svg_info.info.actual_bound.height).toFixed(3)),ii=getCenterPoint(si,r.scale_info.symmetric_point);oi>0&&r.scale_info.type!==EScaleInfoType.TopCenter&&r.scale_info.type!==EScaleInfoType.BottomCenter&&(r.handle_svg_info.info.scale_x=oi,r.handle_svg_info.info.x=Math.round(getSvgNowPosition(r.handle_svg_info.info.center_position.x,ii.x,r.handle_svg_info.info.client.x))),Lt>0&&r.scale_info.type!==EScaleInfoType.Left&&r.scale_info.type!==EScaleInfoType.Right&&(r.handle_svg_info.info.scale_y=Lt,r.handle_svg_info.info.y=Math.round(getSvgNowPosition(r.handle_svg_info.info.center_position.y,ii.y,r.handle_svg_info.info.client.y)))}}else if(r.intention===EGlobalStoreIntention.Rotate){if(!r.handle_svg_info)return;const si=Math.atan2(r.mouse_info.position_y-r.handle_svg_info.info.y,r.mouse_info.position_x-r.handle_svg_info.info.x)/(Math.PI/180),wi=Math.atan2(r.mouse_info.new_position_y-V.center_offset.y-r.handle_svg_info.info.y,r.mouse_info.new_position_x-V.center_offset.x-r.handle_svg_info.info.x)/(Math.PI/180);r.handle_svg_info.info.rotate=parseFloat((r.rotate_info.angle+wi-si).toFixed(2))}else if(r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info){const si=(pi=r.handle_svg_info)==null?void 0:pi.info.props.point_position.val.length,wi=r.mouse_info.new_position_x-r.mouse_info.position_x-V.center_offset.x,oi=r.mouse_info.new_position_y-r.mouse_info.position_y-V.center_offset.y,Lt=r.handle_svg_info.info.props.point_position.val[si-2],ii=((di=(Ni=r.handle_svg_info)==null?void 0:Ni.info.props.point_r)==null?void 0:di.val)+2||4;let gi=Lt.x<wi?-ii:Lt.x>wi?ii:0,hi=Lt.y<oi?-ii:Lt.y>oi?ii:0;ti.ctrlKey?r.handle_svg_info.info.props.point_position.val[si-1]={x:Lt.x,y:oi+hi}:ti.shiftKey?r.handle_svg_info.info.props.point_position.val[si-1]={x:wi+gi,y:Lt.y}:r.handle_svg_info.info.props.point_position.val[si-1]={x:wi+gi,y:oi+hi}}else if(r.intention===EGlobalStoreIntention.SetConnectionLineNode&&r.handle_svg_info){!Ne&&(r.connection_line_node_info.point_index===r.handle_svg_info.info.props.point_position.val.length-1||r.connection_line_node_info.point_index===0)&&(Ne=!0);const si=(fi=r.handle_svg_info)==null?void 0:fi.info.props.point_position.val.length,wi=getSvgNowPosition(r.mouse_info.position_x,r.mouse_info.new_position_x,r.connection_line_node_info.init_pos.x),oi=getSvgNowPosition(r.mouse_info.position_y,r.mouse_info.new_position_y,r.connection_line_node_info.init_pos.y),Lt=r.handle_svg_info.info.props.point_position.val[si-2],ii=((bi=(vi=r.handle_svg_info)==null?void 0:vi.info.props.point_r)==null?void 0:bi.val)+2||4;let gi=Lt.x<wi?-ii:Lt.x>wi?ii:0,hi=Lt.y<oi?-ii:Lt.y>oi?ii:0;r.handle_svg_info.info.props.point_position.val[r.connection_line_node_info.point_index]={x:wi+gi,y:oi+hi}}},Fe=()=>{var ti,ei,Et,ni;if(r.mouse_info.state==EMouseInfoState.Down){if((ti=r.handle_svg_info)!=null&&ti.info&&r.intention==EGlobalStoreIntention.Move)setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.intention=EGlobalStoreIntention.None,r.setDoneJson(r.done_json);else if(r.intention==EGlobalStoreIntention.GroupMove)de&&(de=!1,r.intention=EGlobalStoreIntention.None);else if((ei=r.handle_svg_info)!=null&&ei.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&&((Et=r.handle_svg_info)!=null&&Et.info))setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json),r.intention=EGlobalStoreIntention.None;else{if(r.intention===EGlobalStoreIntention.Connection)return;if(r.intention===EGlobalStoreIntention.SetConnectionLineNode)Ne&&((ni=r.handle_svg_info)!=null&&ni.info.bind_anchors)&&(r.connection_line_node_info.point_index===0?r.handle_svg_info.info.bind_anchors.start=null:r.handle_svg_info.info.bind_anchors.end=null),r.intention=EGlobalStoreIntention.None,Ne=!1;else if(r.intention===EGlobalStoreIntention.SelectArea){r.setHandleSvgInfo(null);for(let ri of r.done_json){const ci=Ie.value;ri.selected=ri.x>ci.x&&ri.x<ci.x+ci.with&&ri.y>ci.y&&ri.y<ci.y+ci.height}r.intention=EGlobalStoreIntention.None}else r.intention!=EGlobalStoreIntention.Select&&(r.intention=EGlobalStoreIntention.None)}r.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},$.display=!1}},Ue=ti=>{const{clientX:ei,clientY:Et}=ti;if(r.intention===EGlobalStoreIntention.Connection){r.handle_svg_info||createLine(ti),r.handle_svg_info&&(ti.button===0?r.handle_svg_info.info.props.point_position.val.length!==1?r.handle_svg_info.info.props.point_position.val.push({x:r.mouse_info.new_position_x-r.mouse_info.position_x-V.center_offset.x,y:r.mouse_info.new_position_y-r.mouse_info.position_y-V.center_offset.y}):r.handle_svg_info.info.props.point_position.val.push({x:0,y:0}):ti.button===2&&(r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setHandleSvgInfo(null)));return}ti.button===0?(r.intention=EGlobalStoreIntention.SelectArea,r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((ei-V.canvasInfo.left)/g.svg.scale-V.center_offset.x),position_y:Math.round((Et-V.canvasInfo.top)/g.svg.scale-V.center_offset.y),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},le.value={a:{x:r.mouse_info.position_x,y:r.mouse_info.position_y},b:{x:0,y:0}}):ti.button===2&&(r.intention=EGlobalStoreIntention.MoveCanvas,r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((ei-V.canvasInfo.left)/g.svg.scale),position_y:Math.round((Et-V.canvasInfo.top)/g.svg.scale),now_position_x:V.center_offset.x,now_position_y:V.center_offset.y,new_position_x:0,new_position_y:0})};function xe(ti){ti!=null&&ti.wheelDelta&&(ti.wheelDelta>0?g.svg.scale=parseFloat((g.svg.scale+.1).toFixed(1)):g.svg.scale=parseFloat((g.svg.scale-.1).toFixed(1)))}const Dt=ti=>{ti.stopPropagation(),ti.preventDefault()},qe=(ti,ei,Et)=>{r.intention!==EGlobalStoreIntention.Connection&&re.value&&(r.intention=EGlobalStoreIntention.ContextMenu,r.setHandleSvgInfo(ti,ei),re.value.style.left=Et.pageX+"px",re.value.style.top=Et.pageY+"px",$.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=$.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!0,ei===r.done_json.length-1&&($.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=!1),ei===0&&($.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!1),$.display=!0)},kt=(ti,ei,Et)=>({x:parseFloat((ti.x-ti.width/2*ei+ti.width/2).toFixed(1)),y:parseFloat((ti.y-ti.height/2*Et+ti.height/2).toFixed(1)),width:parseFloat((ti.width*ei).toFixed(1)),height:parseFloat((ti.height*Et).toFixed(1))}),jt=ti=>{ti.preventDefault();let ei=[];if(!ti.ctrlKey&&["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].indexOf(ti.key)>-1&&(ue.value?ei=r.done_json.map((Et,ni)=>({selected:Et.selected,i:ni})).filter(Et=>Et.selected).map(Et=>Et.i):r.handle_svg_info&&ei.push(r.handle_svg_info.index)),!ti.ctrlKey&&ti.key=="ArrowUp"){for(let Et of ei)r.done_json[Et].y-=1,r.done_json[Et].client.y-=1,moveHandlePoint(r.done_json[Et],0,-1),moveAnchors(r.done_json[Et]);useHistoryRecord(r.done_json)}else if(!ti.ctrlKey&&ti.key=="ArrowDown"){for(let Et of ei)r.done_json[Et].y+=1,r.done_json[Et].client.y+=1,moveHandlePoint(r.done_json[Et],0,1),moveAnchors(r.done_json[Et]);useHistoryRecord(r.done_json)}else if(!ti.ctrlKey&&ti.key=="ArrowLeft"){for(let Et of ei)r.done_json[Et].x-=1,r.done_json[Et].client.x-=1,moveHandlePoint(r.done_json[Et],-1,0),moveAnchors(r.done_json[Et]);useHistoryRecord(r.done_json)}else if(!ti.ctrlKey&&ti.key=="ArrowRight"){for(let Et of ei)r.done_json[Et].x+=1,r.done_json[Et].client.x+=1,moveHandlePoint(r.done_json[Et],1,0),moveAnchors(r.done_json[Et]);useHistoryRecord(r.done_json)}else ti.ctrlKey&&ti.key.toLowerCase()=="c"?$.onContextMenuClick(EContextMenuInfoType.Copy):!ti.ctrlKey&&ti.key=="Delete"?ue.value?(r.setDoneJson(r.done_json.filter(Et=>!Et.selected)),r.setHandleSvgInfo(r.done_json[r.done_json.length-1],r.done_json.length-1)):$.onContextMenuClick(EContextMenuInfoType.Delete):ti.ctrlKey&&ti.key=="ArrowUp"?$.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):ti.ctrlKey&&ti.key=="ArrowDown"?$.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):ti.ctrlKey&&ti.key=="ArrowLeft"?$.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):ti.ctrlKey&&ti.key=="ArrowRight"?$.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):ti.ctrlKey&&ti.shiftKey&&ti.key.toLowerCase()=="z"?k.topRedoBtnClick():ti.ctrlKey&&ti.key.toLowerCase()=="z"?k.topUndoBtnClick():ti.ctrlKey&&ti.key.toLowerCase()=="delete"&&(r.done_json.length<=0||r.setDoneJson([]))},Pt=()=>{setSvgActualInfo(r.done_json[r.handle_svg_info.index],!0)};return vue.onMounted(()=>{var ti;(ti=oe.value)==null||ti.focus(),vue.nextTick(function(){var Et;const ei=(Et=oe.value)==null?void 0:Et.getBoundingClientRect();V.canvasInfo={height:(ei==null?void 0:ei.height)||0,with:(ei==null?void 0:ei.width)||0,top:(ei==null?void 0:ei.top)||0,left:(ei==null?void 0:ei.left)||0}})}),n({onCanvasMouseUp:Fe}),(ti,ei)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:oe,onDrop:he,onDragenter:ze,onDragover:pe,onMousedown:Ue,onMousemove:$e,onMouseup:Fe,onContextmenu:Dt,onKeydown:jt,onMousewheel:xe},[(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%"},[vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",_hoisted_1$8,[vue.createElementVNode("line",{x1:"0",y1:"0",x2:"0",y2:"20",stroke:vue.unref(g).svg.grid_color},null,8,_hoisted_2$6),vue.createElementVNode("line",{x1:"10",y1:"0",x2:"10",y2:"20",stroke:vue.unref(g).svg.grid_color},null,8,_hoisted_3$6),vue.createElementVNode("line",{x1:"0",y1:"0",x2:"20",y2:"0",stroke:vue.unref(g).svg.grid_color},null,8,_hoisted_4$4),vue.createElementVNode("line",{x1:"0",y1:"10",x2:"20",y2:"10",stroke:vue.unref(g).svg.grid_color},null,8,_hoisted_5$2)])]),vue.unref(g).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(V).center_offset.x*vue.unref(g).svg.scale},${vue.unref(V).center_offset.y*vue.unref(g).svg.scale})rotate(0)scale(${vue.unref(g).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).done_json,(Et,ni)=>{var ri,ci,Ci,li,ui,yi;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Et.id,transform:`translate(${Et.x},${Et.y})rotate(0)scale(1)`,onMousewheel:ei[0]||(ei[0]=(...Mi)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...Mi))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Et)}`)},[vue.createElementVNode("g",{transform:`translate(${Et.actual_bound.x+Et.actual_bound.width/2},${Et.actual_bound.y+Et.actual_bound.height/2})rotate(${Et.rotate}) scale(1) translate(${-(Et.actual_bound.x+Et.actual_bound.width/2)},${-(Et.actual_bound.y+Et.actual_bound.height/2)})`,onMousedown:Mi=>Ve(Et,ni,Mi),onMouseup:Mi=>Oe(Et,ni,Mi),onMouseenter:Mi=>_e(Et,ni,Mi),onMouseleave:Mi=>At(Et,ni,Mi),onContextmenu:Mi=>qe(Et,ni,Mi)},[Et.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$e,{key:0,"item-info":Et,"point-visible":vue.unref(ae).connection_line&&((ri=vue.unref(ae).select_item.info)==null?void 0:ri.id)==Et.id},null,8,["item-info","point-visible"])):Et.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Et.name}`},vue.unref(prosToVBind)(Et),{width:"100",height:"100",id:Et.id,transform:`translate(${Et.actual_bound.x+Et.actual_bound.width/2},${Et.actual_bound.y+Et.actual_bound.height/2}) scale(${Et.scale_x},${Et.scale_y}) translate(${-(Et.actual_bound.x+Et.actual_bound.width/2)},${-(Et.actual_bound.y+Et.actual_bound.height/2)})`}),null,16,_hoisted_10)):Et.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Et.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Et),{width:"100",height:"100",id:Et.id,onResize:Pt,transform:`translate(${Et.actual_bound.x+Et.actual_bound.width/2},${Et.actual_bound.y+Et.actual_bound.height/2}) scale(${Et.scale_x},${Et.scale_y}) translate(${-(Et.actual_bound.x+Et.actual_bound.width/2)},${-(Et.actual_bound.y+Et.actual_bound.height/2)})`}),null,16,["id","transform"])):Et.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},kt(Et.actual_bound,Et.scale_x,Et.scale_y),{id:`foreign-object${Et.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Et.tag),vue.mergeProps(vue.unref(prosToVBind)(Et),{id:Et.id,transform:`translate(${Et.actual_bound.x+Et.actual_bound.width/2},${Et.actual_bound.y+Et.actual_bound.height/2}) scale(${Et.scale_x},${Et.scale_y}) translate(${-(Et.actual_bound.x+Et.actual_bound.width/2)},${-(Et.actual_bound.y+Et.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Et.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_11)):Et.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:Et.id,x1:Et.props.start_x.val,y1:Et.props.start_y.val,x2:Et.props.end_x.val,y2:Et.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_12)):vue.createCommentVNode("",!0),Et.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${Et.id}`,fill:"black","fill-opacity":"0"},kt(Et.actual_bound,Et.scale_x,Et.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:{"svg-item-none":!Et.selected&&(vue.unref(r).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select),"svg-item-move":vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Move&&((ci=vue.unref(r).handle_svg_info)==null?void 0:ci.info.id)==Et.id,"svg-item-select":vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&((Ci=vue.unref(r).handle_svg_info)==null?void 0:Ci.info.id)==Et.id,"svg-item-in-group":Et.selected}}),null,16,_hoisted_13)):vue.createCommentVNode("",!0),((li=vue.unref(r).handle_svg_info)==null?void 0:li.info.id)===Et.id&&vue.unref(ae).handle_panel&&Et.type!==vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":Et},null,8,["item-info"])):vue.createCommentVNode("",!0),!Et.selected&&((ui=vue.unref(ae).select_item.info)==null?void 0:ui.id)==Et.id&&vue.unref(ae).connection_panel&&Et.config.have_anchor&&vue.unref(r).intention!==vue.unref(EGlobalStoreIntention).SelectArea&&(vue.unref(r).intention!==vue.unref(EGlobalStoreIntention).Select||Et.id!==((yi=vue.unref(r).handle_svg_info)==null?void 0:yi.info.id))?(vue.openBlock(),vue.createBlock(ConnectionPanel,{key:7,onContextmenu:Dt,"item-info":Et},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_9)],2)],40,_hoisted_8)),[[vue.vShow,Et.display]])}),128)),vue.createElementVNode("rect",{x:vue.unref(Ie).x,y:vue.unref(Ie).y,height:vue.unref(Ie).height,width:vue.unref(Ie).with,stroke:"#107cec",fill:"#107cec","fill-opacity":".2"},null,8,_hoisted_14)],8,_hoisted_7)],4))],544),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:re,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref($).info,(Et,ni)=>(vue.openBlock(),vue.createElementBlock("li",{key:Et.title,onClick:ri=>vue.unref($).onContextMenuClick(ni)},[vue.createElementVNode("p",{class:vue.normalizeClass(Et.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(Et.title)+" ",1),vue.createElementVNode("span",_hoisted_16,vue.toDisplayString(Et.hot_key),1)],2)],8,_hoisted_15))),128))],512),[[vue.vShow,vue.unref($).display]])],64))}}),centerPanel_vue_vue_type_style_index_0_scoped_d3ea847c_lang="",CenterPanel=_export_sfc(_sfc_main$d,[["__scopeId","data-v-d3ea847c"]]);var ace$2={exports:{}};(function(i,n){(function(){var r="ace",g=function(){return this}();!g&&typeof window<"u"&&(g=window);var V=function(ie,ae,le){if(typeof ie!="string"){V.original?V.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(le=ae),V.modules[ie]||(V.payloads[ie]=le,V.modules[ie]=null)};V.modules={},V.payloads={};var k=function(ie,ae,le){if(typeof ae=="string"){var Ie=oe(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=oe(ie,ae[de]);if(he==null&&$.original)return;ue.push(he)}return le&&le.apply(null,ue)||!0}},$=function(ie,ae){var le=k("",ie,ae);return le==null&&$.original?$.original.apply(this,arguments):le},re=function(ie,ae){if(ae.indexOf("!")!==-1){var le=ae.split("!");return re(ie,le[0])+"!"+re(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},oe=function(ie,ae){ae=re(ie,ae);var le=V.modules[ae];if(!le){if(le=V.payloads[ae],typeof le=="function"){var Ie={},ue={id:ae,uri:"",exports:Ie,packaged:!0},de=function(he,ze){return k(ae,he,ze)},Ne=le(de,Ie,ue);Ie=Ne||ue.exports,V.modules[ae]=Ie,delete V.payloads[ae]}le=V.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)&&(V.original=ae.define,ae.define=V,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,V){function k($,re,oe){Object.defineProperty($,re,{value:oe,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||k(String.prototype,"startsWith",function($,re){return re=re||0,this.lastIndexOf($,re)===re}),String.prototype.endsWith||k(String.prototype,"endsWith",function($,re){var oe=this;(re===void 0||re>oe.length)&&(re=oe.length),re-=$.length;var Ce=oe.indexOf($,re);return Ce!==-1&&Ce===re}),String.prototype.repeat||k(String.prototype,"repeat",function($){for(var re="",oe=this;$>0;)$&1&&(re+=oe),($>>=1)&&(oe+=oe);return re}),String.prototype.includes||k(String.prototype,"includes",function($,re){return this.indexOf($,re)!=-1}),Object.assign||(Object.assign=function($){if($==null)throw new TypeError("Cannot convert undefined or null to object");for(var re=Object($),oe=1;oe<arguments.length;oe++){var Ce=arguments[oe];Ce!=null&&Object.keys(Ce).forEach(function(ie){re[ie]=Ce[ie]})}return re}),Object.values||(Object.values=function($){return Object.keys($).map(function(re){return $[re]})}),Array.prototype.find||k(Array.prototype,"find",function($){for(var re=this.length,oe=arguments[1],Ce=0;Ce<re;Ce++){var ie=this[Ce];if($.call(oe,ie,Ce,this))return ie}}),Array.prototype.findIndex||k(Array.prototype,"findIndex",function($){for(var re=this.length,oe=arguments[1],Ce=0;Ce<re;Ce++){var ie=this[Ce];if($.call(oe,ie,Ce,this))return Ce}}),Array.prototype.includes||k(Array.prototype,"includes",function($,re){return this.indexOf($,re)!=-1}),Array.prototype.fill||k(Array.prototype,"fill",function($){for(var re=this,oe=re.length>>>0,Ce=arguments[1],ie=Ce>>0,ae=ie<0?Math.max(oe+ie,0):Math.min(ie,oe),le=arguments[2],Ie=le===void 0?oe:le>>0,ue=Ie<0?Math.max(oe+Ie,0):Math.min(Ie,oe);ae<ue;)re[ae]=$,ae++;return re}),Array.of||k(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(r,g,V){r("./es6-shim")}),ace.define("ace/lib/lang",["require","exports","module"],function(r,g,V){g.last=function(re){return re[re.length-1]},g.stringReverse=function(re){return re.split("").reverse().join("")},g.stringRepeat=function(re,oe){for(var Ce="";oe>0;)oe&1&&(Ce+=re),(oe>>=1)&&(re+=re);return Ce};var k=/^\s\s*/,$=/\s\s*$/;g.stringTrimLeft=function(re){return re.replace(k,"")},g.stringTrimRight=function(re){return re.replace($,"")},g.copyObject=function(re){var oe={};for(var Ce in re)oe[Ce]=re[Ce];return oe},g.copyArray=function(re){for(var oe=[],Ce=0,ie=re.length;Ce<ie;Ce++)re[Ce]&&typeof re[Ce]=="object"?oe[Ce]=this.copyObject(re[Ce]):oe[Ce]=re[Ce];return oe},g.deepCopy=function re(oe){if(typeof oe!="object"||!oe)return oe;var Ce;if(Array.isArray(oe)){Ce=[];for(var ie=0;ie<oe.length;ie++)Ce[ie]=re(oe[ie]);return Ce}if(Object.prototype.toString.call(oe)!=="[object Object]")return oe;Ce={};for(var ie in oe)Ce[ie]=re(oe[ie]);return Ce},g.arrayToMap=function(re){for(var oe={},Ce=0;Ce<re.length;Ce++)oe[re[Ce]]=1;return oe},g.createMap=function(re){var oe=Object.create(null);for(var Ce in re)oe[Ce]=re[Ce];return oe},g.arrayRemove=function(re,oe){for(var Ce=0;Ce<=re.length;Ce++)oe===re[Ce]&&re.splice(Ce,1)},g.escapeRegExp=function(re){return re.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},g.escapeHTML=function(re){return(""+re).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},g.getMatchOffsets=function(re,oe){var Ce=[];return re.replace(oe,function(ie){Ce.push({offset:arguments[arguments.length-2],length:ie.length})}),Ce},g.deferredCall=function(re){var oe=null,Ce=function(){oe=null,re()},ie=function(ae){return ie.cancel(),oe=setTimeout(Ce,ae||0),ie};return ie.schedule=ie,ie.call=function(){return this.cancel(),re(),ie},ie.cancel=function(){return clearTimeout(oe),oe=null,ie},ie.isPending=function(){return oe},ie},g.delayedCall=function(re,oe){var Ce=null,ie=function(){Ce=null,re()},ae=function(le){Ce==null&&(Ce=setTimeout(ie,le||oe))};return ae.delay=function(le){Ce&&clearTimeout(Ce),Ce=setTimeout(ie,le||oe)},ae.schedule=ae,ae.call=function(){this.cancel(),re()},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,V){g.inherits=function(k,$){k.super_=$,k.prototype=Object.create($.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}})},g.mixin=function(k,$){for(var re in $)k[re]=$[re];return k},g.implement=function(k,$){g.mixin(k,$)}}),ace.define("ace/lib/useragent",["require","exports","module"],function(r,g,V){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 k=typeof navigator=="object"?navigator:{},$=(/mac|win|linux/i.exec(k.platform)||["other"])[0].toLowerCase(),re=k.userAgent||"",oe=k.appName||"";g.isWin=$=="win",g.isMac=$=="mac",g.isLinux=$=="linux",g.isIE=oe=="Microsoft Internet Explorer"||oe.indexOf("MSAppHost")>=0?parseFloat((re.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((re.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),g.isOldIE=g.isIE&&g.isIE<9,g.isGecko=g.isMozilla=re.match(/ Gecko\/\d+/),g.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",g.isWebKit=parseFloat(re.split("WebKit/")[1])||void 0,g.isChrome=parseFloat(re.split(" Chrome/")[1])||void 0,g.isEdge=parseFloat(re.split(" Edge/")[1])||void 0,g.isAIR=re.indexOf("AdobeAIR")>=0,g.isAndroid=re.indexOf("Android")>=0,g.isChromeOS=re.indexOf(" CrOS ")>=0,g.isIOS=/iPad|iPhone|iPod/.test(re)&&!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,V){var k=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=[],ze=0;ze<Ie.length;ze++){var pe=le(Ie[ze],ue,de);pe&&he.push(pe)}return he}var Ve=document.createElement(Ie[0]),Oe=Ie[1],_e=1;Oe&&typeof Oe=="object"&&!Array.isArray(Oe)&&(_e=2);for(var ze=_e;ze<Ie.length;ze++)le(Ie[ze],Ve,de);return _e==2&&Object.keys(Oe).forEach(function(At){var $e=Oe[At];At==="class"?Ve.className=Array.isArray($e)?$e.join(" "):$e:typeof $e=="function"||At=="value"||At[0]=="$"?Ve[At]=$e:At==="ref"?de&&(de[$e]=Ve):At==="style"?typeof $e=="string"&&(Ve.style.cssText=$e):$e!=null&&Ve.setAttribute(At,$e)}),ue&&ue.appendChild(Ve),Ve},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 re,oe=[];g.useStrictCSP=function(le){re=le,le==!1?Ce():oe||(oe=[])};function Ce(){var le=oe;oe=null,le&&le.forEach(function(Ie){ie(Ie[0],Ie[1])})}function ie(le,Ie,ue){if(!(typeof document>"u")){if(oe){if(ue)Ce();else if(ue===!1)return oe.push([le,Ie])}if(!re){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+=`
315
+ `)("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(),V=vue.shallowRef(),k=vue.shallowRef(),$=vue.inject("ecTheme",null),re=vue.inject("ecInitOptions",null),oe=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 k.value||i.option||null}),de=vue.computed(function(){return i.theme||j($,{})}),Ne=vue.computed(function(){return i.initOptions||j(re,{})}),he=vue.computed(function(){return i.updateOptions||j(oe,{})}),ze=vue.computed(function(){return function($e){var Fe={};for(var Ue in $e)x(Ue)||(Fe[Ue]=$e[Ue]);return Fe}(r)}),pe=vue.getCurrentInstance().proxy.$listeners;function Ve($e){if(g.value){var Fe=V.value=init(g.value,de.value,Ne.value);i.group&&(Fe.group=i.group);var Ue=pe;Ue||(Ue={},Object.keys(r).filter(function(Dt){return Dt.indexOf("on")===0&&Dt.length>2}).forEach(function(Dt){var qe=Dt.charAt(2).toLowerCase()+Dt.slice(3);qe.substring(qe.length-4)==="Once"&&(qe="~".concat(qe.substring(0,qe.length-4))),Ue[qe]=r[Dt]})),Object.keys(Ue).forEach(function(Dt){var qe=Ue[Dt];if(qe){var kt=Dt.toLowerCase();kt.charAt(0)==="~"&&(kt=kt.substring(1),qe.__once__=!0);var jt=Fe;if(kt.indexOf("zr:")===0&&(jt=Fe.getZr(),kt=kt.substring(3)),qe.__once__){delete qe.__once__;var Pt=qe;qe=function(){for(var ti=[],ei=0;ei<arguments.length;ei++)ti[ei]=arguments[ei];Pt.apply(void 0,ti),jt.off(kt,qe)}}jt.on(kt,qe)}}),ie.value?vue.nextTick(function(){Fe&&!Fe.isDisposed()&&Fe.resize(),xe()}):xe()}function xe(){var Dt=$e||ue.value;Dt&&Fe.setOption(Dt,he.value)}}function Oe(){V.value&&(V.value.dispose(),V.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(Fe,Ue){Fe&&(V.value?V.value.setOption(Fe,O({notMerge:Fe.value!==(Ue==null?void 0:Ue.value)},he.value)):Ve())},{deep:!0}))},{immediate:!0}),vue.watch([de,Ne],function(){Oe(),Ve()},{deep:!0}),vue.watchEffect(function(){i.group&&V.value&&(V.value.group=i.group)});var At=y(V);return function($e,Fe,Ue){var xe=vue.inject("ecLoadingOptions",{}),Dt=vue.computed(function(){return O(O({},j(xe,{})),Ue==null?void 0:Ue.value)});vue.watchEffect(function(){var qe=$e.value;qe&&(Fe.value?qe.showLoading(Dt.value):qe.hideLoading())})}(V,le,Ie),function($e,Fe,Ue){var xe=null;vue.watch([Ue,$e,Fe],function(Dt,qe,kt){var jt=Dt[0],Pt=Dt[1],ti=Dt[2];jt&&Pt&&ti&&(xe=throttle$1(function(){Pt.resize()},100),addListener(jt,xe)),kt(function(){xe&&jt&&removeListener(jt,xe)})})}(V,ie,g),vue.onMounted(function(){Ve()}),vue.onBeforeUnmount(function(){T&&g.value?g.value.__dispose=Oe:Oe()}),O({chart:V,root:g,setOption:function($e,Fe){i.manualUpdate&&(k.value=$e),V.value?V.value.setOption($e,Fe||{}):Ve($e)},nonEventAttrs:ze},At)},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$m=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,V)=>(vue.openBlock(),vue.createBlock(vue.unref(S),{class:"chart",option:vue.unref(r),autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_fec2cbf2_lang="",PieCharts=_export_sfc(_sfc_main$m,[["__scopeId","data-v-fec2cbf2"]]),_hoisted_1$g=["id"],_hoisted_2$e=["id"],_hoisted_3$c=["fill"],_hoisted_4$a=["fill"],_hoisted_5$8=["fill"],_hoisted_6$6=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$6=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$6=["fill-opacity"],_hoisted_9$6=["fill-opacity"],_hoisted_10$5=["fill-opacity"],_hoisted_11$4=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$3=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$3=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$3=["xlink:href"],_sfc_main$l=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,V)=>(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$a),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$6,_hoisted_7$6,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$6),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$6),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$5),_hoisted_11$4,_hoisted_12$3,_hoisted_13$3],8,_hoisted_2$e),vue.createElementVNode("use",{"xlink:href":`#${r.id}light-121`,width:"100",height:"100"},null,8,_hoisted_14$3)],8,_hoisted_1$g))}}),_hoisted_1$f=["id"],_hoisted_2$d=["id"],_hoisted_3$b=["fill"],_hoisted_4$9=["fill"],_hoisted_5$7=["fill"],_hoisted_6$5=["from","to"],_hoisted_7$5=["fill"],_hoisted_8$5=["from","to"],_hoisted_9$5=["fill"],_hoisted_10$4=["fill"],_hoisted_11$3=["fill"],_hoisted_12$2=["from","to"],_hoisted_13$2=["fill"],_hoisted_14$2=["xlink:href"],_sfc_main$k=vue.defineComponent({__name:"clock-a",props:{id:{default:""},centerColor:{default:"#EBF257"},secondsColor:{default:"#E83E24"},circleColor:{default:"#F45AFC"},minutesColor:{default:"#50E68E"},hoursColor:{default:"#9A36E7"},scaleColor:{default:"#4942CF"},backgroundColor:{default:"#ffffff"},borderColor:{default:"#B3A7FF"}},setup(i){const n=i,r=new Date(Number(window.sessionStorage.getItem("editorLoadTime")||"0")),g=r.getSeconds()+1,V=r.getMinutes(),k=Math.floor((r.getHours()+(V+g/60)/60)*30);return($,re)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[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:n.borderColor},null,8,_hoisted_3$b),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:n.backgroundColor},null,8,_hoisted_4$9),vue.createElementVNode("path",{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:n.minutesColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(V)*6} 512.3 506.3`,to:`${405+vue.unref(V)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_6$5)],8,_hoisted_5$7),vue.createElementVNode("path",{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:n.hoursColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(k)} 512.3 506.3`,to:`${315+vue.unref(k)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_8$5)],8,_hoisted_7$5),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:n.circleColor},null,8,_hoisted_9$5),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:n.scaleColor},null,8,_hoisted_10$4),vue.createElementVNode("path",{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:n.secondsColor},[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+g*6} 512.3 506.3`,to:`${495.5+g*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12$2)],8,_hoisted_11$3),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:n.centerColor},null,8,_hoisted_13$2)],8,_hoisted_2$d),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"100",height:"100"},null,8,_hoisted_14$2)],8,_hoisted_1$f))}}),vueComp={"svg-text":_sfc_main$p,"el-button":ElButton,"progress-a":_sfc_main$r,"el-tag":ElTag,"common-table":_sfc_main$o,"pie-charts":PieCharts,"switch-r":_sfc_main$q,"now-time":NowTime,"light-a":_sfc_main$l,"clock-a":_sfc_main$k},config=[...svg_config,...vue_config],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}}),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))})},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},spliceDoneJson(i){const n=useGlobalStore(),g=n.done_json.splice(i,1)[0];unbindAnchors(g.id),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},canvasInfo:{with:0,height:0,top:0,left:0}})}),stopEvent=i=>{i.stopPropagation()},preventDefault=i=>{i.preventDefault()};function componentsRegister(){var n,r;const i=vue.getCurrentInstance();for(let g in vueComp)!((n=i==null?void 0:i.appContext)!=null&&n.components.hasOwnProperty(g))&&vueComp.hasOwnProperty(g)&&((r=i==null?void 0:i.appContext)==null||r.app.component(g,vueComp[g]))}function setEditorLoadTime(){window.sessionStorage.setItem("editorLoadTime",new Date().getTime().toString())}const randomString=i=>{i=i||10;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=n.length;let g="";for(let V=0;V<i;V++){let k=r;V===0&&(k=r-10),g+=n.charAt(Math.floor(Math.random()*k))}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:parseFloat(((i.x-n.x)*Math.cos(angleToRadian(r))-(i.y-n.y)*Math.sin(angleToRadian(r))+n.x).toFixed(1)),y:parseFloat(((i.x-n.x)*Math.sin(angleToRadian(r))+(i.y-n.y)*Math.cos(angleToRadian(r))+n.y).toFixed(1))}),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)=>{var V,k;const r=document.querySelector(`#${i.id}`),g=document.querySelector(`#rect${i.id}`);if(r){let $=0,re=0,oe=0,Ce=0;if(i.type===EDoneJsonType.Vue){oe=((V=i.props.width)==null?void 0:V.val)||r.offsetWidth||100,Ce=((k=i.props.height)==null?void 0:k.val)||r.offsetHeight||100,$=50-oe/2,re=50-Ce/2;const ie=document.querySelector(`#foreign-object${i.id}`);ie&&(ie.getAttribute("x")==="0"&&ie.getAttribute("y")==="0"&&ie.getAttribute("width")==="0"&&ie.getAttribute("height")==="0"||n)&&(ie.setAttribute("x",$.toString()),ie.setAttribute("y",re.toString()),ie.setAttribute("width",oe.toString()),ie.setAttribute("height",Ce.toString()))}else{const ie=r.getBBox();$=parseFloat(ie.x.toFixed(0)),re=parseFloat(ie.y.toFixed(0)),oe=parseFloat(ie.width.toFixed(0)),Ce=parseFloat(ie.height.toFixed(0))}g&&(g.getAttribute("x")==="0"&&g.getAttribute("y")==="0"&&g.getAttribute("width")==="0"&&g.getAttribute("height")==="0"||n)&&(g.setAttribute("x",$.toString()),g.setAttribute("y",re.toString()),g.setAttribute("width",oe.toString()),g.setAttribute("height",Ce.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:$,y:re,width:oe,height:Ce}),i.center_position={x:i.x+i.actual_bound.x+oe/2,y:i.y+i.actual_bound.y+Ce/2},i.point_coordinate.tl={x:i.center_position.x-oe*i.scale_x/2,y:i.center_position.y-Ce*i.scale_y/2},i.point_coordinate.tc={x:i.center_position.x,y:i.center_position.y-Ce*i.scale_y/2},i.point_coordinate.tr={x:i.center_position.x+oe*i.scale_x/2,y:i.center_position.y-Ce*i.scale_y/2},i.point_coordinate.l={x:i.center_position.x-oe*i.scale_x/2,y:i.center_position.y},i.point_coordinate.r={x:i.center_position.x+oe*i.scale_x/2,y:i.center_position.y},i.point_coordinate.bl={x:i.center_position.x-oe*i.scale_x/2,y:i.center_position.y+Ce*i.scale_y/2},i.point_coordinate.bc={x:i.center_position.x,y:i.center_position.y+Ce*i.scale_y/2},i.point_coordinate.br={x:i.center_position.x+oe*i.scale_x/2,y:i.center_position.y+Ce*i.scale_y/2},i.rotate!==0&&setAfterRotationPointCoordinate(i),moveAnchors(i)}},resetHandlePointOld=i=>{for(const n of Object.keys(i.point_coordinate))i.point_coordinate_old&&(i.point_coordinate_old[n].x=0,i.point_coordinate_old[n].y=0)},moveHandlePoint=(i,n,r)=>{const g=useGlobalStore(pinia),V=n??g.mouse_info.new_position_x-g.mouse_info.position_x,k=r??g.mouse_info.new_position_y-g.mouse_info.position_y;for(const $ of Object.keys(i.point_coordinate))n!==void 0&&r!==void 0?(i.point_coordinate[$].x+=V,i.point_coordinate[$].y+=k):i.point_coordinate_old&&(i.point_coordinate[$].x=i.point_coordinate_old[$].x+V,i.point_coordinate[$].y=i.point_coordinate_old[$].y+k)},moveAnchors=i=>{var r,g,V,k;const n=useGlobalStore(pinia);for(let $ of n.done_json)if($.type===EDoneJsonType.ConnectionLine){if(((g=(r=$.bind_anchors)==null?void 0:r.start)==null?void 0:g.target_id)===i.id){const re=getAnchorPosByAnchorType($.bind_anchors.start.type,i);$.props.point_position.val[0]={x:re.x-$.x,y:re.y-$.y}}if(((k=(V=$.bind_anchors)==null?void 0:V.end)==null?void 0:k.target_id)===i.id){const re=getAnchorPosByAnchorType($.bind_anchors.end.type,i);$.props.point_position.val[$.props.point_position.val.length-1]={x:re.x-$.x,y:re.y-$.y}}}},unbindAnchors=i=>{var r,g,V,k;const n=useGlobalStore(pinia);for(let $ of n.done_json)$.type===EDoneJsonType.ConnectionLine&&(((g=(r=$.bind_anchors)==null?void 0:r.start)==null?void 0:g.target_id)===i&&($.bind_anchors.start=null),((k=(V=$.bind_anchors)==null?void 0:V.end)==null?void 0:k.target_id)===i&&($.bind_anchors.end=null))},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,i.center_position,i.rotate),tc:calculateRotatedPointCoordinate(i.point_coordinate.tc,i.center_position,i.rotate),tr:calculateRotatedPointCoordinate(i.point_coordinate.tr,i.center_position,i.rotate),l:calculateRotatedPointCoordinate(i.point_coordinate.l,i.center_position,i.rotate),r:calculateRotatedPointCoordinate(i.point_coordinate.r,i.center_position,i.rotate),bl:calculateRotatedPointCoordinate(i.point_coordinate.bl,i.center_position,i.rotate),bc:calculateRotatedPointCoordinate(i.point_coordinate.bc,i.center_position,i.rotate),br:calculateRotatedPointCoordinate(i.point_coordinate.br,i.center_position,i.rotate)}},prosToVBind=(i,n=[])=>{let r={};if(i.state){for(const g in i.state)if(i.state.hasOwnProperty(g)&&g===i.defaultState){for(let V in i.state[g])V!=="label"&&(r[kebabCase$1(V)]=i.state[g][V]);break}}for(const g in i.props)n.indexOf(g)<0&&(r[kebabCase$1(g)]=i.props[g].val);return r},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,createLine=(i,n,r)=>{i.preventDefault();const g=useGlobalStore(pinia),V=useConfigStore(pinia),k=useSvgEditLayoutStore(pinia),{clientX:$,clientY:re}=i;let oe=objectDeepClone(V.connection_line),Ce=0,ie=0;if(n&&r){oe.bind_anchors.start={type:n,target_id:r.id};let le=getAnchorPosByAnchorType(n,r);Ce=le.x,ie=le.y}else Ce=Math.round(($-k.canvasInfo.left)/V.svg.scale-k.center_offset.x),ie=Math.round((re-k.canvasInfo.top)/V.svg.scale-k.center_offset.y);const ae={id:randomString(),x:Ce,y:ie,client:{x:Ce,y:ie},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y: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}},...oe};ae.props.point_position.val.push({x:0,y:0}),g.setDoneJson(ae),g.setHandleSvgInfo(ae,g.done_json.length-1),g.intention=EGlobalStoreIntention.Connection,g.mouse_info={state:EMouseInfoState.Down,position_x:Ce,position_y:ie,now_position_x:Ce,now_position_y:ie,new_position_x:0,new_position_y:0}};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:[]});const 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_r:{title:"节点半径",type:EConfigItemPropsType.InputNumber,val:4},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,grid:!0,grid_color:"#ebebeb",ruler:!0};const useConfigStore=pinia$1.defineStore("config-store",{state:()=>({svg:s,connection_line:t,net:{mqtt:{url:"",user:"",pwd:"",topics:""}}}),getters:{},actions:{}});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=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 V=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]=V,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(V,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const k=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(k),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(k,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),V=useConfigStore(pinia);return V.$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$j=vue.defineComponent({__name:"svg-analysis",props:{name:{},props:{default:()=>({})}},setup(i){const n=i,r=vue.computed(()=>`#svg-${n.name}`);return(g,V)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$e,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":vue.unref(r)},n.props),null,16,_hoisted_2$c)]))}});var EVisibleConfKey=(i=>(i.ImportJson="ImportJson",i.ExportJson="ExportJson",i.ImportFile="ImportFile",i))(EVisibleConfKey||{});const _withScopeId$2=i=>(vue.pushScopeId("data-v-62907637"),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:"250px"}},_hoisted_3$a=_withScopeId$2(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"Svg Editor")],-1)),_hoisted_4$8={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$4={class:"flex items-center mr-20px"},_hoisted_7$4={class:"flex items-center",style:{width:"250px"}},_hoisted_8$4=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title",style:{"padding-top":"16px"}},"多选",-1)),_hoisted_9$4=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住鼠标左键可以框选(图形坐标在框选区域即判定被选中),也可以按住ctrl+鼠标左键点图形进行多选",-1)),_hoisted_10$3=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_11$2=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"拖动画布",-1)),_hoisted_12$1=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区域按住右键可拖动画布,右侧面板‘图纸’栏可微调或重置位置",-1)),_hoisted_13$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_14$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"画布缩放",-1)),_hoisted_15$1=_withScopeId$2(()=>vue.createElementVNode("div",null,"在画布空白区使用鼠标滚轮或者右侧面板‘图纸’栏可控制画布缩放",-1)),_hoisted_16$1=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_17=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"标尺辅助线",-1)),_hoisted_18=_withScopeId$2(()=>vue.createElementVNode("div",null,"在标尺区域按住鼠标左键并拖动即可创建标尺辅助线,将标尺辅助线拖动到标尺区域即可删除标尺辅助线",-1)),_hoisted_19=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_20=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"组件尺寸",-1)),_hoisted_21=_withScopeId$2(()=>vue.createElementVNode("div",null,[vue.createElementVNode("p",null," 大多数组件可以通过选中组件然后拖动交互点或在右侧‘外观’栏改变外形尺寸,或通过右侧‘数据’栏直接或间接改变外形尺寸;"),vue.createElementVNode("p",null,"少数特殊组件仅可通过右侧'数据'栏直接或间接改变外形尺寸")],-1)),_hoisted_22=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_23=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"连线样式",-1)),_hoisted_24=_withScopeId$2(()=>vue.createElementVNode("div",null,"在右侧‘连线’栏可以统一配置连线样式,配置后先增加的线会应用新样式,之前的线样式不变,如需改变,可选中线手动更改或删除重画 ",-1)),_hoisted_25=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_26=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"横线和竖线",-1)),_hoisted_27=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null," 点击编辑器顶部连线按钮会进入连线状态,该状态下在画板点击鼠标左键即可开始画线,移动并再次点击左键创建新的节点,右键结束画线并退出连线状态;"),vue.createElementVNode("p",null,"画线的时候按住ctrl即可画竖线,按住shift即可画横线")],-1)),_hoisted_28=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_29=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"绑定锚点",-1)),_hoisted_30=_withScopeId$2(()=>vue.createElementVNode("div",{class:"guide-text"},[vue.createElementVNode("p",null,"组件在未选中时,鼠标经过组件时会出现锚点,鼠标悬浮在锚点上时,会有交互样式,点击左键即可以锚点为起点创建连线;"),vue.createElementVNode("p",null,"同样,在连线时鼠标经过锚点时,会出现锚点交互样式,点击左键即可以锚点为连线终点结束连线;"),vue.createElementVNode("p",null,"这两种情况下的连线会绑定组件上的锚点,如需解绑,参考下面的‘锚点解绑’;"),vue.createElementVNode("p",null,"同样,也可先画线,再选中连线绑定想要绑定的组件锚点(连线只有首尾节点可以绑定锚点)")],-1)),_hoisted_31=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_32=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"线段选中",-1)),_hoisted_33=_withScopeId$2(()=>vue.createElementVNode("div",null," 若线段绑定了锚点,移动线段,绑定的锚点不会移动。若是想将线段整体移动,需要先解绑,参考下面的‘锚点解绑’ ",-1)),_hoisted_34=_withScopeId$2(()=>vue.createElementVNode("div",{class:"el-divider el-divider--horizontal",role:"separator",style:{"--el-border-style":"solid"}},null,-1)),_hoisted_35=_withScopeId$2(()=>vue.createElementVNode("div",{class:"font-bold mb-10px text-15px guide-title"},"锚点解绑",-1)),_hoisted_36=_withScopeId$2(()=>vue.createElementVNode("div",{style:{"padding-bottom":"14px"}}," 选中线段,在右侧‘数据’栏里解除绑定;或者鼠标左键拖拽连线上需要解绑的节点",-1)),_sfc_main$i=vue.defineComponent({__name:"top-panel",emits:["changeVisible","onReturn","onPreview","onSave"],setup(i,{emit:n}){const r=useSvgEditLayoutStore(pinia),g=useGlobalStore(pinia),V=useEditPrivateStore(pinia),k=useConfigStore(pinia),$=()=>{g.done_json.length<=0||g.setDoneJson([]),g.intention=EGlobalStoreIntention.None},re=ie=>{const ae={layout_center:r.center_offset,config:k.$state,done_json:g.done_json};n(ie,ae)},oe=vue.ref(!1),Ce=vue.computed({get:()=>g.intention===EGlobalStoreIntention.Connection,set(ie){g.intention=ie?EGlobalStoreIntention.Connection:EGlobalStoreIntention.None,ie&&g.setHandleSvgInfo(null)}});return(ie,ae)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$b,[_hoisted_3$a,vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ae[0]||(ae[0]=le=>vue.unref(r).left_nav=!vue.unref(r).left_nav),title:vue.unref(r).left_nav?"隐藏左侧菜单":"显示左侧菜单"},{default:vue.withCtx(()=>[vue.unref(r).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$j,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$j,{key:1,name:"menu-fold"}))]),_:1},8,["title"])]),vue.createElementVNode("div",_hoisted_4$8,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(ElIcon),{title:"撤销 ctrl+z",size:24,class:vue.normalizeClass(`${vue.unref(V).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:ae[1]||(ae[1]=()=>vue.unref(V).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:vue.unref(V).getTopBtnUndoStatus?"undo":"undo-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(V).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:24,onClick:ae[2]||(ae[2]=()=>vue.unref(V).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:vue.unref(V).getTopBtnRedoStatus?"redo":"redo-gray"},null,8,["name"])]),_: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:24,onClick:$},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:vue.unref(g).done_json.length>0?"delete":"delete-gray"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"导入数据模型",class:"bt-Icon",size:24,onClick:ae[3]||(ae[3]=le=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"import"})]),_:1}),vue.createVNode(vue.unref(ElIcon),{title:"导出数据模型",size:24,class:"bt-Icon ml-5px",onClick:ae[4]||(ae[4]=le=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"export"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"创建连线",class:vue.normalizeClass(["bt-Icon",{active:vue.unref(Ce)}]),size:24,onClick:ae[5]||(ae[5]=le=>Ce.value=!vue.unref(Ce))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:vue.unref(Ce)?"line-active":"line"},null,8,["name"])]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"说明",class:"bt-Icon",size:24,onClick:ae[6]||(ae[6]=le=>oe.value=!vue.unref(oe))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"question"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$4,[vue.createVNode(vue.unref(ElIcon),{title:"返回",class:"bt-Icon",size:24,onClick:ae[7]||(ae[7]=le=>re("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"return"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"保存",class:"bt-Icon",size:24,onClick:ae[8]||(ae[8]=le=>re("onSave"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"save"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:ae[9]||(ae[9]=le=>re("onPreview"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$4,[vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ae[10]||(ae[10]=le=>vue.unref(r).right_nav=!vue.unref(r).right_nav),title:vue.unref(r).right_nav?"隐藏右侧菜单":"显示右侧菜单"},{default:vue.withCtx(()=>[vue.unref(r).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$j,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$j,{key:1,name:"menu-unfold"}))]),_:1},8,["title"])])]),vue.createVNode(vue.unref(ElDialog),{modelValue:vue.unref(oe),"onUpdate:modelValue":ae[11]||(ae[11]=le=>vue.isRef(oe)?oe.value=le:null),title:"使用说明",width:"60%",class:"guide-dialog"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{"max-height":"60vh"},{default:vue.withCtx(()=>[_hoisted_8$4,_hoisted_9$4,_hoisted_10$3,_hoisted_11$2,_hoisted_12$1,_hoisted_13$1,_hoisted_14$1,_hoisted_15$1,_hoisted_16$1,_hoisted_17,_hoisted_18,_hoisted_19,_hoisted_20,_hoisted_21,_hoisted_22,_hoisted_23,_hoisted_24,_hoisted_25,_hoisted_26,_hoisted_27,_hoisted_28,_hoisted_29,_hoisted_30,_hoisted_31,_hoisted_32,_hoisted_33,_hoisted_34,_hoisted_35,_hoisted_36]),_:1})]),_:1},8,["modelValue"])],64))}}),topPanel_vue_vue_type_style_index_0_scoped_62907637_lang="",topPanel_vue_vue_type_style_index_1_lang="",TopPanel=_export_sfc(_sfc_main$i,[["__scopeId","data-v-62907637"]]),_hoisted_1$c={class:"component-group flex flex-wrap"},_hoisted_2$a=["onDragstart","title"],_sfc_main$h=vue.defineComponent({__name:"left-panel",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),V=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),k=re=>{r.setCreateInfo(re)},$=re=>{var oe;if(((oe=re.dataTransfer)==null?void 0:oe.dropEffect)!=="copy"){ElMessage.warning("请将组件拖到画布中!"),r.intention=EGlobalStoreIntention.None;return}};return(re,oe)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElCollapse),{modelValue:vue.unref(V),"onUpdate:modelValue":oe[0]||(oe[0]=Ce=>vue.isRef(V)?V.value=Ce:null),style:{"border-top":"none"}},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(g),Ce=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:Ce.groupType,key:Ce.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",null,vue.toDisplayString(Ce.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$c,[(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=>k(ie),onDragend:$,title:ie.title},[vue.createVNode(vue.unref(ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:ie.name,props:vue.unref(prosToVBind)(ie,["width","height","maxHeight"])},null,8,["name","props"])]),_:2},1024)],40,_hoisted_2$a))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),leftPanel_vue_vue_type_style_index_0_scoped_d7403cfd_lang="",LeftPanel=_export_sfc(_sfc_main$h,[["__scopeId","data-v-d7403cfd"]]),calculateLeftTop=(i,n,r)=>{const g=getCenterPoint(i,n),V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate(n,g,-r);return{width:k.x-V.x,height:k.y-V.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(i,n,r)=>{const g=getCenterPoint(i,n),V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate(n,g,-r);return{width:V.x-k.x,height:k.y-V.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(i,n,r)=>{const g=getCenterPoint(i,n),V=calculateRotatedPointCoordinate(n,g,-r),k=calculateRotatedPointCoordinate(i,g,-r);return{width:k.x-V.x,height:k.y-V.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(i,n,r)=>{const g=getCenterPoint(i,n),V=calculateRotatedPointCoordinate(n,g,-r),k=calculateRotatedPointCoordinate(i,g,-r);return{width:V.x-k.x,height:k.y-V.y,is_old_width:!1,is_old_height:!1}},calculateTop=(i,n,r,g)=>{const V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate({x:g.x,y:V.y},g,r),$=Math.sqrt((k.x-n.x)**2+(k.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateRight=(i,n,r,g)=>{const V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate({x:V.x,y:g.y},g,r),$=Math.sqrt((k.x-n.x)**2+(k.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(i,n,r,g)=>{const V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate({x:g.x,y:V.y},g,r),$=Math.sqrt((k.x-n.x)**2+(k.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateLeft=(i,n,r,g)=>{const V=calculateRotatedPointCoordinate(i,g,-r),k=calculateRotatedPointCoordinate({x:V.x,y:g.y},g,r),$=Math.sqrt((k.x-n.x)**2+(k.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$9=["cx","cy"],_hoisted_4$7=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$3=["fill","x","y"],_hoisted_7$3=["fill","x","y"],_hoisted_8$3=["fill","x","y"],_hoisted_9$3=["fill","x","y"],_hoisted_10$2=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$g=vue.defineComponent({__name:"handle-panel",props:{itemInfo:{}},setup(i){const n=i;vue.useCssVars(le=>({"5c831aea":vue.unref($)}));const r=useGlobalStore(pinia),g=useConfigStore(pinia),V=useSvgEditLayoutStore(pinia),k=vue.ref(4),$=vue.ref("#ab712e"),re=[{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=vue.computed(()=>n.itemInfo.config.can_zoom),Ce=(le,Ie)=>{console.log("handMousedown",Ie);const{clientX:ue,clientY:de}=Ie;Ie.stopPropagation(),r.intention=EGlobalStoreIntention.Zoom;const Ne=Math.round((ue-V.canvasInfo.left)/g.svg.scale-V.center_offset.x),he=Math.round((de-V.canvasInfo.top)/g.svg.scale-V.center_offset.y);r.mouse_info={state:EMouseInfoState.Down,position_x:Ne,position_y:he,now_position_x:Ne,now_position_y:he,new_position_x:0,new_position_y:0},r.scale_info={type:le,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:Ne+Math.abs(Ne-n.itemInfo.center_position.x)*2*(Ne>n.itemInfo.center_position.x?-1:1),y:he+Math.abs(he-n.itemInfo.center_position.y)*2*(he>n.itemInfo.center_position.y?-1:1)}}},ie=le=>{const{clientX:Ie,clientY:ue}=le,de=Math.round((Ie-V.canvasInfo.left)/g.svg.scale-V.center_offset.x),Ne=Math.round((ue-V.canvasInfo.top)/g.svg.scale-V.center_offset.y);le.stopPropagation(),r.intention=EGlobalStoreIntention.Rotate,r.rotate_info={angle:n.itemInfo.rotate},r.mouse_info={state:EMouseInfoState.Down,position_x:de,position_y:Ne,now_position_x:de,now_position_y:Ne,new_position_x:0,new_position_y:0}},ae=le=>{const Ie=(le+n.itemInfo.rotate)%360,ue=re.find(de=>de.start<=Ie&&de.end>Ie);return ue?{cursor:ue.cursor+"-resize",type:ue.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(le,Ie)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$b,[vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:Ie[0]||(Ie[0]=ue=>Ce(vue.unref(EScaleInfoType).TopLeft,ue))},null,44,_hoisted_2$9),[[vue.vShow,vue.unref(oe)]]),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:ie},null,40,_hoisted_3$9),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-vue.unref(k)-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-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:vue.unref($),"stroke-width":2})},null,12,_hoisted_4$7),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-vue.unref(k),y:n.itemInfo.actual_bound.y-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:Ie[1]||(Ie[1]=ue=>Ce(vue.unref(EScaleInfoType).TopCenter,ue))},null,44,_hoisted_5$5),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-vue.unref(k)+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:Ie[2]||(Ie[2]=ue=>Ce(vue.unref(EScaleInfoType).TopRight,ue))},null,44,_hoisted_6$3),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)+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:Ie[3]||(Ie[3]=ue=>Ce(vue.unref(EScaleInfoType).Left,ue))},null,44,_hoisted_7$3),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)+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:Ie[4]||(Ie[4]=ue=>Ce(vue.unref(EScaleInfoType).Right,ue))},null,44,_hoisted_8$3),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)+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:Ie[5]||(Ie[5]=ue=>Ce(vue.unref(EScaleInfoType).BottomLeft,ue))},null,44,_hoisted_9$3),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-vue.unref(k)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:Ie[6]||(Ie[6]=ue=>Ce(vue.unref(EScaleInfoType).BottomCenter,ue))},null,44,_hoisted_10$2),[[vue.vShow,vue.unref(oe)]]),vue.withDirectives(vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:vue.unref($),style:vue.normalizeStyle({cursor:ae(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-vue.unref(k)+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-vue.unref(k)+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:Ie[7]||(Ie[7]=ue=>Ce(vue.unref(EScaleInfoType).BottomRight,ue))},null,44,_hoisted_11$1),[[vue.vShow,vue.unref(oe)]])]))}}),handlePanel_vue_vue_type_style_index_0_scoped_e6622df8_lang="",HandlePanel=_export_sfc(_sfc_main$g,[["__scopeId","data-v-e6622df8"]]),_hoisted_1$a=["fill"],_hoisted_2$8=["cx","cy","r"],_hoisted_3$8=["cx","cy","r"],_hoisted_4$6=["cx","cy","r"],_hoisted_5$4=["cx","cy","r"],_hoisted_6$2=["cx","cy","r"],_hoisted_7$2=["cx","cy","r"],_hoisted_8$2=["cx","cy","r"],_hoisted_9$2=["cx","cy","r"],_sfc_main$f=vue.defineComponent({__name:"connection-panel",props:{itemInfo:{}},setup(i){const n=i,r=vue.ref(4),g=vue.ref("#ab712e"),V=vue.ref(4),k=vue.ref(12),$=useGlobalStore(pinia),re=useSvgEditLayoutStore(pinia),oe=vue.computed(()=>n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-r.value+V.value),Ce=vue.computed(()=>n.itemInfo.actual_bound.y-r.value-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+V.value),ie=vue.computed(()=>n.itemInfo.actual_bound.x-r.value+n.itemInfo.actual_bound.width+getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+V.value),ae=vue.computed(()=>n.itemInfo.actual_bound.y-r.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+V.value),le=vue.computed(()=>n.itemInfo.actual_bound.x-r.value+n.itemInfo.actual_bound.width/2+V.value),Ie=vue.computed(()=>n.itemInfo.actual_bound.y-r.value+n.itemInfo.actual_bound.height+getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+V.value),ue=vue.computed(()=>n.itemInfo.actual_bound.x-r.value-getCoordinateOffset(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+V.value),de=vue.computed(()=>n.itemInfo.actual_bound.y-r.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-getCoordinateOffset(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+V.value),Ne=(ze,pe)=>{var Ve;$.intention===EGlobalStoreIntention.SetConnectionLineNode&&(ze.stopPropagation(),(Ve=$.handle_svg_info)!=null&&Ve.info.bind_anchors&&$.connection_line_node_info&&($.connection_line_node_info.point_index===0?$.handle_svg_info.info.bind_anchors.start={type:pe,target_id:n.itemInfo.id}:$.connection_line_node_info.point_index===$.handle_svg_info.info.props.point_position.val.length-1&&($.handle_svg_info.info.bind_anchors.end={type:pe,target_id:n.itemInfo.id}),$.intention=EGlobalStoreIntention.None,$.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))},he=(ze,pe)=>{var Ve;$.intention===EGlobalStoreIntention.None?(createLine(ze,pe,n.itemInfo),$.handle_svg_info&&($.handle_svg_info.info.props.point_position.val.length!==1?$.handle_svg_info.info.props.point_position.val.push({x:$.mouse_info.new_position_x-$.mouse_info.position_x-re.center_offset.x,y:$.mouse_info.new_position_y-$.mouse_info.position_y-re.center_offset.y}):$.handle_svg_info.info.props.point_position.val.push({x:0,y:0}))):$.intention===EGlobalStoreIntention.Connection&&(ze.stopPropagation(),(Ve=$.handle_svg_info)!=null&&Ve.info.bind_anchors&&($.handle_svg_info.info.bind_anchors.end={type:pe,target_id:n.itemInfo.id},$.intention=EGlobalStoreIntention.None,$.setHandleSvgInfo(null),vue.nextTick(function(){moveAnchors(n.itemInfo)})))};return(ze,pe)=>(vue.openBlock(),vue.createElementBlock("g",{style:{"vector-effect":"non-scaling-stroke"},class:"connect-points",fill:vue.unref(g),"stroke-width":"2",stroke:"rgba(0,0,0,0)"},[vue.createElementVNode("g",{onMousedown:pe[0]||(pe[0]=Ve=>he(Ve,vue.unref(ELineBindAnchors).TopCenter)),onMouseup:pe[1]||(pe[1]=Ve=>Ne(Ve,vue.unref(ELineBindAnchors).TopCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(oe),cy:vue.unref(Ce),r:vue.unref(k),"fill-opacity":".3"},null,8,_hoisted_2$8),vue.createElementVNode("circle",{id:"connection_tc",cx:vue.unref(oe),cy:vue.unref(Ce),r:vue.unref(V),"pointer-events":"all"},null,8,_hoisted_3$8)],32),vue.createElementVNode("g",{onMousedown:pe[2]||(pe[2]=Ve=>he(Ve,vue.unref(ELineBindAnchors).Right)),onMouseup:pe[3]||(pe[3]=Ve=>Ne(Ve,vue.unref(ELineBindAnchors).Right))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(ie),cy:vue.unref(ae),r:vue.unref(k),"fill-opacity":".3"},null,8,_hoisted_4$6),vue.createElementVNode("circle",{id:"connection_r",cx:vue.unref(ie),cy:vue.unref(ae),r:vue.unref(V),"pointer-events":"all"},null,8,_hoisted_5$4)],32),vue.createElementVNode("g",{onMousedown:pe[4]||(pe[4]=Ve=>he(Ve,vue.unref(ELineBindAnchors).BottomCenter)),onMouseup:pe[5]||(pe[5]=Ve=>Ne(Ve,vue.unref(ELineBindAnchors).BottomCenter))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(le),cy:vue.unref(Ie),r:vue.unref(k),"fill-opacity":".3"},null,8,_hoisted_6$2),vue.createElementVNode("circle",{id:"connection_bc",cx:vue.unref(le),cy:vue.unref(Ie),r:vue.unref(V),"pointer-events":"all"},null,8,_hoisted_7$2)],32),vue.createElementVNode("g",{onMousedown:pe[6]||(pe[6]=Ve=>he(Ve,vue.unref(ELineBindAnchors).Left)),onMouseup:pe[7]||(pe[7]=Ve=>Ne(Ve,vue.unref(ELineBindAnchors).Left))},[vue.createElementVNode("circle",{class:"out-circle",cx:vue.unref(ue),cy:vue.unref(de),r:vue.unref(k),"fill-opacity":".3"},null,8,_hoisted_8$2),vue.createElementVNode("circle",{id:"connection_l",cx:vue.unref(ue),cy:vue.unref(de),r:vue.unref(V),style:{cursor:"crosshair"},"pointer-events":"all"},null,8,_hoisted_9$2)],32)],8,_hoisted_1$a))}}),connectionPanel_vue_vue_type_style_index_0_scoped_fb729c7a_lang="",ConnectionPanel=_export_sfc(_sfc_main$f,[["__scopeId","data-v-fb729c7a"]]),_hoisted_1$9=["d","stroke-width"],_hoisted_2$7=["d","stroke-width"],_hoisted_3$7=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$5=["from","to","dur","repeatCount"],_hoisted_5$3=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_6$1=["from","to","dur","repeatCount"],_hoisted_7$1=["r","fill"],_hoisted_8$1=["path","dur","repeatCount"],_hoisted_9$1=["cx","cy","r"],_hoisted_10$1=["cx","cy","r","stroke","onMousedown"],_sfc_main$e=vue.defineComponent({__name:"connection-line",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(i){const n=i,r=useGlobalStore(pinia),g=useConfigStore(pinia),V=useSvgEditLayoutStore(pinia),k=($,re,oe,Ce)=>{if(r.intention===EGlobalStoreIntention.Connection)return;r.setHandleSvgInfo(n.itemInfo);const{clientX:ie,clientY:ae}=re;re.stopPropagation(),r.connection_line_node_info={init_pos:{x:oe,y:Ce},point_index:$},r.intention=EGlobalStoreIntention.SetConnectionLineNode,r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((ie-V.canvasInfo.left)/g.svg.scale),position_y:Math.round((ae-V.canvasInfo.top)/g.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}};return($,re)=>{var oe,Ce,ie,ae,le,Ie;return vue.openBlock(),vue.createElementBlock("g",{style:vue.normalizeStyle({cursor:vue.unref(r).intention===vue.unref(EGlobalStoreIntention).Connection?"crosshair":"move"})},[vue.withDirectives(vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#DE4517","stroke-width":n.itemInfo.props["stroke-width"].val+1,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_1$9),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((oe=vue.unref(r).handle_svg_info)==null?void 0:oe.info.id)]]),vue.createElementVNode("path",{d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:"#fff","stroke-opacity":".01","stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,_hoisted_2$7),vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:((Ce=n.itemInfo.animations)==null?void 0:Ce.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dashoffset":"0","stroke-dasharray":((ie=n.itemInfo.animations)==null?void 0:ie.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0,"stroke-linejoin":"round"},[((ae=n.itemInfo.animations)==null?void 0:ae.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_4$5)):vue.createCommentVNode("",!0)],8,_hoisted_3$7),((le=n.itemInfo.animations)==null?void 0:le.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","stroke-linejoin":"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_6$1)],8,_hoisted_5$3)):((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:Math.ceil(n.itemInfo.props["stroke-width"].val*.6)+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_8$1)],8,_hoisted_7$1)):vue.createCommentVNode("",!0),vue.createElementVNode("g",null,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(ue,de)=>{var Ne;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("circle",{key:de,cx:ue.x,cy:ue.y,r:n.itemInfo.props.point_r.val+1,fill:"none","fill-opacity":"0","stroke-width":"1",stroke:"#DE4517"},null,8,_hoisted_9$1)),[[vue.vShow,n.itemInfo.selected||n.itemInfo.id===((Ne=vue.unref(r).handle_svg_info)==null?void 0:Ne.info.id)]])}),128)),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(ue,de)=>(vue.openBlock(),vue.createElementBlock("circle",{key:de,cx:ue.x,cy:ue.y,r:n.itemInfo.props.point_r.val,"stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:Ne=>k(de,Ne,ue.x,ue.y)},null,40,_hoisted_10$1))),128))])],4)}}}),_hoisted_1$8={id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20"},_hoisted_2$6=["stroke"],_hoisted_3$6=["stroke"],_hoisted_4$4=["stroke"],_hoisted_5$2=["stroke"],_hoisted_6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_7=["transform"],_hoisted_8=["transform"],_hoisted_9=["transform","onMousedown","onMouseup","onMouseenter","onMouseleave","onContextmenu"],_hoisted_10=["xlink:href","id","transform"],_hoisted_11=["id"],_hoisted_12=["id","x1","y1","x2","y2"],_hoisted_13=["id"],_hoisted_14=["x","y","height","width"],_hoisted_15=["onClick"],_hoisted_16={class:"shortcut"},_sfc_main$d=vue.defineComponent({__name:"center-panel",setup(i,{expose:n}){vue.useCssVars(ti=>({"2e4aaeb1":vue.unref(ie)}));const r=useGlobalStore(pinia),g=useConfigStore(pinia),V=useSvgEditLayoutStore(pinia),k=useEditPrivateStore(pinia),$=useContextMenuStore(pinia);componentsRegister();const re=vue.ref(),oe=vue.ref(),Ce={MoveCanvas:"grab",Rotate:"url('/src/assets/icons/rotate.svg'), auto",Connection:"crosshair",SetConnectionLineNode:"crosshair"},ie=vue.computed(()=>Object.keys(Ce).indexOf(r.intention)>-1?Ce[r.intention]:"default"),ae=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}}),le=vue.ref({a:{x:0,y:0},b:{x:0,y:0}}),Ie=vue.computed(()=>r.intention===EGlobalStoreIntention.SelectArea&&le.value.b.x&&le.value.b.y?{with:Math.abs(le.value.b.x-le.value.a.x),height:Math.abs(le.value.b.y-le.value.a.y),x:le.value.a.x<le.value.b.x?le.value.a.x:le.value.b.x,y:le.value.a.y<le.value.b.y?le.value.a.y:le.value.b.y}:{with:0,height:0,x:0,y:0}),ue=vue.computed(()=>{let ti=0;for(let ei of r.done_json)ei.selected&&ti++;return ti>0});let de=!1,Ne=!1;const he=ti=>{var ei;if(r.intention!=EGlobalStoreIntention.None){if(r.intention==EGlobalStoreIntention.Create){if(!r.create_svg_info){console.error("要创建的数据获取失败");return}const Et=Math.floor(ti.offsetX/g.svg.scale-V.center_offset.x),ni=Math.floor(ti.offsetY/g.svg.scale-V.center_offset.y),ri={id:randomString(),x:Et,y:ni,client:{x:Et,y:ni},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},center_position:{x:0,y: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}},selected:!1,...objectDeepClone(r.create_svg_info)};r.setDoneJson(ri),r.setHandleSvgInfo(ri,r.done_json.length),r.intention=EGlobalStoreIntention.None}(ei=oe.value)==null||ei.focus()}},ze=ti=>{ti.preventDefault()},pe=ti=>{ti.preventDefault()},Ve=(ti,ei,Et)=>{var ni,ri,ci;if((ni=oe.value)==null||ni.focus(),r.intention===EGlobalStoreIntention.Connection){Et.stopPropagation();return}if(Et.preventDefault(),Et.stopPropagation(),Et.ctrlKey&&Et.button===0)((ri=r.handle_svg_info)!=null&&ri.index||((ci=r.handle_svg_info)==null?void 0:ci.index)===0)&&(r.done_json[r.handle_svg_info.index].selected=!0,r.setHandleSvgInfo(null),r.intention=EGlobalStoreIntention.None),ti.selected=!ti.selected;else if(ue.value){r.intention=EGlobalStoreIntention.GroupMove,r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Et.clientX-V.canvasInfo.left)/g.svg.scale),position_y:Math.round((Et.clientY-V.canvasInfo.top)/g.svg.scale),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0};for(let Ci of r.done_json)Ci.selected&&(Ci.old_position={x:Ci.x,y:Ci.y},Ci.point_coordinate_old=objectDeepClone(Ci.point_coordinate))}else r.intention=EGlobalStoreIntention.Select,r.setHandleSvgInfo(ti,ei),r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Et.clientX-V.canvasInfo.left)/g.svg.scale),position_y:Math.round((Et.clientY-V.canvasInfo.top)/g.svg.scale),now_position_x:ti.x,now_position_y:ti.y,new_position_x:0,new_position_y:0},ti.point_coordinate_old=objectDeepClone(ti.point_coordinate)},Oe=(ti,ei,Et)=>{if(!(r.intention===EGlobalStoreIntention.Connection||r.mouse_info.state!=EMouseInfoState.Down)&&ue.value&&!de&&["SelectArea","Move","Select"].indexOf(r.intention)<0){for(let ni of r.done_json)ni.selected=!1,ni.old_position={x:0,y:0},resetHandlePointOld(ni);r.intention=EGlobalStoreIntention.Select,r.setHandleSvgInfo(ti,ei),r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((Et.clientX-V.canvasInfo.left)/g.svg.scale),position_y:Math.round((Et.clientY-V.canvasInfo.top)/g.svg.scale),now_position_x:ti.x,now_position_y:ti.y,new_position_x:0,new_position_y:0}}},_e=(ti,ei,Et)=>{Et.preventDefault(),Et.stopPropagation(),ae.connection_panel=!0,ae.connection_line=!0,!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&ti.type===EDoneJsonType.ConnectionLine)&&(ae.select_item.info=ti,ae.select_item.index=ei)},At=(ti,ei,Et)=>{Et.preventDefault(),Et.stopPropagation(),!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&ti.type===EDoneJsonType.ConnectionLine)&&(ae.connection_panel=!1,ae.connection_line=!1,ae.select_item.info=null,ae.select_item.index=-1)},$e=ti=>{var ci,Ci,li,ui,yi,Mi,zi,Ai,Ii,ai,pi,Ni,di,fi,vi,bi;if(r.mouse_info.state!=EMouseInfoState.Down&&r.intention!==EGlobalStoreIntention.Connection)return;const{clientX:ei,clientY:Et}=ti;r.mouse_info.new_position_x=Math.round((ei-V.canvasInfo.left)/g.svg.scale),r.mouse_info.new_position_y=Math.round((Et-V.canvasInfo.top)/g.svg.scale);const ni=Math.round(r.mouse_info.new_position_x-r.mouse_info.position_x+r.mouse_info.now_position_x),ri=Math.round(r.mouse_info.new_position_y-r.mouse_info.position_y+r.mouse_info.now_position_y);if((ci=r.handle_svg_info)!=null&&ci.info&&(r.intention===EGlobalStoreIntention.Select||r.intention===EGlobalStoreIntention.Move)){if(r.handle_svg_info.info.x=ni,r.handle_svg_info.info.y=ri,r.handle_svg_info.info.client={x:ni,y:ri},r.intention=EGlobalStoreIntention.Move,moveHandlePoint(r.handle_svg_info.info),moveAnchors(r.handle_svg_info.info),r.handle_svg_info.info.type===EDoneJsonType.ConnectionLine){if((Ci=r.handle_svg_info.info.bind_anchors)!=null&&Ci.start){let si=null;for(let wi of r.done_json)wi.id===((ui=(li=r.handle_svg_info.info.bind_anchors)==null?void 0:li.start)==null?void 0:ui.target_id)&&(si=wi);si&&moveAnchors(si)}if((yi=r.handle_svg_info.info.bind_anchors)!=null&&yi.end){let si=null;for(let wi of r.done_json)wi.id===((zi=(Mi=r.handle_svg_info.info.bind_anchors)==null?void 0:Mi.end)==null?void 0:zi.target_id)&&(si=wi);si&&moveAnchors(si)}}}else if(r.intention===EGlobalStoreIntention.MoveCanvas)V.center_offset.x=ni,V.center_offset.y=ri;else if(r.intention===EGlobalStoreIntention.SelectArea)le.value.b.x=r.mouse_info.new_position_x-V.center_offset.x,le.value.b.y=r.mouse_info.new_position_y-V.center_offset.y;else if(r.intention===EGlobalStoreIntention.GroupMove){de=!0;for(let si of r.done_json)if(si.selected&&si.old_position){const wi=Math.round(r.mouse_info.new_position_x-r.mouse_info.position_x+si.old_position.x),oi=Math.round(r.mouse_info.new_position_y-r.mouse_info.position_y+si.old_position.y);if(si.x=wi,si.y=oi,si.client={x:wi,y:oi},moveHandlePoint(si),moveAnchors(si),si.type===EDoneJsonType.ConnectionLine&&((Ai=si.bind_anchors)!=null&&Ai.end)){let Lt=null;for(let ii of r.done_json)ii.id===((ai=(Ii=si.bind_anchors)==null?void 0:Ii.end)==null?void 0:ai.target_id)&&(Lt=ii);Lt&&moveAnchors(Lt)}}}else if(r.intention===EGlobalStoreIntention.Zoom){if(!r.handle_svg_info)return;const si={x:r.mouse_info.new_position_x-V.center_offset.x,y:r.mouse_info.new_position_y-V.center_offset.y};let wi={width:0,height:0,is_old_width:!1,is_old_height:!1};if(r.scale_info.type===EScaleInfoType.TopLeft?wi=calculateLeftTop(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopRight?wi=calculateRightTop(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomRight?wi=calculateRightBottom(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomLeft?wi=calculateLeftBottom(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopCenter?wi=calculateTop(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Right?wi=calculateRight(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.BottomCenter?wi=calculateBottom(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Left&&(wi=calculateLeft(si,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client)),r.handle_svg_info&&wi.width>0&&wi.height>0){const oi=wi.is_old_width?1:parseFloat((wi.width/r.handle_svg_info.info.actual_bound.width).toFixed(3)),Lt=wi.is_old_height?1:parseFloat((wi.height/r.handle_svg_info.info.actual_bound.height).toFixed(3)),ii=getCenterPoint(si,r.scale_info.symmetric_point);oi>0&&r.scale_info.type!==EScaleInfoType.TopCenter&&r.scale_info.type!==EScaleInfoType.BottomCenter&&(r.handle_svg_info.info.scale_x=oi,r.handle_svg_info.info.x=Math.round(getSvgNowPosition(r.handle_svg_info.info.center_position.x,ii.x,r.handle_svg_info.info.client.x))),Lt>0&&r.scale_info.type!==EScaleInfoType.Left&&r.scale_info.type!==EScaleInfoType.Right&&(r.handle_svg_info.info.scale_y=Lt,r.handle_svg_info.info.y=Math.round(getSvgNowPosition(r.handle_svg_info.info.center_position.y,ii.y,r.handle_svg_info.info.client.y)))}}else if(r.intention===EGlobalStoreIntention.Rotate){if(!r.handle_svg_info)return;const si=Math.atan2(r.mouse_info.position_y-r.handle_svg_info.info.y,r.mouse_info.position_x-r.handle_svg_info.info.x)/(Math.PI/180),wi=Math.atan2(r.mouse_info.new_position_y-V.center_offset.y-r.handle_svg_info.info.y,r.mouse_info.new_position_x-V.center_offset.x-r.handle_svg_info.info.x)/(Math.PI/180);r.handle_svg_info.info.rotate=parseFloat((r.rotate_info.angle+wi-si).toFixed(2))}else if(r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info){const si=(pi=r.handle_svg_info)==null?void 0:pi.info.props.point_position.val.length,wi=r.mouse_info.new_position_x-r.mouse_info.position_x-V.center_offset.x,oi=r.mouse_info.new_position_y-r.mouse_info.position_y-V.center_offset.y,Lt=r.handle_svg_info.info.props.point_position.val[si-2],ii=((di=(Ni=r.handle_svg_info)==null?void 0:Ni.info.props.point_r)==null?void 0:di.val)+2||4;let gi=Lt.x<wi?-ii:Lt.x>wi?ii:0,hi=Lt.y<oi?-ii:Lt.y>oi?ii:0;ti.ctrlKey?r.handle_svg_info.info.props.point_position.val[si-1]={x:Lt.x,y:oi+hi}:ti.shiftKey?r.handle_svg_info.info.props.point_position.val[si-1]={x:wi+gi,y:Lt.y}:r.handle_svg_info.info.props.point_position.val[si-1]={x:wi+gi,y:oi+hi}}else if(r.intention===EGlobalStoreIntention.SetConnectionLineNode&&r.handle_svg_info){!Ne&&(r.connection_line_node_info.point_index===r.handle_svg_info.info.props.point_position.val.length-1||r.connection_line_node_info.point_index===0)&&(Ne=!0);const si=(fi=r.handle_svg_info)==null?void 0:fi.info.props.point_position.val.length,wi=getSvgNowPosition(r.mouse_info.position_x,r.mouse_info.new_position_x,r.connection_line_node_info.init_pos.x),oi=getSvgNowPosition(r.mouse_info.position_y,r.mouse_info.new_position_y,r.connection_line_node_info.init_pos.y),Lt=r.handle_svg_info.info.props.point_position.val[si-2],ii=((bi=(vi=r.handle_svg_info)==null?void 0:vi.info.props.point_r)==null?void 0:bi.val)+2||4;let gi=Lt.x<wi?-ii:Lt.x>wi?ii:0,hi=Lt.y<oi?-ii:Lt.y>oi?ii:0;r.handle_svg_info.info.props.point_position.val[r.connection_line_node_info.point_index]={x:wi+gi,y:oi+hi}}},Fe=()=>{var ti,ei,Et,ni;if(r.mouse_info.state==EMouseInfoState.Down){if((ti=r.handle_svg_info)!=null&&ti.info&&r.intention==EGlobalStoreIntention.Move)setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.intention=EGlobalStoreIntention.None,r.setDoneJson(r.done_json);else if(r.intention==EGlobalStoreIntention.GroupMove)de&&(de=!1,r.intention=EGlobalStoreIntention.None);else if((ei=r.handle_svg_info)!=null&&ei.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&&((Et=r.handle_svg_info)!=null&&Et.info))setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json),r.intention=EGlobalStoreIntention.None;else{if(r.intention===EGlobalStoreIntention.Connection)return;if(r.intention===EGlobalStoreIntention.SetConnectionLineNode)Ne&&((ni=r.handle_svg_info)!=null&&ni.info.bind_anchors)&&(r.connection_line_node_info.point_index===0?r.handle_svg_info.info.bind_anchors.start=null:r.handle_svg_info.info.bind_anchors.end=null),r.intention=EGlobalStoreIntention.None,Ne=!1;else if(r.intention===EGlobalStoreIntention.SelectArea){r.setHandleSvgInfo(null);for(let ri of r.done_json){const ci=Ie.value;ri.selected=ri.x>ci.x&&ri.x<ci.x+ci.with&&ri.y>ci.y&&ri.y<ci.y+ci.height}r.intention=EGlobalStoreIntention.None}else r.intention!=EGlobalStoreIntention.Select&&(r.intention=EGlobalStoreIntention.None)}r.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},$.display=!1}},Ue=ti=>{const{clientX:ei,clientY:Et}=ti;if(r.intention===EGlobalStoreIntention.Connection){r.handle_svg_info||createLine(ti),r.handle_svg_info&&(ti.button===0?r.handle_svg_info.info.props.point_position.val.length!==1?r.handle_svg_info.info.props.point_position.val.push({x:r.mouse_info.new_position_x-r.mouse_info.position_x-V.center_offset.x,y:r.mouse_info.new_position_y-r.mouse_info.position_y-V.center_offset.y}):r.handle_svg_info.info.props.point_position.val.push({x:0,y:0}):ti.button===2&&(r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setHandleSvgInfo(null)));return}ti.button===0?(r.intention=EGlobalStoreIntention.SelectArea,r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((ei-V.canvasInfo.left)/g.svg.scale-V.center_offset.x),position_y:Math.round((Et-V.canvasInfo.top)/g.svg.scale-V.center_offset.y),now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},le.value={a:{x:r.mouse_info.position_x,y:r.mouse_info.position_y},b:{x:0,y:0}}):ti.button===2&&(r.intention=EGlobalStoreIntention.MoveCanvas,r.mouse_info={state:EMouseInfoState.Down,position_x:Math.round((ei-V.canvasInfo.left)/g.svg.scale),position_y:Math.round((Et-V.canvasInfo.top)/g.svg.scale),now_position_x:V.center_offset.x,now_position_y:V.center_offset.y,new_position_x:0,new_position_y:0})};function xe(ti){ti!=null&&ti.wheelDelta&&(ti.wheelDelta>0?g.svg.scale=parseFloat((g.svg.scale+.1).toFixed(1)):g.svg.scale=parseFloat((g.svg.scale-.1).toFixed(1)))}const Dt=ti=>{ti.stopPropagation(),ti.preventDefault()},qe=(ti,ei,Et)=>{r.intention!==EGlobalStoreIntention.Connection&&re.value&&(r.intention=EGlobalStoreIntention.ContextMenu,r.setHandleSvgInfo(ti,ei),re.value.style.left=Et.pageX+"px",re.value.style.top=Et.pageY+"px",$.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=$.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!0,ei===r.done_json.length-1&&($.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=!1),ei===0&&($.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!1),$.display=!0)},kt=(ti,ei,Et)=>({x:parseFloat((ti.x-ti.width/2*ei+ti.width/2).toFixed(1)),y:parseFloat((ti.y-ti.height/2*Et+ti.height/2).toFixed(1)),width:parseFloat((ti.width*ei).toFixed(1)),height:parseFloat((ti.height*Et).toFixed(1))}),jt=ti=>{ti.preventDefault();let ei=[];if(!ti.ctrlKey&&["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].indexOf(ti.key)>-1&&(ue.value?ei=r.done_json.map((Et,ni)=>({selected:Et.selected,i:ni})).filter(Et=>Et.selected).map(Et=>Et.i):r.handle_svg_info&&ei.push(r.handle_svg_info.index)),!ti.ctrlKey&&ti.key=="ArrowUp"){for(let Et of ei)r.done_json[Et].y-=1,r.done_json[Et].client.y-=1,moveHandlePoint(r.done_json[Et],0,-1),moveAnchors(r.done_json[Et]);useHistoryRecord(r.done_json)}else if(!ti.ctrlKey&&ti.key=="ArrowDown"){for(let Et of ei)r.done_json[Et].y+=1,r.done_json[Et].client.y+=1,moveHandlePoint(r.done_json[Et],0,1),moveAnchors(r.done_json[Et]);useHistoryRecord(r.done_json)}else if(!ti.ctrlKey&&ti.key=="ArrowLeft"){for(let Et of ei)r.done_json[Et].x-=1,r.done_json[Et].client.x-=1,moveHandlePoint(r.done_json[Et],-1,0),moveAnchors(r.done_json[Et]);useHistoryRecord(r.done_json)}else if(!ti.ctrlKey&&ti.key=="ArrowRight"){for(let Et of ei)r.done_json[Et].x+=1,r.done_json[Et].client.x+=1,moveHandlePoint(r.done_json[Et],1,0),moveAnchors(r.done_json[Et]);useHistoryRecord(r.done_json)}else ti.ctrlKey&&ti.key.toLowerCase()=="c"?$.onContextMenuClick(EContextMenuInfoType.Copy):!ti.ctrlKey&&ti.key=="Delete"?ue.value?(r.setDoneJson(r.done_json.filter(Et=>!Et.selected)),r.setHandleSvgInfo(r.done_json[r.done_json.length-1],r.done_json.length-1)):$.onContextMenuClick(EContextMenuInfoType.Delete):ti.ctrlKey&&ti.key=="ArrowUp"?$.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):ti.ctrlKey&&ti.key=="ArrowDown"?$.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):ti.ctrlKey&&ti.key=="ArrowLeft"?$.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):ti.ctrlKey&&ti.key=="ArrowRight"?$.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):ti.ctrlKey&&ti.shiftKey&&ti.key.toLowerCase()=="z"?k.topRedoBtnClick():ti.ctrlKey&&ti.key.toLowerCase()=="z"?k.topUndoBtnClick():ti.ctrlKey&&ti.key.toLowerCase()=="delete"&&(r.done_json.length<=0||r.setDoneJson([]))},Pt=()=>{setSvgActualInfo(r.done_json[r.handle_svg_info.index],!0)};return vue.onMounted(()=>{var ti;(ti=oe.value)==null||ti.focus(),vue.nextTick(function(){var Et;const ei=(Et=oe.value)==null?void 0:Et.getBoundingClientRect();V.canvasInfo={height:(ei==null?void 0:ei.height)||0,with:(ei==null?void 0:ei.width)||0,top:(ei==null?void 0:ei.top)||0,left:(ei==null?void 0:ei.left)||0}})}),n({onCanvasMouseUp:Fe}),(ti,ei)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:oe,onDrop:he,onDragenter:ze,onDragover:pe,onMousedown:Ue,onMousemove:$e,onMouseup:Fe,onContextmenu:Dt,onKeydown:jt,onMousewheel:xe},[(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%"},[vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",_hoisted_1$8,[vue.createElementVNode("line",{x1:"0",y1:"0",x2:"0",y2:"20",stroke:vue.unref(g).svg.grid_color},null,8,_hoisted_2$6),vue.createElementVNode("line",{x1:"10",y1:"0",x2:"10",y2:"20",stroke:vue.unref(g).svg.grid_color},null,8,_hoisted_3$6),vue.createElementVNode("line",{x1:"0",y1:"0",x2:"20",y2:"0",stroke:vue.unref(g).svg.grid_color},null,8,_hoisted_4$4),vue.createElementVNode("line",{x1:"0",y1:"10",x2:"20",y2:"10",stroke:vue.unref(g).svg.grid_color},null,8,_hoisted_5$2)])]),vue.unref(g).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(V).center_offset.x*vue.unref(g).svg.scale},${vue.unref(V).center_offset.y*vue.unref(g).svg.scale})rotate(0)scale(${vue.unref(g).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).done_json,(Et,ni)=>{var ri,ci,Ci,li,ui,yi;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Et.id,transform:`translate(${Et.x},${Et.y})rotate(0)scale(1)`,onMousewheel:ei[0]||(ei[0]=(...Mi)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...Mi))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Et)}`)},[vue.createElementVNode("g",{transform:`translate(${Et.actual_bound.x+Et.actual_bound.width/2},${Et.actual_bound.y+Et.actual_bound.height/2})rotate(${Et.rotate}) scale(1) translate(${-(Et.actual_bound.x+Et.actual_bound.width/2)},${-(Et.actual_bound.y+Et.actual_bound.height/2)})`,onMousedown:Mi=>Ve(Et,ni,Mi),onMouseup:Mi=>Oe(Et,ni,Mi),onMouseenter:Mi=>_e(Et,ni,Mi),onMouseleave:Mi=>At(Et,ni,Mi),onContextmenu:Mi=>qe(Et,ni,Mi)},[Et.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$e,{key:0,"item-info":Et,"point-visible":vue.unref(ae).connection_line&&((ri=vue.unref(ae).select_item.info)==null?void 0:ri.id)==Et.id},null,8,["item-info","point-visible"])):Et.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Et.name}`},vue.unref(prosToVBind)(Et),{width:"100",height:"100",id:Et.id,transform:`translate(${Et.actual_bound.x+Et.actual_bound.width/2},${Et.actual_bound.y+Et.actual_bound.height/2}) scale(${Et.scale_x},${Et.scale_y}) translate(${-(Et.actual_bound.x+Et.actual_bound.width/2)},${-(Et.actual_bound.y+Et.actual_bound.height/2)})`}),null,16,_hoisted_10)):Et.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Et.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Et),{width:"100",height:"100",id:Et.id,onResize:Pt,transform:`translate(${Et.actual_bound.x+Et.actual_bound.width/2},${Et.actual_bound.y+Et.actual_bound.height/2}) scale(${Et.scale_x},${Et.scale_y}) translate(${-(Et.actual_bound.x+Et.actual_bound.width/2)},${-(Et.actual_bound.y+Et.actual_bound.height/2)})`}),null,16,["id","transform"])):Et.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},kt(Et.actual_bound,Et.scale_x,Et.scale_y),{id:`foreign-object${Et.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Et.tag),vue.mergeProps(vue.unref(prosToVBind)(Et),{id:Et.id,transform:`translate(${Et.actual_bound.x+Et.actual_bound.width/2},${Et.actual_bound.y+Et.actual_bound.height/2}) scale(${Et.scale_x},${Et.scale_y}) translate(${-(Et.actual_bound.x+Et.actual_bound.width/2)},${-(Et.actual_bound.y+Et.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Et.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_11)):Et.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:Et.id,x1:Et.props.start_x.val,y1:Et.props.start_y.val,x2:Et.props.end_x.val,y2:Et.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_12)):vue.createCommentVNode("",!0),Et.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${Et.id}`,fill:"black","fill-opacity":"0"},kt(Et.actual_bound,Et.scale_x,Et.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:{"svg-item-none":!Et.selected&&(vue.unref(r).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select),"svg-item-move":vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Move&&((ci=vue.unref(r).handle_svg_info)==null?void 0:ci.info.id)==Et.id,"svg-item-select":vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&((Ci=vue.unref(r).handle_svg_info)==null?void 0:Ci.info.id)==Et.id,"svg-item-in-group":Et.selected}}),null,16,_hoisted_13)):vue.createCommentVNode("",!0),((li=vue.unref(r).handle_svg_info)==null?void 0:li.info.id)===Et.id&&vue.unref(ae).handle_panel&&Et.type!==vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":Et},null,8,["item-info"])):vue.createCommentVNode("",!0),!Et.selected&&((ui=vue.unref(ae).select_item.info)==null?void 0:ui.id)==Et.id&&vue.unref(ae).connection_panel&&Et.config.have_anchor&&vue.unref(r).intention!==vue.unref(EGlobalStoreIntention).SelectArea&&(vue.unref(r).intention!==vue.unref(EGlobalStoreIntention).Select||Et.id!==((yi=vue.unref(r).handle_svg_info)==null?void 0:yi.info.id))?(vue.openBlock(),vue.createBlock(ConnectionPanel,{key:7,onContextmenu:Dt,"item-info":Et},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_9)],2)],40,_hoisted_8)),[[vue.vShow,Et.display]])}),128)),vue.createElementVNode("rect",{x:vue.unref(Ie).x,y:vue.unref(Ie).y,height:vue.unref(Ie).height,width:vue.unref(Ie).with,stroke:"#107cec",fill:"#107cec","fill-opacity":".2"},null,8,_hoisted_14)],8,_hoisted_7)],4))],544),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:re,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref($).info,(Et,ni)=>(vue.openBlock(),vue.createElementBlock("li",{key:Et.title,onClick:ri=>vue.unref($).onContextMenuClick(ni)},[vue.createElementVNode("p",{class:vue.normalizeClass(Et.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(Et.title)+" ",1),vue.createElementVNode("span",_hoisted_16,vue.toDisplayString(Et.hot_key),1)],2)],8,_hoisted_15))),128))],512),[[vue.vShow,vue.unref($).display]])],64))}}),centerPanel_vue_vue_type_style_index_0_scoped_d3ea847c_lang="",CenterPanel=_export_sfc(_sfc_main$d,[["__scopeId","data-v-d3ea847c"]]);var ace$2={exports:{}};(function(i,n){(function(){var r="ace",g=function(){return this}();!g&&typeof window<"u"&&(g=window);var V=function(ie,ae,le){if(typeof ie!="string"){V.original?V.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(le=ae),V.modules[ie]||(V.payloads[ie]=le,V.modules[ie]=null)};V.modules={},V.payloads={};var k=function(ie,ae,le){if(typeof ae=="string"){var Ie=oe(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=oe(ie,ae[de]);if(he==null&&$.original)return;ue.push(he)}return le&&le.apply(null,ue)||!0}},$=function(ie,ae){var le=k("",ie,ae);return le==null&&$.original?$.original.apply(this,arguments):le},re=function(ie,ae){if(ae.indexOf("!")!==-1){var le=ae.split("!");return re(ie,le[0])+"!"+re(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},oe=function(ie,ae){ae=re(ie,ae);var le=V.modules[ae];if(!le){if(le=V.payloads[ae],typeof le=="function"){var Ie={},ue={id:ae,uri:"",exports:Ie,packaged:!0},de=function(he,ze){return k(ae,he,ze)},Ne=le(de,Ie,ue);Ie=Ne||ue.exports,V.modules[ae]=Ie,delete V.payloads[ae]}le=V.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)&&(V.original=ae.define,ae.define=V,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,V){function k($,re,oe){Object.defineProperty($,re,{value:oe,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||k(String.prototype,"startsWith",function($,re){return re=re||0,this.lastIndexOf($,re)===re}),String.prototype.endsWith||k(String.prototype,"endsWith",function($,re){var oe=this;(re===void 0||re>oe.length)&&(re=oe.length),re-=$.length;var Ce=oe.indexOf($,re);return Ce!==-1&&Ce===re}),String.prototype.repeat||k(String.prototype,"repeat",function($){for(var re="",oe=this;$>0;)$&1&&(re+=oe),($>>=1)&&(oe+=oe);return re}),String.prototype.includes||k(String.prototype,"includes",function($,re){return this.indexOf($,re)!=-1}),Object.assign||(Object.assign=function($){if($==null)throw new TypeError("Cannot convert undefined or null to object");for(var re=Object($),oe=1;oe<arguments.length;oe++){var Ce=arguments[oe];Ce!=null&&Object.keys(Ce).forEach(function(ie){re[ie]=Ce[ie]})}return re}),Object.values||(Object.values=function($){return Object.keys($).map(function(re){return $[re]})}),Array.prototype.find||k(Array.prototype,"find",function($){for(var re=this.length,oe=arguments[1],Ce=0;Ce<re;Ce++){var ie=this[Ce];if($.call(oe,ie,Ce,this))return ie}}),Array.prototype.findIndex||k(Array.prototype,"findIndex",function($){for(var re=this.length,oe=arguments[1],Ce=0;Ce<re;Ce++){var ie=this[Ce];if($.call(oe,ie,Ce,this))return Ce}}),Array.prototype.includes||k(Array.prototype,"includes",function($,re){return this.indexOf($,re)!=-1}),Array.prototype.fill||k(Array.prototype,"fill",function($){for(var re=this,oe=re.length>>>0,Ce=arguments[1],ie=Ce>>0,ae=ie<0?Math.max(oe+ie,0):Math.min(ie,oe),le=arguments[2],Ie=le===void 0?oe:le>>0,ue=Ie<0?Math.max(oe+Ie,0):Math.min(Ie,oe);ae<ue;)re[ae]=$,ae++;return re}),Array.of||k(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(r,g,V){r("./es6-shim")}),ace.define("ace/lib/lang",["require","exports","module"],function(r,g,V){g.last=function(re){return re[re.length-1]},g.stringReverse=function(re){return re.split("").reverse().join("")},g.stringRepeat=function(re,oe){for(var Ce="";oe>0;)oe&1&&(Ce+=re),(oe>>=1)&&(re+=re);return Ce};var k=/^\s\s*/,$=/\s\s*$/;g.stringTrimLeft=function(re){return re.replace(k,"")},g.stringTrimRight=function(re){return re.replace($,"")},g.copyObject=function(re){var oe={};for(var Ce in re)oe[Ce]=re[Ce];return oe},g.copyArray=function(re){for(var oe=[],Ce=0,ie=re.length;Ce<ie;Ce++)re[Ce]&&typeof re[Ce]=="object"?oe[Ce]=this.copyObject(re[Ce]):oe[Ce]=re[Ce];return oe},g.deepCopy=function re(oe){if(typeof oe!="object"||!oe)return oe;var Ce;if(Array.isArray(oe)){Ce=[];for(var ie=0;ie<oe.length;ie++)Ce[ie]=re(oe[ie]);return Ce}if(Object.prototype.toString.call(oe)!=="[object Object]")return oe;Ce={};for(var ie in oe)Ce[ie]=re(oe[ie]);return Ce},g.arrayToMap=function(re){for(var oe={},Ce=0;Ce<re.length;Ce++)oe[re[Ce]]=1;return oe},g.createMap=function(re){var oe=Object.create(null);for(var Ce in re)oe[Ce]=re[Ce];return oe},g.arrayRemove=function(re,oe){for(var Ce=0;Ce<=re.length;Ce++)oe===re[Ce]&&re.splice(Ce,1)},g.escapeRegExp=function(re){return re.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},g.escapeHTML=function(re){return(""+re).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},g.getMatchOffsets=function(re,oe){var Ce=[];return re.replace(oe,function(ie){Ce.push({offset:arguments[arguments.length-2],length:ie.length})}),Ce},g.deferredCall=function(re){var oe=null,Ce=function(){oe=null,re()},ie=function(ae){return ie.cancel(),oe=setTimeout(Ce,ae||0),ie};return ie.schedule=ie,ie.call=function(){return this.cancel(),re(),ie},ie.cancel=function(){return clearTimeout(oe),oe=null,ie},ie.isPending=function(){return oe},ie},g.delayedCall=function(re,oe){var Ce=null,ie=function(){Ce=null,re()},ae=function(le){Ce==null&&(Ce=setTimeout(ie,le||oe))};return ae.delay=function(le){Ce&&clearTimeout(Ce),Ce=setTimeout(ie,le||oe)},ae.schedule=ae,ae.call=function(){this.cancel(),re()},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,V){g.inherits=function(k,$){k.super_=$,k.prototype=Object.create($.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}})},g.mixin=function(k,$){for(var re in $)k[re]=$[re];return k},g.implement=function(k,$){g.mixin(k,$)}}),ace.define("ace/lib/useragent",["require","exports","module"],function(r,g,V){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 k=typeof navigator=="object"?navigator:{},$=(/mac|win|linux/i.exec(k.platform)||["other"])[0].toLowerCase(),re=k.userAgent||"",oe=k.appName||"";g.isWin=$=="win",g.isMac=$=="mac",g.isLinux=$=="linux",g.isIE=oe=="Microsoft Internet Explorer"||oe.indexOf("MSAppHost")>=0?parseFloat((re.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((re.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),g.isOldIE=g.isIE&&g.isIE<9,g.isGecko=g.isMozilla=re.match(/ Gecko\/\d+/),g.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",g.isWebKit=parseFloat(re.split("WebKit/")[1])||void 0,g.isChrome=parseFloat(re.split(" Chrome/")[1])||void 0,g.isEdge=parseFloat(re.split(" Edge/")[1])||void 0,g.isAIR=re.indexOf("AdobeAIR")>=0,g.isAndroid=re.indexOf("Android")>=0,g.isChromeOS=re.indexOf(" CrOS ")>=0,g.isIOS=/iPad|iPhone|iPod/.test(re)&&!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,V){var k=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=[],ze=0;ze<Ie.length;ze++){var pe=le(Ie[ze],ue,de);pe&&he.push(pe)}return he}var Ve=document.createElement(Ie[0]),Oe=Ie[1],_e=1;Oe&&typeof Oe=="object"&&!Array.isArray(Oe)&&(_e=2);for(var ze=_e;ze<Ie.length;ze++)le(Ie[ze],Ve,de);return _e==2&&Object.keys(Oe).forEach(function(At){var $e=Oe[At];At==="class"?Ve.className=Array.isArray($e)?$e.join(" "):$e:typeof $e=="function"||At=="value"||At[0]=="$"?Ve[At]=$e:At==="ref"?de&&(de[$e]=Ve):At==="style"?typeof $e=="string"&&(Ve.style.cssText=$e):$e!=null&&Ve.setAttribute(At,$e)}),ue&&ue.appendChild(Ve),Ve},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 re,oe=[];g.useStrictCSP=function(le){re=le,le==!1?Ce():oe||(oe=[])};function Ce(){var le=oe;oe=null,le&&le.forEach(function(Ie){ie(Ie[0],Ie[1])})}function ie(le,Ie,ue){if(!(typeof document>"u")){if(oe){if(ue)Ce();else if(ue===!1)return oe.push([le,Ie])}if(!re){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+=`
316
316
  /*# 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 ze=Ie.offsetWidth;return he===ze&&(ze=ue.clientWidth),Ne.removeChild(ue),he-ze},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=k.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,k.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),!k.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,V){/*
317
317
  * based on code from:
318
318
  *
@@ -1260,5 +1260,5 @@ styles.join("\\n")
1260
1260
  line-height: 1.4;
1261
1261
  background: #25282c;
1262
1262
  color: #c1c1c1;
1263
- }`,"autocompletion.css",!1),g.AcePopup=Ie,g.$singleLineEditor=le,g.getAriaId=ae}),ace.define("ace/autocomplete/util",["require","exports","module"],function(r,g,V){g.parForEach=function($,re,oe){var Ce=0,ie=$.length;ie===0&&oe();for(var ae=0;ae<ie;ae++)re($[ae],function(le,Ie){Ce++,Ce===ie&&oe(le,Ie)})};var k=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;g.retrievePrecedingIdentifier=function($,re,oe){oe=oe||k;for(var Ce=[],ie=re-1;ie>=0&&oe.test($[ie]);ie--)Ce.push($[ie]);return Ce.reverse().join("")},g.retrieveFollowingIdentifier=function($,re,oe){oe=oe||k;for(var Ce=[],ie=re;ie<$.length&&oe.test($[ie]);ie++)Ce.push($[ie]);return Ce},g.getCompletionPrefix=function($){var re=$.getCursorPosition(),oe=$.session.getLine(re.row),Ce;return $.completers.forEach(function(ie){ie.identifierRegexps&&ie.identifierRegexps.forEach(function(ae){!Ce&&ae&&(Ce=this.retrievePrecedingIdentifier(oe,re.column,ae))}.bind(this))}.bind(this)),Ce||this.retrievePrecedingIdentifier(oe,re.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,V){var k=r("./keyboard/hash_handler").HashHandler,$=r("./autocomplete/popup").AcePopup,re=r("./autocomplete/popup").getAriaId,oe=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 k,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:re(this.popup.getRow())}),de.keyBinding.addKeyboardHandler(this.keyboardHandler);var ze=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 pe=ze.layerConfig.lineHeight,Ve=ze.$cursorLayer.getPixelPosition(this.base,!0);Ve.left-=this.popup.getTextLeftOffset();var Oe=de.container.getBoundingClientRect();Ve.top+=Oe.top-ze.layerConfig.offset,Ve.left+=Oe.left-de.renderer.scrollLeft,Ve.left+=ze.gutterWidth,this.popup.show(Ve,pe)}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(),ze=de.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(de.relatedTarget),pe=this.popup&&this.popup.container;Ne!=he&&Ne.parentNode!=pe&&!ze&&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 ze=this.editor.selection.getAllRanges(),pe=0,Ve;Ve=ze[pe];pe++)Ve.start.column-=he.filterText.length,this.editor.session.remove(Ve);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(),ze=de.getCursorPosition(),pe=oe.getCompletionPrefix(de);this.base=he.doc.createAnchor(ze.row,ze.column-pe.length),this.base.$insertRight=!0;var Ve=[],Oe=de.completers.length;return de.completers.forEach(function(_e,At){_e.getCompletions(de,he,ze,pe,function($e,Fe){!$e&&Fe&&(Ve=Ve.concat(Fe)),Ne(null,{prefix:oe.getCompletionPrefix(de),matches:Ve,finished:--Oe===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(),ze=this.editor.session.getTextRange({start:this.base,end:he});if(ze==this.completions.filterText)return;if(this.completions.setFilter(ze),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==ze&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,ze,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 pe=this.gatherCompletionsId,Ve=function(Fe){if(Fe.finished)return this.detach()}.bind(this),Oe=function(Fe){var Ue=Fe.prefix,xe=Fe.matches;this.completions=new ue(xe),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(Ue);var Dt=this.completions.filtered;if(!Dt.length||Dt.length==1&&Dt[0].value==Ue&&!Dt[0].snippet)return Ve(Fe);if(this.autoInsert&&Dt.length==1&&Fe.finished)return this.insertMatch(Dt[0]);this.openPopup(this.editor,Ue,de)}.bind(this),_e=!0,At=null;if(this.gatherCompletions(this.editor,function(Fe,Ue){var xe=Ue.prefix,Dt=Ue&&Ue.matches;if(!Dt||!Dt.length)return Ve(Ue);if(!(xe.indexOf(Ue.prefix)!==0||pe!=this.gatherCompletionsId)){if(_e){At=Ue;return}Oe(Ue)}}.bind(this)),_e=!1,At){var $e=At;At=null,Oe($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()]),ze=null;if(!he||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();if(this.editor.completers.some(function(pe){return pe.getDocTooltip&&(ze=pe.getDocTooltip(he)),ze}),!ze&&typeof he!="string"&&(ze=he),typeof ze=="string"&&(ze={docText:ze}),!ze||!(ze.docHTML||ze.docText))return this.hideDocTooltip();this.showDocTooltip(ze)},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,ze=he.container.getBoundingClientRect();Ne.style.top=he.container.style.top,Ne.style.bottom=he.container.style.bottom,Ne.style.display="block",window.innerWidth-ze.right<320?ze.left<320?he.isTopdown?(Ne.style.top=ze.bottom+"px",Ne.style.left=ze.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.top=he.container.offsetTop-Ne.offsetHeight+"px",Ne.style.left=ze.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.right=window.innerWidth-ze.left+"px",Ne.style.left=""):(Ne.style.left=ze.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(ze,pe){return pe.exactMatch-ze.exactMatch||pe.$score-ze.$score||(ze.caption||ze.value).localeCompare(pe.caption||pe.value)});var he=null;Ne=Ne.filter(function(ze){var pe=ze.snippet||ze.caption||ze.value;return pe===he?!1:(he=pe,!0)}),this.filtered=Ne},this.filterCompletions=function(de,Ne){var he=[],ze=Ne.toUpperCase(),pe=Ne.toLowerCase();e:for(var Ve=0,Oe;Oe=de[Ve];Ve++){var _e=Oe.caption||Oe.value||Oe.snippet;if(_e){var At=-1,$e=0,Fe=0,Ue,xe;if(this.exactMatch){if(Ne!==_e.substr(0,Ne.length))continue e}else{var Dt=_e.toLowerCase().indexOf(pe);if(Dt>-1)Fe=Dt;else for(var qe=0;qe<Ne.length;qe++){var kt=_e.indexOf(pe[qe],At+1),jt=_e.indexOf(ze[qe],At+1);if(Ue=kt>=0&&(jt<0||kt<jt)?kt:jt,Ue<0)continue e;xe=Ue-At-1,xe>0&&(At===-1&&(Fe+=10),Fe+=xe,$e=$e|1<<qe),At=Ue}}Oe.matchMask=$e,Oe.exactMatch=Fe?0:1,Oe.$score=(Oe.score||0)-Fe,he.push(Oe)}}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,V){var k=r("../range").Range,$=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function re(Ce,ie){var ae=Ce.getTextRange(k.fromPoints({row:0,column:0},ie));return ae.split($).length-1}function oe(Ce,ie){var ae=re(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),ze=le.length-he;Ie[de]?Ie[de]=Math.max(ze,Ie[de]):Ie[de]=ze}}),Ie}g.getCompletions=function(Ce,ie,ae,le,Ie){var ue=oe(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,V){var k=r("../snippets").snippetManager,$=r("../autocomplete").Autocomplete,re=r("../config"),oe=r("../lib/lang"),Ce=r("../autocomplete/util"),ie=r("../autocomplete/text_completer"),ae={getCompletions:function(Oe,_e,At,$e,Fe){if(_e.$mode.completer)return _e.$mode.completer.getCompletions(Oe,_e,At,$e,Fe);var Ue=Oe.session.getState(At.row),xe=_e.$mode.getCompletions(Ue,_e,At,$e);Fe(null,xe)}},le=function(Oe){var _e={};return Oe.replace(/\${(\d+)(:(.*?))?}/g,function(At,$e,Fe,Ue){return _e[$e]=Ue||""}).replace(/\$(\d+?)/g,function(At,$e){return _e[$e]})},Ie={getCompletions:function(Oe,_e,At,$e,Fe){var Ue=[],xe=_e.getTokenAt(At.row,At.column);xe&&xe.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?Ue.push("html-tag"):Ue=k.getActiveScopes(Oe);var Dt=k.snippetMap,qe=[];Ue.forEach(function(kt){for(var jt=Dt[kt]||[],Pt=jt.length;Pt--;){var ti=jt[Pt],ei=ti.name||ti.tabTrigger;ei&&qe.push({caption:ei,snippet:ti.content,meta:ti.tabTrigger&&!ti.name?ti.tabTrigger+"⇥ ":"snippet",type:"snippet"})}},this),Fe(null,qe)},getDocTooltip:function(Oe){Oe.type=="snippet"&&!Oe.docHTML&&(Oe.docHTML=["<b>",oe.escapeHTML(Oe.caption),"</b>","<hr></hr>",oe.escapeHTML(le(Oe.snippet))].join(""))}},ue=[Ie,ie,ae];g.setCompleters=function(Oe){ue.length=0,Oe&&ue.push.apply(ue,Oe)},g.addCompleter=function(Oe){ue.push(Oe)},g.textCompleter=ie,g.keyWordCompleter=ae,g.snippetCompleter=Ie;var de={name:"expandSnippet",exec:function(Oe){return k.expandWithTab(Oe)},bindKey:"Tab"},Ne=function(Oe,_e){he(_e.session.$mode)},he=function(Oe){typeof Oe=="string"&&(Oe=re.$modes[Oe]),Oe&&(k.files||(k.files={}),ze(Oe.$id,Oe.snippetFileId),Oe.modes&&Oe.modes.forEach(he))},ze=function(Oe,_e){!_e||!Oe||k.files[Oe]||(k.files[Oe]={},re.loadModule(_e,function(At){At&&(k.files[Oe]=At,!At.snippets&&At.snippetText&&(At.snippets=k.parseSnippetFile(At.snippetText)),k.register(At.snippets||[],At.scope),At.includeScopes&&(k.snippetMap[At.scope].includeScopes=At.includeScopes,At.includeScopes.forEach(function($e){he("ace/mode/"+$e)})))}))},pe=function(Oe){var _e=Oe.editor,At=_e.completer&&_e.completer.activated;if(Oe.command.name==="backspace")At&&!Ce.getCompletionPrefix(_e)&&_e.completer.detach();else if(Oe.command.name==="insertstring"){var $e=Ce.getCompletionPrefix(_e);if($e&&!At){var Fe=$.for(_e);Fe.autoInsert=!1,Fe.showPopup(_e)}}},Ve=r("../editor").Editor;r("../config").defineOptions(Ve.prototype,"editor",{enableBasicAutocompletion:{set:function(Oe){Oe?(this.completers||(this.completers=Array.isArray(Oe)?Oe:ue),this.commands.addCommand($.startCommand)):this.commands.removeCommand($.startCommand)},value:!1},enableLiveAutocompletion:{set:function(Oe){Oe?(this.completers||(this.completers=Array.isArray(Oe)?Oe:ue),this.commands.on("afterExec",pe)):this.commands.removeListener("afterExec",pe)},value:!1},enableSnippets:{set:function(Oe){Oe?(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$c=vue.defineComponent({__name:"code-edit-modal",props:{modelValue:{default:()=>({})},lang:{default:"json"},title:{default:"编辑"}},emits:["update:modelValue","close"],setup(i,{emit:n}){const r=i,g=vue.ref(!1),V=vue.computed({get(){return r.lang==="json"?JSON.stringify(r.modelValue,null,2):r.modelValue},set(k){r.lang==="json"?n("update:modelValue",JSON.parse(k)):n("update:modelValue",k)}});return(k,$)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElButton),{onClick:$[0]||($[0]=re=>g.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("···")]),_:1}),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:vue.unref(g),"onUpdate:modelValue":$[2]||($[2]=re=>vue.isRef(g)?g.value=re:null),title:r.title,width:"60%",onClose:$[3]||($[3]=re=>n("close"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(VAceEditor),{value:vue.unref(V),"onUpdate:value":$[1]||($[1]=re=>vue.isRef(V)?V.value=re:null),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$5={class:"one-row-txt",style:{width:"145px"}},_hoisted_4$3={key:1},_sfc_main$b=vue.defineComponent({__name:"dynamic-el-form-item",props:{objInfo:{default:()=>({})},hide:{default:()=>[]},code:{type:Boolean,default:!1}},emits:["change"],setup(i,{emit:n}){const r=i;function g(V){let k=window.setTimeout(function(){n("change",V),clearTimeout(k),k=null},200)}return(V,k)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.objInfo,($,re)=>(vue.openBlock(),vue.createElementBlock("div",{key:re},[r.code?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,class:"props-row",size:"small"},{label:vue.withCtx(()=>[vue.unref(getStringWidth)(String(re))>78?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:String(re),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$7,vue.toDisplayString(re),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$5,vue.toDisplayString(re),1))]),default:vue.withCtx(()=>[vue.unref(getStringWidth)(String($.val))>145?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:JSON.stringify($.val),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$5,vue.toDisplayString($.val),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$3,vue.toDisplayString($.val),1))]),_:2},1024)):vue.createCommentVNode("",!0),r.hide.indexOf(String(re))<0?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:$.title,size:"small"},{default:vue.withCtx(()=>[$.type===vue.unref(EConfigItemPropsType).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElSelect),{key:0,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,placeholder:"Select",size:"small",disabled:!!($!=null&&$.disabled),onChange:g},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList($.options,oe=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:oe.value,label:oe.label,value:oe.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).InputNumber?(vue.openBlock(),vue.createBlock(vue.unref(ElInputNumber),{key:1,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,disabled:!!($!=null&&$.disabled),onChange:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).Input?(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:2,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,disabled:!!($!=null&&$.disabled),onChange:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).Textarea?(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:3,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,autosize:"",type:"textarea",disabled:!!($!=null&&$.disabled),onChange:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).Color?(vue.openBlock(),vue.createBlock(vue.unref(ElColorPicker),{key:4,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,disabled:!!($!=null&&$.disabled),onChange:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).Switch?(vue.openBlock(),vue.createBlock(vue.unref(ElSwitch),{key:5,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,disabled:!!($!=null&&$.disabled),onChange:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).JsonEdit?(vue.openBlock(),vue.createBlock(_sfc_main$c,{key:6,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,disabled:!!($!=null&&$.disabled),onClose:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):vue.createCommentVNode("",!0)]),_:2},1032,["label"])):vue.createCommentVNode("",!0)]))),128))}}),dynamicElFormItem_vue_vue_type_style_index_0_scoped_df8be28f_lang="",dynamicElFormItem_vue_vue_type_style_index_1_lang="",DynamicElFormItem=_export_sfc(_sfc_main$b,[["__scopeId","data-v-df8be28f"]]),_hoisted_1$6={style:{height:"100%"}},_hoisted_2$4={class:"flex flex-wrap"},_hoisted_3$4=["onMouseenter","onClick"],_sfc_main$a=vue.defineComponent({__name:"common-animate",props:{val:{}},emits:["updateCommonAniVal"],setup(i,{emit:n}){const r=i,g=vue.ref(r.val),V=vue.ref(!1),k=vue.ref("进入"),$=vue.ref(null),re=oe=>{n("updateCommonAniVal",oe),V.value=!1};return vue.watch(()=>r.val,oe=>{g.value=oe}),(oe,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.unref(g)?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:0,closable:"",onClose:Ce[0]||(Ce[0]=ie=>re("")),onClick:Ce[1]||(Ce[1]=ie=>V.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==vue.unref(g)))==null?void 0:ie.label)+" ",1),vue.createVNode(vue.unref(ElIcon),{size:10},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"setting"})]),_:1})]}),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:1,type:"success",style:{cursor:"pointer"},onClick:Ce[2]||(Ce[2]=ie=>V.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("新增")]),_:1})),vue.createVNode(vue.unref(ElDrawer),{modelValue:vue.unref(V),"onUpdate:modelValue":Ce[5]||(Ce[5]=ie=>vue.isRef(V)?V.value=ie:null),title:"选择动画",direction:"ltr"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabs),{modelValue:vue.unref(k),"onUpdate:modelValue":Ce[4]||(Ce[4]=ie=>vue.isRef(k)?k.value=ie:null)},{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=>re(ae.value)},[vue.createElementVNode("div",{class:vue.normalizeClass(`${vue.unref($)==le?`animate__animated animate__${ae.value} animate__slow animate__infinite`:""}`)},vue.toDisplayString(ae.label),3)],40,_hoisted_3$4))),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]))}}),commonAnimate_vue_vue_type_style_index_0_scoped_2668f60c_lang="",CommonAnimate=_export_sfc(_sfc_main$a,[["__scopeId","data-v-2668f60c"]]),_sfc_main$9=vue.defineComponent({__name:"component-tree",setup(i){const n=useGlobalStore(pinia),r=vue.computed(()=>{var k;return((k=n.handle_svg_info)==null?void 0:k.info.id)??""}),g=k=>{for(let $ of n.done_json)$.selected=!1,$.old_position={x:0,y:0};n.intention=EGlobalStoreIntention.Select,n.setHandleSvgInfo(k)},V={children:"children",label:"title"};return(k,$)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTree),{class:"tree-v",data:vue.unref(n).done_json,props:V,onNodeClick:g,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!!vue.unref(r),"node-key":"id","current-node-key":vue.unref(r)},null,8,["data","highlight-current","current-node-key"]))}}),_withScopeId$1=i=>(vue.pushScopeId("data-v-98320511"),i=i(),vue.popScopeId(),i),_hoisted_1$5={class:"wall-l"},_hoisted_2$3={class:"head-l"},_hoisted_3$3=_withScopeId$1(()=>vue.createElementVNode("span",null,"key",-1)),_hoisted_4$2=_withScopeId$1(()=>vue.createElementVNode("span",null,"value",-1)),_hoisted_5$1={class:"row-l"},_sfc_main$8=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",$)}}),V=()=>{g.value.push({key:"",val:""})},k=$=>{g.value.splice($,1)};return($,re)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.createElementVNode("div",_hoisted_2$3,[_hoisted_3$3,_hoisted_4$2,vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:V},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"add"})]),_:1})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(g),(oe,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:oe.key,"onUpdate:modelValue":ie=>oe.key=ie,size:"small",placeholder:"key"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:oe.val,"onUpdate:modelValue":ie=>oe.val=ie,size:"small",placeholder:"value"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:ie=>k(Ce)},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"delete"})]),_:2},1032,["onClick"])]))),256))]))}}),list_vue_vue_type_style_index_0_scoped_98320511_lang="",List=_export_sfc(_sfc_main$8,[["__scopeId","data-v-98320511"]]),_hoisted_1$4={class:"c-wall-d"},_sfc_main$7=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",$)}}),V=[{label:"大于",val:"greater"},{label:"大于等于",val:">="},{label:"小于",val:"<"},{label:"小于等于",val:"<="},{label:"等于",val:"=="},{label:"不等于",val:"!="},{label:"介于",val:">=,=<"},{label:"不介于",val:"<,>"}],k=$=>{$!=="None"&&(g.value.Relation={key:"",relation:"",val:"",val2:""}),n("update:modelValue",g)};return($,re)=>{var oe,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:vue.unref(g).type,"onUpdate:modelValue":re[0]||(re[0]=ie=>vue.unref(g).type=ie),onChange:k},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"None",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"Relation",label:"关系运算"})]),_:1},8,["modelValue"])]),_:1}),vue.unref(g).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"属性",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(g).Relation.key,"onUpdate:modelValue":re[1]||(re[1]=ie=>vue.unref(g).Relation.key=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(g).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"关系",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(g).Relation.relation,"onUpdate:modelValue":re[2]||(re[2]=ie=>vue.unref(g).Relation.relation=ie)},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(V,(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),vue.unref(g).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"值",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(g).Relation.val,"onUpdate:modelValue":re[3]||(re[3]=ie=>vue.unref(g).Relation.val=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(g).type==="Relation"&&(((oe=vue.unref(g).Relation)==null?void 0:oe.relation)===">=,=<"||((Ce=vue.unref(g).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:vue.unref(g).Relation.val2,"onUpdate:modelValue":re[4]||(re[4]=ie=>vue.unref(g).Relation.val2=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)])}}}),condition_vue_vue_type_style_index_0_scoped_f43f10e6_lang="",Condition=_export_sfc(_sfc_main$7,[["__scopeId","data-v-f43f10e6"]]),_sfc_main$6=vue.defineComponent({__name:"bind-anchor",props:{modelValue:{},title:{}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=useGlobalStore(pinia),V=vue.computed({get(){return r.modelValue!==null},set(ie){let ae=null;ie&&(ae={target_id:"",type:""}),n("update:modelValue",ae)}}),k=vue.computed({get(){var ie;return((ie=r.modelValue)==null?void 0:ie.target_id)??void 0},set(ie){let ae=null;V.value&&(ae={target_id:ie,type:$.value}),n("update:modelValue",ae)}}),$=vue.computed({get(){var ie;return((ie=r.modelValue)==null?void 0:ie.type)??void 0},set(ie){let ae=null;V.value&&(ae={target_id:k.value,type:ie}),n("update:modelValue",ae)}}),re=vue.computed(()=>g.done_json.filter(ie=>ie.type!==EDoneJsonType.ConnectionLine).map(ie=>({label:ie.title,value:ie.id}))),oe=[{label:"上锚点",value:ELineBindAnchors.TopCenter},{label:"右锚点",value:ELineBindAnchors.Right},{label:"下锚点",value:ELineBindAnchors.BottomCenter},{label:"左锚点",value:ELineBindAnchors.Left}];function Ce(){vue.nextTick(function(){var ie,ae;if(V.value&&((ie=r.modelValue)!=null&&ie.target_id)&&((ae=r.modelValue)!=null&&ae.type)&&g.handle_svg_info){let le=null;for(let Ie of g.done_json)Ie.id===r.modelValue.target_id&&(le=Ie);le&&(setSvgActualInfo(le),moveAnchors(le))}})}return(ie,ae)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(vue.unref(ElFormItem),{label:r.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(V),"onUpdate:modelValue":ae[0]||(ae[0]=le=>vue.isRef(V)?V.value=le:null),onChange:Ce},null,8,["modelValue"])]),_:1},8,["label"]),vue.unref(V)?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"绑定对象",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(k),"onUpdate:modelValue":ae[1]||(ae[1]=le=>vue.isRef(k)?k.value=le:null),onChange:Ce},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(re),le=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:le.value,label:le.label,value:le.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(V)?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"绑定位置",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref($),"onUpdate:modelValue":ae[2]||(ae[2]=le=>vue.isRef($)?$.value=le:null),onChange:Ce},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(oe,le=>vue.createVNode(vue.unref(ElOption),{key:le.value,label:le.label,value:le.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)],64))}}),_withScopeId=i=>(vue.pushScopeId("data-v-9b4c5da1"),i=i(),vue.popScopeId(),i),_hoisted_1$3=_withScopeId(()=>vue.createElementVNode("span",{style:{"font-weight":"bold"}},"MQTT",-1)),_hoisted_2$2={key:2},_hoisted_3$2={class:"events-title"},_sfc_main$5=vue.defineComponent({__name:"right-panel",setup(i){const n=useConfigStore(pinia),r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),V=vue.ref("page"),k=vue.ref("style"),$=(ue,de)=>{ue!=null&&ue.common_animations&&(ue.common_animations.val=de)};n.$subscribe((ue,de)=>{ue.storeId==="config-store"&&localStorage.setItem("svg-editor-config",JSON.stringify(de))});const re=vue.ref(numberArray(20)),oe=vue.ref(["MQTT"]),Ce=vue.ref();Ce.value=()=>{var de,Ne;let ue={type:EEventType.Null,action:EEventAction.Null,target:"",scripts:"",condition:{type:EConditionType.None}};(Ne=(de=r.handle_svg_info)==null?void 0:de.info)==null||Ne.events.push(ue)};const ie=(ue,de)=>{ue==="ChangeAttr"?de.attrs=[{key:"",val:""}]:delete de.attrs},ae=ue=>{var de,Ne;(Ne=(de=r.handle_svg_info)==null?void 0:de.info)==null||Ne.events.splice(ue,1)},le=()=>{g.center_offset={x:0,y:0}},Ie=(ue,de,Ne)=>{vue.nextTick(function(){if(r.handle_svg_info){const he=r.done_json[r.handle_svg_info.index];Ne?setSvgActualInfo(he,Ne):setSvgActualInfo(he),moveAnchors(he)}})};return(ue,de)=>vue.unref(r).intention!=vue.unref(EGlobalStoreIntention).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElTabs),{key:0,class:"mx-2 rightTabs",modelValue:vue.unref(V),"onUpdate:modelValue":de[13]||(de[13]=Ne=>vue.isRef(V)?V.value=Ne:null)},{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":de[0]||(de[0]=Ne=>vue.unref(n).svg.background_color=Ne)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"画布",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{size:"small",onClick:le,icon:vue.unref(aim_default)},{default:vue.withCtx(()=>[vue.createTextVNode("重置位置")]),_:1},8,["icon"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"X轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(g).center_offset.x,"onUpdate:modelValue":de[1]||(de[1]=Ne=>vue.unref(g).center_offset.x=Ne)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"Y轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(g).center_offset.y,"onUpdate:modelValue":de[2]||(de[2]=Ne=>vue.unref(g).center_offset.y=Ne)},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":de[3]||(de[3]=Ne=>vue.unref(n).svg.scale=Ne),step:.1,"step-strictly":""},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":de[4]||(de[4]=Ne=>vue.unref(n).svg.ruler=Ne)},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":de[5]||(de[5]=Ne=>vue.unref(n).svg.grid=Ne)},null,8,["modelValue"])]),_:1}),vue.unref(n).svg.grid?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"网格颜色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElColorPicker),{modelValue:vue.unref(n).svg.grid_color,"onUpdate:modelValue":de[6]||(de[6]=Ne=>vue.unref(n).svg.grid_color=Ne)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_: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(vue.unref(ElFormItem),{label:vue.unref(n).connection_line.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(n).connection_line.animations.type.val,"onUpdate:modelValue":de[7]||(de[7]=Ne=>vue.unref(n).connection_line.animations.type.val=Ne),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(n).connection_line.animations.type.options,Ne=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:Ne.value,label:Ne.label,value:Ne.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),vue.unref(n).connection_line.animations.type.val!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:0,"obj-info":vue.unref(n).connection_line.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0)]),_:1})):vue.createCommentVNode("",!0)]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"通信",name:"net"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapse),{modelValue:vue.unref(oe),"onUpdate:modelValue":de[12]||(de[12]=Ne=>vue.isRef(oe)?oe.value=Ne:null)},{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":de[8]||(de[8]=Ne=>vue.unref(n).net.mqtt.url=Ne),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":de[9]||(de[9]=Ne=>vue.unref(n).net.mqtt.user=Ne),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":de[10]||(de[10]=Ne=>vue.unref(n).net.mqtt.pwd=Ne),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":de[11]||(de[11]=Ne=>vue.unref(n).net.mqtt.topics=Ne),placeholder:"topics"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$9)]),_: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:vue.unref(k),"onUpdate:modelValue":de[34]||(de[34]=Ne=>vue.isRef(k)?k.value=Ne:null)},{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(()=>{var Ne,he,ze,pe;return[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":de[14]||(de[14]=Ve=>vue.unref(r).handle_svg_info.info.title=Ve)},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":de[15]||(de[15]=Ve=>vue.unref(r).handle_svg_info.info.x=Ve),onChange: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":de[16]||(de[16]=Ve=>vue.unref(r).handle_svg_info.info.y=Ve),onChange:Ie},null,8,["modelValue"])]),_:1}),vue.withDirectives(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.scale_x,"onUpdate:modelValue":de[17]||(de[17]=Ve=>vue.unref(r).handle_svg_info.info.scale_x=Ve),onChange:Ie},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(he=(Ne=vue.unref(r).handle_svg_info)==null?void 0:Ne.info)==null?void 0:he.config.can_zoom]]),vue.withDirectives(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.scale_y,"onUpdate:modelValue":de[18]||(de[18]=Ve=>vue.unref(r).handle_svg_info.info.scale_y=Ve),onChange:Ie},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(pe=(ze=vue.unref(r).handle_svg_info)==null?void 0:ze.info)==null?void 0:pe.config.can_zoom]]),vue.createVNode(vue.unref(ElFormItem),{label:"旋转",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(r).handle_svg_info.info.rotate,"onUpdate:modelValue":de[19]||(de[19]=Ve=>vue.unref(r).handle_svg_info.info.rotate=Ve),onChange: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":de[20]||(de[20]=Ve=>vue.unref(r).handle_svg_info.info.display=Ve)},null,8,["modelValue"])]),_:1})]}),_:1})]),_: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 Ne,he,ze,pe,Ve,Oe,_e,At;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":de[21]||(de[21]=$e=>vue.unref(r).handle_svg_info.info.id=$e)},null,8,["modelValue"])]),_:1}),(he=(Ne=vue.unref(r).handle_svg_info)==null?void 0:Ne.info)!=null&&he.state?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,class:"props-row",label:"state",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(r).handle_svg_info.info.defaultState),1)]),_:1})):vue.createCommentVNode("",!0),(pe=(ze=vue.unref(r).handle_svg_info)==null?void 0:ze.info)!=null&&pe.state?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"状态",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.defaultState,"onUpdate:modelValue":de[22]||(de[22]=$e=>vue.unref(r).handle_svg_info.info.defaultState=$e),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).handle_svg_info.info.state,($e,Fe)=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:"state"+String(Fe),label:$e.label,value:Fe},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),(Ve=vue.unref(r).handle_svg_info.info)!=null&&Ve.hasOwnProperty("tag_slot")?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$2,[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":de[23]||(de[23]=$e=>vue.unref(r).handle_svg_info.info.tag_slot=$e),onInput:de[24]||(de[24]=$e=>Ie($e,null,!0))},null,8,["modelValue"])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).handle_svg_info.info.props,code:"",onChange:de[25]||(de[25]=$e=>Ie($e,null,!0))},null,8,["obj-info"]),vue.unref(r).handle_svg_info.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:vue.unref(r).handle_svg_info.info.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.animations.type.val,"onUpdate:modelValue":de[26]||(de[26]=$e=>vue.unref(r).handle_svg_info.info.animations.type.val=$e),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).handle_svg_info.info.animations.type.options,$e=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:$e.value,label:$e.label,value:$e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"])):vue.createCommentVNode("",!0),((Oe=vue.unref(r).handle_svg_info.info.animations)==null?void 0:Oe.type.val)!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:4,"obj-info":vue.unref(r).handle_svg_info.info.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0),((_e=vue.unref(r).handle_svg_info)==null?void 0:_e.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:5,modelValue:vue.unref(r).handle_svg_info.info.bind_anchors.start,"onUpdate:modelValue":de[27]||(de[27]=$e=>vue.unref(r).handle_svg_info.info.bind_anchors.start=$e),title:"绑定起点"},null,8,["modelValue"])):vue.createCommentVNode("",!0),((At=vue.unref(r).handle_svg_info)==null?void 0:At.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:6,modelValue:vue.unref(r).handle_svg_info.info.bind_anchors.end,"onUpdate:modelValue":de[28]||(de[28]=$e=>vue.unref(r).handle_svg_info.info.bind_anchors.end=$e),title:"绑定终点"},null,8,["modelValue"])):vue.createCommentVNode("",!0)]}),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"事件",name:"event"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{type:"primary",style:{width:"100%"},onClick:vue.unref(Ce)},{default:vue.withCtx(()=>[vue.createTextVNode("添加事件")]),_:1},8,["onClick"]),vue.createVNode(vue.unref(ElCollapse),{modelValue:vue.unref(re),"onUpdate:modelValue":de[29]||(de[29]=Ne=>vue.isRef(re)?re.value=Ne:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).handle_svg_info.info.events,(Ne,he)=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:he,key:"event"+he},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$2,[vue.createElementVNode("span",null,"事件"+vue.toDisplayString(he+1),1),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:vue.withModifiers(ze=>ae(he),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{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:Ne.type,"onUpdate:modelValue":ze=>Ne.type=ze},{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:Ne.action,"onUpdate:modelValue":ze=>Ne.action=ze,onChange:ze=>ie(ze,Ne)},{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),Ne.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"目标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:Ne.target,"onUpdate:modelValue":ze=>Ne.target=ze,placeholder:"默认自身"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),Ne.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(List,{key:1,modelValue:Ne.attrs,"onUpdate:modelValue":ze=>Ne.attrs=ze},null,8,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),Ne.action==="JavaScript"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"JavaScript",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$c,{modelValue:Ne.scripts,"onUpdate:modelValue":ze=>Ne.scripts=ze,lang:"javascript"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),vue.createVNode(Condition,{modelValue:Ne.condition,"onUpdate:modelValue":ze=>Ne.condition=ze},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 Ne;return[(Ne=vue.unref(r).handle_svg_info)!=null&&Ne.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:de[30]||(de[30]=he=>{var ze;return $((ze=vue.unref(r).handle_svg_info)==null?void 0:ze.info,he)}),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":de[31]||(de[31]=he=>vue.unref(r).handle_svg_info.info.common_animations.delay=he)},{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":de[32]||(de[32]=he=>vue.unref(r).handle_svg_info.info.common_animations.speed=he)},{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":de[33]||(de[33]=he=>vue.unref(r).handle_svg_info.info.common_animations.repeat=he)},{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:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$9)]),_:1})]),_:1},8,["modelValue"])):vue.createCommentVNode("",!0)}}),rightPanel_vue_vue_type_style_index_0_scoped_9b4c5da1_lang="",rightPanel_vue_vue_type_style_index_1_lang="",RightPanel=_export_sfc(_sfc_main$5,[["__scopeId","data-v-9b4c5da1"]]),_sfc_main$4=vue.defineComponent({__name:"export-json",setup(i){const n=vue.ref(""),r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),V=useConfigStore(pinia);return vue.onMounted(()=>{const k={layout_center:g.center_offset,config:V.$state,done_json:r.done_json};n.value=JSON.stringify(k,null,2)}),(k,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(n),"onUpdate:value":$[0]||($[0]=re=>vue.isRef(n)?n.value=re:null),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:"import-json",setup(i,{expose:n}){const r=vue.ref("");return n({setVal:k=>{r.value=k},onImportJson:()=>{useImportDataModel(r.value)&&ElMessage.success("导入成功")}}),(k,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(r),"onUpdate:value":$[0]||($[0]=re=>vue.isRef(r)?r.value=re:null),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_hoisted_1$2=["onMousedown"],_hoisted_2$1=["onMousedown"],_hoisted_3$1=["title","onMousedown"],_hoisted_4$1={class:"vue-ruler-content-mask"},_sfc_main$2=vue.defineComponent({__name:"vue3-ruler-tool",props:{visible:{type:Boolean,default:!0},stepLength:{default:100}},emits:["onLineMouseUp"],setup(i,{emit:n}){const r=i,g=useSvgEditLayoutStore(pinia),V=useConfigStore(pinia),k=function(){return function(Ai,Ii,ai){Ai&&Ii&&ai&&Ai.addEventListener(Ii,ai,!1)}}(),$=function(){return function(Ai,Ii,ai){Ai&&Ii&&Ai.removeEventListener(Ii,ai,!1)}}();let re=18,oe=vue.ref(0),Ce=vue.ref(0),ie=vue.ref([]),ae=vue.ref([]);const le=vue.ref([]);let Ie=vue.ref(!1),ue="",de=vue.ref(-999),Ne=vue.ref(-999),he=18,ze=18,pe="";const Ve=vue.ref(null),Oe=vue.ref(null),_e=vue.ref(null),At=vue.ref(null),$e=vue.computed(()=>({width:oe.value+"px",height:Ce.value+"px"})),Fe=vue.computed(()=>({padding:re+"px 0px 0px "+re+"px"})),Ue=vue.computed(()=>{let Ai=0,Ii=0;return le.value.map(ai=>{const pi=ai.type==="h";return{id:`${ai.type}_${pi?Ai++:Ii++}`,type:ai.type,title:ai.site.toFixed(0)+"px",[pi?"top":"left"]:ai.site*V.svg.scale+re+g.center_offset[pi?"y":"x"]*V.svg.scale}})});g.$subscribe(Ai=>{var Ii,ai,pi,Ni;((ai=(Ii=Ai.events)==null?void 0:Ii.target)!=null&&ai.hasOwnProperty("left_nav")||(Ni=(pi=Ai.events)==null?void 0:pi.target)!=null&&Ni.hasOwnProperty("right_nav"))&&window.setTimeout(xe,420)}),V.$subscribe(Ai=>{var Ii,ai;(ai=(Ii=Ai.events)==null?void 0:Ii.target)!=null&&ai.hasOwnProperty("scale")&&Pt()}),vue.onMounted(()=>{k(document,"mousemove",ei),k(document,"mouseup",ri),xe(),k(window,"resize",Dt)}),vue.onBeforeUnmount(()=>{$(document,"mousemove",ei),$(document,"mouseup",ri),$(window,"resize",Dt)});const xe=()=>{jt(),Pt()},Dt=()=>{ie.value=[],ae.value=[],xe()},qe=({type:Ai,top:Ii,left:ai})=>Ai==="h"?{top:Ii+"px"}:{left:ai+"px"},kt=({type:Ai,id:Ii})=>Ai==="h"?yi(Ii):Mi(Ii),jt=()=>{const Ai=window.getComputedStyle(Oe.value.parentNode,null);oe.value=parseInt(Ai.getPropertyValue("width")),Ce.value=parseInt(Ai.getPropertyValue("height")),he=_e.value.clientWidth,ze=At.value.clientHeight},Pt=()=>{ti(ie.value,oe.value,g.center_offset.x),ti(ae.value,Ce.value,g.center_offset.y)},ti=(Ai,Ii,ai)=>{if(Ai.length===0)for(let pi=0;pi<Ii;pi+=r.stepLength)pi%r.stepLength===0&&Ai.push({id:Number((pi/V.svg.scale-ai).toFixed(0))});else Ai.forEach((pi,Ni)=>{pi.id=Number((Ni*r.stepLength/V.svg.scale-ai).toFixed(0))})},ei=Ai=>{Pt(),Et(Ai)},Et=Ai=>{if(!(Ai.layerX===Ai.x||Ai.layerY===Ai.y))switch(ue){case"x":Ie.value&&(Ne.value=Ai.layerY);break;case"y":Ie.value&&(de.value=Ai.layerX);break;case"h":Ie.value&&(Ne.value=Ai.layerY);break;case"v":Ie.value&&(de.value=Ai.layerX);break}},ni=Ai=>{Ie.value=!0,ue=Ai},ri=Ai=>{ci(Ai)},ci=Ai=>{if(Ie.value){switch(Ie.value=!1,ue){case"x":const Ii=Math.round((Ai.layerY-re)/V.svg.scale-g.center_offset.y);if(Ii<=0){Ne.value=-999;return}le.value.push({type:"h",site:Ii});break;case"y":const ai=Math.round((Ai.layerX-re)/V.svg.scale-g.center_offset.x);if(ai<=0){de.value=-999;return}le.value.push({type:"v",site:ai});break;case"h":Ci(le.value,Math.round((Ai.layerY-re)/V.svg.scale-g.center_offset.y),Math.round(ze/V.svg.scale-g.center_offset.y),"h");break;case"v":Ci(le.value,Math.round((Ai.layerX-re)/V.svg.scale-g.center_offset.x),Math.round(he/V.svg.scale-g.center_offset.x),"v");break}Ne.value=de.value=-999}},Ci=(Ai,Ii,ai,pi)=>{if(Ii<ai){let Ni;Ue.value.forEach((di,fi)=>{di.id===pe&&(Ni=fi)}),Ai.splice(Ni,1)}else{let Ni;Ue.value.forEach((di,fi)=>{di.id===pe&&(Ni=fi)}),Ai.splice(Ni,1,{type:pi,site:Ii})}},li=()=>{ni("x")},ui=()=>{ni("y")},yi=Ai=>{Ie.value=!0,ue="h",pe=Ai},Mi=Ai=>{Ie.value=!0,ue="v",pe=Ai},zi=()=>{n("onLineMouseUp")};return(Ai,Ii)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(vue.unref($e)),class:"vue-ruler-wrapper",onselectStart:"return false;",ref_key:"el",ref:Oe},[vue.withDirectives(vue.createElementVNode("section",null,[vue.createElementVNode("div",{ref_key:"horizontalRuler",ref:At,class:"vue-ruler-h",onMousedown:vue.withModifiers(li,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ie),(ai,pi)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({left:pi*Ai.stepLength+"px"}),class:"n"},vue.toDisplayString(ai.id),5))),256))],40,_hoisted_1$2),vue.createElementVNode("div",{ref_key:"verticalRuler",ref:_e,class:"vue-ruler-v",onMousedown:vue.withModifiers(ui,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ae),(ai,pi)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({top:pi*Ai.stepLength+"px"}),class:"n"},vue.toDisplayString(ai.id),5))),256))],40,_hoisted_2$1),vue.createElementVNode("div",{style:vue.normalizeStyle({top:vue.unref(Ne)+"px"}),class:"vue-ruler-ref-dot-h"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(Ne)-vue.unref(ze))/vue.unref(V).svg.scale)),1)],4),vue.createElementVNode("div",{style:vue.normalizeStyle({left:vue.unref(de)+"px"}),class:"vue-ruler-ref-dot-v"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(de)-vue.unref(he))/vue.unref(V).svg.scale)),1)],4),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(Ue),ai=>(vue.openBlock(),vue.createElementBlock("div",{title:ai.title,style:vue.normalizeStyle(qe(ai)),key:ai.id,class:vue.normalizeClass(`vue-ruler-ref-line-${ai.type}`),onMousedown:pi=>kt(ai),onMouseup:zi,onContextmenu:Ii[0]||(Ii[0]=(...pi)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...pi))},null,46,_hoisted_3$1))),128))],512),[[vue.vShow,r.visible]]),vue.createElementVNode("div",{ref_key:"content",ref:Ve,class:"vue-ruler-content",style:vue.normalizeStyle(vue.unref(Fe))},[vue.renderSlot(Ai.$slots,"default")],4),vue.withDirectives(vue.createElementVNode("div",_hoisted_4$1,null,512),[[vue.vShow,vue.unref(Ie)]])],4))}}),vue3RulerTool_vue_vue_type_style_index_0_lang="";function fileWrite(i,n=new Date(Date.now()).toLocaleString()){const r=JSON.stringify(i),g=new Blob([r]);let V=document.createElement("a");V.download=n+".json",V.style.display="none",V.href=URL.createObjectURL(g),document.body.appendChild(V),V.click(),document.body.removeChild(V)}function fileRead(i){return new Promise((n,r)=>{let g=new FileReader;g.readAsText(i,"UTF-8"),g.onload=function(V){V&&V.target?n(V.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,V=useGlobalStore(pinia),k=useSvgEditLayoutStore(pinia),$=useConfigStore(pinia),re=useEditPrivateStore(pinia),oe=vue.ref(),Ce=vue.ref(),ie=vue.reactive({[EVisibleConfKey.ExportJson]:!1,[EVisibleConfKey.ImportJson]:!1,[EVisibleConfKey.ImportFile]:!1}),ae=(pe,Ve)=>{ie[pe]=Ve},le=vue.ref();le.value=()=>{Ce.value.onImportJson(),ae(EVisibleConfKey.ImportJson,!1)};const Ie=pe=>["text/plain","application/json"].indexOf(pe.type)<0?(ElMessage.error("仅支持的格式:txt、json"),!1):(fileRead(pe).then(Ve=>{Ce.value.setVal(Ve),ElMessage.success("文件读取成功!")}),!1),ue=pe=>{V.setDoneJson(pe)};vue.onMounted(()=>{re.history_doneComponent=[],re.history_now_index=0,g.data?useImportDataModel(g.data):V.setDoneJson([]),V.intention=EGlobalStoreIntention.None});const{appContext:de}=vue.getCurrentInstance();function Ne(pe){r("onReturn",{data:pe,isChange:re.getTopBtnUndoStatus})}function he(pe){g.saveFile?ElMessageBox.prompt("请输入文件名","保存",{cancelButtonText:"取消",confirmButtonText:"保存"},de).then(Ve=>{fileWrite(pe,Ve.value.trim()),r("onSave",pe)}).catch(Ve=>{console.log(Ve)}):r("onSave",pe)}function ze(){oe.value.onCanvasMouseUp()}return n({setGraphNodeJson:ue}),(pe,Ve)=>(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:Ne,onOnPreview:Ve[0]||(Ve[0]=Oe=>r("onPreview",Oe)),onOnSave:he})]),_:1}),vue.createVNode(vue.unref(ElContainer),{class:"middle"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(k).left_nav?"show-nav":"hide-nav"]),style:{"border-right":"1px solid #efefef"}},{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(_sfc_main$2,{class:"canvas-main-pc",visible:vue.unref($).svg.ruler,onOnLineMouseUp:ze},{default:vue.withCtx(()=>[vue.createVNode(CenterPanel,{ref_key:"centerRef",ref:oe},null,512)]),_:1},8,["visible"])])]),_:1}),vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(k).right_nav?"show-nav":"hide-nav"]),style:{"border-left":"1px solid #efefef"}},{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:vue.unref(ie).ImportJson,"onUpdate:modelValue":Ve[2]||(Ve[2]=Oe=>vue.unref(ie).ImportJson=Oe),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:Ve[1]||(Ve[1]=Oe=>ae(vue.unref(EVisibleConfKey).ImportFile,!0))},{default:vue.withCtx(()=>[vue.createTextVNode("读取文件")]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{type:"primary",onClick:vue.unref(le)},{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:vue.unref(ie).ExportJson,"onUpdate:modelValue":Ve[3]||(Ve[3]=Oe=>vue.unref(ie).ExportJson=Oe),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_f4b63109_lang="",index=_export_sfc(_sfc_main$1,[["__scopeId","data-v-f4b63109"]]);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,V,k){function $(Ce,ie){if(!V[Ce]){if(!g[Ce]){var ae=typeof commonjsRequire=="function"&&commonjsRequire;if(!ie&&ae)return ae(Ce,!0);if(re)return re(Ce,!0);var le=new Error("Cannot find module '"+Ce+"'");throw le.code="MODULE_NOT_FOUND",le}var Ie=V[Ce]={exports:{}};g[Ce][0].call(Ie.exports,function(ue){var de=g[Ce][1][ue];return $(de||ue)},Ie,Ie.exports,r,g,V,k)}return V[Ce].exports}for(var re=typeof commonjsRequire=="function"&&commonjsRequire,oe=0;oe<k.length;oe++)$(k[oe]);return $}return r}()({1:[function(r,g,V){(function(k,$){(function(){const re=r("events").EventEmitter,oe=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"),ze=r("xtend"),pe=r("debug")("mqttjs:client"),Ve=k?k.nextTick:function(ei){setTimeout(ei,0)},Oe=$.setImmediate||function(ei){Ve(ei)},_e={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0},At=["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 Fe(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function Ue(ei,Et){if(ei.options.protocolVersion===5&&Et.cmd==="publish"){let ni;Et.properties&&(ni=Et.properties.topicAlias);const ri=Et.topic.toString();if(ei.topicAliasSend)if(ni){if(ri.length!==0&&(pe("applyTopicAlias :: register topic: %s - alias: %d",ri,ni),!ei.topicAliasSend.put(ri,ni)))return pe("applyTopicAlias :: error out of range. topic: %s - alias: %d",ri,ni),new Error("Sending Topic Alias out of range")}else ri.length!==0&&(ei.options.autoAssignTopicAlias?(ni=ei.topicAliasSend.getAliasByTopic(ri),ni?(Et.topic="",Et.properties={...Et.properties,topicAlias:ni},pe("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",ri,ni)):(ni=ei.topicAliasSend.getLruAlias(),ei.topicAliasSend.put(ri,ni),Et.properties={...Et.properties,topicAlias:ni},pe("applyTopicAlias :: auto assign topic: %s - alias: %d",ri,ni))):ei.options.autoUseTopicAlias&&(ni=ei.topicAliasSend.getAliasByTopic(ri),ni&&(Et.topic="",Et.properties={...Et.properties,topicAlias:ni},pe("applyTopicAlias :: auto use topic: %s - alias: %d",ri,ni))));else if(ni)return pe("applyTopicAlias :: error out of range. topic: %s - alias: %d",ri,ni),new Error("Sending Topic Alias out of range")}}function xe(ei,Et){let ni;Et.properties&&(ni=Et.properties.topicAlias);let ri=Et.topic.toString();if(ri.length===0){if(typeof ni>"u")return new Error("Unregistered Topic Alias");if(ri=ei.topicAliasSend.getTopicByAlias(ni),typeof ri>"u")return new Error("Unregistered Topic Alias");Et.topic=ri}ni&&delete Et.properties.topicAlias}function Dt(ei,Et,ni){pe("sendPacket :: packet: %O",Et),pe("sendPacket :: emitting `packetsend`"),ei.emit("packetsend",Et),pe("sendPacket :: writing to stream");const ri=ae.writeToStream(Et,ei.stream,ei.options);pe("sendPacket :: writeToStream result %s",ri),!ri&&ni&&ni!==Pt?(pe("sendPacket :: handle events on `drain` once through callback."),ei.stream.once("drain",ni)):ni&&(pe("sendPacket :: invoking cb"),ni())}function qe(ei){ei&&(pe("flush: queue exists? %b",!!ei),Object.keys(ei).forEach(function(Et){typeof ei[Et].cb=="function"&&(ei[Et].cb(new Error("Connection closed")),delete ei[Et])}))}function kt(ei){ei&&(pe("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(ei).forEach(function(Et){ei[Et].volatile&&typeof ei[Et].cb=="function"&&(ei[Et].cb(new Error("Connection closed")),delete ei[Et])}))}function jt(ei,Et,ni,ri){pe("storeAndSend :: store packet with cmd %s to outgoingStore",Et.cmd);let ci=Et,Ci;if(ci.cmd==="publish"&&(ci=Ne(Et),Ci=xe(ei,ci),Ci))return ni&&ni(Ci);ei.outgoingStore.put(ci,function(ui){if(ui)return ni&&ni(ui);ri(),Dt(ei,Et,ni)})}function Pt(ei){pe("nop ::",ei)}function ti(ei,Et){let ni;const ri=this;if(!(this instanceof ti))return new ti(ei,Et);this.options=Et||{};for(ni in _e)typeof this.options[ni]>"u"?this.options[ni]=_e[ni]:this.options[ni]=Et[ni];pe("MqttClient :: options.protocol",Et.protocol),pe("MqttClient :: options.protocolVersion",Et.protocolVersion),pe("MqttClient :: options.username",Et.username),pe("MqttClient :: options.keepalive",Et.keepalive),pe("MqttClient :: options.reconnectPeriod",Et.reconnectPeriod),pe("MqttClient :: options.rejectUnauthorized",Et.rejectUnauthorized),pe("MqttClient :: options.topicAliasMaximum",Et.topicAliasMaximum),this.options.clientId=typeof Et.clientId=="string"?Et.clientId:Fe(),pe("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=Et.protocolVersion===5&&Et.customHandleAcks?Et.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=ei,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new le:this.options.messageIdProvider,this.outgoingStore=Et.outgoingStore||new oe,this.incomingStore=Et.incomingStore||new oe,this.queueQoSZero=Et.queueQoSZero===void 0?!0:Et.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,Et.topicAliasMaximum>0&&(Et.topicAliasMaximum>65535?pe("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new Ce(Et.topicAliasMaximum)),this.on("connect",function(){const ci=this.queue;function Ci(){const li=ci.shift();pe("deliver :: entry %o",li);let ui=null;if(!li){ri._resubscribe();return}ui=li.packet,pe("deliver :: call _sendPacket for %o",ui);let yi=!0;ui.messageId&&ui.messageId!==0&&(ri.messageIdProvider.register(ui.messageId)||(yi=!1)),yi?ri._sendPacket(ui,function(Mi){li.cb&&li.cb(Mi),Ci()}):(pe("messageId: %d has already used. The message is skipped and removed.",ui.messageId),Ci())}pe("connect :: sending queued packets"),Ci()}),this.on("close",function(){pe("close :: connected set to `false`"),this.connected=!1,pe("close :: clearing connackTimer"),clearTimeout(this.connackTimer),pe("close :: clearing ping timer"),ri.pingTimer!==null&&(ri.pingTimer.clear(),ri.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),pe("close :: calling _setupReconnect"),this._setupReconnect()}),re.call(this),pe("MqttClient :: setting up stream"),this._setupStream()}ue(ti,re),ti.prototype._setupStream=function(){const ei=this,Et=new Ie,ni=ae.parser(this.options);let ri=null;const ci=[];pe("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),pe("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),ni.on("packet",function(Mi){pe("parser :: on packet push to packets array."),ci.push(Mi)});function Ci(){if(ci.length)Ve(li);else{const Mi=ri;ri=null,Mi()}}function li(){pe("work :: getting next packet in queue");const Mi=ci.shift();if(Mi)pe("work :: packet pulled from queue"),ei._handlePacket(Mi,Ci);else{pe("work :: no packets in queue");const zi=ri;ri=null,pe("work :: done flag is %s",!!zi),zi&&zi()}}Et._write=function(Mi,zi,Ai){ri=Ai,pe("writable stream :: parsing buffer"),ni.parse(Mi),li()};function ui(Mi){pe("streamErrorHandler :: error",Mi.message),At.includes(Mi.code)?(pe("streamErrorHandler :: emitting error"),ei.emit("error",Mi)):Pt(Mi)}pe("_setupStream :: pipe stream to writable stream"),this.stream.pipe(Et),this.stream.on("error",ui),this.stream.on("close",function(){pe("(%s)stream :: on close",ei.options.clientId),kt(ei.outgoing),pe("stream: emit close to MqttClient"),ei.emit("close")}),pe("_setupStream: sending packet `connect`");const yi=Object.create(this.options);if(yi.cmd="connect",this.topicAliasRecv&&(yi.properties||(yi.properties={}),this.topicAliasRecv&&(yi.properties.topicAliasMaximum=this.topicAliasRecv.max)),Dt(this,yi),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 Mi=ze({cmd:"auth",reasonCode:0},this.options.authPacket);Dt(this,Mi)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){pe("!!connectTimeout hit!! Calling _cleanUp with force `true`"),ei._cleanUp(!0)},this.options.connectTimeout)},ti.prototype._handlePacket=function(ei,Et){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(pe("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",ei),ei.cmd){case"publish":this._handlePublish(ei,Et);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(ei),Et();break;case"pubrel":this._handlePubrel(ei,Et);break;case"connack":this._handleConnack(ei),Et();break;case"auth":this._handleAuth(ei),Et();break;case"pingresp":this._handlePingresp(ei),Et();break;case"disconnect":this._handleDisconnect(ei),Et();break}},ti.prototype._checkDisconnecting=function(ei){return this.disconnecting&&(ei&&ei!==Pt?ei(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},ti.prototype.publish=function(ei,Et,ni,ri){pe("publish :: message `%s` to topic `%s`",Et,ei);const ci=this.options;if(typeof ni=="function"&&(ri=ni,ni=null),ni=ze({qos:0,retain:!1,dup:!1},ni),this._checkDisconnecting(ri))return this;const li=this,ui=function(){let yi=0;if((ni.qos===1||ni.qos===2)&&(yi=li._nextId(),yi===null))return pe("No messageId left"),!1;const Mi={cmd:"publish",topic:ei,payload:Et,qos:ni.qos,retain:ni.retain,messageId:yi,dup:ni.dup};switch(ci.protocolVersion===5&&(Mi.properties=ni.properties),pe("publish :: qos",ni.qos),ni.qos){case 1:case 2:li.outgoing[Mi.messageId]={volatile:!1,cb:ri||Pt},pe("MqttClient:publish: packet cmd: %s",Mi.cmd),li._sendPacket(Mi,void 0,ni.cbStorePut);break;default:pe("MqttClient:publish: packet cmd: %s",Mi.cmd),li._sendPacket(Mi,ri,ni.cbStorePut);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ui())&&this._storeProcessingQueue.push({invoke:ui,cbStorePut:ni.cbStorePut,callback:ri}),this},ti.prototype.subscribe=function(){const ei=this,Et=new Array(arguments.length);for(let Ai=0;Ai<arguments.length;Ai++)Et[Ai]=arguments[Ai];const ni=[];let ri=Et.shift();const ci=ri.resubscribe;let Ci=Et.pop()||Pt,li=Et.pop();const ui=this.options.protocolVersion;delete ri.resubscribe,typeof ri=="string"&&(ri=[ri]),typeof Ci!="function"&&(li=Ci,Ci=Pt);const yi=he.validateTopics(ri);if(yi!==null)return Oe(Ci,new Error("Invalid topic "+yi)),this;if(this._checkDisconnecting(Ci))return pe("subscribe: discconecting true"),this;const Mi={qos:0};if(ui===5&&(Mi.nl=!1,Mi.rap=!1,Mi.rh=0),li=ze(Mi,li),Array.isArray(ri)?ri.forEach(function(Ai){if(pe("subscribe: array topic %s",Ai),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,Ai)||ei._resubscribeTopics[Ai].qos<li.qos||ci){const Ii={topic:Ai,qos:li.qos};ui===5&&(Ii.nl=li.nl,Ii.rap=li.rap,Ii.rh=li.rh,Ii.properties=li.properties),pe("subscribe: pushing topic `%s` and qos `%s` to subs list",Ii.topic,Ii.qos),ni.push(Ii)}}):Object.keys(ri).forEach(function(Ai){if(pe("subscribe: object topic %s",Ai),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,Ai)||ei._resubscribeTopics[Ai].qos<ri[Ai].qos||ci){const Ii={topic:Ai,qos:ri[Ai].qos};ui===5&&(Ii.nl=ri[Ai].nl,Ii.rap=ri[Ai].rap,Ii.rh=ri[Ai].rh,Ii.properties=li.properties),pe("subscribe: pushing `%s` to subs list",Ii),ni.push(Ii)}}),!ni.length)return Ci(null,[]),this;const zi=function(){const Ai=ei._nextId();if(Ai===null)return pe("No messageId left"),!1;const Ii={cmd:"subscribe",subscriptions:ni,qos:1,retain:!1,dup:!1,messageId:Ai};if(li.properties&&(Ii.properties=li.properties),ei.options.resubscribe){pe("subscribe :: resubscribe true");const ai=[];ni.forEach(function(pi){if(ei.options.reconnectPeriod>0){const Ni={qos:pi.qos};ui===5&&(Ni.nl=pi.nl||!1,Ni.rap=pi.rap||!1,Ni.rh=pi.rh||0,Ni.properties=pi.properties),ei._resubscribeTopics[pi.topic]=Ni,ai.push(pi.topic)}}),ei.messageIdToTopic[Ii.messageId]=ai}return ei.outgoing[Ii.messageId]={volatile:!0,cb:function(ai,pi){if(!ai){const Ni=pi.granted;for(let di=0;di<Ni.length;di+=1)ni[di].qos=Ni[di]}Ci(ai,ni)}},pe("subscribe :: call _sendPacket"),ei._sendPacket(Ii),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!zi())&&this._storeProcessingQueue.push({invoke:zi,callback:Ci}),this},ti.prototype.unsubscribe=function(){const ei=this,Et=new Array(arguments.length);for(let ui=0;ui<arguments.length;ui++)Et[ui]=arguments[ui];let ni=Et.shift(),ri=Et.pop()||Pt,ci=Et.pop();typeof ni=="string"&&(ni=[ni]),typeof ri!="function"&&(ci=ri,ri=Pt);const Ci=he.validateTopics(ni);if(Ci!==null)return Oe(ri,new Error("Invalid topic "+Ci)),this;if(ei._checkDisconnecting(ri))return this;const li=function(){const ui=ei._nextId();if(ui===null)return pe("No messageId left"),!1;const yi={cmd:"unsubscribe",qos:1,messageId:ui};return typeof ni=="string"?yi.unsubscriptions=[ni]:Array.isArray(ni)&&(yi.unsubscriptions=ni),ei.options.resubscribe&&yi.unsubscriptions.forEach(function(Mi){delete ei._resubscribeTopics[Mi]}),typeof ci=="object"&&ci.properties&&(yi.properties=ci.properties),ei.outgoing[yi.messageId]={volatile:!0,cb:ri},pe("unsubscribe: call _sendPacket"),ei._sendPacket(yi),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!li())&&this._storeProcessingQueue.push({invoke:li,callback:ri}),this},ti.prototype.end=function(ei,Et,ni){const ri=this;pe("end :: (%s)",this.options.clientId),(ei==null||typeof ei!="boolean")&&(ni=Et||Pt,Et=ei,ei=!1,typeof Et!="object"&&(ni=Et,Et=null,typeof ni!="function"&&(ni=Pt))),typeof Et!="object"&&(ni=Et,Et=null),pe("end :: cb? %s",!!ni),ni=ni||Pt;function ci(){pe("end :: closeStores: closing incoming and outgoing stores"),ri.disconnected=!0,ri.incomingStore.close(function(li){ri.outgoingStore.close(function(ui){if(pe("end :: closeStores: emitting end"),ri.emit("end"),ni){const yi=li||ui;pe("end :: closeStores: invoking callback with args"),ni(yi)}})}),ri._deferredReconnect&&ri._deferredReconnect()}function Ci(){pe("end :: (%s) :: finish :: calling _cleanUp with force %s",ri.options.clientId,ei),ri._cleanUp(ei,()=>{pe("end :: finish :: calling process.nextTick on closeStores"),Ve(ci.bind(ri))},Et)}return this.disconnecting?(ni(),this):(this._clearReconnect(),this.disconnecting=!0,!ei&&Object.keys(this.outgoing).length>0?(pe("end :: (%s) :: calling finish in 10ms once outgoing is empty",ri.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,Ci,10))):(pe("end :: (%s) :: immediately calling finish",ri.options.clientId),Ci()),this)},ti.prototype.removeOutgoingMessage=function(ei){const Et=this.outgoing[ei]?this.outgoing[ei].cb:null;return delete this.outgoing[ei],this.outgoingStore.del({messageId:ei},function(){Et(new Error("Message removed"))}),this},ti.prototype.reconnect=function(ei){pe("client reconnect");const Et=this,ni=function(){ei?(Et.options.incomingStore=ei.incomingStore,Et.options.outgoingStore=ei.outgoingStore):(Et.options.incomingStore=null,Et.options.outgoingStore=null),Et.incomingStore=Et.options.incomingStore||new oe,Et.outgoingStore=Et.options.outgoingStore||new oe,Et.disconnecting=!1,Et.disconnected=!1,Et._deferredReconnect=null,Et._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=ni:ni(),this},ti.prototype._reconnect=function(){pe("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),pe("client already connected. disconnecting first.")):(pe("_reconnect: calling _setupStream"),this._setupStream())},ti.prototype._setupReconnect=function(){const ei=this;!ei.disconnecting&&!ei.reconnectTimer&&ei.options.reconnectPeriod>0?(this.reconnecting||(pe("_setupReconnect :: emit `offline` state"),this.emit("offline"),pe("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),pe("_setupReconnect :: setting reconnectTimer for %d ms",ei.options.reconnectPeriod),ei.reconnectTimer=setInterval(function(){pe("reconnectTimer :: reconnect triggered!"),ei._reconnect()},ei.options.reconnectPeriod)):pe("_setupReconnect :: doing nothing...")},ti.prototype._clearReconnect=function(){pe("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},ti.prototype._cleanUp=function(ei,Et){const ni=arguments[2];if(Et&&(pe("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",Et)),pe("_cleanUp :: forced? %s",ei),ei)this.options.reconnectPeriod===0&&this.options.clean&&qe(this.outgoing),pe("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const ri=ze({cmd:"disconnect"},ni);pe("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(ri,Oe.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(pe("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(pe("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),Et&&!this.connected&&(pe("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",Et),Et())},ti.prototype._sendPacket=function(ei,Et,ni){pe("_sendPacket :: (%s) :: start",this.options.clientId),ni=ni||Pt,Et=Et||Pt;const ri=Ue(this,ei);if(ri){Et(ri);return}if(!this.connected){if(ei.cmd==="auth"){this._shiftPingInterval(),Dt(this,ei,Et);return}pe("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(ei,Et,ni);return}switch(this._shiftPingInterval(),ei.cmd){case"publish":break;case"pubrel":jt(this,ei,Et,ni);return;default:Dt(this,ei,Et);return}switch(ei.qos){case 2:case 1:jt(this,ei,Et,ni);break;case 0:default:Dt(this,ei,Et);break}pe("_sendPacket :: (%s) :: end",this.options.clientId)},ti.prototype._storePacket=function(ei,Et,ni){pe("_storePacket :: packet: %o",ei),pe("_storePacket :: cb? %s",!!Et),ni=ni||Pt;let ri=ei;if(ri.cmd==="publish"){ri=Ne(ei);const ci=xe(this,ri);if(ci)return Et&&Et(ci)}(ri.qos||0)===0&&this.queueQoSZero||ri.cmd!=="publish"?this.queue.push({packet:ri,cb:Et}):ri.qos>0?(Et=this.outgoing[ri.messageId]?this.outgoing[ri.messageId].cb:null,this.outgoingStore.put(ri,function(ci){if(ci)return Et&&Et(ci);ni()})):Et&&Et(new Error("No connection to broker"))},ti.prototype._setupPingTimer=function(){pe("_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(){pe("_checkPing :: checking ping..."),this.pingResp?(pe("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(pe("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},ti.prototype._handlePingresp=function(){this.pingResp=!0},ti.prototype._handleConnack=function(ei){pe("_handleConnack");const Et=this.options,ri=Et.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&&Et.keepalive&&(Et.keepalive=ei.properties.serverKeepAlive,this._shiftPingInterval()),ei.properties.maximumPacketSize&&(Et.properties||(Et.properties={}),Et.properties.maximumPacketSize=ei.properties.maximumPacketSize)}if(ri===0)this.reconnecting=!1,this._onConnect(ei);else if(ri>0){const ci=new Error("Connection refused: "+$e[ri]);ci.code=ri,this.emit("error",ci)}},ti.prototype._handleAuth=function(ei){const ni=this.options.protocolVersion,ri=ni===5?ei.reasonCode:ei.returnCode;if(ni!==5){const Ci=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+ni);Ci.code=ri,this.emit("error",Ci);return}const ci=this;this.handleAuth(ei,function(Ci,li){if(Ci){ci.emit("error",Ci);return}if(ri===24)ci.reconnecting=!1,ci._sendPacket(li);else{const ui=new Error("Connection refused: "+$e[ri]);Ci.code=ri,ci.emit("error",ui)}})},ti.prototype.handleAuth=function(ei,Et){Et()},ti.prototype._handlePublish=function(ei,Et){pe("_handlePublish: packet %o",ei),Et=typeof Et<"u"?Et:Pt;let ni=ei.topic.toString();const ri=ei.payload,ci=ei.qos,Ci=ei.messageId,li=this,ui=this.options,yi=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){let Mi;if(ei.properties&&(Mi=ei.properties.topicAlias),typeof Mi<"u")if(ni.length===0)if(Mi>0&&Mi<=65535){const zi=this.topicAliasRecv.getTopicByAlias(Mi);if(zi)ni=zi,pe("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",ni,Mi);else{pe("_handlePublish :: unregistered topic alias. alias: %d",Mi),this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{pe("_handlePublish :: topic alias out of range. alias: %d",Mi),this.emit("error",new Error("Received Topic Alias is out of range"));return}else if(this.topicAliasRecv.put(ni,Mi))pe("_handlePublish :: registered topic: %s - alias: %d",ni,Mi);else{pe("_handlePublish :: topic alias out of range. alias: %d",Mi),this.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(pe("_handlePublish: qos %d",ci),ci){case 2:{ui.customHandleAcks(ni,ri,ei,function(Mi,zi){if(Mi instanceof Error||(zi=Mi,Mi=null),Mi)return li.emit("error",Mi);if(yi.indexOf(zi)===-1)return li.emit("error",new Error("Wrong reason code for pubrec"));zi?li._sendPacket({cmd:"pubrec",messageId:Ci,reasonCode:zi},Et):li.incomingStore.put(ei,function(){li._sendPacket({cmd:"pubrec",messageId:Ci},Et)})});break}case 1:{ui.customHandleAcks(ni,ri,ei,function(Mi,zi){if(Mi instanceof Error||(zi=Mi,Mi=null),Mi)return li.emit("error",Mi);if(yi.indexOf(zi)===-1)return li.emit("error",new Error("Wrong reason code for puback"));zi||li.emit("message",ni,ri,ei),li.handleMessage(ei,function(Ai){if(Ai)return Et&&Et(Ai);li._sendPacket({cmd:"puback",messageId:Ci,reasonCode:zi},Et)})});break}case 0:this.emit("message",ni,ri,ei),this.handleMessage(ei,Et);break;default:pe("_handlePublish: unknown QoS. Doing nothing.");break}},ti.prototype.handleMessage=function(ei,Et){Et()},ti.prototype._handleAck=function(ei){const Et=ei.messageId,ni=ei.cmd;let ri=null;const ci=this.outgoing[Et]?this.outgoing[Et].cb:null,Ci=this;let li;if(!ci){pe("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(pe("_handleAck :: packet type",ni),ni){case"pubcomp":case"puback":{const ui=ei.reasonCode;ui&&ui>0&&ui!==16&&(li=new Error("Publish error: "+$e[ui]),li.code=ui,ci(li,ei)),delete this.outgoing[Et],this.outgoingStore.del(ei,ci),this.messageIdProvider.deallocate(Et),this._invokeStoreProcessingQueue();break}case"pubrec":{ri={cmd:"pubrel",qos:2,messageId:Et};const ui=ei.reasonCode;ui&&ui>0&&ui!==16?(li=new Error("Publish error: "+$e[ui]),li.code=ui,ci(li,ei)):this._sendPacket(ri);break}case"suback":{delete this.outgoing[Et],this.messageIdProvider.deallocate(Et);for(let ui=0;ui<ei.granted.length;ui++)if(ei.granted[ui]&128){const yi=this.messageIdToTopic[Et];yi&&yi.forEach(function(Mi){delete Ci._resubscribeTopics[Mi]})}this._invokeStoreProcessingQueue(),ci(null,ei);break}case"unsuback":{delete this.outgoing[Et],this.messageIdProvider.deallocate(Et),this._invokeStoreProcessingQueue(),ci(null);break}default:Ci.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&Object.keys(this.outgoing).length===0&&this.emit("outgoingEmpty")},ti.prototype._handlePubrel=function(ei,Et){pe("handling pubrel packet"),Et=typeof Et<"u"?Et:Pt;const ni=ei.messageId,ri=this,ci={cmd:"pubcomp",messageId:ni};ri.incomingStore.get(ei,function(Ci,li){Ci?ri._sendPacket(ci,Et):(ri.emit("message",li.topic,li.payload,li),ri.handleMessage(li,function(ui){if(ui)return Et(ui);ri.incomingStore.del(li,Pt),ri._sendPacket(ci,Et)}))})},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(){pe("_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){pe("_resubscribe: protocolVersion 5");for(let Et=0;Et<ei.length;Et++){const ni={};ni[ei[Et]]=this._resubscribeTopics[ei[Et]],ni.resubscribe=!0,this.subscribe(ni,{properties:ni[ei[Et]].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 Et=this;this.connackPacket=ei,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;function ni(){let ri=Et.outgoingStore.createStream();function ci(){Et._storeProcessing=!1,Et._packetIdsDuringStoreProcessing={}}Et.once("close",Ci),ri.on("error",function(ui){ci(),Et._flushStoreProcessingQueue(),Et.removeListener("close",Ci),Et.emit("error",ui)});function Ci(){ri.destroy(),ri=null,Et._flushStoreProcessingQueue(),ci()}function li(){if(!ri)return;Et._storeProcessing=!0;const ui=ri.read(1);let yi;if(!ui){ri.once("readable",li);return}if(Et._packetIdsDuringStoreProcessing[ui.messageId]){li();return}!Et.disconnecting&&!Et.reconnectTimer?(yi=Et.outgoing[ui.messageId]?Et.outgoing[ui.messageId].cb:null,Et.outgoing[ui.messageId]={volatile:!1,cb:function(Mi,zi){yi&&yi(Mi,zi),li()}},Et._packetIdsDuringStoreProcessing[ui.messageId]=!0,Et.messageIdProvider.register(ui.messageId)?Et._sendPacket(ui):pe("messageId: %d has already used.",ui.messageId)):ri.destroy&&ri.destroy()}ri.on("end",function(){let ui=!0;for(const yi in Et._packetIdsDuringStoreProcessing)if(!Et._packetIdsDuringStoreProcessing[yi]){ui=!1;break}ui?(ci(),Et.removeListener("close",Ci),Et._invokeAllStoreProcessingQueue(),Et.emit("connect",ei)):ni()}),li()}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,V){const{Buffer:k}=r("buffer"),$=r("readable-stream").Transform,re=r("duplexify");let oe,Ce,ie,ae=!1;function le(){const he=new $;return he._write=function(ze,pe,Ve){oe.sendSocketMessage({data:ze.buffer,success:function(){Ve()},fail:function(){Ve(new Error)}})},he._flush=function(pe){oe.closeSocket({success:function(){pe()}})},he}function Ie(he){he.hostname||(he.hostname="localhost"),he.path||(he.path="/"),he.wsOptions||(he.wsOptions={})}function ue(he,ze){const pe=he.protocol==="alis"?"wss":"ws";let Ve=pe+"://"+he.hostname+he.path;return he.port&&he.port!==80&&he.port!==443&&(Ve=pe+"://"+he.hostname+":"+he.port+he.path),typeof he.transformWsUrl=="function"&&(Ve=he.transformWsUrl(Ve,he,ze)),Ve}function de(){ae||(ae=!0,oe.onSocketOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),oe.onSocketMessage(function(he){if(typeof he.data=="string"){const ze=k.from(he.data,"base64");Ce.push(ze)}else{const ze=new FileReader;ze.addEventListener("load",function(){let pe=ze.result;pe instanceof ArrayBuffer?pe=k.from(pe):pe=k.from(pe,"utf8"),Ce.push(pe)}),ze.readAsArrayBuffer(he.data)}}),oe.onSocketClose(function(){ie.end(),ie.destroy()}),oe.onSocketError(function(he){ie.destroy(he)}))}function Ne(he,ze){if(ze.hostname=ze.hostname||ze.host,!ze.hostname)throw new Error("Could not determine host. Specify host manually.");const pe=ze.protocolId==="MQIsdp"&&ze.protocolVersion===3?"mqttv3.1":"mqtt";Ie(ze);const Ve=ue(ze,he);return oe=ze.my,oe.connectSocket({url:Ve,protocols:pe}),Ce=le(),ie=re.obj(),de(),ie}g.exports=Ne},{buffer:17,duplexify:20,"readable-stream":69}],3:[function(r,g,V){const k=r("net"),$=r("debug")("mqttjs:tcp");function re(oe,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),k.createConnection(ie,ae)}g.exports=re},{debug:18,net:16}],4:[function(r,g,V){const k=r("tls"),$=r("net"),re=r("debug")("mqttjs:tls");function oe(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,re("port %d host %s rejectUnauthorized %b",ie.port,ie.host,ie.rejectUnauthorized);const ae=k.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=oe},{debug:18,net:16,tls:16}],5:[function(r,g,V){(function(k){(function(){const{Buffer:$}=r("buffer"),re=r("ws"),oe=r("debug")("mqttjs:ws"),Ce=r("duplexify"),ie=r("readable-stream").Transform,ae=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],le=typeof k<"u"&&k.title==="browser"||typeof __webpack_require__=="function";function Ie(Ve,Oe){let _e=Ve.protocol+"://"+Ve.hostname+":"+Ve.port+Ve.path;return typeof Ve.transformWsUrl=="function"&&(_e=Ve.transformWsUrl(_e,Ve,Oe)),_e}function ue(Ve){const Oe=Ve;return Ve.hostname||(Oe.hostname="localhost"),Ve.port||(Ve.protocol==="wss"?Oe.port=443:Oe.port=80),Ve.path||(Oe.path="/"),Ve.wsOptions||(Oe.wsOptions={}),!le&&Ve.protocol==="wss"&&ae.forEach(function(_e){Object.prototype.hasOwnProperty.call(Ve,_e)&&!Object.prototype.hasOwnProperty.call(Ve.wsOptions,_e)&&(Oe.wsOptions[_e]=Ve[_e])}),Oe}function de(Ve){const Oe=ue(Ve);if(Oe.hostname||(Oe.hostname=Oe.host),!Oe.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");const _e=new URL(document.URL);Oe.hostname=_e.hostname,Oe.port||(Oe.port=_e.port)}return Oe.objectMode===void 0&&(Oe.objectMode=!(Oe.binary===!0||Oe.binary===void 0)),Oe}function Ne(Ve,Oe,_e){oe("createWebSocket"),oe("protocol: "+_e.protocolId+" "+_e.protocolVersion);const At=_e.protocolId==="MQIsdp"&&_e.protocolVersion===3?"mqttv3.1":"mqtt";return oe("creating new Websocket for url: "+Oe+" and protocol: "+At),new re(Oe,[At],_e.wsOptions)}function he(Ve,Oe){const _e=Oe.protocolId==="MQIsdp"&&Oe.protocolVersion===3?"mqttv3.1":"mqtt",At=Ie(Oe,Ve),$e=new WebSocket(At,[_e]);return $e.binaryType="arraybuffer",$e}function ze(Ve,Oe){oe("streamBuilder");const _e=ue(Oe),At=Ie(_e,Ve),$e=Ne(Ve,At,_e),Fe=re.createWebSocketStream($e,_e.wsOptions);return Fe.url=At,$e.on("close",()=>{Fe.destroy()}),Fe}function pe(Ve,Oe){oe("browserStreamBuilder");let _e;const $e=de(Oe).browserBufferSize||1024*512,Fe=Oe.browserBufferTimeout||1e3,Ue=!Oe.objectMode,xe=he(Ve,Oe),Dt=kt(Oe,ni,ri);Oe.objectMode||(Dt._writev=Et),Dt.on("close",()=>{xe.close()});const qe=typeof xe.addEventListener<"u";xe.readyState===xe.OPEN?_e=Dt:(_e=_e=Ce(void 0,void 0,Oe),Oe.objectMode||(_e._writev=Et),qe?xe.addEventListener("open",jt):xe.onopen=jt),_e.socket=xe,qe?(xe.addEventListener("close",Pt),xe.addEventListener("error",ti),xe.addEventListener("message",ei)):(xe.onclose=Pt,xe.onerror=ti,xe.onmessage=ei);function kt(ci,Ci,li){const ui=new ie({objectModeMode:ci.objectMode});return ui._write=Ci,ui._flush=li,ui}function jt(){_e.setReadable(Dt),_e.setWritable(Dt),_e.emit("connect")}function Pt(){_e.end(),_e.destroy()}function ti(ci){_e.destroy(ci)}function ei(ci){let Ci=ci.data;Ci instanceof ArrayBuffer?Ci=$.from(Ci):Ci=$.from(Ci,"utf8"),Dt.push(Ci)}function Et(ci,Ci){const li=new Array(ci.length);for(let ui=0;ui<ci.length;ui++)typeof ci[ui].chunk=="string"?li[ui]=$.from(ci[ui],"utf8"):li[ui]=ci[ui].chunk;this._write($.concat(li),"binary",Ci)}function ni(ci,Ci,li){xe.bufferedAmount>$e&&setTimeout(ni,Fe,ci,Ci,li),Ue&&typeof ci=="string"&&(ci=$.from(ci,"utf8"));try{xe.send(ci)}catch(ui){return li(ui)}li()}function ri(ci){xe.close(),ci()}return _e}le?g.exports=pe:g.exports=ze}).call(this)}).call(this,r("_process"))},{_process:50,buffer:17,debug:18,duplexify:20,"readable-stream":69,ws:80}],6:[function(r,g,V){const{Buffer:k}=r("buffer"),$=r("readable-stream").Transform,re=r("duplexify");let oe,Ce,ie;function ae(){const Ne=new $;return Ne._write=function(he,ze,pe){oe.send({data:he.buffer,success:function(){pe()},fail:function(Ve){pe(new Error(Ve))}})},Ne._flush=function(ze){oe.close({success:function(){ze()}})},Ne}function le(Ne){Ne.hostname||(Ne.hostname="localhost"),Ne.path||(Ne.path="/"),Ne.wsOptions||(Ne.wsOptions={})}function Ie(Ne,he){const ze=Ne.protocol==="wxs"?"wss":"ws";let pe=ze+"://"+Ne.hostname+Ne.path;return Ne.port&&Ne.port!==80&&Ne.port!==443&&(pe=ze+"://"+Ne.hostname+":"+Ne.port+Ne.path),typeof Ne.transformWsUrl=="function"&&(pe=Ne.transformWsUrl(pe,Ne,he)),pe}function ue(){oe.onOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),oe.onMessage(function(Ne){let he=Ne.data;he instanceof ArrayBuffer?he=k.from(he):he=k.from(he,"utf8"),Ce.push(he)}),oe.onClose(function(){ie.end(),ie.destroy()}),oe.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 ze=he.protocolId==="MQIsdp"&&he.protocolVersion===3?"mqttv3.1":"mqtt";le(he);const pe=Ie(he,Ne);oe=wx.connectSocket({url:pe,protocols:[ze]}),Ce=ae(),ie=re.obj(),ie._destroy=function(Oe,_e){oe.close({success:function(){_e&&_e(Oe)}})};const Ve=ie.destroy;return ie.destroy=function(){ie.destroy=Ve;const Oe=this;setTimeout(function(){oe.close({fail:function(){Oe._destroy(new Error)}})},0)}.bind(ie),ue(),ie}g.exports=de},{buffer:17,duplexify:20,"readable-stream":69}],7:[function(r,g,V){function k(){if(!(this instanceof k))return new k;this.nextId=Math.max(1,Math.floor(Math.random()*65535))}k.prototype.allocate=function(){const $=this.nextId++;return this.nextId===65536&&(this.nextId=1),$},k.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1},k.prototype.register=function($){return!0},k.prototype.deallocate=function($){},k.prototype.clear=function(){},g.exports=k},{}],8:[function(r,g,V){const k=r("xtend"),$=r("readable-stream").Readable,re={objectMode:!0},oe={clean:!0};function Ce(ie){if(!(this instanceof Ce))return new Ce(ie);this.options=ie||{},this.options=k(oe,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 $(re),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,V){function k($){if(!(this instanceof k))return new k($);this.aliasToTopic={},this.max=$}k.prototype.put=function($,re){return re===0||re>this.max?!1:(this.aliasToTopic[re]=$,this.length=Object.keys(this.aliasToTopic).length,!0)},k.prototype.getTopicByAlias=function($){return this.aliasToTopic[$]},k.prototype.clear=function(){this.aliasToTopic={}},g.exports=k},{}],10:[function(r,g,V){const k=r("lru-cache"),$=r("number-allocator").NumberAllocator;function re(oe){if(!(this instanceof re))return new re(oe);oe>0&&(this.aliasToTopic=new k({max:oe}),this.topicToAlias={},this.numberAllocator=new $(1,oe),this.max=oe,this.length=0)}re.prototype.put=function(oe,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,oe),this.topicToAlias[oe]=Ce,this.numberAllocator.use(Ce),this.length=this.aliasToTopic.length,!0},re.prototype.getTopicByAlias=function(oe){return this.aliasToTopic.get(oe)},re.prototype.getAliasByTopic=function(oe){const Ce=this.topicToAlias[oe];return typeof Ce<"u"&&this.aliasToTopic.get(Ce),Ce},re.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},re.prototype.getLruAlias=function(){const oe=this.numberAllocator.firstVacant();return oe||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},g.exports=re},{"lru-cache":37,"number-allocator":46}],11:[function(r,g,V){function k(re){const oe=re.split("/");for(let Ce=0;Ce<oe.length;Ce++)if(oe[Ce]!=="+"){if(oe[Ce]==="#")return Ce===oe.length-1;if(oe[Ce].indexOf("+")!==-1||oe[Ce].indexOf("#")!==-1)return!1}return!0}function $(re){if(re.length===0)return"empty_topic_list";for(let oe=0;oe<re.length;oe++)if(!k(re[oe]))return re[oe];return null}g.exports={validateTopics:$}},{}],12:[function(r,g,V){(function(k){(function(){const $=r("../client"),re=r("../store"),oe=r("url"),Ce=r("xtend"),ie=r("debug")("mqttjs"),ae={};typeof k<"u"&&k.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 ze=oe.parse(ue,!0);if(ze.port!=null&&(ze.port=Number(ze.port)),de=Ce(ze,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 ze=["mqtts","wss"].indexOf(de.protocol)!==-1;de.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(pe,Ve){return ze&&Ve%2===0?!1:typeof ae[pe]=="function"})[0]}if(de.clean===!1&&!de.clientId)throw new Error("Missing clientId for unclean clients");de.protocol&&(de.defaultProtocol=de.protocol);function Ne(ze){return de.servers&&((!ze._reconnectCount||ze._reconnectCount===de.servers.length)&&(ze._reconnectCount=0),de.host=de.servers[ze._reconnectCount].host,de.port=de.servers[ze._reconnectCount].port,de.protocol=de.servers[ze._reconnectCount].protocol?de.servers[ze._reconnectCount].protocol:de.defaultProtocol,de.hostname=de.host,ze._reconnectCount++),ie("calling streambuilder for",de.protocol),ae[de.protocol](ze,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=re}).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,V){V.byteLength=le,V.toByteArray=ue,V.fromByteArray=he;for(var k=[],$=[],re=typeof Uint8Array<"u"?Uint8Array:Array,oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ce=0,ie=oe.length;Ce<ie;++Ce)k[Ce]=oe[Ce],$[oe.charCodeAt(Ce)]=Ce;$["-".charCodeAt(0)]=62,$["_".charCodeAt(0)]=63;function ae(ze){var pe=ze.length;if(pe%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var Ve=ze.indexOf("=");Ve===-1&&(Ve=pe);var Oe=Ve===pe?0:4-Ve%4;return[Ve,Oe]}function le(ze){var pe=ae(ze),Ve=pe[0],Oe=pe[1];return(Ve+Oe)*3/4-Oe}function Ie(ze,pe,Ve){return(pe+Ve)*3/4-Ve}function ue(ze){var pe,Ve=ae(ze),Oe=Ve[0],_e=Ve[1],At=new re(Ie(ze,Oe,_e)),$e=0,Fe=_e>0?Oe-4:Oe,Ue;for(Ue=0;Ue<Fe;Ue+=4)pe=$[ze.charCodeAt(Ue)]<<18|$[ze.charCodeAt(Ue+1)]<<12|$[ze.charCodeAt(Ue+2)]<<6|$[ze.charCodeAt(Ue+3)],At[$e++]=pe>>16&255,At[$e++]=pe>>8&255,At[$e++]=pe&255;return _e===2&&(pe=$[ze.charCodeAt(Ue)]<<2|$[ze.charCodeAt(Ue+1)]>>4,At[$e++]=pe&255),_e===1&&(pe=$[ze.charCodeAt(Ue)]<<10|$[ze.charCodeAt(Ue+1)]<<4|$[ze.charCodeAt(Ue+2)]>>2,At[$e++]=pe>>8&255,At[$e++]=pe&255),At}function de(ze){return k[ze>>18&63]+k[ze>>12&63]+k[ze>>6&63]+k[ze&63]}function Ne(ze,pe,Ve){for(var Oe,_e=[],At=pe;At<Ve;At+=3)Oe=(ze[At]<<16&16711680)+(ze[At+1]<<8&65280)+(ze[At+2]&255),_e.push(de(Oe));return _e.join("")}function he(ze){for(var pe,Ve=ze.length,Oe=Ve%3,_e=[],At=16383,$e=0,Fe=Ve-Oe;$e<Fe;$e+=At)_e.push(Ne(ze,$e,$e+At>Fe?Fe:$e+At));return Oe===1?(pe=ze[Ve-1],_e.push(k[pe>>2]+k[pe<<4&63]+"==")):Oe===2&&(pe=(ze[Ve-2]<<8)+ze[Ve-1],_e.push(k[pe>>10]+k[pe>>4&63]+k[pe<<2&63]+"=")),_e.join("")}},{}],14:[function(r,g,V){const{Buffer:k}=r("buffer"),$=Symbol.for("BufferList");function re(oe){if(!(this instanceof re))return new re(oe);re._init.call(this,oe)}re._init=function(Ce){Object.defineProperty(this,$,{value:!0}),this._bufs=[],this.length=0,Ce&&this.append(Ce)},re.prototype._new=function(Ce){return new re(Ce)},re.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}},re.prototype._reverseOffset=function(oe){const Ce=oe[0];let ie=oe[1];for(let ae=0;ae<Ce;ae++)ie+=this._bufs[ae].length;return ie},re.prototype.get=function(Ce){if(Ce>this.length||Ce<0)return;const ie=this._offset(Ce);return this._bufs[ie[0]][ie[1]]},re.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)},re.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||k.alloc(0);const Ie=!!Ce,ue=this._offset(ae),de=le-ae;let Ne=de,he=Ie&&ie||0,ze=ue[1];if(ae===0&&le===this.length){if(!Ie)return this._bufs.length===1?this._bufs[0]:k.concat(this._bufs,this.length);for(let pe=0;pe<this._bufs.length;pe++)this._bufs[pe].copy(Ce,he),he+=this._bufs[pe].length;return Ce}if(Ne<=this._bufs[ue[0]].length-ze)return Ie?this._bufs[ue[0]].copy(Ce,ie,ze,ze+Ne):this._bufs[ue[0]].slice(ze,ze+Ne);Ie||(Ce=k.allocUnsafe(de));for(let pe=ue[0];pe<this._bufs.length;pe++){const Ve=this._bufs[pe].length-ze;if(Ne>Ve)this._bufs[pe].copy(Ce,he,ze),he+=Ve;else{this._bufs[pe].copy(Ce,he,ze,ze+Ne),he+=Ve;break}Ne-=Ve,ze&&(ze=0)}return Ce.length>he?Ce.slice(0,he):Ce},re.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)},re.prototype.toString=function(Ce,ie,ae){return this.slice(ie,ae).toString(Ce)},re.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},re.prototype.duplicate=function(){const Ce=this._new();for(let ie=0;ie<this._bufs.length;ie++)Ce.append(this._bufs[ie]);return Ce},re.prototype.append=function(Ce){if(Ce==null)return this;if(Ce.buffer)this._appendBuffer(k.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(k.from(Ce));return this},re.prototype._appendBuffer=function(Ce){this._bufs.push(Ce),this.length+=Ce.length},re.prototype.indexOf=function(oe,Ce,ie){if(ie===void 0&&typeof Ce=="string"&&(ie=Ce,Ce=void 0),typeof oe=="function"||Array.isArray(oe))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof oe=="number"?oe=k.from([oe]):typeof oe=="string"?oe=k.from(oe,ie):this._isBufferList(oe)?oe=oe.slice():Array.isArray(oe.buffer)?oe=k.from(oe.buffer,oe.byteOffset,oe.byteLength):k.isBuffer(oe)||(oe=k.from(oe)),Ce=Number(Ce||0),isNaN(Ce)&&(Ce=0),Ce<0&&(Ce=this.length+Ce),Ce<0&&(Ce=0),oe.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>=oe.length){const Ne=ue.indexOf(oe,Ie);if(Ne!==-1)return this._reverseOffset([le,Ne]);Ie=ue.length-oe.length+1}else{const Ne=this._reverseOffset([le,Ie]);if(this._match(Ne,oe))return Ne;Ie++}Ie=0}return-1},re.prototype._match=function(oe,Ce){if(this.length-oe<Ce.length)return!1;for(let ie=0;ie<Ce.length;ie++)if(this.get(oe+ie)!==Ce[ie])return!1;return!0},function(){const oe={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 oe)(function(ie){oe[ie]===null?re.prototype[ie]=function(ae,le){return this.slice(ae,ae+le)[ie](0,le)}:re.prototype[ie]=function(ae=0){return this.slice(ae,ae+oe[ie])[ie](0)}})(Ce)}(),re.prototype._isBufferList=function(Ce){return Ce instanceof re||re.isBufferList(Ce)},re.isBufferList=function(Ce){return Ce!=null&&Ce[$]},g.exports=re},{buffer:17}],15:[function(r,g,V){const k=r("readable-stream").Duplex,$=r("inherits"),re=r("./BufferList");function oe(Ce){if(!(this instanceof oe))return new oe(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}re._init.call(this,Ce),k.call(this)}$(oe,k),Object.assign(oe.prototype,re.prototype),oe.prototype._new=function(ie){return new oe(ie)},oe.prototype._write=function(ie,ae,le){this._appendBuffer(ie),typeof le=="function"&&le()},oe.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)},oe.prototype.end=function(ie){k.prototype.end.call(this,ie),this._callback&&(this._callback(null,this.slice()),this._callback=null)},oe.prototype._destroy=function(ie,ae){this._bufs.length=0,this.length=0,ae(ie)},oe.prototype._isBufferList=function(ie){return ie instanceof oe||ie instanceof re||oe.isBufferList(ie)},oe.isBufferList=re.isBufferList,g.exports=oe,g.exports.BufferListStream=oe,g.exports.BufferList=re},{"./BufferList":14,inherits:24,"readable-stream":69}],16:[function(r,g,V){},{}],17:[function(r,g,V){(function(k){(function(){var $=r("base64-js"),re=r("ieee754");V.Buffer=ae,V.SlowBuffer=Oe,V.INSPECT_MAX_BYTES=50;var oe=2147483647;V.kMaxLength=oe,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>oe)throw new RangeError('The value "'+oi+'" is invalid for option "size"');var Lt=new Uint8Array(oi);return Lt.__proto__=ae.prototype,Lt}function ae(oi,Lt,ii){if(typeof oi=="number"){if(typeof Lt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return de(oi)}return le(oi,Lt,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,Lt,ii){if(typeof oi=="string")return Ne(oi,Lt);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 ze(oi,Lt,ii);if(typeof oi=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var gi=oi.valueOf&&oi.valueOf();if(gi!=null&&gi!==oi)return ae.from(gi,Lt,ii);var hi=pe(oi);if(hi)return hi;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof oi[Symbol.toPrimitive]=="function")return ae.from(oi[Symbol.toPrimitive]("string"),Lt,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,Lt,ii){return le(oi,Lt,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,Lt,ii){return Ie(oi),oi<=0?ie(oi):Lt!==void 0?typeof ii=="string"?ie(oi).fill(Lt,ii):ie(oi).fill(Lt):ie(oi)}ae.alloc=function(oi,Lt,ii){return ue(oi,Lt,ii)};function de(oi){return Ie(oi),ie(oi<0?0:Ve(oi)|0)}ae.allocUnsafe=function(oi){return de(oi)},ae.allocUnsafeSlow=function(oi){return de(oi)};function Ne(oi,Lt){if((typeof Lt!="string"||Lt==="")&&(Lt="utf8"),!ae.isEncoding(Lt))throw new TypeError("Unknown encoding: "+Lt);var ii=_e(oi,Lt)|0,gi=ie(ii),hi=gi.write(oi,Lt);return hi!==ii&&(gi=gi.slice(0,hi)),gi}function he(oi){for(var Lt=oi.length<0?0:Ve(oi.length)|0,ii=ie(Lt),gi=0;gi<Lt;gi+=1)ii[gi]=oi[gi]&255;return ii}function ze(oi,Lt,ii){if(Lt<0||oi.byteLength<Lt)throw new RangeError('"offset" is outside of buffer bounds');if(oi.byteLength<Lt+(ii||0))throw new RangeError('"length" is outside of buffer bounds');var gi;return Lt===void 0&&ii===void 0?gi=new Uint8Array(oi):ii===void 0?gi=new Uint8Array(oi,Lt):gi=new Uint8Array(oi,Lt,ii),gi.__proto__=ae.prototype,gi}function pe(oi){if(ae.isBuffer(oi)){var Lt=Ve(oi.length)|0,ii=ie(Lt);return ii.length===0||oi.copy(ii,0,0,Lt),ii}if(oi.length!==void 0)return typeof oi.length!="number"||wi(oi.length)?ie(0):he(oi);if(oi.type==="Buffer"&&Array.isArray(oi.data))return he(oi.data)}function Ve(oi){if(oi>=oe)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe.toString(16)+" bytes");return oi|0}function Oe(oi){return+oi!=oi&&(oi=0),ae.alloc(+oi)}ae.isBuffer=function(Lt){return Lt!=null&&Lt._isBuffer===!0&&Lt!==ae.prototype},ae.compare=function(Lt,ii){if(si(Lt,Uint8Array)&&(Lt=ae.from(Lt,Lt.offset,Lt.byteLength)),si(ii,Uint8Array)&&(ii=ae.from(ii,ii.offset,ii.byteLength)),!ae.isBuffer(Lt)||!ae.isBuffer(ii))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Lt===ii)return 0;for(var gi=Lt.length,hi=ii.length,mi=0,Si=Math.min(gi,hi);mi<Si;++mi)if(Lt[mi]!==ii[mi]){gi=Lt[mi],hi=ii[mi];break}return gi<hi?-1:hi<gi?1:0},ae.isEncoding=function(Lt){switch(String(Lt).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(Lt,ii){if(!Array.isArray(Lt))throw new TypeError('"list" argument must be an Array of Buffers');if(Lt.length===0)return ae.alloc(0);var gi;if(ii===void 0)for(ii=0,gi=0;gi<Lt.length;++gi)ii+=Lt[gi].length;var hi=ae.allocUnsafe(ii),mi=0;for(gi=0;gi<Lt.length;++gi){var Si=Lt[gi];if(si(Si,Uint8Array)&&(Si=ae.from(Si)),!ae.isBuffer(Si))throw new TypeError('"list" argument must be an Array of Buffers');Si.copy(hi,mi),mi+=Si.length}return hi};function _e(oi,Lt){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,gi=arguments.length>2&&arguments[2]===!0;if(!gi&&ii===0)return 0;for(var hi=!1;;)switch(Lt){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 vi(oi).length;default:if(hi)return gi?-1:Ni(oi).length;Lt=(""+Lt).toLowerCase(),hi=!0}}ae.byteLength=_e;function At(oi,Lt,ii){var gi=!1;if((Lt===void 0||Lt<0)&&(Lt=0),Lt>this.length||((ii===void 0||ii>this.length)&&(ii=this.length),ii<=0)||(ii>>>=0,Lt>>>=0,ii<=Lt))return"";for(oi||(oi="utf8");;)switch(oi){case"hex":return Ci(this,Lt,ii);case"utf8":case"utf-8":return ei(this,Lt,ii);case"ascii":return ri(this,Lt,ii);case"latin1":case"binary":return ci(this,Lt,ii);case"base64":return ti(this,Lt,ii);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return li(this,Lt,ii);default:if(gi)throw new TypeError("Unknown encoding: "+oi);oi=(oi+"").toLowerCase(),gi=!0}}ae.prototype._isBuffer=!0;function $e(oi,Lt,ii){var gi=oi[Lt];oi[Lt]=oi[ii],oi[ii]=gi}ae.prototype.swap16=function(){var Lt=this.length;if(Lt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ii=0;ii<Lt;ii+=2)$e(this,ii,ii+1);return this},ae.prototype.swap32=function(){var Lt=this.length;if(Lt%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var ii=0;ii<Lt;ii+=4)$e(this,ii,ii+3),$e(this,ii+1,ii+2);return this},ae.prototype.swap64=function(){var Lt=this.length;if(Lt%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var ii=0;ii<Lt;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 Lt=this.length;return Lt===0?"":arguments.length===0?ei(this,0,Lt):At.apply(this,arguments)},ae.prototype.toLocaleString=ae.prototype.toString,ae.prototype.equals=function(Lt){if(!ae.isBuffer(Lt))throw new TypeError("Argument must be a Buffer");return this===Lt?!0:ae.compare(this,Lt)===0},ae.prototype.inspect=function(){var Lt="",ii=V.INSPECT_MAX_BYTES;return Lt=this.toString("hex",0,ii).replace(/(.{2})/g,"$1 ").trim(),this.length>ii&&(Lt+=" ... "),"<Buffer "+Lt+">"},ae.prototype.compare=function(Lt,ii,gi,hi,mi){if(si(Lt,Uint8Array)&&(Lt=ae.from(Lt,Lt.offset,Lt.byteLength)),!ae.isBuffer(Lt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Lt);if(ii===void 0&&(ii=0),gi===void 0&&(gi=Lt?Lt.length:0),hi===void 0&&(hi=0),mi===void 0&&(mi=this.length),ii<0||gi>Lt.length||hi<0||mi>this.length)throw new RangeError("out of range index");if(hi>=mi&&ii>=gi)return 0;if(hi>=mi)return-1;if(ii>=gi)return 1;if(ii>>>=0,gi>>>=0,hi>>>=0,mi>>>=0,this===Lt)return 0;for(var Si=mi-hi,xi=gi-ii,Gi=Math.min(Si,xi),Bi=this.slice(hi,mi),Oi=Lt.slice(ii,gi),Zi=0;Zi<Gi;++Zi)if(Bi[Zi]!==Oi[Zi]){Si=Bi[Zi],xi=Oi[Zi];break}return Si<xi?-1:xi<Si?1:0};function Fe(oi,Lt,ii,gi,hi){if(oi.length===0)return-1;if(typeof ii=="string"?(gi=ii,ii=0):ii>2147483647?ii=2147483647:ii<-2147483648&&(ii=-2147483648),ii=+ii,wi(ii)&&(ii=hi?0:oi.length-1),ii<0&&(ii=oi.length+ii),ii>=oi.length){if(hi)return-1;ii=oi.length-1}else if(ii<0)if(hi)ii=0;else return-1;if(typeof Lt=="string"&&(Lt=ae.from(Lt,gi)),ae.isBuffer(Lt))return Lt.length===0?-1:Ue(oi,Lt,ii,gi,hi);if(typeof Lt=="number")return Lt=Lt&255,typeof Uint8Array.prototype.indexOf=="function"?hi?Uint8Array.prototype.indexOf.call(oi,Lt,ii):Uint8Array.prototype.lastIndexOf.call(oi,Lt,ii):Ue(oi,[Lt],ii,gi,hi);throw new TypeError("val must be string, number or Buffer")}function Ue(oi,Lt,ii,gi,hi){var mi=1,Si=oi.length,xi=Lt.length;if(gi!==void 0&&(gi=String(gi).toLowerCase(),gi==="ucs2"||gi==="ucs-2"||gi==="utf16le"||gi==="utf-16le")){if(oi.length<2||Lt.length<2)return-1;mi=2,Si/=2,xi/=2,ii/=2}function Gi(Vi,ki){return mi===1?Vi[ki]:Vi.readUInt16BE(ki*mi)}var Bi;if(hi){var Oi=-1;for(Bi=ii;Bi<Si;Bi++)if(Gi(oi,Bi)===Gi(Lt,Oi===-1?0:Bi-Oi)){if(Oi===-1&&(Oi=Bi),Bi-Oi+1===xi)return Oi*mi}else Oi!==-1&&(Bi-=Bi-Oi),Oi=-1}else for(ii+xi>Si&&(ii=Si-xi),Bi=ii;Bi>=0;Bi--){for(var Zi=!0,Wi=0;Wi<xi;Wi++)if(Gi(oi,Bi+Wi)!==Gi(Lt,Wi)){Zi=!1;break}if(Zi)return Bi}return-1}ae.prototype.includes=function(Lt,ii,gi){return this.indexOf(Lt,ii,gi)!==-1},ae.prototype.indexOf=function(Lt,ii,gi){return Fe(this,Lt,ii,gi,!0)},ae.prototype.lastIndexOf=function(Lt,ii,gi){return Fe(this,Lt,ii,gi,!1)};function xe(oi,Lt,ii,gi){ii=Number(ii)||0;var hi=oi.length-ii;gi?(gi=Number(gi),gi>hi&&(gi=hi)):gi=hi;var mi=Lt.length;gi>mi/2&&(gi=mi/2);for(var Si=0;Si<gi;++Si){var xi=parseInt(Lt.substr(Si*2,2),16);if(wi(xi))return Si;oi[ii+Si]=xi}return Si}function Dt(oi,Lt,ii,gi){return bi(Ni(Lt,oi.length-ii),oi,ii,gi)}function qe(oi,Lt,ii,gi){return bi(di(Lt),oi,ii,gi)}function kt(oi,Lt,ii,gi){return qe(oi,Lt,ii,gi)}function jt(oi,Lt,ii,gi){return bi(vi(Lt),oi,ii,gi)}function Pt(oi,Lt,ii,gi){return bi(fi(Lt,oi.length-ii),oi,ii,gi)}ae.prototype.write=function(Lt,ii,gi,hi){if(ii===void 0)hi="utf8",gi=this.length,ii=0;else if(gi===void 0&&typeof ii=="string")hi=ii,gi=this.length,ii=0;else if(isFinite(ii))ii=ii>>>0,isFinite(gi)?(gi=gi>>>0,hi===void 0&&(hi="utf8")):(hi=gi,gi=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var mi=this.length-ii;if((gi===void 0||gi>mi)&&(gi=mi),Lt.length>0&&(gi<0||ii<0)||ii>this.length)throw new RangeError("Attempt to write outside buffer bounds");hi||(hi="utf8");for(var Si=!1;;)switch(hi){case"hex":return xe(this,Lt,ii,gi);case"utf8":case"utf-8":return Dt(this,Lt,ii,gi);case"ascii":return qe(this,Lt,ii,gi);case"latin1":case"binary":return kt(this,Lt,ii,gi);case"base64":return jt(this,Lt,ii,gi);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pt(this,Lt,ii,gi);default:if(Si)throw new TypeError("Unknown encoding: "+hi);hi=(""+hi).toLowerCase(),Si=!0}},ae.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ti(oi,Lt,ii){return Lt===0&&ii===oi.length?$.fromByteArray(oi):$.fromByteArray(oi.slice(Lt,ii))}function ei(oi,Lt,ii){ii=Math.min(oi.length,ii);for(var gi=[],hi=Lt;hi<ii;){var mi=oi[hi],Si=null,xi=mi>239?4:mi>223?3:mi>191?2:1;if(hi+xi<=ii){var Gi,Bi,Oi,Zi;switch(xi){case 1:mi<128&&(Si=mi);break;case 2:Gi=oi[hi+1],(Gi&192)===128&&(Zi=(mi&31)<<6|Gi&63,Zi>127&&(Si=Zi));break;case 3:Gi=oi[hi+1],Bi=oi[hi+2],(Gi&192)===128&&(Bi&192)===128&&(Zi=(mi&15)<<12|(Gi&63)<<6|Bi&63,Zi>2047&&(Zi<55296||Zi>57343)&&(Si=Zi));break;case 4:Gi=oi[hi+1],Bi=oi[hi+2],Oi=oi[hi+3],(Gi&192)===128&&(Bi&192)===128&&(Oi&192)===128&&(Zi=(mi&15)<<18|(Gi&63)<<12|(Bi&63)<<6|Oi&63,Zi>65535&&Zi<1114112&&(Si=Zi))}}Si===null?(Si=65533,xi=1):Si>65535&&(Si-=65536,gi.push(Si>>>10&1023|55296),Si=56320|Si&1023),gi.push(Si),hi+=xi}return ni(gi)}var Et=4096;function ni(oi){var Lt=oi.length;if(Lt<=Et)return String.fromCharCode.apply(String,oi);for(var ii="",gi=0;gi<Lt;)ii+=String.fromCharCode.apply(String,oi.slice(gi,gi+=Et));return ii}function ri(oi,Lt,ii){var gi="";ii=Math.min(oi.length,ii);for(var hi=Lt;hi<ii;++hi)gi+=String.fromCharCode(oi[hi]&127);return gi}function ci(oi,Lt,ii){var gi="";ii=Math.min(oi.length,ii);for(var hi=Lt;hi<ii;++hi)gi+=String.fromCharCode(oi[hi]);return gi}function Ci(oi,Lt,ii){var gi=oi.length;(!Lt||Lt<0)&&(Lt=0),(!ii||ii<0||ii>gi)&&(ii=gi);for(var hi="",mi=Lt;mi<ii;++mi)hi+=pi(oi[mi]);return hi}function li(oi,Lt,ii){for(var gi=oi.slice(Lt,ii),hi="",mi=0;mi<gi.length;mi+=2)hi+=String.fromCharCode(gi[mi]+gi[mi+1]*256);return hi}ae.prototype.slice=function(Lt,ii){var gi=this.length;Lt=~~Lt,ii=ii===void 0?gi:~~ii,Lt<0?(Lt+=gi,Lt<0&&(Lt=0)):Lt>gi&&(Lt=gi),ii<0?(ii+=gi,ii<0&&(ii=0)):ii>gi&&(ii=gi),ii<Lt&&(ii=Lt);var hi=this.subarray(Lt,ii);return hi.__proto__=ae.prototype,hi};function ui(oi,Lt,ii){if(oi%1!==0||oi<0)throw new RangeError("offset is not uint");if(oi+Lt>ii)throw new RangeError("Trying to access beyond buffer length")}ae.prototype.readUIntLE=function(Lt,ii,gi){Lt=Lt>>>0,ii=ii>>>0,gi||ui(Lt,ii,this.length);for(var hi=this[Lt],mi=1,Si=0;++Si<ii&&(mi*=256);)hi+=this[Lt+Si]*mi;return hi},ae.prototype.readUIntBE=function(Lt,ii,gi){Lt=Lt>>>0,ii=ii>>>0,gi||ui(Lt,ii,this.length);for(var hi=this[Lt+--ii],mi=1;ii>0&&(mi*=256);)hi+=this[Lt+--ii]*mi;return hi},ae.prototype.readUInt8=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,1,this.length),this[Lt]},ae.prototype.readUInt16LE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,2,this.length),this[Lt]|this[Lt+1]<<8},ae.prototype.readUInt16BE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,2,this.length),this[Lt]<<8|this[Lt+1]},ae.prototype.readUInt32LE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),(this[Lt]|this[Lt+1]<<8|this[Lt+2]<<16)+this[Lt+3]*16777216},ae.prototype.readUInt32BE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),this[Lt]*16777216+(this[Lt+1]<<16|this[Lt+2]<<8|this[Lt+3])},ae.prototype.readIntLE=function(Lt,ii,gi){Lt=Lt>>>0,ii=ii>>>0,gi||ui(Lt,ii,this.length);for(var hi=this[Lt],mi=1,Si=0;++Si<ii&&(mi*=256);)hi+=this[Lt+Si]*mi;return mi*=128,hi>=mi&&(hi-=Math.pow(2,8*ii)),hi},ae.prototype.readIntBE=function(Lt,ii,gi){Lt=Lt>>>0,ii=ii>>>0,gi||ui(Lt,ii,this.length);for(var hi=ii,mi=1,Si=this[Lt+--hi];hi>0&&(mi*=256);)Si+=this[Lt+--hi]*mi;return mi*=128,Si>=mi&&(Si-=Math.pow(2,8*ii)),Si},ae.prototype.readInt8=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,1,this.length),this[Lt]&128?(255-this[Lt]+1)*-1:this[Lt]},ae.prototype.readInt16LE=function(Lt,ii){Lt=Lt>>>0,ii||ui(Lt,2,this.length);var gi=this[Lt]|this[Lt+1]<<8;return gi&32768?gi|4294901760:gi},ae.prototype.readInt16BE=function(Lt,ii){Lt=Lt>>>0,ii||ui(Lt,2,this.length);var gi=this[Lt+1]|this[Lt]<<8;return gi&32768?gi|4294901760:gi},ae.prototype.readInt32LE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),this[Lt]|this[Lt+1]<<8|this[Lt+2]<<16|this[Lt+3]<<24},ae.prototype.readInt32BE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),this[Lt]<<24|this[Lt+1]<<16|this[Lt+2]<<8|this[Lt+3]},ae.prototype.readFloatLE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),re.read(this,Lt,!0,23,4)},ae.prototype.readFloatBE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),re.read(this,Lt,!1,23,4)},ae.prototype.readDoubleLE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,8,this.length),re.read(this,Lt,!0,52,8)},ae.prototype.readDoubleBE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,8,this.length),re.read(this,Lt,!1,52,8)};function yi(oi,Lt,ii,gi,hi,mi){if(!ae.isBuffer(oi))throw new TypeError('"buffer" argument must be a Buffer instance');if(Lt>hi||Lt<mi)throw new RangeError('"value" argument is out of bounds');if(ii+gi>oi.length)throw new RangeError("Index out of range")}ae.prototype.writeUIntLE=function(Lt,ii,gi,hi){if(Lt=+Lt,ii=ii>>>0,gi=gi>>>0,!hi){var mi=Math.pow(2,8*gi)-1;yi(this,Lt,ii,gi,mi,0)}var Si=1,xi=0;for(this[ii]=Lt&255;++xi<gi&&(Si*=256);)this[ii+xi]=Lt/Si&255;return ii+gi},ae.prototype.writeUIntBE=function(Lt,ii,gi,hi){if(Lt=+Lt,ii=ii>>>0,gi=gi>>>0,!hi){var mi=Math.pow(2,8*gi)-1;yi(this,Lt,ii,gi,mi,0)}var Si=gi-1,xi=1;for(this[ii+Si]=Lt&255;--Si>=0&&(xi*=256);)this[ii+Si]=Lt/xi&255;return ii+gi},ae.prototype.writeUInt8=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,1,255,0),this[ii]=Lt&255,ii+1},ae.prototype.writeUInt16LE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,2,65535,0),this[ii]=Lt&255,this[ii+1]=Lt>>>8,ii+2},ae.prototype.writeUInt16BE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,2,65535,0),this[ii]=Lt>>>8,this[ii+1]=Lt&255,ii+2},ae.prototype.writeUInt32LE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,4,4294967295,0),this[ii+3]=Lt>>>24,this[ii+2]=Lt>>>16,this[ii+1]=Lt>>>8,this[ii]=Lt&255,ii+4},ae.prototype.writeUInt32BE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,4,4294967295,0),this[ii]=Lt>>>24,this[ii+1]=Lt>>>16,this[ii+2]=Lt>>>8,this[ii+3]=Lt&255,ii+4},ae.prototype.writeIntLE=function(Lt,ii,gi,hi){if(Lt=+Lt,ii=ii>>>0,!hi){var mi=Math.pow(2,8*gi-1);yi(this,Lt,ii,gi,mi-1,-mi)}var Si=0,xi=1,Gi=0;for(this[ii]=Lt&255;++Si<gi&&(xi*=256);)Lt<0&&Gi===0&&this[ii+Si-1]!==0&&(Gi=1),this[ii+Si]=(Lt/xi>>0)-Gi&255;return ii+gi},ae.prototype.writeIntBE=function(Lt,ii,gi,hi){if(Lt=+Lt,ii=ii>>>0,!hi){var mi=Math.pow(2,8*gi-1);yi(this,Lt,ii,gi,mi-1,-mi)}var Si=gi-1,xi=1,Gi=0;for(this[ii+Si]=Lt&255;--Si>=0&&(xi*=256);)Lt<0&&Gi===0&&this[ii+Si+1]!==0&&(Gi=1),this[ii+Si]=(Lt/xi>>0)-Gi&255;return ii+gi},ae.prototype.writeInt8=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,1,127,-128),Lt<0&&(Lt=255+Lt+1),this[ii]=Lt&255,ii+1},ae.prototype.writeInt16LE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,2,32767,-32768),this[ii]=Lt&255,this[ii+1]=Lt>>>8,ii+2},ae.prototype.writeInt16BE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,2,32767,-32768),this[ii]=Lt>>>8,this[ii+1]=Lt&255,ii+2},ae.prototype.writeInt32LE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,4,2147483647,-2147483648),this[ii]=Lt&255,this[ii+1]=Lt>>>8,this[ii+2]=Lt>>>16,this[ii+3]=Lt>>>24,ii+4},ae.prototype.writeInt32BE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,4,2147483647,-2147483648),Lt<0&&(Lt=4294967295+Lt+1),this[ii]=Lt>>>24,this[ii+1]=Lt>>>16,this[ii+2]=Lt>>>8,this[ii+3]=Lt&255,ii+4};function Mi(oi,Lt,ii,gi,hi,mi){if(ii+gi>oi.length)throw new RangeError("Index out of range");if(ii<0)throw new RangeError("Index out of range")}function zi(oi,Lt,ii,gi,hi){return Lt=+Lt,ii=ii>>>0,hi||Mi(oi,Lt,ii,4),re.write(oi,Lt,ii,gi,23,4),ii+4}ae.prototype.writeFloatLE=function(Lt,ii,gi){return zi(this,Lt,ii,!0,gi)},ae.prototype.writeFloatBE=function(Lt,ii,gi){return zi(this,Lt,ii,!1,gi)};function Ai(oi,Lt,ii,gi,hi){return Lt=+Lt,ii=ii>>>0,hi||Mi(oi,Lt,ii,8),re.write(oi,Lt,ii,gi,52,8),ii+8}ae.prototype.writeDoubleLE=function(Lt,ii,gi){return Ai(this,Lt,ii,!0,gi)},ae.prototype.writeDoubleBE=function(Lt,ii,gi){return Ai(this,Lt,ii,!1,gi)},ae.prototype.copy=function(Lt,ii,gi,hi){if(!ae.isBuffer(Lt))throw new TypeError("argument should be a Buffer");if(gi||(gi=0),!hi&&hi!==0&&(hi=this.length),ii>=Lt.length&&(ii=Lt.length),ii||(ii=0),hi>0&&hi<gi&&(hi=gi),hi===gi||Lt.length===0||this.length===0)return 0;if(ii<0)throw new RangeError("targetStart out of bounds");if(gi<0||gi>=this.length)throw new RangeError("Index out of range");if(hi<0)throw new RangeError("sourceEnd out of bounds");hi>this.length&&(hi=this.length),Lt.length-ii<hi-gi&&(hi=Lt.length-ii+gi);var mi=hi-gi;if(this===Lt&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(ii,gi,hi);else if(this===Lt&&gi<ii&&ii<hi)for(var Si=mi-1;Si>=0;--Si)Lt[Si+ii]=this[Si+gi];else Uint8Array.prototype.set.call(Lt,this.subarray(gi,hi),ii);return mi},ae.prototype.fill=function(Lt,ii,gi,hi){if(typeof Lt=="string"){if(typeof ii=="string"?(hi=ii,ii=0,gi=this.length):typeof gi=="string"&&(hi=gi,gi=this.length),hi!==void 0&&typeof hi!="string")throw new TypeError("encoding must be a string");if(typeof hi=="string"&&!ae.isEncoding(hi))throw new TypeError("Unknown encoding: "+hi);if(Lt.length===1){var mi=Lt.charCodeAt(0);(hi==="utf8"&&mi<128||hi==="latin1")&&(Lt=mi)}}else typeof Lt=="number"&&(Lt=Lt&255);if(ii<0||this.length<ii||this.length<gi)throw new RangeError("Out of range index");if(gi<=ii)return this;ii=ii>>>0,gi=gi===void 0?this.length:gi>>>0,Lt||(Lt=0);var Si;if(typeof Lt=="number")for(Si=ii;Si<gi;++Si)this[Si]=Lt;else{var xi=ae.isBuffer(Lt)?Lt:ae.from(Lt,hi),Gi=xi.length;if(Gi===0)throw new TypeError('The value "'+Lt+'" is invalid for argument "value"');for(Si=0;Si<gi-ii;++Si)this[Si+ii]=xi[Si%Gi]}return this};var Ii=/[^+/0-9A-Za-z-_]/g;function ai(oi){if(oi=oi.split("=")[0],oi=oi.trim().replace(Ii,""),oi.length<2)return"";for(;oi.length%4!==0;)oi=oi+"=";return oi}function pi(oi){return oi<16?"0"+oi.toString(16):oi.toString(16)}function Ni(oi,Lt){Lt=Lt||1/0;for(var ii,gi=oi.length,hi=null,mi=[],Si=0;Si<gi;++Si){if(ii=oi.charCodeAt(Si),ii>55295&&ii<57344){if(!hi){if(ii>56319){(Lt-=3)>-1&&mi.push(239,191,189);continue}else if(Si+1===gi){(Lt-=3)>-1&&mi.push(239,191,189);continue}hi=ii;continue}if(ii<56320){(Lt-=3)>-1&&mi.push(239,191,189),hi=ii;continue}ii=(hi-55296<<10|ii-56320)+65536}else hi&&(Lt-=3)>-1&&mi.push(239,191,189);if(hi=null,ii<128){if((Lt-=1)<0)break;mi.push(ii)}else if(ii<2048){if((Lt-=2)<0)break;mi.push(ii>>6|192,ii&63|128)}else if(ii<65536){if((Lt-=3)<0)break;mi.push(ii>>12|224,ii>>6&63|128,ii&63|128)}else if(ii<1114112){if((Lt-=4)<0)break;mi.push(ii>>18|240,ii>>12&63|128,ii>>6&63|128,ii&63|128)}else throw new Error("Invalid code point")}return mi}function di(oi){for(var Lt=[],ii=0;ii<oi.length;++ii)Lt.push(oi.charCodeAt(ii)&255);return Lt}function fi(oi,Lt){for(var ii,gi,hi,mi=[],Si=0;Si<oi.length&&!((Lt-=2)<0);++Si)ii=oi.charCodeAt(Si),gi=ii>>8,hi=ii%256,mi.push(hi),mi.push(gi);return mi}function vi(oi){return $.toByteArray(ai(oi))}function bi(oi,Lt,ii,gi){for(var hi=0;hi<gi&&!(hi+ii>=Lt.length||hi>=oi.length);++hi)Lt[hi+ii]=oi[hi];return hi}function si(oi,Lt){return oi instanceof Lt||oi!=null&&oi.constructor!=null&&oi.constructor.name!=null&&oi.constructor.name===Lt.name}function wi(oi){return oi!==oi}}).call(this)}).call(this,r("buffer").Buffer)},{"base64-js":13,buffer:17,ieee754:23}],18:[function(r,g,V){(function(k){(function(){V.formatArgs=re,V.save=oe,V.load=Ce,V.useColors=$,V.storage=ie(),V.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`."))}})(),V.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 re(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)}V.log=console.debug||console.log||(()=>{});function oe(le){try{le?V.storage.setItem("debug",le):V.storage.removeItem("debug")}catch{}}function Ce(){let le;try{le=V.storage.getItem("debug")}catch{}return!le&&typeof k<"u"&&"env"in k&&(le=k.env.DEBUG),le}function ie(){try{return localStorage}catch{}}g.exports=r("./common")(V);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,V){function k($){oe.debug=oe,oe.default=oe,oe.coerce=ue,oe.disable=ae,oe.enable=ie,oe.enabled=le,oe.humanize=r("ms"),oe.destroy=de,Object.keys($).forEach(Ne=>{oe[Ne]=$[Ne]}),oe.names=[],oe.skips=[],oe.formatters={};function re(Ne){let he=0;for(let ze=0;ze<Ne.length;ze++)he=(he<<5)-he+Ne.charCodeAt(ze),he|=0;return oe.colors[Math.abs(he)%oe.colors.length]}oe.selectColor=re;function oe(Ne){let he,ze=null,pe,Ve;function Oe(..._e){if(!Oe.enabled)return;const At=Oe,$e=Number(new Date),Fe=$e-(he||$e);At.diff=Fe,At.prev=he,At.curr=$e,he=$e,_e[0]=oe.coerce(_e[0]),typeof _e[0]!="string"&&_e.unshift("%O");let Ue=0;_e[0]=_e[0].replace(/%([a-zA-Z%])/g,(Dt,qe)=>{if(Dt==="%%")return"%";Ue++;const kt=oe.formatters[qe];if(typeof kt=="function"){const jt=_e[Ue];Dt=kt.call(At,jt),_e.splice(Ue,1),Ue--}return Dt}),oe.formatArgs.call(At,_e),(At.log||oe.log).apply(At,_e)}return Oe.namespace=Ne,Oe.useColors=oe.useColors(),Oe.color=oe.selectColor(Ne),Oe.extend=Ce,Oe.destroy=oe.destroy,Object.defineProperty(Oe,"enabled",{enumerable:!0,configurable:!1,get:()=>ze!==null?ze:(pe!==oe.namespaces&&(pe=oe.namespaces,Ve=oe.enabled(Ne)),Ve),set:_e=>{ze=_e}}),typeof oe.init=="function"&&oe.init(Oe),Oe}function Ce(Ne,he){const ze=oe(this.namespace+(typeof he>"u"?":":he)+Ne);return ze.log=this.log,ze}function ie(Ne){oe.save(Ne),oe.namespaces=Ne,oe.names=[],oe.skips=[];let he;const ze=(typeof Ne=="string"?Ne:"").split(/[\s,]+/),pe=ze.length;for(he=0;he<pe;he++)ze[he]&&(Ne=ze[he].replace(/\*/g,".*?"),Ne[0]==="-"?oe.skips.push(new RegExp("^"+Ne.substr(1)+"$")):oe.names.push(new RegExp("^"+Ne+"$")))}function ae(){const Ne=[...oe.names.map(Ie),...oe.skips.map(Ie).map(he=>"-"+he)].join(",");return oe.enable(""),Ne}function le(Ne){if(Ne[Ne.length-1]==="*")return!0;let he,ze;for(he=0,ze=oe.skips.length;he<ze;he++)if(oe.skips[he].test(Ne))return!1;for(he=0,ze=oe.names.length;he<ze;he++)if(oe.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 oe.enable(oe.load()),oe}g.exports=k},{ms:45}],20:[function(r,g,V){(function(k,$){(function(){var re=r("readable-stream"),oe=r("end-of-stream"),Ce=r("inherits"),ie=r("stream-shift"),ae=$.from&&$.from!==Uint8Array.from?$.from([0]):new $([0]),le=function(pe,Ve){pe._corked?pe.once("uncork",Ve):Ve()},Ie=function(pe,Ve){pe._autoDestroy&&pe.destroy(Ve)},ue=function(pe,Ve){return function(Oe){Oe?Ie(pe,Oe.message==="premature close"?null:Oe):Ve&&!pe._ended&&pe.end()}},de=function(pe,Ve){if(!pe||pe._writableState&&pe._writableState.finished)return Ve();if(pe._writableState)return pe.end(Ve);pe.end(),Ve()},Ne=function(){},he=function(pe){return new re.Readable({objectMode:!0,highWaterMark:16}).wrap(pe)},ze=function(pe,Ve,Oe){if(!(this instanceof ze))return new ze(pe,Ve,Oe);re.Duplex.call(this,Oe),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!Oe||Oe.autoDestroy!==!1,this._forwardDestroy=!Oe||Oe.destroy!==!1,this._forwardEnd=!Oe||Oe.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,pe&&this.setWritable(pe),Ve&&this.setReadable(Ve)};Ce(ze,re.Duplex),ze.obj=function(pe,Ve,Oe){return Oe||(Oe={}),Oe.objectMode=!0,Oe.highWaterMark=16,new ze(pe,Ve,Oe)},ze.prototype.cork=function(){++this._corked===1&&this.emit("cork")},ze.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},ze.prototype.setWritable=function(pe){if(this._unwrite&&this._unwrite(),this.destroyed){pe&&pe.destroy&&pe.destroy();return}if(pe===null||pe===!1){this.end();return}var Ve=this,Oe=oe(pe,{writable:!0,readable:!1},ue(this,this._forwardEnd)),_e=function(){var $e=Ve._ondrain;Ve._ondrain=null,$e&&$e()},At=function(){Ve._writable.removeListener("drain",_e),Oe()};this._unwrite&&k.nextTick(_e),this._writable=pe,this._writable.on("drain",_e),this._unwrite=At,this.uncork()},ze.prototype.setReadable=function(pe){if(this._unread&&this._unread(),this.destroyed){pe&&pe.destroy&&pe.destroy();return}if(pe===null||pe===!1){this.push(null),this.resume();return}var Ve=this,Oe=oe(pe,{writable:!1,readable:!0},ue(this)),_e=function(){Ve._forward()},At=function(){Ve.push(null)},$e=function(){Ve._readable2.removeListener("readable",_e),Ve._readable2.removeListener("end",At),Oe()};this._drained=!0,this._readable=pe,this._readable2=pe._readableState?pe:he(pe),this._readable2.on("readable",_e),this._readable2.on("end",At),this._unread=$e,this._forward()},ze.prototype._read=function(){this._drained=!0,this._forward()},ze.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var pe;this._drained&&(pe=ie(this._readable2))!==null;)this.destroyed||(this._drained=this.push(pe));this._forwarding=!1}},ze.prototype.destroy=function(pe,Ve){if(Ve||(Ve=Ne),this.destroyed)return Ve(null);this.destroyed=!0;var Oe=this;k.nextTick(function(){Oe._destroy(pe),Ve(null)})},ze.prototype._destroy=function(pe){if(pe){var Ve=this._ondrain;this._ondrain=null,Ve?Ve(pe):this.emit("error",pe)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},ze.prototype._write=function(pe,Ve,Oe){if(!this.destroyed){if(this._corked)return le(this,this._write.bind(this,pe,Ve,Oe));if(pe===ae)return this._finish(Oe);if(!this._writable)return Oe();this._writable.write(pe)===!1?this._ondrain=Oe:this.destroyed||Oe()}},ze.prototype._finish=function(pe){var Ve=this;this.emit("preend"),le(this,function(){de(Ve._forwardEnd&&Ve._writable,function(){Ve._writableState.prefinished===!1&&(Ve._writableState.prefinished=!0),Ve.emit("prefinish"),le(Ve,pe)})})},ze.prototype.end=function(pe,Ve,Oe){return typeof pe=="function"?this.end(null,null,pe):typeof Ve=="function"?this.end(pe,null,Ve):(this._ended=!0,pe&&this.write(pe),!this._writableState.ending&&!this._writableState.destroyed&&this.write(ae),re.Writable.prototype.end.call(this,Oe))},g.exports=ze}).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,V){(function(k){(function(){var $=r("once"),re=function(){},oe=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||re);var ue=ae._writableState,de=ae._readableState,Ne=le.readable||le.readable!==!1&&ae.readable,he=le.writable||le.writable!==!1&&ae.writable,ze=!1,pe=function(){ae.writable||Ve()},Ve=function(){he=!1,Ne||Ie.call(ae)},Oe=function(){Ne=!1,he||Ie.call(ae)},_e=function(xe){Ie.call(ae,xe?new Error("exited with error code: "+xe):null)},At=function(xe){Ie.call(ae,xe)},$e=function(){k.nextTick(Fe)},Fe=function(){if(!ze){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"))}},Ue=function(){ae.req.on("finish",Ve)};return oe(ae)?(ae.on("complete",Ve),ae.on("abort",$e),ae.req?Ue():ae.on("request",Ue)):he&&!ue&&(ae.on("end",pe),ae.on("close",pe)),Ce(ae)&&ae.on("exit",_e),ae.on("end",Oe),ae.on("finish",Ve),le.error!==!1&&ae.on("error",At),ae.on("close",$e),function(){ze=!0,ae.removeListener("complete",Ve),ae.removeListener("abort",$e),ae.removeListener("request",Ue),ae.req&&ae.req.removeListener("finish",Ve),ae.removeListener("end",pe),ae.removeListener("close",pe),ae.removeListener("finish",Ve),ae.removeListener("exit",_e),ae.removeListener("end",Oe),ae.removeListener("error",At),ae.removeListener("close",$e)}};g.exports=ie}).call(this)}).call(this,r("_process"))},{_process:50,once:48}],22:[function(r,g,V){var k=Object.create||Ue,$=Object.keys||xe,re=Function.prototype.bind||Dt;function oe(){(!this._events||!Object.prototype.hasOwnProperty.call(this,"_events"))&&(this._events=k(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}g.exports=oe,oe.EventEmitter=oe,oe.prototype._events=void 0,oe.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(oe,"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}}):oe.defaultMaxListeners=Ce,oe.prototype.setMaxListeners=function(kt){if(typeof kt!="number"||kt<0||isNaN(kt))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=kt,this};function le(qe){return qe._maxListeners===void 0?oe.defaultMaxListeners:qe._maxListeners}oe.prototype.getMaxListeners=function(){return le(this)};function Ie(qe,kt,jt){if(kt)qe.call(jt);else for(var Pt=qe.length,ti=$e(qe,Pt),ei=0;ei<Pt;++ei)ti[ei].call(jt)}function ue(qe,kt,jt,Pt){if(kt)qe.call(jt,Pt);else for(var ti=qe.length,ei=$e(qe,ti),Et=0;Et<ti;++Et)ei[Et].call(jt,Pt)}function de(qe,kt,jt,Pt,ti){if(kt)qe.call(jt,Pt,ti);else for(var ei=qe.length,Et=$e(qe,ei),ni=0;ni<ei;++ni)Et[ni].call(jt,Pt,ti)}function Ne(qe,kt,jt,Pt,ti,ei){if(kt)qe.call(jt,Pt,ti,ei);else for(var Et=qe.length,ni=$e(qe,Et),ri=0;ri<Et;++ri)ni[ri].call(jt,Pt,ti,ei)}function he(qe,kt,jt,Pt){if(kt)qe.apply(jt,Pt);else for(var ti=qe.length,ei=$e(qe,ti),Et=0;Et<ti;++Et)ei[Et].apply(jt,Pt)}oe.prototype.emit=function(kt){var jt,Pt,ti,ei,Et,ni,ri=kt==="error";if(ni=this._events,ni)ri=ri&&ni.error==null;else if(!ri)return!1;if(ri){if(arguments.length>1&&(jt=arguments[1]),jt instanceof Error)throw jt;var ci=new Error('Unhandled "error" event. ('+jt+")");throw ci.context=jt,ci}if(Pt=ni[kt],!Pt)return!1;var Ci=typeof Pt=="function";switch(ti=arguments.length,ti){case 1:Ie(Pt,Ci,this);break;case 2:ue(Pt,Ci,this,arguments[1]);break;case 3:de(Pt,Ci,this,arguments[1],arguments[2]);break;case 4:Ne(Pt,Ci,this,arguments[1],arguments[2],arguments[3]);break;default:for(ei=new Array(ti-1),Et=1;Et<ti;Et++)ei[Et-1]=arguments[Et];he(Pt,Ci,this,ei)}return!0};function ze(qe,kt,jt,Pt){var ti,ei,Et;if(typeof jt!="function")throw new TypeError('"listener" argument must be a function');if(ei=qe._events,ei?(ei.newListener&&(qe.emit("newListener",kt,jt.listener?jt.listener:jt),ei=qe._events),Et=ei[kt]):(ei=qe._events=k(null),qe._eventsCount=0),!Et)Et=ei[kt]=jt,++qe._eventsCount;else if(typeof Et=="function"?Et=ei[kt]=Pt?[jt,Et]:[Et,jt]:Pt?Et.unshift(jt):Et.push(jt),!Et.warned&&(ti=le(qe),ti&&ti>0&&Et.length>ti)){Et.warned=!0;var ni=new Error("Possible EventEmitter memory leak detected. "+Et.length+' "'+String(kt)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');ni.name="MaxListenersExceededWarning",ni.emitter=qe,ni.type=kt,ni.count=Et.length,typeof console=="object"&&console.warn&&console.warn("%s: %s",ni.name,ni.message)}return qe}oe.prototype.addListener=function(kt,jt){return ze(this,kt,jt,!1)},oe.prototype.on=oe.prototype.addListener,oe.prototype.prependListener=function(kt,jt){return ze(this,kt,jt,!0)};function pe(){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),kt=0;kt<qe.length;++kt)qe[kt]=arguments[kt];this.listener.apply(this.target,qe)}}function Ve(qe,kt,jt){var Pt={fired:!1,wrapFn:void 0,target:qe,type:kt,listener:jt},ti=re.call(pe,Pt);return ti.listener=jt,Pt.wrapFn=ti,ti}oe.prototype.once=function(kt,jt){if(typeof jt!="function")throw new TypeError('"listener" argument must be a function');return this.on(kt,Ve(this,kt,jt)),this},oe.prototype.prependOnceListener=function(kt,jt){if(typeof jt!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(kt,Ve(this,kt,jt)),this},oe.prototype.removeListener=function(kt,jt){var Pt,ti,ei,Et,ni;if(typeof jt!="function")throw new TypeError('"listener" argument must be a function');if(ti=this._events,!ti)return this;if(Pt=ti[kt],!Pt)return this;if(Pt===jt||Pt.listener===jt)--this._eventsCount===0?this._events=k(null):(delete ti[kt],ti.removeListener&&this.emit("removeListener",kt,Pt.listener||jt));else if(typeof Pt!="function"){for(ei=-1,Et=Pt.length-1;Et>=0;Et--)if(Pt[Et]===jt||Pt[Et].listener===jt){ni=Pt[Et].listener,ei=Et;break}if(ei<0)return this;ei===0?Pt.shift():At(Pt,ei),Pt.length===1&&(ti[kt]=Pt[0]),ti.removeListener&&this.emit("removeListener",kt,ni||jt)}return this},oe.prototype.removeAllListeners=function(kt){var jt,Pt,ti;if(Pt=this._events,!Pt)return this;if(!Pt.removeListener)return arguments.length===0?(this._events=k(null),this._eventsCount=0):Pt[kt]&&(--this._eventsCount===0?this._events=k(null):delete Pt[kt]),this;if(arguments.length===0){var ei=$(Pt),Et;for(ti=0;ti<ei.length;++ti)Et=ei[ti],Et!=="removeListener"&&this.removeAllListeners(Et);return this.removeAllListeners("removeListener"),this._events=k(null),this._eventsCount=0,this}if(jt=Pt[kt],typeof jt=="function")this.removeListener(kt,jt);else if(jt)for(ti=jt.length-1;ti>=0;ti--)this.removeListener(kt,jt[ti]);return this};function Oe(qe,kt,jt){var Pt=qe._events;if(!Pt)return[];var ti=Pt[kt];return ti?typeof ti=="function"?jt?[ti.listener||ti]:[ti]:jt?Fe(ti):$e(ti,ti.length):[]}oe.prototype.listeners=function(kt){return Oe(this,kt,!0)},oe.prototype.rawListeners=function(kt){return Oe(this,kt,!1)},oe.listenerCount=function(qe,kt){return typeof qe.listenerCount=="function"?qe.listenerCount(kt):_e.call(qe,kt)},oe.prototype.listenerCount=_e;function _e(qe){var kt=this._events;if(kt){var jt=kt[qe];if(typeof jt=="function")return 1;if(jt)return jt.length}return 0}oe.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function At(qe,kt){for(var jt=kt,Pt=jt+1,ti=qe.length;Pt<ti;jt+=1,Pt+=1)qe[jt]=qe[Pt];qe.pop()}function $e(qe,kt){for(var jt=new Array(kt),Pt=0;Pt<kt;++Pt)jt[Pt]=qe[Pt];return jt}function Fe(qe){for(var kt=new Array(qe.length),jt=0;jt<kt.length;++jt)kt[jt]=qe[jt].listener||qe[jt];return kt}function Ue(qe){var kt=function(){};return kt.prototype=qe,new kt}function xe(qe){for(var kt in qe)Object.prototype.hasOwnProperty.call(qe,kt);return kt}function Dt(qe){var kt=this;return function(){return kt.apply(qe,arguments)}}},{}],23:[function(r,g,V){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */V.read=function(k,$,re,oe,Ce){var ie,ae,le=Ce*8-oe-1,Ie=(1<<le)-1,ue=Ie>>1,de=-7,Ne=re?Ce-1:0,he=re?-1:1,ze=k[$+Ne];for(Ne+=he,ie=ze&(1<<-de)-1,ze>>=-de,de+=le;de>0;ie=ie*256+k[$+Ne],Ne+=he,de-=8);for(ae=ie&(1<<-de)-1,ie>>=-de,de+=oe;de>0;ae=ae*256+k[$+Ne],Ne+=he,de-=8);if(ie===0)ie=1-ue;else{if(ie===Ie)return ae?NaN:(ze?-1:1)*(1/0);ae=ae+Math.pow(2,oe),ie=ie-ue}return(ze?-1:1)*ae*Math.pow(2,ie-oe)},V.write=function(k,$,re,oe,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,ze=oe?0:ie-1,pe=oe?1:-1,Ve=$<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;k[re+ze]=le&255,ze+=pe,le/=256,Ce-=8);for(ae=ae<<Ce|le,ue+=Ce;ue>0;k[re+ze]=ae&255,ze+=pe,ae/=256,ue-=8);k[re+ze-pe]|=Ve*128}},{}],24:[function(r,g,V){typeof Object.create=="function"?g.exports=function($,re){re&&($.super_=re,$.prototype=Object.create(re.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}))}:g.exports=function($,re){if(re){$.super_=re;var oe=function(){};oe.prototype=re.prototype,$.prototype=new oe,$.prototype.constructor=$}}},{}],25:[function(r,g,V){Object.defineProperty(V,"__esModule",{value:!0});var k=function(){function $(re,oe){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=re,this.value=oe}return $.prototype.rotateLeft=function(){var re=this.parent,oe=this.brother,Ce=this.leftChild,ie=this.rightChild;if(!ie)throw new Error("unknown error");var ae=ie.leftChild,le=ie.rightChild;return re&&(re.leftChild===this?re.leftChild=ie:re.rightChild===this&&(re.rightChild=ie)),ie.parent=re,ie.brother=oe,ie.leftChild=this,ie.rightChild=le,oe&&(oe.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 re=this.parent,oe=this.brother,Ce=this.leftChild;if(!Ce)throw new Error("unknown error");var ie=this.rightChild,ae=Ce.leftChild,le=Ce.rightChild;return re&&(re.leftChild===this?re.leftChild=Ce:re.rightChild===this&&(re.rightChild=Ce)),Ce.parent=re,Ce.brother=oe,Ce.leftChild=ae,Ce.rightChild=this,oe&&(oe.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(k),V.default=k},{}],26:[function(r,g,V){var k=this&&this.__generator||function(re,oe){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=oe.call(re,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(V,"__esModule",{value:!0}),$.sigma=3,$.bucketSize=5e3;function $(re){var oe=this;re===void 0&&(re=[]);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(ze){if(!this.empty()){var pe=0;if(ie===le){for(var Ve=ae;Ve<=Ie;++Ve)ze(Ce[ie][Ve],pe++);return}for(var Ve=ae;Ve<$.bucketSize;++Ve)ze(Ce[ie][Ve],pe++);for(var Ve=ie+1;Ve<le;++Ve)for(var Oe=0;Oe<$.bucketSize;++Oe)ze(Ce[Ve][Oe],pe++);for(var Ve=0;Ve<=Ie;++Ve)ze(Ce[le][Ve],pe++)}};var Ne=function(ze){var pe=ie*$.bucketSize+ae,Ve=pe+ze,Oe=le*$.bucketSize+Ie;if(Ve<pe||Ve>Oe)throw new Error("pos should more than 0 and less than queue's size");var _e=Math.floor(Ve/$.bucketSize),At=Ve%$.bucketSize;return{curNodeBucketIndex:_e,curNodePointerIndex:At}};this.getElementByPos=function(ze){var pe=Ne(ze),Ve=pe.curNodeBucketIndex,Oe=pe.curNodePointerIndex;return Ce[Ve][Oe]},this.eraseElementByPos=function(ze){var pe=this;if(ze<0||ze>de)throw new Error("pos should more than 0 and less than queue's size");if(ze===0)this.popFront();else if(ze===this.size())this.popBack();else{for(var Ve=[],Oe=ze+1;Oe<de;++Oe)Ve.push(this.getElementByPos(Oe));this.cut(ze),this.popBack(),Ve.forEach(function(_e){return pe.pushBack(_e)})}},this.eraseElementByValue=function(ze){if(!this.empty()){var pe=[];this.forEach(function(_e){_e!==ze&&pe.push(_e)});for(var Ve=pe.length,Oe=0;Oe<Ve;++Oe)this.setElementByPos(Oe,pe[Oe]);this.cut(Ve-1)}};var he=function(ze){for(var pe=[],Ve=ze*$.sigma,Oe=Math.max(Math.ceil(Ve/$.bucketSize),2),_e=0;_e<Oe;++_e)pe.push(new Array($.bucketSize));var At=Math.ceil(ze/$.bucketSize),$e=Math.floor(Oe/2)-Math.floor(At/2),Fe=$e,Ue=0;if(this.size())for(var _e=0;_e<At;++_e){for(var xe=0;xe<$.bucketSize;++xe)if(pe[$e+_e][xe]=this.front(),this.popFront(),this.empty()){Fe=$e+_e,Ue=xe;break}if(this.empty())break}Ce=pe,ie=$e,ae=0,le=Fe,Ie=Ue,ue=Oe,de=ze};this.pushBack=function(ze){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]=ze},this.popBack=function(){this.empty()||(this.size()!==1&&(Ie>0?--Ie:ie<le&&(--le,Ie=$.bucketSize-1)),de>0&&--de)},this.setElementByPos=function(ze,pe){var Ve=Ne(ze),Oe=Ve.curNodeBucketIndex,_e=Ve.curNodePointerIndex;Ce[Oe][_e]=pe},this.insert=function(ze,pe,Ve){var Oe=this;if(Ve===void 0&&(Ve=1),ze===0)for(;Ve--;)this.pushFront(pe);else if(ze===this.size())for(;Ve--;)this.pushBack(pe);else{for(var _e=[],At=ze;At<de;++At)_e.push(this.getElementByPos(At));this.cut(ze-1);for(var At=0;At<Ve;++At)this.pushBack(pe);_e.forEach(function($e){return Oe.pushBack($e)})}},this.find=function(ze){if(ie===le){for(var pe=ae;pe<=Ie;++pe)if(Ce[ie][pe]===ze)return!0;return!1}for(var pe=ae;pe<$.bucketSize;++pe)if(Ce[ie][pe]===ze)return!0;for(var pe=ie+1;pe<le;++pe)for(var Ve=0;Ve<$.bucketSize;++Ve)if(Ce[pe][Ve]===ze)return!0;for(var pe=0;pe<=Ie;++pe)if(Ce[le][pe]===ze)return!0;return!1},this.reverse=function(){for(var ze=0,pe=de-1;ze<pe;){var Ve=this.getElementByPos(ze);this.setElementByPos(ze,this.getElementByPos(pe)),this.setElementByPos(pe,Ve),++ze,--pe}},this.unique=function(){if(!this.empty()){var ze=[],pe=this.front();this.forEach(function(Oe,_e){(_e===0||Oe!==pe)&&(ze.push(Oe),pe=Oe)});for(var Ve=0;Ve<de;++Ve)this.setElementByPos(Ve,ze[Ve]);this.cut(ze.length-1)}},this.sort=function(ze){var pe=[];this.forEach(function(Oe){pe.push(Oe)}),pe.sort(ze);for(var Ve=0;Ve<de;++Ve)this.setElementByPos(Ve,pe[Ve])},this.pushFront=function(ze){this.empty()||(ie===0&&ae===0&&he.call(this,this.size()),ae>0?--ae:ie>0&&(--ie,ae=$.bucketSize-1)),++de,Ce[ie][ae]=ze},this.popFront=function(){this.empty()||(this.size()!==1&&(ae<$.bucketSize-1?++ae:ie<le&&(++ie,ae=0)),de>0&&--de)},this.shrinkToFit=function(){var ze=this,pe=[];this.forEach(function(At){pe.push(At)});var Ve=pe.length;Ce=[];for(var Oe=Math.ceil(Ve/$.bucketSize),_e=0;_e<Oe;++_e)Ce.push(new Array($.bucketSize));this.clear(),pe.forEach(function(At){return ze.pushBack(At)})},this.cut=function(ze){if(ze<0){this.clear();return}var pe=Ne(ze),Ve=pe.curNodeBucketIndex,Oe=pe.curNodePointerIndex;le=Ve,Ie=Oe,de=ze+1},this[Symbol.iterator]=function(){return function(){var pe,pe,pe,ze,pe;return k(this,function(Ve){switch(Ve.label){case 0:if(de===0)return[2];if(ie!==le)return[3,5];pe=ae,Ve.label=1;case 1:return pe<=Ie?[4,Ce[ie][pe]]:[3,4];case 2:Ve.sent(),Ve.label=3;case 3:return++pe,[3,1];case 4:return[2];case 5:pe=ae,Ve.label=6;case 6:return pe<$.bucketSize?[4,Ce[ie][pe]]:[3,9];case 7:Ve.sent(),Ve.label=8;case 8:return++pe,[3,6];case 9:pe=ie+1,Ve.label=10;case 10:if(!(pe<le))return[3,15];ze=0,Ve.label=11;case 11:return ze<$.bucketSize?[4,Ce[pe][ze]]:[3,14];case 12:Ve.sent(),Ve.label=13;case 13:return++ze,[3,11];case 14:return++pe,[3,10];case 15:pe=0,Ve.label=16;case 16:return pe<=Ie?[4,Ce[le][pe]]:[3,19];case 17:Ve.sent(),Ve.label=18;case 18:return++pe,[3,16];case 19:return[2]}})}()},function(){var ze=$.bucketSize;re.size?ze=re.size():re.length&&(ze=re.length);var pe=ze*$.sigma;ue=Math.ceil(pe/$.bucketSize),ue=Math.max(ue,3);for(var Ve=0;Ve<ue;++Ve)Ce.push(new Array($.bucketSize));var Oe=Math.ceil(ze/$.bucketSize);ie=Math.floor(ue/2)-Math.floor(Oe/2),le=ie,re.forEach(function(_e){return oe.pushBack(_e)})}(),Object.freeze(this)}Object.freeze($),V.default=$},{}],27:[function(r,g,V){var k=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(pe){return function(Ve){return ze([pe,Ve])}}function ze(pe){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=pe[0]&2?ue.return:pe[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,pe[1])).done)return de;switch(ue=0,de&&(pe=[pe[0]&2,de.value]),pe[0]){case 0:case 1:de=pe;break;case 4:return le.label++,{value:pe[1],done:!1};case 5:le.label++,ue=pe[1],pe=[0];continue;case 7:pe=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(pe[0]===6||pe[0]===2)){le=0;continue}if(pe[0]===3&&(!de||pe[1]>de[0]&&pe[1]<de[3])){le.label=pe[1];break}if(pe[0]===6&&le.label<de[1]){le.label=de[1],de=pe;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(pe);break}de[2]&&le.ops.pop(),le.trys.pop();continue}pe=ae.call(ie,le)}catch(Ve){pe=[6,Ve],ue=0}finally{Ie=de=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[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(V,"__esModule",{value:!0});var re=r("../LinkList/LinkList"),oe=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(ze){var pe,Ve,Oe=0,_e="";if(typeof ze=="number")Oe=Math.floor(ze),Oe=(Oe<<5)-Oe,Oe=Oe&Oe;else{typeof ze!="string"?_e=JSON.stringify(ze):_e=ze;try{for(var At=$(_e),$e=At.next();!$e.done;$e=At.next()){var Fe=$e.value,Ue=Fe.charCodeAt(0);Oe=(Oe<<5)-Oe+Ue,Oe=Oe&Oe}}catch(xe){pe={error:xe}}finally{try{$e&&!$e.done&&(Ve=At.return)&&Ve.call(At)}finally{if(pe)throw pe.error}}}return Oe^=Oe>>>16,Oe},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(ze){var pe=0;de.forEach(function(Ve){Ve.forEach(function(Oe){ze(Oe,pe++)})})};var he=function(ze){if(!(ze>=Ce.maxSize)){Ne=ze*2;var pe=[];de.forEach(function(Ve,Oe){if(!Ve.empty()){if(Ve instanceof re.default&&Ve.size()===1){var _e=Ve.front(),At=_e.key,$e=_e.value;pe[le(At)&Ne-1]=new re.default([{key:At,value:$e}])}else if(Ve instanceof oe.default){var Fe=new re.default,Ue=new re.default;Ve.forEach(function(qe){var kt=le(qe.key);kt&ze?Ue.pushBack(qe):Fe.pushBack(qe)}),Fe.size()>Ce.untreeifyThreshold?pe[Oe]=new oe.default(Fe):Fe.size()&&(pe[Oe]=Fe),Ue.size()>Ce.untreeifyThreshold?pe[Oe+ze]=new oe.default(Ue):Ue.size()&&(pe[Oe+ze]=Ue)}else{var xe=new re.default,Dt=new re.default;Ve.forEach(function(qe){var kt=le(qe.key);kt&ze?Dt.pushBack(qe):xe.pushBack(qe)}),xe.size()&&(pe[Oe]=xe),Dt.size()&&(pe[Oe+ze]=Dt)}de[Oe].clear()}}),de=pe}};this.setElement=function(ze,pe){var Ve,Oe;if(ze==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(pe==null){this.eraseElementByKey(ze);return}var _e=le(ze)&Ne-1;if(!de[_e])++ue,de[_e]=new re.default([{key:ze,value:pe}]);else{var At=de[_e].size();if(de[_e]instanceof re.default){try{for(var $e=$(de[_e]),Fe=$e.next();!Fe.done;Fe=$e.next()){var Ue=Fe.value;if(Ue.key===ze){Ue.value=pe;return}}}catch(Dt){Ve={error:Dt}}finally{try{Fe&&!Fe.done&&(Oe=$e.return)&&Oe.call($e)}finally{if(Ve)throw Ve.error}}de[_e].pushBack({key:ze,value:pe}),de[_e].size()>=Ce.treeifyThreshold&&(de[_e]=new oe.default(de[_e]))}else de[_e].setElement(ze,pe);var xe=de[_e].size();ue+=xe-At}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.getElementByKey=function(ze){var pe,Ve,Oe=le(ze)&Ne-1;if(de[Oe]){if(de[Oe]instanceof oe.default)return de[Oe].getElementByKey(ze);try{for(var _e=$(de[Oe]),At=_e.next();!At.done;At=_e.next()){var $e=At.value;if($e.key===ze)return $e.value}}catch(Fe){pe={error:Fe}}finally{try{At&&!At.done&&(Ve=_e.return)&&Ve.call(_e)}finally{if(pe)throw pe.error}}}},this.eraseElementByKey=function(ze){var pe,Ve,Oe=le(ze)&Ne-1;if(de[Oe]){var _e=de[Oe].size();if(de[Oe]instanceof oe.default)de[Oe].eraseElementByKey(ze),de[Oe].size()<=Ce.untreeifyThreshold&&(de[Oe]=new re.default(de[Oe]));else{var At=-1;try{for(var $e=$(de[Oe]),Fe=$e.next();!Fe.done;Fe=$e.next()){var Ue=Fe.value;if(++At,Ue.key===ze){de[Oe].eraseElementByPos(At);break}}}catch(Dt){pe={error:Dt}}finally{try{Fe&&!Fe.done&&(Ve=$e.return)&&Ve.call($e)}finally{if(pe)throw pe.error}}}var xe=de[Oe].size();ue+=xe-_e}},this.find=function(ze){var pe,Ve,Oe=le(ze)&Ne-1;if(!de[Oe])return!1;if(de[Oe]instanceof oe.default)return de[Oe].find(ze);try{for(var _e=$(de[Oe]),At=_e.next();!At.done;At=_e.next()){var $e=At.value;if($e.key===ze)return!0}}catch(Fe){pe={error:Fe}}finally{try{At&&!At.done&&(Ve=_e.return)&&Ve.call(_e)}finally{if(pe)throw pe.error}}return!1},this[Symbol.iterator]=function(){return function(){var ze,pe,Ve,Oe,_e,At,$e;return k(this,function(Fe){switch(Fe.label){case 0:ze=0,Fe.label=1;case 1:if(!(ze<Ne))return[3,10];for(;ze<Ne&&!de[ze];)++ze;if(ze>=Ne)return[3,10];Fe.label=2;case 2:Fe.trys.push([2,7,8,9]),pe=(At=void 0,$(de[ze])),Ve=pe.next(),Fe.label=3;case 3:return Ve.done?[3,6]:(Oe=Ve.value,[4,Oe]);case 4:Fe.sent(),Fe.label=5;case 5:return Ve=pe.next(),[3,3];case 6:return[3,9];case 7:return _e=Fe.sent(),At={error:_e},[3,9];case 8:try{Ve&&!Ve.done&&($e=pe.return)&&$e.call(pe)}finally{if(At)throw At.error}return[7];case 9:return++ze,[3,1];case 10:return[2]}})}()},ie.forEach(function(ze){var pe=ze.key,Ve=ze.value;return Ie.setElement(pe,Ve)}),Object.freeze(this)}Object.freeze(Ce),V.default=Ce},{"../LinkList/LinkList":29,"../Map/Map":30}],28:[function(r,g,V){var k=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(pe){return function(Ve){return ze([pe,Ve])}}function ze(pe){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=pe[0]&2?ue.return:pe[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,pe[1])).done)return de;switch(ue=0,de&&(pe=[pe[0]&2,de.value]),pe[0]){case 0:case 1:de=pe;break;case 4:return le.label++,{value:pe[1],done:!1};case 5:le.label++,ue=pe[1],pe=[0];continue;case 7:pe=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(pe[0]===6||pe[0]===2)){le=0;continue}if(pe[0]===3&&(!de||pe[1]>de[0]&&pe[1]<de[3])){le.label=pe[1];break}if(pe[0]===6&&le.label<de[1]){le.label=de[1],de=pe;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(pe);break}de[2]&&le.ops.pop(),le.trys.pop();continue}pe=ae.call(ie,le)}catch(Ve){pe=[6,Ve],ue=0}finally{Ie=de=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[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(V,"__esModule",{value:!0});var re=r("../Set/Set"),oe=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(ze){var pe=0,Ve="";if(typeof ze=="number")pe=Math.floor(ze),pe=(pe<<5)-pe,pe=pe&pe;else{typeof ze!="string"?Ve=JSON.stringify(ze):Ve=ze;for(var Oe=0;Oe<Ve.length;Oe++){var _e=Ve.charCodeAt(Oe);pe=(pe<<5)-pe+_e,pe=pe&pe}}return pe^=pe>>>16,pe},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(ze){var pe=0;de.forEach(function(Ve){Ve.forEach(function(Oe){ze(Oe,pe++)})})};var he=function(ze){if(!(ze>=Ce.maxSize)){Ne=ze*2;var pe=[];de.forEach(function(Ve,Oe){if(!Ve.empty()){if(Ve instanceof oe.default&&Ve.size()===1){var _e=Ve.front();if(_e===void 0)throw new Error("unknown error");pe[le(_e)&Ne-1]=new oe.default([_e])}else if(Ve instanceof re.default){var At=new oe.default,$e=new oe.default;Ve.forEach(function(xe){var Dt=le(xe);Dt&ze?$e.pushBack(xe):At.pushBack(xe)}),At.size()>Ce.untreeifyThreshold?pe[Oe]=new re.default(At):At.size()&&(pe[Oe]=At),$e.size()>Ce.untreeifyThreshold?pe[Oe+ze]=new re.default($e):$e.size()&&(pe[Oe+ze]=$e)}else{var Fe=new oe.default,Ue=new oe.default;Ve.forEach(function(xe){var Dt=le(xe);Dt&ze?Ue.pushBack(xe):Fe.pushBack(xe)}),Fe.size()&&(pe[Oe]=Fe),Ue.size()&&(pe[Oe+ze]=Ue)}de[Oe].clear()}}),de=pe}};this.insert=function(ze){if(ze==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");var pe=le(ze)&Ne-1;if(!de[pe])de[pe]=new oe.default([ze]),++ue;else{var Ve=de[pe].size();if(de[pe]instanceof oe.default){if(de[pe].find(ze))return;de[pe].pushBack(ze),de[pe].size()>=Ce.treeifyThreshold&&(de[pe]=new re.default(de[pe]))}else de[pe].insert(ze);var Oe=de[pe].size();ue+=Oe-Ve}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.eraseElementByValue=function(ze){var pe=le(ze)&Ne-1;if(de[pe]){var Ve=de[pe].size();de[pe].eraseElementByValue(ze),de[pe]instanceof re.default&&de[pe].size()<=Ce.untreeifyThreshold&&(de[pe]=new oe.default(de[pe]));var Oe=de[pe].size();ue+=Oe-Ve}},this.find=function(ze){var pe=le(ze)&Ne-1;return de[pe]?de[pe].find(ze):!1},this[Symbol.iterator]=function(){return function(){var ze,pe,Ve,Oe,_e,At,$e;return k(this,function(Fe){switch(Fe.label){case 0:ze=0,Fe.label=1;case 1:if(!(ze<Ne))return[3,10];for(;ze<Ne&&!de[ze];)++ze;if(ze>=Ne)return[3,10];Fe.label=2;case 2:Fe.trys.push([2,7,8,9]),pe=(At=void 0,$(de[ze])),Ve=pe.next(),Fe.label=3;case 3:return Ve.done?[3,6]:(Oe=Ve.value,[4,Oe]);case 4:Fe.sent(),Fe.label=5;case 5:return Ve=pe.next(),[3,3];case 6:return[3,9];case 7:return _e=Fe.sent(),At={error:_e},[3,9];case 8:try{Ve&&!Ve.done&&($e=pe.return)&&$e.call(pe)}finally{if(At)throw At.error}return[7];case 9:return++ze,[3,1];case 10:return[2]}})}()},ie.forEach(function(ze){return Ie.insert(ze)}),Object.freeze(this)}Object.freeze(Ce),V.default=Ce},{"../LinkList/LinkList":29,"../Set/Set":33}],29:[function(r,g,V){var k=this&&this.__generator||function(oe,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(ze){return Ne([he,ze])}}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(oe,ie)}catch(ze){he=[6,ze],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(V,"__esModule",{value:!0});var $=function(){function oe(Ce){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=Ce}return oe}();function re(oe){var Ce=this;oe===void 0&&(oe=[]);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 ze=Ne.next;for(ie+=de;de--;)Ne.next=new $(ue),Ne.next.pre=Ne,Ne=Ne.next;Ne.next=ze,ze&&(ze.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 k(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]}})}()},oe.forEach(function(Ie){return Ce.pushBack(Ie)}),Object.freeze(this)}Object.freeze(re),V.default=re},{}],30:[function(r,g,V){var k=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(ze){return function(pe){return he([ze,pe])}}function he(ze){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=ze[0]&2?Ie.return:ze[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,ze[1])).done)return ue;switch(Ie=0,ue&&(ze=[ze[0]&2,ue.value]),ze[0]){case 0:case 1:ue=ze;break;case 4:return ae.label++,{value:ze[1],done:!1};case 5:ae.label++,Ie=ze[1],ze=[0];continue;case 7:ze=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(ze[0]===6||ze[0]===2)){ae=0;continue}if(ze[0]===3&&(!ue||ze[1]>ue[0]&&ze[1]<ue[3])){ae.label=ze[1];break}if(ze[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=ze;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(ze);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}ze=ie.call(Ce,ae)}catch(pe){ze=[6,pe],Ie=0}finally{le=ue=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[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(V,"__esModule",{value:!0});var re=r("../Base/TreeNode");function oe(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(xe,Dt){return xe<Dt?-1:xe>Dt?1:0};var le=0,Ie=new re.default;Ie.color=re.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(xe){if(!xe||xe.key===void 0)throw new Error("unknown error");return xe.leftChild?ue(xe.leftChild):xe},de=function(xe){if(!xe||xe.key===void 0)throw new Error("unknown error");return xe.rightChild?de(xe.rightChild):xe};this.front=function(){if(!this.empty()){var xe=ue(Ie);if(xe.key===void 0||xe.value===void 0)throw new Error("unknown error");return{key:xe.key,value:xe.value}}},this.back=function(){if(!this.empty()){var xe=de(Ie);if(xe.key===void 0||xe.value===void 0)throw new Error("unknown error");return{key:xe.key,value:xe.value}}},this.forEach=function(xe){var Dt,qe,kt=0;try{for(var jt=$(this),Pt=jt.next();!Pt.done;Pt=jt.next()){var ti=Pt.value;xe(ti,kt++)}}catch(ei){Dt={error:ei}}finally{try{Pt&&!Pt.done&&(qe=jt.return)&&qe.call(jt)}finally{if(Dt)throw Dt.error}}},this.getElementByPos=function(xe){var Dt,qe;if(xe<0||xe>=this.size())throw new Error("pos must more than 0 and less than set's size");var kt=0;try{for(var jt=$(this),Pt=jt.next();!Pt.done;Pt=jt.next()){var ti=Pt.value;if(kt===xe)return ti;++kt}}catch(ei){Dt={error:ei}}finally{try{Pt&&!Pt.done&&(qe=jt.return)&&qe.call(jt)}finally{if(Dt)throw Dt.error}}throw new Error("unknown Error")};var Ne=function(xe,Dt){if(!(!xe||xe.key===void 0||xe.value===void 0)){var qe=ie(xe.key,Dt);return qe===0?{key:xe.key,value:xe.value}:qe<0?Ne(xe.rightChild,Dt):Ne(xe.leftChild,Dt)||{key:xe.key,value:xe.value}}};this.lowerBound=function(xe){return Ne(Ie,xe)};var he=function(xe,Dt){if(!(!xe||xe.key===void 0||xe.value===void 0)){var qe=ie(xe.key,Dt);return qe<=0?he(xe.rightChild,Dt):he(xe.leftChild,Dt)||{key:xe.key,value:xe.value}}};this.upperBound=function(xe){return he(Ie,xe)};var ze=function(xe,Dt){if(!(!xe||xe.key===void 0||xe.value===void 0)){var qe=ie(xe.key,Dt);return qe===0?{key:xe.key,value:xe.value}:qe>0?ze(xe.leftChild,Dt):ze(xe.rightChild,Dt)||{key:xe.key,value:xe.value}}};this.reverseLowerBound=function(xe){return ze(Ie,xe)};var pe=function(xe,Dt){if(!(!xe||xe.key===void 0||xe.value===void 0)){var qe=ie(xe.key,Dt);return qe>=0?pe(xe.leftChild,Dt):pe(xe.rightChild,Dt)||{key:xe.key,value:xe.value}}};this.reverseUpperBound=function(xe){return pe(Ie,xe)};var Ve=function(xe){var Dt=xe.parent;if(!Dt){if(xe===Ie)return;throw new Error("unknown error")}if(xe.color===re.default.TreeNodeColorType.red){xe.color=re.default.TreeNodeColorType.black;return}var qe=xe.brother;if(!qe)throw new Error("unknown error");if(xe===Dt.leftChild){if(qe.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.black,Dt.color=re.default.TreeNodeColorType.red;var kt=Dt.rotateLeft();Ie===Dt&&(Ie=kt),Ve(xe)}else if(qe.color===re.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===re.default.TreeNodeColorType.red){qe.color=Dt.color,Dt.color=re.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=re.default.TreeNodeColorType.black);var kt=Dt.rotateLeft();Ie===Dt&&(Ie=kt),xe.color=re.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=re.default.TreeNodeColorType.black);var kt=qe.rotateRight();Ie===qe&&(Ie=kt),Ve(xe)}else(!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&(qe.color=re.default.TreeNodeColorType.red,Ve(Dt))}else if(xe===Dt.rightChild){if(qe.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.black,Dt.color=re.default.TreeNodeColorType.red;var kt=Dt.rotateRight();Ie===Dt&&(Ie=kt),Ve(xe)}else if(qe.color===re.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===re.default.TreeNodeColorType.red){qe.color=Dt.color,Dt.color=re.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=re.default.TreeNodeColorType.black);var kt=Dt.rotateRight();Ie===Dt&&(Ie=kt),xe.color=re.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=re.default.TreeNodeColorType.black);var kt=qe.rotateLeft();Ie===qe&&(Ie=kt),Ve(xe)}else(!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&(qe.color=re.default.TreeNodeColorType.red,Ve(Dt))}},Oe=function(xe){for(var Dt=xe;Dt.leftChild||Dt.rightChild;){if(Dt.rightChild){Dt=ue(Dt.rightChild);var qe=xe.key;xe.key=Dt.key,Dt.key=qe;var kt=xe.value;xe.value=Dt.value,Dt.value=kt,xe=Dt}if(Dt.leftChild){Dt=de(Dt.leftChild);var qe=xe.key;xe.key=Dt.key,Dt.key=qe;var kt=xe.value;xe.value=Dt.value,Dt.value=kt,xe=Dt}}Ve(Dt),Dt&&Dt.remove(),--le,Ie.color=re.default.TreeNodeColorType.black},_e=function(xe,Dt){if(!xe||xe.key===void 0)return!1;var qe=_e(xe.leftChild,Dt);return qe||Dt(xe)?!0:_e(xe.rightChild,Dt)};this.eraseElementByPos=function(xe){if(xe<0||xe>=le)throw new Error("pos must more than 0 and less than set's size");var Dt=0;_e(Ie,function(qe){return xe===Dt?(Oe(qe),!0):(++Dt,!1)})},this.eraseElementByKey=function(xe){if(!this.empty()){var Dt=Fe(Ie,xe);Dt===void 0||Dt.key===void 0||ie(Dt.key,xe)!==0||Oe(Dt)}};var At=function(xe,Dt){if(!xe||xe.key===void 0)throw new Error("unknown error");var qe=ie(Dt,xe.key);return qe<0?xe.leftChild?At(xe.leftChild,Dt):(xe.leftChild=new re.default,xe.leftChild.parent=xe,xe.leftChild.brother=xe.rightChild,xe.rightChild&&(xe.rightChild.brother=xe.leftChild),xe.leftChild):qe>0?xe.rightChild?At(xe.rightChild,Dt):(xe.rightChild=new re.default,xe.rightChild.parent=xe,xe.rightChild.brother=xe.leftChild,xe.leftChild&&(xe.leftChild.brother=xe.rightChild),xe.rightChild):xe},$e=function(xe){var Dt=xe.parent;if(!Dt){if(xe===Ie)return;throw new Error("unknown error")}if(Dt.color!==re.default.TreeNodeColorType.black&&Dt.color===re.default.TreeNodeColorType.red){var qe=Dt.brother,kt=Dt.parent;if(!kt)throw new Error("unknown error");if(qe&&qe.color===re.default.TreeNodeColorType.red)qe.color=Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red,$e(kt);else if(!qe||qe.color===re.default.TreeNodeColorType.black){if(Dt===kt.leftChild){if(xe===Dt.leftChild){Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red;var jt=kt.rotateRight();kt===Ie&&(Ie=jt)}else if(xe===Dt.rightChild){var jt=Dt.rotateLeft();kt===Ie&&(Ie=jt),$e(Dt)}}else if(Dt===kt.rightChild){if(xe===Dt.leftChild){var jt=Dt.rotateRight();kt===Ie&&(Ie=jt),$e(Dt)}else if(xe===Dt.rightChild){Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red;var jt=kt.rotateLeft();kt===Ie&&(Ie=jt)}}}}};this.setElement=function(xe,Dt){if(xe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(Dt==null){this.eraseElementByKey(xe);return}if(this.empty()){++le,Ie.key=xe,Ie.value=Dt,Ie.color=re.default.TreeNodeColorType.black;return}var qe=At(Ie,xe);if(qe.key!==void 0&&ie(qe.key,xe)===0){qe.value=Dt;return}++le,qe.key=xe,qe.value=Dt,$e(qe),Ie.color=re.default.TreeNodeColorType.black};var Fe=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(Dt,xe.key);return qe<0?Fe(xe.leftChild,Dt):qe>0?Fe(xe.rightChild,Dt):xe}};this.find=function(xe){return!!Fe(Ie,xe)},this.getElementByKey=function(xe){var Dt=Fe(Ie,xe);if((Dt==null?void 0:Dt.key)===void 0||(Dt==null?void 0:Dt.value)===void 0)throw new Error("unknown error");return Dt.value},this.union=function(xe){var Dt=this;xe.forEach(function(qe){var kt=qe.key,jt=qe.value;return Dt.setElement(kt,jt)})},this.getHeight=function(){if(this.empty())return 0;var xe=function(Dt){return Dt?Math.max(xe(Dt.leftChild),xe(Dt.rightChild))+1:1};return xe(Ie)};var Ue=function(xe){return k(this,function(Dt){switch(Dt.label){case 0:return!xe||xe.key===void 0||xe.value===void 0?[2]:[5,$(Ue(xe.leftChild))];case 1:return Dt.sent(),[4,{key:xe.key,value:xe.value}];case 2:return Dt.sent(),[5,$(Ue(xe.rightChild))];case 3:return Dt.sent(),[2]}})};this[Symbol.iterator]=function(){return Ue(Ie)},Ce.forEach(function(xe){var Dt=xe.key,qe=xe.value;return ae.setElement(Dt,qe)}),Object.freeze(this)}Object.freeze(oe),V.default=oe},{"../Base/TreeNode":25}],31:[function(r,g,V){Object.defineProperty(V,"__esModule",{value:!0});function k($,re){$===void 0&&($=[]),re=re||function(le,Ie){return le>Ie?-1:le<Ie?1:0};var oe=[];$.forEach(function(le){return oe.push(le)});var Ce=oe.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=oe[le];oe[le]=oe[Ie],oe[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&&re(oe[le],oe[Ie])>0&&ie(le,Ie),ue<Ce&&re(oe[le],oe[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&&re(oe[de],oe[Ne])>0&&(he=Ne),re(oe[Ie],oe[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,oe.length=0},this.push=function(le){if(oe.push(le),++Ce,Ce!==1)for(var Ie=Ce-1;Ie>0;){var ue=Math.floor((Ie-1)/2);if(re(oe[ue],le)<=0)break;ae(ue),Ie=ue}},this.pop=function(){if(!this.empty()){if(this.size()===1){--Ce;return}var le=oe[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()&&re(oe[ue],oe[de])>0&&(Ne=de),re(oe[Ne],le)>=0)break;oe[Ie]=oe[Ne],Ie=Ne}oe[Ie]=le}},this.top=function(){return oe[0]},Object.freeze(this)}Object.freeze(k),V.default=k},{}],32:[function(r,g,V){Object.defineProperty(V,"__esModule",{value:!0});var k=r("../LinkList/LinkList");function $(re){re===void 0&&(re=[]);var oe=new k.default(re);this.size=function(){return oe.size()},this.empty=function(){return oe.empty()},this.clear=function(){oe.clear()},this.push=function(Ce){oe.pushBack(Ce)},this.pop=function(){oe.popFront()},this.front=function(){return oe.front()},Object.freeze(this)}Object.freeze($),V.default=$},{"../LinkList/LinkList":29}],33:[function(r,g,V){var k=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(ze){return function(pe){return he([ze,pe])}}function he(ze){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=ze[0]&2?Ie.return:ze[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,ze[1])).done)return ue;switch(Ie=0,ue&&(ze=[ze[0]&2,ue.value]),ze[0]){case 0:case 1:ue=ze;break;case 4:return ae.label++,{value:ze[1],done:!1};case 5:ae.label++,Ie=ze[1],ze=[0];continue;case 7:ze=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(ze[0]===6||ze[0]===2)){ae=0;continue}if(ze[0]===3&&(!ue||ze[1]>ue[0]&&ze[1]<ue[3])){ae.label=ze[1];break}if(ze[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=ze;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(ze);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}ze=ie.call(Ce,ae)}catch(pe){ze=[6,pe],Ie=0}finally{le=ue=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[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(V,"__esModule",{value:!0});var re=r("../Base/TreeNode");function oe(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(xe,Dt){return xe<Dt?-1:xe>Dt?1:0};var le=0,Ie=new re.default;Ie.color=re.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=re.default.TreeNodeColorType.black};var ue=function(xe){if(!xe||xe.key===void 0)throw new Error("unknown error");return xe.leftChild?ue(xe.leftChild):xe},de=function(xe){if(!xe||xe.key===void 0)throw new Error("unknown error");return xe.rightChild?de(xe.rightChild):xe};this.front=function(){if(!this.empty()){var xe=ue(Ie);return xe.key}},this.back=function(){if(!this.empty()){var xe=de(Ie);return xe.key}},this.forEach=function(xe){var Dt,qe,kt=0;try{for(var jt=$(this),Pt=jt.next();!Pt.done;Pt=jt.next()){var ti=Pt.value;xe(ti,kt++)}}catch(ei){Dt={error:ei}}finally{try{Pt&&!Pt.done&&(qe=jt.return)&&qe.call(jt)}finally{if(Dt)throw Dt.error}}},this.getElementByPos=function(xe){var Dt,qe;if(xe<0||xe>=this.size())throw new Error("pos must more than 0 and less than set's size");var kt=0;try{for(var jt=$(this),Pt=jt.next();!Pt.done;Pt=jt.next()){var ti=Pt.value;if(kt===xe)return ti;++kt}}catch(ei){Dt={error:ei}}finally{try{Pt&&!Pt.done&&(qe=jt.return)&&qe.call(jt)}finally{if(Dt)throw Dt.error}}throw new Error("unknown error")};var Ne=function(xe){var Dt=xe.parent;if(!Dt){if(xe===Ie)return;throw new Error("unknown error")}if(xe.color===re.default.TreeNodeColorType.red){xe.color=re.default.TreeNodeColorType.black;return}var qe=xe.brother;if(!qe)throw new Error("unknown error");if(xe===Dt.leftChild){if(qe.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.black,Dt.color=re.default.TreeNodeColorType.red;var kt=Dt.rotateLeft();Ie===Dt&&(Ie=kt),Ne(xe)}else if(qe.color===re.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===re.default.TreeNodeColorType.red){qe.color=Dt.color,Dt.color=re.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=re.default.TreeNodeColorType.black);var kt=Dt.rotateLeft();Ie===Dt&&(Ie=kt),xe.color=re.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=re.default.TreeNodeColorType.black);var kt=qe.rotateRight();Ie===qe&&(Ie=kt),Ne(xe)}else(!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&(qe.color=re.default.TreeNodeColorType.red,Ne(Dt))}else if(xe===Dt.rightChild){if(qe.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.black,Dt.color=re.default.TreeNodeColorType.red;var kt=Dt.rotateRight();Ie===Dt&&(Ie=kt),Ne(xe)}else if(qe.color===re.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===re.default.TreeNodeColorType.red){qe.color=Dt.color,Dt.color=re.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=re.default.TreeNodeColorType.black);var kt=Dt.rotateRight();Ie===Dt&&(Ie=kt),xe.color=re.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=re.default.TreeNodeColorType.black);var kt=qe.rotateLeft();Ie===qe&&(Ie=kt),Ne(xe)}else(!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&(qe.color=re.default.TreeNodeColorType.red,Ne(Dt))}},he=function(xe){for(var Dt=xe;Dt.leftChild||Dt.rightChild;){if(Dt.rightChild){Dt=ue(Dt.rightChild);var qe=xe.key;xe.key=Dt.key,Dt.key=qe,xe=Dt}if(Dt.leftChild){Dt=de(Dt.leftChild);var qe=xe.key;xe.key=Dt.key,Dt.key=qe,xe=Dt}}Ne(Dt),Dt&&Dt.remove(),--le,Ie.color=re.default.TreeNodeColorType.black},ze=function(xe,Dt){if(!xe||xe.key===void 0)return!1;var qe=ze(xe.leftChild,Dt);return qe||Dt(xe)?!0:ze(xe.rightChild,Dt)};this.eraseElementByPos=function(xe){if(xe<0||xe>=le)throw new Error("pos must more than 0 and less than set's size");var Dt=0;ze(Ie,function(qe){return xe===Dt?(he(qe),!0):(++Dt,!1)})},this.eraseElementByValue=function(xe){if(!this.empty()){var Dt=Oe(Ie,xe);Dt===void 0||Dt.key===void 0||ie(Dt.key,xe)!==0||he(Dt)}};var pe=function(xe,Dt){if(!xe||xe.key===void 0)throw new Error("unknown error");var qe=ie(Dt,xe.key);return qe<0?xe.leftChild?pe(xe.leftChild,Dt):(xe.leftChild=new re.default,xe.leftChild.parent=xe,xe.leftChild.brother=xe.rightChild,xe.rightChild&&(xe.rightChild.brother=xe.leftChild),xe.leftChild):qe>0?xe.rightChild?pe(xe.rightChild,Dt):(xe.rightChild=new re.default,xe.rightChild.parent=xe,xe.rightChild.brother=xe.leftChild,xe.leftChild&&(xe.leftChild.brother=xe.rightChild),xe.rightChild):xe},Ve=function(xe){var Dt=xe.parent;if(!Dt){if(xe===Ie)return;throw new Error("unknown error")}if(Dt.color!==re.default.TreeNodeColorType.black&&Dt.color===re.default.TreeNodeColorType.red){var qe=Dt.brother,kt=Dt.parent;if(!kt)throw new Error("unknown error");if(qe&&qe.color===re.default.TreeNodeColorType.red)qe.color=Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red,Ve(kt);else if(!qe||qe.color===re.default.TreeNodeColorType.black){if(Dt===kt.leftChild){if(xe===Dt.leftChild){Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red;var jt=kt.rotateRight();kt===Ie&&(Ie=jt)}else if(xe===Dt.rightChild){var jt=Dt.rotateLeft();kt===Ie&&(Ie=jt),Ve(Dt)}}else if(Dt===kt.rightChild){if(xe===Dt.leftChild){var jt=Dt.rotateRight();kt===Ie&&(Ie=jt),Ve(Dt)}else if(xe===Dt.rightChild){Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red;var jt=kt.rotateLeft();kt===Ie&&(Ie=jt)}}}}};this.insert=function(xe){if(xe==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=xe,Ie.color=re.default.TreeNodeColorType.black;return}var Dt=pe(Ie,xe);Dt.key!==void 0&&ie(Dt.key,xe)===0||(++le,Dt.key=xe,Ve(Dt),Ie.color=re.default.TreeNodeColorType.black)};var Oe=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(Dt,xe.key);return qe<0?Oe(xe.leftChild,Dt):qe>0?Oe(xe.rightChild,Dt):xe}};this.find=function(xe){var Dt=Oe(Ie,xe);return Dt!==void 0&&Dt.key!==void 0&&ie(Dt.key,xe)===0};var _e=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(xe.key,Dt);if(qe===0)return xe.key;if(qe<0)return _e(xe.rightChild,Dt);var kt=_e(xe.leftChild,Dt);return kt!==void 0?kt:xe.key}};this.lowerBound=function(xe){return _e(Ie,xe)};var At=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(xe.key,Dt);if(qe<=0)return At(xe.rightChild,Dt);var kt=At(xe.leftChild,Dt);return kt!==void 0?kt:xe.key}};this.upperBound=function(xe){return At(Ie,xe)};var $e=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(xe.key,Dt);if(qe===0)return xe.key;if(qe>0)return $e(xe.leftChild,Dt);var kt=$e(xe.rightChild,Dt);return kt!==void 0?kt:xe.key}};this.reverseLowerBound=function(xe){return $e(Ie,xe)};var Fe=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(xe.key,Dt);if(qe>=0)return Fe(xe.leftChild,Dt);var kt=Fe(xe.rightChild,Dt);return kt!==void 0?kt:xe.key}};this.reverseUpperBound=function(xe){return Fe(Ie,xe)},this.union=function(xe){var Dt=this;xe.forEach(function(qe){return Dt.insert(qe)})},this.getHeight=function(){if(this.empty())return 0;var xe=function(Dt){return Dt?Math.max(xe(Dt.leftChild),xe(Dt.rightChild))+1:1};return xe(Ie)};var Ue=function(xe){return k(this,function(Dt){switch(Dt.label){case 0:return!xe||xe.key===void 0?[2]:[5,$(Ue(xe.leftChild))];case 1:return Dt.sent(),[4,xe.key];case 2:return Dt.sent(),[5,$(Ue(xe.rightChild))];case 3:return Dt.sent(),[2]}})};this[Symbol.iterator]=function(){return Ue(Ie)},Ce.forEach(function(xe){return ae.insert(xe)}),Object.freeze(this)}Object.freeze(oe),V.default=oe},{"../Base/TreeNode":25}],34:[function(r,g,V){Object.defineProperty(V,"__esModule",{value:!0});function k($){var re=this;$===void 0&&($=[]);var oe=0,Ce=[];this.size=function(){return oe},this.empty=function(){return oe===0},this.clear=function(){oe=0,Ce.length=0},this.push=function(ie){Ce.push(ie),++oe},this.pop=function(){Ce.pop(),oe>0&&--oe},this.top=function(){return Ce[oe-1]},$.forEach(function(ie){return re.push(ie)}),Object.freeze(this)}Object.freeze(k),V.default=k},{}],35:[function(r,g,V){var k=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(pe){return function(Ve){return ze([pe,Ve])}}function ze(pe){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=pe[0]&2?ue.return:pe[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,pe[1])).done)return de;switch(ue=0,de&&(pe=[pe[0]&2,de.value]),pe[0]){case 0:case 1:de=pe;break;case 4:return le.label++,{value:pe[1],done:!1};case 5:le.label++,ue=pe[1],pe=[0];continue;case 7:pe=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(pe[0]===6||pe[0]===2)){le=0;continue}if(pe[0]===3&&(!de||pe[1]>de[0]&&pe[1]<de[3])){le.label=pe[1];break}if(pe[0]===6&&le.label<de[1]){le.label=de[1],de=pe;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(pe);break}de[2]&&le.ops.pop(),le.trys.pop();continue}pe=ae.call(ie,le)}catch(Ve){pe=[6,Ve],ue=0}finally{Ie=de=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[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},re=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))},oe=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(V,"__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,ze){Ie[ze]=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,re([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,ze){(ze===0||he!==ue)&&(de.push(he),ue=he)}),de.forEach(function(he,ze){Ie[ze]=he});for(var Ne=de.length;le>Ne;)this.popBack()},this.sort=function(ue){Ie.sort(ue)},this[Symbol.iterator]=function(){return function(){return k(this,function(ue){switch(ue.label){case 0:return[5,oe(Ie)];case 1:return[2,ue.sent()]}})}()},ie.forEach(function(ue){return ae.pushBack(ue)}),Object.freeze(this)}Object.freeze(Ce),V.default=Ce},{}],36:[function(r,g,V){Object.defineProperty(V,"__esModule",{value:!0}),V.HashMap=V.HashSet=V.Map=V.Set=V.PriorityQueue=V.Deque=V.LinkList=V.Queue=V.Stack=V.Vector=void 0;var k=r("./Vector/Vector");V.Vector=k.default;var $=r("./Stack/Stack");V.Stack=$.default;var re=r("./Queue/Queue");V.Queue=re.default;var oe=r("./LinkList/LinkList");V.LinkList=oe.default;var Ce=r("./Deque/Deque");V.Deque=Ce.default;var ie=r("./PriorityQueue/PriorityQueue");V.PriorityQueue=ie.default;var ae=r("./Set/Set");V.Set=ae.default;var le=r("./Map/Map");V.Map=le.default;var Ie=r("./HashSet/HashSet");V.HashSet=Ie.default;var ue=r("./HashMap/HashMap");V.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,V){const k=r("yallist"),$=Symbol("max"),re=Symbol("length"),oe=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(Fe){if(typeof Fe=="number"&&(Fe={max:Fe}),Fe||(Fe={}),Fe.max&&(typeof Fe.max!="number"||Fe.max<0))throw new TypeError("max must be a non-negative number");this[$]=Fe.max||1/0;const Ue=Fe.length||Ne;if(this[oe]=typeof Ue!="function"?Ne:Ue,this[Ce]=Fe.stale||!1,Fe.maxAge&&typeof Fe.maxAge!="number")throw new TypeError("maxAge must be a number");this[ie]=Fe.maxAge||0,this[ae]=Fe.dispose,this[le]=Fe.noDisposeOnSet||!1,this[de]=Fe.updateAgeOnGet||!1,this.reset()}set max(Fe){if(typeof Fe!="number"||Fe<0)throw new TypeError("max must be a non-negative number");this[$]=Fe||1/0,Ve(this)}get max(){return this[$]}set allowStale(Fe){this[Ce]=!!Fe}get allowStale(){return this[Ce]}set maxAge(Fe){if(typeof Fe!="number")throw new TypeError("maxAge must be a non-negative number");this[ie]=Fe,Ve(this)}get maxAge(){return this[ie]}set lengthCalculator(Fe){typeof Fe!="function"&&(Fe=Ne),Fe!==this[oe]&&(this[oe]=Fe,this[re]=0,this[Ie].forEach(Ue=>{Ue.length=this[oe](Ue.value,Ue.key),this[re]+=Ue.length})),Ve(this)}get lengthCalculator(){return this[oe]}get length(){return this[re]}get itemCount(){return this[Ie].length}rforEach(Fe,Ue){Ue=Ue||this;for(let xe=this[Ie].tail;xe!==null;){const Dt=xe.prev;At(this,Fe,xe,Ue),xe=Dt}}forEach(Fe,Ue){Ue=Ue||this;for(let xe=this[Ie].head;xe!==null;){const Dt=xe.next;At(this,Fe,xe,Ue),xe=Dt}}keys(){return this[Ie].toArray().map(Fe=>Fe.key)}values(){return this[Ie].toArray().map(Fe=>Fe.value)}reset(){this[ae]&&this[Ie]&&this[Ie].length&&this[Ie].forEach(Fe=>this[ae](Fe.key,Fe.value)),this[ue]=new Map,this[Ie]=new k,this[re]=0}dump(){return this[Ie].map(Fe=>pe(this,Fe)?!1:{k:Fe.key,v:Fe.value,e:Fe.now+(Fe.maxAge||0)}).toArray().filter(Fe=>Fe)}dumpLru(){return this[Ie]}set(Fe,Ue,xe){if(xe=xe||this[ie],xe&&typeof xe!="number")throw new TypeError("maxAge must be a number");const Dt=xe?Date.now():0,qe=this[oe](Ue,Fe);if(this[ue].has(Fe)){if(qe>this[$])return Oe(this,this[ue].get(Fe)),!1;const Pt=this[ue].get(Fe).value;return this[ae]&&(this[le]||this[ae](Fe,Pt.value)),Pt.now=Dt,Pt.maxAge=xe,Pt.value=Ue,this[re]+=qe-Pt.length,Pt.length=qe,this.get(Fe),Ve(this),!0}const kt=new _e(Fe,Ue,qe,Dt,xe);return kt.length>this[$]?(this[ae]&&this[ae](Fe,Ue),!1):(this[re]+=kt.length,this[Ie].unshift(kt),this[ue].set(Fe,this[Ie].head),Ve(this),!0)}has(Fe){if(!this[ue].has(Fe))return!1;const Ue=this[ue].get(Fe).value;return!pe(this,Ue)}get(Fe){return ze(this,Fe,!0)}peek(Fe){return ze(this,Fe,!1)}pop(){const Fe=this[Ie].tail;return Fe?(Oe(this,Fe),Fe.value):null}del(Fe){Oe(this,this[ue].get(Fe))}load(Fe){this.reset();const Ue=Date.now();for(let xe=Fe.length-1;xe>=0;xe--){const Dt=Fe[xe],qe=Dt.e||0;if(qe===0)this.set(Dt.k,Dt.v);else{const kt=qe-Ue;kt>0&&this.set(Dt.k,Dt.v,kt)}}}prune(){this[ue].forEach((Fe,Ue)=>ze(this,Ue,!1))}}const ze=($e,Fe,Ue)=>{const xe=$e[ue].get(Fe);if(xe){const Dt=xe.value;if(pe($e,Dt)){if(Oe($e,xe),!$e[Ce])return}else Ue&&($e[de]&&(xe.value.now=Date.now()),$e[Ie].unshiftNode(xe));return Dt.value}},pe=($e,Fe)=>{if(!Fe||!Fe.maxAge&&!$e[ie])return!1;const Ue=Date.now()-Fe.now;return Fe.maxAge?Ue>Fe.maxAge:$e[ie]&&Ue>$e[ie]},Ve=$e=>{if($e[re]>$e[$])for(let Fe=$e[Ie].tail;$e[re]>$e[$]&&Fe!==null;){const Ue=Fe.prev;Oe($e,Fe),Fe=Ue}},Oe=($e,Fe)=>{if(Fe){const Ue=Fe.value;$e[ae]&&$e[ae](Ue.key,Ue.value),$e[re]-=Ue.length,$e[ue].delete(Ue.key),$e[Ie].removeNode(Fe)}};class _e{constructor(Fe,Ue,xe,Dt,qe){this.key=Fe,this.value=Ue,this.length=xe,this.now=Dt,this.maxAge=qe||0}}const At=($e,Fe,Ue,xe)=>{let Dt=Ue.value;pe($e,Dt)&&(Oe($e,Ue),$e[Ce]||(Dt=void 0)),Dt&&Fe.call(xe,Dt.value,Dt.key,$e)};g.exports=he},{yallist:83}],38:[function(r,g,V){(function(k){(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 oe in $.types){const Ce=$.types[oe];$.codes[Ce]=oe}$.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=k.from([$.SESSIONPRESENT_MASK]),$.CONNACK_HEADER=k.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=k.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 oe in $.properties){const Ce=$.properties[oe];$.propertiesCodes[Ce]=oe}$.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 re(oe){return[0,1,2].map(Ce=>[0,1].map(ie=>[0,1].map(ae=>{const le=k.alloc(1);return le.writeUInt8($.codes[oe]<<$.CMD_SHIFT|(ie?$.DUP_MASK:0)|Ce<<$.QOS_SHIFT|ae,0,!0),le})))}$.PUBLISH_HEADER=re("publish"),$.SUBSCRIBE_HEADER=re("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=re("unsubscribe"),$.ACKS={unsuback:re("unsuback"),puback:re("puback"),pubcomp:re("pubcomp"),pubrel:re("pubrel"),pubrec:re("pubrec")},$.SUBACK_HEADER=k.from([$.codes.suback<<$.CMD_SHIFT]),$.VERSION3=k.from([3]),$.VERSION4=k.from([4]),$.VERSION5=k.from([5]),$.VERSION131=k.from([131]),$.VERSION132=k.from([132]),$.QOS=[0,1,2].map(oe=>k.from([oe])),$.EMPTY={pingreq:k.from([$.codes.pingreq<<4,0]),pingresp:k.from([$.codes.pingresp<<4,0]),disconnect:k.from([$.codes.disconnect<<4,0])}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],39:[function(r,g,V){(function(k){(function(){const $=r("./writeToStream"),re=r("events");function oe(ie,ae){const le=new Ce;return $(ie,le,ae),le.concat()}class Ce extends re{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]=k.byteLength(Ie[de]),ae+=le[de];const Ne=k.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=oe}).call(this)}).call(this,r("buffer").Buffer)},{"./writeToStream":44,buffer:17,events:22}],40:[function(r,g,V){V.parser=r("./parser").parser,V.generate=r("./generate"),V.writeToStream=r("./writeToStream")},{"./generate":39,"./parser":43,"./writeToStream":44}],41:[function(r,g,V){(function(k){(function(){const re={},oe=k.isBuffer(k.from([1,2]).subarray(0,1));function Ce(Ie){const ue=k.allocUnsafe(2);return ue.writeUInt8(Ie>>8,0),ue.writeUInt8(Ie&255,0+1),ue}function ie(){for(let Ie=0;Ie<65536;Ie++)re[Ie]=Ce(Ie)}function ae(Ie){let de=0,Ne=0;const he=k.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),oe?he.subarray(0,Ne):he.slice(0,Ne)}function le(Ie){const ue=k.allocUnsafe(4);return ue.writeUInt32BE(Ie,0),ue}g.exports={cache:re,generateCache:ie,generateNumber:Ce,genBufVariableByteInt:ae,generate4ByteBuffer:le}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],42:[function(r,g,V){class k{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}g.exports=k},{}],43:[function(r,g,V){const k=r("bl"),$=r("events"),re=r("./packet"),oe=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 re,this.error=null,this._list=k(),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=oe.types[le>>oe.CMD_SHIFT],this.packet.retain=(le&oe.RETAIN_MASK)!==0,this.packet.qos=le>>oe.QOS_SHIFT&oe.QOS_MASK,this.packet.dup=(le&oe.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,ze=this._parseString();if(ze===null)return this._emitError(new Error("Cannot parse protocolId"));if(ze!=="MQTT"&&ze!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(he.protocolId=ze,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)&oe.USERNAME_MASK,Ne.password=this._list.readUInt8(this._pos)&oe.PASSWORD_MASK,Ne.will=this._list.readUInt8(this._pos)&oe.WILL_FLAG_MASK,Ne.will&&(he.will={},he.will.retain=(this._list.readUInt8(this._pos)&oe.WILL_RETAIN_MASK)!==0,he.will.qos=(this._list.readUInt8(this._pos)&oe.WILL_QOS_MASK)>>oe.WILL_QOS_SHIFT),he.clean=(this._list.readUInt8(this._pos)&oe.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 Ve=this._parseProperties();Object.getOwnPropertyNames(Ve).length&&(he.properties=Ve)}const pe=this._parseString();if(pe===null)return this._emitError(new Error("Packet too short"));if(he.clientId=pe,Ce("_parseConnect: packet.clientId: %s",he.clientId),Ne.will){if(he.protocolVersion===5){const Ve=this._parseProperties();Object.getOwnPropertyNames(Ve).length&&(he.will.properties=Ve)}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++)&oe.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,ze,pe;if(le.qos!==1)return this._emitError(new Error("Wrong subscribe header"));if(le.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Ve=this._parseProperties();Object.getOwnPropertyNames(Ve).length&&(le.properties=Ve)}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&oe.SUBSCRIBE_OPTIONS_QOS_MASK,ze=(ue>>oe.SUBSCRIBE_OPTIONS_NL_SHIFT&oe.SUBSCRIBE_OPTIONS_NL_MASK)!==0,he=(ue>>oe.SUBSCRIBE_OPTIONS_RAP_SHIFT&oe.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,Ne=ue>>oe.SUBSCRIBE_OPTIONS_RH_SHIFT&oe.SUBSCRIBE_OPTIONS_RH_MASK,pe={topic:Ie,qos:de},this.settings.protocolVersion===5?(pe.nl=ze,pe.rap=he,pe.rh=Ne):this.settings.bridgeMode&&(pe.rh=0,pe.rap=!0,pe.nl=!0),Ce("_parseSubscribe: push subscription `%s` to subscription",pe),le.subscriptions.push(pe)}}}_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,ze;const pe=this._pos?this._pos:0;for(;ue<Ie&&pe+ue<this._list.length;){if(ze=this._list.readUInt8(pe+ue++),Ne+=de*(ze&oe.VARBYTEINT_MASK),de*=128,!(ze&oe.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")),pe&&(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=oe.propertiesCodes[Ne];if(!he)return this._emitError(new Error("Unknown property")),!1;if(he==="userProperties"){de[he]||(de[he]=Object.create(null));const ze=this._parseByType(oe.propertiesTypes[he]);if(de[he][ze.name])if(Array.isArray(de[he][ze.name]))de[he][ze.name].push(ze.value);else{const pe=de[he][ze.name];de[he][ze.name]=[pe],de[he][ze.name].push(ze.value)}else de[he][ze.name]=ze.value;continue}de[he]?Array.isArray(de[he])?de[he].push(this._parseByType(oe.propertiesTypes[he])):(de[he]=[de[he]],de[he].push(this._parseByType(oe.propertiesTypes[he]))):de[he]=this._parseByType(oe.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 re,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,V){(function(k){(function(){const $=r("./constants"),re=k.allocUnsafe(0),oe=k.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,ze=!0;function pe(Ii,ai,pi){switch(ae("generate called"),ai.cork&&(ai.cork(),ie(Ve,ai)),ze&&(ze=!1,ue()),ae("generate: packet.cmd: %s",Ii.cmd),Ii.cmd){case"connect":return Oe(Ii,ai);case"connack":return _e(Ii,ai,pi);case"publish":return At(Ii,ai,pi);case"puback":case"pubrec":case"pubrel":case"pubcomp":return $e(Ii,ai,pi);case"subscribe":return Fe(Ii,ai,pi);case"suback":return Ue(Ii,ai,pi);case"unsubscribe":return xe(Ii,ai,pi);case"unsuback":return Dt(Ii,ai,pi);case"pingreq":case"pingresp":return qe(Ii,ai);case"disconnect":return kt(Ii,ai,pi);case"auth":return jt(Ii,ai,pi);default:return ai.emit("error",new Error("Unknown command")),!1}}Object.defineProperty(pe,"cacheNumbers",{get(){return he===ni},set(Ii){Ii?((!le||Object.keys(le).length===0)&&(ze=!0),he=ni):(ze=!1,he=ri)}});function Ve(Ii){Ii.uncork()}function Oe(Ii,ai,pi){const Ni=Ii||{},di=Ni.protocolId||"MQTT";let fi=Ni.protocolVersion||4;const vi=Ni.will;let bi=Ni.clean;const si=Ni.keepalive||0,wi=Ni.clientId||"",oi=Ni.username,Lt=Ni.password,ii=Ni.properties;bi===void 0&&(bi=!0);let gi=0;if(!di||typeof di!="string"&&!k.isBuffer(di))return ai.emit("error",new Error("Invalid protocolId")),!1;if(gi+=di.length+2,fi!==3&&fi!==4&&fi!==5)return ai.emit("error",new Error("Invalid protocol version")),!1;if(gi+=1,(typeof wi=="string"||k.isBuffer(wi))&&(wi||fi>=4)&&(wi||bi))gi+=k.byteLength(wi)+2;else{if(fi<4)return ai.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(bi*1===0)return ai.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 ai.emit("error",new Error("Invalid keepalive")),!1;if(gi+=2,gi+=1,fi===5){var hi=li(ai,ii);if(!hi)return!1;gi+=hi.length}if(vi){if(typeof vi!="object")return ai.emit("error",new Error("Invalid will")),!1;if(!vi.topic||typeof vi.topic!="string")return ai.emit("error",new Error("Invalid will topic")),!1;if(gi+=k.byteLength(vi.topic)+2,gi+=2,vi.payload)if(vi.payload.length>=0)typeof vi.payload=="string"?gi+=k.byteLength(vi.payload):gi+=vi.payload.length;else return ai.emit("error",new Error("Invalid will payload")),!1;var mi={};if(fi===5){if(mi=li(ai,vi.properties),!mi)return!1;gi+=mi.length}}let Si=!1;if(oi!=null)if(Ai(oi))Si=!0,gi+=k.byteLength(oi)+2;else return ai.emit("error",new Error("Invalid username")),!1;if(Lt!=null){if(!Si)return ai.emit("error",new Error("Username is required to use password")),!1;if(Ai(Lt))gi+=zi(Lt)+2;else return ai.emit("error",new Error("Invalid password")),!1}ai.write($.CONNECT_HEADER),ti(ai,gi),Ci(ai,di),Ni.bridgeMode&&(fi+=128),ai.write(fi===131?$.VERSION131:fi===132?$.VERSION132:fi===4?$.VERSION4:fi===5?$.VERSION5:$.VERSION3);let xi=0;return xi|=oi!=null?$.USERNAME_MASK:0,xi|=Lt!=null?$.PASSWORD_MASK:0,xi|=vi&&vi.retain?$.WILL_RETAIN_MASK:0,xi|=vi&&vi.qos?vi.qos<<$.WILL_QOS_SHIFT:0,xi|=vi?$.WILL_FLAG_MASK:0,xi|=bi?$.CLEAN_SESSION_MASK:0,ai.write(k.from([xi])),he(ai,si),fi===5&&hi.write(),Ci(ai,wi),vi&&(fi===5&&mi.write(),ei(ai,vi.topic),Ci(ai,vi.payload)),oi!=null&&Ci(ai,oi),Lt!=null&&Ci(ai,Lt),!0}function _e(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=Ni===5?di.reasonCode:di.returnCode,vi=di.properties;let bi=2;if(typeof fi!="number")return ai.emit("error",new Error("Invalid return code")),!1;let si=null;if(Ni===5){if(si=li(ai,vi),!si)return!1;bi+=si.length}return ai.write($.CONNACK_HEADER),ti(ai,bi),ai.write(di.sessionPresent?$.SESSIONPRESENT_HEADER:oe),ai.write(k.from([fi])),si!=null&&si.write(),!0}function At(Ii,ai,pi){ae("publish: packet: %o",Ii);const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.qos||0,vi=di.retain?$.RETAIN_MASK:0,bi=di.topic,si=di.payload||re,wi=di.messageId,oi=di.properties;let Lt=0;if(typeof bi=="string")Lt+=k.byteLength(bi)+2;else if(k.isBuffer(bi))Lt+=bi.length+2;else return ai.emit("error",new Error("Invalid topic")),!1;if(k.isBuffer(si)?Lt+=si.length:Lt+=k.byteLength(si),fi&&typeof wi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;fi&&(Lt+=2);let ii=null;if(Ni===5){if(ii=li(ai,oi),!ii)return!1;Lt+=ii.length}return ai.write($.PUBLISH_HEADER[fi][di.dup?1:0][vi?1:0]),ti(ai,Lt),he(ai,zi(bi)),ai.write(bi),fi>0&&he(ai,wi),ii!=null&&ii.write(),ae("publish: payload: %o",si),ai.write(si)}function $e(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.cmd||"puback",vi=di.messageId,bi=di.dup&&fi==="pubrel"?$.DUP_MASK:0;let si=0;const wi=di.reasonCode,oi=di.properties;let Lt=Ni===5?3:2;if(fi==="pubrel"&&(si=1),typeof vi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;let ii=null;if(Ni===5&&typeof oi=="object"){if(ii=ui(ai,oi,pi,Lt),!ii)return!1;Lt+=ii.length}return ai.write($.ACKS[fi][si][bi][0]),ti(ai,Lt),he(ai,vi),Ni===5&&ai.write(k.from([wi])),ii!==null&&ii.write(),!0}function Fe(Ii,ai,pi){ae("subscribe: packet: ");const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.dup?$.DUP_MASK:0,vi=di.messageId,bi=di.subscriptions,si=di.properties;let wi=0;if(typeof vi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;wi+=2;let oi=null;if(Ni===5){if(oi=li(ai,si),!oi)return!1;wi+=oi.length}if(typeof bi=="object"&&bi.length)for(let ii=0;ii<bi.length;ii+=1){const gi=bi[ii].topic,hi=bi[ii].qos;if(typeof gi!="string")return ai.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if(typeof hi!="number")return ai.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(Ni===5){if(typeof(bi[ii].nl||!1)!="boolean")return ai.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(bi[ii].rap||!1)!="boolean")return ai.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;const xi=bi[ii].rh||0;if(typeof xi!="number"||xi>2)return ai.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}wi+=k.byteLength(gi)+2+1}else return ai.emit("error",new Error("Invalid subscriptions")),!1;ae("subscribe: writing to stream: %o",$.SUBSCRIBE_HEADER),ai.write($.SUBSCRIBE_HEADER[1][fi?1:0][0]),ti(ai,wi),he(ai,vi),oi!==null&&oi.write();let Lt=!0;for(const ii of bi){const gi=ii.topic,hi=ii.qos,mi=+ii.nl,Si=+ii.rap,xi=ii.rh;let Gi;ei(ai,gi),Gi=$.SUBSCRIBE_OPTIONS_QOS[hi],Ni===5&&(Gi|=mi?$.SUBSCRIBE_OPTIONS_NL:0,Gi|=Si?$.SUBSCRIBE_OPTIONS_RAP:0,Gi|=xi?$.SUBSCRIBE_OPTIONS_RH[xi]:0),Lt=ai.write(k.from([Gi]))}return Lt}function Ue(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.messageId,vi=di.granted,bi=di.properties;let si=0;if(typeof fi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;if(si+=2,typeof vi=="object"&&vi.length)for(let oi=0;oi<vi.length;oi+=1){if(typeof vi[oi]!="number")return ai.emit("error",new Error("Invalid qos vector")),!1;si+=1}else return ai.emit("error",new Error("Invalid qos vector")),!1;let wi=null;if(Ni===5){if(wi=ui(ai,bi,pi,si),!wi)return!1;si+=wi.length}return ai.write($.SUBACK_HEADER),ti(ai,si),he(ai,fi),wi!==null&&wi.write(),ai.write(k.from(vi))}function xe(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.messageId,vi=di.dup?$.DUP_MASK:0,bi=di.unsubscriptions,si=di.properties;let wi=0;if(typeof fi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;if(wi+=2,typeof bi=="object"&&bi.length)for(let ii=0;ii<bi.length;ii+=1){if(typeof bi[ii]!="string")return ai.emit("error",new Error("Invalid unsubscriptions")),!1;wi+=k.byteLength(bi[ii])+2}else return ai.emit("error",new Error("Invalid unsubscriptions")),!1;let oi=null;if(Ni===5){if(oi=li(ai,si),!oi)return!1;wi+=oi.length}ai.write($.UNSUBSCRIBE_HEADER[1][vi?1:0][0]),ti(ai,wi),he(ai,fi),oi!==null&&oi.write();let Lt=!0;for(let ii=0;ii<bi.length;ii++)Lt=ei(ai,bi[ii]);return Lt}function Dt(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.messageId,vi=di.dup?$.DUP_MASK:0,bi=di.granted,si=di.properties,wi=di.cmd,oi=0;let Lt=2;if(typeof fi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;if(Ni===5)if(typeof bi=="object"&&bi.length)for(let gi=0;gi<bi.length;gi+=1){if(typeof bi[gi]!="number")return ai.emit("error",new Error("Invalid qos vector")),!1;Lt+=1}else return ai.emit("error",new Error("Invalid qos vector")),!1;let ii=null;if(Ni===5){if(ii=ui(ai,si,pi,Lt),!ii)return!1;Lt+=ii.length}return ai.write($.ACKS[wi][oi][vi][0]),ti(ai,Lt),he(ai,fi),ii!==null&&ii.write(),Ni===5&&ai.write(k.from(bi)),!0}function qe(Ii,ai,pi){return ai.write($.EMPTY[Ii.cmd])}function kt(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.reasonCode,vi=di.properties;let bi=Ni===5?1:0,si=null;if(Ni===5){if(si=ui(ai,vi,pi,bi),!si)return!1;bi+=si.length}return ai.write(k.from([$.codes.disconnect<<4])),ti(ai,bi),Ni===5&&ai.write(k.from([fi])),si!==null&&si.write(),!0}function jt(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.reasonCode,vi=di.properties;let bi=Ni===5?1:0;Ni!==5&&ai.emit("error",new Error("Invalid mqtt version for auth packet"));const si=ui(ai,vi,pi,bi);return si?(bi+=si.length,ai.write(k.from([$.codes.auth<<4])),ti(ai,bi),ai.write(k.from([fi])),si!==null&&si.write(),!0):!1}const Pt={};function ti(Ii,ai){if(ai>$.VARBYTEINT_MAX)return Ii.emit("error",new Error(`Invalid variable byte integer: ${ai}`)),!1;let pi=Pt[ai];return pi||(pi=de(ai),ai<16384&&(Pt[ai]=pi)),ae("writeVarByteInt: writing to stream: %o",pi),Ii.write(pi)}function ei(Ii,ai){const pi=k.byteLength(ai);return he(Ii,pi),ae("writeString: %s",ai),Ii.write(ai,"utf8")}function Et(Ii,ai,pi){ei(Ii,ai),ei(Ii,pi)}function ni(Ii,ai){return ae("writeNumberCached: number: %d",ai),ae("writeNumberCached: %o",le[ai]),Ii.write(le[ai])}function ri(Ii,ai){const pi=Ie(ai);return ae("writeNumberGenerated: %o",pi),Ii.write(pi)}function ci(Ii,ai){const pi=Ne(ai);return ae("write4ByteNumber: %o",pi),Ii.write(pi)}function Ci(Ii,ai){typeof ai=="string"?ei(Ii,ai):ai?(he(Ii,ai.length),Ii.write(ai)):he(Ii,0)}function li(Ii,ai){if(typeof ai!="object"||ai.length!=null)return{length:1,write(){Mi(Ii,{},0)}};let pi=0;function Ni(fi,vi){const bi=$.propertiesTypes[fi];let si=0;switch(bi){case"byte":{if(typeof vi!="boolean")return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+1;break}case"int8":{if(typeof vi!="number"||vi<0||vi>255)return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+1;break}case"binary":{if(vi&&vi===null)return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+k.byteLength(vi)+2;break}case"int16":{if(typeof vi!="number"||vi<0||vi>65535)return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+2;break}case"int32":{if(typeof vi!="number"||vi<0||vi>4294967295)return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+4;break}case"var":{if(typeof vi!="number"||vi<0||vi>268435455)return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+k.byteLength(de(vi));break}case"string":{if(typeof vi!="string")return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+2+k.byteLength(vi.toString());break}case"pair":{if(typeof vi!="object")return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=Object.getOwnPropertyNames(vi).reduce((wi,oi)=>{const Lt=vi[oi];return Array.isArray(Lt)?wi+=Lt.reduce((ii,gi)=>(ii+=1+2+k.byteLength(oi.toString())+2+k.byteLength(gi.toString()),ii),0):wi+=1+2+k.byteLength(oi.toString())+2+k.byteLength(vi[oi].toString()),wi},0);break}default:return Ii.emit("error",new Error(`Invalid property ${fi}: ${vi}`)),!1}return si}if(ai)for(const fi in ai){let vi=0,bi=0;const si=ai[fi];if(Array.isArray(si))for(let wi=0;wi<si.length;wi++){if(bi=Ni(fi,si[wi]),!bi)return!1;vi+=bi}else{if(bi=Ni(fi,si),!bi)return!1;vi=bi}if(!vi)return!1;pi+=vi}return{length:k.byteLength(de(pi))+pi,write(){Mi(Ii,ai,pi)}}}function ui(Ii,ai,pi,Ni){const di=["reasonString","userProperties"],fi=pi&&pi.properties&&pi.properties.maximumPacketSize?pi.properties.maximumPacketSize:0;let vi=li(Ii,ai);if(fi)for(;Ni+vi.length>fi;){const bi=di.shift();if(bi&&ai[bi])delete ai[bi],vi=li(Ii,ai);else return!1}return vi}function yi(Ii,ai,pi){switch($.propertiesTypes[ai]){case"byte":{Ii.write(k.from([$.properties[ai]])),Ii.write(k.from([+pi]));break}case"int8":{Ii.write(k.from([$.properties[ai]])),Ii.write(k.from([pi]));break}case"binary":{Ii.write(k.from([$.properties[ai]])),Ci(Ii,pi);break}case"int16":{Ii.write(k.from([$.properties[ai]])),he(Ii,pi);break}case"int32":{Ii.write(k.from([$.properties[ai]])),ci(Ii,pi);break}case"var":{Ii.write(k.from([$.properties[ai]])),ti(Ii,pi);break}case"string":{Ii.write(k.from([$.properties[ai]])),ei(Ii,pi);break}case"pair":{Object.getOwnPropertyNames(pi).forEach(di=>{const fi=pi[di];Array.isArray(fi)?fi.forEach(vi=>{Ii.write(k.from([$.properties[ai]])),Et(Ii,di.toString(),vi.toString())}):(Ii.write(k.from([$.properties[ai]])),Et(Ii,di.toString(),fi.toString()))});break}default:return Ii.emit("error",new Error(`Invalid property ${ai} value: ${pi}`)),!1}}function Mi(Ii,ai,pi){ti(Ii,pi);for(const Ni in ai)if(Object.prototype.hasOwnProperty.call(ai,Ni)&&ai[Ni]!==null){const di=ai[Ni];if(Array.isArray(di))for(let fi=0;fi<di.length;fi++)yi(Ii,Ni,di[fi]);else yi(Ii,Ni,di)}}function zi(Ii){return Ii?Ii instanceof k?Ii.length:k.byteLength(Ii):0}function Ai(Ii){return typeof Ii=="string"||Ii instanceof k}g.exports=pe}).call(this)}).call(this,r("buffer").Buffer)},{"./constants":38,"./numbers":41,buffer:17,debug:18,"process-nextick-args":49}],45:[function(r,g,V){var k=1e3,$=k*60,re=$*60,oe=re*24,Ce=oe*7,ie=oe*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]),ze=(Ne[2]||"ms").toLowerCase();switch(ze){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*oe;case"hours":case"hour":case"hrs":case"hr":case"h":return he*re;case"minutes":case"minute":case"mins":case"min":case"m":return he*$;case"seconds":case"second":case"secs":case"sec":case"s":return he*k;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return he;default:return}}}}function le(de){var Ne=Math.abs(de);return Ne>=oe?Math.round(de/oe)+"d":Ne>=re?Math.round(de/re)+"h":Ne>=$?Math.round(de/$)+"m":Ne>=k?Math.round(de/k)+"s":de+"ms"}function Ie(de){var Ne=Math.abs(de);return Ne>=oe?ue(de,Ne,oe,"day"):Ne>=re?ue(de,Ne,re,"hour"):Ne>=$?ue(de,Ne,$,"minute"):Ne>=k?ue(de,Ne,k,"second"):de+" ms"}function ue(de,Ne,he,ze){var pe=Ne>=he*1.5;return Math.round(de/he)+" "+ze+(pe?"s":"")}},{}],46:[function(r,g,V){const k=r("./lib/number-allocator.js");g.exports.NumberAllocator=k},{"./lib/number-allocator.js":47}],47:[function(r,g,V){const k=r("js-sdsl").Set,$=r("debug")("number-allocator:trace"),re=r("debug")("number-allocator:error");function oe(ie,ae){this.low=ie,this.high=ae}oe.prototype.equals=function(ie){return this.low===ie.low&&this.high===ie.high},oe.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 k([],(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 oe(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 oe(Ie,ie-1)),$("use():"+ie),!0}return $("use():failed"),!1},Ce.prototype.free=function(ie){if(ie<this.min||ie>this.max){re("free():"+ie+" is out of range");return}const ae=new oe(ie,ie),le=this.ss.lowerBound(ae);if(le){if(le.low<=ie&&ie<=le.high){re("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 oe(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,V){var k=r("wrappy");g.exports=k($),g.exports.strict=k(re),$.proto=$(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return $(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return re(this)},configurable:!0})});function $(oe){var Ce=function(){return Ce.called?Ce.value:(Ce.called=!0,Ce.value=oe.apply(this,arguments))};return Ce.called=!1,Ce}function re(oe){var Ce=function(){if(Ce.called)throw new Error(Ce.onceError);return Ce.called=!0,Ce.value=oe.apply(this,arguments)},ie=oe.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,V){(function(k){(function(){typeof k>"u"||!k.version||k.version.indexOf("v0.")===0||k.version.indexOf("v1.")===0&&k.version.indexOf("v1.8.")!==0?g.exports={nextTick:$}:g.exports=k;function $(re,oe,Ce,ie){if(typeof re!="function")throw new TypeError('"callback" argument must be a function');var ae=arguments.length,le,Ie;switch(ae){case 0:case 1:return k.nextTick(re);case 2:return k.nextTick(function(){re.call(null,oe)});case 3:return k.nextTick(function(){re.call(null,oe,Ce)});case 4:return k.nextTick(function(){re.call(null,oe,Ce,ie)});default:for(le=new Array(ae-1),Ie=0;Ie<le.length;)le[Ie++]=arguments[Ie];return k.nextTick(function(){re.apply(null,le)})}}}).call(this)}).call(this,r("_process"))},{_process:50}],50:[function(r,g,V){var k=g.exports={},$,re;function oe(){throw new Error("setTimeout has not been defined")}function Ce(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?$=setTimeout:$=oe}catch{$=oe}try{typeof clearTimeout=="function"?re=clearTimeout:re=Ce}catch{re=Ce}})();function ie(Ve){if($===setTimeout)return setTimeout(Ve,0);if(($===oe||!$)&&setTimeout)return $=setTimeout,setTimeout(Ve,0);try{return $(Ve,0)}catch{try{return $.call(null,Ve,0)}catch{return $.call(this,Ve,0)}}}function ae(Ve){if(re===clearTimeout)return clearTimeout(Ve);if((re===Ce||!re)&&clearTimeout)return re=clearTimeout,clearTimeout(Ve);try{return re(Ve)}catch{try{return re.call(null,Ve)}catch{return re.call(this,Ve)}}}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 Ve=ie(Ne);Ie=!0;for(var Oe=le.length;Oe;){for(ue=le,le=[];++de<Oe;)ue&&ue[de].run();de=-1,Oe=le.length}ue=null,Ie=!1,ae(Ve)}}k.nextTick=function(Ve){var Oe=new Array(arguments.length-1);if(arguments.length>1)for(var _e=1;_e<arguments.length;_e++)Oe[_e-1]=arguments[_e];le.push(new ze(Ve,Oe)),le.length===1&&!Ie&&ie(he)};function ze(Ve,Oe){this.fun=Ve,this.array=Oe}ze.prototype.run=function(){this.fun.apply(null,this.array)},k.title="browser",k.browser=!0,k.env={},k.argv=[],k.version="",k.versions={};function pe(){}k.on=pe,k.addListener=pe,k.once=pe,k.off=pe,k.removeListener=pe,k.removeAllListeners=pe,k.emit=pe,k.prependListener=pe,k.prependOnceListener=pe,k.listeners=function(Ve){return[]},k.binding=function(Ve){throw new Error("process.binding is not supported")},k.cwd=function(){return"/"},k.chdir=function(Ve){throw new Error("process.chdir is not supported")},k.umask=function(){return 0}},{}],51:[function(r,g,V){(function(k){(function(){(function($){var re=typeof V=="object"&&V&&!V.nodeType&&V,oe=typeof g=="object"&&g&&!g.nodeType&&g,Ce=typeof k=="object"&&k;(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,ze=128,pe="-",Ve=/^xn--/,Oe=/[^\x20-\x7E]/,_e=/[\x2E\u3002\uFF0E\uFF61]/g,At={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,Fe=Math.floor,Ue=String.fromCharCode,xe;function Dt(li){throw new RangeError(At[li])}function qe(li,ui){for(var yi=li.length,Mi=[];yi--;)Mi[yi]=ui(li[yi]);return Mi}function kt(li,ui){var yi=li.split("@"),Mi="";yi.length>1&&(Mi=yi[0]+"@",li=yi[1]),li=li.replace(_e,".");var zi=li.split("."),Ai=qe(zi,ui).join(".");return Mi+Ai}function jt(li){for(var ui=[],yi=0,Mi=li.length,zi,Ai;yi<Mi;)zi=li.charCodeAt(yi++),zi>=55296&&zi<=56319&&yi<Mi?(Ai=li.charCodeAt(yi++),(Ai&64512)==56320?ui.push(((zi&1023)<<10)+(Ai&1023)+65536):(ui.push(zi),yi--)):ui.push(zi);return ui}function Pt(li){return qe(li,function(ui){var yi="";return ui>65535&&(ui-=65536,yi+=Ue(ui>>>10&1023|55296),ui=56320|ui&1023),yi+=Ue(ui),yi}).join("")}function ti(li){return li-48<10?li-22:li-65<26?li-65:li-97<26?li-97:le}function ei(li,ui){return li+22+75*(li<26)-((ui!=0)<<5)}function Et(li,ui,yi){var Mi=0;for(li=yi?Fe(li/Ne):li>>1,li+=Fe(li/ui);li>$e*ue>>1;Mi+=le)li=Fe(li/$e);return Fe(Mi+($e+1)*li/(li+de))}function ni(li){var ui=[],yi=li.length,Mi,zi=0,Ai=ze,Ii=he,ai,pi,Ni,di,fi,vi,bi,si,wi;for(ai=li.lastIndexOf(pe),ai<0&&(ai=0),pi=0;pi<ai;++pi)li.charCodeAt(pi)>=128&&Dt("not-basic"),ui.push(li.charCodeAt(pi));for(Ni=ai>0?ai+1:0;Ni<yi;){for(di=zi,fi=1,vi=le;Ni>=yi&&Dt("invalid-input"),bi=ti(li.charCodeAt(Ni++)),(bi>=le||bi>Fe((ae-zi)/fi))&&Dt("overflow"),zi+=bi*fi,si=vi<=Ii?Ie:vi>=Ii+ue?ue:vi-Ii,!(bi<si);vi+=le)wi=le-si,fi>Fe(ae/wi)&&Dt("overflow"),fi*=wi;Mi=ui.length+1,Ii=Et(zi-di,Mi,di==0),Fe(zi/Mi)>ae-Ai&&Dt("overflow"),Ai+=Fe(zi/Mi),zi%=Mi,ui.splice(zi++,0,Ai)}return Pt(ui)}function ri(li){var ui,yi,Mi,zi,Ai,Ii,ai,pi,Ni,di,fi,vi=[],bi,si,wi,oi;for(li=jt(li),bi=li.length,ui=ze,yi=0,Ai=he,Ii=0;Ii<bi;++Ii)fi=li[Ii],fi<128&&vi.push(Ue(fi));for(Mi=zi=vi.length,zi&&vi.push(pe);Mi<bi;){for(ai=ae,Ii=0;Ii<bi;++Ii)fi=li[Ii],fi>=ui&&fi<ai&&(ai=fi);for(si=Mi+1,ai-ui>Fe((ae-yi)/si)&&Dt("overflow"),yi+=(ai-ui)*si,ui=ai,Ii=0;Ii<bi;++Ii)if(fi=li[Ii],fi<ui&&++yi>ae&&Dt("overflow"),fi==ui){for(pi=yi,Ni=le;di=Ni<=Ai?Ie:Ni>=Ai+ue?ue:Ni-Ai,!(pi<di);Ni+=le)oi=pi-di,wi=le-di,vi.push(Ue(ei(di+oi%wi,0))),pi=Fe(oi/wi);vi.push(Ue(ei(pi,0))),Ai=Et(yi,si,Mi==zi),yi=0,++Mi}++yi,++ui}return vi.join("")}function ci(li){return kt(li,function(ui){return Ve.test(ui)?ni(ui.slice(4).toLowerCase()):ui})}function Ci(li){return kt(li,function(ui){return Oe.test(ui)?"xn--"+ri(ui):ui})}if(ie={version:"1.4.1",ucs2:{decode:jt,encode:Pt},decode:ni,encode:ri,toASCII:Ci,toUnicode:ci},re&&oe)if(g.exports==re)oe.exports=ie;else for(xe in ie)ie.hasOwnProperty(xe)&&(re[xe]=ie[xe]);else $.punycode=ie})(this)}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],52:[function(r,g,V){function k(re,oe){return Object.prototype.hasOwnProperty.call(re,oe)}g.exports=function(re,oe,Ce,ie){oe=oe||"&",Ce=Ce||"=";var ae={};if(typeof re!="string"||re.length===0)return ae;var le=/\+/g;re=re.split(oe);var Ie=1e3;ie&&typeof ie.maxKeys=="number"&&(Ie=ie.maxKeys);var ue=re.length;Ie>0&&ue>Ie&&(ue=Ie);for(var de=0;de<ue;++de){var Ne=re[de].replace(le,"%20"),he=Ne.indexOf(Ce),ze,pe,Ve,Oe;he>=0?(ze=Ne.substr(0,he),pe=Ne.substr(he+1)):(ze=Ne,pe=""),Ve=decodeURIComponent(ze),Oe=decodeURIComponent(pe),k(ae,Ve)?$(ae[Ve])?ae[Ve].push(Oe):ae[Ve]=[ae[Ve],Oe]:ae[Ve]=Oe}return ae};var $=Array.isArray||function(re){return Object.prototype.toString.call(re)==="[object Array]"}},{}],53:[function(r,g,V){var k=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"?re(oe(Ce),function(Ie){var ue=encodeURIComponent(k(Ie))+ae;return $(Ce[Ie])?re(Ce[Ie],function(de){return ue+encodeURIComponent(k(de))}).join(ie):ue+encodeURIComponent(k(Ce[Ie]))}).join(ie):le?encodeURIComponent(k(le))+ae+encodeURIComponent(k(Ce)):""};var $=Array.isArray||function(Ce){return Object.prototype.toString.call(Ce)==="[object Array]"};function re(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 oe=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,V){V.decode=V.parse=r("./decode"),V.encode=V.stringify=r("./encode")},{"./decode":52,"./encode":53}],55:[function(r,g,V){function k(le,Ie){le.prototype=Object.create(Ie.prototype),le.prototype.constructor=le,le.__proto__=Ie}var $={};function re(le,Ie,ue){ue||(ue=Error);function de(he,ze,pe){return typeof Ie=="string"?Ie:Ie(he,ze,pe)}var Ne=function(he){k(ze,he);function ze(pe,Ve,Oe){return he.call(this,de(pe,Ve,Oe))||this}return ze}(ue);Ne.prototype.name=ue.name,Ne.prototype.code=le,$[le]=Ne}function oe(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}re("ERR_INVALID_OPT_VALUE",function(le,Ie){return'The value "'+Ie+'" is invalid for option "'+le+'"'},TypeError),re("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(oe(Ie,"type"));else{var he=ae(le,".")?"property":"argument";Ne='The "'.concat(le,'" ').concat(he," ").concat(de," ").concat(oe(Ie,"type"))}return Ne+=". Received type ".concat(typeof ue),Ne},TypeError),re("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),re("ERR_METHOD_NOT_IMPLEMENTED",function(le){return"The "+le+" method is not implemented"}),re("ERR_STREAM_PREMATURE_CLOSE","Premature close"),re("ERR_STREAM_DESTROYED",function(le){return"Cannot call "+le+" after a stream was destroyed"}),re("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),re("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),re("ERR_STREAM_WRITE_AFTER_END","write after end"),re("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),re("ERR_UNKNOWN_ENCODING",function(le){return"Unknown encoding: "+le},TypeError),re("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),g.exports.codes=$},{}],56:[function(r,g,V){(function(k){(function(){var $=Object.keys||function(de){var Ne=[];for(var he in de)Ne.push(he);return Ne};g.exports=le;var re=r("./_stream_readable"),oe=r("./_stream_writable");r("inherits")(le,re);for(var Ce=$(oe.prototype),ie=0;ie<Ce.length;ie++){var ae=Ce[ie];le.prototype[ae]||(le.prototype[ae]=oe.prototype[ae])}function le(de){if(!(this instanceof le))return new le(de);re.call(this,de),oe.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||k.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,V){g.exports=$;var k=r("./_stream_transform");r("inherits")($,k);function $(re){if(!(this instanceof $))return new $(re);k.call(this,re)}$.prototype._transform=function(re,oe,Ce){Ce(null,re)}},{"./_stream_transform":59,inherits:24}],58:[function(r,g,V){(function(k,$){(function(){g.exports=Pt;var re;Pt.ReadableState=jt,r("events").EventEmitter;var oe=function(wi,oi){return wi.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"),ze=r("./internal/streams/state"),pe=ze.getHighWaterMark,Ve=r("../errors").codes,Oe=Ve.ERR_INVALID_ARG_TYPE,_e=Ve.ERR_STREAM_PUSH_AFTER_EOF,At=Ve.ERR_METHOD_NOT_IMPLEMENTED,$e=Ve.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Fe,Ue,xe;r("inherits")(Pt,Ce);var Dt=he.errorOrDestroy,qe=["error","close","destroy","pause","resume"];function kt(si,wi,oi){if(typeof si.prependListener=="function")return si.prependListener(wi,oi);!si._events||!si._events[wi]?si.on(wi,oi):Array.isArray(si._events[wi])?si._events[wi].unshift(oi):si._events[wi]=[oi,si._events[wi]]}function jt(si,wi,oi){re=re||r("./_stream_duplex"),si=si||{},typeof oi!="boolean"&&(oi=wi instanceof re),this.objectMode=!!si.objectMode,oi&&(this.objectMode=this.objectMode||!!si.readableObjectMode),this.highWaterMark=pe(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&&(Fe||(Fe=r("string_decoder/").StringDecoder),this.decoder=new Fe(si.encoding),this.encoding=si.encoding)}function Pt(si){if(re=re||r("./_stream_duplex"),!(this instanceof Pt))return new Pt(si);var wi=this instanceof re;this._readableState=new jt(si,this,wi),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(Pt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(wi){this._readableState&&(this._readableState.destroyed=wi)}}),Pt.prototype.destroy=he.destroy,Pt.prototype._undestroy=he.undestroy,Pt.prototype._destroy=function(si,wi){wi(si)},Pt.prototype.push=function(si,wi){var oi=this._readableState,Lt;return oi.objectMode?Lt=!0:typeof si=="string"&&(wi=wi||oi.defaultEncoding,wi!==oi.encoding&&(si=ie.from(si,wi),wi=""),Lt=!0),ti(this,si,wi,!1,Lt)},Pt.prototype.unshift=function(si){return ti(this,si,null,!0,!1)};function ti(si,wi,oi,Lt,ii){de("readableAddChunk",wi);var gi=si._readableState;if(wi===null)gi.reading=!1,Ci(si,gi);else{var hi;if(ii||(hi=Et(gi,wi)),hi)Dt(si,hi);else if(gi.objectMode||wi&&wi.length>0)if(typeof wi!="string"&&!gi.objectMode&&Object.getPrototypeOf(wi)!==ie.prototype&&(wi=le(wi)),Lt)gi.endEmitted?Dt(si,new $e):ei(si,gi,wi,!0);else if(gi.ended)Dt(si,new _e);else{if(gi.destroyed)return!1;gi.reading=!1,gi.decoder&&!oi?(wi=gi.decoder.write(wi),gi.objectMode||wi.length!==0?ei(si,gi,wi,!1):yi(si,gi)):ei(si,gi,wi,!1)}else Lt||(gi.reading=!1,yi(si,gi))}return!gi.ended&&(gi.length<gi.highWaterMark||gi.length===0)}function ei(si,wi,oi,Lt){wi.flowing&&wi.length===0&&!wi.sync?(wi.awaitDrain=0,si.emit("data",oi)):(wi.length+=wi.objectMode?1:oi.length,Lt?wi.buffer.unshift(oi):wi.buffer.push(oi),wi.needReadable&&li(si)),yi(si,wi)}function Et(si,wi){var oi;return!Ie(wi)&&typeof wi!="string"&&wi!==void 0&&!si.objectMode&&(oi=new Oe("chunk",["string","Buffer","Uint8Array"],wi)),oi}Pt.prototype.isPaused=function(){return this._readableState.flowing===!1},Pt.prototype.setEncoding=function(si){Fe||(Fe=r("string_decoder/").StringDecoder);var wi=new Fe(si);this._readableState.decoder=wi,this._readableState.encoding=this._readableState.decoder.encoding;for(var oi=this._readableState.buffer.head,Lt="";oi!==null;)Lt+=wi.write(oi.data),oi=oi.next;return this._readableState.buffer.clear(),Lt!==""&&this._readableState.buffer.push(Lt),this._readableState.length=Lt.length,this};var ni=1073741824;function ri(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 ci(si,wi){return si<=0||wi.length===0&&wi.ended?0:wi.objectMode?1:si!==si?wi.flowing&&wi.length?wi.buffer.head.data.length:wi.length:(si>wi.highWaterMark&&(wi.highWaterMark=ri(si)),si<=wi.length?si:wi.ended?wi.length:(wi.needReadable=!0,0))}Pt.prototype.read=function(si){de("read",si),si=parseInt(si,10);var wi=this._readableState,oi=si;if(si!==0&&(wi.emittedReadable=!1),si===0&&wi.needReadable&&((wi.highWaterMark!==0?wi.length>=wi.highWaterMark:wi.length>0)||wi.ended))return de("read: emitReadable",wi.length,wi.ended),wi.length===0&&wi.ended?fi(this):li(this),null;if(si=ci(si,wi),si===0&&wi.ended)return wi.length===0&&fi(this),null;var Lt=wi.needReadable;de("need readable",Lt),(wi.length===0||wi.length-si<wi.highWaterMark)&&(Lt=!0,de("length less than watermark",Lt)),wi.ended||wi.reading?(Lt=!1,de("reading or ended",Lt)):Lt&&(de("do read"),wi.reading=!0,wi.sync=!0,wi.length===0&&(wi.needReadable=!0),this._read(wi.highWaterMark),wi.sync=!1,wi.reading||(si=ci(oi,wi)));var ii;return si>0?ii=di(si,wi):ii=null,ii===null?(wi.needReadable=wi.length<=wi.highWaterMark,si=0):(wi.length-=si,wi.awaitDrain=0),wi.length===0&&(wi.ended||(wi.needReadable=!0),oi!==si&&wi.ended&&fi(this)),ii!==null&&this.emit("data",ii),ii};function Ci(si,wi){if(de("onEofChunk"),!wi.ended){if(wi.decoder){var oi=wi.decoder.end();oi&&oi.length&&(wi.buffer.push(oi),wi.length+=wi.objectMode?1:oi.length)}wi.ended=!0,wi.sync?li(si):(wi.needReadable=!1,wi.emittedReadable||(wi.emittedReadable=!0,ui(si)))}}function li(si){var wi=si._readableState;de("emitReadable",wi.needReadable,wi.emittedReadable),wi.needReadable=!1,wi.emittedReadable||(de("emitReadable",wi.flowing),wi.emittedReadable=!0,k.nextTick(ui,si))}function ui(si){var wi=si._readableState;de("emitReadable_",wi.destroyed,wi.length,wi.ended),!wi.destroyed&&(wi.length||wi.ended)&&(si.emit("readable"),wi.emittedReadable=!1),wi.needReadable=!wi.flowing&&!wi.ended&&wi.length<=wi.highWaterMark,Ni(si)}function yi(si,wi){wi.readingMore||(wi.readingMore=!0,k.nextTick(Mi,si,wi))}function Mi(si,wi){for(;!wi.reading&&!wi.ended&&(wi.length<wi.highWaterMark||wi.flowing&&wi.length===0);){var oi=wi.length;if(de("maybeReadMore read 0"),si.read(0),oi===wi.length)break}wi.readingMore=!1}Pt.prototype._read=function(si){Dt(this,new At("_read()"))},Pt.prototype.pipe=function(si,wi){var oi=this,Lt=this._readableState;switch(Lt.pipesCount){case 0:Lt.pipes=si;break;case 1:Lt.pipes=[Lt.pipes,si];break;default:Lt.pipes.push(si);break}Lt.pipesCount+=1,de("pipe count=%d opts=%j",Lt.pipesCount,wi);var ii=(!wi||wi.end!==!1)&&si!==k.stdout&&si!==k.stderr,gi=ii?mi:Vi;Lt.endEmitted?k.nextTick(gi):oi.once("end",gi),si.on("unpipe",hi);function hi(ki,Hi){de("onunpipe"),ki===oi&&Hi&&Hi.hasUnpiped===!1&&(Hi.hasUnpiped=!0,Gi())}function mi(){de("onend"),si.end()}var Si=zi(oi);si.on("drain",Si);var xi=!1;function Gi(){de("cleanup"),si.removeListener("close",Zi),si.removeListener("finish",Wi),si.removeListener("drain",Si),si.removeListener("error",Oi),si.removeListener("unpipe",hi),oi.removeListener("end",mi),oi.removeListener("end",Vi),oi.removeListener("data",Bi),xi=!0,Lt.awaitDrain&&(!si._writableState||si._writableState.needDrain)&&Si()}oi.on("data",Bi);function Bi(ki){de("ondata");var Hi=si.write(ki);de("dest.write",Hi),Hi===!1&&((Lt.pipesCount===1&&Lt.pipes===si||Lt.pipesCount>1&&bi(Lt.pipes,si)!==-1)&&!xi&&(de("false write response, pause",Lt.awaitDrain),Lt.awaitDrain++),oi.pause())}function Oi(ki){de("onerror",ki),Vi(),si.removeListener("error",Oi),oe(si,"error")===0&&Dt(si,ki)}kt(si,"error",Oi);function Zi(){si.removeListener("finish",Wi),Vi()}si.once("close",Zi);function Wi(){de("onfinish"),si.removeListener("close",Zi),Vi()}si.once("finish",Wi);function Vi(){de("unpipe"),oi.unpipe(si)}return si.emit("pipe",oi),Lt.flowing||(de("pipe resume"),oi.resume()),si};function zi(si){return function(){var oi=si._readableState;de("pipeOnDrain",oi.awaitDrain),oi.awaitDrain&&oi.awaitDrain--,oi.awaitDrain===0&&oe(si,"data")&&(oi.flowing=!0,Ni(si))}}Pt.prototype.unpipe=function(si){var wi=this._readableState,oi={hasUnpiped:!1};if(wi.pipesCount===0)return this;if(wi.pipesCount===1)return si&&si!==wi.pipes?this:(si||(si=wi.pipes),wi.pipes=null,wi.pipesCount=0,wi.flowing=!1,si&&si.emit("unpipe",this,oi),this);if(!si){var Lt=wi.pipes,ii=wi.pipesCount;wi.pipes=null,wi.pipesCount=0,wi.flowing=!1;for(var gi=0;gi<ii;gi++)Lt[gi].emit("unpipe",this,{hasUnpiped:!1});return this}var hi=bi(wi.pipes,si);return hi===-1?this:(wi.pipes.splice(hi,1),wi.pipesCount-=1,wi.pipesCount===1&&(wi.pipes=wi.pipes[0]),si.emit("unpipe",this,oi),this)},Pt.prototype.on=function(si,wi){var oi=Ce.prototype.on.call(this,si,wi),Lt=this._readableState;return si==="data"?(Lt.readableListening=this.listenerCount("readable")>0,Lt.flowing!==!1&&this.resume()):si==="readable"&&!Lt.endEmitted&&!Lt.readableListening&&(Lt.readableListening=Lt.needReadable=!0,Lt.flowing=!1,Lt.emittedReadable=!1,de("on readable",Lt.length,Lt.reading),Lt.length?li(this):Lt.reading||k.nextTick(Ii,this)),oi},Pt.prototype.addListener=Pt.prototype.on,Pt.prototype.removeListener=function(si,wi){var oi=Ce.prototype.removeListener.call(this,si,wi);return si==="readable"&&k.nextTick(Ai,this),oi},Pt.prototype.removeAllListeners=function(si){var wi=Ce.prototype.removeAllListeners.apply(this,arguments);return(si==="readable"||si===void 0)&&k.nextTick(Ai,this),wi};function Ai(si){var wi=si._readableState;wi.readableListening=si.listenerCount("readable")>0,wi.resumeScheduled&&!wi.paused?wi.flowing=!0:si.listenerCount("data")>0&&si.resume()}function Ii(si){de("readable nexttick read 0"),si.read(0)}Pt.prototype.resume=function(){var si=this._readableState;return si.flowing||(de("resume"),si.flowing=!si.readableListening,ai(this,si)),si.paused=!1,this};function ai(si,wi){wi.resumeScheduled||(wi.resumeScheduled=!0,k.nextTick(pi,si,wi))}function pi(si,wi){de("resume",wi.reading),wi.reading||si.read(0),wi.resumeScheduled=!1,si.emit("resume"),Ni(si),wi.flowing&&!wi.reading&&si.read(0)}Pt.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 wi=si._readableState;for(de("flow",wi.flowing);wi.flowing&&si.read()!==null;);}Pt.prototype.wrap=function(si){var wi=this,oi=this._readableState,Lt=!1;si.on("end",function(){if(de("wrapped end"),oi.decoder&&!oi.ended){var hi=oi.decoder.end();hi&&hi.length&&wi.push(hi)}wi.push(null)}),si.on("data",function(hi){if(de("wrapped data"),oi.decoder&&(hi=oi.decoder.write(hi)),!(oi.objectMode&&hi==null)&&!(!oi.objectMode&&(!hi||!hi.length))){var mi=wi.push(hi);mi||(Lt=!0,si.pause())}});for(var ii in si)this[ii]===void 0&&typeof si[ii]=="function"&&(this[ii]=function(mi){return function(){return si[mi].apply(si,arguments)}}(ii));for(var gi=0;gi<qe.length;gi++)si.on(qe[gi],this.emit.bind(this,qe[gi]));return this._read=function(hi){de("wrapped _read",hi),Lt&&(Lt=!1,si.resume())},this},typeof Symbol=="function"&&(Pt.prototype[Symbol.asyncIterator]=function(){return Ue===void 0&&(Ue=r("./internal/streams/async_iterator")),Ue(this)}),Object.defineProperty(Pt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Pt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Pt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(wi){this._readableState&&(this._readableState.flowing=wi)}}),Pt._fromList=di,Object.defineProperty(Pt.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function di(si,wi){if(wi.length===0)return null;var oi;return wi.objectMode?oi=wi.buffer.shift():!si||si>=wi.length?(wi.decoder?oi=wi.buffer.join(""):wi.buffer.length===1?oi=wi.buffer.first():oi=wi.buffer.concat(wi.length),wi.buffer.clear()):oi=wi.buffer.consume(si,wi.decoder),oi}function fi(si){var wi=si._readableState;de("endReadable",wi.endEmitted),wi.endEmitted||(wi.ended=!0,k.nextTick(vi,wi,si))}function vi(si,wi){if(de("endReadableNT",si.endEmitted,si.length),!si.endEmitted&&si.length===0&&(si.endEmitted=!0,wi.readable=!1,wi.emit("end"),si.autoDestroy)){var oi=wi._writableState;(!oi||oi.autoDestroy&&oi.finished)&&wi.destroy()}}typeof Symbol=="function"&&(Pt.from=function(si,wi){return xe===void 0&&(xe=r("./internal/streams/from")),xe(Pt,si,wi)});function bi(si,wi){for(var oi=0,Lt=si.length;oi<Lt;oi++)if(si[oi]===wi)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,V){g.exports=le;var k=r("../errors").codes,$=k.ERR_METHOD_NOT_IMPLEMENTED,re=k.ERR_MULTIPLE_CALLBACK,oe=k.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ce=k.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 ze=he.writecb;if(ze===null)return this.emit("error",new re);he.writechunk=null,he.writecb=null,Ne!=null&&this.push(Ne),ze(de);var pe=this._readableState;pe.reading=!1,(pe.needReadable||pe.length<pe.highWaterMark)&&this._read(pe.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 ze=this._transformState;if(ze.writecb=he,ze.writechunk=de,ze.writeencoding=Ne,!ze.transforming){var pe=this._readableState;(ze.needTransform||pe.needReadable||pe.length<pe.highWaterMark)&&this._read(pe.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 oe;return de.push(null)}},{"../errors":55,"./_stream_duplex":56,inherits:24}],60:[function(r,g,V){(function(k,$){(function(){g.exports=jt;function re(Ni){var di=this;this.next=null,this.entry=null,this.finish=function(){pi(di,Ni)}}var oe;jt.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,ze=r("../errors").codes,pe=ze.ERR_INVALID_ARG_TYPE,Ve=ze.ERR_METHOD_NOT_IMPLEMENTED,Oe=ze.ERR_MULTIPLE_CALLBACK,_e=ze.ERR_STREAM_CANNOT_PIPE,At=ze.ERR_STREAM_DESTROYED,$e=ze.ERR_STREAM_NULL_VALUES,Fe=ze.ERR_STREAM_WRITE_AFTER_END,Ue=ze.ERR_UNKNOWN_ENCODING,xe=de.errorOrDestroy;r("inherits")(jt,ie);function Dt(){}function qe(Ni,di,fi){oe=oe||r("./_stream_duplex"),Ni=Ni||{},typeof fi!="boolean"&&(fi=di instanceof oe),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 vi=Ni.decodeStrings===!1;this.decodeStrings=!vi,this.defaultEncoding=Ni.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(bi){Ci(di,bi)},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 re(this)}qe.prototype.getBuffer=function(){for(var di=this.bufferedRequest,fi=[];di;)fi.push(di),di=di.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 kt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(kt=Function.prototype[Symbol.hasInstance],Object.defineProperty(jt,Symbol.hasInstance,{value:function(di){return kt.call(this,di)?!0:this!==jt?!1:di&&di._writableState instanceof qe}})):kt=function(di){return di instanceof this};function jt(Ni){oe=oe||r("./_stream_duplex");var di=this instanceof oe;if(!di&&!kt.call(jt,this))return new jt(Ni);this._writableState=new qe(Ni,this,di),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)}jt.prototype.pipe=function(){xe(this,new _e)};function Pt(Ni,di){var fi=new Fe;xe(Ni,fi),k.nextTick(di,fi)}function ti(Ni,di,fi,vi){var bi;return fi===null?bi=new $e:typeof fi!="string"&&!di.objectMode&&(bi=new pe("chunk",["string","Buffer"],fi)),bi?(xe(Ni,bi),k.nextTick(vi,bi),!1):!0}jt.prototype.write=function(Ni,di,fi){var vi=this._writableState,bi=!1,si=!vi.objectMode&&ue(Ni);return si&&!ae.isBuffer(Ni)&&(Ni=Ie(Ni)),typeof di=="function"&&(fi=di,di=null),si?di="buffer":di||(di=vi.defaultEncoding),typeof fi!="function"&&(fi=Dt),vi.ending?Pt(this,fi):(si||ti(this,vi,Ni,fi))&&(vi.pendingcb++,bi=Et(this,vi,si,Ni,di,fi)),bi},jt.prototype.cork=function(){this._writableState.corked++},jt.prototype.uncork=function(){var Ni=this._writableState;Ni.corked&&(Ni.corked--,!Ni.writing&&!Ni.corked&&!Ni.bufferProcessing&&Ni.bufferedRequest&&yi(this,Ni))},jt.prototype.setDefaultEncoding=function(di){if(typeof di=="string"&&(di=di.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((di+"").toLowerCase())>-1))throw new Ue(di);return this._writableState.defaultEncoding=di,this},Object.defineProperty(jt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ei(Ni,di,fi){return!Ni.objectMode&&Ni.decodeStrings!==!1&&typeof di=="string"&&(di=ae.from(di,fi)),di}Object.defineProperty(jt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Et(Ni,di,fi,vi,bi,si){if(!fi){var wi=ei(di,vi,bi);vi!==wi&&(fi=!0,bi="buffer",vi=wi)}var oi=di.objectMode?1:vi.length;di.length+=oi;var Lt=di.length<di.highWaterMark;if(Lt||(di.needDrain=!0),di.writing||di.corked){var ii=di.lastBufferedRequest;di.lastBufferedRequest={chunk:vi,encoding:bi,isBuf:fi,callback:si,next:null},ii?ii.next=di.lastBufferedRequest:di.bufferedRequest=di.lastBufferedRequest,di.bufferedRequestCount+=1}else ni(Ni,di,!1,oi,vi,bi,si);return Lt}function ni(Ni,di,fi,vi,bi,si,wi){di.writelen=vi,di.writecb=wi,di.writing=!0,di.sync=!0,di.destroyed?di.onwrite(new At("write")):fi?Ni._writev(bi,di.onwrite):Ni._write(bi,si,di.onwrite),di.sync=!1}function ri(Ni,di,fi,vi,bi){--di.pendingcb,fi?(k.nextTick(bi,vi),k.nextTick(Ii,Ni,di),Ni._writableState.errorEmitted=!0,xe(Ni,vi)):(bi(vi),Ni._writableState.errorEmitted=!0,xe(Ni,vi),Ii(Ni,di))}function ci(Ni){Ni.writing=!1,Ni.writecb=null,Ni.length-=Ni.writelen,Ni.writelen=0}function Ci(Ni,di){var fi=Ni._writableState,vi=fi.sync,bi=fi.writecb;if(typeof bi!="function")throw new Oe;if(ci(fi),di)ri(Ni,fi,vi,di,bi);else{var si=Mi(fi)||Ni.destroyed;!si&&!fi.corked&&!fi.bufferProcessing&&fi.bufferedRequest&&yi(Ni,fi),vi?k.nextTick(li,Ni,fi,si,bi):li(Ni,fi,si,bi)}}function li(Ni,di,fi,vi){fi||ui(Ni,di),di.pendingcb--,vi(),Ii(Ni,di)}function ui(Ni,di){di.length===0&&di.needDrain&&(di.needDrain=!1,Ni.emit("drain"))}function yi(Ni,di){di.bufferProcessing=!0;var fi=di.bufferedRequest;if(Ni._writev&&fi&&fi.next){var vi=di.bufferedRequestCount,bi=new Array(vi),si=di.corkedRequestsFree;si.entry=fi;for(var wi=0,oi=!0;fi;)bi[wi]=fi,fi.isBuf||(oi=!1),fi=fi.next,wi+=1;bi.allBuffers=oi,ni(Ni,di,!0,di.length,bi,"",si.finish),di.pendingcb++,di.lastBufferedRequest=null,si.next?(di.corkedRequestsFree=si.next,si.next=null):di.corkedRequestsFree=new re(di),di.bufferedRequestCount=0}else{for(;fi;){var Lt=fi.chunk,ii=fi.encoding,gi=fi.callback,hi=di.objectMode?1:Lt.length;if(ni(Ni,di,!1,hi,Lt,ii,gi),fi=fi.next,di.bufferedRequestCount--,di.writing)break}fi===null&&(di.lastBufferedRequest=null)}di.bufferedRequest=fi,di.bufferProcessing=!1}jt.prototype._write=function(Ni,di,fi){fi(new Ve("_write()"))},jt.prototype._writev=null,jt.prototype.end=function(Ni,di,fi){var vi=this._writableState;return typeof Ni=="function"?(fi=Ni,Ni=null,di=null):typeof di=="function"&&(fi=di,di=null),Ni!=null&&this.write(Ni,di),vi.corked&&(vi.corked=1,this.uncork()),vi.ending||ai(this,vi,fi),this},Object.defineProperty(jt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Mi(Ni){return Ni.ending&&Ni.length===0&&Ni.bufferedRequest===null&&!Ni.finished&&!Ni.writing}function zi(Ni,di){Ni._final(function(fi){di.pendingcb--,fi&&xe(Ni,fi),di.prefinished=!0,Ni.emit("prefinish"),Ii(Ni,di)})}function Ai(Ni,di){!di.prefinished&&!di.finalCalled&&(typeof Ni._final=="function"&&!di.destroyed?(di.pendingcb++,di.finalCalled=!0,k.nextTick(zi,Ni,di)):(di.prefinished=!0,Ni.emit("prefinish")))}function Ii(Ni,di){var fi=Mi(di);if(fi&&(Ai(Ni,di),di.pendingcb===0&&(di.finished=!0,Ni.emit("finish"),di.autoDestroy))){var vi=Ni._readableState;(!vi||vi.autoDestroy&&vi.endEmitted)&&Ni.destroy()}return fi}function ai(Ni,di,fi){di.ending=!0,Ii(Ni,di),fi&&(di.finished?k.nextTick(fi):Ni.once("finish",fi)),di.ended=!0,Ni.writable=!1}function pi(Ni,di,fi){var vi=Ni.entry;for(Ni.entry=null;vi;){var bi=vi.callback;di.pendingcb--,bi(fi),vi=vi.next}di.corkedRequestsFree.next=Ni}Object.defineProperty(jt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(di){this._writableState&&(this._writableState.destroyed=di)}}),jt.prototype.destroy=de.destroy,jt.prototype._undestroy=de.undestroy,jt.prototype._destroy=function(Ni,di){di(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,V){(function(k){(function(){var $;function re(At,$e,Fe){return $e in At?Object.defineProperty(At,$e,{value:Fe,enumerable:!0,configurable:!0,writable:!0}):At[$e]=Fe,At}var oe=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(At,$e){return{value:At,done:$e}}function he(At){var $e=At[Ce];if($e!==null){var Fe=At[de].read();Fe!==null&&(At[Ie]=null,At[Ce]=null,At[ie]=null,$e(Ne(Fe,!1)))}}function ze(At){k.nextTick(he,At)}function pe(At,$e){return function(Fe,Ue){At.then(function(){if($e[le]){Fe(Ne(void 0,!0));return}$e[ue](Fe,Ue)},Ue)}}var Ve=Object.getPrototypeOf(function(){}),Oe=Object.setPrototypeOf(($={get stream(){return this[de]},next:function(){var $e=this,Fe=this[ae];if(Fe!==null)return Promise.reject(Fe);if(this[le])return Promise.resolve(Ne(void 0,!0));if(this[de].destroyed)return new Promise(function(qe,kt){k.nextTick(function(){$e[ae]?kt($e[ae]):qe(Ne(void 0,!0))})});var Ue=this[Ie],xe;if(Ue)xe=new Promise(pe(Ue,this));else{var Dt=this[de].read();if(Dt!==null)return Promise.resolve(Ne(Dt,!1));xe=new Promise(this[ue])}return this[Ie]=xe,xe}},re($,Symbol.asyncIterator,function(){return this}),re($,"return",function(){var $e=this;return new Promise(function(Fe,Ue){$e[de].destroy(null,function(xe){if(xe){Ue(xe);return}Fe(Ne(void 0,!0))})})}),$),Ve),_e=function($e){var Fe,Ue=Object.create(Oe,(Fe={},re(Fe,de,{value:$e,writable:!0}),re(Fe,Ce,{value:null,writable:!0}),re(Fe,ie,{value:null,writable:!0}),re(Fe,ae,{value:null,writable:!0}),re(Fe,le,{value:$e._readableState.endEmitted,writable:!0}),re(Fe,ue,{value:function(Dt,qe){var kt=Ue[de].read();kt?(Ue[Ie]=null,Ue[Ce]=null,Ue[ie]=null,Dt(Ne(kt,!1))):(Ue[Ce]=Dt,Ue[ie]=qe)},writable:!0}),Fe));return Ue[Ie]=null,oe($e,function(xe){if(xe&&xe.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Dt=Ue[ie];Dt!==null&&(Ue[Ie]=null,Ue[Ce]=null,Ue[ie]=null,Dt(xe)),Ue[ae]=xe;return}var qe=Ue[Ce];qe!==null&&(Ue[Ie]=null,Ue[Ce]=null,Ue[ie]=null,qe(Ne(void 0,!0))),Ue[le]=!0}),$e.on("readable",ze.bind(null,Ue)),Ue};g.exports=_e}).call(this)}).call(this,r("_process"))},{"./end-of-stream":64,_process:50}],62:[function(r,g,V){function k(he,ze){var pe=Object.keys(he);if(Object.getOwnPropertySymbols){var Ve=Object.getOwnPropertySymbols(he);ze&&(Ve=Ve.filter(function(Oe){return Object.getOwnPropertyDescriptor(he,Oe).enumerable})),pe.push.apply(pe,Ve)}return pe}function $(he){for(var ze=1;ze<arguments.length;ze++){var pe=arguments[ze]!=null?arguments[ze]:{};ze%2?k(Object(pe),!0).forEach(function(Ve){re(he,Ve,pe[Ve])}):Object.getOwnPropertyDescriptors?Object.defineProperties(he,Object.getOwnPropertyDescriptors(pe)):k(Object(pe)).forEach(function(Ve){Object.defineProperty(he,Ve,Object.getOwnPropertyDescriptor(pe,Ve))})}return he}function re(he,ze,pe){return ze in he?Object.defineProperty(he,ze,{value:pe,enumerable:!0,configurable:!0,writable:!0}):he[ze]=pe,he}function oe(he,ze){if(!(he instanceof ze))throw new TypeError("Cannot call a class as a function")}function Ce(he,ze){for(var pe=0;pe<ze.length;pe++){var Ve=ze[pe];Ve.enumerable=Ve.enumerable||!1,Ve.configurable=!0,"value"in Ve&&(Ve.writable=!0),Object.defineProperty(he,Ve.key,Ve)}}function ie(he,ze,pe){return ze&&Ce(he.prototype,ze),pe&&Ce(he,pe),he}var ae=r("buffer"),le=ae.Buffer,Ie=r("util"),ue=Ie.inspect,de=ue&&ue.custom||"inspect";function Ne(he,ze,pe){le.prototype.copy.call(he,ze,pe)}g.exports=function(){function he(){oe(this,he),this.head=null,this.tail=null,this.length=0}return ie(he,[{key:"push",value:function(pe){var Ve={data:pe,next:null};this.length>0?this.tail.next=Ve:this.head=Ve,this.tail=Ve,++this.length}},{key:"unshift",value:function(pe){var Ve={data:pe,next:this.head};this.length===0&&(this.tail=Ve),this.head=Ve,++this.length}},{key:"shift",value:function(){if(this.length!==0){var pe=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,pe}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(pe){if(this.length===0)return"";for(var Ve=this.head,Oe=""+Ve.data;Ve=Ve.next;)Oe+=pe+Ve.data;return Oe}},{key:"concat",value:function(pe){if(this.length===0)return le.alloc(0);for(var Ve=le.allocUnsafe(pe>>>0),Oe=this.head,_e=0;Oe;)Ne(Oe.data,Ve,_e),_e+=Oe.data.length,Oe=Oe.next;return Ve}},{key:"consume",value:function(pe,Ve){var Oe;return pe<this.head.data.length?(Oe=this.head.data.slice(0,pe),this.head.data=this.head.data.slice(pe)):pe===this.head.data.length?Oe=this.shift():Oe=Ve?this._getString(pe):this._getBuffer(pe),Oe}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(pe){var Ve=this.head,Oe=1,_e=Ve.data;for(pe-=_e.length;Ve=Ve.next;){var At=Ve.data,$e=pe>At.length?At.length:pe;if($e===At.length?_e+=At:_e+=At.slice(0,pe),pe-=$e,pe===0){$e===At.length?(++Oe,Ve.next?this.head=Ve.next:this.head=this.tail=null):(this.head=Ve,Ve.data=At.slice($e));break}++Oe}return this.length-=Oe,_e}},{key:"_getBuffer",value:function(pe){var Ve=le.allocUnsafe(pe),Oe=this.head,_e=1;for(Oe.data.copy(Ve),pe-=Oe.data.length;Oe=Oe.next;){var At=Oe.data,$e=pe>At.length?At.length:pe;if(At.copy(Ve,Ve.length-pe,0,$e),pe-=$e,pe===0){$e===At.length?(++_e,Oe.next?this.head=Oe.next:this.head=this.tail=null):(this.head=Oe,Oe.data=At.slice($e));break}++_e}return this.length-=_e,Ve}},{key:de,value:function(pe,Ve){return ue(this,$({},Ve,{depth:0,customInspect:!1}))}}]),he}()},{buffer:17,util:16}],63:[function(r,g,V){(function(k){(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,k.nextTick(ie,this,le)):k.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?k.nextTick(oe,ue):(ue._writableState.errorEmitted=!0,k.nextTick(re,ue,he)):k.nextTick(re,ue,he):Ie?(k.nextTick(oe,ue),Ie(he)):k.nextTick(oe,ue)}),this)}function re(le,Ie){ie(le,Ie),oe(le)}function oe(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,V){var k=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 re(){}function oe(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||re);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)},ze=ie._readableState&&ie._readableState.endEmitted,pe=function(){Ie=!1,ze=!0,ue||le.call(ie)},Ve=function($e){le.call(ie,$e)},Oe=function(){var $e;if(Ie&&!ze)return(!ie._readableState||!ie._readableState.ended)&&($e=new k),le.call(ie,$e);if(ue&&!Ne)return(!ie._writableState||!ie._writableState.ended)&&($e=new k),le.call(ie,$e)},_e=function(){ie.req.on("finish",he)};return oe(ie)?(ie.on("complete",he),ie.on("abort",Oe),ie.req?_e():ie.on("request",_e)):ue&&!ie._writableState&&(ie.on("end",de),ie.on("close",de)),ie.on("end",pe),ie.on("finish",he),ae.error!==!1&&ie.on("error",Ve),ie.on("close",Oe),function(){ie.removeListener("complete",he),ie.removeListener("abort",Oe),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",pe),ie.removeListener("error",Ve),ie.removeListener("close",Oe)}}g.exports=Ce},{"../../../errors":55}],65:[function(r,g,V){g.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],66:[function(r,g,V){var k;function $(he){var ze=!1;return function(){ze||(ze=!0,he.apply(void 0,arguments))}}var re=r("../../../errors").codes,oe=re.ERR_MISSING_ARGS,Ce=re.ERR_STREAM_DESTROYED;function ie(he){if(he)throw he}function ae(he){return he.setHeader&&typeof he.abort=="function"}function le(he,ze,pe,Ve){Ve=$(Ve);var Oe=!1;he.on("close",function(){Oe=!0}),k===void 0&&(k=r("./end-of-stream")),k(he,{readable:ze,writable:pe},function(At){if(At)return Ve(At);Oe=!0,Ve()});var _e=!1;return function(At){if(!Oe&&!_e){if(_e=!0,ae(he))return he.abort();if(typeof he.destroy=="function")return he.destroy();Ve(At||new Ce("pipe"))}}}function Ie(he){he()}function ue(he,ze){return he.pipe(ze)}function de(he){return!he.length||typeof he[he.length-1]!="function"?ie:he.pop()}function Ne(){for(var he=arguments.length,ze=new Array(he),pe=0;pe<he;pe++)ze[pe]=arguments[pe];var Ve=de(ze);if(Array.isArray(ze[0])&&(ze=ze[0]),ze.length<2)throw new oe("streams");var Oe,_e=ze.map(function(At,$e){var Fe=$e<ze.length-1,Ue=$e>0;return le(At,Fe,Ue,function(xe){Oe||(Oe=xe),xe&&_e.forEach(Ie),!Fe&&(_e.forEach(Ie),Ve(Oe))})});return ze.reduce(ue)}g.exports=Ne},{"../../../errors":55,"./end-of-stream":64}],67:[function(r,g,V){var k=r("../../../errors").codes.ERR_INVALID_OPT_VALUE;function $(oe,Ce,ie){return oe.highWaterMark!=null?oe.highWaterMark:Ce?oe[ie]:null}function re(oe,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 k(Ie,le)}return Math.floor(le)}return oe.objectMode?16:16*1024}g.exports={getHighWaterMark:re}},{"../../../errors":55}],68:[function(r,g,V){g.exports=r("events").EventEmitter},{events:22}],69:[function(r,g,V){V=g.exports=r("./lib/_stream_readable.js"),V.Stream=V,V.Readable=V,V.Writable=r("./lib/_stream_writable.js"),V.Duplex=r("./lib/_stream_duplex.js"),V.Transform=r("./lib/_stream_transform.js"),V.PassThrough=r("./lib/_stream_passthrough.js"),V.finished=r("./lib/internal/streams/end-of-stream.js"),V.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,V){function k(re,oe,Ce){var ie=this;this._callback=re,this._args=Ce,this._interval=setInterval(re,oe,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 re;if(arguments.length>0){re=new Array(arguments.length-2);for(var oe=0;oe<re.length;oe++)re[oe]=arguments[oe+2]}return new k(arguments[0],arguments[1],re)}g.exports=$},{}],71:[function(r,g,V){g.exports=r("./index.js")()},{"./index.js":72}],72:[function(r,g,V){(function(k){(function(){g.exports=re;function $(Ce){return Ce instanceof k?k.from(Ce):new Ce.constructor(Ce.buffer.slice(),Ce.byteOffset,Ce.length)}function re(Ce){if(Ce=Ce||{},Ce.circles)return oe(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 ze=de[he],pe=Ie[ze];typeof pe!="object"||pe===null?Ne[ze]=pe:pe instanceof Date?Ne[ze]=new Date(pe):ArrayBuffer.isView(pe)?Ne[ze]=$(pe):Ne[ze]=ue(pe)}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 oe(Ce){var ie=[],ae=[];return Ce.proto?ue:Ie;function le(de,Ne){for(var he=Object.keys(de),ze=new Array(he.length),pe=0;pe<he.length;pe++){var Ve=he[pe],Oe=de[Ve];if(typeof Oe!="object"||Oe===null)ze[Ve]=Oe;else if(Oe instanceof Date)ze[Ve]=new Date(Oe);else if(ArrayBuffer.isView(Oe))ze[Ve]=$(Oe);else{var _e=ie.indexOf(Oe);_e!==-1?ze[Ve]=ae[_e]:ze[Ve]=Ne(Oe)}}return ze}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 ze=de[he];if(typeof ze!="object"||ze===null)Ne[he]=ze;else if(ze instanceof Date)Ne[he]=new Date(ze);else if(ze instanceof Map)Ne[he]=new Map(le(Array.from(ze),Ie));else if(ze instanceof Set)Ne[he]=new Set(le(Array.from(ze),Ie));else if(ArrayBuffer.isView(ze))Ne[he]=$(ze);else{var pe=ie.indexOf(ze);pe!==-1?Ne[he]=ae[pe]:Ne[he]=Ie(ze)}}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 ze=de[he];if(typeof ze!="object"||ze===null)Ne[he]=ze;else if(ze instanceof Date)Ne[he]=new Date(ze);else if(ze instanceof Map)Ne[he]=new Map(le(Array.from(ze),ue));else if(ze instanceof Set)Ne[he]=new Set(le(Array.from(ze),ue));else if(ArrayBuffer.isView(ze))Ne[he]=$(ze);else{var pe=ie.indexOf(ze);pe!==-1?Ne[he]=ae[pe]:Ne[he]=ue(ze)}}return ie.pop(),ae.pop(),Ne}}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],73:[function(r,g,V){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var k=r("buffer"),$=k.Buffer;function re(Ce,ie){for(var ae in Ce)ie[ae]=Ce[ae]}$.from&&$.alloc&&$.allocUnsafe&&$.allocUnsafeSlow?g.exports=k:(re(k,V),V.Buffer=oe);function oe(Ce,ie,ae){return $(Ce,ie,ae)}oe.prototype=Object.create($.prototype),re($,oe),oe.from=function(Ce,ie,ae){if(typeof Ce=="number")throw new TypeError("Argument must not be a number");return $(Ce,ie,ae)},oe.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},oe.allocUnsafe=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return $(Ce)},oe.allocUnsafeSlow=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return k.SlowBuffer(Ce)}},{buffer:17}],74:[function(r,g,V){g.exports=k;function k(re){var oe=re._readableState;return oe?oe.objectMode||typeof re._duplexState=="number"?re.read():re.read($(oe)):null}function $(re){return re.buffer.length?re.buffer.head?re.buffer.head.data.length:re.buffer[0].length:re.length}},{}],75:[function(r,g,V){var k=r("safe-buffer").Buffer,$=k.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 re(_e){if(!_e)return"utf8";for(var At;;)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(At)return;_e=(""+_e).toLowerCase(),At=!0}}function oe(_e){var At=re(_e);if(typeof At!="string"&&(k.isEncoding===$||!$(_e)))throw new Error("Unknown encoding: "+_e);return At||_e}V.StringDecoder=Ce;function Ce(_e){this.encoding=oe(_e);var At;switch(this.encoding){case"utf16le":this.text=Ne,this.end=he,At=4;break;case"utf8":this.fillLast=Ie,At=4;break;case"base64":this.text=ze,this.end=pe,At=3;break;default:this.write=Ve,this.end=Oe;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=k.allocUnsafe(At)}Ce.prototype.write=function(_e){if(_e.length===0)return"";var At,$e;if(this.lastNeed){if(At=this.fillLast(_e),At===void 0)return"";$e=this.lastNeed,this.lastNeed=0}else $e=0;return $e<_e.length?At?At+this.text(_e,$e):this.text(_e,$e):At||""},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,At,$e){var Fe=At.length-1;if(Fe<$e)return 0;var Ue=ie(At[Fe]);return Ue>=0?(Ue>0&&(_e.lastNeed=Ue-1),Ue):--Fe<$e||Ue===-2?0:(Ue=ie(At[Fe]),Ue>=0?(Ue>0&&(_e.lastNeed=Ue-2),Ue):--Fe<$e||Ue===-2?0:(Ue=ie(At[Fe]),Ue>=0?(Ue>0&&(Ue===2?Ue=0:_e.lastNeed=Ue-3),Ue):0))}function le(_e,At,$e){if((At[0]&192)!==128)return _e.lastNeed=0,"�";if(_e.lastNeed>1&&At.length>1){if((At[1]&192)!==128)return _e.lastNeed=1,"�";if(_e.lastNeed>2&&At.length>2&&(At[2]&192)!==128)return _e.lastNeed=2,"�"}}function Ie(_e){var At=this.lastTotal-this.lastNeed,$e=le(this,_e);if($e!==void 0)return $e;if(this.lastNeed<=_e.length)return _e.copy(this.lastChar,At,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_e.copy(this.lastChar,At,0,_e.length),this.lastNeed-=_e.length}function ue(_e,At){var $e=ae(this,_e,At);if(!this.lastNeed)return _e.toString("utf8",At);this.lastTotal=$e;var Fe=_e.length-($e-this.lastNeed);return _e.copy(this.lastChar,0,Fe),_e.toString("utf8",At,Fe)}function de(_e){var At=_e&&_e.length?this.write(_e):"";return this.lastNeed?At+"�":At}function Ne(_e,At){if((_e.length-At)%2===0){var $e=_e.toString("utf16le",At);if($e){var Fe=$e.charCodeAt($e.length-1);if(Fe>=55296&&Fe<=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",At,_e.length-1)}function he(_e){var At=_e&&_e.length?this.write(_e):"";if(this.lastNeed){var $e=this.lastTotal-this.lastNeed;return At+this.lastChar.toString("utf16le",0,$e)}return At}function ze(_e,At){var $e=(_e.length-At)%3;return $e===0?_e.toString("base64",At):(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",At,_e.length-$e))}function pe(_e){var At=_e&&_e.length?this.write(_e):"";return this.lastNeed?At+this.lastChar.toString("base64",0,3-this.lastNeed):At}function Ve(_e){return _e.toString(this.encoding)}function Oe(_e){return _e&&_e.length?this.write(_e):""}},{"safe-buffer":73}],76:[function(r,g,V){var k=r("punycode"),$=r("./util");V.parse=At,V.resolve=Fe,V.resolveObject=Ue,V.format=$e,V.Url=re;function re(){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 oe=/^([a-z0-9.+-]+:)/i,Ce=/:[0-9]*$/,ie=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ae=["<",">",'"',"`"," ","\r",`
1264
- `," "],le=["{","}","|","\\","^","`"].concat(ae),Ie=["'"].concat(le),ue=["%","/","?",";","#"].concat(Ie),de=["/","?","#"],Ne=255,he=/^[+a-z0-9A-Z_-]{0,63}$/,ze=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,pe={javascript:!0,"javascript:":!0},Ve={javascript:!0,"javascript:":!0},Oe={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_e=r("querystring");function At(xe,Dt,qe){if(xe&&$.isObject(xe)&&xe instanceof re)return xe;var kt=new re;return kt.parse(xe,Dt,qe),kt}re.prototype.parse=function(xe,Dt,qe){if(!$.isString(xe))throw new TypeError("Parameter 'url' must be a string, not "+typeof xe);var kt=xe.indexOf("?"),jt=kt!==-1&&kt<xe.indexOf("#")?"?":"#",Pt=xe.split(jt),ti=/\\/g;Pt[0]=Pt[0].replace(ti,"/"),xe=Pt.join(jt);var ei=xe;if(ei=ei.trim(),!qe&&xe.split("#").length===1){var Et=ie.exec(ei);if(Et)return this.path=ei,this.href=ei,this.pathname=Et[1],Et[2]?(this.search=Et[2],Dt?this.query=_e.parse(this.search.substr(1)):this.query=this.search.substr(1)):Dt&&(this.search="",this.query={}),this}var ni=oe.exec(ei);if(ni){ni=ni[0];var ri=ni.toLowerCase();this.protocol=ri,ei=ei.substr(ni.length)}if(qe||ni||ei.match(/^\/\/[^@\/]+@[^@\/]+/)){var ci=ei.substr(0,2)==="//";ci&&!(ni&&Ve[ni])&&(ei=ei.substr(2),this.slashes=!0)}if(!Ve[ni]&&(ci||ni&&!Oe[ni])){for(var Ci=-1,li=0;li<de.length;li++){var ui=ei.indexOf(de[li]);ui!==-1&&(Ci===-1||ui<Ci)&&(Ci=ui)}var yi,Mi;Ci===-1?Mi=ei.lastIndexOf("@"):Mi=ei.lastIndexOf("@",Ci),Mi!==-1&&(yi=ei.slice(0,Mi),ei=ei.slice(Mi+1),this.auth=decodeURIComponent(yi)),Ci=-1;for(var li=0;li<ue.length;li++){var ui=ei.indexOf(ue[li]);ui!==-1&&(Ci===-1||ui<Ci)&&(Ci=ui)}Ci===-1&&(Ci=ei.length),this.host=ei.slice(0,Ci),ei=ei.slice(Ci),this.parseHost(),this.hostname=this.hostname||"";var zi=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!zi)for(var Ai=this.hostname.split(/\./),li=0,Ii=Ai.length;li<Ii;li++){var ai=Ai[li];if(ai&&!ai.match(he)){for(var pi="",Ni=0,di=ai.length;Ni<di;Ni++)ai.charCodeAt(Ni)>127?pi+="x":pi+=ai[Ni];if(!pi.match(he)){var fi=Ai.slice(0,li),vi=Ai.slice(li+1),bi=ai.match(ze);bi&&(fi.push(bi[1]),vi.unshift(bi[2])),vi.length&&(ei="/"+vi.join(".")+ei),this.hostname=fi.join(".");break}}}this.hostname.length>Ne?this.hostname="":this.hostname=this.hostname.toLowerCase(),zi||(this.hostname=k.toASCII(this.hostname));var si=this.port?":"+this.port:"",wi=this.hostname||"";this.host=wi+si,this.href+=this.host,zi&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ei[0]!=="/"&&(ei="/"+ei))}if(!pe[ri])for(var li=0,Ii=Ie.length;li<Ii;li++){var oi=Ie[li];if(ei.indexOf(oi)!==-1){var Lt=encodeURIComponent(oi);Lt===oi&&(Lt=escape(oi)),ei=ei.split(oi).join(Lt)}}var ii=ei.indexOf("#");ii!==-1&&(this.hash=ei.substr(ii),ei=ei.slice(0,ii));var gi=ei.indexOf("?");if(gi!==-1?(this.search=ei.substr(gi),this.query=ei.substr(gi+1),Dt&&(this.query=_e.parse(this.query)),ei=ei.slice(0,gi)):Dt&&(this.search="",this.query={}),ei&&(this.pathname=ei),Oe[ri]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var si=this.pathname||"",hi=this.search||"";this.path=si+hi}return this.href=this.format(),this};function $e(xe){return $.isString(xe)&&(xe=At(xe)),xe instanceof re?xe.format():re.prototype.format.call(xe)}re.prototype.format=function(){var xe=this.auth||"";xe&&(xe=encodeURIComponent(xe),xe=xe.replace(/%3A/i,":"),xe+="@");var Dt=this.protocol||"",qe=this.pathname||"",kt=this.hash||"",jt=!1,Pt="";this.host?jt=xe+this.host:this.hostname&&(jt=xe+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(jt+=":"+this.port)),this.query&&$.isObject(this.query)&&Object.keys(this.query).length&&(Pt=_e.stringify(this.query));var ti=this.search||Pt&&"?"+Pt||"";return Dt&&Dt.substr(-1)!==":"&&(Dt+=":"),this.slashes||(!Dt||Oe[Dt])&&jt!==!1?(jt="//"+(jt||""),qe&&qe.charAt(0)!=="/"&&(qe="/"+qe)):jt||(jt=""),kt&&kt.charAt(0)!=="#"&&(kt="#"+kt),ti&&ti.charAt(0)!=="?"&&(ti="?"+ti),qe=qe.replace(/[?#]/g,function(ei){return encodeURIComponent(ei)}),ti=ti.replace("#","%23"),Dt+jt+qe+ti+kt};function Fe(xe,Dt){return At(xe,!1,!0).resolve(Dt)}re.prototype.resolve=function(xe){return this.resolveObject(At(xe,!1,!0)).format()};function Ue(xe,Dt){return xe?At(xe,!1,!0).resolveObject(Dt):Dt}re.prototype.resolveObject=function(xe){if($.isString(xe)){var Dt=new re;Dt.parse(xe,!1,!0),xe=Dt}for(var qe=new re,kt=Object.keys(this),jt=0;jt<kt.length;jt++){var Pt=kt[jt];qe[Pt]=this[Pt]}if(qe.hash=xe.hash,xe.href==="")return qe.href=qe.format(),qe;if(xe.slashes&&!xe.protocol){for(var ti=Object.keys(xe),ei=0;ei<ti.length;ei++){var Et=ti[ei];Et!=="protocol"&&(qe[Et]=xe[Et])}return Oe[qe.protocol]&&qe.hostname&&!qe.pathname&&(qe.path=qe.pathname="/"),qe.href=qe.format(),qe}if(xe.protocol&&xe.protocol!==qe.protocol){if(!Oe[xe.protocol]){for(var ni=Object.keys(xe),ri=0;ri<ni.length;ri++){var ci=ni[ri];qe[ci]=xe[ci]}return qe.href=qe.format(),qe}if(qe.protocol=xe.protocol,!xe.host&&!Ve[xe.protocol]){for(var Ii=(xe.pathname||"").split("/");Ii.length&&!(xe.host=Ii.shift()););xe.host||(xe.host=""),xe.hostname||(xe.hostname=""),Ii[0]!==""&&Ii.unshift(""),Ii.length<2&&Ii.unshift(""),qe.pathname=Ii.join("/")}else qe.pathname=xe.pathname;if(qe.search=xe.search,qe.query=xe.query,qe.host=xe.host||"",qe.auth=xe.auth,qe.hostname=xe.hostname||xe.host,qe.port=xe.port,qe.pathname||qe.search){var Ci=qe.pathname||"",li=qe.search||"";qe.path=Ci+li}return qe.slashes=qe.slashes||xe.slashes,qe.href=qe.format(),qe}var ui=qe.pathname&&qe.pathname.charAt(0)==="/",yi=xe.host||xe.pathname&&xe.pathname.charAt(0)==="/",Mi=yi||ui||qe.host&&xe.pathname,zi=Mi,Ai=qe.pathname&&qe.pathname.split("/")||[],Ii=xe.pathname&&xe.pathname.split("/")||[],ai=qe.protocol&&!Oe[qe.protocol];if(ai&&(qe.hostname="",qe.port=null,qe.host&&(Ai[0]===""?Ai[0]=qe.host:Ai.unshift(qe.host)),qe.host="",xe.protocol&&(xe.hostname=null,xe.port=null,xe.host&&(Ii[0]===""?Ii[0]=xe.host:Ii.unshift(xe.host)),xe.host=null),Mi=Mi&&(Ii[0]===""||Ai[0]==="")),yi)qe.host=xe.host||xe.host===""?xe.host:qe.host,qe.hostname=xe.hostname||xe.hostname===""?xe.hostname:qe.hostname,qe.search=xe.search,qe.query=xe.query,Ai=Ii;else if(Ii.length)Ai||(Ai=[]),Ai.pop(),Ai=Ai.concat(Ii),qe.search=xe.search,qe.query=xe.query;else if(!$.isNullOrUndefined(xe.search)){if(ai){qe.hostname=qe.host=Ai.shift();var pi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;pi&&(qe.auth=pi.shift(),qe.host=qe.hostname=pi.shift())}return qe.search=xe.search,qe.query=xe.query,(!$.isNull(qe.pathname)||!$.isNull(qe.search))&&(qe.path=(qe.pathname?qe.pathname:"")+(qe.search?qe.search:"")),qe.href=qe.format(),qe}if(!Ai.length)return qe.pathname=null,qe.search?qe.path="/"+qe.search:qe.path=null,qe.href=qe.format(),qe;for(var Ni=Ai.slice(-1)[0],di=(qe.host||xe.host||Ai.length>1)&&(Ni==="."||Ni==="..")||Ni==="",fi=0,vi=Ai.length;vi>=0;vi--)Ni=Ai[vi],Ni==="."?Ai.splice(vi,1):Ni===".."?(Ai.splice(vi,1),fi++):fi&&(Ai.splice(vi,1),fi--);if(!Mi&&!zi)for(;fi--;fi)Ai.unshift("..");Mi&&Ai[0]!==""&&(!Ai[0]||Ai[0].charAt(0)!=="/")&&Ai.unshift(""),di&&Ai.join("/").substr(-1)!=="/"&&Ai.push("");var bi=Ai[0]===""||Ai[0]&&Ai[0].charAt(0)==="/";if(ai){qe.hostname=qe.host=bi?"":Ai.length?Ai.shift():"";var pi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;pi&&(qe.auth=pi.shift(),qe.host=qe.hostname=pi.shift())}return Mi=Mi||qe.host&&Ai.length,Mi&&!bi&&Ai.unshift(""),Ai.length?qe.pathname=Ai.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=xe.auth||qe.auth,qe.slashes=qe.slashes||xe.slashes,qe.href=qe.format(),qe},re.prototype.parseHost=function(){var xe=this.host,Dt=Ce.exec(xe);Dt&&(Dt=Dt[0],Dt!==":"&&(this.port=Dt.substr(1)),xe=xe.substr(0,xe.length-Dt.length)),xe&&(this.hostname=xe)}},{"./util":77,punycode:51,querystring:54}],77:[function(r,g,V){g.exports={isString:function(k){return typeof k=="string"},isObject:function(k){return typeof k=="object"&&k!==null},isNull:function(k){return k===null},isNullOrUndefined:function(k){return k==null}}},{}],78:[function(r,g,V){(function(k){(function(){g.exports=$;function $(oe,Ce){if(re("noDeprecation"))return oe;var ie=!1;function ae(){if(!ie){if(re("throwDeprecation"))throw new Error(Ce);re("traceDeprecation")?console.trace(Ce):console.warn(Ce),ie=!0}return oe.apply(this,arguments)}return ae}function re(oe){try{if(!k.localStorage)return!1}catch{return!1}var Ce=k.localStorage[oe];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,V){g.exports=k;function k($,re){if($&&re)return k($)(re);if(typeof $!="function")throw new TypeError("need wrapper function");return Object.keys($).forEach(function(Ce){oe[Ce]=$[Ce]}),oe;function oe(){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,V){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,V){g.exports=$;var k=Object.prototype.hasOwnProperty;function $(){for(var re={},oe=0;oe<arguments.length;oe++){var Ce=arguments[oe];for(var ie in Ce)k.call(Ce,ie)&&(re[ie]=Ce[ie])}return re}},{}],82:[function(r,g,V){g.exports=function(k){k.prototype[Symbol.iterator]=function*(){for(let $=this.head;$;$=$.next)yield $.value}}},{}],83:[function(r,g,V){g.exports=k,k.Node=Ce,k.create=k;function k(ie){var ae=this;if(ae instanceof k||(ae=new k),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}k.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},k.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++}},k.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++}},k.prototype.push=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)re(this,arguments[ie]);return this.length},k.prototype.unshift=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)oe(this,arguments[ie]);return this.length},k.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}},k.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}},k.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},k.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},k.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},k.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},k.prototype.map=function(ie,ae){ae=ae||this;for(var le=new k,Ie=this.head;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.next;return le},k.prototype.mapReverse=function(ie,ae){ae=ae||this;for(var le=new k,Ie=this.tail;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.prev;return le},k.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},k.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},k.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},k.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},k.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 k;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},k.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 k;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},k.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},k.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 re(ie,ae){ie.tail=new Ce(ae,ie.tail,null,ie),ie.head||(ie.head=ie.tail),ie.length++}function oe(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")(k)}catch{}},{"./iterator.js":82}]},{},[12])(12)})})(mqtt);var mqttExports=mqtt.exports;let client;const sub=(i,n,r,g,V)=>{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",V)},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:"svg-viewer",props:{data:{},canvasDrag:{type:Boolean,default:!0}},emits:["onMessage"],setup(i,{expose:n,emit:r}){const g=i;vue.useCssVars(he=>({"124bbd8e":vue.unref($)}));const V=useGlobalStore(pinia);componentsRegister();const k=vue.reactive(g.data??{layout_center:{x:0,y:0},config:{svg:{background_color:"#fff",scale:1,grid_color:"#ebebeb"},net:{mqtt:{url:"",user:"",pwd:"",topics:""}}},done_json:[]}),$=vue.computed(()=>V.intention==EGlobalStoreIntention.MoveCanvas?"grab":"default"),re=he=>{if(V.mouse_info.state!=EMouseInfoState.Down&&V.intention!==EGlobalStoreIntention.Connection||!g.canvasDrag)return;const{clientX:ze,clientY:pe}=he;V.mouse_info.new_position_x=V.mouse_info.now_position_x+ze-V.mouse_info.position_x,V.mouse_info.new_position_y=V.mouse_info.now_position_y+pe-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.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})},Ce=he=>{const{clientX:ze,clientY:pe}=he;V.intention=EGlobalStoreIntention.MoveCanvas,V.mouse_info={state:EMouseInfoState.Down,position_x:ze,position_y:pe,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}};function ie(he){he!=null&&he.wheelDelta&&(he.wheelDelta>0?k.config.svg.scale=parseFloat((k.config.svg.scale+.1).toFixed(1)):k.config.svg.scale=parseFloat((k.config.svg.scale-.1).toFixed(1)))}const ae=(he,ze,pe)=>({x:he.x-he.width/2*ze+he.width/2,y:he.y-he.height/2*pe+he.height/2,width:he.width*ze,height:he.height*pe}),le=he=>{var pe;let ze=!1;if(((pe=he.events)==null?void 0:pe.length)>0){for(let Ve of he.events)if(Ve.type===EEventType.Click){ze=!0;break}}return{cursor:ze?"pointer":"default"}},Ie=(he,ze)=>{var pe;if(console.log(he.events,ze),((pe=he.events)==null?void 0:pe.length)>0){for(let Ve of he.events)if(Ve.type===ze){if(Ve.condition&&Ve.condition.type!=="None"&&Ve.condition.type==="Relation"&&Ve.condition.Relation&&Ve.condition.Relation.relation){const Oe=Ve.condition.Relation.key,_e=Ve.condition.Relation.relation,At=valFormat(Ve.condition.Relation.val),$e=valFormat(Ve.condition.Relation.val2);if(he.props.hasOwnProperty(Oe)){const Fe=he.props[Oe].val;if(!ue(Fe,_e,At,$e))continue}}if(Ve.action===EEventAction.ChangeAttr){if(Ve.attrs&&Ve.attrs.length>0){let Oe;if(Ve.target){for(let _e of k.done_json)if(_e.id===Ve.target){Oe=_e;break}}else Oe=he;if(!Oe)continue;for(let _e of Ve.attrs)_e.key==="state"?Oe.defaultState=valFormat(_e.val):Oe.props.hasOwnProperty(_e.key)&&(Oe.props[_e.key].val=valFormat(_e.val))}}else Ve.action===EEventAction.JavaScript&&new Function(Ve.scripts)()}}},ue=(he,ze,pe,Ve)=>{switch(ze){case">":return he>pe;case">=":return he>=pe;case"<":return he<pe;case"<=":return he<=pe;case"==":return he==pe;case"!=":return he!=pe;case">=,=<":return he>=pe&&he<=Ve;case"<,>":return he<pe||he>Ve}},de=()=>{const he=k.config.net.mqtt;he&&he.url&&he.user&&he.pwd&&he.topics&&sub(he.url,he.user,he.pwd,he.topics,(ze,pe)=>{console.log(ze),console.log(pe.toString()),r("onMessage",{topics:ze,message:pe})})},Ne=(he,ze,pe)=>setArrItemByID(he,ze,pe,k.done_json);return vue.onMounted(()=>{de()}),vue.onBeforeUnmount(close),n({setNodeAttrByID:Ne}),(he,ze)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",onMousedown:Ce,onMousemove:re,onMouseup:oe,onMousewheel:ie,onContextmenu:ze[4]||(ze[4]=(...pe)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...pe))},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(k).config.svg.background_color}),width:"100%",height:"100%"},[vue.createElementVNode("g",{transform:`translate(${vue.unref(k).layout_center.x},${vue.unref(k).layout_center.y})rotate(0)scale(${vue.unref(k).config.svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(k).done_json,pe=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:pe.id,transform:`translate(${pe.x},${pe.y})rotate(0)scale(1)`,style:vue.normalizeStyle(le(pe)),onClick:Ve=>Ie(pe,vue.unref(EEventType).Click),onMousedown:ze[0]||(ze[0]=(...Ve)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...Ve)),onMousemove:ze[1]||(ze[1]=(...Ve)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...Ve)),onMouseup:ze[2]||(ze[2]=(...Ve)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...Ve)),onMousewheel:ze[3]||(ze[3]=(...Ve)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...Ve))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(pe)}`)},[vue.createElementVNode("g",{transform:`translate(${pe.actual_bound.x+pe.actual_bound.width/2},${pe.actual_bound.y+pe.actual_bound.height/2})rotate(${pe.rotate}) scale(1) translate(${-(pe.actual_bound.x+pe.actual_bound.width/2)},${-(pe.actual_bound.y+pe.actual_bound.height/2)})`},[pe.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$e,{key:0,"item-info":pe},null,8,["item-info"])):pe.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${pe.name}`},vue.unref(prosToVBind)(pe),{width:"100",height:"100",id:pe.id,transform:`translate(${pe.actual_bound.x+pe.actual_bound.width/2},${pe.actual_bound.y+pe.actual_bound.height/2}) scale(${pe.scale_x},${pe.scale_y}) translate(${-(pe.actual_bound.x+pe.actual_bound.width/2)},${-(pe.actual_bound.y+pe.actual_bound.height/2)})`}),null,16,_hoisted_4)):pe.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(pe.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(pe),{width:"100",height:"100",id:pe.id,onOnChange:Ve=>Ie(pe,vue.unref(EEventType).Change),transform:`translate(${pe.actual_bound.x+pe.actual_bound.width/2},${pe.actual_bound.y+pe.actual_bound.height/2}) scale(${pe.scale_x},${pe.scale_y}) translate(${-(pe.actual_bound.x+pe.actual_bound.width/2)},${-(pe.actual_bound.y+pe.actual_bound.height/2)})`}),null,16,["id","onOnChange","transform"])):pe.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},ae(pe.actual_bound,pe.scale_x,pe.scale_y),{id:`foreign-object${pe.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(pe.tag),vue.mergeProps(vue.unref(prosToVBind)(pe),{id:pe.id,onOnChange:Ve=>Ie(pe,vue.unref(EEventType).Change),transform:`translate(${pe.actual_bound.x+pe.actual_bound.width/2},${pe.actual_bound.y+pe.actual_bound.height/2}) scale(${pe.scale_x},${pe.scale_y}) translate(${-(pe.actual_bound.x+pe.actual_bound.width/2)},${-(pe.actual_bound.y+pe.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(pe.tag_slot),1)]),_:2},1040,["id","onOnChange","transform"]))],16,_hoisted_5)):vue.createCommentVNode("",!0)],8,_hoisted_3)],2)],44,_hoisted_2)),[[vue.vShow,pe.display]])),128))],8,_hoisted_1)],4))],32))}}),svgViewer_vue_vue_type_style_index_0_scoped_8ba7b1d0_lang="",svgViewer=_export_sfc(_sfc_main,[["__scopeId","data-v-8ba7b1d0"]]);exports.SvgEditor=index,exports.SvgViewer=svgViewer,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
1263
+ }`,"autocompletion.css",!1),g.AcePopup=Ie,g.$singleLineEditor=le,g.getAriaId=ae}),ace.define("ace/autocomplete/util",["require","exports","module"],function(r,g,V){g.parForEach=function($,re,oe){var Ce=0,ie=$.length;ie===0&&oe();for(var ae=0;ae<ie;ae++)re($[ae],function(le,Ie){Ce++,Ce===ie&&oe(le,Ie)})};var k=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;g.retrievePrecedingIdentifier=function($,re,oe){oe=oe||k;for(var Ce=[],ie=re-1;ie>=0&&oe.test($[ie]);ie--)Ce.push($[ie]);return Ce.reverse().join("")},g.retrieveFollowingIdentifier=function($,re,oe){oe=oe||k;for(var Ce=[],ie=re;ie<$.length&&oe.test($[ie]);ie++)Ce.push($[ie]);return Ce},g.getCompletionPrefix=function($){var re=$.getCursorPosition(),oe=$.session.getLine(re.row),Ce;return $.completers.forEach(function(ie){ie.identifierRegexps&&ie.identifierRegexps.forEach(function(ae){!Ce&&ae&&(Ce=this.retrievePrecedingIdentifier(oe,re.column,ae))}.bind(this))}.bind(this)),Ce||this.retrievePrecedingIdentifier(oe,re.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,V){var k=r("./keyboard/hash_handler").HashHandler,$=r("./autocomplete/popup").AcePopup,re=r("./autocomplete/popup").getAriaId,oe=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 k,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:re(this.popup.getRow())}),de.keyBinding.addKeyboardHandler(this.keyboardHandler);var ze=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 pe=ze.layerConfig.lineHeight,Ve=ze.$cursorLayer.getPixelPosition(this.base,!0);Ve.left-=this.popup.getTextLeftOffset();var Oe=de.container.getBoundingClientRect();Ve.top+=Oe.top-ze.layerConfig.offset,Ve.left+=Oe.left-de.renderer.scrollLeft,Ve.left+=ze.gutterWidth,this.popup.show(Ve,pe)}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(),ze=de.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(de.relatedTarget),pe=this.popup&&this.popup.container;Ne!=he&&Ne.parentNode!=pe&&!ze&&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 ze=this.editor.selection.getAllRanges(),pe=0,Ve;Ve=ze[pe];pe++)Ve.start.column-=he.filterText.length,this.editor.session.remove(Ve);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(),ze=de.getCursorPosition(),pe=oe.getCompletionPrefix(de);this.base=he.doc.createAnchor(ze.row,ze.column-pe.length),this.base.$insertRight=!0;var Ve=[],Oe=de.completers.length;return de.completers.forEach(function(_e,At){_e.getCompletions(de,he,ze,pe,function($e,Fe){!$e&&Fe&&(Ve=Ve.concat(Fe)),Ne(null,{prefix:oe.getCompletionPrefix(de),matches:Ve,finished:--Oe===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(),ze=this.editor.session.getTextRange({start:this.base,end:he});if(ze==this.completions.filterText)return;if(this.completions.setFilter(ze),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==ze&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,ze,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 pe=this.gatherCompletionsId,Ve=function(Fe){if(Fe.finished)return this.detach()}.bind(this),Oe=function(Fe){var Ue=Fe.prefix,xe=Fe.matches;this.completions=new ue(xe),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(Ue);var Dt=this.completions.filtered;if(!Dt.length||Dt.length==1&&Dt[0].value==Ue&&!Dt[0].snippet)return Ve(Fe);if(this.autoInsert&&Dt.length==1&&Fe.finished)return this.insertMatch(Dt[0]);this.openPopup(this.editor,Ue,de)}.bind(this),_e=!0,At=null;if(this.gatherCompletions(this.editor,function(Fe,Ue){var xe=Ue.prefix,Dt=Ue&&Ue.matches;if(!Dt||!Dt.length)return Ve(Ue);if(!(xe.indexOf(Ue.prefix)!==0||pe!=this.gatherCompletionsId)){if(_e){At=Ue;return}Oe(Ue)}}.bind(this)),_e=!1,At){var $e=At;At=null,Oe($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()]),ze=null;if(!he||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();if(this.editor.completers.some(function(pe){return pe.getDocTooltip&&(ze=pe.getDocTooltip(he)),ze}),!ze&&typeof he!="string"&&(ze=he),typeof ze=="string"&&(ze={docText:ze}),!ze||!(ze.docHTML||ze.docText))return this.hideDocTooltip();this.showDocTooltip(ze)},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,ze=he.container.getBoundingClientRect();Ne.style.top=he.container.style.top,Ne.style.bottom=he.container.style.bottom,Ne.style.display="block",window.innerWidth-ze.right<320?ze.left<320?he.isTopdown?(Ne.style.top=ze.bottom+"px",Ne.style.left=ze.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.top=he.container.offsetTop-Ne.offsetHeight+"px",Ne.style.left=ze.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.right=window.innerWidth-ze.left+"px",Ne.style.left=""):(Ne.style.left=ze.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(ze,pe){return pe.exactMatch-ze.exactMatch||pe.$score-ze.$score||(ze.caption||ze.value).localeCompare(pe.caption||pe.value)});var he=null;Ne=Ne.filter(function(ze){var pe=ze.snippet||ze.caption||ze.value;return pe===he?!1:(he=pe,!0)}),this.filtered=Ne},this.filterCompletions=function(de,Ne){var he=[],ze=Ne.toUpperCase(),pe=Ne.toLowerCase();e:for(var Ve=0,Oe;Oe=de[Ve];Ve++){var _e=Oe.caption||Oe.value||Oe.snippet;if(_e){var At=-1,$e=0,Fe=0,Ue,xe;if(this.exactMatch){if(Ne!==_e.substr(0,Ne.length))continue e}else{var Dt=_e.toLowerCase().indexOf(pe);if(Dt>-1)Fe=Dt;else for(var qe=0;qe<Ne.length;qe++){var kt=_e.indexOf(pe[qe],At+1),jt=_e.indexOf(ze[qe],At+1);if(Ue=kt>=0&&(jt<0||kt<jt)?kt:jt,Ue<0)continue e;xe=Ue-At-1,xe>0&&(At===-1&&(Fe+=10),Fe+=xe,$e=$e|1<<qe),At=Ue}}Oe.matchMask=$e,Oe.exactMatch=Fe?0:1,Oe.$score=(Oe.score||0)-Fe,he.push(Oe)}}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,V){var k=r("../range").Range,$=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function re(Ce,ie){var ae=Ce.getTextRange(k.fromPoints({row:0,column:0},ie));return ae.split($).length-1}function oe(Ce,ie){var ae=re(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),ze=le.length-he;Ie[de]?Ie[de]=Math.max(ze,Ie[de]):Ie[de]=ze}}),Ie}g.getCompletions=function(Ce,ie,ae,le,Ie){var ue=oe(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,V){var k=r("../snippets").snippetManager,$=r("../autocomplete").Autocomplete,re=r("../config"),oe=r("../lib/lang"),Ce=r("../autocomplete/util"),ie=r("../autocomplete/text_completer"),ae={getCompletions:function(Oe,_e,At,$e,Fe){if(_e.$mode.completer)return _e.$mode.completer.getCompletions(Oe,_e,At,$e,Fe);var Ue=Oe.session.getState(At.row),xe=_e.$mode.getCompletions(Ue,_e,At,$e);Fe(null,xe)}},le=function(Oe){var _e={};return Oe.replace(/\${(\d+)(:(.*?))?}/g,function(At,$e,Fe,Ue){return _e[$e]=Ue||""}).replace(/\$(\d+?)/g,function(At,$e){return _e[$e]})},Ie={getCompletions:function(Oe,_e,At,$e,Fe){var Ue=[],xe=_e.getTokenAt(At.row,At.column);xe&&xe.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?Ue.push("html-tag"):Ue=k.getActiveScopes(Oe);var Dt=k.snippetMap,qe=[];Ue.forEach(function(kt){for(var jt=Dt[kt]||[],Pt=jt.length;Pt--;){var ti=jt[Pt],ei=ti.name||ti.tabTrigger;ei&&qe.push({caption:ei,snippet:ti.content,meta:ti.tabTrigger&&!ti.name?ti.tabTrigger+"⇥ ":"snippet",type:"snippet"})}},this),Fe(null,qe)},getDocTooltip:function(Oe){Oe.type=="snippet"&&!Oe.docHTML&&(Oe.docHTML=["<b>",oe.escapeHTML(Oe.caption),"</b>","<hr></hr>",oe.escapeHTML(le(Oe.snippet))].join(""))}},ue=[Ie,ie,ae];g.setCompleters=function(Oe){ue.length=0,Oe&&ue.push.apply(ue,Oe)},g.addCompleter=function(Oe){ue.push(Oe)},g.textCompleter=ie,g.keyWordCompleter=ae,g.snippetCompleter=Ie;var de={name:"expandSnippet",exec:function(Oe){return k.expandWithTab(Oe)},bindKey:"Tab"},Ne=function(Oe,_e){he(_e.session.$mode)},he=function(Oe){typeof Oe=="string"&&(Oe=re.$modes[Oe]),Oe&&(k.files||(k.files={}),ze(Oe.$id,Oe.snippetFileId),Oe.modes&&Oe.modes.forEach(he))},ze=function(Oe,_e){!_e||!Oe||k.files[Oe]||(k.files[Oe]={},re.loadModule(_e,function(At){At&&(k.files[Oe]=At,!At.snippets&&At.snippetText&&(At.snippets=k.parseSnippetFile(At.snippetText)),k.register(At.snippets||[],At.scope),At.includeScopes&&(k.snippetMap[At.scope].includeScopes=At.includeScopes,At.includeScopes.forEach(function($e){he("ace/mode/"+$e)})))}))},pe=function(Oe){var _e=Oe.editor,At=_e.completer&&_e.completer.activated;if(Oe.command.name==="backspace")At&&!Ce.getCompletionPrefix(_e)&&_e.completer.detach();else if(Oe.command.name==="insertstring"){var $e=Ce.getCompletionPrefix(_e);if($e&&!At){var Fe=$.for(_e);Fe.autoInsert=!1,Fe.showPopup(_e)}}},Ve=r("../editor").Editor;r("../config").defineOptions(Ve.prototype,"editor",{enableBasicAutocompletion:{set:function(Oe){Oe?(this.completers||(this.completers=Array.isArray(Oe)?Oe:ue),this.commands.addCommand($.startCommand)):this.commands.removeCommand($.startCommand)},value:!1},enableLiveAutocompletion:{set:function(Oe){Oe?(this.completers||(this.completers=Array.isArray(Oe)?Oe:ue),this.commands.on("afterExec",pe)):this.commands.removeListener("afterExec",pe)},value:!1},enableSnippets:{set:function(Oe){Oe?(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$c=vue.defineComponent({__name:"code-edit-modal",props:{modelValue:{default:()=>({})},lang:{default:"json"},title:{default:"编辑"}},emits:["update:modelValue","close"],setup(i,{emit:n}){const r=i,g=vue.ref(!1),V=vue.computed({get(){return r.lang==="json"?JSON.stringify(r.modelValue,null,2):r.modelValue},set(k){r.lang==="json"?n("update:modelValue",JSON.parse(k)):n("update:modelValue",k)}});return(k,$)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElButton),{onClick:$[0]||($[0]=re=>g.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("···")]),_:1}),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:vue.unref(g),"onUpdate:modelValue":$[2]||($[2]=re=>vue.isRef(g)?g.value=re:null),title:r.title,width:"60%",onClose:$[3]||($[3]=re=>n("close"))},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(VAceEditor),{value:vue.unref(V),"onUpdate:value":$[1]||($[1]=re=>vue.isRef(V)?V.value=re:null),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$5={class:"one-row-txt",style:{width:"145px"}},_hoisted_4$3={key:1},_sfc_main$b=vue.defineComponent({__name:"dynamic-el-form-item",props:{objInfo:{default:()=>({})},hide:{default:()=>[]},code:{type:Boolean,default:!1}},emits:["change"],setup(i,{emit:n}){const r=i;function g(V){let k=window.setTimeout(function(){n("change",V),clearTimeout(k),k=null},200)}return(V,k)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(r.objInfo,($,re)=>(vue.openBlock(),vue.createElementBlock("div",{key:re},[r.code?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,class:"props-row",size:"small"},{label:vue.withCtx(()=>[vue.unref(getStringWidth)(String(re))>78?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:String(re),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$7,vue.toDisplayString(re),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$5,vue.toDisplayString(re),1))]),default:vue.withCtx(()=>[vue.unref(getStringWidth)(String($.val))>145?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:JSON.stringify($.val),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$5,vue.toDisplayString($.val),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$3,vue.toDisplayString($.val),1))]),_:2},1024)):vue.createCommentVNode("",!0),r.hide.indexOf(String(re))<0?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:$.title,size:"small"},{default:vue.withCtx(()=>[$.type===vue.unref(EConfigItemPropsType).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElSelect),{key:0,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,placeholder:"Select",size:"small",disabled:!!($!=null&&$.disabled),onChange:g},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList($.options,oe=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:oe.value,label:oe.label,value:oe.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).InputNumber?(vue.openBlock(),vue.createBlock(vue.unref(ElInputNumber),{key:1,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,disabled:!!($!=null&&$.disabled),onChange:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).Input?(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:2,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,disabled:!!($!=null&&$.disabled),onChange:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).Textarea?(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:3,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,autosize:"",type:"textarea",disabled:!!($!=null&&$.disabled),onChange:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).Color?(vue.openBlock(),vue.createBlock(vue.unref(ElColorPicker),{key:4,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,disabled:!!($!=null&&$.disabled),onChange:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).Switch?(vue.openBlock(),vue.createBlock(vue.unref(ElSwitch),{key:5,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,disabled:!!($!=null&&$.disabled),onChange:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):$.type===vue.unref(EConfigItemPropsType).JsonEdit?(vue.openBlock(),vue.createBlock(_sfc_main$c,{key:6,modelValue:$.val,"onUpdate:modelValue":oe=>$.val=oe,disabled:!!($!=null&&$.disabled),onClose:g},null,8,["modelValue","onUpdate:modelValue","disabled"])):vue.createCommentVNode("",!0)]),_:2},1032,["label"])):vue.createCommentVNode("",!0)]))),128))}}),dynamicElFormItem_vue_vue_type_style_index_0_scoped_df8be28f_lang="",dynamicElFormItem_vue_vue_type_style_index_1_lang="",DynamicElFormItem=_export_sfc(_sfc_main$b,[["__scopeId","data-v-df8be28f"]]),_hoisted_1$6={style:{height:"100%"}},_hoisted_2$4={class:"flex flex-wrap"},_hoisted_3$4=["onMouseenter","onClick"],_sfc_main$a=vue.defineComponent({__name:"common-animate",props:{val:{}},emits:["updateCommonAniVal"],setup(i,{emit:n}){const r=i,g=vue.ref(r.val),V=vue.ref(!1),k=vue.ref("进入"),$=vue.ref(null),re=oe=>{n("updateCommonAniVal",oe),V.value=!1};return vue.watch(()=>r.val,oe=>{g.value=oe}),(oe,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.unref(g)?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:0,closable:"",onClose:Ce[0]||(Ce[0]=ie=>re("")),onClick:Ce[1]||(Ce[1]=ie=>V.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==vue.unref(g)))==null?void 0:ie.label)+" ",1),vue.createVNode(vue.unref(ElIcon),{size:10},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"setting"})]),_:1})]}),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:1,type:"success",style:{cursor:"pointer"},onClick:Ce[2]||(Ce[2]=ie=>V.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("新增")]),_:1})),vue.createVNode(vue.unref(ElDrawer),{modelValue:vue.unref(V),"onUpdate:modelValue":Ce[5]||(Ce[5]=ie=>vue.isRef(V)?V.value=ie:null),title:"选择动画",direction:"ltr"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabs),{modelValue:vue.unref(k),"onUpdate:modelValue":Ce[4]||(Ce[4]=ie=>vue.isRef(k)?k.value=ie:null)},{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=>re(ae.value)},[vue.createElementVNode("div",{class:vue.normalizeClass(`${vue.unref($)==le?`animate__animated animate__${ae.value} animate__slow animate__infinite`:""}`)},vue.toDisplayString(ae.label),3)],40,_hoisted_3$4))),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]))}}),commonAnimate_vue_vue_type_style_index_0_scoped_2668f60c_lang="",CommonAnimate=_export_sfc(_sfc_main$a,[["__scopeId","data-v-2668f60c"]]),_sfc_main$9=vue.defineComponent({__name:"component-tree",setup(i){const n=useGlobalStore(pinia),r=vue.computed(()=>{var k;return((k=n.handle_svg_info)==null?void 0:k.info.id)??""}),g=k=>{for(let $ of n.done_json)$.selected=!1,$.old_position={x:0,y:0};n.intention=EGlobalStoreIntention.Select,n.setHandleSvgInfo(k)},V={children:"children",label:"title"};return(k,$)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTree),{class:"tree-v",data:vue.unref(n).done_json,props:V,onNodeClick:g,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!!vue.unref(r),"node-key":"id","current-node-key":vue.unref(r)},null,8,["data","highlight-current","current-node-key"]))}}),_withScopeId$1=i=>(vue.pushScopeId("data-v-98320511"),i=i(),vue.popScopeId(),i),_hoisted_1$5={class:"wall-l"},_hoisted_2$3={class:"head-l"},_hoisted_3$3=_withScopeId$1(()=>vue.createElementVNode("span",null,"key",-1)),_hoisted_4$2=_withScopeId$1(()=>vue.createElementVNode("span",null,"value",-1)),_hoisted_5$1={class:"row-l"},_sfc_main$8=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",$)}}),V=()=>{g.value.push({key:"",val:""})},k=$=>{g.value.splice($,1)};return($,re)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.createElementVNode("div",_hoisted_2$3,[_hoisted_3$3,_hoisted_4$2,vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:V},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"add"})]),_:1})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(g),(oe,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:oe.key,"onUpdate:modelValue":ie=>oe.key=ie,size:"small",placeholder:"key"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:oe.val,"onUpdate:modelValue":ie=>oe.val=ie,size:"small",placeholder:"value"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:ie=>k(Ce)},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{name:"delete"})]),_:2},1032,["onClick"])]))),256))]))}}),list_vue_vue_type_style_index_0_scoped_98320511_lang="",List=_export_sfc(_sfc_main$8,[["__scopeId","data-v-98320511"]]),_hoisted_1$4={class:"c-wall-d"},_sfc_main$7=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",$)}}),V=[{label:"大于",val:"greater"},{label:"大于等于",val:">="},{label:"小于",val:"<"},{label:"小于等于",val:"<="},{label:"等于",val:"=="},{label:"不等于",val:"!="},{label:"介于",val:">=,=<"},{label:"不介于",val:"<,>"}],k=$=>{$!=="None"&&(g.value.Relation={key:"",relation:"",val:"",val2:""}),n("update:modelValue",g)};return($,re)=>{var oe,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:vue.unref(g).type,"onUpdate:modelValue":re[0]||(re[0]=ie=>vue.unref(g).type=ie),onChange:k},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"None",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"Relation",label:"关系运算"})]),_:1},8,["modelValue"])]),_:1}),vue.unref(g).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"属性",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(g).Relation.key,"onUpdate:modelValue":re[1]||(re[1]=ie=>vue.unref(g).Relation.key=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(g).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"关系",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(g).Relation.relation,"onUpdate:modelValue":re[2]||(re[2]=ie=>vue.unref(g).Relation.relation=ie)},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(V,(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),vue.unref(g).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"值",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(g).Relation.val,"onUpdate:modelValue":re[3]||(re[3]=ie=>vue.unref(g).Relation.val=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(g).type==="Relation"&&(((oe=vue.unref(g).Relation)==null?void 0:oe.relation)===">=,=<"||((Ce=vue.unref(g).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:vue.unref(g).Relation.val2,"onUpdate:modelValue":re[4]||(re[4]=ie=>vue.unref(g).Relation.val2=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)])}}}),condition_vue_vue_type_style_index_0_scoped_f43f10e6_lang="",Condition=_export_sfc(_sfc_main$7,[["__scopeId","data-v-f43f10e6"]]),_sfc_main$6=vue.defineComponent({__name:"bind-anchor",props:{modelValue:{},title:{}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=useGlobalStore(pinia),V=vue.computed({get(){return r.modelValue!==null},set(ie){let ae=null;ie&&(ae={target_id:"",type:""}),n("update:modelValue",ae)}}),k=vue.computed({get(){var ie;return((ie=r.modelValue)==null?void 0:ie.target_id)??void 0},set(ie){let ae=null;V.value&&(ae={target_id:ie,type:$.value}),n("update:modelValue",ae)}}),$=vue.computed({get(){var ie;return((ie=r.modelValue)==null?void 0:ie.type)??void 0},set(ie){let ae=null;V.value&&(ae={target_id:k.value,type:ie}),n("update:modelValue",ae)}}),re=vue.computed(()=>g.done_json.filter(ie=>ie.type!==EDoneJsonType.ConnectionLine).map(ie=>({label:ie.title,value:ie.id}))),oe=[{label:"上锚点",value:ELineBindAnchors.TopCenter},{label:"右锚点",value:ELineBindAnchors.Right},{label:"下锚点",value:ELineBindAnchors.BottomCenter},{label:"左锚点",value:ELineBindAnchors.Left}];function Ce(){vue.nextTick(function(){var ie,ae;if(V.value&&((ie=r.modelValue)!=null&&ie.target_id)&&((ae=r.modelValue)!=null&&ae.type)&&g.handle_svg_info){let le=null;for(let Ie of g.done_json)Ie.id===r.modelValue.target_id&&(le=Ie);le&&(setSvgActualInfo(le),moveAnchors(le))}})}return(ie,ae)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(vue.unref(ElFormItem),{label:r.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(V),"onUpdate:modelValue":ae[0]||(ae[0]=le=>vue.isRef(V)?V.value=le:null),onChange:Ce},null,8,["modelValue"])]),_:1},8,["label"]),vue.unref(V)?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"绑定对象",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(k),"onUpdate:modelValue":ae[1]||(ae[1]=le=>vue.isRef(k)?k.value=le:null),onChange:Ce},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(re),le=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:le.value,label:le.label,value:le.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(V)?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"绑定位置",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref($),"onUpdate:modelValue":ae[2]||(ae[2]=le=>vue.isRef($)?$.value=le:null),onChange:Ce},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(oe,le=>vue.createVNode(vue.unref(ElOption),{key:le.value,label:le.label,value:le.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)],64))}}),_withScopeId=i=>(vue.pushScopeId("data-v-9b4c5da1"),i=i(),vue.popScopeId(),i),_hoisted_1$3=_withScopeId(()=>vue.createElementVNode("span",{style:{"font-weight":"bold"}},"MQTT",-1)),_hoisted_2$2={key:2},_hoisted_3$2={class:"events-title"},_sfc_main$5=vue.defineComponent({__name:"right-panel",setup(i){const n=useConfigStore(pinia),r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),V=vue.ref("page"),k=vue.ref("style"),$=(ue,de)=>{ue!=null&&ue.common_animations&&(ue.common_animations.val=de)};n.$subscribe((ue,de)=>{ue.storeId==="config-store"&&localStorage.setItem("svg-editor-config",JSON.stringify(de))});const re=vue.ref(numberArray(20)),oe=vue.ref(["MQTT"]),Ce=vue.ref();Ce.value=()=>{var de,Ne;let ue={type:EEventType.Null,action:EEventAction.Null,target:"",scripts:"",condition:{type:EConditionType.None}};(Ne=(de=r.handle_svg_info)==null?void 0:de.info)==null||Ne.events.push(ue)};const ie=(ue,de)=>{ue==="ChangeAttr"?de.attrs=[{key:"",val:""}]:delete de.attrs},ae=ue=>{var de,Ne;(Ne=(de=r.handle_svg_info)==null?void 0:de.info)==null||Ne.events.splice(ue,1)},le=()=>{g.center_offset={x:0,y:0}},Ie=(ue,de,Ne)=>{vue.nextTick(function(){if(r.handle_svg_info){const he=r.done_json[r.handle_svg_info.index];Ne?setSvgActualInfo(he,Ne):setSvgActualInfo(he),moveAnchors(he)}})};return(ue,de)=>vue.unref(r).intention!=vue.unref(EGlobalStoreIntention).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElTabs),{key:0,class:"mx-2 rightTabs",modelValue:vue.unref(V),"onUpdate:modelValue":de[13]||(de[13]=Ne=>vue.isRef(V)?V.value=Ne:null)},{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":de[0]||(de[0]=Ne=>vue.unref(n).svg.background_color=Ne)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"画布",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{size:"small",onClick:le,icon:vue.unref(aim_default)},{default:vue.withCtx(()=>[vue.createTextVNode("重置位置")]),_:1},8,["icon"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"X轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(g).center_offset.x,"onUpdate:modelValue":de[1]||(de[1]=Ne=>vue.unref(g).center_offset.x=Ne)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"Y轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(g).center_offset.y,"onUpdate:modelValue":de[2]||(de[2]=Ne=>vue.unref(g).center_offset.y=Ne)},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":de[3]||(de[3]=Ne=>vue.unref(n).svg.scale=Ne),step:.1,"step-strictly":""},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":de[4]||(de[4]=Ne=>vue.unref(n).svg.ruler=Ne)},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":de[5]||(de[5]=Ne=>vue.unref(n).svg.grid=Ne)},null,8,["modelValue"])]),_:1}),vue.unref(n).svg.grid?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"网格颜色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElColorPicker),{modelValue:vue.unref(n).svg.grid_color,"onUpdate:modelValue":de[6]||(de[6]=Ne=>vue.unref(n).svg.grid_color=Ne)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_: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(vue.unref(ElFormItem),{label:vue.unref(n).connection_line.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(n).connection_line.animations.type.val,"onUpdate:modelValue":de[7]||(de[7]=Ne=>vue.unref(n).connection_line.animations.type.val=Ne),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(n).connection_line.animations.type.options,Ne=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:Ne.value,label:Ne.label,value:Ne.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),vue.unref(n).connection_line.animations.type.val!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:0,"obj-info":vue.unref(n).connection_line.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0)]),_:1})):vue.createCommentVNode("",!0)]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"通信",name:"net"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapse),{modelValue:vue.unref(oe),"onUpdate:modelValue":de[12]||(de[12]=Ne=>vue.isRef(oe)?oe.value=Ne:null)},{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":de[8]||(de[8]=Ne=>vue.unref(n).net.mqtt.url=Ne),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":de[9]||(de[9]=Ne=>vue.unref(n).net.mqtt.user=Ne),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":de[10]||(de[10]=Ne=>vue.unref(n).net.mqtt.pwd=Ne),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":de[11]||(de[11]=Ne=>vue.unref(n).net.mqtt.topics=Ne),placeholder:"topics"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$9)]),_: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:vue.unref(k),"onUpdate:modelValue":de[34]||(de[34]=Ne=>vue.isRef(k)?k.value=Ne:null)},{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(()=>{var Ne,he,ze,pe;return[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":de[14]||(de[14]=Ve=>vue.unref(r).handle_svg_info.info.title=Ve)},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":de[15]||(de[15]=Ve=>vue.unref(r).handle_svg_info.info.x=Ve),onChange: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":de[16]||(de[16]=Ve=>vue.unref(r).handle_svg_info.info.y=Ve),onChange:Ie},null,8,["modelValue"])]),_:1}),vue.withDirectives(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.scale_x,"onUpdate:modelValue":de[17]||(de[17]=Ve=>vue.unref(r).handle_svg_info.info.scale_x=Ve),onChange:Ie},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(he=(Ne=vue.unref(r).handle_svg_info)==null?void 0:Ne.info)==null?void 0:he.config.can_zoom]]),vue.withDirectives(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.scale_y,"onUpdate:modelValue":de[18]||(de[18]=Ve=>vue.unref(r).handle_svg_info.info.scale_y=Ve),onChange:Ie},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(pe=(ze=vue.unref(r).handle_svg_info)==null?void 0:ze.info)==null?void 0:pe.config.can_zoom]]),vue.createVNode(vue.unref(ElFormItem),{label:"旋转",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(r).handle_svg_info.info.rotate,"onUpdate:modelValue":de[19]||(de[19]=Ve=>vue.unref(r).handle_svg_info.info.rotate=Ve),onChange: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":de[20]||(de[20]=Ve=>vue.unref(r).handle_svg_info.info.display=Ve)},null,8,["modelValue"])]),_:1})]}),_:1})]),_: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 Ne,he,ze,pe,Ve,Oe,_e,At;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":de[21]||(de[21]=$e=>vue.unref(r).handle_svg_info.info.id=$e)},null,8,["modelValue"])]),_:1}),(he=(Ne=vue.unref(r).handle_svg_info)==null?void 0:Ne.info)!=null&&he.state?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,class:"props-row",label:"state",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(r).handle_svg_info.info.defaultState),1)]),_:1})):vue.createCommentVNode("",!0),(pe=(ze=vue.unref(r).handle_svg_info)==null?void 0:ze.info)!=null&&pe.state?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"状态",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.defaultState,"onUpdate:modelValue":de[22]||(de[22]=$e=>vue.unref(r).handle_svg_info.info.defaultState=$e),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).handle_svg_info.info.state,($e,Fe)=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:"state"+String(Fe),label:$e.label,value:Fe},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),(Ve=vue.unref(r).handle_svg_info.info)!=null&&Ve.hasOwnProperty("tag_slot")?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$2,[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":de[23]||(de[23]=$e=>vue.unref(r).handle_svg_info.info.tag_slot=$e),onInput:de[24]||(de[24]=$e=>Ie($e,null,!0))},null,8,["modelValue"])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).handle_svg_info.info.props,code:"",onChange:de[25]||(de[25]=$e=>Ie($e,null,!0))},null,8,["obj-info"]),vue.unref(r).handle_svg_info.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:vue.unref(r).handle_svg_info.info.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.animations.type.val,"onUpdate:modelValue":de[26]||(de[26]=$e=>vue.unref(r).handle_svg_info.info.animations.type.val=$e),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).handle_svg_info.info.animations.type.options,$e=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:$e.value,label:$e.label,value:$e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"])):vue.createCommentVNode("",!0),((Oe=vue.unref(r).handle_svg_info.info.animations)==null?void 0:Oe.type.val)!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:4,"obj-info":vue.unref(r).handle_svg_info.info.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0),((_e=vue.unref(r).handle_svg_info)==null?void 0:_e.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:5,modelValue:vue.unref(r).handle_svg_info.info.bind_anchors.start,"onUpdate:modelValue":de[27]||(de[27]=$e=>vue.unref(r).handle_svg_info.info.bind_anchors.start=$e),title:"绑定起点"},null,8,["modelValue"])):vue.createCommentVNode("",!0),((At=vue.unref(r).handle_svg_info)==null?void 0:At.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:6,modelValue:vue.unref(r).handle_svg_info.info.bind_anchors.end,"onUpdate:modelValue":de[28]||(de[28]=$e=>vue.unref(r).handle_svg_info.info.bind_anchors.end=$e),title:"绑定终点"},null,8,["modelValue"])):vue.createCommentVNode("",!0)]}),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"事件",name:"event"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{type:"primary",style:{width:"100%"},onClick:vue.unref(Ce)},{default:vue.withCtx(()=>[vue.createTextVNode("添加事件")]),_:1},8,["onClick"]),vue.createVNode(vue.unref(ElCollapse),{modelValue:vue.unref(re),"onUpdate:modelValue":de[29]||(de[29]=Ne=>vue.isRef(re)?re.value=Ne:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).handle_svg_info.info.events,(Ne,he)=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:he,key:"event"+he},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$2,[vue.createElementVNode("span",null,"事件"+vue.toDisplayString(he+1),1),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:vue.withModifiers(ze=>ae(he),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$j,{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:Ne.type,"onUpdate:modelValue":ze=>Ne.type=ze},{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:Ne.action,"onUpdate:modelValue":ze=>Ne.action=ze,onChange:ze=>ie(ze,Ne)},{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),Ne.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"目标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:Ne.target,"onUpdate:modelValue":ze=>Ne.target=ze,placeholder:"默认自身"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),Ne.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(List,{key:1,modelValue:Ne.attrs,"onUpdate:modelValue":ze=>Ne.attrs=ze},null,8,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),Ne.action==="JavaScript"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"JavaScript",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$c,{modelValue:Ne.scripts,"onUpdate:modelValue":ze=>Ne.scripts=ze,lang:"javascript"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),vue.createVNode(Condition,{modelValue:Ne.condition,"onUpdate:modelValue":ze=>Ne.condition=ze},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 Ne;return[(Ne=vue.unref(r).handle_svg_info)!=null&&Ne.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:de[30]||(de[30]=he=>{var ze;return $((ze=vue.unref(r).handle_svg_info)==null?void 0:ze.info,he)}),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":de[31]||(de[31]=he=>vue.unref(r).handle_svg_info.info.common_animations.delay=he)},{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":de[32]||(de[32]=he=>vue.unref(r).handle_svg_info.info.common_animations.speed=he)},{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":de[33]||(de[33]=he=>vue.unref(r).handle_svg_info.info.common_animations.repeat=he)},{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:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$9)]),_:1})]),_:1},8,["modelValue"])):vue.createCommentVNode("",!0)}}),rightPanel_vue_vue_type_style_index_0_scoped_9b4c5da1_lang="",rightPanel_vue_vue_type_style_index_1_lang="",RightPanel=_export_sfc(_sfc_main$5,[["__scopeId","data-v-9b4c5da1"]]),_sfc_main$4=vue.defineComponent({__name:"export-json",setup(i){const n=vue.ref(""),r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),V=useConfigStore(pinia);return vue.onMounted(()=>{const k={layout_center:g.center_offset,config:V.$state,done_json:r.done_json};n.value=JSON.stringify(k,null,2)}),(k,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(n),"onUpdate:value":$[0]||($[0]=re=>vue.isRef(n)?n.value=re:null),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:"import-json",setup(i,{expose:n}){const r=vue.ref("");return n({setVal:k=>{r.value=k},onImportJson:()=>{useImportDataModel(r.value)&&ElMessage.success("导入成功")}}),(k,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(r),"onUpdate:value":$[0]||($[0]=re=>vue.isRef(r)?r.value=re:null),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_hoisted_1$2=["onMousedown"],_hoisted_2$1=["onMousedown"],_hoisted_3$1=["title","onMousedown"],_hoisted_4$1={class:"vue-ruler-content-mask"},_sfc_main$2=vue.defineComponent({__name:"vue3-ruler-tool",props:{visible:{type:Boolean,default:!0},stepLength:{default:100}},emits:["onLineMouseUp"],setup(i,{emit:n}){const r=i,g=useSvgEditLayoutStore(pinia),V=useConfigStore(pinia),k=function(){return function(Ai,Ii,ai){Ai&&Ii&&ai&&Ai.addEventListener(Ii,ai,!1)}}(),$=function(){return function(Ai,Ii,ai){Ai&&Ii&&Ai.removeEventListener(Ii,ai,!1)}}();let re=18,oe=vue.ref(0),Ce=vue.ref(0),ie=vue.ref([]),ae=vue.ref([]);const le=vue.ref([]);let Ie=vue.ref(!1),ue="",de=vue.ref(-999),Ne=vue.ref(-999),he=18,ze=18,pe="";const Ve=vue.ref(null),Oe=vue.ref(null),_e=vue.ref(null),At=vue.ref(null),$e=vue.computed(()=>({width:oe.value+"px",height:Ce.value+"px"})),Fe=vue.computed(()=>({padding:re+"px 0px 0px "+re+"px"})),Ue=vue.computed(()=>{let Ai=0,Ii=0;return le.value.map(ai=>{const pi=ai.type==="h";return{id:`${ai.type}_${pi?Ai++:Ii++}`,type:ai.type,title:ai.site.toFixed(0)+"px",[pi?"top":"left"]:ai.site*V.svg.scale+re+g.center_offset[pi?"y":"x"]*V.svg.scale}})});g.$subscribe(Ai=>{var Ii,ai,pi,Ni;((ai=(Ii=Ai.events)==null?void 0:Ii.target)!=null&&ai.hasOwnProperty("left_nav")||(Ni=(pi=Ai.events)==null?void 0:pi.target)!=null&&Ni.hasOwnProperty("right_nav"))&&window.setTimeout(xe,420)}),V.$subscribe(Ai=>{var Ii,ai;(ai=(Ii=Ai.events)==null?void 0:Ii.target)!=null&&ai.hasOwnProperty("scale")&&Pt()}),vue.onMounted(()=>{k(document,"mousemove",ei),k(document,"mouseup",ri),xe(),k(window,"resize",Dt)}),vue.onBeforeUnmount(()=>{$(document,"mousemove",ei),$(document,"mouseup",ri),$(window,"resize",Dt)});const xe=()=>{jt(),Pt()},Dt=()=>{ie.value=[],ae.value=[],xe()},qe=({type:Ai,top:Ii,left:ai})=>Ai==="h"?{top:Ii+"px"}:{left:ai+"px"},kt=({type:Ai,id:Ii})=>Ai==="h"?yi(Ii):Mi(Ii),jt=()=>{const Ai=window.getComputedStyle(Oe.value.parentNode,null);oe.value=parseInt(Ai.getPropertyValue("width")),Ce.value=parseInt(Ai.getPropertyValue("height")),he=_e.value.clientWidth,ze=At.value.clientHeight},Pt=()=>{ti(ie.value,oe.value,g.center_offset.x),ti(ae.value,Ce.value,g.center_offset.y)},ti=(Ai,Ii,ai)=>{if(Ai.length===0)for(let pi=0;pi<Ii;pi+=r.stepLength)pi%r.stepLength===0&&Ai.push({id:Number((pi/V.svg.scale-ai).toFixed(0))});else Ai.forEach((pi,Ni)=>{pi.id=Number((Ni*r.stepLength/V.svg.scale-ai).toFixed(0))})},ei=Ai=>{Pt(),Et(Ai)},Et=Ai=>{if(!(Ai.layerX===Ai.x||Ai.layerY===Ai.y))switch(ue){case"x":Ie.value&&(Ne.value=Ai.layerY);break;case"y":Ie.value&&(de.value=Ai.layerX);break;case"h":Ie.value&&(Ne.value=Ai.layerY);break;case"v":Ie.value&&(de.value=Ai.layerX);break}},ni=Ai=>{Ie.value=!0,ue=Ai},ri=Ai=>{ci(Ai)},ci=Ai=>{if(Ie.value){switch(Ie.value=!1,ue){case"x":const Ii=Math.round((Ai.layerY-re)/V.svg.scale-g.center_offset.y);if(Ii<=0){Ne.value=-999;return}le.value.push({type:"h",site:Ii});break;case"y":const ai=Math.round((Ai.layerX-re)/V.svg.scale-g.center_offset.x);if(ai<=0){de.value=-999;return}le.value.push({type:"v",site:ai});break;case"h":Ci(le.value,Math.round((Ai.layerY-re)/V.svg.scale-g.center_offset.y),Math.round(ze/V.svg.scale-g.center_offset.y),"h");break;case"v":Ci(le.value,Math.round((Ai.layerX-re)/V.svg.scale-g.center_offset.x),Math.round(he/V.svg.scale-g.center_offset.x),"v");break}Ne.value=de.value=-999}},Ci=(Ai,Ii,ai,pi)=>{if(Ii<ai){let Ni;Ue.value.forEach((di,fi)=>{di.id===pe&&(Ni=fi)}),Ai.splice(Ni,1)}else{let Ni;Ue.value.forEach((di,fi)=>{di.id===pe&&(Ni=fi)}),Ai.splice(Ni,1,{type:pi,site:Ii})}},li=()=>{ni("x")},ui=()=>{ni("y")},yi=Ai=>{Ie.value=!0,ue="h",pe=Ai},Mi=Ai=>{Ie.value=!0,ue="v",pe=Ai},zi=()=>{n("onLineMouseUp")};return(Ai,Ii)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(vue.unref($e)),class:"vue-ruler-wrapper",onselectStart:"return false;",ref_key:"el",ref:Oe},[vue.withDirectives(vue.createElementVNode("section",null,[vue.createElementVNode("div",{ref_key:"horizontalRuler",ref:At,class:"vue-ruler-h",onMousedown:vue.withModifiers(li,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ie),(ai,pi)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({left:pi*Ai.stepLength+"px"}),class:"n"},vue.toDisplayString(ai.id),5))),256))],40,_hoisted_1$2),vue.createElementVNode("div",{ref_key:"verticalRuler",ref:_e,class:"vue-ruler-v",onMousedown:vue.withModifiers(ui,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(ae),(ai,pi)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({top:pi*Ai.stepLength+"px"}),class:"n"},vue.toDisplayString(ai.id),5))),256))],40,_hoisted_2$1),vue.createElementVNode("div",{style:vue.normalizeStyle({top:vue.unref(Ne)+"px"}),class:"vue-ruler-ref-dot-h"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(Ne)-vue.unref(ze))/vue.unref(V).svg.scale)),1)],4),vue.createElementVNode("div",{style:vue.normalizeStyle({left:vue.unref(de)+"px"}),class:"vue-ruler-ref-dot-v"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(de)-vue.unref(he))/vue.unref(V).svg.scale)),1)],4),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(Ue),ai=>(vue.openBlock(),vue.createElementBlock("div",{title:ai.title,style:vue.normalizeStyle(qe(ai)),key:ai.id,class:vue.normalizeClass(`vue-ruler-ref-line-${ai.type}`),onMousedown:pi=>kt(ai),onMouseup:zi,onContextmenu:Ii[0]||(Ii[0]=(...pi)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...pi))},null,46,_hoisted_3$1))),128))],512),[[vue.vShow,r.visible]]),vue.createElementVNode("div",{ref_key:"content",ref:Ve,class:"vue-ruler-content",style:vue.normalizeStyle(vue.unref(Fe))},[vue.renderSlot(Ai.$slots,"default")],4),vue.withDirectives(vue.createElementVNode("div",_hoisted_4$1,null,512),[[vue.vShow,vue.unref(Ie)]])],4))}}),vue3RulerTool_vue_vue_type_style_index_0_lang="";function fileWrite(i,n=new Date(Date.now()).toLocaleString()){const r=JSON.stringify(i),g=new Blob([r]);let V=document.createElement("a");V.download=n+".json",V.style.display="none",V.href=URL.createObjectURL(g),document.body.appendChild(V),V.click(),document.body.removeChild(V)}function fileRead(i){return new Promise((n,r)=>{let g=new FileReader;g.readAsText(i,"UTF-8"),g.onload=function(V){V&&V.target?n(V.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;setEditorLoadTime();const V=useGlobalStore(pinia),k=useSvgEditLayoutStore(pinia),$=useConfigStore(pinia),re=useEditPrivateStore(pinia),oe=vue.ref(),Ce=vue.ref(),ie=vue.reactive({[EVisibleConfKey.ExportJson]:!1,[EVisibleConfKey.ImportJson]:!1,[EVisibleConfKey.ImportFile]:!1}),ae=(pe,Ve)=>{ie[pe]=Ve},le=vue.ref();le.value=()=>{Ce.value.onImportJson(),ae(EVisibleConfKey.ImportJson,!1)};const Ie=pe=>["text/plain","application/json"].indexOf(pe.type)<0?(ElMessage.error("仅支持的格式:txt、json"),!1):(fileRead(pe).then(Ve=>{Ce.value.setVal(Ve),ElMessage.success("文件读取成功!")}),!1),ue=pe=>{V.setDoneJson(pe)};vue.onMounted(()=>{re.history_doneComponent=[],re.history_now_index=0,g.data?useImportDataModel(g.data):V.setDoneJson([]),V.intention=EGlobalStoreIntention.None});const{appContext:de}=vue.getCurrentInstance();function Ne(pe){r("onReturn",{data:pe,isChange:re.getTopBtnUndoStatus})}function he(pe){g.saveFile?ElMessageBox.prompt("请输入文件名","保存",{cancelButtonText:"取消",confirmButtonText:"保存"},de).then(Ve=>{fileWrite(pe,Ve.value.trim()),r("onSave",pe)}).catch(Ve=>{console.log(Ve)}):r("onSave",pe)}function ze(){oe.value.onCanvasMouseUp()}return n({setGraphNodeJson:ue}),(pe,Ve)=>(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:Ne,onOnPreview:Ve[0]||(Ve[0]=Oe=>r("onPreview",Oe)),onOnSave:he})]),_:1}),vue.createVNode(vue.unref(ElContainer),{class:"middle"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(k).left_nav?"show-nav":"hide-nav"]),style:{"border-right":"1px solid #efefef"}},{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(_sfc_main$2,{class:"canvas-main-pc",visible:vue.unref($).svg.ruler,onOnLineMouseUp:ze},{default:vue.withCtx(()=>[vue.createVNode(CenterPanel,{ref_key:"centerRef",ref:oe},null,512)]),_:1},8,["visible"])])]),_:1}),vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(k).right_nav?"show-nav":"hide-nav"]),style:{"border-left":"1px solid #efefef"}},{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:vue.unref(ie).ImportJson,"onUpdate:modelValue":Ve[2]||(Ve[2]=Oe=>vue.unref(ie).ImportJson=Oe),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:Ve[1]||(Ve[1]=Oe=>ae(vue.unref(EVisibleConfKey).ImportFile,!0))},{default:vue.withCtx(()=>[vue.createTextVNode("读取文件")]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{type:"primary",onClick:vue.unref(le)},{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:vue.unref(ie).ExportJson,"onUpdate:modelValue":Ve[3]||(Ve[3]=Oe=>vue.unref(ie).ExportJson=Oe),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_01ceb0c4_lang="",index=_export_sfc(_sfc_main$1,[["__scopeId","data-v-01ceb0c4"]]);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,V,k){function $(Ce,ie){if(!V[Ce]){if(!g[Ce]){var ae=typeof commonjsRequire=="function"&&commonjsRequire;if(!ie&&ae)return ae(Ce,!0);if(re)return re(Ce,!0);var le=new Error("Cannot find module '"+Ce+"'");throw le.code="MODULE_NOT_FOUND",le}var Ie=V[Ce]={exports:{}};g[Ce][0].call(Ie.exports,function(ue){var de=g[Ce][1][ue];return $(de||ue)},Ie,Ie.exports,r,g,V,k)}return V[Ce].exports}for(var re=typeof commonjsRequire=="function"&&commonjsRequire,oe=0;oe<k.length;oe++)$(k[oe]);return $}return r}()({1:[function(r,g,V){(function(k,$){(function(){const re=r("events").EventEmitter,oe=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"),ze=r("xtend"),pe=r("debug")("mqttjs:client"),Ve=k?k.nextTick:function(ei){setTimeout(ei,0)},Oe=$.setImmediate||function(ei){Ve(ei)},_e={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0},At=["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 Fe(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function Ue(ei,Et){if(ei.options.protocolVersion===5&&Et.cmd==="publish"){let ni;Et.properties&&(ni=Et.properties.topicAlias);const ri=Et.topic.toString();if(ei.topicAliasSend)if(ni){if(ri.length!==0&&(pe("applyTopicAlias :: register topic: %s - alias: %d",ri,ni),!ei.topicAliasSend.put(ri,ni)))return pe("applyTopicAlias :: error out of range. topic: %s - alias: %d",ri,ni),new Error("Sending Topic Alias out of range")}else ri.length!==0&&(ei.options.autoAssignTopicAlias?(ni=ei.topicAliasSend.getAliasByTopic(ri),ni?(Et.topic="",Et.properties={...Et.properties,topicAlias:ni},pe("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",ri,ni)):(ni=ei.topicAliasSend.getLruAlias(),ei.topicAliasSend.put(ri,ni),Et.properties={...Et.properties,topicAlias:ni},pe("applyTopicAlias :: auto assign topic: %s - alias: %d",ri,ni))):ei.options.autoUseTopicAlias&&(ni=ei.topicAliasSend.getAliasByTopic(ri),ni&&(Et.topic="",Et.properties={...Et.properties,topicAlias:ni},pe("applyTopicAlias :: auto use topic: %s - alias: %d",ri,ni))));else if(ni)return pe("applyTopicAlias :: error out of range. topic: %s - alias: %d",ri,ni),new Error("Sending Topic Alias out of range")}}function xe(ei,Et){let ni;Et.properties&&(ni=Et.properties.topicAlias);let ri=Et.topic.toString();if(ri.length===0){if(typeof ni>"u")return new Error("Unregistered Topic Alias");if(ri=ei.topicAliasSend.getTopicByAlias(ni),typeof ri>"u")return new Error("Unregistered Topic Alias");Et.topic=ri}ni&&delete Et.properties.topicAlias}function Dt(ei,Et,ni){pe("sendPacket :: packet: %O",Et),pe("sendPacket :: emitting `packetsend`"),ei.emit("packetsend",Et),pe("sendPacket :: writing to stream");const ri=ae.writeToStream(Et,ei.stream,ei.options);pe("sendPacket :: writeToStream result %s",ri),!ri&&ni&&ni!==Pt?(pe("sendPacket :: handle events on `drain` once through callback."),ei.stream.once("drain",ni)):ni&&(pe("sendPacket :: invoking cb"),ni())}function qe(ei){ei&&(pe("flush: queue exists? %b",!!ei),Object.keys(ei).forEach(function(Et){typeof ei[Et].cb=="function"&&(ei[Et].cb(new Error("Connection closed")),delete ei[Et])}))}function kt(ei){ei&&(pe("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(ei).forEach(function(Et){ei[Et].volatile&&typeof ei[Et].cb=="function"&&(ei[Et].cb(new Error("Connection closed")),delete ei[Et])}))}function jt(ei,Et,ni,ri){pe("storeAndSend :: store packet with cmd %s to outgoingStore",Et.cmd);let ci=Et,Ci;if(ci.cmd==="publish"&&(ci=Ne(Et),Ci=xe(ei,ci),Ci))return ni&&ni(Ci);ei.outgoingStore.put(ci,function(ui){if(ui)return ni&&ni(ui);ri(),Dt(ei,Et,ni)})}function Pt(ei){pe("nop ::",ei)}function ti(ei,Et){let ni;const ri=this;if(!(this instanceof ti))return new ti(ei,Et);this.options=Et||{};for(ni in _e)typeof this.options[ni]>"u"?this.options[ni]=_e[ni]:this.options[ni]=Et[ni];pe("MqttClient :: options.protocol",Et.protocol),pe("MqttClient :: options.protocolVersion",Et.protocolVersion),pe("MqttClient :: options.username",Et.username),pe("MqttClient :: options.keepalive",Et.keepalive),pe("MqttClient :: options.reconnectPeriod",Et.reconnectPeriod),pe("MqttClient :: options.rejectUnauthorized",Et.rejectUnauthorized),pe("MqttClient :: options.topicAliasMaximum",Et.topicAliasMaximum),this.options.clientId=typeof Et.clientId=="string"?Et.clientId:Fe(),pe("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=Et.protocolVersion===5&&Et.customHandleAcks?Et.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=ei,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new le:this.options.messageIdProvider,this.outgoingStore=Et.outgoingStore||new oe,this.incomingStore=Et.incomingStore||new oe,this.queueQoSZero=Et.queueQoSZero===void 0?!0:Et.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,Et.topicAliasMaximum>0&&(Et.topicAliasMaximum>65535?pe("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new Ce(Et.topicAliasMaximum)),this.on("connect",function(){const ci=this.queue;function Ci(){const li=ci.shift();pe("deliver :: entry %o",li);let ui=null;if(!li){ri._resubscribe();return}ui=li.packet,pe("deliver :: call _sendPacket for %o",ui);let yi=!0;ui.messageId&&ui.messageId!==0&&(ri.messageIdProvider.register(ui.messageId)||(yi=!1)),yi?ri._sendPacket(ui,function(Mi){li.cb&&li.cb(Mi),Ci()}):(pe("messageId: %d has already used. The message is skipped and removed.",ui.messageId),Ci())}pe("connect :: sending queued packets"),Ci()}),this.on("close",function(){pe("close :: connected set to `false`"),this.connected=!1,pe("close :: clearing connackTimer"),clearTimeout(this.connackTimer),pe("close :: clearing ping timer"),ri.pingTimer!==null&&(ri.pingTimer.clear(),ri.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),pe("close :: calling _setupReconnect"),this._setupReconnect()}),re.call(this),pe("MqttClient :: setting up stream"),this._setupStream()}ue(ti,re),ti.prototype._setupStream=function(){const ei=this,Et=new Ie,ni=ae.parser(this.options);let ri=null;const ci=[];pe("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),pe("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),ni.on("packet",function(Mi){pe("parser :: on packet push to packets array."),ci.push(Mi)});function Ci(){if(ci.length)Ve(li);else{const Mi=ri;ri=null,Mi()}}function li(){pe("work :: getting next packet in queue");const Mi=ci.shift();if(Mi)pe("work :: packet pulled from queue"),ei._handlePacket(Mi,Ci);else{pe("work :: no packets in queue");const zi=ri;ri=null,pe("work :: done flag is %s",!!zi),zi&&zi()}}Et._write=function(Mi,zi,Ai){ri=Ai,pe("writable stream :: parsing buffer"),ni.parse(Mi),li()};function ui(Mi){pe("streamErrorHandler :: error",Mi.message),At.includes(Mi.code)?(pe("streamErrorHandler :: emitting error"),ei.emit("error",Mi)):Pt(Mi)}pe("_setupStream :: pipe stream to writable stream"),this.stream.pipe(Et),this.stream.on("error",ui),this.stream.on("close",function(){pe("(%s)stream :: on close",ei.options.clientId),kt(ei.outgoing),pe("stream: emit close to MqttClient"),ei.emit("close")}),pe("_setupStream: sending packet `connect`");const yi=Object.create(this.options);if(yi.cmd="connect",this.topicAliasRecv&&(yi.properties||(yi.properties={}),this.topicAliasRecv&&(yi.properties.topicAliasMaximum=this.topicAliasRecv.max)),Dt(this,yi),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 Mi=ze({cmd:"auth",reasonCode:0},this.options.authPacket);Dt(this,Mi)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){pe("!!connectTimeout hit!! Calling _cleanUp with force `true`"),ei._cleanUp(!0)},this.options.connectTimeout)},ti.prototype._handlePacket=function(ei,Et){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(pe("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",ei),ei.cmd){case"publish":this._handlePublish(ei,Et);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(ei),Et();break;case"pubrel":this._handlePubrel(ei,Et);break;case"connack":this._handleConnack(ei),Et();break;case"auth":this._handleAuth(ei),Et();break;case"pingresp":this._handlePingresp(ei),Et();break;case"disconnect":this._handleDisconnect(ei),Et();break}},ti.prototype._checkDisconnecting=function(ei){return this.disconnecting&&(ei&&ei!==Pt?ei(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},ti.prototype.publish=function(ei,Et,ni,ri){pe("publish :: message `%s` to topic `%s`",Et,ei);const ci=this.options;if(typeof ni=="function"&&(ri=ni,ni=null),ni=ze({qos:0,retain:!1,dup:!1},ni),this._checkDisconnecting(ri))return this;const li=this,ui=function(){let yi=0;if((ni.qos===1||ni.qos===2)&&(yi=li._nextId(),yi===null))return pe("No messageId left"),!1;const Mi={cmd:"publish",topic:ei,payload:Et,qos:ni.qos,retain:ni.retain,messageId:yi,dup:ni.dup};switch(ci.protocolVersion===5&&(Mi.properties=ni.properties),pe("publish :: qos",ni.qos),ni.qos){case 1:case 2:li.outgoing[Mi.messageId]={volatile:!1,cb:ri||Pt},pe("MqttClient:publish: packet cmd: %s",Mi.cmd),li._sendPacket(Mi,void 0,ni.cbStorePut);break;default:pe("MqttClient:publish: packet cmd: %s",Mi.cmd),li._sendPacket(Mi,ri,ni.cbStorePut);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ui())&&this._storeProcessingQueue.push({invoke:ui,cbStorePut:ni.cbStorePut,callback:ri}),this},ti.prototype.subscribe=function(){const ei=this,Et=new Array(arguments.length);for(let Ai=0;Ai<arguments.length;Ai++)Et[Ai]=arguments[Ai];const ni=[];let ri=Et.shift();const ci=ri.resubscribe;let Ci=Et.pop()||Pt,li=Et.pop();const ui=this.options.protocolVersion;delete ri.resubscribe,typeof ri=="string"&&(ri=[ri]),typeof Ci!="function"&&(li=Ci,Ci=Pt);const yi=he.validateTopics(ri);if(yi!==null)return Oe(Ci,new Error("Invalid topic "+yi)),this;if(this._checkDisconnecting(Ci))return pe("subscribe: discconecting true"),this;const Mi={qos:0};if(ui===5&&(Mi.nl=!1,Mi.rap=!1,Mi.rh=0),li=ze(Mi,li),Array.isArray(ri)?ri.forEach(function(Ai){if(pe("subscribe: array topic %s",Ai),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,Ai)||ei._resubscribeTopics[Ai].qos<li.qos||ci){const Ii={topic:Ai,qos:li.qos};ui===5&&(Ii.nl=li.nl,Ii.rap=li.rap,Ii.rh=li.rh,Ii.properties=li.properties),pe("subscribe: pushing topic `%s` and qos `%s` to subs list",Ii.topic,Ii.qos),ni.push(Ii)}}):Object.keys(ri).forEach(function(Ai){if(pe("subscribe: object topic %s",Ai),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,Ai)||ei._resubscribeTopics[Ai].qos<ri[Ai].qos||ci){const Ii={topic:Ai,qos:ri[Ai].qos};ui===5&&(Ii.nl=ri[Ai].nl,Ii.rap=ri[Ai].rap,Ii.rh=ri[Ai].rh,Ii.properties=li.properties),pe("subscribe: pushing `%s` to subs list",Ii),ni.push(Ii)}}),!ni.length)return Ci(null,[]),this;const zi=function(){const Ai=ei._nextId();if(Ai===null)return pe("No messageId left"),!1;const Ii={cmd:"subscribe",subscriptions:ni,qos:1,retain:!1,dup:!1,messageId:Ai};if(li.properties&&(Ii.properties=li.properties),ei.options.resubscribe){pe("subscribe :: resubscribe true");const ai=[];ni.forEach(function(pi){if(ei.options.reconnectPeriod>0){const Ni={qos:pi.qos};ui===5&&(Ni.nl=pi.nl||!1,Ni.rap=pi.rap||!1,Ni.rh=pi.rh||0,Ni.properties=pi.properties),ei._resubscribeTopics[pi.topic]=Ni,ai.push(pi.topic)}}),ei.messageIdToTopic[Ii.messageId]=ai}return ei.outgoing[Ii.messageId]={volatile:!0,cb:function(ai,pi){if(!ai){const Ni=pi.granted;for(let di=0;di<Ni.length;di+=1)ni[di].qos=Ni[di]}Ci(ai,ni)}},pe("subscribe :: call _sendPacket"),ei._sendPacket(Ii),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!zi())&&this._storeProcessingQueue.push({invoke:zi,callback:Ci}),this},ti.prototype.unsubscribe=function(){const ei=this,Et=new Array(arguments.length);for(let ui=0;ui<arguments.length;ui++)Et[ui]=arguments[ui];let ni=Et.shift(),ri=Et.pop()||Pt,ci=Et.pop();typeof ni=="string"&&(ni=[ni]),typeof ri!="function"&&(ci=ri,ri=Pt);const Ci=he.validateTopics(ni);if(Ci!==null)return Oe(ri,new Error("Invalid topic "+Ci)),this;if(ei._checkDisconnecting(ri))return this;const li=function(){const ui=ei._nextId();if(ui===null)return pe("No messageId left"),!1;const yi={cmd:"unsubscribe",qos:1,messageId:ui};return typeof ni=="string"?yi.unsubscriptions=[ni]:Array.isArray(ni)&&(yi.unsubscriptions=ni),ei.options.resubscribe&&yi.unsubscriptions.forEach(function(Mi){delete ei._resubscribeTopics[Mi]}),typeof ci=="object"&&ci.properties&&(yi.properties=ci.properties),ei.outgoing[yi.messageId]={volatile:!0,cb:ri},pe("unsubscribe: call _sendPacket"),ei._sendPacket(yi),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!li())&&this._storeProcessingQueue.push({invoke:li,callback:ri}),this},ti.prototype.end=function(ei,Et,ni){const ri=this;pe("end :: (%s)",this.options.clientId),(ei==null||typeof ei!="boolean")&&(ni=Et||Pt,Et=ei,ei=!1,typeof Et!="object"&&(ni=Et,Et=null,typeof ni!="function"&&(ni=Pt))),typeof Et!="object"&&(ni=Et,Et=null),pe("end :: cb? %s",!!ni),ni=ni||Pt;function ci(){pe("end :: closeStores: closing incoming and outgoing stores"),ri.disconnected=!0,ri.incomingStore.close(function(li){ri.outgoingStore.close(function(ui){if(pe("end :: closeStores: emitting end"),ri.emit("end"),ni){const yi=li||ui;pe("end :: closeStores: invoking callback with args"),ni(yi)}})}),ri._deferredReconnect&&ri._deferredReconnect()}function Ci(){pe("end :: (%s) :: finish :: calling _cleanUp with force %s",ri.options.clientId,ei),ri._cleanUp(ei,()=>{pe("end :: finish :: calling process.nextTick on closeStores"),Ve(ci.bind(ri))},Et)}return this.disconnecting?(ni(),this):(this._clearReconnect(),this.disconnecting=!0,!ei&&Object.keys(this.outgoing).length>0?(pe("end :: (%s) :: calling finish in 10ms once outgoing is empty",ri.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,Ci,10))):(pe("end :: (%s) :: immediately calling finish",ri.options.clientId),Ci()),this)},ti.prototype.removeOutgoingMessage=function(ei){const Et=this.outgoing[ei]?this.outgoing[ei].cb:null;return delete this.outgoing[ei],this.outgoingStore.del({messageId:ei},function(){Et(new Error("Message removed"))}),this},ti.prototype.reconnect=function(ei){pe("client reconnect");const Et=this,ni=function(){ei?(Et.options.incomingStore=ei.incomingStore,Et.options.outgoingStore=ei.outgoingStore):(Et.options.incomingStore=null,Et.options.outgoingStore=null),Et.incomingStore=Et.options.incomingStore||new oe,Et.outgoingStore=Et.options.outgoingStore||new oe,Et.disconnecting=!1,Et.disconnected=!1,Et._deferredReconnect=null,Et._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=ni:ni(),this},ti.prototype._reconnect=function(){pe("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),pe("client already connected. disconnecting first.")):(pe("_reconnect: calling _setupStream"),this._setupStream())},ti.prototype._setupReconnect=function(){const ei=this;!ei.disconnecting&&!ei.reconnectTimer&&ei.options.reconnectPeriod>0?(this.reconnecting||(pe("_setupReconnect :: emit `offline` state"),this.emit("offline"),pe("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),pe("_setupReconnect :: setting reconnectTimer for %d ms",ei.options.reconnectPeriod),ei.reconnectTimer=setInterval(function(){pe("reconnectTimer :: reconnect triggered!"),ei._reconnect()},ei.options.reconnectPeriod)):pe("_setupReconnect :: doing nothing...")},ti.prototype._clearReconnect=function(){pe("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},ti.prototype._cleanUp=function(ei,Et){const ni=arguments[2];if(Et&&(pe("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",Et)),pe("_cleanUp :: forced? %s",ei),ei)this.options.reconnectPeriod===0&&this.options.clean&&qe(this.outgoing),pe("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const ri=ze({cmd:"disconnect"},ni);pe("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(ri,Oe.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(pe("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(pe("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),Et&&!this.connected&&(pe("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",Et),Et())},ti.prototype._sendPacket=function(ei,Et,ni){pe("_sendPacket :: (%s) :: start",this.options.clientId),ni=ni||Pt,Et=Et||Pt;const ri=Ue(this,ei);if(ri){Et(ri);return}if(!this.connected){if(ei.cmd==="auth"){this._shiftPingInterval(),Dt(this,ei,Et);return}pe("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(ei,Et,ni);return}switch(this._shiftPingInterval(),ei.cmd){case"publish":break;case"pubrel":jt(this,ei,Et,ni);return;default:Dt(this,ei,Et);return}switch(ei.qos){case 2:case 1:jt(this,ei,Et,ni);break;case 0:default:Dt(this,ei,Et);break}pe("_sendPacket :: (%s) :: end",this.options.clientId)},ti.prototype._storePacket=function(ei,Et,ni){pe("_storePacket :: packet: %o",ei),pe("_storePacket :: cb? %s",!!Et),ni=ni||Pt;let ri=ei;if(ri.cmd==="publish"){ri=Ne(ei);const ci=xe(this,ri);if(ci)return Et&&Et(ci)}(ri.qos||0)===0&&this.queueQoSZero||ri.cmd!=="publish"?this.queue.push({packet:ri,cb:Et}):ri.qos>0?(Et=this.outgoing[ri.messageId]?this.outgoing[ri.messageId].cb:null,this.outgoingStore.put(ri,function(ci){if(ci)return Et&&Et(ci);ni()})):Et&&Et(new Error("No connection to broker"))},ti.prototype._setupPingTimer=function(){pe("_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(){pe("_checkPing :: checking ping..."),this.pingResp?(pe("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(pe("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},ti.prototype._handlePingresp=function(){this.pingResp=!0},ti.prototype._handleConnack=function(ei){pe("_handleConnack");const Et=this.options,ri=Et.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&&Et.keepalive&&(Et.keepalive=ei.properties.serverKeepAlive,this._shiftPingInterval()),ei.properties.maximumPacketSize&&(Et.properties||(Et.properties={}),Et.properties.maximumPacketSize=ei.properties.maximumPacketSize)}if(ri===0)this.reconnecting=!1,this._onConnect(ei);else if(ri>0){const ci=new Error("Connection refused: "+$e[ri]);ci.code=ri,this.emit("error",ci)}},ti.prototype._handleAuth=function(ei){const ni=this.options.protocolVersion,ri=ni===5?ei.reasonCode:ei.returnCode;if(ni!==5){const Ci=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+ni);Ci.code=ri,this.emit("error",Ci);return}const ci=this;this.handleAuth(ei,function(Ci,li){if(Ci){ci.emit("error",Ci);return}if(ri===24)ci.reconnecting=!1,ci._sendPacket(li);else{const ui=new Error("Connection refused: "+$e[ri]);Ci.code=ri,ci.emit("error",ui)}})},ti.prototype.handleAuth=function(ei,Et){Et()},ti.prototype._handlePublish=function(ei,Et){pe("_handlePublish: packet %o",ei),Et=typeof Et<"u"?Et:Pt;let ni=ei.topic.toString();const ri=ei.payload,ci=ei.qos,Ci=ei.messageId,li=this,ui=this.options,yi=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){let Mi;if(ei.properties&&(Mi=ei.properties.topicAlias),typeof Mi<"u")if(ni.length===0)if(Mi>0&&Mi<=65535){const zi=this.topicAliasRecv.getTopicByAlias(Mi);if(zi)ni=zi,pe("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",ni,Mi);else{pe("_handlePublish :: unregistered topic alias. alias: %d",Mi),this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{pe("_handlePublish :: topic alias out of range. alias: %d",Mi),this.emit("error",new Error("Received Topic Alias is out of range"));return}else if(this.topicAliasRecv.put(ni,Mi))pe("_handlePublish :: registered topic: %s - alias: %d",ni,Mi);else{pe("_handlePublish :: topic alias out of range. alias: %d",Mi),this.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(pe("_handlePublish: qos %d",ci),ci){case 2:{ui.customHandleAcks(ni,ri,ei,function(Mi,zi){if(Mi instanceof Error||(zi=Mi,Mi=null),Mi)return li.emit("error",Mi);if(yi.indexOf(zi)===-1)return li.emit("error",new Error("Wrong reason code for pubrec"));zi?li._sendPacket({cmd:"pubrec",messageId:Ci,reasonCode:zi},Et):li.incomingStore.put(ei,function(){li._sendPacket({cmd:"pubrec",messageId:Ci},Et)})});break}case 1:{ui.customHandleAcks(ni,ri,ei,function(Mi,zi){if(Mi instanceof Error||(zi=Mi,Mi=null),Mi)return li.emit("error",Mi);if(yi.indexOf(zi)===-1)return li.emit("error",new Error("Wrong reason code for puback"));zi||li.emit("message",ni,ri,ei),li.handleMessage(ei,function(Ai){if(Ai)return Et&&Et(Ai);li._sendPacket({cmd:"puback",messageId:Ci,reasonCode:zi},Et)})});break}case 0:this.emit("message",ni,ri,ei),this.handleMessage(ei,Et);break;default:pe("_handlePublish: unknown QoS. Doing nothing.");break}},ti.prototype.handleMessage=function(ei,Et){Et()},ti.prototype._handleAck=function(ei){const Et=ei.messageId,ni=ei.cmd;let ri=null;const ci=this.outgoing[Et]?this.outgoing[Et].cb:null,Ci=this;let li;if(!ci){pe("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(pe("_handleAck :: packet type",ni),ni){case"pubcomp":case"puback":{const ui=ei.reasonCode;ui&&ui>0&&ui!==16&&(li=new Error("Publish error: "+$e[ui]),li.code=ui,ci(li,ei)),delete this.outgoing[Et],this.outgoingStore.del(ei,ci),this.messageIdProvider.deallocate(Et),this._invokeStoreProcessingQueue();break}case"pubrec":{ri={cmd:"pubrel",qos:2,messageId:Et};const ui=ei.reasonCode;ui&&ui>0&&ui!==16?(li=new Error("Publish error: "+$e[ui]),li.code=ui,ci(li,ei)):this._sendPacket(ri);break}case"suback":{delete this.outgoing[Et],this.messageIdProvider.deallocate(Et);for(let ui=0;ui<ei.granted.length;ui++)if(ei.granted[ui]&128){const yi=this.messageIdToTopic[Et];yi&&yi.forEach(function(Mi){delete Ci._resubscribeTopics[Mi]})}this._invokeStoreProcessingQueue(),ci(null,ei);break}case"unsuback":{delete this.outgoing[Et],this.messageIdProvider.deallocate(Et),this._invokeStoreProcessingQueue(),ci(null);break}default:Ci.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&Object.keys(this.outgoing).length===0&&this.emit("outgoingEmpty")},ti.prototype._handlePubrel=function(ei,Et){pe("handling pubrel packet"),Et=typeof Et<"u"?Et:Pt;const ni=ei.messageId,ri=this,ci={cmd:"pubcomp",messageId:ni};ri.incomingStore.get(ei,function(Ci,li){Ci?ri._sendPacket(ci,Et):(ri.emit("message",li.topic,li.payload,li),ri.handleMessage(li,function(ui){if(ui)return Et(ui);ri.incomingStore.del(li,Pt),ri._sendPacket(ci,Et)}))})},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(){pe("_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){pe("_resubscribe: protocolVersion 5");for(let Et=0;Et<ei.length;Et++){const ni={};ni[ei[Et]]=this._resubscribeTopics[ei[Et]],ni.resubscribe=!0,this.subscribe(ni,{properties:ni[ei[Et]].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 Et=this;this.connackPacket=ei,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;function ni(){let ri=Et.outgoingStore.createStream();function ci(){Et._storeProcessing=!1,Et._packetIdsDuringStoreProcessing={}}Et.once("close",Ci),ri.on("error",function(ui){ci(),Et._flushStoreProcessingQueue(),Et.removeListener("close",Ci),Et.emit("error",ui)});function Ci(){ri.destroy(),ri=null,Et._flushStoreProcessingQueue(),ci()}function li(){if(!ri)return;Et._storeProcessing=!0;const ui=ri.read(1);let yi;if(!ui){ri.once("readable",li);return}if(Et._packetIdsDuringStoreProcessing[ui.messageId]){li();return}!Et.disconnecting&&!Et.reconnectTimer?(yi=Et.outgoing[ui.messageId]?Et.outgoing[ui.messageId].cb:null,Et.outgoing[ui.messageId]={volatile:!1,cb:function(Mi,zi){yi&&yi(Mi,zi),li()}},Et._packetIdsDuringStoreProcessing[ui.messageId]=!0,Et.messageIdProvider.register(ui.messageId)?Et._sendPacket(ui):pe("messageId: %d has already used.",ui.messageId)):ri.destroy&&ri.destroy()}ri.on("end",function(){let ui=!0;for(const yi in Et._packetIdsDuringStoreProcessing)if(!Et._packetIdsDuringStoreProcessing[yi]){ui=!1;break}ui?(ci(),Et.removeListener("close",Ci),Et._invokeAllStoreProcessingQueue(),Et.emit("connect",ei)):ni()}),li()}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,V){const{Buffer:k}=r("buffer"),$=r("readable-stream").Transform,re=r("duplexify");let oe,Ce,ie,ae=!1;function le(){const he=new $;return he._write=function(ze,pe,Ve){oe.sendSocketMessage({data:ze.buffer,success:function(){Ve()},fail:function(){Ve(new Error)}})},he._flush=function(pe){oe.closeSocket({success:function(){pe()}})},he}function Ie(he){he.hostname||(he.hostname="localhost"),he.path||(he.path="/"),he.wsOptions||(he.wsOptions={})}function ue(he,ze){const pe=he.protocol==="alis"?"wss":"ws";let Ve=pe+"://"+he.hostname+he.path;return he.port&&he.port!==80&&he.port!==443&&(Ve=pe+"://"+he.hostname+":"+he.port+he.path),typeof he.transformWsUrl=="function"&&(Ve=he.transformWsUrl(Ve,he,ze)),Ve}function de(){ae||(ae=!0,oe.onSocketOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),oe.onSocketMessage(function(he){if(typeof he.data=="string"){const ze=k.from(he.data,"base64");Ce.push(ze)}else{const ze=new FileReader;ze.addEventListener("load",function(){let pe=ze.result;pe instanceof ArrayBuffer?pe=k.from(pe):pe=k.from(pe,"utf8"),Ce.push(pe)}),ze.readAsArrayBuffer(he.data)}}),oe.onSocketClose(function(){ie.end(),ie.destroy()}),oe.onSocketError(function(he){ie.destroy(he)}))}function Ne(he,ze){if(ze.hostname=ze.hostname||ze.host,!ze.hostname)throw new Error("Could not determine host. Specify host manually.");const pe=ze.protocolId==="MQIsdp"&&ze.protocolVersion===3?"mqttv3.1":"mqtt";Ie(ze);const Ve=ue(ze,he);return oe=ze.my,oe.connectSocket({url:Ve,protocols:pe}),Ce=le(),ie=re.obj(),de(),ie}g.exports=Ne},{buffer:17,duplexify:20,"readable-stream":69}],3:[function(r,g,V){const k=r("net"),$=r("debug")("mqttjs:tcp");function re(oe,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),k.createConnection(ie,ae)}g.exports=re},{debug:18,net:16}],4:[function(r,g,V){const k=r("tls"),$=r("net"),re=r("debug")("mqttjs:tls");function oe(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,re("port %d host %s rejectUnauthorized %b",ie.port,ie.host,ie.rejectUnauthorized);const ae=k.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=oe},{debug:18,net:16,tls:16}],5:[function(r,g,V){(function(k){(function(){const{Buffer:$}=r("buffer"),re=r("ws"),oe=r("debug")("mqttjs:ws"),Ce=r("duplexify"),ie=r("readable-stream").Transform,ae=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],le=typeof k<"u"&&k.title==="browser"||typeof __webpack_require__=="function";function Ie(Ve,Oe){let _e=Ve.protocol+"://"+Ve.hostname+":"+Ve.port+Ve.path;return typeof Ve.transformWsUrl=="function"&&(_e=Ve.transformWsUrl(_e,Ve,Oe)),_e}function ue(Ve){const Oe=Ve;return Ve.hostname||(Oe.hostname="localhost"),Ve.port||(Ve.protocol==="wss"?Oe.port=443:Oe.port=80),Ve.path||(Oe.path="/"),Ve.wsOptions||(Oe.wsOptions={}),!le&&Ve.protocol==="wss"&&ae.forEach(function(_e){Object.prototype.hasOwnProperty.call(Ve,_e)&&!Object.prototype.hasOwnProperty.call(Ve.wsOptions,_e)&&(Oe.wsOptions[_e]=Ve[_e])}),Oe}function de(Ve){const Oe=ue(Ve);if(Oe.hostname||(Oe.hostname=Oe.host),!Oe.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");const _e=new URL(document.URL);Oe.hostname=_e.hostname,Oe.port||(Oe.port=_e.port)}return Oe.objectMode===void 0&&(Oe.objectMode=!(Oe.binary===!0||Oe.binary===void 0)),Oe}function Ne(Ve,Oe,_e){oe("createWebSocket"),oe("protocol: "+_e.protocolId+" "+_e.protocolVersion);const At=_e.protocolId==="MQIsdp"&&_e.protocolVersion===3?"mqttv3.1":"mqtt";return oe("creating new Websocket for url: "+Oe+" and protocol: "+At),new re(Oe,[At],_e.wsOptions)}function he(Ve,Oe){const _e=Oe.protocolId==="MQIsdp"&&Oe.protocolVersion===3?"mqttv3.1":"mqtt",At=Ie(Oe,Ve),$e=new WebSocket(At,[_e]);return $e.binaryType="arraybuffer",$e}function ze(Ve,Oe){oe("streamBuilder");const _e=ue(Oe),At=Ie(_e,Ve),$e=Ne(Ve,At,_e),Fe=re.createWebSocketStream($e,_e.wsOptions);return Fe.url=At,$e.on("close",()=>{Fe.destroy()}),Fe}function pe(Ve,Oe){oe("browserStreamBuilder");let _e;const $e=de(Oe).browserBufferSize||1024*512,Fe=Oe.browserBufferTimeout||1e3,Ue=!Oe.objectMode,xe=he(Ve,Oe),Dt=kt(Oe,ni,ri);Oe.objectMode||(Dt._writev=Et),Dt.on("close",()=>{xe.close()});const qe=typeof xe.addEventListener<"u";xe.readyState===xe.OPEN?_e=Dt:(_e=_e=Ce(void 0,void 0,Oe),Oe.objectMode||(_e._writev=Et),qe?xe.addEventListener("open",jt):xe.onopen=jt),_e.socket=xe,qe?(xe.addEventListener("close",Pt),xe.addEventListener("error",ti),xe.addEventListener("message",ei)):(xe.onclose=Pt,xe.onerror=ti,xe.onmessage=ei);function kt(ci,Ci,li){const ui=new ie({objectModeMode:ci.objectMode});return ui._write=Ci,ui._flush=li,ui}function jt(){_e.setReadable(Dt),_e.setWritable(Dt),_e.emit("connect")}function Pt(){_e.end(),_e.destroy()}function ti(ci){_e.destroy(ci)}function ei(ci){let Ci=ci.data;Ci instanceof ArrayBuffer?Ci=$.from(Ci):Ci=$.from(Ci,"utf8"),Dt.push(Ci)}function Et(ci,Ci){const li=new Array(ci.length);for(let ui=0;ui<ci.length;ui++)typeof ci[ui].chunk=="string"?li[ui]=$.from(ci[ui],"utf8"):li[ui]=ci[ui].chunk;this._write($.concat(li),"binary",Ci)}function ni(ci,Ci,li){xe.bufferedAmount>$e&&setTimeout(ni,Fe,ci,Ci,li),Ue&&typeof ci=="string"&&(ci=$.from(ci,"utf8"));try{xe.send(ci)}catch(ui){return li(ui)}li()}function ri(ci){xe.close(),ci()}return _e}le?g.exports=pe:g.exports=ze}).call(this)}).call(this,r("_process"))},{_process:50,buffer:17,debug:18,duplexify:20,"readable-stream":69,ws:80}],6:[function(r,g,V){const{Buffer:k}=r("buffer"),$=r("readable-stream").Transform,re=r("duplexify");let oe,Ce,ie;function ae(){const Ne=new $;return Ne._write=function(he,ze,pe){oe.send({data:he.buffer,success:function(){pe()},fail:function(Ve){pe(new Error(Ve))}})},Ne._flush=function(ze){oe.close({success:function(){ze()}})},Ne}function le(Ne){Ne.hostname||(Ne.hostname="localhost"),Ne.path||(Ne.path="/"),Ne.wsOptions||(Ne.wsOptions={})}function Ie(Ne,he){const ze=Ne.protocol==="wxs"?"wss":"ws";let pe=ze+"://"+Ne.hostname+Ne.path;return Ne.port&&Ne.port!==80&&Ne.port!==443&&(pe=ze+"://"+Ne.hostname+":"+Ne.port+Ne.path),typeof Ne.transformWsUrl=="function"&&(pe=Ne.transformWsUrl(pe,Ne,he)),pe}function ue(){oe.onOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),oe.onMessage(function(Ne){let he=Ne.data;he instanceof ArrayBuffer?he=k.from(he):he=k.from(he,"utf8"),Ce.push(he)}),oe.onClose(function(){ie.end(),ie.destroy()}),oe.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 ze=he.protocolId==="MQIsdp"&&he.protocolVersion===3?"mqttv3.1":"mqtt";le(he);const pe=Ie(he,Ne);oe=wx.connectSocket({url:pe,protocols:[ze]}),Ce=ae(),ie=re.obj(),ie._destroy=function(Oe,_e){oe.close({success:function(){_e&&_e(Oe)}})};const Ve=ie.destroy;return ie.destroy=function(){ie.destroy=Ve;const Oe=this;setTimeout(function(){oe.close({fail:function(){Oe._destroy(new Error)}})},0)}.bind(ie),ue(),ie}g.exports=de},{buffer:17,duplexify:20,"readable-stream":69}],7:[function(r,g,V){function k(){if(!(this instanceof k))return new k;this.nextId=Math.max(1,Math.floor(Math.random()*65535))}k.prototype.allocate=function(){const $=this.nextId++;return this.nextId===65536&&(this.nextId=1),$},k.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1},k.prototype.register=function($){return!0},k.prototype.deallocate=function($){},k.prototype.clear=function(){},g.exports=k},{}],8:[function(r,g,V){const k=r("xtend"),$=r("readable-stream").Readable,re={objectMode:!0},oe={clean:!0};function Ce(ie){if(!(this instanceof Ce))return new Ce(ie);this.options=ie||{},this.options=k(oe,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 $(re),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,V){function k($){if(!(this instanceof k))return new k($);this.aliasToTopic={},this.max=$}k.prototype.put=function($,re){return re===0||re>this.max?!1:(this.aliasToTopic[re]=$,this.length=Object.keys(this.aliasToTopic).length,!0)},k.prototype.getTopicByAlias=function($){return this.aliasToTopic[$]},k.prototype.clear=function(){this.aliasToTopic={}},g.exports=k},{}],10:[function(r,g,V){const k=r("lru-cache"),$=r("number-allocator").NumberAllocator;function re(oe){if(!(this instanceof re))return new re(oe);oe>0&&(this.aliasToTopic=new k({max:oe}),this.topicToAlias={},this.numberAllocator=new $(1,oe),this.max=oe,this.length=0)}re.prototype.put=function(oe,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,oe),this.topicToAlias[oe]=Ce,this.numberAllocator.use(Ce),this.length=this.aliasToTopic.length,!0},re.prototype.getTopicByAlias=function(oe){return this.aliasToTopic.get(oe)},re.prototype.getAliasByTopic=function(oe){const Ce=this.topicToAlias[oe];return typeof Ce<"u"&&this.aliasToTopic.get(Ce),Ce},re.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},re.prototype.getLruAlias=function(){const oe=this.numberAllocator.firstVacant();return oe||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},g.exports=re},{"lru-cache":37,"number-allocator":46}],11:[function(r,g,V){function k(re){const oe=re.split("/");for(let Ce=0;Ce<oe.length;Ce++)if(oe[Ce]!=="+"){if(oe[Ce]==="#")return Ce===oe.length-1;if(oe[Ce].indexOf("+")!==-1||oe[Ce].indexOf("#")!==-1)return!1}return!0}function $(re){if(re.length===0)return"empty_topic_list";for(let oe=0;oe<re.length;oe++)if(!k(re[oe]))return re[oe];return null}g.exports={validateTopics:$}},{}],12:[function(r,g,V){(function(k){(function(){const $=r("../client"),re=r("../store"),oe=r("url"),Ce=r("xtend"),ie=r("debug")("mqttjs"),ae={};typeof k<"u"&&k.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 ze=oe.parse(ue,!0);if(ze.port!=null&&(ze.port=Number(ze.port)),de=Ce(ze,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 ze=["mqtts","wss"].indexOf(de.protocol)!==-1;de.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(pe,Ve){return ze&&Ve%2===0?!1:typeof ae[pe]=="function"})[0]}if(de.clean===!1&&!de.clientId)throw new Error("Missing clientId for unclean clients");de.protocol&&(de.defaultProtocol=de.protocol);function Ne(ze){return de.servers&&((!ze._reconnectCount||ze._reconnectCount===de.servers.length)&&(ze._reconnectCount=0),de.host=de.servers[ze._reconnectCount].host,de.port=de.servers[ze._reconnectCount].port,de.protocol=de.servers[ze._reconnectCount].protocol?de.servers[ze._reconnectCount].protocol:de.defaultProtocol,de.hostname=de.host,ze._reconnectCount++),ie("calling streambuilder for",de.protocol),ae[de.protocol](ze,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=re}).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,V){V.byteLength=le,V.toByteArray=ue,V.fromByteArray=he;for(var k=[],$=[],re=typeof Uint8Array<"u"?Uint8Array:Array,oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ce=0,ie=oe.length;Ce<ie;++Ce)k[Ce]=oe[Ce],$[oe.charCodeAt(Ce)]=Ce;$["-".charCodeAt(0)]=62,$["_".charCodeAt(0)]=63;function ae(ze){var pe=ze.length;if(pe%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var Ve=ze.indexOf("=");Ve===-1&&(Ve=pe);var Oe=Ve===pe?0:4-Ve%4;return[Ve,Oe]}function le(ze){var pe=ae(ze),Ve=pe[0],Oe=pe[1];return(Ve+Oe)*3/4-Oe}function Ie(ze,pe,Ve){return(pe+Ve)*3/4-Ve}function ue(ze){var pe,Ve=ae(ze),Oe=Ve[0],_e=Ve[1],At=new re(Ie(ze,Oe,_e)),$e=0,Fe=_e>0?Oe-4:Oe,Ue;for(Ue=0;Ue<Fe;Ue+=4)pe=$[ze.charCodeAt(Ue)]<<18|$[ze.charCodeAt(Ue+1)]<<12|$[ze.charCodeAt(Ue+2)]<<6|$[ze.charCodeAt(Ue+3)],At[$e++]=pe>>16&255,At[$e++]=pe>>8&255,At[$e++]=pe&255;return _e===2&&(pe=$[ze.charCodeAt(Ue)]<<2|$[ze.charCodeAt(Ue+1)]>>4,At[$e++]=pe&255),_e===1&&(pe=$[ze.charCodeAt(Ue)]<<10|$[ze.charCodeAt(Ue+1)]<<4|$[ze.charCodeAt(Ue+2)]>>2,At[$e++]=pe>>8&255,At[$e++]=pe&255),At}function de(ze){return k[ze>>18&63]+k[ze>>12&63]+k[ze>>6&63]+k[ze&63]}function Ne(ze,pe,Ve){for(var Oe,_e=[],At=pe;At<Ve;At+=3)Oe=(ze[At]<<16&16711680)+(ze[At+1]<<8&65280)+(ze[At+2]&255),_e.push(de(Oe));return _e.join("")}function he(ze){for(var pe,Ve=ze.length,Oe=Ve%3,_e=[],At=16383,$e=0,Fe=Ve-Oe;$e<Fe;$e+=At)_e.push(Ne(ze,$e,$e+At>Fe?Fe:$e+At));return Oe===1?(pe=ze[Ve-1],_e.push(k[pe>>2]+k[pe<<4&63]+"==")):Oe===2&&(pe=(ze[Ve-2]<<8)+ze[Ve-1],_e.push(k[pe>>10]+k[pe>>4&63]+k[pe<<2&63]+"=")),_e.join("")}},{}],14:[function(r,g,V){const{Buffer:k}=r("buffer"),$=Symbol.for("BufferList");function re(oe){if(!(this instanceof re))return new re(oe);re._init.call(this,oe)}re._init=function(Ce){Object.defineProperty(this,$,{value:!0}),this._bufs=[],this.length=0,Ce&&this.append(Ce)},re.prototype._new=function(Ce){return new re(Ce)},re.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}},re.prototype._reverseOffset=function(oe){const Ce=oe[0];let ie=oe[1];for(let ae=0;ae<Ce;ae++)ie+=this._bufs[ae].length;return ie},re.prototype.get=function(Ce){if(Ce>this.length||Ce<0)return;const ie=this._offset(Ce);return this._bufs[ie[0]][ie[1]]},re.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)},re.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||k.alloc(0);const Ie=!!Ce,ue=this._offset(ae),de=le-ae;let Ne=de,he=Ie&&ie||0,ze=ue[1];if(ae===0&&le===this.length){if(!Ie)return this._bufs.length===1?this._bufs[0]:k.concat(this._bufs,this.length);for(let pe=0;pe<this._bufs.length;pe++)this._bufs[pe].copy(Ce,he),he+=this._bufs[pe].length;return Ce}if(Ne<=this._bufs[ue[0]].length-ze)return Ie?this._bufs[ue[0]].copy(Ce,ie,ze,ze+Ne):this._bufs[ue[0]].slice(ze,ze+Ne);Ie||(Ce=k.allocUnsafe(de));for(let pe=ue[0];pe<this._bufs.length;pe++){const Ve=this._bufs[pe].length-ze;if(Ne>Ve)this._bufs[pe].copy(Ce,he,ze),he+=Ve;else{this._bufs[pe].copy(Ce,he,ze,ze+Ne),he+=Ve;break}Ne-=Ve,ze&&(ze=0)}return Ce.length>he?Ce.slice(0,he):Ce},re.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)},re.prototype.toString=function(Ce,ie,ae){return this.slice(ie,ae).toString(Ce)},re.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},re.prototype.duplicate=function(){const Ce=this._new();for(let ie=0;ie<this._bufs.length;ie++)Ce.append(this._bufs[ie]);return Ce},re.prototype.append=function(Ce){if(Ce==null)return this;if(Ce.buffer)this._appendBuffer(k.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(k.from(Ce));return this},re.prototype._appendBuffer=function(Ce){this._bufs.push(Ce),this.length+=Ce.length},re.prototype.indexOf=function(oe,Ce,ie){if(ie===void 0&&typeof Ce=="string"&&(ie=Ce,Ce=void 0),typeof oe=="function"||Array.isArray(oe))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof oe=="number"?oe=k.from([oe]):typeof oe=="string"?oe=k.from(oe,ie):this._isBufferList(oe)?oe=oe.slice():Array.isArray(oe.buffer)?oe=k.from(oe.buffer,oe.byteOffset,oe.byteLength):k.isBuffer(oe)||(oe=k.from(oe)),Ce=Number(Ce||0),isNaN(Ce)&&(Ce=0),Ce<0&&(Ce=this.length+Ce),Ce<0&&(Ce=0),oe.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>=oe.length){const Ne=ue.indexOf(oe,Ie);if(Ne!==-1)return this._reverseOffset([le,Ne]);Ie=ue.length-oe.length+1}else{const Ne=this._reverseOffset([le,Ie]);if(this._match(Ne,oe))return Ne;Ie++}Ie=0}return-1},re.prototype._match=function(oe,Ce){if(this.length-oe<Ce.length)return!1;for(let ie=0;ie<Ce.length;ie++)if(this.get(oe+ie)!==Ce[ie])return!1;return!0},function(){const oe={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 oe)(function(ie){oe[ie]===null?re.prototype[ie]=function(ae,le){return this.slice(ae,ae+le)[ie](0,le)}:re.prototype[ie]=function(ae=0){return this.slice(ae,ae+oe[ie])[ie](0)}})(Ce)}(),re.prototype._isBufferList=function(Ce){return Ce instanceof re||re.isBufferList(Ce)},re.isBufferList=function(Ce){return Ce!=null&&Ce[$]},g.exports=re},{buffer:17}],15:[function(r,g,V){const k=r("readable-stream").Duplex,$=r("inherits"),re=r("./BufferList");function oe(Ce){if(!(this instanceof oe))return new oe(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}re._init.call(this,Ce),k.call(this)}$(oe,k),Object.assign(oe.prototype,re.prototype),oe.prototype._new=function(ie){return new oe(ie)},oe.prototype._write=function(ie,ae,le){this._appendBuffer(ie),typeof le=="function"&&le()},oe.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)},oe.prototype.end=function(ie){k.prototype.end.call(this,ie),this._callback&&(this._callback(null,this.slice()),this._callback=null)},oe.prototype._destroy=function(ie,ae){this._bufs.length=0,this.length=0,ae(ie)},oe.prototype._isBufferList=function(ie){return ie instanceof oe||ie instanceof re||oe.isBufferList(ie)},oe.isBufferList=re.isBufferList,g.exports=oe,g.exports.BufferListStream=oe,g.exports.BufferList=re},{"./BufferList":14,inherits:24,"readable-stream":69}],16:[function(r,g,V){},{}],17:[function(r,g,V){(function(k){(function(){var $=r("base64-js"),re=r("ieee754");V.Buffer=ae,V.SlowBuffer=Oe,V.INSPECT_MAX_BYTES=50;var oe=2147483647;V.kMaxLength=oe,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>oe)throw new RangeError('The value "'+oi+'" is invalid for option "size"');var Lt=new Uint8Array(oi);return Lt.__proto__=ae.prototype,Lt}function ae(oi,Lt,ii){if(typeof oi=="number"){if(typeof Lt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return de(oi)}return le(oi,Lt,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,Lt,ii){if(typeof oi=="string")return Ne(oi,Lt);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 ze(oi,Lt,ii);if(typeof oi=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var gi=oi.valueOf&&oi.valueOf();if(gi!=null&&gi!==oi)return ae.from(gi,Lt,ii);var hi=pe(oi);if(hi)return hi;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof oi[Symbol.toPrimitive]=="function")return ae.from(oi[Symbol.toPrimitive]("string"),Lt,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,Lt,ii){return le(oi,Lt,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,Lt,ii){return Ie(oi),oi<=0?ie(oi):Lt!==void 0?typeof ii=="string"?ie(oi).fill(Lt,ii):ie(oi).fill(Lt):ie(oi)}ae.alloc=function(oi,Lt,ii){return ue(oi,Lt,ii)};function de(oi){return Ie(oi),ie(oi<0?0:Ve(oi)|0)}ae.allocUnsafe=function(oi){return de(oi)},ae.allocUnsafeSlow=function(oi){return de(oi)};function Ne(oi,Lt){if((typeof Lt!="string"||Lt==="")&&(Lt="utf8"),!ae.isEncoding(Lt))throw new TypeError("Unknown encoding: "+Lt);var ii=_e(oi,Lt)|0,gi=ie(ii),hi=gi.write(oi,Lt);return hi!==ii&&(gi=gi.slice(0,hi)),gi}function he(oi){for(var Lt=oi.length<0?0:Ve(oi.length)|0,ii=ie(Lt),gi=0;gi<Lt;gi+=1)ii[gi]=oi[gi]&255;return ii}function ze(oi,Lt,ii){if(Lt<0||oi.byteLength<Lt)throw new RangeError('"offset" is outside of buffer bounds');if(oi.byteLength<Lt+(ii||0))throw new RangeError('"length" is outside of buffer bounds');var gi;return Lt===void 0&&ii===void 0?gi=new Uint8Array(oi):ii===void 0?gi=new Uint8Array(oi,Lt):gi=new Uint8Array(oi,Lt,ii),gi.__proto__=ae.prototype,gi}function pe(oi){if(ae.isBuffer(oi)){var Lt=Ve(oi.length)|0,ii=ie(Lt);return ii.length===0||oi.copy(ii,0,0,Lt),ii}if(oi.length!==void 0)return typeof oi.length!="number"||wi(oi.length)?ie(0):he(oi);if(oi.type==="Buffer"&&Array.isArray(oi.data))return he(oi.data)}function Ve(oi){if(oi>=oe)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe.toString(16)+" bytes");return oi|0}function Oe(oi){return+oi!=oi&&(oi=0),ae.alloc(+oi)}ae.isBuffer=function(Lt){return Lt!=null&&Lt._isBuffer===!0&&Lt!==ae.prototype},ae.compare=function(Lt,ii){if(si(Lt,Uint8Array)&&(Lt=ae.from(Lt,Lt.offset,Lt.byteLength)),si(ii,Uint8Array)&&(ii=ae.from(ii,ii.offset,ii.byteLength)),!ae.isBuffer(Lt)||!ae.isBuffer(ii))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Lt===ii)return 0;for(var gi=Lt.length,hi=ii.length,mi=0,Si=Math.min(gi,hi);mi<Si;++mi)if(Lt[mi]!==ii[mi]){gi=Lt[mi],hi=ii[mi];break}return gi<hi?-1:hi<gi?1:0},ae.isEncoding=function(Lt){switch(String(Lt).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(Lt,ii){if(!Array.isArray(Lt))throw new TypeError('"list" argument must be an Array of Buffers');if(Lt.length===0)return ae.alloc(0);var gi;if(ii===void 0)for(ii=0,gi=0;gi<Lt.length;++gi)ii+=Lt[gi].length;var hi=ae.allocUnsafe(ii),mi=0;for(gi=0;gi<Lt.length;++gi){var Si=Lt[gi];if(si(Si,Uint8Array)&&(Si=ae.from(Si)),!ae.isBuffer(Si))throw new TypeError('"list" argument must be an Array of Buffers');Si.copy(hi,mi),mi+=Si.length}return hi};function _e(oi,Lt){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,gi=arguments.length>2&&arguments[2]===!0;if(!gi&&ii===0)return 0;for(var hi=!1;;)switch(Lt){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 vi(oi).length;default:if(hi)return gi?-1:Ni(oi).length;Lt=(""+Lt).toLowerCase(),hi=!0}}ae.byteLength=_e;function At(oi,Lt,ii){var gi=!1;if((Lt===void 0||Lt<0)&&(Lt=0),Lt>this.length||((ii===void 0||ii>this.length)&&(ii=this.length),ii<=0)||(ii>>>=0,Lt>>>=0,ii<=Lt))return"";for(oi||(oi="utf8");;)switch(oi){case"hex":return Ci(this,Lt,ii);case"utf8":case"utf-8":return ei(this,Lt,ii);case"ascii":return ri(this,Lt,ii);case"latin1":case"binary":return ci(this,Lt,ii);case"base64":return ti(this,Lt,ii);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return li(this,Lt,ii);default:if(gi)throw new TypeError("Unknown encoding: "+oi);oi=(oi+"").toLowerCase(),gi=!0}}ae.prototype._isBuffer=!0;function $e(oi,Lt,ii){var gi=oi[Lt];oi[Lt]=oi[ii],oi[ii]=gi}ae.prototype.swap16=function(){var Lt=this.length;if(Lt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ii=0;ii<Lt;ii+=2)$e(this,ii,ii+1);return this},ae.prototype.swap32=function(){var Lt=this.length;if(Lt%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var ii=0;ii<Lt;ii+=4)$e(this,ii,ii+3),$e(this,ii+1,ii+2);return this},ae.prototype.swap64=function(){var Lt=this.length;if(Lt%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var ii=0;ii<Lt;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 Lt=this.length;return Lt===0?"":arguments.length===0?ei(this,0,Lt):At.apply(this,arguments)},ae.prototype.toLocaleString=ae.prototype.toString,ae.prototype.equals=function(Lt){if(!ae.isBuffer(Lt))throw new TypeError("Argument must be a Buffer");return this===Lt?!0:ae.compare(this,Lt)===0},ae.prototype.inspect=function(){var Lt="",ii=V.INSPECT_MAX_BYTES;return Lt=this.toString("hex",0,ii).replace(/(.{2})/g,"$1 ").trim(),this.length>ii&&(Lt+=" ... "),"<Buffer "+Lt+">"},ae.prototype.compare=function(Lt,ii,gi,hi,mi){if(si(Lt,Uint8Array)&&(Lt=ae.from(Lt,Lt.offset,Lt.byteLength)),!ae.isBuffer(Lt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Lt);if(ii===void 0&&(ii=0),gi===void 0&&(gi=Lt?Lt.length:0),hi===void 0&&(hi=0),mi===void 0&&(mi=this.length),ii<0||gi>Lt.length||hi<0||mi>this.length)throw new RangeError("out of range index");if(hi>=mi&&ii>=gi)return 0;if(hi>=mi)return-1;if(ii>=gi)return 1;if(ii>>>=0,gi>>>=0,hi>>>=0,mi>>>=0,this===Lt)return 0;for(var Si=mi-hi,xi=gi-ii,Gi=Math.min(Si,xi),Bi=this.slice(hi,mi),Oi=Lt.slice(ii,gi),Zi=0;Zi<Gi;++Zi)if(Bi[Zi]!==Oi[Zi]){Si=Bi[Zi],xi=Oi[Zi];break}return Si<xi?-1:xi<Si?1:0};function Fe(oi,Lt,ii,gi,hi){if(oi.length===0)return-1;if(typeof ii=="string"?(gi=ii,ii=0):ii>2147483647?ii=2147483647:ii<-2147483648&&(ii=-2147483648),ii=+ii,wi(ii)&&(ii=hi?0:oi.length-1),ii<0&&(ii=oi.length+ii),ii>=oi.length){if(hi)return-1;ii=oi.length-1}else if(ii<0)if(hi)ii=0;else return-1;if(typeof Lt=="string"&&(Lt=ae.from(Lt,gi)),ae.isBuffer(Lt))return Lt.length===0?-1:Ue(oi,Lt,ii,gi,hi);if(typeof Lt=="number")return Lt=Lt&255,typeof Uint8Array.prototype.indexOf=="function"?hi?Uint8Array.prototype.indexOf.call(oi,Lt,ii):Uint8Array.prototype.lastIndexOf.call(oi,Lt,ii):Ue(oi,[Lt],ii,gi,hi);throw new TypeError("val must be string, number or Buffer")}function Ue(oi,Lt,ii,gi,hi){var mi=1,Si=oi.length,xi=Lt.length;if(gi!==void 0&&(gi=String(gi).toLowerCase(),gi==="ucs2"||gi==="ucs-2"||gi==="utf16le"||gi==="utf-16le")){if(oi.length<2||Lt.length<2)return-1;mi=2,Si/=2,xi/=2,ii/=2}function Gi(Vi,ki){return mi===1?Vi[ki]:Vi.readUInt16BE(ki*mi)}var Bi;if(hi){var Oi=-1;for(Bi=ii;Bi<Si;Bi++)if(Gi(oi,Bi)===Gi(Lt,Oi===-1?0:Bi-Oi)){if(Oi===-1&&(Oi=Bi),Bi-Oi+1===xi)return Oi*mi}else Oi!==-1&&(Bi-=Bi-Oi),Oi=-1}else for(ii+xi>Si&&(ii=Si-xi),Bi=ii;Bi>=0;Bi--){for(var Zi=!0,Wi=0;Wi<xi;Wi++)if(Gi(oi,Bi+Wi)!==Gi(Lt,Wi)){Zi=!1;break}if(Zi)return Bi}return-1}ae.prototype.includes=function(Lt,ii,gi){return this.indexOf(Lt,ii,gi)!==-1},ae.prototype.indexOf=function(Lt,ii,gi){return Fe(this,Lt,ii,gi,!0)},ae.prototype.lastIndexOf=function(Lt,ii,gi){return Fe(this,Lt,ii,gi,!1)};function xe(oi,Lt,ii,gi){ii=Number(ii)||0;var hi=oi.length-ii;gi?(gi=Number(gi),gi>hi&&(gi=hi)):gi=hi;var mi=Lt.length;gi>mi/2&&(gi=mi/2);for(var Si=0;Si<gi;++Si){var xi=parseInt(Lt.substr(Si*2,2),16);if(wi(xi))return Si;oi[ii+Si]=xi}return Si}function Dt(oi,Lt,ii,gi){return bi(Ni(Lt,oi.length-ii),oi,ii,gi)}function qe(oi,Lt,ii,gi){return bi(di(Lt),oi,ii,gi)}function kt(oi,Lt,ii,gi){return qe(oi,Lt,ii,gi)}function jt(oi,Lt,ii,gi){return bi(vi(Lt),oi,ii,gi)}function Pt(oi,Lt,ii,gi){return bi(fi(Lt,oi.length-ii),oi,ii,gi)}ae.prototype.write=function(Lt,ii,gi,hi){if(ii===void 0)hi="utf8",gi=this.length,ii=0;else if(gi===void 0&&typeof ii=="string")hi=ii,gi=this.length,ii=0;else if(isFinite(ii))ii=ii>>>0,isFinite(gi)?(gi=gi>>>0,hi===void 0&&(hi="utf8")):(hi=gi,gi=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var mi=this.length-ii;if((gi===void 0||gi>mi)&&(gi=mi),Lt.length>0&&(gi<0||ii<0)||ii>this.length)throw new RangeError("Attempt to write outside buffer bounds");hi||(hi="utf8");for(var Si=!1;;)switch(hi){case"hex":return xe(this,Lt,ii,gi);case"utf8":case"utf-8":return Dt(this,Lt,ii,gi);case"ascii":return qe(this,Lt,ii,gi);case"latin1":case"binary":return kt(this,Lt,ii,gi);case"base64":return jt(this,Lt,ii,gi);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pt(this,Lt,ii,gi);default:if(Si)throw new TypeError("Unknown encoding: "+hi);hi=(""+hi).toLowerCase(),Si=!0}},ae.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ti(oi,Lt,ii){return Lt===0&&ii===oi.length?$.fromByteArray(oi):$.fromByteArray(oi.slice(Lt,ii))}function ei(oi,Lt,ii){ii=Math.min(oi.length,ii);for(var gi=[],hi=Lt;hi<ii;){var mi=oi[hi],Si=null,xi=mi>239?4:mi>223?3:mi>191?2:1;if(hi+xi<=ii){var Gi,Bi,Oi,Zi;switch(xi){case 1:mi<128&&(Si=mi);break;case 2:Gi=oi[hi+1],(Gi&192)===128&&(Zi=(mi&31)<<6|Gi&63,Zi>127&&(Si=Zi));break;case 3:Gi=oi[hi+1],Bi=oi[hi+2],(Gi&192)===128&&(Bi&192)===128&&(Zi=(mi&15)<<12|(Gi&63)<<6|Bi&63,Zi>2047&&(Zi<55296||Zi>57343)&&(Si=Zi));break;case 4:Gi=oi[hi+1],Bi=oi[hi+2],Oi=oi[hi+3],(Gi&192)===128&&(Bi&192)===128&&(Oi&192)===128&&(Zi=(mi&15)<<18|(Gi&63)<<12|(Bi&63)<<6|Oi&63,Zi>65535&&Zi<1114112&&(Si=Zi))}}Si===null?(Si=65533,xi=1):Si>65535&&(Si-=65536,gi.push(Si>>>10&1023|55296),Si=56320|Si&1023),gi.push(Si),hi+=xi}return ni(gi)}var Et=4096;function ni(oi){var Lt=oi.length;if(Lt<=Et)return String.fromCharCode.apply(String,oi);for(var ii="",gi=0;gi<Lt;)ii+=String.fromCharCode.apply(String,oi.slice(gi,gi+=Et));return ii}function ri(oi,Lt,ii){var gi="";ii=Math.min(oi.length,ii);for(var hi=Lt;hi<ii;++hi)gi+=String.fromCharCode(oi[hi]&127);return gi}function ci(oi,Lt,ii){var gi="";ii=Math.min(oi.length,ii);for(var hi=Lt;hi<ii;++hi)gi+=String.fromCharCode(oi[hi]);return gi}function Ci(oi,Lt,ii){var gi=oi.length;(!Lt||Lt<0)&&(Lt=0),(!ii||ii<0||ii>gi)&&(ii=gi);for(var hi="",mi=Lt;mi<ii;++mi)hi+=pi(oi[mi]);return hi}function li(oi,Lt,ii){for(var gi=oi.slice(Lt,ii),hi="",mi=0;mi<gi.length;mi+=2)hi+=String.fromCharCode(gi[mi]+gi[mi+1]*256);return hi}ae.prototype.slice=function(Lt,ii){var gi=this.length;Lt=~~Lt,ii=ii===void 0?gi:~~ii,Lt<0?(Lt+=gi,Lt<0&&(Lt=0)):Lt>gi&&(Lt=gi),ii<0?(ii+=gi,ii<0&&(ii=0)):ii>gi&&(ii=gi),ii<Lt&&(ii=Lt);var hi=this.subarray(Lt,ii);return hi.__proto__=ae.prototype,hi};function ui(oi,Lt,ii){if(oi%1!==0||oi<0)throw new RangeError("offset is not uint");if(oi+Lt>ii)throw new RangeError("Trying to access beyond buffer length")}ae.prototype.readUIntLE=function(Lt,ii,gi){Lt=Lt>>>0,ii=ii>>>0,gi||ui(Lt,ii,this.length);for(var hi=this[Lt],mi=1,Si=0;++Si<ii&&(mi*=256);)hi+=this[Lt+Si]*mi;return hi},ae.prototype.readUIntBE=function(Lt,ii,gi){Lt=Lt>>>0,ii=ii>>>0,gi||ui(Lt,ii,this.length);for(var hi=this[Lt+--ii],mi=1;ii>0&&(mi*=256);)hi+=this[Lt+--ii]*mi;return hi},ae.prototype.readUInt8=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,1,this.length),this[Lt]},ae.prototype.readUInt16LE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,2,this.length),this[Lt]|this[Lt+1]<<8},ae.prototype.readUInt16BE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,2,this.length),this[Lt]<<8|this[Lt+1]},ae.prototype.readUInt32LE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),(this[Lt]|this[Lt+1]<<8|this[Lt+2]<<16)+this[Lt+3]*16777216},ae.prototype.readUInt32BE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),this[Lt]*16777216+(this[Lt+1]<<16|this[Lt+2]<<8|this[Lt+3])},ae.prototype.readIntLE=function(Lt,ii,gi){Lt=Lt>>>0,ii=ii>>>0,gi||ui(Lt,ii,this.length);for(var hi=this[Lt],mi=1,Si=0;++Si<ii&&(mi*=256);)hi+=this[Lt+Si]*mi;return mi*=128,hi>=mi&&(hi-=Math.pow(2,8*ii)),hi},ae.prototype.readIntBE=function(Lt,ii,gi){Lt=Lt>>>0,ii=ii>>>0,gi||ui(Lt,ii,this.length);for(var hi=ii,mi=1,Si=this[Lt+--hi];hi>0&&(mi*=256);)Si+=this[Lt+--hi]*mi;return mi*=128,Si>=mi&&(Si-=Math.pow(2,8*ii)),Si},ae.prototype.readInt8=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,1,this.length),this[Lt]&128?(255-this[Lt]+1)*-1:this[Lt]},ae.prototype.readInt16LE=function(Lt,ii){Lt=Lt>>>0,ii||ui(Lt,2,this.length);var gi=this[Lt]|this[Lt+1]<<8;return gi&32768?gi|4294901760:gi},ae.prototype.readInt16BE=function(Lt,ii){Lt=Lt>>>0,ii||ui(Lt,2,this.length);var gi=this[Lt+1]|this[Lt]<<8;return gi&32768?gi|4294901760:gi},ae.prototype.readInt32LE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),this[Lt]|this[Lt+1]<<8|this[Lt+2]<<16|this[Lt+3]<<24},ae.prototype.readInt32BE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),this[Lt]<<24|this[Lt+1]<<16|this[Lt+2]<<8|this[Lt+3]},ae.prototype.readFloatLE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),re.read(this,Lt,!0,23,4)},ae.prototype.readFloatBE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,4,this.length),re.read(this,Lt,!1,23,4)},ae.prototype.readDoubleLE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,8,this.length),re.read(this,Lt,!0,52,8)},ae.prototype.readDoubleBE=function(Lt,ii){return Lt=Lt>>>0,ii||ui(Lt,8,this.length),re.read(this,Lt,!1,52,8)};function yi(oi,Lt,ii,gi,hi,mi){if(!ae.isBuffer(oi))throw new TypeError('"buffer" argument must be a Buffer instance');if(Lt>hi||Lt<mi)throw new RangeError('"value" argument is out of bounds');if(ii+gi>oi.length)throw new RangeError("Index out of range")}ae.prototype.writeUIntLE=function(Lt,ii,gi,hi){if(Lt=+Lt,ii=ii>>>0,gi=gi>>>0,!hi){var mi=Math.pow(2,8*gi)-1;yi(this,Lt,ii,gi,mi,0)}var Si=1,xi=0;for(this[ii]=Lt&255;++xi<gi&&(Si*=256);)this[ii+xi]=Lt/Si&255;return ii+gi},ae.prototype.writeUIntBE=function(Lt,ii,gi,hi){if(Lt=+Lt,ii=ii>>>0,gi=gi>>>0,!hi){var mi=Math.pow(2,8*gi)-1;yi(this,Lt,ii,gi,mi,0)}var Si=gi-1,xi=1;for(this[ii+Si]=Lt&255;--Si>=0&&(xi*=256);)this[ii+Si]=Lt/xi&255;return ii+gi},ae.prototype.writeUInt8=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,1,255,0),this[ii]=Lt&255,ii+1},ae.prototype.writeUInt16LE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,2,65535,0),this[ii]=Lt&255,this[ii+1]=Lt>>>8,ii+2},ae.prototype.writeUInt16BE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,2,65535,0),this[ii]=Lt>>>8,this[ii+1]=Lt&255,ii+2},ae.prototype.writeUInt32LE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,4,4294967295,0),this[ii+3]=Lt>>>24,this[ii+2]=Lt>>>16,this[ii+1]=Lt>>>8,this[ii]=Lt&255,ii+4},ae.prototype.writeUInt32BE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,4,4294967295,0),this[ii]=Lt>>>24,this[ii+1]=Lt>>>16,this[ii+2]=Lt>>>8,this[ii+3]=Lt&255,ii+4},ae.prototype.writeIntLE=function(Lt,ii,gi,hi){if(Lt=+Lt,ii=ii>>>0,!hi){var mi=Math.pow(2,8*gi-1);yi(this,Lt,ii,gi,mi-1,-mi)}var Si=0,xi=1,Gi=0;for(this[ii]=Lt&255;++Si<gi&&(xi*=256);)Lt<0&&Gi===0&&this[ii+Si-1]!==0&&(Gi=1),this[ii+Si]=(Lt/xi>>0)-Gi&255;return ii+gi},ae.prototype.writeIntBE=function(Lt,ii,gi,hi){if(Lt=+Lt,ii=ii>>>0,!hi){var mi=Math.pow(2,8*gi-1);yi(this,Lt,ii,gi,mi-1,-mi)}var Si=gi-1,xi=1,Gi=0;for(this[ii+Si]=Lt&255;--Si>=0&&(xi*=256);)Lt<0&&Gi===0&&this[ii+Si+1]!==0&&(Gi=1),this[ii+Si]=(Lt/xi>>0)-Gi&255;return ii+gi},ae.prototype.writeInt8=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,1,127,-128),Lt<0&&(Lt=255+Lt+1),this[ii]=Lt&255,ii+1},ae.prototype.writeInt16LE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,2,32767,-32768),this[ii]=Lt&255,this[ii+1]=Lt>>>8,ii+2},ae.prototype.writeInt16BE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,2,32767,-32768),this[ii]=Lt>>>8,this[ii+1]=Lt&255,ii+2},ae.prototype.writeInt32LE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,4,2147483647,-2147483648),this[ii]=Lt&255,this[ii+1]=Lt>>>8,this[ii+2]=Lt>>>16,this[ii+3]=Lt>>>24,ii+4},ae.prototype.writeInt32BE=function(Lt,ii,gi){return Lt=+Lt,ii=ii>>>0,gi||yi(this,Lt,ii,4,2147483647,-2147483648),Lt<0&&(Lt=4294967295+Lt+1),this[ii]=Lt>>>24,this[ii+1]=Lt>>>16,this[ii+2]=Lt>>>8,this[ii+3]=Lt&255,ii+4};function Mi(oi,Lt,ii,gi,hi,mi){if(ii+gi>oi.length)throw new RangeError("Index out of range");if(ii<0)throw new RangeError("Index out of range")}function zi(oi,Lt,ii,gi,hi){return Lt=+Lt,ii=ii>>>0,hi||Mi(oi,Lt,ii,4),re.write(oi,Lt,ii,gi,23,4),ii+4}ae.prototype.writeFloatLE=function(Lt,ii,gi){return zi(this,Lt,ii,!0,gi)},ae.prototype.writeFloatBE=function(Lt,ii,gi){return zi(this,Lt,ii,!1,gi)};function Ai(oi,Lt,ii,gi,hi){return Lt=+Lt,ii=ii>>>0,hi||Mi(oi,Lt,ii,8),re.write(oi,Lt,ii,gi,52,8),ii+8}ae.prototype.writeDoubleLE=function(Lt,ii,gi){return Ai(this,Lt,ii,!0,gi)},ae.prototype.writeDoubleBE=function(Lt,ii,gi){return Ai(this,Lt,ii,!1,gi)},ae.prototype.copy=function(Lt,ii,gi,hi){if(!ae.isBuffer(Lt))throw new TypeError("argument should be a Buffer");if(gi||(gi=0),!hi&&hi!==0&&(hi=this.length),ii>=Lt.length&&(ii=Lt.length),ii||(ii=0),hi>0&&hi<gi&&(hi=gi),hi===gi||Lt.length===0||this.length===0)return 0;if(ii<0)throw new RangeError("targetStart out of bounds");if(gi<0||gi>=this.length)throw new RangeError("Index out of range");if(hi<0)throw new RangeError("sourceEnd out of bounds");hi>this.length&&(hi=this.length),Lt.length-ii<hi-gi&&(hi=Lt.length-ii+gi);var mi=hi-gi;if(this===Lt&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(ii,gi,hi);else if(this===Lt&&gi<ii&&ii<hi)for(var Si=mi-1;Si>=0;--Si)Lt[Si+ii]=this[Si+gi];else Uint8Array.prototype.set.call(Lt,this.subarray(gi,hi),ii);return mi},ae.prototype.fill=function(Lt,ii,gi,hi){if(typeof Lt=="string"){if(typeof ii=="string"?(hi=ii,ii=0,gi=this.length):typeof gi=="string"&&(hi=gi,gi=this.length),hi!==void 0&&typeof hi!="string")throw new TypeError("encoding must be a string");if(typeof hi=="string"&&!ae.isEncoding(hi))throw new TypeError("Unknown encoding: "+hi);if(Lt.length===1){var mi=Lt.charCodeAt(0);(hi==="utf8"&&mi<128||hi==="latin1")&&(Lt=mi)}}else typeof Lt=="number"&&(Lt=Lt&255);if(ii<0||this.length<ii||this.length<gi)throw new RangeError("Out of range index");if(gi<=ii)return this;ii=ii>>>0,gi=gi===void 0?this.length:gi>>>0,Lt||(Lt=0);var Si;if(typeof Lt=="number")for(Si=ii;Si<gi;++Si)this[Si]=Lt;else{var xi=ae.isBuffer(Lt)?Lt:ae.from(Lt,hi),Gi=xi.length;if(Gi===0)throw new TypeError('The value "'+Lt+'" is invalid for argument "value"');for(Si=0;Si<gi-ii;++Si)this[Si+ii]=xi[Si%Gi]}return this};var Ii=/[^+/0-9A-Za-z-_]/g;function ai(oi){if(oi=oi.split("=")[0],oi=oi.trim().replace(Ii,""),oi.length<2)return"";for(;oi.length%4!==0;)oi=oi+"=";return oi}function pi(oi){return oi<16?"0"+oi.toString(16):oi.toString(16)}function Ni(oi,Lt){Lt=Lt||1/0;for(var ii,gi=oi.length,hi=null,mi=[],Si=0;Si<gi;++Si){if(ii=oi.charCodeAt(Si),ii>55295&&ii<57344){if(!hi){if(ii>56319){(Lt-=3)>-1&&mi.push(239,191,189);continue}else if(Si+1===gi){(Lt-=3)>-1&&mi.push(239,191,189);continue}hi=ii;continue}if(ii<56320){(Lt-=3)>-1&&mi.push(239,191,189),hi=ii;continue}ii=(hi-55296<<10|ii-56320)+65536}else hi&&(Lt-=3)>-1&&mi.push(239,191,189);if(hi=null,ii<128){if((Lt-=1)<0)break;mi.push(ii)}else if(ii<2048){if((Lt-=2)<0)break;mi.push(ii>>6|192,ii&63|128)}else if(ii<65536){if((Lt-=3)<0)break;mi.push(ii>>12|224,ii>>6&63|128,ii&63|128)}else if(ii<1114112){if((Lt-=4)<0)break;mi.push(ii>>18|240,ii>>12&63|128,ii>>6&63|128,ii&63|128)}else throw new Error("Invalid code point")}return mi}function di(oi){for(var Lt=[],ii=0;ii<oi.length;++ii)Lt.push(oi.charCodeAt(ii)&255);return Lt}function fi(oi,Lt){for(var ii,gi,hi,mi=[],Si=0;Si<oi.length&&!((Lt-=2)<0);++Si)ii=oi.charCodeAt(Si),gi=ii>>8,hi=ii%256,mi.push(hi),mi.push(gi);return mi}function vi(oi){return $.toByteArray(ai(oi))}function bi(oi,Lt,ii,gi){for(var hi=0;hi<gi&&!(hi+ii>=Lt.length||hi>=oi.length);++hi)Lt[hi+ii]=oi[hi];return hi}function si(oi,Lt){return oi instanceof Lt||oi!=null&&oi.constructor!=null&&oi.constructor.name!=null&&oi.constructor.name===Lt.name}function wi(oi){return oi!==oi}}).call(this)}).call(this,r("buffer").Buffer)},{"base64-js":13,buffer:17,ieee754:23}],18:[function(r,g,V){(function(k){(function(){V.formatArgs=re,V.save=oe,V.load=Ce,V.useColors=$,V.storage=ie(),V.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`."))}})(),V.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 re(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)}V.log=console.debug||console.log||(()=>{});function oe(le){try{le?V.storage.setItem("debug",le):V.storage.removeItem("debug")}catch{}}function Ce(){let le;try{le=V.storage.getItem("debug")}catch{}return!le&&typeof k<"u"&&"env"in k&&(le=k.env.DEBUG),le}function ie(){try{return localStorage}catch{}}g.exports=r("./common")(V);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,V){function k($){oe.debug=oe,oe.default=oe,oe.coerce=ue,oe.disable=ae,oe.enable=ie,oe.enabled=le,oe.humanize=r("ms"),oe.destroy=de,Object.keys($).forEach(Ne=>{oe[Ne]=$[Ne]}),oe.names=[],oe.skips=[],oe.formatters={};function re(Ne){let he=0;for(let ze=0;ze<Ne.length;ze++)he=(he<<5)-he+Ne.charCodeAt(ze),he|=0;return oe.colors[Math.abs(he)%oe.colors.length]}oe.selectColor=re;function oe(Ne){let he,ze=null,pe,Ve;function Oe(..._e){if(!Oe.enabled)return;const At=Oe,$e=Number(new Date),Fe=$e-(he||$e);At.diff=Fe,At.prev=he,At.curr=$e,he=$e,_e[0]=oe.coerce(_e[0]),typeof _e[0]!="string"&&_e.unshift("%O");let Ue=0;_e[0]=_e[0].replace(/%([a-zA-Z%])/g,(Dt,qe)=>{if(Dt==="%%")return"%";Ue++;const kt=oe.formatters[qe];if(typeof kt=="function"){const jt=_e[Ue];Dt=kt.call(At,jt),_e.splice(Ue,1),Ue--}return Dt}),oe.formatArgs.call(At,_e),(At.log||oe.log).apply(At,_e)}return Oe.namespace=Ne,Oe.useColors=oe.useColors(),Oe.color=oe.selectColor(Ne),Oe.extend=Ce,Oe.destroy=oe.destroy,Object.defineProperty(Oe,"enabled",{enumerable:!0,configurable:!1,get:()=>ze!==null?ze:(pe!==oe.namespaces&&(pe=oe.namespaces,Ve=oe.enabled(Ne)),Ve),set:_e=>{ze=_e}}),typeof oe.init=="function"&&oe.init(Oe),Oe}function Ce(Ne,he){const ze=oe(this.namespace+(typeof he>"u"?":":he)+Ne);return ze.log=this.log,ze}function ie(Ne){oe.save(Ne),oe.namespaces=Ne,oe.names=[],oe.skips=[];let he;const ze=(typeof Ne=="string"?Ne:"").split(/[\s,]+/),pe=ze.length;for(he=0;he<pe;he++)ze[he]&&(Ne=ze[he].replace(/\*/g,".*?"),Ne[0]==="-"?oe.skips.push(new RegExp("^"+Ne.substr(1)+"$")):oe.names.push(new RegExp("^"+Ne+"$")))}function ae(){const Ne=[...oe.names.map(Ie),...oe.skips.map(Ie).map(he=>"-"+he)].join(",");return oe.enable(""),Ne}function le(Ne){if(Ne[Ne.length-1]==="*")return!0;let he,ze;for(he=0,ze=oe.skips.length;he<ze;he++)if(oe.skips[he].test(Ne))return!1;for(he=0,ze=oe.names.length;he<ze;he++)if(oe.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 oe.enable(oe.load()),oe}g.exports=k},{ms:45}],20:[function(r,g,V){(function(k,$){(function(){var re=r("readable-stream"),oe=r("end-of-stream"),Ce=r("inherits"),ie=r("stream-shift"),ae=$.from&&$.from!==Uint8Array.from?$.from([0]):new $([0]),le=function(pe,Ve){pe._corked?pe.once("uncork",Ve):Ve()},Ie=function(pe,Ve){pe._autoDestroy&&pe.destroy(Ve)},ue=function(pe,Ve){return function(Oe){Oe?Ie(pe,Oe.message==="premature close"?null:Oe):Ve&&!pe._ended&&pe.end()}},de=function(pe,Ve){if(!pe||pe._writableState&&pe._writableState.finished)return Ve();if(pe._writableState)return pe.end(Ve);pe.end(),Ve()},Ne=function(){},he=function(pe){return new re.Readable({objectMode:!0,highWaterMark:16}).wrap(pe)},ze=function(pe,Ve,Oe){if(!(this instanceof ze))return new ze(pe,Ve,Oe);re.Duplex.call(this,Oe),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!Oe||Oe.autoDestroy!==!1,this._forwardDestroy=!Oe||Oe.destroy!==!1,this._forwardEnd=!Oe||Oe.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,pe&&this.setWritable(pe),Ve&&this.setReadable(Ve)};Ce(ze,re.Duplex),ze.obj=function(pe,Ve,Oe){return Oe||(Oe={}),Oe.objectMode=!0,Oe.highWaterMark=16,new ze(pe,Ve,Oe)},ze.prototype.cork=function(){++this._corked===1&&this.emit("cork")},ze.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},ze.prototype.setWritable=function(pe){if(this._unwrite&&this._unwrite(),this.destroyed){pe&&pe.destroy&&pe.destroy();return}if(pe===null||pe===!1){this.end();return}var Ve=this,Oe=oe(pe,{writable:!0,readable:!1},ue(this,this._forwardEnd)),_e=function(){var $e=Ve._ondrain;Ve._ondrain=null,$e&&$e()},At=function(){Ve._writable.removeListener("drain",_e),Oe()};this._unwrite&&k.nextTick(_e),this._writable=pe,this._writable.on("drain",_e),this._unwrite=At,this.uncork()},ze.prototype.setReadable=function(pe){if(this._unread&&this._unread(),this.destroyed){pe&&pe.destroy&&pe.destroy();return}if(pe===null||pe===!1){this.push(null),this.resume();return}var Ve=this,Oe=oe(pe,{writable:!1,readable:!0},ue(this)),_e=function(){Ve._forward()},At=function(){Ve.push(null)},$e=function(){Ve._readable2.removeListener("readable",_e),Ve._readable2.removeListener("end",At),Oe()};this._drained=!0,this._readable=pe,this._readable2=pe._readableState?pe:he(pe),this._readable2.on("readable",_e),this._readable2.on("end",At),this._unread=$e,this._forward()},ze.prototype._read=function(){this._drained=!0,this._forward()},ze.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var pe;this._drained&&(pe=ie(this._readable2))!==null;)this.destroyed||(this._drained=this.push(pe));this._forwarding=!1}},ze.prototype.destroy=function(pe,Ve){if(Ve||(Ve=Ne),this.destroyed)return Ve(null);this.destroyed=!0;var Oe=this;k.nextTick(function(){Oe._destroy(pe),Ve(null)})},ze.prototype._destroy=function(pe){if(pe){var Ve=this._ondrain;this._ondrain=null,Ve?Ve(pe):this.emit("error",pe)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},ze.prototype._write=function(pe,Ve,Oe){if(!this.destroyed){if(this._corked)return le(this,this._write.bind(this,pe,Ve,Oe));if(pe===ae)return this._finish(Oe);if(!this._writable)return Oe();this._writable.write(pe)===!1?this._ondrain=Oe:this.destroyed||Oe()}},ze.prototype._finish=function(pe){var Ve=this;this.emit("preend"),le(this,function(){de(Ve._forwardEnd&&Ve._writable,function(){Ve._writableState.prefinished===!1&&(Ve._writableState.prefinished=!0),Ve.emit("prefinish"),le(Ve,pe)})})},ze.prototype.end=function(pe,Ve,Oe){return typeof pe=="function"?this.end(null,null,pe):typeof Ve=="function"?this.end(pe,null,Ve):(this._ended=!0,pe&&this.write(pe),!this._writableState.ending&&!this._writableState.destroyed&&this.write(ae),re.Writable.prototype.end.call(this,Oe))},g.exports=ze}).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,V){(function(k){(function(){var $=r("once"),re=function(){},oe=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||re);var ue=ae._writableState,de=ae._readableState,Ne=le.readable||le.readable!==!1&&ae.readable,he=le.writable||le.writable!==!1&&ae.writable,ze=!1,pe=function(){ae.writable||Ve()},Ve=function(){he=!1,Ne||Ie.call(ae)},Oe=function(){Ne=!1,he||Ie.call(ae)},_e=function(xe){Ie.call(ae,xe?new Error("exited with error code: "+xe):null)},At=function(xe){Ie.call(ae,xe)},$e=function(){k.nextTick(Fe)},Fe=function(){if(!ze){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"))}},Ue=function(){ae.req.on("finish",Ve)};return oe(ae)?(ae.on("complete",Ve),ae.on("abort",$e),ae.req?Ue():ae.on("request",Ue)):he&&!ue&&(ae.on("end",pe),ae.on("close",pe)),Ce(ae)&&ae.on("exit",_e),ae.on("end",Oe),ae.on("finish",Ve),le.error!==!1&&ae.on("error",At),ae.on("close",$e),function(){ze=!0,ae.removeListener("complete",Ve),ae.removeListener("abort",$e),ae.removeListener("request",Ue),ae.req&&ae.req.removeListener("finish",Ve),ae.removeListener("end",pe),ae.removeListener("close",pe),ae.removeListener("finish",Ve),ae.removeListener("exit",_e),ae.removeListener("end",Oe),ae.removeListener("error",At),ae.removeListener("close",$e)}};g.exports=ie}).call(this)}).call(this,r("_process"))},{_process:50,once:48}],22:[function(r,g,V){var k=Object.create||Ue,$=Object.keys||xe,re=Function.prototype.bind||Dt;function oe(){(!this._events||!Object.prototype.hasOwnProperty.call(this,"_events"))&&(this._events=k(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}g.exports=oe,oe.EventEmitter=oe,oe.prototype._events=void 0,oe.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(oe,"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}}):oe.defaultMaxListeners=Ce,oe.prototype.setMaxListeners=function(kt){if(typeof kt!="number"||kt<0||isNaN(kt))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=kt,this};function le(qe){return qe._maxListeners===void 0?oe.defaultMaxListeners:qe._maxListeners}oe.prototype.getMaxListeners=function(){return le(this)};function Ie(qe,kt,jt){if(kt)qe.call(jt);else for(var Pt=qe.length,ti=$e(qe,Pt),ei=0;ei<Pt;++ei)ti[ei].call(jt)}function ue(qe,kt,jt,Pt){if(kt)qe.call(jt,Pt);else for(var ti=qe.length,ei=$e(qe,ti),Et=0;Et<ti;++Et)ei[Et].call(jt,Pt)}function de(qe,kt,jt,Pt,ti){if(kt)qe.call(jt,Pt,ti);else for(var ei=qe.length,Et=$e(qe,ei),ni=0;ni<ei;++ni)Et[ni].call(jt,Pt,ti)}function Ne(qe,kt,jt,Pt,ti,ei){if(kt)qe.call(jt,Pt,ti,ei);else for(var Et=qe.length,ni=$e(qe,Et),ri=0;ri<Et;++ri)ni[ri].call(jt,Pt,ti,ei)}function he(qe,kt,jt,Pt){if(kt)qe.apply(jt,Pt);else for(var ti=qe.length,ei=$e(qe,ti),Et=0;Et<ti;++Et)ei[Et].apply(jt,Pt)}oe.prototype.emit=function(kt){var jt,Pt,ti,ei,Et,ni,ri=kt==="error";if(ni=this._events,ni)ri=ri&&ni.error==null;else if(!ri)return!1;if(ri){if(arguments.length>1&&(jt=arguments[1]),jt instanceof Error)throw jt;var ci=new Error('Unhandled "error" event. ('+jt+")");throw ci.context=jt,ci}if(Pt=ni[kt],!Pt)return!1;var Ci=typeof Pt=="function";switch(ti=arguments.length,ti){case 1:Ie(Pt,Ci,this);break;case 2:ue(Pt,Ci,this,arguments[1]);break;case 3:de(Pt,Ci,this,arguments[1],arguments[2]);break;case 4:Ne(Pt,Ci,this,arguments[1],arguments[2],arguments[3]);break;default:for(ei=new Array(ti-1),Et=1;Et<ti;Et++)ei[Et-1]=arguments[Et];he(Pt,Ci,this,ei)}return!0};function ze(qe,kt,jt,Pt){var ti,ei,Et;if(typeof jt!="function")throw new TypeError('"listener" argument must be a function');if(ei=qe._events,ei?(ei.newListener&&(qe.emit("newListener",kt,jt.listener?jt.listener:jt),ei=qe._events),Et=ei[kt]):(ei=qe._events=k(null),qe._eventsCount=0),!Et)Et=ei[kt]=jt,++qe._eventsCount;else if(typeof Et=="function"?Et=ei[kt]=Pt?[jt,Et]:[Et,jt]:Pt?Et.unshift(jt):Et.push(jt),!Et.warned&&(ti=le(qe),ti&&ti>0&&Et.length>ti)){Et.warned=!0;var ni=new Error("Possible EventEmitter memory leak detected. "+Et.length+' "'+String(kt)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');ni.name="MaxListenersExceededWarning",ni.emitter=qe,ni.type=kt,ni.count=Et.length,typeof console=="object"&&console.warn&&console.warn("%s: %s",ni.name,ni.message)}return qe}oe.prototype.addListener=function(kt,jt){return ze(this,kt,jt,!1)},oe.prototype.on=oe.prototype.addListener,oe.prototype.prependListener=function(kt,jt){return ze(this,kt,jt,!0)};function pe(){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),kt=0;kt<qe.length;++kt)qe[kt]=arguments[kt];this.listener.apply(this.target,qe)}}function Ve(qe,kt,jt){var Pt={fired:!1,wrapFn:void 0,target:qe,type:kt,listener:jt},ti=re.call(pe,Pt);return ti.listener=jt,Pt.wrapFn=ti,ti}oe.prototype.once=function(kt,jt){if(typeof jt!="function")throw new TypeError('"listener" argument must be a function');return this.on(kt,Ve(this,kt,jt)),this},oe.prototype.prependOnceListener=function(kt,jt){if(typeof jt!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(kt,Ve(this,kt,jt)),this},oe.prototype.removeListener=function(kt,jt){var Pt,ti,ei,Et,ni;if(typeof jt!="function")throw new TypeError('"listener" argument must be a function');if(ti=this._events,!ti)return this;if(Pt=ti[kt],!Pt)return this;if(Pt===jt||Pt.listener===jt)--this._eventsCount===0?this._events=k(null):(delete ti[kt],ti.removeListener&&this.emit("removeListener",kt,Pt.listener||jt));else if(typeof Pt!="function"){for(ei=-1,Et=Pt.length-1;Et>=0;Et--)if(Pt[Et]===jt||Pt[Et].listener===jt){ni=Pt[Et].listener,ei=Et;break}if(ei<0)return this;ei===0?Pt.shift():At(Pt,ei),Pt.length===1&&(ti[kt]=Pt[0]),ti.removeListener&&this.emit("removeListener",kt,ni||jt)}return this},oe.prototype.removeAllListeners=function(kt){var jt,Pt,ti;if(Pt=this._events,!Pt)return this;if(!Pt.removeListener)return arguments.length===0?(this._events=k(null),this._eventsCount=0):Pt[kt]&&(--this._eventsCount===0?this._events=k(null):delete Pt[kt]),this;if(arguments.length===0){var ei=$(Pt),Et;for(ti=0;ti<ei.length;++ti)Et=ei[ti],Et!=="removeListener"&&this.removeAllListeners(Et);return this.removeAllListeners("removeListener"),this._events=k(null),this._eventsCount=0,this}if(jt=Pt[kt],typeof jt=="function")this.removeListener(kt,jt);else if(jt)for(ti=jt.length-1;ti>=0;ti--)this.removeListener(kt,jt[ti]);return this};function Oe(qe,kt,jt){var Pt=qe._events;if(!Pt)return[];var ti=Pt[kt];return ti?typeof ti=="function"?jt?[ti.listener||ti]:[ti]:jt?Fe(ti):$e(ti,ti.length):[]}oe.prototype.listeners=function(kt){return Oe(this,kt,!0)},oe.prototype.rawListeners=function(kt){return Oe(this,kt,!1)},oe.listenerCount=function(qe,kt){return typeof qe.listenerCount=="function"?qe.listenerCount(kt):_e.call(qe,kt)},oe.prototype.listenerCount=_e;function _e(qe){var kt=this._events;if(kt){var jt=kt[qe];if(typeof jt=="function")return 1;if(jt)return jt.length}return 0}oe.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function At(qe,kt){for(var jt=kt,Pt=jt+1,ti=qe.length;Pt<ti;jt+=1,Pt+=1)qe[jt]=qe[Pt];qe.pop()}function $e(qe,kt){for(var jt=new Array(kt),Pt=0;Pt<kt;++Pt)jt[Pt]=qe[Pt];return jt}function Fe(qe){for(var kt=new Array(qe.length),jt=0;jt<kt.length;++jt)kt[jt]=qe[jt].listener||qe[jt];return kt}function Ue(qe){var kt=function(){};return kt.prototype=qe,new kt}function xe(qe){for(var kt in qe)Object.prototype.hasOwnProperty.call(qe,kt);return kt}function Dt(qe){var kt=this;return function(){return kt.apply(qe,arguments)}}},{}],23:[function(r,g,V){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */V.read=function(k,$,re,oe,Ce){var ie,ae,le=Ce*8-oe-1,Ie=(1<<le)-1,ue=Ie>>1,de=-7,Ne=re?Ce-1:0,he=re?-1:1,ze=k[$+Ne];for(Ne+=he,ie=ze&(1<<-de)-1,ze>>=-de,de+=le;de>0;ie=ie*256+k[$+Ne],Ne+=he,de-=8);for(ae=ie&(1<<-de)-1,ie>>=-de,de+=oe;de>0;ae=ae*256+k[$+Ne],Ne+=he,de-=8);if(ie===0)ie=1-ue;else{if(ie===Ie)return ae?NaN:(ze?-1:1)*(1/0);ae=ae+Math.pow(2,oe),ie=ie-ue}return(ze?-1:1)*ae*Math.pow(2,ie-oe)},V.write=function(k,$,re,oe,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,ze=oe?0:ie-1,pe=oe?1:-1,Ve=$<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;k[re+ze]=le&255,ze+=pe,le/=256,Ce-=8);for(ae=ae<<Ce|le,ue+=Ce;ue>0;k[re+ze]=ae&255,ze+=pe,ae/=256,ue-=8);k[re+ze-pe]|=Ve*128}},{}],24:[function(r,g,V){typeof Object.create=="function"?g.exports=function($,re){re&&($.super_=re,$.prototype=Object.create(re.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}))}:g.exports=function($,re){if(re){$.super_=re;var oe=function(){};oe.prototype=re.prototype,$.prototype=new oe,$.prototype.constructor=$}}},{}],25:[function(r,g,V){Object.defineProperty(V,"__esModule",{value:!0});var k=function(){function $(re,oe){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=re,this.value=oe}return $.prototype.rotateLeft=function(){var re=this.parent,oe=this.brother,Ce=this.leftChild,ie=this.rightChild;if(!ie)throw new Error("unknown error");var ae=ie.leftChild,le=ie.rightChild;return re&&(re.leftChild===this?re.leftChild=ie:re.rightChild===this&&(re.rightChild=ie)),ie.parent=re,ie.brother=oe,ie.leftChild=this,ie.rightChild=le,oe&&(oe.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 re=this.parent,oe=this.brother,Ce=this.leftChild;if(!Ce)throw new Error("unknown error");var ie=this.rightChild,ae=Ce.leftChild,le=Ce.rightChild;return re&&(re.leftChild===this?re.leftChild=Ce:re.rightChild===this&&(re.rightChild=Ce)),Ce.parent=re,Ce.brother=oe,Ce.leftChild=ae,Ce.rightChild=this,oe&&(oe.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(k),V.default=k},{}],26:[function(r,g,V){var k=this&&this.__generator||function(re,oe){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=oe.call(re,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(V,"__esModule",{value:!0}),$.sigma=3,$.bucketSize=5e3;function $(re){var oe=this;re===void 0&&(re=[]);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(ze){if(!this.empty()){var pe=0;if(ie===le){for(var Ve=ae;Ve<=Ie;++Ve)ze(Ce[ie][Ve],pe++);return}for(var Ve=ae;Ve<$.bucketSize;++Ve)ze(Ce[ie][Ve],pe++);for(var Ve=ie+1;Ve<le;++Ve)for(var Oe=0;Oe<$.bucketSize;++Oe)ze(Ce[Ve][Oe],pe++);for(var Ve=0;Ve<=Ie;++Ve)ze(Ce[le][Ve],pe++)}};var Ne=function(ze){var pe=ie*$.bucketSize+ae,Ve=pe+ze,Oe=le*$.bucketSize+Ie;if(Ve<pe||Ve>Oe)throw new Error("pos should more than 0 and less than queue's size");var _e=Math.floor(Ve/$.bucketSize),At=Ve%$.bucketSize;return{curNodeBucketIndex:_e,curNodePointerIndex:At}};this.getElementByPos=function(ze){var pe=Ne(ze),Ve=pe.curNodeBucketIndex,Oe=pe.curNodePointerIndex;return Ce[Ve][Oe]},this.eraseElementByPos=function(ze){var pe=this;if(ze<0||ze>de)throw new Error("pos should more than 0 and less than queue's size");if(ze===0)this.popFront();else if(ze===this.size())this.popBack();else{for(var Ve=[],Oe=ze+1;Oe<de;++Oe)Ve.push(this.getElementByPos(Oe));this.cut(ze),this.popBack(),Ve.forEach(function(_e){return pe.pushBack(_e)})}},this.eraseElementByValue=function(ze){if(!this.empty()){var pe=[];this.forEach(function(_e){_e!==ze&&pe.push(_e)});for(var Ve=pe.length,Oe=0;Oe<Ve;++Oe)this.setElementByPos(Oe,pe[Oe]);this.cut(Ve-1)}};var he=function(ze){for(var pe=[],Ve=ze*$.sigma,Oe=Math.max(Math.ceil(Ve/$.bucketSize),2),_e=0;_e<Oe;++_e)pe.push(new Array($.bucketSize));var At=Math.ceil(ze/$.bucketSize),$e=Math.floor(Oe/2)-Math.floor(At/2),Fe=$e,Ue=0;if(this.size())for(var _e=0;_e<At;++_e){for(var xe=0;xe<$.bucketSize;++xe)if(pe[$e+_e][xe]=this.front(),this.popFront(),this.empty()){Fe=$e+_e,Ue=xe;break}if(this.empty())break}Ce=pe,ie=$e,ae=0,le=Fe,Ie=Ue,ue=Oe,de=ze};this.pushBack=function(ze){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]=ze},this.popBack=function(){this.empty()||(this.size()!==1&&(Ie>0?--Ie:ie<le&&(--le,Ie=$.bucketSize-1)),de>0&&--de)},this.setElementByPos=function(ze,pe){var Ve=Ne(ze),Oe=Ve.curNodeBucketIndex,_e=Ve.curNodePointerIndex;Ce[Oe][_e]=pe},this.insert=function(ze,pe,Ve){var Oe=this;if(Ve===void 0&&(Ve=1),ze===0)for(;Ve--;)this.pushFront(pe);else if(ze===this.size())for(;Ve--;)this.pushBack(pe);else{for(var _e=[],At=ze;At<de;++At)_e.push(this.getElementByPos(At));this.cut(ze-1);for(var At=0;At<Ve;++At)this.pushBack(pe);_e.forEach(function($e){return Oe.pushBack($e)})}},this.find=function(ze){if(ie===le){for(var pe=ae;pe<=Ie;++pe)if(Ce[ie][pe]===ze)return!0;return!1}for(var pe=ae;pe<$.bucketSize;++pe)if(Ce[ie][pe]===ze)return!0;for(var pe=ie+1;pe<le;++pe)for(var Ve=0;Ve<$.bucketSize;++Ve)if(Ce[pe][Ve]===ze)return!0;for(var pe=0;pe<=Ie;++pe)if(Ce[le][pe]===ze)return!0;return!1},this.reverse=function(){for(var ze=0,pe=de-1;ze<pe;){var Ve=this.getElementByPos(ze);this.setElementByPos(ze,this.getElementByPos(pe)),this.setElementByPos(pe,Ve),++ze,--pe}},this.unique=function(){if(!this.empty()){var ze=[],pe=this.front();this.forEach(function(Oe,_e){(_e===0||Oe!==pe)&&(ze.push(Oe),pe=Oe)});for(var Ve=0;Ve<de;++Ve)this.setElementByPos(Ve,ze[Ve]);this.cut(ze.length-1)}},this.sort=function(ze){var pe=[];this.forEach(function(Oe){pe.push(Oe)}),pe.sort(ze);for(var Ve=0;Ve<de;++Ve)this.setElementByPos(Ve,pe[Ve])},this.pushFront=function(ze){this.empty()||(ie===0&&ae===0&&he.call(this,this.size()),ae>0?--ae:ie>0&&(--ie,ae=$.bucketSize-1)),++de,Ce[ie][ae]=ze},this.popFront=function(){this.empty()||(this.size()!==1&&(ae<$.bucketSize-1?++ae:ie<le&&(++ie,ae=0)),de>0&&--de)},this.shrinkToFit=function(){var ze=this,pe=[];this.forEach(function(At){pe.push(At)});var Ve=pe.length;Ce=[];for(var Oe=Math.ceil(Ve/$.bucketSize),_e=0;_e<Oe;++_e)Ce.push(new Array($.bucketSize));this.clear(),pe.forEach(function(At){return ze.pushBack(At)})},this.cut=function(ze){if(ze<0){this.clear();return}var pe=Ne(ze),Ve=pe.curNodeBucketIndex,Oe=pe.curNodePointerIndex;le=Ve,Ie=Oe,de=ze+1},this[Symbol.iterator]=function(){return function(){var pe,pe,pe,ze,pe;return k(this,function(Ve){switch(Ve.label){case 0:if(de===0)return[2];if(ie!==le)return[3,5];pe=ae,Ve.label=1;case 1:return pe<=Ie?[4,Ce[ie][pe]]:[3,4];case 2:Ve.sent(),Ve.label=3;case 3:return++pe,[3,1];case 4:return[2];case 5:pe=ae,Ve.label=6;case 6:return pe<$.bucketSize?[4,Ce[ie][pe]]:[3,9];case 7:Ve.sent(),Ve.label=8;case 8:return++pe,[3,6];case 9:pe=ie+1,Ve.label=10;case 10:if(!(pe<le))return[3,15];ze=0,Ve.label=11;case 11:return ze<$.bucketSize?[4,Ce[pe][ze]]:[3,14];case 12:Ve.sent(),Ve.label=13;case 13:return++ze,[3,11];case 14:return++pe,[3,10];case 15:pe=0,Ve.label=16;case 16:return pe<=Ie?[4,Ce[le][pe]]:[3,19];case 17:Ve.sent(),Ve.label=18;case 18:return++pe,[3,16];case 19:return[2]}})}()},function(){var ze=$.bucketSize;re.size?ze=re.size():re.length&&(ze=re.length);var pe=ze*$.sigma;ue=Math.ceil(pe/$.bucketSize),ue=Math.max(ue,3);for(var Ve=0;Ve<ue;++Ve)Ce.push(new Array($.bucketSize));var Oe=Math.ceil(ze/$.bucketSize);ie=Math.floor(ue/2)-Math.floor(Oe/2),le=ie,re.forEach(function(_e){return oe.pushBack(_e)})}(),Object.freeze(this)}Object.freeze($),V.default=$},{}],27:[function(r,g,V){var k=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(pe){return function(Ve){return ze([pe,Ve])}}function ze(pe){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=pe[0]&2?ue.return:pe[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,pe[1])).done)return de;switch(ue=0,de&&(pe=[pe[0]&2,de.value]),pe[0]){case 0:case 1:de=pe;break;case 4:return le.label++,{value:pe[1],done:!1};case 5:le.label++,ue=pe[1],pe=[0];continue;case 7:pe=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(pe[0]===6||pe[0]===2)){le=0;continue}if(pe[0]===3&&(!de||pe[1]>de[0]&&pe[1]<de[3])){le.label=pe[1];break}if(pe[0]===6&&le.label<de[1]){le.label=de[1],de=pe;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(pe);break}de[2]&&le.ops.pop(),le.trys.pop();continue}pe=ae.call(ie,le)}catch(Ve){pe=[6,Ve],ue=0}finally{Ie=de=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[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(V,"__esModule",{value:!0});var re=r("../LinkList/LinkList"),oe=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(ze){var pe,Ve,Oe=0,_e="";if(typeof ze=="number")Oe=Math.floor(ze),Oe=(Oe<<5)-Oe,Oe=Oe&Oe;else{typeof ze!="string"?_e=JSON.stringify(ze):_e=ze;try{for(var At=$(_e),$e=At.next();!$e.done;$e=At.next()){var Fe=$e.value,Ue=Fe.charCodeAt(0);Oe=(Oe<<5)-Oe+Ue,Oe=Oe&Oe}}catch(xe){pe={error:xe}}finally{try{$e&&!$e.done&&(Ve=At.return)&&Ve.call(At)}finally{if(pe)throw pe.error}}}return Oe^=Oe>>>16,Oe},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(ze){var pe=0;de.forEach(function(Ve){Ve.forEach(function(Oe){ze(Oe,pe++)})})};var he=function(ze){if(!(ze>=Ce.maxSize)){Ne=ze*2;var pe=[];de.forEach(function(Ve,Oe){if(!Ve.empty()){if(Ve instanceof re.default&&Ve.size()===1){var _e=Ve.front(),At=_e.key,$e=_e.value;pe[le(At)&Ne-1]=new re.default([{key:At,value:$e}])}else if(Ve instanceof oe.default){var Fe=new re.default,Ue=new re.default;Ve.forEach(function(qe){var kt=le(qe.key);kt&ze?Ue.pushBack(qe):Fe.pushBack(qe)}),Fe.size()>Ce.untreeifyThreshold?pe[Oe]=new oe.default(Fe):Fe.size()&&(pe[Oe]=Fe),Ue.size()>Ce.untreeifyThreshold?pe[Oe+ze]=new oe.default(Ue):Ue.size()&&(pe[Oe+ze]=Ue)}else{var xe=new re.default,Dt=new re.default;Ve.forEach(function(qe){var kt=le(qe.key);kt&ze?Dt.pushBack(qe):xe.pushBack(qe)}),xe.size()&&(pe[Oe]=xe),Dt.size()&&(pe[Oe+ze]=Dt)}de[Oe].clear()}}),de=pe}};this.setElement=function(ze,pe){var Ve,Oe;if(ze==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(pe==null){this.eraseElementByKey(ze);return}var _e=le(ze)&Ne-1;if(!de[_e])++ue,de[_e]=new re.default([{key:ze,value:pe}]);else{var At=de[_e].size();if(de[_e]instanceof re.default){try{for(var $e=$(de[_e]),Fe=$e.next();!Fe.done;Fe=$e.next()){var Ue=Fe.value;if(Ue.key===ze){Ue.value=pe;return}}}catch(Dt){Ve={error:Dt}}finally{try{Fe&&!Fe.done&&(Oe=$e.return)&&Oe.call($e)}finally{if(Ve)throw Ve.error}}de[_e].pushBack({key:ze,value:pe}),de[_e].size()>=Ce.treeifyThreshold&&(de[_e]=new oe.default(de[_e]))}else de[_e].setElement(ze,pe);var xe=de[_e].size();ue+=xe-At}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.getElementByKey=function(ze){var pe,Ve,Oe=le(ze)&Ne-1;if(de[Oe]){if(de[Oe]instanceof oe.default)return de[Oe].getElementByKey(ze);try{for(var _e=$(de[Oe]),At=_e.next();!At.done;At=_e.next()){var $e=At.value;if($e.key===ze)return $e.value}}catch(Fe){pe={error:Fe}}finally{try{At&&!At.done&&(Ve=_e.return)&&Ve.call(_e)}finally{if(pe)throw pe.error}}}},this.eraseElementByKey=function(ze){var pe,Ve,Oe=le(ze)&Ne-1;if(de[Oe]){var _e=de[Oe].size();if(de[Oe]instanceof oe.default)de[Oe].eraseElementByKey(ze),de[Oe].size()<=Ce.untreeifyThreshold&&(de[Oe]=new re.default(de[Oe]));else{var At=-1;try{for(var $e=$(de[Oe]),Fe=$e.next();!Fe.done;Fe=$e.next()){var Ue=Fe.value;if(++At,Ue.key===ze){de[Oe].eraseElementByPos(At);break}}}catch(Dt){pe={error:Dt}}finally{try{Fe&&!Fe.done&&(Ve=$e.return)&&Ve.call($e)}finally{if(pe)throw pe.error}}}var xe=de[Oe].size();ue+=xe-_e}},this.find=function(ze){var pe,Ve,Oe=le(ze)&Ne-1;if(!de[Oe])return!1;if(de[Oe]instanceof oe.default)return de[Oe].find(ze);try{for(var _e=$(de[Oe]),At=_e.next();!At.done;At=_e.next()){var $e=At.value;if($e.key===ze)return!0}}catch(Fe){pe={error:Fe}}finally{try{At&&!At.done&&(Ve=_e.return)&&Ve.call(_e)}finally{if(pe)throw pe.error}}return!1},this[Symbol.iterator]=function(){return function(){var ze,pe,Ve,Oe,_e,At,$e;return k(this,function(Fe){switch(Fe.label){case 0:ze=0,Fe.label=1;case 1:if(!(ze<Ne))return[3,10];for(;ze<Ne&&!de[ze];)++ze;if(ze>=Ne)return[3,10];Fe.label=2;case 2:Fe.trys.push([2,7,8,9]),pe=(At=void 0,$(de[ze])),Ve=pe.next(),Fe.label=3;case 3:return Ve.done?[3,6]:(Oe=Ve.value,[4,Oe]);case 4:Fe.sent(),Fe.label=5;case 5:return Ve=pe.next(),[3,3];case 6:return[3,9];case 7:return _e=Fe.sent(),At={error:_e},[3,9];case 8:try{Ve&&!Ve.done&&($e=pe.return)&&$e.call(pe)}finally{if(At)throw At.error}return[7];case 9:return++ze,[3,1];case 10:return[2]}})}()},ie.forEach(function(ze){var pe=ze.key,Ve=ze.value;return Ie.setElement(pe,Ve)}),Object.freeze(this)}Object.freeze(Ce),V.default=Ce},{"../LinkList/LinkList":29,"../Map/Map":30}],28:[function(r,g,V){var k=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(pe){return function(Ve){return ze([pe,Ve])}}function ze(pe){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=pe[0]&2?ue.return:pe[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,pe[1])).done)return de;switch(ue=0,de&&(pe=[pe[0]&2,de.value]),pe[0]){case 0:case 1:de=pe;break;case 4:return le.label++,{value:pe[1],done:!1};case 5:le.label++,ue=pe[1],pe=[0];continue;case 7:pe=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(pe[0]===6||pe[0]===2)){le=0;continue}if(pe[0]===3&&(!de||pe[1]>de[0]&&pe[1]<de[3])){le.label=pe[1];break}if(pe[0]===6&&le.label<de[1]){le.label=de[1],de=pe;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(pe);break}de[2]&&le.ops.pop(),le.trys.pop();continue}pe=ae.call(ie,le)}catch(Ve){pe=[6,Ve],ue=0}finally{Ie=de=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[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(V,"__esModule",{value:!0});var re=r("../Set/Set"),oe=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(ze){var pe=0,Ve="";if(typeof ze=="number")pe=Math.floor(ze),pe=(pe<<5)-pe,pe=pe&pe;else{typeof ze!="string"?Ve=JSON.stringify(ze):Ve=ze;for(var Oe=0;Oe<Ve.length;Oe++){var _e=Ve.charCodeAt(Oe);pe=(pe<<5)-pe+_e,pe=pe&pe}}return pe^=pe>>>16,pe},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(ze){var pe=0;de.forEach(function(Ve){Ve.forEach(function(Oe){ze(Oe,pe++)})})};var he=function(ze){if(!(ze>=Ce.maxSize)){Ne=ze*2;var pe=[];de.forEach(function(Ve,Oe){if(!Ve.empty()){if(Ve instanceof oe.default&&Ve.size()===1){var _e=Ve.front();if(_e===void 0)throw new Error("unknown error");pe[le(_e)&Ne-1]=new oe.default([_e])}else if(Ve instanceof re.default){var At=new oe.default,$e=new oe.default;Ve.forEach(function(xe){var Dt=le(xe);Dt&ze?$e.pushBack(xe):At.pushBack(xe)}),At.size()>Ce.untreeifyThreshold?pe[Oe]=new re.default(At):At.size()&&(pe[Oe]=At),$e.size()>Ce.untreeifyThreshold?pe[Oe+ze]=new re.default($e):$e.size()&&(pe[Oe+ze]=$e)}else{var Fe=new oe.default,Ue=new oe.default;Ve.forEach(function(xe){var Dt=le(xe);Dt&ze?Ue.pushBack(xe):Fe.pushBack(xe)}),Fe.size()&&(pe[Oe]=Fe),Ue.size()&&(pe[Oe+ze]=Ue)}de[Oe].clear()}}),de=pe}};this.insert=function(ze){if(ze==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");var pe=le(ze)&Ne-1;if(!de[pe])de[pe]=new oe.default([ze]),++ue;else{var Ve=de[pe].size();if(de[pe]instanceof oe.default){if(de[pe].find(ze))return;de[pe].pushBack(ze),de[pe].size()>=Ce.treeifyThreshold&&(de[pe]=new re.default(de[pe]))}else de[pe].insert(ze);var Oe=de[pe].size();ue+=Oe-Ve}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.eraseElementByValue=function(ze){var pe=le(ze)&Ne-1;if(de[pe]){var Ve=de[pe].size();de[pe].eraseElementByValue(ze),de[pe]instanceof re.default&&de[pe].size()<=Ce.untreeifyThreshold&&(de[pe]=new oe.default(de[pe]));var Oe=de[pe].size();ue+=Oe-Ve}},this.find=function(ze){var pe=le(ze)&Ne-1;return de[pe]?de[pe].find(ze):!1},this[Symbol.iterator]=function(){return function(){var ze,pe,Ve,Oe,_e,At,$e;return k(this,function(Fe){switch(Fe.label){case 0:ze=0,Fe.label=1;case 1:if(!(ze<Ne))return[3,10];for(;ze<Ne&&!de[ze];)++ze;if(ze>=Ne)return[3,10];Fe.label=2;case 2:Fe.trys.push([2,7,8,9]),pe=(At=void 0,$(de[ze])),Ve=pe.next(),Fe.label=3;case 3:return Ve.done?[3,6]:(Oe=Ve.value,[4,Oe]);case 4:Fe.sent(),Fe.label=5;case 5:return Ve=pe.next(),[3,3];case 6:return[3,9];case 7:return _e=Fe.sent(),At={error:_e},[3,9];case 8:try{Ve&&!Ve.done&&($e=pe.return)&&$e.call(pe)}finally{if(At)throw At.error}return[7];case 9:return++ze,[3,1];case 10:return[2]}})}()},ie.forEach(function(ze){return Ie.insert(ze)}),Object.freeze(this)}Object.freeze(Ce),V.default=Ce},{"../LinkList/LinkList":29,"../Set/Set":33}],29:[function(r,g,V){var k=this&&this.__generator||function(oe,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(ze){return Ne([he,ze])}}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(oe,ie)}catch(ze){he=[6,ze],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(V,"__esModule",{value:!0});var $=function(){function oe(Ce){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=Ce}return oe}();function re(oe){var Ce=this;oe===void 0&&(oe=[]);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 ze=Ne.next;for(ie+=de;de--;)Ne.next=new $(ue),Ne.next.pre=Ne,Ne=Ne.next;Ne.next=ze,ze&&(ze.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 k(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]}})}()},oe.forEach(function(Ie){return Ce.pushBack(Ie)}),Object.freeze(this)}Object.freeze(re),V.default=re},{}],30:[function(r,g,V){var k=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(ze){return function(pe){return he([ze,pe])}}function he(ze){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=ze[0]&2?Ie.return:ze[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,ze[1])).done)return ue;switch(Ie=0,ue&&(ze=[ze[0]&2,ue.value]),ze[0]){case 0:case 1:ue=ze;break;case 4:return ae.label++,{value:ze[1],done:!1};case 5:ae.label++,Ie=ze[1],ze=[0];continue;case 7:ze=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(ze[0]===6||ze[0]===2)){ae=0;continue}if(ze[0]===3&&(!ue||ze[1]>ue[0]&&ze[1]<ue[3])){ae.label=ze[1];break}if(ze[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=ze;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(ze);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}ze=ie.call(Ce,ae)}catch(pe){ze=[6,pe],Ie=0}finally{le=ue=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[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(V,"__esModule",{value:!0});var re=r("../Base/TreeNode");function oe(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(xe,Dt){return xe<Dt?-1:xe>Dt?1:0};var le=0,Ie=new re.default;Ie.color=re.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(xe){if(!xe||xe.key===void 0)throw new Error("unknown error");return xe.leftChild?ue(xe.leftChild):xe},de=function(xe){if(!xe||xe.key===void 0)throw new Error("unknown error");return xe.rightChild?de(xe.rightChild):xe};this.front=function(){if(!this.empty()){var xe=ue(Ie);if(xe.key===void 0||xe.value===void 0)throw new Error("unknown error");return{key:xe.key,value:xe.value}}},this.back=function(){if(!this.empty()){var xe=de(Ie);if(xe.key===void 0||xe.value===void 0)throw new Error("unknown error");return{key:xe.key,value:xe.value}}},this.forEach=function(xe){var Dt,qe,kt=0;try{for(var jt=$(this),Pt=jt.next();!Pt.done;Pt=jt.next()){var ti=Pt.value;xe(ti,kt++)}}catch(ei){Dt={error:ei}}finally{try{Pt&&!Pt.done&&(qe=jt.return)&&qe.call(jt)}finally{if(Dt)throw Dt.error}}},this.getElementByPos=function(xe){var Dt,qe;if(xe<0||xe>=this.size())throw new Error("pos must more than 0 and less than set's size");var kt=0;try{for(var jt=$(this),Pt=jt.next();!Pt.done;Pt=jt.next()){var ti=Pt.value;if(kt===xe)return ti;++kt}}catch(ei){Dt={error:ei}}finally{try{Pt&&!Pt.done&&(qe=jt.return)&&qe.call(jt)}finally{if(Dt)throw Dt.error}}throw new Error("unknown Error")};var Ne=function(xe,Dt){if(!(!xe||xe.key===void 0||xe.value===void 0)){var qe=ie(xe.key,Dt);return qe===0?{key:xe.key,value:xe.value}:qe<0?Ne(xe.rightChild,Dt):Ne(xe.leftChild,Dt)||{key:xe.key,value:xe.value}}};this.lowerBound=function(xe){return Ne(Ie,xe)};var he=function(xe,Dt){if(!(!xe||xe.key===void 0||xe.value===void 0)){var qe=ie(xe.key,Dt);return qe<=0?he(xe.rightChild,Dt):he(xe.leftChild,Dt)||{key:xe.key,value:xe.value}}};this.upperBound=function(xe){return he(Ie,xe)};var ze=function(xe,Dt){if(!(!xe||xe.key===void 0||xe.value===void 0)){var qe=ie(xe.key,Dt);return qe===0?{key:xe.key,value:xe.value}:qe>0?ze(xe.leftChild,Dt):ze(xe.rightChild,Dt)||{key:xe.key,value:xe.value}}};this.reverseLowerBound=function(xe){return ze(Ie,xe)};var pe=function(xe,Dt){if(!(!xe||xe.key===void 0||xe.value===void 0)){var qe=ie(xe.key,Dt);return qe>=0?pe(xe.leftChild,Dt):pe(xe.rightChild,Dt)||{key:xe.key,value:xe.value}}};this.reverseUpperBound=function(xe){return pe(Ie,xe)};var Ve=function(xe){var Dt=xe.parent;if(!Dt){if(xe===Ie)return;throw new Error("unknown error")}if(xe.color===re.default.TreeNodeColorType.red){xe.color=re.default.TreeNodeColorType.black;return}var qe=xe.brother;if(!qe)throw new Error("unknown error");if(xe===Dt.leftChild){if(qe.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.black,Dt.color=re.default.TreeNodeColorType.red;var kt=Dt.rotateLeft();Ie===Dt&&(Ie=kt),Ve(xe)}else if(qe.color===re.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===re.default.TreeNodeColorType.red){qe.color=Dt.color,Dt.color=re.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=re.default.TreeNodeColorType.black);var kt=Dt.rotateLeft();Ie===Dt&&(Ie=kt),xe.color=re.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=re.default.TreeNodeColorType.black);var kt=qe.rotateRight();Ie===qe&&(Ie=kt),Ve(xe)}else(!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&(qe.color=re.default.TreeNodeColorType.red,Ve(Dt))}else if(xe===Dt.rightChild){if(qe.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.black,Dt.color=re.default.TreeNodeColorType.red;var kt=Dt.rotateRight();Ie===Dt&&(Ie=kt),Ve(xe)}else if(qe.color===re.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===re.default.TreeNodeColorType.red){qe.color=Dt.color,Dt.color=re.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=re.default.TreeNodeColorType.black);var kt=Dt.rotateRight();Ie===Dt&&(Ie=kt),xe.color=re.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=re.default.TreeNodeColorType.black);var kt=qe.rotateLeft();Ie===qe&&(Ie=kt),Ve(xe)}else(!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&(qe.color=re.default.TreeNodeColorType.red,Ve(Dt))}},Oe=function(xe){for(var Dt=xe;Dt.leftChild||Dt.rightChild;){if(Dt.rightChild){Dt=ue(Dt.rightChild);var qe=xe.key;xe.key=Dt.key,Dt.key=qe;var kt=xe.value;xe.value=Dt.value,Dt.value=kt,xe=Dt}if(Dt.leftChild){Dt=de(Dt.leftChild);var qe=xe.key;xe.key=Dt.key,Dt.key=qe;var kt=xe.value;xe.value=Dt.value,Dt.value=kt,xe=Dt}}Ve(Dt),Dt&&Dt.remove(),--le,Ie.color=re.default.TreeNodeColorType.black},_e=function(xe,Dt){if(!xe||xe.key===void 0)return!1;var qe=_e(xe.leftChild,Dt);return qe||Dt(xe)?!0:_e(xe.rightChild,Dt)};this.eraseElementByPos=function(xe){if(xe<0||xe>=le)throw new Error("pos must more than 0 and less than set's size");var Dt=0;_e(Ie,function(qe){return xe===Dt?(Oe(qe),!0):(++Dt,!1)})},this.eraseElementByKey=function(xe){if(!this.empty()){var Dt=Fe(Ie,xe);Dt===void 0||Dt.key===void 0||ie(Dt.key,xe)!==0||Oe(Dt)}};var At=function(xe,Dt){if(!xe||xe.key===void 0)throw new Error("unknown error");var qe=ie(Dt,xe.key);return qe<0?xe.leftChild?At(xe.leftChild,Dt):(xe.leftChild=new re.default,xe.leftChild.parent=xe,xe.leftChild.brother=xe.rightChild,xe.rightChild&&(xe.rightChild.brother=xe.leftChild),xe.leftChild):qe>0?xe.rightChild?At(xe.rightChild,Dt):(xe.rightChild=new re.default,xe.rightChild.parent=xe,xe.rightChild.brother=xe.leftChild,xe.leftChild&&(xe.leftChild.brother=xe.rightChild),xe.rightChild):xe},$e=function(xe){var Dt=xe.parent;if(!Dt){if(xe===Ie)return;throw new Error("unknown error")}if(Dt.color!==re.default.TreeNodeColorType.black&&Dt.color===re.default.TreeNodeColorType.red){var qe=Dt.brother,kt=Dt.parent;if(!kt)throw new Error("unknown error");if(qe&&qe.color===re.default.TreeNodeColorType.red)qe.color=Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red,$e(kt);else if(!qe||qe.color===re.default.TreeNodeColorType.black){if(Dt===kt.leftChild){if(xe===Dt.leftChild){Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red;var jt=kt.rotateRight();kt===Ie&&(Ie=jt)}else if(xe===Dt.rightChild){var jt=Dt.rotateLeft();kt===Ie&&(Ie=jt),$e(Dt)}}else if(Dt===kt.rightChild){if(xe===Dt.leftChild){var jt=Dt.rotateRight();kt===Ie&&(Ie=jt),$e(Dt)}else if(xe===Dt.rightChild){Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red;var jt=kt.rotateLeft();kt===Ie&&(Ie=jt)}}}}};this.setElement=function(xe,Dt){if(xe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(Dt==null){this.eraseElementByKey(xe);return}if(this.empty()){++le,Ie.key=xe,Ie.value=Dt,Ie.color=re.default.TreeNodeColorType.black;return}var qe=At(Ie,xe);if(qe.key!==void 0&&ie(qe.key,xe)===0){qe.value=Dt;return}++le,qe.key=xe,qe.value=Dt,$e(qe),Ie.color=re.default.TreeNodeColorType.black};var Fe=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(Dt,xe.key);return qe<0?Fe(xe.leftChild,Dt):qe>0?Fe(xe.rightChild,Dt):xe}};this.find=function(xe){return!!Fe(Ie,xe)},this.getElementByKey=function(xe){var Dt=Fe(Ie,xe);if((Dt==null?void 0:Dt.key)===void 0||(Dt==null?void 0:Dt.value)===void 0)throw new Error("unknown error");return Dt.value},this.union=function(xe){var Dt=this;xe.forEach(function(qe){var kt=qe.key,jt=qe.value;return Dt.setElement(kt,jt)})},this.getHeight=function(){if(this.empty())return 0;var xe=function(Dt){return Dt?Math.max(xe(Dt.leftChild),xe(Dt.rightChild))+1:1};return xe(Ie)};var Ue=function(xe){return k(this,function(Dt){switch(Dt.label){case 0:return!xe||xe.key===void 0||xe.value===void 0?[2]:[5,$(Ue(xe.leftChild))];case 1:return Dt.sent(),[4,{key:xe.key,value:xe.value}];case 2:return Dt.sent(),[5,$(Ue(xe.rightChild))];case 3:return Dt.sent(),[2]}})};this[Symbol.iterator]=function(){return Ue(Ie)},Ce.forEach(function(xe){var Dt=xe.key,qe=xe.value;return ae.setElement(Dt,qe)}),Object.freeze(this)}Object.freeze(oe),V.default=oe},{"../Base/TreeNode":25}],31:[function(r,g,V){Object.defineProperty(V,"__esModule",{value:!0});function k($,re){$===void 0&&($=[]),re=re||function(le,Ie){return le>Ie?-1:le<Ie?1:0};var oe=[];$.forEach(function(le){return oe.push(le)});var Ce=oe.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=oe[le];oe[le]=oe[Ie],oe[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&&re(oe[le],oe[Ie])>0&&ie(le,Ie),ue<Ce&&re(oe[le],oe[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&&re(oe[de],oe[Ne])>0&&(he=Ne),re(oe[Ie],oe[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,oe.length=0},this.push=function(le){if(oe.push(le),++Ce,Ce!==1)for(var Ie=Ce-1;Ie>0;){var ue=Math.floor((Ie-1)/2);if(re(oe[ue],le)<=0)break;ae(ue),Ie=ue}},this.pop=function(){if(!this.empty()){if(this.size()===1){--Ce;return}var le=oe[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()&&re(oe[ue],oe[de])>0&&(Ne=de),re(oe[Ne],le)>=0)break;oe[Ie]=oe[Ne],Ie=Ne}oe[Ie]=le}},this.top=function(){return oe[0]},Object.freeze(this)}Object.freeze(k),V.default=k},{}],32:[function(r,g,V){Object.defineProperty(V,"__esModule",{value:!0});var k=r("../LinkList/LinkList");function $(re){re===void 0&&(re=[]);var oe=new k.default(re);this.size=function(){return oe.size()},this.empty=function(){return oe.empty()},this.clear=function(){oe.clear()},this.push=function(Ce){oe.pushBack(Ce)},this.pop=function(){oe.popFront()},this.front=function(){return oe.front()},Object.freeze(this)}Object.freeze($),V.default=$},{"../LinkList/LinkList":29}],33:[function(r,g,V){var k=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(ze){return function(pe){return he([ze,pe])}}function he(ze){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=ze[0]&2?Ie.return:ze[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,ze[1])).done)return ue;switch(Ie=0,ue&&(ze=[ze[0]&2,ue.value]),ze[0]){case 0:case 1:ue=ze;break;case 4:return ae.label++,{value:ze[1],done:!1};case 5:ae.label++,Ie=ze[1],ze=[0];continue;case 7:ze=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(ze[0]===6||ze[0]===2)){ae=0;continue}if(ze[0]===3&&(!ue||ze[1]>ue[0]&&ze[1]<ue[3])){ae.label=ze[1];break}if(ze[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=ze;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(ze);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}ze=ie.call(Ce,ae)}catch(pe){ze=[6,pe],Ie=0}finally{le=ue=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[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(V,"__esModule",{value:!0});var re=r("../Base/TreeNode");function oe(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(xe,Dt){return xe<Dt?-1:xe>Dt?1:0};var le=0,Ie=new re.default;Ie.color=re.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=re.default.TreeNodeColorType.black};var ue=function(xe){if(!xe||xe.key===void 0)throw new Error("unknown error");return xe.leftChild?ue(xe.leftChild):xe},de=function(xe){if(!xe||xe.key===void 0)throw new Error("unknown error");return xe.rightChild?de(xe.rightChild):xe};this.front=function(){if(!this.empty()){var xe=ue(Ie);return xe.key}},this.back=function(){if(!this.empty()){var xe=de(Ie);return xe.key}},this.forEach=function(xe){var Dt,qe,kt=0;try{for(var jt=$(this),Pt=jt.next();!Pt.done;Pt=jt.next()){var ti=Pt.value;xe(ti,kt++)}}catch(ei){Dt={error:ei}}finally{try{Pt&&!Pt.done&&(qe=jt.return)&&qe.call(jt)}finally{if(Dt)throw Dt.error}}},this.getElementByPos=function(xe){var Dt,qe;if(xe<0||xe>=this.size())throw new Error("pos must more than 0 and less than set's size");var kt=0;try{for(var jt=$(this),Pt=jt.next();!Pt.done;Pt=jt.next()){var ti=Pt.value;if(kt===xe)return ti;++kt}}catch(ei){Dt={error:ei}}finally{try{Pt&&!Pt.done&&(qe=jt.return)&&qe.call(jt)}finally{if(Dt)throw Dt.error}}throw new Error("unknown error")};var Ne=function(xe){var Dt=xe.parent;if(!Dt){if(xe===Ie)return;throw new Error("unknown error")}if(xe.color===re.default.TreeNodeColorType.red){xe.color=re.default.TreeNodeColorType.black;return}var qe=xe.brother;if(!qe)throw new Error("unknown error");if(xe===Dt.leftChild){if(qe.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.black,Dt.color=re.default.TreeNodeColorType.red;var kt=Dt.rotateLeft();Ie===Dt&&(Ie=kt),Ne(xe)}else if(qe.color===re.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===re.default.TreeNodeColorType.red){qe.color=Dt.color,Dt.color=re.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=re.default.TreeNodeColorType.black);var kt=Dt.rotateLeft();Ie===Dt&&(Ie=kt),xe.color=re.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=re.default.TreeNodeColorType.black);var kt=qe.rotateRight();Ie===qe&&(Ie=kt),Ne(xe)}else(!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&(qe.color=re.default.TreeNodeColorType.red,Ne(Dt))}else if(xe===Dt.rightChild){if(qe.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.black,Dt.color=re.default.TreeNodeColorType.red;var kt=Dt.rotateRight();Ie===Dt&&(Ie=kt),Ne(xe)}else if(qe.color===re.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===re.default.TreeNodeColorType.red){qe.color=Dt.color,Dt.color=re.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=re.default.TreeNodeColorType.black);var kt=Dt.rotateRight();Ie===Dt&&(Ie=kt),xe.color=re.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===re.default.TreeNodeColorType.red){qe.color=re.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=re.default.TreeNodeColorType.black);var kt=qe.rotateLeft();Ie===qe&&(Ie=kt),Ne(xe)}else(!qe.leftChild||qe.leftChild.color===re.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===re.default.TreeNodeColorType.black)&&(qe.color=re.default.TreeNodeColorType.red,Ne(Dt))}},he=function(xe){for(var Dt=xe;Dt.leftChild||Dt.rightChild;){if(Dt.rightChild){Dt=ue(Dt.rightChild);var qe=xe.key;xe.key=Dt.key,Dt.key=qe,xe=Dt}if(Dt.leftChild){Dt=de(Dt.leftChild);var qe=xe.key;xe.key=Dt.key,Dt.key=qe,xe=Dt}}Ne(Dt),Dt&&Dt.remove(),--le,Ie.color=re.default.TreeNodeColorType.black},ze=function(xe,Dt){if(!xe||xe.key===void 0)return!1;var qe=ze(xe.leftChild,Dt);return qe||Dt(xe)?!0:ze(xe.rightChild,Dt)};this.eraseElementByPos=function(xe){if(xe<0||xe>=le)throw new Error("pos must more than 0 and less than set's size");var Dt=0;ze(Ie,function(qe){return xe===Dt?(he(qe),!0):(++Dt,!1)})},this.eraseElementByValue=function(xe){if(!this.empty()){var Dt=Oe(Ie,xe);Dt===void 0||Dt.key===void 0||ie(Dt.key,xe)!==0||he(Dt)}};var pe=function(xe,Dt){if(!xe||xe.key===void 0)throw new Error("unknown error");var qe=ie(Dt,xe.key);return qe<0?xe.leftChild?pe(xe.leftChild,Dt):(xe.leftChild=new re.default,xe.leftChild.parent=xe,xe.leftChild.brother=xe.rightChild,xe.rightChild&&(xe.rightChild.brother=xe.leftChild),xe.leftChild):qe>0?xe.rightChild?pe(xe.rightChild,Dt):(xe.rightChild=new re.default,xe.rightChild.parent=xe,xe.rightChild.brother=xe.leftChild,xe.leftChild&&(xe.leftChild.brother=xe.rightChild),xe.rightChild):xe},Ve=function(xe){var Dt=xe.parent;if(!Dt){if(xe===Ie)return;throw new Error("unknown error")}if(Dt.color!==re.default.TreeNodeColorType.black&&Dt.color===re.default.TreeNodeColorType.red){var qe=Dt.brother,kt=Dt.parent;if(!kt)throw new Error("unknown error");if(qe&&qe.color===re.default.TreeNodeColorType.red)qe.color=Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red,Ve(kt);else if(!qe||qe.color===re.default.TreeNodeColorType.black){if(Dt===kt.leftChild){if(xe===Dt.leftChild){Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red;var jt=kt.rotateRight();kt===Ie&&(Ie=jt)}else if(xe===Dt.rightChild){var jt=Dt.rotateLeft();kt===Ie&&(Ie=jt),Ve(Dt)}}else if(Dt===kt.rightChild){if(xe===Dt.leftChild){var jt=Dt.rotateRight();kt===Ie&&(Ie=jt),Ve(Dt)}else if(xe===Dt.rightChild){Dt.color=re.default.TreeNodeColorType.black,kt.color=re.default.TreeNodeColorType.red;var jt=kt.rotateLeft();kt===Ie&&(Ie=jt)}}}}};this.insert=function(xe){if(xe==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=xe,Ie.color=re.default.TreeNodeColorType.black;return}var Dt=pe(Ie,xe);Dt.key!==void 0&&ie(Dt.key,xe)===0||(++le,Dt.key=xe,Ve(Dt),Ie.color=re.default.TreeNodeColorType.black)};var Oe=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(Dt,xe.key);return qe<0?Oe(xe.leftChild,Dt):qe>0?Oe(xe.rightChild,Dt):xe}};this.find=function(xe){var Dt=Oe(Ie,xe);return Dt!==void 0&&Dt.key!==void 0&&ie(Dt.key,xe)===0};var _e=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(xe.key,Dt);if(qe===0)return xe.key;if(qe<0)return _e(xe.rightChild,Dt);var kt=_e(xe.leftChild,Dt);return kt!==void 0?kt:xe.key}};this.lowerBound=function(xe){return _e(Ie,xe)};var At=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(xe.key,Dt);if(qe<=0)return At(xe.rightChild,Dt);var kt=At(xe.leftChild,Dt);return kt!==void 0?kt:xe.key}};this.upperBound=function(xe){return At(Ie,xe)};var $e=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(xe.key,Dt);if(qe===0)return xe.key;if(qe>0)return $e(xe.leftChild,Dt);var kt=$e(xe.rightChild,Dt);return kt!==void 0?kt:xe.key}};this.reverseLowerBound=function(xe){return $e(Ie,xe)};var Fe=function(xe,Dt){if(!(!xe||xe.key===void 0)){var qe=ie(xe.key,Dt);if(qe>=0)return Fe(xe.leftChild,Dt);var kt=Fe(xe.rightChild,Dt);return kt!==void 0?kt:xe.key}};this.reverseUpperBound=function(xe){return Fe(Ie,xe)},this.union=function(xe){var Dt=this;xe.forEach(function(qe){return Dt.insert(qe)})},this.getHeight=function(){if(this.empty())return 0;var xe=function(Dt){return Dt?Math.max(xe(Dt.leftChild),xe(Dt.rightChild))+1:1};return xe(Ie)};var Ue=function(xe){return k(this,function(Dt){switch(Dt.label){case 0:return!xe||xe.key===void 0?[2]:[5,$(Ue(xe.leftChild))];case 1:return Dt.sent(),[4,xe.key];case 2:return Dt.sent(),[5,$(Ue(xe.rightChild))];case 3:return Dt.sent(),[2]}})};this[Symbol.iterator]=function(){return Ue(Ie)},Ce.forEach(function(xe){return ae.insert(xe)}),Object.freeze(this)}Object.freeze(oe),V.default=oe},{"../Base/TreeNode":25}],34:[function(r,g,V){Object.defineProperty(V,"__esModule",{value:!0});function k($){var re=this;$===void 0&&($=[]);var oe=0,Ce=[];this.size=function(){return oe},this.empty=function(){return oe===0},this.clear=function(){oe=0,Ce.length=0},this.push=function(ie){Ce.push(ie),++oe},this.pop=function(){Ce.pop(),oe>0&&--oe},this.top=function(){return Ce[oe-1]},$.forEach(function(ie){return re.push(ie)}),Object.freeze(this)}Object.freeze(k),V.default=k},{}],35:[function(r,g,V){var k=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(pe){return function(Ve){return ze([pe,Ve])}}function ze(pe){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=pe[0]&2?ue.return:pe[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,pe[1])).done)return de;switch(ue=0,de&&(pe=[pe[0]&2,de.value]),pe[0]){case 0:case 1:de=pe;break;case 4:return le.label++,{value:pe[1],done:!1};case 5:le.label++,ue=pe[1],pe=[0];continue;case 7:pe=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(pe[0]===6||pe[0]===2)){le=0;continue}if(pe[0]===3&&(!de||pe[1]>de[0]&&pe[1]<de[3])){le.label=pe[1];break}if(pe[0]===6&&le.label<de[1]){le.label=de[1],de=pe;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(pe);break}de[2]&&le.ops.pop(),le.trys.pop();continue}pe=ae.call(ie,le)}catch(Ve){pe=[6,Ve],ue=0}finally{Ie=de=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[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},re=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))},oe=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(V,"__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,ze){Ie[ze]=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,re([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,ze){(ze===0||he!==ue)&&(de.push(he),ue=he)}),de.forEach(function(he,ze){Ie[ze]=he});for(var Ne=de.length;le>Ne;)this.popBack()},this.sort=function(ue){Ie.sort(ue)},this[Symbol.iterator]=function(){return function(){return k(this,function(ue){switch(ue.label){case 0:return[5,oe(Ie)];case 1:return[2,ue.sent()]}})}()},ie.forEach(function(ue){return ae.pushBack(ue)}),Object.freeze(this)}Object.freeze(Ce),V.default=Ce},{}],36:[function(r,g,V){Object.defineProperty(V,"__esModule",{value:!0}),V.HashMap=V.HashSet=V.Map=V.Set=V.PriorityQueue=V.Deque=V.LinkList=V.Queue=V.Stack=V.Vector=void 0;var k=r("./Vector/Vector");V.Vector=k.default;var $=r("./Stack/Stack");V.Stack=$.default;var re=r("./Queue/Queue");V.Queue=re.default;var oe=r("./LinkList/LinkList");V.LinkList=oe.default;var Ce=r("./Deque/Deque");V.Deque=Ce.default;var ie=r("./PriorityQueue/PriorityQueue");V.PriorityQueue=ie.default;var ae=r("./Set/Set");V.Set=ae.default;var le=r("./Map/Map");V.Map=le.default;var Ie=r("./HashSet/HashSet");V.HashSet=Ie.default;var ue=r("./HashMap/HashMap");V.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,V){const k=r("yallist"),$=Symbol("max"),re=Symbol("length"),oe=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(Fe){if(typeof Fe=="number"&&(Fe={max:Fe}),Fe||(Fe={}),Fe.max&&(typeof Fe.max!="number"||Fe.max<0))throw new TypeError("max must be a non-negative number");this[$]=Fe.max||1/0;const Ue=Fe.length||Ne;if(this[oe]=typeof Ue!="function"?Ne:Ue,this[Ce]=Fe.stale||!1,Fe.maxAge&&typeof Fe.maxAge!="number")throw new TypeError("maxAge must be a number");this[ie]=Fe.maxAge||0,this[ae]=Fe.dispose,this[le]=Fe.noDisposeOnSet||!1,this[de]=Fe.updateAgeOnGet||!1,this.reset()}set max(Fe){if(typeof Fe!="number"||Fe<0)throw new TypeError("max must be a non-negative number");this[$]=Fe||1/0,Ve(this)}get max(){return this[$]}set allowStale(Fe){this[Ce]=!!Fe}get allowStale(){return this[Ce]}set maxAge(Fe){if(typeof Fe!="number")throw new TypeError("maxAge must be a non-negative number");this[ie]=Fe,Ve(this)}get maxAge(){return this[ie]}set lengthCalculator(Fe){typeof Fe!="function"&&(Fe=Ne),Fe!==this[oe]&&(this[oe]=Fe,this[re]=0,this[Ie].forEach(Ue=>{Ue.length=this[oe](Ue.value,Ue.key),this[re]+=Ue.length})),Ve(this)}get lengthCalculator(){return this[oe]}get length(){return this[re]}get itemCount(){return this[Ie].length}rforEach(Fe,Ue){Ue=Ue||this;for(let xe=this[Ie].tail;xe!==null;){const Dt=xe.prev;At(this,Fe,xe,Ue),xe=Dt}}forEach(Fe,Ue){Ue=Ue||this;for(let xe=this[Ie].head;xe!==null;){const Dt=xe.next;At(this,Fe,xe,Ue),xe=Dt}}keys(){return this[Ie].toArray().map(Fe=>Fe.key)}values(){return this[Ie].toArray().map(Fe=>Fe.value)}reset(){this[ae]&&this[Ie]&&this[Ie].length&&this[Ie].forEach(Fe=>this[ae](Fe.key,Fe.value)),this[ue]=new Map,this[Ie]=new k,this[re]=0}dump(){return this[Ie].map(Fe=>pe(this,Fe)?!1:{k:Fe.key,v:Fe.value,e:Fe.now+(Fe.maxAge||0)}).toArray().filter(Fe=>Fe)}dumpLru(){return this[Ie]}set(Fe,Ue,xe){if(xe=xe||this[ie],xe&&typeof xe!="number")throw new TypeError("maxAge must be a number");const Dt=xe?Date.now():0,qe=this[oe](Ue,Fe);if(this[ue].has(Fe)){if(qe>this[$])return Oe(this,this[ue].get(Fe)),!1;const Pt=this[ue].get(Fe).value;return this[ae]&&(this[le]||this[ae](Fe,Pt.value)),Pt.now=Dt,Pt.maxAge=xe,Pt.value=Ue,this[re]+=qe-Pt.length,Pt.length=qe,this.get(Fe),Ve(this),!0}const kt=new _e(Fe,Ue,qe,Dt,xe);return kt.length>this[$]?(this[ae]&&this[ae](Fe,Ue),!1):(this[re]+=kt.length,this[Ie].unshift(kt),this[ue].set(Fe,this[Ie].head),Ve(this),!0)}has(Fe){if(!this[ue].has(Fe))return!1;const Ue=this[ue].get(Fe).value;return!pe(this,Ue)}get(Fe){return ze(this,Fe,!0)}peek(Fe){return ze(this,Fe,!1)}pop(){const Fe=this[Ie].tail;return Fe?(Oe(this,Fe),Fe.value):null}del(Fe){Oe(this,this[ue].get(Fe))}load(Fe){this.reset();const Ue=Date.now();for(let xe=Fe.length-1;xe>=0;xe--){const Dt=Fe[xe],qe=Dt.e||0;if(qe===0)this.set(Dt.k,Dt.v);else{const kt=qe-Ue;kt>0&&this.set(Dt.k,Dt.v,kt)}}}prune(){this[ue].forEach((Fe,Ue)=>ze(this,Ue,!1))}}const ze=($e,Fe,Ue)=>{const xe=$e[ue].get(Fe);if(xe){const Dt=xe.value;if(pe($e,Dt)){if(Oe($e,xe),!$e[Ce])return}else Ue&&($e[de]&&(xe.value.now=Date.now()),$e[Ie].unshiftNode(xe));return Dt.value}},pe=($e,Fe)=>{if(!Fe||!Fe.maxAge&&!$e[ie])return!1;const Ue=Date.now()-Fe.now;return Fe.maxAge?Ue>Fe.maxAge:$e[ie]&&Ue>$e[ie]},Ve=$e=>{if($e[re]>$e[$])for(let Fe=$e[Ie].tail;$e[re]>$e[$]&&Fe!==null;){const Ue=Fe.prev;Oe($e,Fe),Fe=Ue}},Oe=($e,Fe)=>{if(Fe){const Ue=Fe.value;$e[ae]&&$e[ae](Ue.key,Ue.value),$e[re]-=Ue.length,$e[ue].delete(Ue.key),$e[Ie].removeNode(Fe)}};class _e{constructor(Fe,Ue,xe,Dt,qe){this.key=Fe,this.value=Ue,this.length=xe,this.now=Dt,this.maxAge=qe||0}}const At=($e,Fe,Ue,xe)=>{let Dt=Ue.value;pe($e,Dt)&&(Oe($e,Ue),$e[Ce]||(Dt=void 0)),Dt&&Fe.call(xe,Dt.value,Dt.key,$e)};g.exports=he},{yallist:83}],38:[function(r,g,V){(function(k){(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 oe in $.types){const Ce=$.types[oe];$.codes[Ce]=oe}$.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=k.from([$.SESSIONPRESENT_MASK]),$.CONNACK_HEADER=k.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=k.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 oe in $.properties){const Ce=$.properties[oe];$.propertiesCodes[Ce]=oe}$.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 re(oe){return[0,1,2].map(Ce=>[0,1].map(ie=>[0,1].map(ae=>{const le=k.alloc(1);return le.writeUInt8($.codes[oe]<<$.CMD_SHIFT|(ie?$.DUP_MASK:0)|Ce<<$.QOS_SHIFT|ae,0,!0),le})))}$.PUBLISH_HEADER=re("publish"),$.SUBSCRIBE_HEADER=re("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=re("unsubscribe"),$.ACKS={unsuback:re("unsuback"),puback:re("puback"),pubcomp:re("pubcomp"),pubrel:re("pubrel"),pubrec:re("pubrec")},$.SUBACK_HEADER=k.from([$.codes.suback<<$.CMD_SHIFT]),$.VERSION3=k.from([3]),$.VERSION4=k.from([4]),$.VERSION5=k.from([5]),$.VERSION131=k.from([131]),$.VERSION132=k.from([132]),$.QOS=[0,1,2].map(oe=>k.from([oe])),$.EMPTY={pingreq:k.from([$.codes.pingreq<<4,0]),pingresp:k.from([$.codes.pingresp<<4,0]),disconnect:k.from([$.codes.disconnect<<4,0])}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],39:[function(r,g,V){(function(k){(function(){const $=r("./writeToStream"),re=r("events");function oe(ie,ae){const le=new Ce;return $(ie,le,ae),le.concat()}class Ce extends re{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]=k.byteLength(Ie[de]),ae+=le[de];const Ne=k.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=oe}).call(this)}).call(this,r("buffer").Buffer)},{"./writeToStream":44,buffer:17,events:22}],40:[function(r,g,V){V.parser=r("./parser").parser,V.generate=r("./generate"),V.writeToStream=r("./writeToStream")},{"./generate":39,"./parser":43,"./writeToStream":44}],41:[function(r,g,V){(function(k){(function(){const re={},oe=k.isBuffer(k.from([1,2]).subarray(0,1));function Ce(Ie){const ue=k.allocUnsafe(2);return ue.writeUInt8(Ie>>8,0),ue.writeUInt8(Ie&255,0+1),ue}function ie(){for(let Ie=0;Ie<65536;Ie++)re[Ie]=Ce(Ie)}function ae(Ie){let de=0,Ne=0;const he=k.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),oe?he.subarray(0,Ne):he.slice(0,Ne)}function le(Ie){const ue=k.allocUnsafe(4);return ue.writeUInt32BE(Ie,0),ue}g.exports={cache:re,generateCache:ie,generateNumber:Ce,genBufVariableByteInt:ae,generate4ByteBuffer:le}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],42:[function(r,g,V){class k{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}g.exports=k},{}],43:[function(r,g,V){const k=r("bl"),$=r("events"),re=r("./packet"),oe=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 re,this.error=null,this._list=k(),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=oe.types[le>>oe.CMD_SHIFT],this.packet.retain=(le&oe.RETAIN_MASK)!==0,this.packet.qos=le>>oe.QOS_SHIFT&oe.QOS_MASK,this.packet.dup=(le&oe.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,ze=this._parseString();if(ze===null)return this._emitError(new Error("Cannot parse protocolId"));if(ze!=="MQTT"&&ze!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(he.protocolId=ze,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)&oe.USERNAME_MASK,Ne.password=this._list.readUInt8(this._pos)&oe.PASSWORD_MASK,Ne.will=this._list.readUInt8(this._pos)&oe.WILL_FLAG_MASK,Ne.will&&(he.will={},he.will.retain=(this._list.readUInt8(this._pos)&oe.WILL_RETAIN_MASK)!==0,he.will.qos=(this._list.readUInt8(this._pos)&oe.WILL_QOS_MASK)>>oe.WILL_QOS_SHIFT),he.clean=(this._list.readUInt8(this._pos)&oe.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 Ve=this._parseProperties();Object.getOwnPropertyNames(Ve).length&&(he.properties=Ve)}const pe=this._parseString();if(pe===null)return this._emitError(new Error("Packet too short"));if(he.clientId=pe,Ce("_parseConnect: packet.clientId: %s",he.clientId),Ne.will){if(he.protocolVersion===5){const Ve=this._parseProperties();Object.getOwnPropertyNames(Ve).length&&(he.will.properties=Ve)}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++)&oe.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,ze,pe;if(le.qos!==1)return this._emitError(new Error("Wrong subscribe header"));if(le.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Ve=this._parseProperties();Object.getOwnPropertyNames(Ve).length&&(le.properties=Ve)}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&oe.SUBSCRIBE_OPTIONS_QOS_MASK,ze=(ue>>oe.SUBSCRIBE_OPTIONS_NL_SHIFT&oe.SUBSCRIBE_OPTIONS_NL_MASK)!==0,he=(ue>>oe.SUBSCRIBE_OPTIONS_RAP_SHIFT&oe.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,Ne=ue>>oe.SUBSCRIBE_OPTIONS_RH_SHIFT&oe.SUBSCRIBE_OPTIONS_RH_MASK,pe={topic:Ie,qos:de},this.settings.protocolVersion===5?(pe.nl=ze,pe.rap=he,pe.rh=Ne):this.settings.bridgeMode&&(pe.rh=0,pe.rap=!0,pe.nl=!0),Ce("_parseSubscribe: push subscription `%s` to subscription",pe),le.subscriptions.push(pe)}}}_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,ze;const pe=this._pos?this._pos:0;for(;ue<Ie&&pe+ue<this._list.length;){if(ze=this._list.readUInt8(pe+ue++),Ne+=de*(ze&oe.VARBYTEINT_MASK),de*=128,!(ze&oe.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")),pe&&(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=oe.propertiesCodes[Ne];if(!he)return this._emitError(new Error("Unknown property")),!1;if(he==="userProperties"){de[he]||(de[he]=Object.create(null));const ze=this._parseByType(oe.propertiesTypes[he]);if(de[he][ze.name])if(Array.isArray(de[he][ze.name]))de[he][ze.name].push(ze.value);else{const pe=de[he][ze.name];de[he][ze.name]=[pe],de[he][ze.name].push(ze.value)}else de[he][ze.name]=ze.value;continue}de[he]?Array.isArray(de[he])?de[he].push(this._parseByType(oe.propertiesTypes[he])):(de[he]=[de[he]],de[he].push(this._parseByType(oe.propertiesTypes[he]))):de[he]=this._parseByType(oe.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 re,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,V){(function(k){(function(){const $=r("./constants"),re=k.allocUnsafe(0),oe=k.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,ze=!0;function pe(Ii,ai,pi){switch(ae("generate called"),ai.cork&&(ai.cork(),ie(Ve,ai)),ze&&(ze=!1,ue()),ae("generate: packet.cmd: %s",Ii.cmd),Ii.cmd){case"connect":return Oe(Ii,ai);case"connack":return _e(Ii,ai,pi);case"publish":return At(Ii,ai,pi);case"puback":case"pubrec":case"pubrel":case"pubcomp":return $e(Ii,ai,pi);case"subscribe":return Fe(Ii,ai,pi);case"suback":return Ue(Ii,ai,pi);case"unsubscribe":return xe(Ii,ai,pi);case"unsuback":return Dt(Ii,ai,pi);case"pingreq":case"pingresp":return qe(Ii,ai);case"disconnect":return kt(Ii,ai,pi);case"auth":return jt(Ii,ai,pi);default:return ai.emit("error",new Error("Unknown command")),!1}}Object.defineProperty(pe,"cacheNumbers",{get(){return he===ni},set(Ii){Ii?((!le||Object.keys(le).length===0)&&(ze=!0),he=ni):(ze=!1,he=ri)}});function Ve(Ii){Ii.uncork()}function Oe(Ii,ai,pi){const Ni=Ii||{},di=Ni.protocolId||"MQTT";let fi=Ni.protocolVersion||4;const vi=Ni.will;let bi=Ni.clean;const si=Ni.keepalive||0,wi=Ni.clientId||"",oi=Ni.username,Lt=Ni.password,ii=Ni.properties;bi===void 0&&(bi=!0);let gi=0;if(!di||typeof di!="string"&&!k.isBuffer(di))return ai.emit("error",new Error("Invalid protocolId")),!1;if(gi+=di.length+2,fi!==3&&fi!==4&&fi!==5)return ai.emit("error",new Error("Invalid protocol version")),!1;if(gi+=1,(typeof wi=="string"||k.isBuffer(wi))&&(wi||fi>=4)&&(wi||bi))gi+=k.byteLength(wi)+2;else{if(fi<4)return ai.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(bi*1===0)return ai.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 ai.emit("error",new Error("Invalid keepalive")),!1;if(gi+=2,gi+=1,fi===5){var hi=li(ai,ii);if(!hi)return!1;gi+=hi.length}if(vi){if(typeof vi!="object")return ai.emit("error",new Error("Invalid will")),!1;if(!vi.topic||typeof vi.topic!="string")return ai.emit("error",new Error("Invalid will topic")),!1;if(gi+=k.byteLength(vi.topic)+2,gi+=2,vi.payload)if(vi.payload.length>=0)typeof vi.payload=="string"?gi+=k.byteLength(vi.payload):gi+=vi.payload.length;else return ai.emit("error",new Error("Invalid will payload")),!1;var mi={};if(fi===5){if(mi=li(ai,vi.properties),!mi)return!1;gi+=mi.length}}let Si=!1;if(oi!=null)if(Ai(oi))Si=!0,gi+=k.byteLength(oi)+2;else return ai.emit("error",new Error("Invalid username")),!1;if(Lt!=null){if(!Si)return ai.emit("error",new Error("Username is required to use password")),!1;if(Ai(Lt))gi+=zi(Lt)+2;else return ai.emit("error",new Error("Invalid password")),!1}ai.write($.CONNECT_HEADER),ti(ai,gi),Ci(ai,di),Ni.bridgeMode&&(fi+=128),ai.write(fi===131?$.VERSION131:fi===132?$.VERSION132:fi===4?$.VERSION4:fi===5?$.VERSION5:$.VERSION3);let xi=0;return xi|=oi!=null?$.USERNAME_MASK:0,xi|=Lt!=null?$.PASSWORD_MASK:0,xi|=vi&&vi.retain?$.WILL_RETAIN_MASK:0,xi|=vi&&vi.qos?vi.qos<<$.WILL_QOS_SHIFT:0,xi|=vi?$.WILL_FLAG_MASK:0,xi|=bi?$.CLEAN_SESSION_MASK:0,ai.write(k.from([xi])),he(ai,si),fi===5&&hi.write(),Ci(ai,wi),vi&&(fi===5&&mi.write(),ei(ai,vi.topic),Ci(ai,vi.payload)),oi!=null&&Ci(ai,oi),Lt!=null&&Ci(ai,Lt),!0}function _e(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=Ni===5?di.reasonCode:di.returnCode,vi=di.properties;let bi=2;if(typeof fi!="number")return ai.emit("error",new Error("Invalid return code")),!1;let si=null;if(Ni===5){if(si=li(ai,vi),!si)return!1;bi+=si.length}return ai.write($.CONNACK_HEADER),ti(ai,bi),ai.write(di.sessionPresent?$.SESSIONPRESENT_HEADER:oe),ai.write(k.from([fi])),si!=null&&si.write(),!0}function At(Ii,ai,pi){ae("publish: packet: %o",Ii);const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.qos||0,vi=di.retain?$.RETAIN_MASK:0,bi=di.topic,si=di.payload||re,wi=di.messageId,oi=di.properties;let Lt=0;if(typeof bi=="string")Lt+=k.byteLength(bi)+2;else if(k.isBuffer(bi))Lt+=bi.length+2;else return ai.emit("error",new Error("Invalid topic")),!1;if(k.isBuffer(si)?Lt+=si.length:Lt+=k.byteLength(si),fi&&typeof wi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;fi&&(Lt+=2);let ii=null;if(Ni===5){if(ii=li(ai,oi),!ii)return!1;Lt+=ii.length}return ai.write($.PUBLISH_HEADER[fi][di.dup?1:0][vi?1:0]),ti(ai,Lt),he(ai,zi(bi)),ai.write(bi),fi>0&&he(ai,wi),ii!=null&&ii.write(),ae("publish: payload: %o",si),ai.write(si)}function $e(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.cmd||"puback",vi=di.messageId,bi=di.dup&&fi==="pubrel"?$.DUP_MASK:0;let si=0;const wi=di.reasonCode,oi=di.properties;let Lt=Ni===5?3:2;if(fi==="pubrel"&&(si=1),typeof vi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;let ii=null;if(Ni===5&&typeof oi=="object"){if(ii=ui(ai,oi,pi,Lt),!ii)return!1;Lt+=ii.length}return ai.write($.ACKS[fi][si][bi][0]),ti(ai,Lt),he(ai,vi),Ni===5&&ai.write(k.from([wi])),ii!==null&&ii.write(),!0}function Fe(Ii,ai,pi){ae("subscribe: packet: ");const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.dup?$.DUP_MASK:0,vi=di.messageId,bi=di.subscriptions,si=di.properties;let wi=0;if(typeof vi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;wi+=2;let oi=null;if(Ni===5){if(oi=li(ai,si),!oi)return!1;wi+=oi.length}if(typeof bi=="object"&&bi.length)for(let ii=0;ii<bi.length;ii+=1){const gi=bi[ii].topic,hi=bi[ii].qos;if(typeof gi!="string")return ai.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if(typeof hi!="number")return ai.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(Ni===5){if(typeof(bi[ii].nl||!1)!="boolean")return ai.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(bi[ii].rap||!1)!="boolean")return ai.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;const xi=bi[ii].rh||0;if(typeof xi!="number"||xi>2)return ai.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}wi+=k.byteLength(gi)+2+1}else return ai.emit("error",new Error("Invalid subscriptions")),!1;ae("subscribe: writing to stream: %o",$.SUBSCRIBE_HEADER),ai.write($.SUBSCRIBE_HEADER[1][fi?1:0][0]),ti(ai,wi),he(ai,vi),oi!==null&&oi.write();let Lt=!0;for(const ii of bi){const gi=ii.topic,hi=ii.qos,mi=+ii.nl,Si=+ii.rap,xi=ii.rh;let Gi;ei(ai,gi),Gi=$.SUBSCRIBE_OPTIONS_QOS[hi],Ni===5&&(Gi|=mi?$.SUBSCRIBE_OPTIONS_NL:0,Gi|=Si?$.SUBSCRIBE_OPTIONS_RAP:0,Gi|=xi?$.SUBSCRIBE_OPTIONS_RH[xi]:0),Lt=ai.write(k.from([Gi]))}return Lt}function Ue(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.messageId,vi=di.granted,bi=di.properties;let si=0;if(typeof fi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;if(si+=2,typeof vi=="object"&&vi.length)for(let oi=0;oi<vi.length;oi+=1){if(typeof vi[oi]!="number")return ai.emit("error",new Error("Invalid qos vector")),!1;si+=1}else return ai.emit("error",new Error("Invalid qos vector")),!1;let wi=null;if(Ni===5){if(wi=ui(ai,bi,pi,si),!wi)return!1;si+=wi.length}return ai.write($.SUBACK_HEADER),ti(ai,si),he(ai,fi),wi!==null&&wi.write(),ai.write(k.from(vi))}function xe(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.messageId,vi=di.dup?$.DUP_MASK:0,bi=di.unsubscriptions,si=di.properties;let wi=0;if(typeof fi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;if(wi+=2,typeof bi=="object"&&bi.length)for(let ii=0;ii<bi.length;ii+=1){if(typeof bi[ii]!="string")return ai.emit("error",new Error("Invalid unsubscriptions")),!1;wi+=k.byteLength(bi[ii])+2}else return ai.emit("error",new Error("Invalid unsubscriptions")),!1;let oi=null;if(Ni===5){if(oi=li(ai,si),!oi)return!1;wi+=oi.length}ai.write($.UNSUBSCRIBE_HEADER[1][vi?1:0][0]),ti(ai,wi),he(ai,fi),oi!==null&&oi.write();let Lt=!0;for(let ii=0;ii<bi.length;ii++)Lt=ei(ai,bi[ii]);return Lt}function Dt(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.messageId,vi=di.dup?$.DUP_MASK:0,bi=di.granted,si=di.properties,wi=di.cmd,oi=0;let Lt=2;if(typeof fi!="number")return ai.emit("error",new Error("Invalid messageId")),!1;if(Ni===5)if(typeof bi=="object"&&bi.length)for(let gi=0;gi<bi.length;gi+=1){if(typeof bi[gi]!="number")return ai.emit("error",new Error("Invalid qos vector")),!1;Lt+=1}else return ai.emit("error",new Error("Invalid qos vector")),!1;let ii=null;if(Ni===5){if(ii=ui(ai,si,pi,Lt),!ii)return!1;Lt+=ii.length}return ai.write($.ACKS[wi][oi][vi][0]),ti(ai,Lt),he(ai,fi),ii!==null&&ii.write(),Ni===5&&ai.write(k.from(bi)),!0}function qe(Ii,ai,pi){return ai.write($.EMPTY[Ii.cmd])}function kt(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.reasonCode,vi=di.properties;let bi=Ni===5?1:0,si=null;if(Ni===5){if(si=ui(ai,vi,pi,bi),!si)return!1;bi+=si.length}return ai.write(k.from([$.codes.disconnect<<4])),ti(ai,bi),Ni===5&&ai.write(k.from([fi])),si!==null&&si.write(),!0}function jt(Ii,ai,pi){const Ni=pi?pi.protocolVersion:4,di=Ii||{},fi=di.reasonCode,vi=di.properties;let bi=Ni===5?1:0;Ni!==5&&ai.emit("error",new Error("Invalid mqtt version for auth packet"));const si=ui(ai,vi,pi,bi);return si?(bi+=si.length,ai.write(k.from([$.codes.auth<<4])),ti(ai,bi),ai.write(k.from([fi])),si!==null&&si.write(),!0):!1}const Pt={};function ti(Ii,ai){if(ai>$.VARBYTEINT_MAX)return Ii.emit("error",new Error(`Invalid variable byte integer: ${ai}`)),!1;let pi=Pt[ai];return pi||(pi=de(ai),ai<16384&&(Pt[ai]=pi)),ae("writeVarByteInt: writing to stream: %o",pi),Ii.write(pi)}function ei(Ii,ai){const pi=k.byteLength(ai);return he(Ii,pi),ae("writeString: %s",ai),Ii.write(ai,"utf8")}function Et(Ii,ai,pi){ei(Ii,ai),ei(Ii,pi)}function ni(Ii,ai){return ae("writeNumberCached: number: %d",ai),ae("writeNumberCached: %o",le[ai]),Ii.write(le[ai])}function ri(Ii,ai){const pi=Ie(ai);return ae("writeNumberGenerated: %o",pi),Ii.write(pi)}function ci(Ii,ai){const pi=Ne(ai);return ae("write4ByteNumber: %o",pi),Ii.write(pi)}function Ci(Ii,ai){typeof ai=="string"?ei(Ii,ai):ai?(he(Ii,ai.length),Ii.write(ai)):he(Ii,0)}function li(Ii,ai){if(typeof ai!="object"||ai.length!=null)return{length:1,write(){Mi(Ii,{},0)}};let pi=0;function Ni(fi,vi){const bi=$.propertiesTypes[fi];let si=0;switch(bi){case"byte":{if(typeof vi!="boolean")return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+1;break}case"int8":{if(typeof vi!="number"||vi<0||vi>255)return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+1;break}case"binary":{if(vi&&vi===null)return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+k.byteLength(vi)+2;break}case"int16":{if(typeof vi!="number"||vi<0||vi>65535)return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+2;break}case"int32":{if(typeof vi!="number"||vi<0||vi>4294967295)return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+4;break}case"var":{if(typeof vi!="number"||vi<0||vi>268435455)return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+k.byteLength(de(vi));break}case"string":{if(typeof vi!="string")return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=1+2+k.byteLength(vi.toString());break}case"pair":{if(typeof vi!="object")return Ii.emit("error",new Error(`Invalid ${fi}: ${vi}`)),!1;si+=Object.getOwnPropertyNames(vi).reduce((wi,oi)=>{const Lt=vi[oi];return Array.isArray(Lt)?wi+=Lt.reduce((ii,gi)=>(ii+=1+2+k.byteLength(oi.toString())+2+k.byteLength(gi.toString()),ii),0):wi+=1+2+k.byteLength(oi.toString())+2+k.byteLength(vi[oi].toString()),wi},0);break}default:return Ii.emit("error",new Error(`Invalid property ${fi}: ${vi}`)),!1}return si}if(ai)for(const fi in ai){let vi=0,bi=0;const si=ai[fi];if(Array.isArray(si))for(let wi=0;wi<si.length;wi++){if(bi=Ni(fi,si[wi]),!bi)return!1;vi+=bi}else{if(bi=Ni(fi,si),!bi)return!1;vi=bi}if(!vi)return!1;pi+=vi}return{length:k.byteLength(de(pi))+pi,write(){Mi(Ii,ai,pi)}}}function ui(Ii,ai,pi,Ni){const di=["reasonString","userProperties"],fi=pi&&pi.properties&&pi.properties.maximumPacketSize?pi.properties.maximumPacketSize:0;let vi=li(Ii,ai);if(fi)for(;Ni+vi.length>fi;){const bi=di.shift();if(bi&&ai[bi])delete ai[bi],vi=li(Ii,ai);else return!1}return vi}function yi(Ii,ai,pi){switch($.propertiesTypes[ai]){case"byte":{Ii.write(k.from([$.properties[ai]])),Ii.write(k.from([+pi]));break}case"int8":{Ii.write(k.from([$.properties[ai]])),Ii.write(k.from([pi]));break}case"binary":{Ii.write(k.from([$.properties[ai]])),Ci(Ii,pi);break}case"int16":{Ii.write(k.from([$.properties[ai]])),he(Ii,pi);break}case"int32":{Ii.write(k.from([$.properties[ai]])),ci(Ii,pi);break}case"var":{Ii.write(k.from([$.properties[ai]])),ti(Ii,pi);break}case"string":{Ii.write(k.from([$.properties[ai]])),ei(Ii,pi);break}case"pair":{Object.getOwnPropertyNames(pi).forEach(di=>{const fi=pi[di];Array.isArray(fi)?fi.forEach(vi=>{Ii.write(k.from([$.properties[ai]])),Et(Ii,di.toString(),vi.toString())}):(Ii.write(k.from([$.properties[ai]])),Et(Ii,di.toString(),fi.toString()))});break}default:return Ii.emit("error",new Error(`Invalid property ${ai} value: ${pi}`)),!1}}function Mi(Ii,ai,pi){ti(Ii,pi);for(const Ni in ai)if(Object.prototype.hasOwnProperty.call(ai,Ni)&&ai[Ni]!==null){const di=ai[Ni];if(Array.isArray(di))for(let fi=0;fi<di.length;fi++)yi(Ii,Ni,di[fi]);else yi(Ii,Ni,di)}}function zi(Ii){return Ii?Ii instanceof k?Ii.length:k.byteLength(Ii):0}function Ai(Ii){return typeof Ii=="string"||Ii instanceof k}g.exports=pe}).call(this)}).call(this,r("buffer").Buffer)},{"./constants":38,"./numbers":41,buffer:17,debug:18,"process-nextick-args":49}],45:[function(r,g,V){var k=1e3,$=k*60,re=$*60,oe=re*24,Ce=oe*7,ie=oe*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]),ze=(Ne[2]||"ms").toLowerCase();switch(ze){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*oe;case"hours":case"hour":case"hrs":case"hr":case"h":return he*re;case"minutes":case"minute":case"mins":case"min":case"m":return he*$;case"seconds":case"second":case"secs":case"sec":case"s":return he*k;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return he;default:return}}}}function le(de){var Ne=Math.abs(de);return Ne>=oe?Math.round(de/oe)+"d":Ne>=re?Math.round(de/re)+"h":Ne>=$?Math.round(de/$)+"m":Ne>=k?Math.round(de/k)+"s":de+"ms"}function Ie(de){var Ne=Math.abs(de);return Ne>=oe?ue(de,Ne,oe,"day"):Ne>=re?ue(de,Ne,re,"hour"):Ne>=$?ue(de,Ne,$,"minute"):Ne>=k?ue(de,Ne,k,"second"):de+" ms"}function ue(de,Ne,he,ze){var pe=Ne>=he*1.5;return Math.round(de/he)+" "+ze+(pe?"s":"")}},{}],46:[function(r,g,V){const k=r("./lib/number-allocator.js");g.exports.NumberAllocator=k},{"./lib/number-allocator.js":47}],47:[function(r,g,V){const k=r("js-sdsl").Set,$=r("debug")("number-allocator:trace"),re=r("debug")("number-allocator:error");function oe(ie,ae){this.low=ie,this.high=ae}oe.prototype.equals=function(ie){return this.low===ie.low&&this.high===ie.high},oe.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 k([],(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 oe(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 oe(Ie,ie-1)),$("use():"+ie),!0}return $("use():failed"),!1},Ce.prototype.free=function(ie){if(ie<this.min||ie>this.max){re("free():"+ie+" is out of range");return}const ae=new oe(ie,ie),le=this.ss.lowerBound(ae);if(le){if(le.low<=ie&&ie<=le.high){re("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 oe(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,V){var k=r("wrappy");g.exports=k($),g.exports.strict=k(re),$.proto=$(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return $(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return re(this)},configurable:!0})});function $(oe){var Ce=function(){return Ce.called?Ce.value:(Ce.called=!0,Ce.value=oe.apply(this,arguments))};return Ce.called=!1,Ce}function re(oe){var Ce=function(){if(Ce.called)throw new Error(Ce.onceError);return Ce.called=!0,Ce.value=oe.apply(this,arguments)},ie=oe.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,V){(function(k){(function(){typeof k>"u"||!k.version||k.version.indexOf("v0.")===0||k.version.indexOf("v1.")===0&&k.version.indexOf("v1.8.")!==0?g.exports={nextTick:$}:g.exports=k;function $(re,oe,Ce,ie){if(typeof re!="function")throw new TypeError('"callback" argument must be a function');var ae=arguments.length,le,Ie;switch(ae){case 0:case 1:return k.nextTick(re);case 2:return k.nextTick(function(){re.call(null,oe)});case 3:return k.nextTick(function(){re.call(null,oe,Ce)});case 4:return k.nextTick(function(){re.call(null,oe,Ce,ie)});default:for(le=new Array(ae-1),Ie=0;Ie<le.length;)le[Ie++]=arguments[Ie];return k.nextTick(function(){re.apply(null,le)})}}}).call(this)}).call(this,r("_process"))},{_process:50}],50:[function(r,g,V){var k=g.exports={},$,re;function oe(){throw new Error("setTimeout has not been defined")}function Ce(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?$=setTimeout:$=oe}catch{$=oe}try{typeof clearTimeout=="function"?re=clearTimeout:re=Ce}catch{re=Ce}})();function ie(Ve){if($===setTimeout)return setTimeout(Ve,0);if(($===oe||!$)&&setTimeout)return $=setTimeout,setTimeout(Ve,0);try{return $(Ve,0)}catch{try{return $.call(null,Ve,0)}catch{return $.call(this,Ve,0)}}}function ae(Ve){if(re===clearTimeout)return clearTimeout(Ve);if((re===Ce||!re)&&clearTimeout)return re=clearTimeout,clearTimeout(Ve);try{return re(Ve)}catch{try{return re.call(null,Ve)}catch{return re.call(this,Ve)}}}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 Ve=ie(Ne);Ie=!0;for(var Oe=le.length;Oe;){for(ue=le,le=[];++de<Oe;)ue&&ue[de].run();de=-1,Oe=le.length}ue=null,Ie=!1,ae(Ve)}}k.nextTick=function(Ve){var Oe=new Array(arguments.length-1);if(arguments.length>1)for(var _e=1;_e<arguments.length;_e++)Oe[_e-1]=arguments[_e];le.push(new ze(Ve,Oe)),le.length===1&&!Ie&&ie(he)};function ze(Ve,Oe){this.fun=Ve,this.array=Oe}ze.prototype.run=function(){this.fun.apply(null,this.array)},k.title="browser",k.browser=!0,k.env={},k.argv=[],k.version="",k.versions={};function pe(){}k.on=pe,k.addListener=pe,k.once=pe,k.off=pe,k.removeListener=pe,k.removeAllListeners=pe,k.emit=pe,k.prependListener=pe,k.prependOnceListener=pe,k.listeners=function(Ve){return[]},k.binding=function(Ve){throw new Error("process.binding is not supported")},k.cwd=function(){return"/"},k.chdir=function(Ve){throw new Error("process.chdir is not supported")},k.umask=function(){return 0}},{}],51:[function(r,g,V){(function(k){(function(){(function($){var re=typeof V=="object"&&V&&!V.nodeType&&V,oe=typeof g=="object"&&g&&!g.nodeType&&g,Ce=typeof k=="object"&&k;(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,ze=128,pe="-",Ve=/^xn--/,Oe=/[^\x20-\x7E]/,_e=/[\x2E\u3002\uFF0E\uFF61]/g,At={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,Fe=Math.floor,Ue=String.fromCharCode,xe;function Dt(li){throw new RangeError(At[li])}function qe(li,ui){for(var yi=li.length,Mi=[];yi--;)Mi[yi]=ui(li[yi]);return Mi}function kt(li,ui){var yi=li.split("@"),Mi="";yi.length>1&&(Mi=yi[0]+"@",li=yi[1]),li=li.replace(_e,".");var zi=li.split("."),Ai=qe(zi,ui).join(".");return Mi+Ai}function jt(li){for(var ui=[],yi=0,Mi=li.length,zi,Ai;yi<Mi;)zi=li.charCodeAt(yi++),zi>=55296&&zi<=56319&&yi<Mi?(Ai=li.charCodeAt(yi++),(Ai&64512)==56320?ui.push(((zi&1023)<<10)+(Ai&1023)+65536):(ui.push(zi),yi--)):ui.push(zi);return ui}function Pt(li){return qe(li,function(ui){var yi="";return ui>65535&&(ui-=65536,yi+=Ue(ui>>>10&1023|55296),ui=56320|ui&1023),yi+=Ue(ui),yi}).join("")}function ti(li){return li-48<10?li-22:li-65<26?li-65:li-97<26?li-97:le}function ei(li,ui){return li+22+75*(li<26)-((ui!=0)<<5)}function Et(li,ui,yi){var Mi=0;for(li=yi?Fe(li/Ne):li>>1,li+=Fe(li/ui);li>$e*ue>>1;Mi+=le)li=Fe(li/$e);return Fe(Mi+($e+1)*li/(li+de))}function ni(li){var ui=[],yi=li.length,Mi,zi=0,Ai=ze,Ii=he,ai,pi,Ni,di,fi,vi,bi,si,wi;for(ai=li.lastIndexOf(pe),ai<0&&(ai=0),pi=0;pi<ai;++pi)li.charCodeAt(pi)>=128&&Dt("not-basic"),ui.push(li.charCodeAt(pi));for(Ni=ai>0?ai+1:0;Ni<yi;){for(di=zi,fi=1,vi=le;Ni>=yi&&Dt("invalid-input"),bi=ti(li.charCodeAt(Ni++)),(bi>=le||bi>Fe((ae-zi)/fi))&&Dt("overflow"),zi+=bi*fi,si=vi<=Ii?Ie:vi>=Ii+ue?ue:vi-Ii,!(bi<si);vi+=le)wi=le-si,fi>Fe(ae/wi)&&Dt("overflow"),fi*=wi;Mi=ui.length+1,Ii=Et(zi-di,Mi,di==0),Fe(zi/Mi)>ae-Ai&&Dt("overflow"),Ai+=Fe(zi/Mi),zi%=Mi,ui.splice(zi++,0,Ai)}return Pt(ui)}function ri(li){var ui,yi,Mi,zi,Ai,Ii,ai,pi,Ni,di,fi,vi=[],bi,si,wi,oi;for(li=jt(li),bi=li.length,ui=ze,yi=0,Ai=he,Ii=0;Ii<bi;++Ii)fi=li[Ii],fi<128&&vi.push(Ue(fi));for(Mi=zi=vi.length,zi&&vi.push(pe);Mi<bi;){for(ai=ae,Ii=0;Ii<bi;++Ii)fi=li[Ii],fi>=ui&&fi<ai&&(ai=fi);for(si=Mi+1,ai-ui>Fe((ae-yi)/si)&&Dt("overflow"),yi+=(ai-ui)*si,ui=ai,Ii=0;Ii<bi;++Ii)if(fi=li[Ii],fi<ui&&++yi>ae&&Dt("overflow"),fi==ui){for(pi=yi,Ni=le;di=Ni<=Ai?Ie:Ni>=Ai+ue?ue:Ni-Ai,!(pi<di);Ni+=le)oi=pi-di,wi=le-di,vi.push(Ue(ei(di+oi%wi,0))),pi=Fe(oi/wi);vi.push(Ue(ei(pi,0))),Ai=Et(yi,si,Mi==zi),yi=0,++Mi}++yi,++ui}return vi.join("")}function ci(li){return kt(li,function(ui){return Ve.test(ui)?ni(ui.slice(4).toLowerCase()):ui})}function Ci(li){return kt(li,function(ui){return Oe.test(ui)?"xn--"+ri(ui):ui})}if(ie={version:"1.4.1",ucs2:{decode:jt,encode:Pt},decode:ni,encode:ri,toASCII:Ci,toUnicode:ci},re&&oe)if(g.exports==re)oe.exports=ie;else for(xe in ie)ie.hasOwnProperty(xe)&&(re[xe]=ie[xe]);else $.punycode=ie})(this)}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],52:[function(r,g,V){function k(re,oe){return Object.prototype.hasOwnProperty.call(re,oe)}g.exports=function(re,oe,Ce,ie){oe=oe||"&",Ce=Ce||"=";var ae={};if(typeof re!="string"||re.length===0)return ae;var le=/\+/g;re=re.split(oe);var Ie=1e3;ie&&typeof ie.maxKeys=="number"&&(Ie=ie.maxKeys);var ue=re.length;Ie>0&&ue>Ie&&(ue=Ie);for(var de=0;de<ue;++de){var Ne=re[de].replace(le,"%20"),he=Ne.indexOf(Ce),ze,pe,Ve,Oe;he>=0?(ze=Ne.substr(0,he),pe=Ne.substr(he+1)):(ze=Ne,pe=""),Ve=decodeURIComponent(ze),Oe=decodeURIComponent(pe),k(ae,Ve)?$(ae[Ve])?ae[Ve].push(Oe):ae[Ve]=[ae[Ve],Oe]:ae[Ve]=Oe}return ae};var $=Array.isArray||function(re){return Object.prototype.toString.call(re)==="[object Array]"}},{}],53:[function(r,g,V){var k=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"?re(oe(Ce),function(Ie){var ue=encodeURIComponent(k(Ie))+ae;return $(Ce[Ie])?re(Ce[Ie],function(de){return ue+encodeURIComponent(k(de))}).join(ie):ue+encodeURIComponent(k(Ce[Ie]))}).join(ie):le?encodeURIComponent(k(le))+ae+encodeURIComponent(k(Ce)):""};var $=Array.isArray||function(Ce){return Object.prototype.toString.call(Ce)==="[object Array]"};function re(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 oe=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,V){V.decode=V.parse=r("./decode"),V.encode=V.stringify=r("./encode")},{"./decode":52,"./encode":53}],55:[function(r,g,V){function k(le,Ie){le.prototype=Object.create(Ie.prototype),le.prototype.constructor=le,le.__proto__=Ie}var $={};function re(le,Ie,ue){ue||(ue=Error);function de(he,ze,pe){return typeof Ie=="string"?Ie:Ie(he,ze,pe)}var Ne=function(he){k(ze,he);function ze(pe,Ve,Oe){return he.call(this,de(pe,Ve,Oe))||this}return ze}(ue);Ne.prototype.name=ue.name,Ne.prototype.code=le,$[le]=Ne}function oe(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}re("ERR_INVALID_OPT_VALUE",function(le,Ie){return'The value "'+Ie+'" is invalid for option "'+le+'"'},TypeError),re("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(oe(Ie,"type"));else{var he=ae(le,".")?"property":"argument";Ne='The "'.concat(le,'" ').concat(he," ").concat(de," ").concat(oe(Ie,"type"))}return Ne+=". Received type ".concat(typeof ue),Ne},TypeError),re("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),re("ERR_METHOD_NOT_IMPLEMENTED",function(le){return"The "+le+" method is not implemented"}),re("ERR_STREAM_PREMATURE_CLOSE","Premature close"),re("ERR_STREAM_DESTROYED",function(le){return"Cannot call "+le+" after a stream was destroyed"}),re("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),re("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),re("ERR_STREAM_WRITE_AFTER_END","write after end"),re("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),re("ERR_UNKNOWN_ENCODING",function(le){return"Unknown encoding: "+le},TypeError),re("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),g.exports.codes=$},{}],56:[function(r,g,V){(function(k){(function(){var $=Object.keys||function(de){var Ne=[];for(var he in de)Ne.push(he);return Ne};g.exports=le;var re=r("./_stream_readable"),oe=r("./_stream_writable");r("inherits")(le,re);for(var Ce=$(oe.prototype),ie=0;ie<Ce.length;ie++){var ae=Ce[ie];le.prototype[ae]||(le.prototype[ae]=oe.prototype[ae])}function le(de){if(!(this instanceof le))return new le(de);re.call(this,de),oe.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||k.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,V){g.exports=$;var k=r("./_stream_transform");r("inherits")($,k);function $(re){if(!(this instanceof $))return new $(re);k.call(this,re)}$.prototype._transform=function(re,oe,Ce){Ce(null,re)}},{"./_stream_transform":59,inherits:24}],58:[function(r,g,V){(function(k,$){(function(){g.exports=Pt;var re;Pt.ReadableState=jt,r("events").EventEmitter;var oe=function(wi,oi){return wi.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"),ze=r("./internal/streams/state"),pe=ze.getHighWaterMark,Ve=r("../errors").codes,Oe=Ve.ERR_INVALID_ARG_TYPE,_e=Ve.ERR_STREAM_PUSH_AFTER_EOF,At=Ve.ERR_METHOD_NOT_IMPLEMENTED,$e=Ve.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Fe,Ue,xe;r("inherits")(Pt,Ce);var Dt=he.errorOrDestroy,qe=["error","close","destroy","pause","resume"];function kt(si,wi,oi){if(typeof si.prependListener=="function")return si.prependListener(wi,oi);!si._events||!si._events[wi]?si.on(wi,oi):Array.isArray(si._events[wi])?si._events[wi].unshift(oi):si._events[wi]=[oi,si._events[wi]]}function jt(si,wi,oi){re=re||r("./_stream_duplex"),si=si||{},typeof oi!="boolean"&&(oi=wi instanceof re),this.objectMode=!!si.objectMode,oi&&(this.objectMode=this.objectMode||!!si.readableObjectMode),this.highWaterMark=pe(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&&(Fe||(Fe=r("string_decoder/").StringDecoder),this.decoder=new Fe(si.encoding),this.encoding=si.encoding)}function Pt(si){if(re=re||r("./_stream_duplex"),!(this instanceof Pt))return new Pt(si);var wi=this instanceof re;this._readableState=new jt(si,this,wi),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(Pt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(wi){this._readableState&&(this._readableState.destroyed=wi)}}),Pt.prototype.destroy=he.destroy,Pt.prototype._undestroy=he.undestroy,Pt.prototype._destroy=function(si,wi){wi(si)},Pt.prototype.push=function(si,wi){var oi=this._readableState,Lt;return oi.objectMode?Lt=!0:typeof si=="string"&&(wi=wi||oi.defaultEncoding,wi!==oi.encoding&&(si=ie.from(si,wi),wi=""),Lt=!0),ti(this,si,wi,!1,Lt)},Pt.prototype.unshift=function(si){return ti(this,si,null,!0,!1)};function ti(si,wi,oi,Lt,ii){de("readableAddChunk",wi);var gi=si._readableState;if(wi===null)gi.reading=!1,Ci(si,gi);else{var hi;if(ii||(hi=Et(gi,wi)),hi)Dt(si,hi);else if(gi.objectMode||wi&&wi.length>0)if(typeof wi!="string"&&!gi.objectMode&&Object.getPrototypeOf(wi)!==ie.prototype&&(wi=le(wi)),Lt)gi.endEmitted?Dt(si,new $e):ei(si,gi,wi,!0);else if(gi.ended)Dt(si,new _e);else{if(gi.destroyed)return!1;gi.reading=!1,gi.decoder&&!oi?(wi=gi.decoder.write(wi),gi.objectMode||wi.length!==0?ei(si,gi,wi,!1):yi(si,gi)):ei(si,gi,wi,!1)}else Lt||(gi.reading=!1,yi(si,gi))}return!gi.ended&&(gi.length<gi.highWaterMark||gi.length===0)}function ei(si,wi,oi,Lt){wi.flowing&&wi.length===0&&!wi.sync?(wi.awaitDrain=0,si.emit("data",oi)):(wi.length+=wi.objectMode?1:oi.length,Lt?wi.buffer.unshift(oi):wi.buffer.push(oi),wi.needReadable&&li(si)),yi(si,wi)}function Et(si,wi){var oi;return!Ie(wi)&&typeof wi!="string"&&wi!==void 0&&!si.objectMode&&(oi=new Oe("chunk",["string","Buffer","Uint8Array"],wi)),oi}Pt.prototype.isPaused=function(){return this._readableState.flowing===!1},Pt.prototype.setEncoding=function(si){Fe||(Fe=r("string_decoder/").StringDecoder);var wi=new Fe(si);this._readableState.decoder=wi,this._readableState.encoding=this._readableState.decoder.encoding;for(var oi=this._readableState.buffer.head,Lt="";oi!==null;)Lt+=wi.write(oi.data),oi=oi.next;return this._readableState.buffer.clear(),Lt!==""&&this._readableState.buffer.push(Lt),this._readableState.length=Lt.length,this};var ni=1073741824;function ri(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 ci(si,wi){return si<=0||wi.length===0&&wi.ended?0:wi.objectMode?1:si!==si?wi.flowing&&wi.length?wi.buffer.head.data.length:wi.length:(si>wi.highWaterMark&&(wi.highWaterMark=ri(si)),si<=wi.length?si:wi.ended?wi.length:(wi.needReadable=!0,0))}Pt.prototype.read=function(si){de("read",si),si=parseInt(si,10);var wi=this._readableState,oi=si;if(si!==0&&(wi.emittedReadable=!1),si===0&&wi.needReadable&&((wi.highWaterMark!==0?wi.length>=wi.highWaterMark:wi.length>0)||wi.ended))return de("read: emitReadable",wi.length,wi.ended),wi.length===0&&wi.ended?fi(this):li(this),null;if(si=ci(si,wi),si===0&&wi.ended)return wi.length===0&&fi(this),null;var Lt=wi.needReadable;de("need readable",Lt),(wi.length===0||wi.length-si<wi.highWaterMark)&&(Lt=!0,de("length less than watermark",Lt)),wi.ended||wi.reading?(Lt=!1,de("reading or ended",Lt)):Lt&&(de("do read"),wi.reading=!0,wi.sync=!0,wi.length===0&&(wi.needReadable=!0),this._read(wi.highWaterMark),wi.sync=!1,wi.reading||(si=ci(oi,wi)));var ii;return si>0?ii=di(si,wi):ii=null,ii===null?(wi.needReadable=wi.length<=wi.highWaterMark,si=0):(wi.length-=si,wi.awaitDrain=0),wi.length===0&&(wi.ended||(wi.needReadable=!0),oi!==si&&wi.ended&&fi(this)),ii!==null&&this.emit("data",ii),ii};function Ci(si,wi){if(de("onEofChunk"),!wi.ended){if(wi.decoder){var oi=wi.decoder.end();oi&&oi.length&&(wi.buffer.push(oi),wi.length+=wi.objectMode?1:oi.length)}wi.ended=!0,wi.sync?li(si):(wi.needReadable=!1,wi.emittedReadable||(wi.emittedReadable=!0,ui(si)))}}function li(si){var wi=si._readableState;de("emitReadable",wi.needReadable,wi.emittedReadable),wi.needReadable=!1,wi.emittedReadable||(de("emitReadable",wi.flowing),wi.emittedReadable=!0,k.nextTick(ui,si))}function ui(si){var wi=si._readableState;de("emitReadable_",wi.destroyed,wi.length,wi.ended),!wi.destroyed&&(wi.length||wi.ended)&&(si.emit("readable"),wi.emittedReadable=!1),wi.needReadable=!wi.flowing&&!wi.ended&&wi.length<=wi.highWaterMark,Ni(si)}function yi(si,wi){wi.readingMore||(wi.readingMore=!0,k.nextTick(Mi,si,wi))}function Mi(si,wi){for(;!wi.reading&&!wi.ended&&(wi.length<wi.highWaterMark||wi.flowing&&wi.length===0);){var oi=wi.length;if(de("maybeReadMore read 0"),si.read(0),oi===wi.length)break}wi.readingMore=!1}Pt.prototype._read=function(si){Dt(this,new At("_read()"))},Pt.prototype.pipe=function(si,wi){var oi=this,Lt=this._readableState;switch(Lt.pipesCount){case 0:Lt.pipes=si;break;case 1:Lt.pipes=[Lt.pipes,si];break;default:Lt.pipes.push(si);break}Lt.pipesCount+=1,de("pipe count=%d opts=%j",Lt.pipesCount,wi);var ii=(!wi||wi.end!==!1)&&si!==k.stdout&&si!==k.stderr,gi=ii?mi:Vi;Lt.endEmitted?k.nextTick(gi):oi.once("end",gi),si.on("unpipe",hi);function hi(ki,Hi){de("onunpipe"),ki===oi&&Hi&&Hi.hasUnpiped===!1&&(Hi.hasUnpiped=!0,Gi())}function mi(){de("onend"),si.end()}var Si=zi(oi);si.on("drain",Si);var xi=!1;function Gi(){de("cleanup"),si.removeListener("close",Zi),si.removeListener("finish",Wi),si.removeListener("drain",Si),si.removeListener("error",Oi),si.removeListener("unpipe",hi),oi.removeListener("end",mi),oi.removeListener("end",Vi),oi.removeListener("data",Bi),xi=!0,Lt.awaitDrain&&(!si._writableState||si._writableState.needDrain)&&Si()}oi.on("data",Bi);function Bi(ki){de("ondata");var Hi=si.write(ki);de("dest.write",Hi),Hi===!1&&((Lt.pipesCount===1&&Lt.pipes===si||Lt.pipesCount>1&&bi(Lt.pipes,si)!==-1)&&!xi&&(de("false write response, pause",Lt.awaitDrain),Lt.awaitDrain++),oi.pause())}function Oi(ki){de("onerror",ki),Vi(),si.removeListener("error",Oi),oe(si,"error")===0&&Dt(si,ki)}kt(si,"error",Oi);function Zi(){si.removeListener("finish",Wi),Vi()}si.once("close",Zi);function Wi(){de("onfinish"),si.removeListener("close",Zi),Vi()}si.once("finish",Wi);function Vi(){de("unpipe"),oi.unpipe(si)}return si.emit("pipe",oi),Lt.flowing||(de("pipe resume"),oi.resume()),si};function zi(si){return function(){var oi=si._readableState;de("pipeOnDrain",oi.awaitDrain),oi.awaitDrain&&oi.awaitDrain--,oi.awaitDrain===0&&oe(si,"data")&&(oi.flowing=!0,Ni(si))}}Pt.prototype.unpipe=function(si){var wi=this._readableState,oi={hasUnpiped:!1};if(wi.pipesCount===0)return this;if(wi.pipesCount===1)return si&&si!==wi.pipes?this:(si||(si=wi.pipes),wi.pipes=null,wi.pipesCount=0,wi.flowing=!1,si&&si.emit("unpipe",this,oi),this);if(!si){var Lt=wi.pipes,ii=wi.pipesCount;wi.pipes=null,wi.pipesCount=0,wi.flowing=!1;for(var gi=0;gi<ii;gi++)Lt[gi].emit("unpipe",this,{hasUnpiped:!1});return this}var hi=bi(wi.pipes,si);return hi===-1?this:(wi.pipes.splice(hi,1),wi.pipesCount-=1,wi.pipesCount===1&&(wi.pipes=wi.pipes[0]),si.emit("unpipe",this,oi),this)},Pt.prototype.on=function(si,wi){var oi=Ce.prototype.on.call(this,si,wi),Lt=this._readableState;return si==="data"?(Lt.readableListening=this.listenerCount("readable")>0,Lt.flowing!==!1&&this.resume()):si==="readable"&&!Lt.endEmitted&&!Lt.readableListening&&(Lt.readableListening=Lt.needReadable=!0,Lt.flowing=!1,Lt.emittedReadable=!1,de("on readable",Lt.length,Lt.reading),Lt.length?li(this):Lt.reading||k.nextTick(Ii,this)),oi},Pt.prototype.addListener=Pt.prototype.on,Pt.prototype.removeListener=function(si,wi){var oi=Ce.prototype.removeListener.call(this,si,wi);return si==="readable"&&k.nextTick(Ai,this),oi},Pt.prototype.removeAllListeners=function(si){var wi=Ce.prototype.removeAllListeners.apply(this,arguments);return(si==="readable"||si===void 0)&&k.nextTick(Ai,this),wi};function Ai(si){var wi=si._readableState;wi.readableListening=si.listenerCount("readable")>0,wi.resumeScheduled&&!wi.paused?wi.flowing=!0:si.listenerCount("data")>0&&si.resume()}function Ii(si){de("readable nexttick read 0"),si.read(0)}Pt.prototype.resume=function(){var si=this._readableState;return si.flowing||(de("resume"),si.flowing=!si.readableListening,ai(this,si)),si.paused=!1,this};function ai(si,wi){wi.resumeScheduled||(wi.resumeScheduled=!0,k.nextTick(pi,si,wi))}function pi(si,wi){de("resume",wi.reading),wi.reading||si.read(0),wi.resumeScheduled=!1,si.emit("resume"),Ni(si),wi.flowing&&!wi.reading&&si.read(0)}Pt.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 wi=si._readableState;for(de("flow",wi.flowing);wi.flowing&&si.read()!==null;);}Pt.prototype.wrap=function(si){var wi=this,oi=this._readableState,Lt=!1;si.on("end",function(){if(de("wrapped end"),oi.decoder&&!oi.ended){var hi=oi.decoder.end();hi&&hi.length&&wi.push(hi)}wi.push(null)}),si.on("data",function(hi){if(de("wrapped data"),oi.decoder&&(hi=oi.decoder.write(hi)),!(oi.objectMode&&hi==null)&&!(!oi.objectMode&&(!hi||!hi.length))){var mi=wi.push(hi);mi||(Lt=!0,si.pause())}});for(var ii in si)this[ii]===void 0&&typeof si[ii]=="function"&&(this[ii]=function(mi){return function(){return si[mi].apply(si,arguments)}}(ii));for(var gi=0;gi<qe.length;gi++)si.on(qe[gi],this.emit.bind(this,qe[gi]));return this._read=function(hi){de("wrapped _read",hi),Lt&&(Lt=!1,si.resume())},this},typeof Symbol=="function"&&(Pt.prototype[Symbol.asyncIterator]=function(){return Ue===void 0&&(Ue=r("./internal/streams/async_iterator")),Ue(this)}),Object.defineProperty(Pt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Pt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Pt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(wi){this._readableState&&(this._readableState.flowing=wi)}}),Pt._fromList=di,Object.defineProperty(Pt.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function di(si,wi){if(wi.length===0)return null;var oi;return wi.objectMode?oi=wi.buffer.shift():!si||si>=wi.length?(wi.decoder?oi=wi.buffer.join(""):wi.buffer.length===1?oi=wi.buffer.first():oi=wi.buffer.concat(wi.length),wi.buffer.clear()):oi=wi.buffer.consume(si,wi.decoder),oi}function fi(si){var wi=si._readableState;de("endReadable",wi.endEmitted),wi.endEmitted||(wi.ended=!0,k.nextTick(vi,wi,si))}function vi(si,wi){if(de("endReadableNT",si.endEmitted,si.length),!si.endEmitted&&si.length===0&&(si.endEmitted=!0,wi.readable=!1,wi.emit("end"),si.autoDestroy)){var oi=wi._writableState;(!oi||oi.autoDestroy&&oi.finished)&&wi.destroy()}}typeof Symbol=="function"&&(Pt.from=function(si,wi){return xe===void 0&&(xe=r("./internal/streams/from")),xe(Pt,si,wi)});function bi(si,wi){for(var oi=0,Lt=si.length;oi<Lt;oi++)if(si[oi]===wi)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,V){g.exports=le;var k=r("../errors").codes,$=k.ERR_METHOD_NOT_IMPLEMENTED,re=k.ERR_MULTIPLE_CALLBACK,oe=k.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ce=k.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 ze=he.writecb;if(ze===null)return this.emit("error",new re);he.writechunk=null,he.writecb=null,Ne!=null&&this.push(Ne),ze(de);var pe=this._readableState;pe.reading=!1,(pe.needReadable||pe.length<pe.highWaterMark)&&this._read(pe.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 ze=this._transformState;if(ze.writecb=he,ze.writechunk=de,ze.writeencoding=Ne,!ze.transforming){var pe=this._readableState;(ze.needTransform||pe.needReadable||pe.length<pe.highWaterMark)&&this._read(pe.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 oe;return de.push(null)}},{"../errors":55,"./_stream_duplex":56,inherits:24}],60:[function(r,g,V){(function(k,$){(function(){g.exports=jt;function re(Ni){var di=this;this.next=null,this.entry=null,this.finish=function(){pi(di,Ni)}}var oe;jt.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,ze=r("../errors").codes,pe=ze.ERR_INVALID_ARG_TYPE,Ve=ze.ERR_METHOD_NOT_IMPLEMENTED,Oe=ze.ERR_MULTIPLE_CALLBACK,_e=ze.ERR_STREAM_CANNOT_PIPE,At=ze.ERR_STREAM_DESTROYED,$e=ze.ERR_STREAM_NULL_VALUES,Fe=ze.ERR_STREAM_WRITE_AFTER_END,Ue=ze.ERR_UNKNOWN_ENCODING,xe=de.errorOrDestroy;r("inherits")(jt,ie);function Dt(){}function qe(Ni,di,fi){oe=oe||r("./_stream_duplex"),Ni=Ni||{},typeof fi!="boolean"&&(fi=di instanceof oe),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 vi=Ni.decodeStrings===!1;this.decodeStrings=!vi,this.defaultEncoding=Ni.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(bi){Ci(di,bi)},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 re(this)}qe.prototype.getBuffer=function(){for(var di=this.bufferedRequest,fi=[];di;)fi.push(di),di=di.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 kt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(kt=Function.prototype[Symbol.hasInstance],Object.defineProperty(jt,Symbol.hasInstance,{value:function(di){return kt.call(this,di)?!0:this!==jt?!1:di&&di._writableState instanceof qe}})):kt=function(di){return di instanceof this};function jt(Ni){oe=oe||r("./_stream_duplex");var di=this instanceof oe;if(!di&&!kt.call(jt,this))return new jt(Ni);this._writableState=new qe(Ni,this,di),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)}jt.prototype.pipe=function(){xe(this,new _e)};function Pt(Ni,di){var fi=new Fe;xe(Ni,fi),k.nextTick(di,fi)}function ti(Ni,di,fi,vi){var bi;return fi===null?bi=new $e:typeof fi!="string"&&!di.objectMode&&(bi=new pe("chunk",["string","Buffer"],fi)),bi?(xe(Ni,bi),k.nextTick(vi,bi),!1):!0}jt.prototype.write=function(Ni,di,fi){var vi=this._writableState,bi=!1,si=!vi.objectMode&&ue(Ni);return si&&!ae.isBuffer(Ni)&&(Ni=Ie(Ni)),typeof di=="function"&&(fi=di,di=null),si?di="buffer":di||(di=vi.defaultEncoding),typeof fi!="function"&&(fi=Dt),vi.ending?Pt(this,fi):(si||ti(this,vi,Ni,fi))&&(vi.pendingcb++,bi=Et(this,vi,si,Ni,di,fi)),bi},jt.prototype.cork=function(){this._writableState.corked++},jt.prototype.uncork=function(){var Ni=this._writableState;Ni.corked&&(Ni.corked--,!Ni.writing&&!Ni.corked&&!Ni.bufferProcessing&&Ni.bufferedRequest&&yi(this,Ni))},jt.prototype.setDefaultEncoding=function(di){if(typeof di=="string"&&(di=di.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((di+"").toLowerCase())>-1))throw new Ue(di);return this._writableState.defaultEncoding=di,this},Object.defineProperty(jt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ei(Ni,di,fi){return!Ni.objectMode&&Ni.decodeStrings!==!1&&typeof di=="string"&&(di=ae.from(di,fi)),di}Object.defineProperty(jt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Et(Ni,di,fi,vi,bi,si){if(!fi){var wi=ei(di,vi,bi);vi!==wi&&(fi=!0,bi="buffer",vi=wi)}var oi=di.objectMode?1:vi.length;di.length+=oi;var Lt=di.length<di.highWaterMark;if(Lt||(di.needDrain=!0),di.writing||di.corked){var ii=di.lastBufferedRequest;di.lastBufferedRequest={chunk:vi,encoding:bi,isBuf:fi,callback:si,next:null},ii?ii.next=di.lastBufferedRequest:di.bufferedRequest=di.lastBufferedRequest,di.bufferedRequestCount+=1}else ni(Ni,di,!1,oi,vi,bi,si);return Lt}function ni(Ni,di,fi,vi,bi,si,wi){di.writelen=vi,di.writecb=wi,di.writing=!0,di.sync=!0,di.destroyed?di.onwrite(new At("write")):fi?Ni._writev(bi,di.onwrite):Ni._write(bi,si,di.onwrite),di.sync=!1}function ri(Ni,di,fi,vi,bi){--di.pendingcb,fi?(k.nextTick(bi,vi),k.nextTick(Ii,Ni,di),Ni._writableState.errorEmitted=!0,xe(Ni,vi)):(bi(vi),Ni._writableState.errorEmitted=!0,xe(Ni,vi),Ii(Ni,di))}function ci(Ni){Ni.writing=!1,Ni.writecb=null,Ni.length-=Ni.writelen,Ni.writelen=0}function Ci(Ni,di){var fi=Ni._writableState,vi=fi.sync,bi=fi.writecb;if(typeof bi!="function")throw new Oe;if(ci(fi),di)ri(Ni,fi,vi,di,bi);else{var si=Mi(fi)||Ni.destroyed;!si&&!fi.corked&&!fi.bufferProcessing&&fi.bufferedRequest&&yi(Ni,fi),vi?k.nextTick(li,Ni,fi,si,bi):li(Ni,fi,si,bi)}}function li(Ni,di,fi,vi){fi||ui(Ni,di),di.pendingcb--,vi(),Ii(Ni,di)}function ui(Ni,di){di.length===0&&di.needDrain&&(di.needDrain=!1,Ni.emit("drain"))}function yi(Ni,di){di.bufferProcessing=!0;var fi=di.bufferedRequest;if(Ni._writev&&fi&&fi.next){var vi=di.bufferedRequestCount,bi=new Array(vi),si=di.corkedRequestsFree;si.entry=fi;for(var wi=0,oi=!0;fi;)bi[wi]=fi,fi.isBuf||(oi=!1),fi=fi.next,wi+=1;bi.allBuffers=oi,ni(Ni,di,!0,di.length,bi,"",si.finish),di.pendingcb++,di.lastBufferedRequest=null,si.next?(di.corkedRequestsFree=si.next,si.next=null):di.corkedRequestsFree=new re(di),di.bufferedRequestCount=0}else{for(;fi;){var Lt=fi.chunk,ii=fi.encoding,gi=fi.callback,hi=di.objectMode?1:Lt.length;if(ni(Ni,di,!1,hi,Lt,ii,gi),fi=fi.next,di.bufferedRequestCount--,di.writing)break}fi===null&&(di.lastBufferedRequest=null)}di.bufferedRequest=fi,di.bufferProcessing=!1}jt.prototype._write=function(Ni,di,fi){fi(new Ve("_write()"))},jt.prototype._writev=null,jt.prototype.end=function(Ni,di,fi){var vi=this._writableState;return typeof Ni=="function"?(fi=Ni,Ni=null,di=null):typeof di=="function"&&(fi=di,di=null),Ni!=null&&this.write(Ni,di),vi.corked&&(vi.corked=1,this.uncork()),vi.ending||ai(this,vi,fi),this},Object.defineProperty(jt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Mi(Ni){return Ni.ending&&Ni.length===0&&Ni.bufferedRequest===null&&!Ni.finished&&!Ni.writing}function zi(Ni,di){Ni._final(function(fi){di.pendingcb--,fi&&xe(Ni,fi),di.prefinished=!0,Ni.emit("prefinish"),Ii(Ni,di)})}function Ai(Ni,di){!di.prefinished&&!di.finalCalled&&(typeof Ni._final=="function"&&!di.destroyed?(di.pendingcb++,di.finalCalled=!0,k.nextTick(zi,Ni,di)):(di.prefinished=!0,Ni.emit("prefinish")))}function Ii(Ni,di){var fi=Mi(di);if(fi&&(Ai(Ni,di),di.pendingcb===0&&(di.finished=!0,Ni.emit("finish"),di.autoDestroy))){var vi=Ni._readableState;(!vi||vi.autoDestroy&&vi.endEmitted)&&Ni.destroy()}return fi}function ai(Ni,di,fi){di.ending=!0,Ii(Ni,di),fi&&(di.finished?k.nextTick(fi):Ni.once("finish",fi)),di.ended=!0,Ni.writable=!1}function pi(Ni,di,fi){var vi=Ni.entry;for(Ni.entry=null;vi;){var bi=vi.callback;di.pendingcb--,bi(fi),vi=vi.next}di.corkedRequestsFree.next=Ni}Object.defineProperty(jt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(di){this._writableState&&(this._writableState.destroyed=di)}}),jt.prototype.destroy=de.destroy,jt.prototype._undestroy=de.undestroy,jt.prototype._destroy=function(Ni,di){di(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,V){(function(k){(function(){var $;function re(At,$e,Fe){return $e in At?Object.defineProperty(At,$e,{value:Fe,enumerable:!0,configurable:!0,writable:!0}):At[$e]=Fe,At}var oe=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(At,$e){return{value:At,done:$e}}function he(At){var $e=At[Ce];if($e!==null){var Fe=At[de].read();Fe!==null&&(At[Ie]=null,At[Ce]=null,At[ie]=null,$e(Ne(Fe,!1)))}}function ze(At){k.nextTick(he,At)}function pe(At,$e){return function(Fe,Ue){At.then(function(){if($e[le]){Fe(Ne(void 0,!0));return}$e[ue](Fe,Ue)},Ue)}}var Ve=Object.getPrototypeOf(function(){}),Oe=Object.setPrototypeOf(($={get stream(){return this[de]},next:function(){var $e=this,Fe=this[ae];if(Fe!==null)return Promise.reject(Fe);if(this[le])return Promise.resolve(Ne(void 0,!0));if(this[de].destroyed)return new Promise(function(qe,kt){k.nextTick(function(){$e[ae]?kt($e[ae]):qe(Ne(void 0,!0))})});var Ue=this[Ie],xe;if(Ue)xe=new Promise(pe(Ue,this));else{var Dt=this[de].read();if(Dt!==null)return Promise.resolve(Ne(Dt,!1));xe=new Promise(this[ue])}return this[Ie]=xe,xe}},re($,Symbol.asyncIterator,function(){return this}),re($,"return",function(){var $e=this;return new Promise(function(Fe,Ue){$e[de].destroy(null,function(xe){if(xe){Ue(xe);return}Fe(Ne(void 0,!0))})})}),$),Ve),_e=function($e){var Fe,Ue=Object.create(Oe,(Fe={},re(Fe,de,{value:$e,writable:!0}),re(Fe,Ce,{value:null,writable:!0}),re(Fe,ie,{value:null,writable:!0}),re(Fe,ae,{value:null,writable:!0}),re(Fe,le,{value:$e._readableState.endEmitted,writable:!0}),re(Fe,ue,{value:function(Dt,qe){var kt=Ue[de].read();kt?(Ue[Ie]=null,Ue[Ce]=null,Ue[ie]=null,Dt(Ne(kt,!1))):(Ue[Ce]=Dt,Ue[ie]=qe)},writable:!0}),Fe));return Ue[Ie]=null,oe($e,function(xe){if(xe&&xe.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Dt=Ue[ie];Dt!==null&&(Ue[Ie]=null,Ue[Ce]=null,Ue[ie]=null,Dt(xe)),Ue[ae]=xe;return}var qe=Ue[Ce];qe!==null&&(Ue[Ie]=null,Ue[Ce]=null,Ue[ie]=null,qe(Ne(void 0,!0))),Ue[le]=!0}),$e.on("readable",ze.bind(null,Ue)),Ue};g.exports=_e}).call(this)}).call(this,r("_process"))},{"./end-of-stream":64,_process:50}],62:[function(r,g,V){function k(he,ze){var pe=Object.keys(he);if(Object.getOwnPropertySymbols){var Ve=Object.getOwnPropertySymbols(he);ze&&(Ve=Ve.filter(function(Oe){return Object.getOwnPropertyDescriptor(he,Oe).enumerable})),pe.push.apply(pe,Ve)}return pe}function $(he){for(var ze=1;ze<arguments.length;ze++){var pe=arguments[ze]!=null?arguments[ze]:{};ze%2?k(Object(pe),!0).forEach(function(Ve){re(he,Ve,pe[Ve])}):Object.getOwnPropertyDescriptors?Object.defineProperties(he,Object.getOwnPropertyDescriptors(pe)):k(Object(pe)).forEach(function(Ve){Object.defineProperty(he,Ve,Object.getOwnPropertyDescriptor(pe,Ve))})}return he}function re(he,ze,pe){return ze in he?Object.defineProperty(he,ze,{value:pe,enumerable:!0,configurable:!0,writable:!0}):he[ze]=pe,he}function oe(he,ze){if(!(he instanceof ze))throw new TypeError("Cannot call a class as a function")}function Ce(he,ze){for(var pe=0;pe<ze.length;pe++){var Ve=ze[pe];Ve.enumerable=Ve.enumerable||!1,Ve.configurable=!0,"value"in Ve&&(Ve.writable=!0),Object.defineProperty(he,Ve.key,Ve)}}function ie(he,ze,pe){return ze&&Ce(he.prototype,ze),pe&&Ce(he,pe),he}var ae=r("buffer"),le=ae.Buffer,Ie=r("util"),ue=Ie.inspect,de=ue&&ue.custom||"inspect";function Ne(he,ze,pe){le.prototype.copy.call(he,ze,pe)}g.exports=function(){function he(){oe(this,he),this.head=null,this.tail=null,this.length=0}return ie(he,[{key:"push",value:function(pe){var Ve={data:pe,next:null};this.length>0?this.tail.next=Ve:this.head=Ve,this.tail=Ve,++this.length}},{key:"unshift",value:function(pe){var Ve={data:pe,next:this.head};this.length===0&&(this.tail=Ve),this.head=Ve,++this.length}},{key:"shift",value:function(){if(this.length!==0){var pe=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,pe}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(pe){if(this.length===0)return"";for(var Ve=this.head,Oe=""+Ve.data;Ve=Ve.next;)Oe+=pe+Ve.data;return Oe}},{key:"concat",value:function(pe){if(this.length===0)return le.alloc(0);for(var Ve=le.allocUnsafe(pe>>>0),Oe=this.head,_e=0;Oe;)Ne(Oe.data,Ve,_e),_e+=Oe.data.length,Oe=Oe.next;return Ve}},{key:"consume",value:function(pe,Ve){var Oe;return pe<this.head.data.length?(Oe=this.head.data.slice(0,pe),this.head.data=this.head.data.slice(pe)):pe===this.head.data.length?Oe=this.shift():Oe=Ve?this._getString(pe):this._getBuffer(pe),Oe}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(pe){var Ve=this.head,Oe=1,_e=Ve.data;for(pe-=_e.length;Ve=Ve.next;){var At=Ve.data,$e=pe>At.length?At.length:pe;if($e===At.length?_e+=At:_e+=At.slice(0,pe),pe-=$e,pe===0){$e===At.length?(++Oe,Ve.next?this.head=Ve.next:this.head=this.tail=null):(this.head=Ve,Ve.data=At.slice($e));break}++Oe}return this.length-=Oe,_e}},{key:"_getBuffer",value:function(pe){var Ve=le.allocUnsafe(pe),Oe=this.head,_e=1;for(Oe.data.copy(Ve),pe-=Oe.data.length;Oe=Oe.next;){var At=Oe.data,$e=pe>At.length?At.length:pe;if(At.copy(Ve,Ve.length-pe,0,$e),pe-=$e,pe===0){$e===At.length?(++_e,Oe.next?this.head=Oe.next:this.head=this.tail=null):(this.head=Oe,Oe.data=At.slice($e));break}++_e}return this.length-=_e,Ve}},{key:de,value:function(pe,Ve){return ue(this,$({},Ve,{depth:0,customInspect:!1}))}}]),he}()},{buffer:17,util:16}],63:[function(r,g,V){(function(k){(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,k.nextTick(ie,this,le)):k.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?k.nextTick(oe,ue):(ue._writableState.errorEmitted=!0,k.nextTick(re,ue,he)):k.nextTick(re,ue,he):Ie?(k.nextTick(oe,ue),Ie(he)):k.nextTick(oe,ue)}),this)}function re(le,Ie){ie(le,Ie),oe(le)}function oe(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,V){var k=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 re(){}function oe(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||re);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)},ze=ie._readableState&&ie._readableState.endEmitted,pe=function(){Ie=!1,ze=!0,ue||le.call(ie)},Ve=function($e){le.call(ie,$e)},Oe=function(){var $e;if(Ie&&!ze)return(!ie._readableState||!ie._readableState.ended)&&($e=new k),le.call(ie,$e);if(ue&&!Ne)return(!ie._writableState||!ie._writableState.ended)&&($e=new k),le.call(ie,$e)},_e=function(){ie.req.on("finish",he)};return oe(ie)?(ie.on("complete",he),ie.on("abort",Oe),ie.req?_e():ie.on("request",_e)):ue&&!ie._writableState&&(ie.on("end",de),ie.on("close",de)),ie.on("end",pe),ie.on("finish",he),ae.error!==!1&&ie.on("error",Ve),ie.on("close",Oe),function(){ie.removeListener("complete",he),ie.removeListener("abort",Oe),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",pe),ie.removeListener("error",Ve),ie.removeListener("close",Oe)}}g.exports=Ce},{"../../../errors":55}],65:[function(r,g,V){g.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],66:[function(r,g,V){var k;function $(he){var ze=!1;return function(){ze||(ze=!0,he.apply(void 0,arguments))}}var re=r("../../../errors").codes,oe=re.ERR_MISSING_ARGS,Ce=re.ERR_STREAM_DESTROYED;function ie(he){if(he)throw he}function ae(he){return he.setHeader&&typeof he.abort=="function"}function le(he,ze,pe,Ve){Ve=$(Ve);var Oe=!1;he.on("close",function(){Oe=!0}),k===void 0&&(k=r("./end-of-stream")),k(he,{readable:ze,writable:pe},function(At){if(At)return Ve(At);Oe=!0,Ve()});var _e=!1;return function(At){if(!Oe&&!_e){if(_e=!0,ae(he))return he.abort();if(typeof he.destroy=="function")return he.destroy();Ve(At||new Ce("pipe"))}}}function Ie(he){he()}function ue(he,ze){return he.pipe(ze)}function de(he){return!he.length||typeof he[he.length-1]!="function"?ie:he.pop()}function Ne(){for(var he=arguments.length,ze=new Array(he),pe=0;pe<he;pe++)ze[pe]=arguments[pe];var Ve=de(ze);if(Array.isArray(ze[0])&&(ze=ze[0]),ze.length<2)throw new oe("streams");var Oe,_e=ze.map(function(At,$e){var Fe=$e<ze.length-1,Ue=$e>0;return le(At,Fe,Ue,function(xe){Oe||(Oe=xe),xe&&_e.forEach(Ie),!Fe&&(_e.forEach(Ie),Ve(Oe))})});return ze.reduce(ue)}g.exports=Ne},{"../../../errors":55,"./end-of-stream":64}],67:[function(r,g,V){var k=r("../../../errors").codes.ERR_INVALID_OPT_VALUE;function $(oe,Ce,ie){return oe.highWaterMark!=null?oe.highWaterMark:Ce?oe[ie]:null}function re(oe,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 k(Ie,le)}return Math.floor(le)}return oe.objectMode?16:16*1024}g.exports={getHighWaterMark:re}},{"../../../errors":55}],68:[function(r,g,V){g.exports=r("events").EventEmitter},{events:22}],69:[function(r,g,V){V=g.exports=r("./lib/_stream_readable.js"),V.Stream=V,V.Readable=V,V.Writable=r("./lib/_stream_writable.js"),V.Duplex=r("./lib/_stream_duplex.js"),V.Transform=r("./lib/_stream_transform.js"),V.PassThrough=r("./lib/_stream_passthrough.js"),V.finished=r("./lib/internal/streams/end-of-stream.js"),V.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,V){function k(re,oe,Ce){var ie=this;this._callback=re,this._args=Ce,this._interval=setInterval(re,oe,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 re;if(arguments.length>0){re=new Array(arguments.length-2);for(var oe=0;oe<re.length;oe++)re[oe]=arguments[oe+2]}return new k(arguments[0],arguments[1],re)}g.exports=$},{}],71:[function(r,g,V){g.exports=r("./index.js")()},{"./index.js":72}],72:[function(r,g,V){(function(k){(function(){g.exports=re;function $(Ce){return Ce instanceof k?k.from(Ce):new Ce.constructor(Ce.buffer.slice(),Ce.byteOffset,Ce.length)}function re(Ce){if(Ce=Ce||{},Ce.circles)return oe(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 ze=de[he],pe=Ie[ze];typeof pe!="object"||pe===null?Ne[ze]=pe:pe instanceof Date?Ne[ze]=new Date(pe):ArrayBuffer.isView(pe)?Ne[ze]=$(pe):Ne[ze]=ue(pe)}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 oe(Ce){var ie=[],ae=[];return Ce.proto?ue:Ie;function le(de,Ne){for(var he=Object.keys(de),ze=new Array(he.length),pe=0;pe<he.length;pe++){var Ve=he[pe],Oe=de[Ve];if(typeof Oe!="object"||Oe===null)ze[Ve]=Oe;else if(Oe instanceof Date)ze[Ve]=new Date(Oe);else if(ArrayBuffer.isView(Oe))ze[Ve]=$(Oe);else{var _e=ie.indexOf(Oe);_e!==-1?ze[Ve]=ae[_e]:ze[Ve]=Ne(Oe)}}return ze}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 ze=de[he];if(typeof ze!="object"||ze===null)Ne[he]=ze;else if(ze instanceof Date)Ne[he]=new Date(ze);else if(ze instanceof Map)Ne[he]=new Map(le(Array.from(ze),Ie));else if(ze instanceof Set)Ne[he]=new Set(le(Array.from(ze),Ie));else if(ArrayBuffer.isView(ze))Ne[he]=$(ze);else{var pe=ie.indexOf(ze);pe!==-1?Ne[he]=ae[pe]:Ne[he]=Ie(ze)}}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 ze=de[he];if(typeof ze!="object"||ze===null)Ne[he]=ze;else if(ze instanceof Date)Ne[he]=new Date(ze);else if(ze instanceof Map)Ne[he]=new Map(le(Array.from(ze),ue));else if(ze instanceof Set)Ne[he]=new Set(le(Array.from(ze),ue));else if(ArrayBuffer.isView(ze))Ne[he]=$(ze);else{var pe=ie.indexOf(ze);pe!==-1?Ne[he]=ae[pe]:Ne[he]=ue(ze)}}return ie.pop(),ae.pop(),Ne}}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],73:[function(r,g,V){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var k=r("buffer"),$=k.Buffer;function re(Ce,ie){for(var ae in Ce)ie[ae]=Ce[ae]}$.from&&$.alloc&&$.allocUnsafe&&$.allocUnsafeSlow?g.exports=k:(re(k,V),V.Buffer=oe);function oe(Ce,ie,ae){return $(Ce,ie,ae)}oe.prototype=Object.create($.prototype),re($,oe),oe.from=function(Ce,ie,ae){if(typeof Ce=="number")throw new TypeError("Argument must not be a number");return $(Ce,ie,ae)},oe.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},oe.allocUnsafe=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return $(Ce)},oe.allocUnsafeSlow=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return k.SlowBuffer(Ce)}},{buffer:17}],74:[function(r,g,V){g.exports=k;function k(re){var oe=re._readableState;return oe?oe.objectMode||typeof re._duplexState=="number"?re.read():re.read($(oe)):null}function $(re){return re.buffer.length?re.buffer.head?re.buffer.head.data.length:re.buffer[0].length:re.length}},{}],75:[function(r,g,V){var k=r("safe-buffer").Buffer,$=k.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 re(_e){if(!_e)return"utf8";for(var At;;)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(At)return;_e=(""+_e).toLowerCase(),At=!0}}function oe(_e){var At=re(_e);if(typeof At!="string"&&(k.isEncoding===$||!$(_e)))throw new Error("Unknown encoding: "+_e);return At||_e}V.StringDecoder=Ce;function Ce(_e){this.encoding=oe(_e);var At;switch(this.encoding){case"utf16le":this.text=Ne,this.end=he,At=4;break;case"utf8":this.fillLast=Ie,At=4;break;case"base64":this.text=ze,this.end=pe,At=3;break;default:this.write=Ve,this.end=Oe;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=k.allocUnsafe(At)}Ce.prototype.write=function(_e){if(_e.length===0)return"";var At,$e;if(this.lastNeed){if(At=this.fillLast(_e),At===void 0)return"";$e=this.lastNeed,this.lastNeed=0}else $e=0;return $e<_e.length?At?At+this.text(_e,$e):this.text(_e,$e):At||""},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,At,$e){var Fe=At.length-1;if(Fe<$e)return 0;var Ue=ie(At[Fe]);return Ue>=0?(Ue>0&&(_e.lastNeed=Ue-1),Ue):--Fe<$e||Ue===-2?0:(Ue=ie(At[Fe]),Ue>=0?(Ue>0&&(_e.lastNeed=Ue-2),Ue):--Fe<$e||Ue===-2?0:(Ue=ie(At[Fe]),Ue>=0?(Ue>0&&(Ue===2?Ue=0:_e.lastNeed=Ue-3),Ue):0))}function le(_e,At,$e){if((At[0]&192)!==128)return _e.lastNeed=0,"�";if(_e.lastNeed>1&&At.length>1){if((At[1]&192)!==128)return _e.lastNeed=1,"�";if(_e.lastNeed>2&&At.length>2&&(At[2]&192)!==128)return _e.lastNeed=2,"�"}}function Ie(_e){var At=this.lastTotal-this.lastNeed,$e=le(this,_e);if($e!==void 0)return $e;if(this.lastNeed<=_e.length)return _e.copy(this.lastChar,At,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_e.copy(this.lastChar,At,0,_e.length),this.lastNeed-=_e.length}function ue(_e,At){var $e=ae(this,_e,At);if(!this.lastNeed)return _e.toString("utf8",At);this.lastTotal=$e;var Fe=_e.length-($e-this.lastNeed);return _e.copy(this.lastChar,0,Fe),_e.toString("utf8",At,Fe)}function de(_e){var At=_e&&_e.length?this.write(_e):"";return this.lastNeed?At+"�":At}function Ne(_e,At){if((_e.length-At)%2===0){var $e=_e.toString("utf16le",At);if($e){var Fe=$e.charCodeAt($e.length-1);if(Fe>=55296&&Fe<=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",At,_e.length-1)}function he(_e){var At=_e&&_e.length?this.write(_e):"";if(this.lastNeed){var $e=this.lastTotal-this.lastNeed;return At+this.lastChar.toString("utf16le",0,$e)}return At}function ze(_e,At){var $e=(_e.length-At)%3;return $e===0?_e.toString("base64",At):(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",At,_e.length-$e))}function pe(_e){var At=_e&&_e.length?this.write(_e):"";return this.lastNeed?At+this.lastChar.toString("base64",0,3-this.lastNeed):At}function Ve(_e){return _e.toString(this.encoding)}function Oe(_e){return _e&&_e.length?this.write(_e):""}},{"safe-buffer":73}],76:[function(r,g,V){var k=r("punycode"),$=r("./util");V.parse=At,V.resolve=Fe,V.resolveObject=Ue,V.format=$e,V.Url=re;function re(){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 oe=/^([a-z0-9.+-]+:)/i,Ce=/:[0-9]*$/,ie=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ae=["<",">",'"',"`"," ","\r",`
1264
+ `," "],le=["{","}","|","\\","^","`"].concat(ae),Ie=["'"].concat(le),ue=["%","/","?",";","#"].concat(Ie),de=["/","?","#"],Ne=255,he=/^[+a-z0-9A-Z_-]{0,63}$/,ze=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,pe={javascript:!0,"javascript:":!0},Ve={javascript:!0,"javascript:":!0},Oe={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_e=r("querystring");function At(xe,Dt,qe){if(xe&&$.isObject(xe)&&xe instanceof re)return xe;var kt=new re;return kt.parse(xe,Dt,qe),kt}re.prototype.parse=function(xe,Dt,qe){if(!$.isString(xe))throw new TypeError("Parameter 'url' must be a string, not "+typeof xe);var kt=xe.indexOf("?"),jt=kt!==-1&&kt<xe.indexOf("#")?"?":"#",Pt=xe.split(jt),ti=/\\/g;Pt[0]=Pt[0].replace(ti,"/"),xe=Pt.join(jt);var ei=xe;if(ei=ei.trim(),!qe&&xe.split("#").length===1){var Et=ie.exec(ei);if(Et)return this.path=ei,this.href=ei,this.pathname=Et[1],Et[2]?(this.search=Et[2],Dt?this.query=_e.parse(this.search.substr(1)):this.query=this.search.substr(1)):Dt&&(this.search="",this.query={}),this}var ni=oe.exec(ei);if(ni){ni=ni[0];var ri=ni.toLowerCase();this.protocol=ri,ei=ei.substr(ni.length)}if(qe||ni||ei.match(/^\/\/[^@\/]+@[^@\/]+/)){var ci=ei.substr(0,2)==="//";ci&&!(ni&&Ve[ni])&&(ei=ei.substr(2),this.slashes=!0)}if(!Ve[ni]&&(ci||ni&&!Oe[ni])){for(var Ci=-1,li=0;li<de.length;li++){var ui=ei.indexOf(de[li]);ui!==-1&&(Ci===-1||ui<Ci)&&(Ci=ui)}var yi,Mi;Ci===-1?Mi=ei.lastIndexOf("@"):Mi=ei.lastIndexOf("@",Ci),Mi!==-1&&(yi=ei.slice(0,Mi),ei=ei.slice(Mi+1),this.auth=decodeURIComponent(yi)),Ci=-1;for(var li=0;li<ue.length;li++){var ui=ei.indexOf(ue[li]);ui!==-1&&(Ci===-1||ui<Ci)&&(Ci=ui)}Ci===-1&&(Ci=ei.length),this.host=ei.slice(0,Ci),ei=ei.slice(Ci),this.parseHost(),this.hostname=this.hostname||"";var zi=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!zi)for(var Ai=this.hostname.split(/\./),li=0,Ii=Ai.length;li<Ii;li++){var ai=Ai[li];if(ai&&!ai.match(he)){for(var pi="",Ni=0,di=ai.length;Ni<di;Ni++)ai.charCodeAt(Ni)>127?pi+="x":pi+=ai[Ni];if(!pi.match(he)){var fi=Ai.slice(0,li),vi=Ai.slice(li+1),bi=ai.match(ze);bi&&(fi.push(bi[1]),vi.unshift(bi[2])),vi.length&&(ei="/"+vi.join(".")+ei),this.hostname=fi.join(".");break}}}this.hostname.length>Ne?this.hostname="":this.hostname=this.hostname.toLowerCase(),zi||(this.hostname=k.toASCII(this.hostname));var si=this.port?":"+this.port:"",wi=this.hostname||"";this.host=wi+si,this.href+=this.host,zi&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ei[0]!=="/"&&(ei="/"+ei))}if(!pe[ri])for(var li=0,Ii=Ie.length;li<Ii;li++){var oi=Ie[li];if(ei.indexOf(oi)!==-1){var Lt=encodeURIComponent(oi);Lt===oi&&(Lt=escape(oi)),ei=ei.split(oi).join(Lt)}}var ii=ei.indexOf("#");ii!==-1&&(this.hash=ei.substr(ii),ei=ei.slice(0,ii));var gi=ei.indexOf("?");if(gi!==-1?(this.search=ei.substr(gi),this.query=ei.substr(gi+1),Dt&&(this.query=_e.parse(this.query)),ei=ei.slice(0,gi)):Dt&&(this.search="",this.query={}),ei&&(this.pathname=ei),Oe[ri]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var si=this.pathname||"",hi=this.search||"";this.path=si+hi}return this.href=this.format(),this};function $e(xe){return $.isString(xe)&&(xe=At(xe)),xe instanceof re?xe.format():re.prototype.format.call(xe)}re.prototype.format=function(){var xe=this.auth||"";xe&&(xe=encodeURIComponent(xe),xe=xe.replace(/%3A/i,":"),xe+="@");var Dt=this.protocol||"",qe=this.pathname||"",kt=this.hash||"",jt=!1,Pt="";this.host?jt=xe+this.host:this.hostname&&(jt=xe+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(jt+=":"+this.port)),this.query&&$.isObject(this.query)&&Object.keys(this.query).length&&(Pt=_e.stringify(this.query));var ti=this.search||Pt&&"?"+Pt||"";return Dt&&Dt.substr(-1)!==":"&&(Dt+=":"),this.slashes||(!Dt||Oe[Dt])&&jt!==!1?(jt="//"+(jt||""),qe&&qe.charAt(0)!=="/"&&(qe="/"+qe)):jt||(jt=""),kt&&kt.charAt(0)!=="#"&&(kt="#"+kt),ti&&ti.charAt(0)!=="?"&&(ti="?"+ti),qe=qe.replace(/[?#]/g,function(ei){return encodeURIComponent(ei)}),ti=ti.replace("#","%23"),Dt+jt+qe+ti+kt};function Fe(xe,Dt){return At(xe,!1,!0).resolve(Dt)}re.prototype.resolve=function(xe){return this.resolveObject(At(xe,!1,!0)).format()};function Ue(xe,Dt){return xe?At(xe,!1,!0).resolveObject(Dt):Dt}re.prototype.resolveObject=function(xe){if($.isString(xe)){var Dt=new re;Dt.parse(xe,!1,!0),xe=Dt}for(var qe=new re,kt=Object.keys(this),jt=0;jt<kt.length;jt++){var Pt=kt[jt];qe[Pt]=this[Pt]}if(qe.hash=xe.hash,xe.href==="")return qe.href=qe.format(),qe;if(xe.slashes&&!xe.protocol){for(var ti=Object.keys(xe),ei=0;ei<ti.length;ei++){var Et=ti[ei];Et!=="protocol"&&(qe[Et]=xe[Et])}return Oe[qe.protocol]&&qe.hostname&&!qe.pathname&&(qe.path=qe.pathname="/"),qe.href=qe.format(),qe}if(xe.protocol&&xe.protocol!==qe.protocol){if(!Oe[xe.protocol]){for(var ni=Object.keys(xe),ri=0;ri<ni.length;ri++){var ci=ni[ri];qe[ci]=xe[ci]}return qe.href=qe.format(),qe}if(qe.protocol=xe.protocol,!xe.host&&!Ve[xe.protocol]){for(var Ii=(xe.pathname||"").split("/");Ii.length&&!(xe.host=Ii.shift()););xe.host||(xe.host=""),xe.hostname||(xe.hostname=""),Ii[0]!==""&&Ii.unshift(""),Ii.length<2&&Ii.unshift(""),qe.pathname=Ii.join("/")}else qe.pathname=xe.pathname;if(qe.search=xe.search,qe.query=xe.query,qe.host=xe.host||"",qe.auth=xe.auth,qe.hostname=xe.hostname||xe.host,qe.port=xe.port,qe.pathname||qe.search){var Ci=qe.pathname||"",li=qe.search||"";qe.path=Ci+li}return qe.slashes=qe.slashes||xe.slashes,qe.href=qe.format(),qe}var ui=qe.pathname&&qe.pathname.charAt(0)==="/",yi=xe.host||xe.pathname&&xe.pathname.charAt(0)==="/",Mi=yi||ui||qe.host&&xe.pathname,zi=Mi,Ai=qe.pathname&&qe.pathname.split("/")||[],Ii=xe.pathname&&xe.pathname.split("/")||[],ai=qe.protocol&&!Oe[qe.protocol];if(ai&&(qe.hostname="",qe.port=null,qe.host&&(Ai[0]===""?Ai[0]=qe.host:Ai.unshift(qe.host)),qe.host="",xe.protocol&&(xe.hostname=null,xe.port=null,xe.host&&(Ii[0]===""?Ii[0]=xe.host:Ii.unshift(xe.host)),xe.host=null),Mi=Mi&&(Ii[0]===""||Ai[0]==="")),yi)qe.host=xe.host||xe.host===""?xe.host:qe.host,qe.hostname=xe.hostname||xe.hostname===""?xe.hostname:qe.hostname,qe.search=xe.search,qe.query=xe.query,Ai=Ii;else if(Ii.length)Ai||(Ai=[]),Ai.pop(),Ai=Ai.concat(Ii),qe.search=xe.search,qe.query=xe.query;else if(!$.isNullOrUndefined(xe.search)){if(ai){qe.hostname=qe.host=Ai.shift();var pi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;pi&&(qe.auth=pi.shift(),qe.host=qe.hostname=pi.shift())}return qe.search=xe.search,qe.query=xe.query,(!$.isNull(qe.pathname)||!$.isNull(qe.search))&&(qe.path=(qe.pathname?qe.pathname:"")+(qe.search?qe.search:"")),qe.href=qe.format(),qe}if(!Ai.length)return qe.pathname=null,qe.search?qe.path="/"+qe.search:qe.path=null,qe.href=qe.format(),qe;for(var Ni=Ai.slice(-1)[0],di=(qe.host||xe.host||Ai.length>1)&&(Ni==="."||Ni==="..")||Ni==="",fi=0,vi=Ai.length;vi>=0;vi--)Ni=Ai[vi],Ni==="."?Ai.splice(vi,1):Ni===".."?(Ai.splice(vi,1),fi++):fi&&(Ai.splice(vi,1),fi--);if(!Mi&&!zi)for(;fi--;fi)Ai.unshift("..");Mi&&Ai[0]!==""&&(!Ai[0]||Ai[0].charAt(0)!=="/")&&Ai.unshift(""),di&&Ai.join("/").substr(-1)!=="/"&&Ai.push("");var bi=Ai[0]===""||Ai[0]&&Ai[0].charAt(0)==="/";if(ai){qe.hostname=qe.host=bi?"":Ai.length?Ai.shift():"";var pi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;pi&&(qe.auth=pi.shift(),qe.host=qe.hostname=pi.shift())}return Mi=Mi||qe.host&&Ai.length,Mi&&!bi&&Ai.unshift(""),Ai.length?qe.pathname=Ai.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=xe.auth||qe.auth,qe.slashes=qe.slashes||xe.slashes,qe.href=qe.format(),qe},re.prototype.parseHost=function(){var xe=this.host,Dt=Ce.exec(xe);Dt&&(Dt=Dt[0],Dt!==":"&&(this.port=Dt.substr(1)),xe=xe.substr(0,xe.length-Dt.length)),xe&&(this.hostname=xe)}},{"./util":77,punycode:51,querystring:54}],77:[function(r,g,V){g.exports={isString:function(k){return typeof k=="string"},isObject:function(k){return typeof k=="object"&&k!==null},isNull:function(k){return k===null},isNullOrUndefined:function(k){return k==null}}},{}],78:[function(r,g,V){(function(k){(function(){g.exports=$;function $(oe,Ce){if(re("noDeprecation"))return oe;var ie=!1;function ae(){if(!ie){if(re("throwDeprecation"))throw new Error(Ce);re("traceDeprecation")?console.trace(Ce):console.warn(Ce),ie=!0}return oe.apply(this,arguments)}return ae}function re(oe){try{if(!k.localStorage)return!1}catch{return!1}var Ce=k.localStorage[oe];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,V){g.exports=k;function k($,re){if($&&re)return k($)(re);if(typeof $!="function")throw new TypeError("need wrapper function");return Object.keys($).forEach(function(Ce){oe[Ce]=$[Ce]}),oe;function oe(){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,V){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,V){g.exports=$;var k=Object.prototype.hasOwnProperty;function $(){for(var re={},oe=0;oe<arguments.length;oe++){var Ce=arguments[oe];for(var ie in Ce)k.call(Ce,ie)&&(re[ie]=Ce[ie])}return re}},{}],82:[function(r,g,V){g.exports=function(k){k.prototype[Symbol.iterator]=function*(){for(let $=this.head;$;$=$.next)yield $.value}}},{}],83:[function(r,g,V){g.exports=k,k.Node=Ce,k.create=k;function k(ie){var ae=this;if(ae instanceof k||(ae=new k),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}k.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},k.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++}},k.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++}},k.prototype.push=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)re(this,arguments[ie]);return this.length},k.prototype.unshift=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)oe(this,arguments[ie]);return this.length},k.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}},k.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}},k.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},k.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},k.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},k.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},k.prototype.map=function(ie,ae){ae=ae||this;for(var le=new k,Ie=this.head;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.next;return le},k.prototype.mapReverse=function(ie,ae){ae=ae||this;for(var le=new k,Ie=this.tail;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.prev;return le},k.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},k.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},k.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},k.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},k.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 k;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},k.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 k;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},k.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},k.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 re(ie,ae){ie.tail=new Ce(ae,ie.tail,null,ie),ie.head||(ie.head=ie.tail),ie.length++}function oe(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")(k)}catch{}},{"./iterator.js":82}]},{},[12])(12)})})(mqtt);var mqttExports=mqtt.exports;let client;const sub=(i,n,r,g,V)=>{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",V)},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:"svg-viewer",props:{data:{},canvasDrag:{type:Boolean,default:!0}},emits:["onMessage"],setup(i,{expose:n,emit:r}){const g=i;vue.useCssVars(he=>({eb9e007c:vue.unref($)})),setEditorLoadTime();const V=useGlobalStore(pinia);componentsRegister();const k=vue.reactive(g.data??{layout_center:{x:0,y:0},config:{svg:{background_color:"#fff",scale:1,grid_color:"#ebebeb"},net:{mqtt:{url:"",user:"",pwd:"",topics:""}}},done_json:[]}),$=vue.computed(()=>V.intention==EGlobalStoreIntention.MoveCanvas?"grab":"default"),re=he=>{if(V.mouse_info.state!=EMouseInfoState.Down&&V.intention!==EGlobalStoreIntention.Connection||!g.canvasDrag)return;const{clientX:ze,clientY:pe}=he;V.mouse_info.new_position_x=V.mouse_info.now_position_x+ze-V.mouse_info.position_x,V.mouse_info.new_position_y=V.mouse_info.now_position_y+pe-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.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})},Ce=he=>{const{clientX:ze,clientY:pe}=he;V.intention=EGlobalStoreIntention.MoveCanvas,V.mouse_info={state:EMouseInfoState.Down,position_x:ze,position_y:pe,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}};function ie(he){he!=null&&he.wheelDelta&&(he.wheelDelta>0?k.config.svg.scale=parseFloat((k.config.svg.scale+.1).toFixed(1)):k.config.svg.scale=parseFloat((k.config.svg.scale-.1).toFixed(1)))}const ae=(he,ze,pe)=>({x:he.x-he.width/2*ze+he.width/2,y:he.y-he.height/2*pe+he.height/2,width:he.width*ze,height:he.height*pe}),le=he=>{var pe;let ze=!1;if(((pe=he.events)==null?void 0:pe.length)>0){for(let Ve of he.events)if(Ve.type===EEventType.Click){ze=!0;break}}return{cursor:ze?"pointer":"default"}},Ie=(he,ze)=>{var pe;if(console.log(he.events,ze),((pe=he.events)==null?void 0:pe.length)>0){for(let Ve of he.events)if(Ve.type===ze){if(Ve.condition&&Ve.condition.type!=="None"&&Ve.condition.type==="Relation"&&Ve.condition.Relation&&Ve.condition.Relation.relation){const Oe=Ve.condition.Relation.key,_e=Ve.condition.Relation.relation,At=valFormat(Ve.condition.Relation.val),$e=valFormat(Ve.condition.Relation.val2);if(he.props.hasOwnProperty(Oe)){const Fe=he.props[Oe].val;if(!ue(Fe,_e,At,$e))continue}}if(Ve.action===EEventAction.ChangeAttr){if(Ve.attrs&&Ve.attrs.length>0){let Oe;if(Ve.target){for(let _e of k.done_json)if(_e.id===Ve.target){Oe=_e;break}}else Oe=he;if(!Oe)continue;for(let _e of Ve.attrs)_e.key==="state"?Oe.defaultState=valFormat(_e.val):Oe.props.hasOwnProperty(_e.key)&&(Oe.props[_e.key].val=valFormat(_e.val))}}else Ve.action===EEventAction.JavaScript&&new Function(Ve.scripts)()}}},ue=(he,ze,pe,Ve)=>{switch(ze){case">":return he>pe;case">=":return he>=pe;case"<":return he<pe;case"<=":return he<=pe;case"==":return he==pe;case"!=":return he!=pe;case">=,=<":return he>=pe&&he<=Ve;case"<,>":return he<pe||he>Ve}},de=()=>{const he=k.config.net.mqtt;he&&he.url&&he.user&&he.pwd&&he.topics&&sub(he.url,he.user,he.pwd,he.topics,(ze,pe)=>{console.log(ze),console.log(pe.toString()),r("onMessage",{topics:ze,message:pe})})},Ne=(he,ze,pe)=>setArrItemByID(he,ze,pe,k.done_json);return vue.onMounted(()=>{de()}),vue.onBeforeUnmount(close),n({setNodeAttrByID:Ne}),(he,ze)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",onMousedown:Ce,onMousemove:re,onMouseup:oe,onMousewheel:ie,onContextmenu:ze[4]||(ze[4]=(...pe)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...pe))},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(k).config.svg.background_color}),width:"100%",height:"100%"},[vue.createElementVNode("g",{transform:`translate(${vue.unref(k).layout_center.x},${vue.unref(k).layout_center.y})rotate(0)scale(${vue.unref(k).config.svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(k).done_json,pe=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:pe.id,transform:`translate(${pe.x},${pe.y})rotate(0)scale(1)`,style:vue.normalizeStyle(le(pe)),onClick:Ve=>Ie(pe,vue.unref(EEventType).Click),onMousedown:ze[0]||(ze[0]=(...Ve)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...Ve)),onMousemove:ze[1]||(ze[1]=(...Ve)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...Ve)),onMouseup:ze[2]||(ze[2]=(...Ve)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...Ve)),onMousewheel:ze[3]||(ze[3]=(...Ve)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...Ve))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(pe)}`)},[vue.createElementVNode("g",{transform:`translate(${pe.actual_bound.x+pe.actual_bound.width/2},${pe.actual_bound.y+pe.actual_bound.height/2})rotate(${pe.rotate}) scale(1) translate(${-(pe.actual_bound.x+pe.actual_bound.width/2)},${-(pe.actual_bound.y+pe.actual_bound.height/2)})`},[pe.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$e,{key:0,"item-info":pe},null,8,["item-info"])):pe.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${pe.name}`},vue.unref(prosToVBind)(pe),{width:"100",height:"100",id:pe.id,transform:`translate(${pe.actual_bound.x+pe.actual_bound.width/2},${pe.actual_bound.y+pe.actual_bound.height/2}) scale(${pe.scale_x},${pe.scale_y}) translate(${-(pe.actual_bound.x+pe.actual_bound.width/2)},${-(pe.actual_bound.y+pe.actual_bound.height/2)})`}),null,16,_hoisted_4)):pe.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(pe.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(pe),{width:"100",height:"100",id:pe.id,onOnChange:Ve=>Ie(pe,vue.unref(EEventType).Change),transform:`translate(${pe.actual_bound.x+pe.actual_bound.width/2},${pe.actual_bound.y+pe.actual_bound.height/2}) scale(${pe.scale_x},${pe.scale_y}) translate(${-(pe.actual_bound.x+pe.actual_bound.width/2)},${-(pe.actual_bound.y+pe.actual_bound.height/2)})`}),null,16,["id","onOnChange","transform"])):pe.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},ae(pe.actual_bound,pe.scale_x,pe.scale_y),{id:`foreign-object${pe.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(pe.tag),vue.mergeProps(vue.unref(prosToVBind)(pe),{id:pe.id,onOnChange:Ve=>Ie(pe,vue.unref(EEventType).Change),transform:`translate(${pe.actual_bound.x+pe.actual_bound.width/2},${pe.actual_bound.y+pe.actual_bound.height/2}) scale(${pe.scale_x},${pe.scale_y}) translate(${-(pe.actual_bound.x+pe.actual_bound.width/2)},${-(pe.actual_bound.y+pe.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(pe.tag_slot),1)]),_:2},1040,["id","onOnChange","transform"]))],16,_hoisted_5)):vue.createCommentVNode("",!0)],8,_hoisted_3)],2)],44,_hoisted_2)),[[vue.vShow,pe.display]])),128))],8,_hoisted_1)],4))],32))}}),svgViewer_vue_vue_type_style_index_0_scoped_7cd79a96_lang="",svgViewer=_export_sfc(_sfc_main,[["__scopeId","data-v-7cd79a96"]]);exports.SvgEditor=index,exports.SvgViewer=svgViewer,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});